:root { --ink:#171713; --paper:#f4f1e9; --surface:#fffdf8; --muted:#6d6c63; --accent:#c86e3a; --green:#406128; --line:rgba(23,23,19,.14); font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; color:var(--ink); background:var(--paper); }
* { box-sizing:border-box; }
body { margin:0; background:var(--paper); color:var(--ink); }
a { color:inherit; }
button,input,select,textarea { font:inherit; }
.portal-header { width:min(1160px,calc(100% - 32px)); min-height:76px; margin:auto; display:flex; justify-content:space-between; align-items:center; gap:20px; }
.portal-brand { display:flex; align-items:center; gap:10px; text-decoration:none; font-weight:800; }
.portal-brand img { width:36px; height:36px; border-radius:11px; }
.header-actions { display:flex; align-items:center; gap:18px; }
.header-actions > a { color:var(--muted); font-size:.88rem; text-decoration:none; }
.header-actions > a:hover { color:var(--ink); }
.portal-main { width:min(1160px,calc(100% - 32px)); margin:32px auto 90px; }
.link-button { padding:0; border:0; background:none; color:var(--muted); cursor:pointer; }
.kicker { margin:0 0 10px; color:#9f4e23; font-size:.74rem; font-weight:850; letter-spacing:.14em; text-transform:uppercase; }
h1,h2,h3,p { margin-top:0; }
h1,h2 { font-family:Georgia,"Times New Roman",serif; font-weight:500; letter-spacing:-.04em; }
h1 { margin-bottom:14px; font-size:clamp(2.6rem,6vw,5rem); line-height:.96; }
h2 { font-size:2rem; }
.login-card,.editor-card,.info-card,.table-card,.client-card,.preview-card,.payment-card,.link-card { border:1px solid var(--line); border-radius:24px; background:var(--surface); box-shadow:0 20px 55px rgba(35,31,23,.08); }
.login-card { max-width:480px; margin:9vh auto; padding:42px; }
.login-card > p:not(.kicker),.editor-card > p,.client-card p { color:var(--muted); line-height:1.6; }
.stack-form { display:grid; gap:20px; margin-top:28px; }
.two-columns { display:grid; grid-template-columns:1fr 1fr; gap:18px; }
label { display:grid; gap:8px; font-size:.84rem; font-weight:760; }
input,select,textarea { width:100%; padding:13px 14px; border:1px solid var(--line); border-radius:11px; background:white; outline:none; }
textarea { resize:vertical; line-height:1.55; }
input:focus,select:focus,textarea:focus { border-color:var(--accent); box-shadow:0 0 0 3px rgba(200,110,58,.13); }
.primary-button,.secondary-button,.danger-button { min-height:46px; padding:0 18px; border:1px solid transparent; border-radius:999px; display:inline-flex; align-items:center; justify-content:center; text-decoration:none; font-weight:800; cursor:pointer; }
.primary-button { background:var(--ink); color:white; }
.secondary-button { border-color:var(--line); background:white; color:var(--ink); }
.danger-button { border-color:#d8a59c; background:#fff0ed; color:#822d20; }
.admin-heading { margin-bottom:28px; display:flex; justify-content:space-between; align-items:end; gap:24px; }
.admin-heading h1 { margin-bottom:0; }
.heading-copy { max-width:720px; margin:10px 0 0; color:var(--muted); line-height:1.55; }
.table-card { overflow:hidden; }
table { width:100%; border-collapse:collapse; }
th,td { padding:17px 20px; border-bottom:1px solid var(--line); text-align:left; vertical-align:middle; }
th { color:var(--muted); font-size:.7rem; letter-spacing:.1em; text-transform:uppercase; }
td { font-size:.9rem; }
td small { display:block; margin-top:4px; color:var(--muted); }
.status { display:inline-flex; padding:7px 10px; border-radius:999px; background:#e9e6de; font-size:.72rem; font-weight:780; }
.status-paid { background:#e7f0da; color:var(--green); }
.status-ready,.status-payment_pending { background:#fff0df; color:#8d4b19; }
.status-revoked { background:#f1dddd; color:#842d2d; }
.empty { padding:45px; text-align:center; color:var(--muted); }
.back-link { display:inline-block; margin-bottom:25px; color:var(--muted); text-decoration:none; }
.editor-card { padding:clamp(28px,5vw,52px); }
.settings-card { max-width:900px; margin:0 auto; }
.settings-card + .settings-card { margin-top:24px; }
.settings-card > p { max-width:720px; }
.settings-section { padding:28px 0; border-top:1px solid var(--line); }
.settings-section:first-of-type { border-top:0; }
.settings-section > div:first-child p { color:var(--muted); line-height:1.55; }
.settings-section h2 { margin-bottom:8px; }
.watermark-settings { display:grid; gap:18px; }
.watermark-settings > img { width:min(100%,520px); padding:18px; border-radius:16px; background:#171713; }
.editor-card.compact { margin-top:24px; }
.video-upload { padding:22px; border:1px dashed rgba(23,23,19,.28); border-radius:16px; background:#f7f4ec; }
.video-upload small { color:var(--muted); font-weight:500; }
.detail-heading p { margin-bottom:0; color:var(--muted); }
.detail-grid { margin-top:24px; display:grid; grid-template-columns:1fr 1fr; gap:24px; }
.info-card { padding:30px; }
dl { display:grid; grid-template-columns:120px 1fr; gap:13px; }
dt { color:var(--muted); font-size:.8rem; }
dd { margin:0; }
.file-rows { padding:0; list-style:none; }
.file-rows li { padding:10px 0; border-bottom:1px solid var(--line); }
.file-rows small { float:right; color:var(--muted); }
.button-row { display:flex; flex-wrap:wrap; gap:10px; }
.notice { margin:18px 0; padding:15px 18px; border-radius:12px; line-height:1.5; }
.notice.error { background:#fff0ed; color:#822d20; }
.notice.success { background:#eaf2dd; color:#3f5c27; }
.notice.info { background:#edf0f4; color:#405069; }
.link-card { margin-bottom:24px; padding:30px; background:#edf4dc; }
.link-card input { margin:8px 0 14px; }
.client-body { background:#ede9df; }
.client-hero { max-width:760px; margin:7vh auto 34px; text-align:center; }
.client-hero p:last-child { color:var(--muted); }
.preview-card { overflow:hidden; background:#141411; }
.preview-card video { display:block; width:100%; max-height:70vh; background:black; }
.preview-copy { padding:17px 22px; display:flex; justify-content:space-between; gap:24px; color:white; }
.preview-copy span { font-weight:800; }
.preview-copy p { margin:0; color:rgba(255,255,255,.62); font-size:.8rem; }
.payment-card { margin-top:22px; padding:30px; display:flex; justify-content:space-between; align-items:center; gap:30px; }
.payment-card p { margin-bottom:0; color:var(--muted); }
.client-price { font-family:Georgia,serif; font-size:4rem; color:var(--accent); }
.payment-action { display:grid; justify-items:end; gap:9px; }
.payment-action form { max-width:520px; }
.terms-check { margin-bottom:16px; display:flex; align-items:flex-start; gap:10px; color:var(--muted); font-size:.78rem; font-weight:500; line-height:1.55; }
.terms-check input,.consent input { width:18px; height:18px; margin:2px 0 0; flex:0 0 auto; accent-color:var(--accent); }
.consent { display:flex; align-items:flex-start; gap:10px; color:var(--muted); font-weight:500; line-height:1.5; }
.client-secondary-action { margin:26px 0; text-align:center; color:var(--muted); }
.status-card { margin:0 auto; }
.customer-orders { display:grid; gap:14px; }
.customer-order { padding:22px 24px; border:1px solid var(--line); border-radius:18px; background:var(--surface); display:flex; justify-content:space-between; align-items:center; gap:20px; }
.customer-order span,.customer-order p { color:var(--muted); font-size:.8rem; }
.customer-order h3,.customer-order p { margin:5px 0 0; }
.order-list { padding:0; list-style:none; }
.order-list li { padding:14px 0; border-bottom:1px solid var(--line); display:flex; justify-content:space-between; gap:18px; }
.order-list span { color:var(--muted); font-size:.82rem; }
.payment-action small { color:var(--muted); }
.bank-transfer-card { display:block; }
.bank-transfer-card .payment-summary { margin-bottom:26px; }
.bank-transfer { display:grid; grid-template-columns:minmax(220px,320px) minmax(0,1fr); gap:30px; align-items:start; }
.bank-transfer > img { width:100%; height:auto; padding:12px; border:1px solid var(--line); border-radius:18px; background:white; }
.bank-details { display:grid; gap:13px; }
.bank-details > p { margin:0 0 5px; color:var(--text); }
.bank-details label { gap:6px; }
.bank-details input[readonly] { background:#f7f4ec; font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:.92rem; }
.bank-details small { color:var(--muted); line-height:1.55; }
.client-card { max-width:700px; margin:12vh auto; padding:45px; text-align:center; }
.inbox-count { padding:9px 13px; border-radius:999px; background:#e7f0da; color:var(--green); font-size:.78rem; font-weight:800; white-space:nowrap; }
.mailbox-card,.mail-detail-card,.mail-replies { border:1px solid var(--line); border-radius:24px; background:var(--surface); box-shadow:0 20px 55px rgba(35,31,23,.08); overflow:hidden; }
.mail-row { min-height:70px; padding:16px 20px; border-bottom:1px solid var(--line); display:grid; grid-template-columns:10px minmax(170px,1fr) minmax(240px,2fr) auto; align-items:center; gap:15px; text-decoration:none; }
.mail-row:last-child { border-bottom:0; }
.mail-row:hover { background:#f8f4eb; }
.mail-row.unread { background:#fffaf0; font-weight:760; }
.mail-state { width:8px; height:8px; border-radius:50%; background:#d0cec6; }
.mail-row.unread .mail-state { background:var(--accent); box-shadow:0 0 0 4px rgba(200,110,58,.13); }
.mail-sender,.mail-subject { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.mail-subject { color:var(--muted); }
.mail-row time,.mail-detail-heading time,.sent-reply time { color:var(--muted); font-size:.78rem; white-space:nowrap; }
.mail-detail-card { padding:clamp(26px,5vw,52px); }
.mail-detail-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:24px; }
.mail-detail-heading h1 { max-width:820px; font-size:clamp(2.2rem,5vw,4.4rem); overflow-wrap:anywhere; }
.mail-meta { max-width:820px; margin:26px 0; padding:20px 0; border-top:1px solid var(--line); border-bottom:1px solid var(--line); }
.mail-meta dd { overflow-wrap:anywhere; }
.mail-body,.sent-reply pre { margin:0; padding:22px; border-radius:14px; background:#f7f4ec; white-space:pre-wrap; overflow-wrap:anywhere; font:500 .92rem/1.7 Inter,ui-sans-serif,system-ui,sans-serif; }
.mail-attachments { margin-top:30px; }
.mail-attachments h2,.mail-replies h2 { font-size:1.65rem; }
.mail-replies { margin-top:24px; padding:30px; }
.sent-reply + .sent-reply { margin-top:18px; }
.sent-reply > div { margin-bottom:10px; display:flex; justify-content:space-between; gap:20px; }
.reply-card > p:not(.kicker) { max-width:760px; color:var(--muted); line-height:1.55; }
.mail-nav { margin:-8px 0 34px; padding:7px; border:1px solid var(--line); border-radius:18px; display:flex; gap:4px; overflow-x:auto; background:rgba(255,253,248,.72); box-shadow:0 12px 35px rgba(35,31,23,.05); }
.mail-nav a { padding:10px 13px; border-radius:12px; color:var(--muted); font-size:.78rem; font-weight:760; text-decoration:none; white-space:nowrap; }
.mail-nav a:hover,.mail-nav a[aria-current="page"] { background:var(--ink); color:white; }
.mail-stat-grid { margin-bottom:22px; display:grid; grid-template-columns:repeat(6,1fr); gap:12px; }
.mail-metric { min-height:120px; padding:20px; border:1px solid var(--line); border-radius:18px; display:flex; flex-direction:column; justify-content:space-between; background:var(--surface); text-decoration:none; }
.mail-metric:hover { border-color:rgba(200,110,58,.55); transform:translateY(-1px); }
.mail-metric strong { font-family:Georgia,serif; font-size:2.5rem; font-weight:500; }
.mail-metric span { color:var(--muted); font-size:.78rem; font-weight:760; }
.mail-quick-grid { margin-bottom:38px; display:grid; grid-template-columns:repeat(3,1fr); gap:14px; }
.mail-quick-card { padding:22px; border-radius:18px; background:var(--ink); color:white; display:grid; gap:7px; text-decoration:none; }
.mail-quick-card span { color:rgba(255,255,255,.66); font-size:.82rem; line-height:1.5; }
.section-heading { margin:34px 0 14px; display:flex; justify-content:space-between; align-items:end; gap:20px; }
.section-heading h2 { margin:0; }
.section-heading > a,.section-heading > span { color:var(--muted); font-size:.82rem; }
.mail-filter { margin-bottom:16px; padding:12px; border:1px solid var(--line); border-radius:16px; display:grid; grid-template-columns:minmax(220px,1fr) 190px auto auto; gap:10px; background:var(--surface); }
.mail-filter input,.mail-filter select { min-width:0; }
.mail-row.outbound .mail-state { background:#929087; }
.mail-row.outbound .state-delivered { background:var(--green); }
.mail-row.outbound .state-bounced,.mail-row.outbound .state-complained,.mail-row.outbound .state-failed { background:#a83c2a; }
.mail-row.outbound .state-queued,.mail-row.outbound .state-sending,.mail-row.outbound .state-delayed { background:#d88b2f; }
.mail-subject small { color:#9a988f; }
.mail-compose-card { max-width:900px; margin:0 auto; }
.template-shortcuts { margin:20px 0 0; padding:14px; border-radius:13px; display:flex; flex-wrap:wrap; gap:9px; align-items:center; background:#f0ede5; }
.template-shortcuts span { color:var(--muted); font-size:.8rem; }
.template-shortcuts a { padding:6px 10px; border-radius:999px; background:white; font-size:.78rem; text-decoration:none; }
.existing-attachments { padding:16px; border-radius:13px; background:#f7f4ec; }
.existing-attachments ul { margin:9px 0 0; padding-left:18px; }
.existing-attachments small { color:var(--muted); }
button:disabled { opacity:.48; cursor:not-allowed; }
.mail-status-delivered { background:#e7f0da; color:var(--green); }
.mail-status-bounced,.mail-status-complained,.mail-status-failed { background:#f1dddd; color:#842d2d; }
.mail-status-queued,.mail-status-sending,.mail-status-delayed { background:#fff0df; color:#8d4b19; }
.mail-detail-actions { margin-top:28px; }
.mail-detail-actions form { margin:0; }
.mail-two-column { display:grid; grid-template-columns:minmax(0,1.15fr) minmax(340px,.85fr); gap:24px; align-items:start; }
.template-list { display:grid; gap:12px; }
.template-card { padding:20px; border:1px solid var(--line); border-radius:18px; background:var(--surface); }
.template-card summary { display:flex; justify-content:space-between; align-items:center; gap:15px; cursor:pointer; }
.template-card summary span { display:grid; gap:4px; }
.template-card summary small { color:var(--muted); }
.template-card summary a { font-size:.8rem; }
.template-card > form:last-child { margin-top:12px; }
.primary-button.small,.secondary-button.small,.danger-button.small { min-height:34px; padding:0 12px; font-size:.72rem; }
.agent-layout { display:grid; grid-template-columns:minmax(360px,.8fr) minmax(0,1.2fr); gap:24px; align-items:start; }
.agent-layout > .editor-card { padding:32px; }
.agent-job-list { display:grid; gap:12px; }
.agent-job-card { padding:20px; border:1px solid var(--line); border-radius:18px; background:var(--surface); display:grid; gap:16px; }
.agent-job-card h3 { margin:12px 0 6px; font-size:1rem; }
.agent-job-card p,.agent-job-card small { color:var(--muted); line-height:1.5; }
.agent-message-preview { margin-top:.7rem; }
.agent-message-preview summary { color:var(--accent); cursor:pointer; font-weight:700; }
.agent-message-preview strong { display:block; margin-top:.65rem; }
.agent-message-preview pre { margin:.45rem 0 0; max-width:36rem; overflow:auto; white-space:pre-wrap; word-break:break-word; }
.agent-lead-actions { display:grid; gap:.55rem; min-width:12rem; }
.agent-status-running,.agent-status-candidate { background:#fff0df; color:#8d4b19; }
.agent-status-active,.agent-status-sent,.agent-status-queued { background:#e7f0da; color:var(--green); }
.agent-status-paused,.agent-status-rejected { background:#e9e6de; color:#66645c; }
.warning-consent { padding:15px; border-radius:13px; background:#fff5e8; color:#6d461e; }
code { font-size:.75rem; white-space:pre-wrap; overflow-wrap:anywhere; }
@media(max-width:760px){.portal-main{margin-top:18px}.admin-heading,.payment-card,.preview-copy,.mail-detail-heading{align-items:stretch;flex-direction:column}.two-columns,.detail-grid,.bank-transfer{grid-template-columns:1fr}.bank-transfer>img{max-width:320px;margin:0 auto}.table-card{overflow-x:auto}table{min-width:760px}.payment-action{justify-items:stretch}.payment-action .primary-button{width:100%}.login-card{padding:28px}.file-rows small{float:none;display:block;margin-top:3px}.portal-header{align-items:flex-start;padding-top:18px}.header-actions{max-width:210px;align-items:flex-end;justify-content:flex-end;flex-direction:row;flex-wrap:wrap;gap:8px 14px}.mail-row{grid-template-columns:10px 1fr auto}.mail-subject{grid-column:2/4}.mail-row time{grid-column:3;grid-row:1}.mail-detail-card{padding:26px 20px}.mail-meta{grid-template-columns:92px 1fr}.sent-reply>div{flex-direction:column;gap:4px}}
@media(max-width:980px){.mail-stat-grid{grid-template-columns:repeat(3,1fr)}.mail-two-column,.agent-layout{grid-template-columns:1fr}.mail-filter{grid-template-columns:1fr 170px auto}.mail-filter .secondary-button:last-child{grid-column:1/-1}.mail-quick-grid{grid-template-columns:1fr}}
@media(max-width:620px){.mail-stat-grid{grid-template-columns:repeat(2,1fr)}.mail-filter{grid-template-columns:1fr}.mail-filter .secondary-button:last-child{grid-column:auto}.mail-nav{margin-left:-16px;margin-right:-16px;border-radius:0;border-left:0;border-right:0}.mail-metric{min-height:100px}.mail-row.outbound{grid-template-columns:10px 1fr}.mail-row.outbound time{grid-column:2}.mail-row.outbound .mail-subject{grid-column:2}.section-heading{align-items:flex-start;flex-direction:column}}
