/* Design polish, stage 1 (loaded last). */
/* Compact page header: more room for the work itself. */
.topbar { min-height: 0; padding: 14px 22px; margin-bottom: 18px; border-bottom-width: 2px; }
.topbar h1 { font-size: 26px; }
.workspace-intro, .topbar .workspace-intro { margin-top: 2px; font-size: 14px; font-weight: 500; }
/* Sidebar: profile as one quiet line, logout and mode switch as smaller secondary buttons, no motion toggle. */
.sidebar .whoami { background: #ffffff14; color: #fff; border: 1px solid #ffffff2b; font-weight: 600; padding: 10px 12px; }
.sidebar .sidebar-logout { min-height: 40px; font-size: 14px; }
.sidebar #logoutBtn { background: transparent; color: #dbe8ff; border-color: #ffffff40; }
.sidebar #logoutBtn:hover { background: #ffffff18; color: #fff; }
.sidebar .motion-control { display: none; }
.sidebar .nav-list a[data-retired] { display: none !important; }
/* KPI cards fill the row instead of leaving an empty half. */
.dash-kpis { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important; }
/* Mode picker never overflows a phone screen. */
.mode-cards { grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
.mode-box { width: min(760px, 100%); }
@media (max-width: 560px) { .topbar { padding: 12px 16px; } .topbar h1 { font-size: 22px; } }
/* CRM: empty status columns stay narrow so every column fits; phone numbers stand out. */
#crmList .crm-lane-empty { flex: 0 0 150px; opacity: .8; }
#crmList .crm-lane-empty h3 { font-size: 14px; }
.crm-lane .crm-item .crm-phone { font-variant-numeric: tabular-nums; font-weight: 700; color: #003796; letter-spacing: .2px; }
@media (max-width: 700px) { #crmList .crm-lane-empty { flex: 0 0 140px; } }
/* CRM lead card: a side panel instead of a block far below the board. */
#crmDetail { display: none; }
#crmDetail.open { display: grid; position: fixed; z-index: 70; top: 16px; right: 16px; bottom: 16px; width: min(440px, calc(100vw - 32px)); margin: 0; overflow-y: auto; align-content: start; padding: 22px 22px 28px; box-shadow: -18px 0 50px #10284933; border-color: #d4e0ee; animation: crm-panel-in .22s ease-out; }
#crmDetail.open:focus { outline: none; }
.crm-detail-close { position: absolute; top: 12px; right: 12px; width: 38px; height: 38px; min-height: 38px; padding: 0; border-radius: 11px; font-size: 24px; line-height: 1; }
#crmDetail header { padding-right: 46px; }
#crmDetail .crm-status { display: flex; flex-wrap: wrap; gap: 8px; }
#crmDetail .crm-status button[aria-pressed=true] { background: var(--primary); color: #fff; border-color: var(--primary); }
#crmDetail .crm-contact .primary-btn { display: inline-flex; justify-content: center; width: 100%; padding: 12px; font-size: 16px; }
@keyframes crm-panel-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
body.motion-off #crmDetail.open { animation: none; }
@media (max-width: 700px) { #crmDetail.open { inset: 0; width: auto; border-radius: 0; } }
/* Direct and comments: white cards; unanswered ones marked with a blue edge and label. */
.inbox-threads button { background: #fff !important; color: #17263a !important; border: 1px solid #dbe5f1 !important; border-left: 4px solid #dbe5f1 !important; text-align: left; }
.inbox-threads button.is-unanswered { border-left-color: #2f6fe0 !important; }
.inbox-threads button.is-answered { opacity: .82; }
.inbox-threads button[aria-pressed=true] { background: #eef5ff !important; border-color: #9cbcf0 !important; border-left-color: #003796 !important; opacity: 1; }
.inbox-threads button b { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inbox-platform { width: 16px; height: 16px; flex: 0 0 16px; }
.inbox-state { margin-left: auto; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 700; color: #1d4fb8; background: #e6efff; }
.inbox-state.done { color: #216949; background: #e5f4ec; }
.inbox-count { font-size: 13px; font-weight: 600; color: #1d4fb8; margin-left: 8px; }
.inbox-column h3 { display: flex; align-items: baseline; flex-wrap: wrap; }
/* Video Studio: the form in three numbered steps. */
.studio-step { display: grid; gap: 14px; margin: 0 0 16px; padding: 18px 18px 20px; border: 1px solid #dce6f1; border-radius: 18px; background: #f9fbff; min-width: 0; }
.studio-step legend { display: flex; align-items: center; gap: 10px; padding: 0 8px; font-size: 16px; font-weight: 700; color: #17365d; }
.studio-step legend span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 14px; }
.studio-step .studio-fields { margin: 0; }
.studio-checks { display: grid; gap: 10px; }
.studio-checks .reference-consent { display: flex; align-items: flex-start; gap: 12px; margin: 0; padding: 12px 14px; border: 1px solid #dce6f1; border-radius: 14px; background: #fff; font-size: 15px; font-weight: 700; }
.studio-checks .reference-consent input { width: 20px; height: 20px; flex: 0 0 20px; margin-top: 2px; }
.studio-checks .reference-consent span { display: grid; gap: 2px; }
.studio-checks .reference-consent small { font-weight: 500; font-size: 13px; }
#referenceApply { width: 100%; min-height: 52px; font-size: 16px; }
#studioEmptyPreview { display: grid; place-content: center; gap: 6px; text-align: center; padding: 24px; color: #34445a; }
#studioEmptyPreview[hidden] { display: none; }
#studioEmptyPreview b { font-size: 16px; color: #17365d; }
/* Metric tiles (Reklama, CRM tahlili): labels reserve two lines so every number sits on the same row. */
.dash-insights > div { display: grid; grid-template-rows: minmax(2.9em, auto) auto 1fr; align-content: start; gap: 6px; }
.dash-insights > div > span { line-height: 1.45; align-self: start; }
.dash-insights > div > strong { margin: 0; align-self: end; }
/* Destructive actions look destructive. */
.danger-btn, button.danger-btn { color: var(--danger); background: #fdeef0; border-color: #f2c4cb; }
.danger-btn:hover, button.danger-btn:hover { color: #fff; background: var(--danger); border-color: var(--danger); }
/* Fields inside the studio steps never overflow on a phone. */
.studio-step label, .studio-step .studio-fields > * { min-width: 0; }
.studio-step input, .studio-step select, .studio-step textarea { max-width: 100%; min-width: 0; box-sizing: border-box; }
@media (max-width: 700px) { .studio-step .studio-fields { grid-template-columns: minmax(0, 1fr); } .studio-step { padding: 14px 12px 16px; } }
/* Direct: drop the empty gap left by hidden helper blocks above the columns. */
#audienceNotice:empty, #audienceChannels:empty { display: none; }
