/* =====================================================================
   Maseefak — admin panel refresh (Nov 2026)
   Loaded last. Scoped to the admin view except the label-case rule.
   ===================================================================== */

/* Site-wide: labels keep their own case (no forced capitals) */
.eyebrow{text-transform:none;letter-spacing:.02em}

/* ---------- canvas ---------- */
.admin-view{--a-text:#22332d;--a-muted:#5d7169;--a-line:#e2e8e2;--a-bg:#f6f8f5;--a-hover:#e8f0ea}
.admin-view,.admin-view main,.admin-view .admin-section{background:var(--a-bg)}
.admin-view .site-header{background:#fffffff2}


/* ---------- sidebar (desktop) ---------- */
.admin-view .admin-sidebar{top:calc(var(--hdr,105px) + 18px)}
.admin-view .admin-sidebar>.eyebrow{font-size:11px;color:var(--a-muted);margin-bottom:6px}
.admin-view .admin-sidebar h2{font-size:20px;margin-bottom:18px;color:var(--a-text)}
.admin-view .admin-sidebar nav{gap:3px}
.admin-view .admin-sidebar nav a{font-size:14px;font-weight:500;color:#3c5149;padding:10px 12px;border-radius:10px;gap:11px;transition:background .15s,color .15s}
.admin-view .admin-sidebar nav a>.icon{width:18px;height:18px;color:#71897f}
.admin-view .admin-sidebar nav a:hover:not(.active){background:var(--a-hover);color:var(--teal)}
.admin-view .admin-sidebar nav a.active{background:var(--teal);color:#fff;font-weight:600;box-shadow:0 4px 14px rgba(20,102,108,.18)}
.admin-view .admin-sidebar nav a.active>.icon{color:#fff}
.admin-view .sidebar-note{margin-top:22px;padding:14px;border-radius:12px}
.admin-view .sidebar-note p{font-size:12px;line-height:1.8}

/* ---------- page heading ---------- */
.admin-view .admin-heading{align-items:flex-end;margin-bottom:22px;padding-top:4px}
.admin-view .admin-heading .eyebrow{font-size:11px;color:var(--a-muted);margin-bottom:6px}
.admin-view .admin-heading h1{font-size:28px;line-height:1.35;color:var(--a-text)}
.admin-view .admin-heading p{font-size:14px;line-height:1.8;color:var(--a-muted);margin-top:6px;max-width:64ch}
.admin-view .admin-heading>.btn,.admin-view .heading-actions .btn{font-size:13px;min-height:42px;padding:9px 16px;gap:7px}
.admin-view .heading-actions{gap:8px}

/* ---------- readable type everywhere in the workspace ---------- */
#admin-content{font-size:14px;color:var(--a-text)}
#admin-content p{font-size:13.5px;line-height:1.85}
#admin-content small{font-size:12px}
#admin-content label{font-size:13px}
#admin-content :is(input,select,textarea){font-size:14px}
#admin-content .btn{font-size:13px;min-height:40px}
#admin-content .btn.small,#admin-content .bot-make-btn,#admin-content .bot-room-new{font-size:12.5px;min-height:34px}
#admin-content h2{line-height:1.45}
#admin-content .notice{font-size:13px;line-height:1.8}
/* AI answers are long: give them reading size */
#admin-content .chat-bubble{font-size:14px}
#admin-content .chat-bubble>p{font-size:15px;line-height:1.95;color:#2b3d37}
#admin-content .bubble-label{font-size:11px}
#admin-content .chat-disclosure,#admin-content .bubble-images-note{font-size:12px}
#admin-content .adv-strip{font-size:11.5px}

/* cards share one quiet look */
.admin-view :is(.dashboard-panel,.admin-unit,.knowledge-summary,.upload-panel,.knowledge-files>article,.bot-workspace,.chat-panel,.bot-card,.bot-new){border-color:var(--a-line)}
.admin-view :is(.dashboard-panel,.admin-unit,.knowledge-summary,.upload-panel,.knowledge-files>article,.bot-workspace){box-shadow:0 1px 2px rgba(25,50,44,.04)}
.admin-view .bot-card:hover{box-shadow:0 2px 10px rgba(25,50,44,.06)}

/* knowledge files: long file names wrap instead of pushing the page sideways */
.knowledge-files>article>span{min-width:0}
.knowledge-files strong{overflow-wrap:anywhere}

/* ---------- phone / tablet ---------- */
@media (max-width:900px){
 .admin-view .admin-heading{flex-direction:column;align-items:stretch;gap:12px;margin-bottom:16px}
 .admin-view .admin-heading h1{font-size:23px}
 .admin-view .admin-heading p{font-size:13px}
 .admin-view .heading-actions{display:flex;flex-wrap:wrap}
 .admin-view .heading-actions .btn,.admin-view .admin-heading>.btn{flex:1 1 auto;justify-content:center}
 .admin-view .admin-sidebar nav{gap:6px;padding:2px 0 8px;scrollbar-width:none}
 .admin-view .admin-sidebar nav::-webkit-scrollbar{display:none}
 .admin-view .admin-sidebar nav a{font-size:13px;padding:8px 13px;gap:7px;border:1px solid var(--a-line);background:#fff;border-radius:999px;box-shadow:none}
 .admin-view .admin-sidebar nav a>.icon{width:16px;height:16px}
 .admin-view .admin-sidebar nav a.active{border-color:var(--teal)}
}
@media (max-width:820px){
 /* 16px stops iPhone Safari from zooming in when a field is tapped */
 #admin-content :is(input,select,textarea){font-size:16px}
 #admin-content .bot-toolbar label{font-size:0}
 #admin-content .chat-bubble>p{font-size:15px}
}
@media (max-width:640px){
 .knowledge-files>article{flex-wrap:wrap;padding:12px 14px;gap:10px}
}

/* units list */
#admin-content .admin-unit small{font-size:12px}
#admin-content .admin-unit div>span{font-size:12.5px}
#admin-content .admin-unit>.status{font-size:11.5px}
@media (max-width:640px){
 .admin-view .admin-unit>img{width:72px;height:72px}
 .admin-view .admin-unit>div{flex:1 1 calc(100% - 92px)}
 .admin-view .admin-unit>.status{margin-inline-start:0}
 .admin-view .admin-unit>.icon-btn:first-of-type{margin-inline-start:auto}
 .admin-view .admin-unit>.icon-btn{height:38px;width:38px}
}
/* sidebar items stay on one line */
@media (min-width:901px){.admin-view .admin-sidebar nav a{white-space:nowrap;font-size:13.5px}}
@media (min-width:901px) and (max-width:1180px){.admin-view .admin-sidebar nav a{font-size:12.5px;padding:9px 10px;gap:8px}}
@media (max-width:1300px){.chat-disclosure .kbd-hint{display:none}}

/* ================= desktop pass 2 ================= */
/* keyboard focus is always visible */
.admin-view :is(a,button,input,select,textarea,summary):focus-visible{outline:2px solid var(--teal);outline-offset:2px}

/* slimmer top bar in the workspace = more room for the work */
@media (min-width:901px){
 .admin-view .site-header .nav{height:76px;min-height:0}
 .admin-view .brand.brand-wordmark>img{width:150px}
}

/* overview: numbers first, compact, and each one opens its section */
.admin-view .stats-grid{margin-bottom:18px}
.admin-view .stats-grid .stat-card{position:relative;display:grid;grid-template-columns:auto 1fr;grid-template-rows:auto auto;align-items:center;column-gap:14px;row-gap:2px;padding:16px 18px;min-height:0;transition:border-color .15s,box-shadow .15s,transform .15s}
.admin-view .stats-grid .stat-card>.icon{grid-row:1 / span 2;width:40px;height:40px;padding:10px;border-radius:12px;background:var(--mint);color:var(--teal);margin:0}
.admin-view .stats-grid .stat-card>strong{font-size:26px;line-height:1.1;margin:0}
.admin-view .stats-grid .stat-card>span{font-size:13px;color:var(--a-muted);margin:0}
.admin-view .stats-grid .stat-card:hover{border-color:#b8ccc4;box-shadow:0 6px 18px rgba(25,50,44,.07);transform:translateY(-1px)}
.stat-link{position:absolute;inset:0;border-radius:inherit}
.admin-view .brief{margin-bottom:18px}
.admin-view .brief-list .btn{gap:6px;white-space:nowrap}
.admin-view .brief-list .btn .icon{width:14px;height:14px}
.admin-view .agent-promo h2{font-size:24px;line-height:1.45}

/* agents: task cards line their buttons up */
.admin-view .tk-card .btn{align-self:flex-start;margin-top:auto}
.admin-view .tk-card dl{font-size:13px}
.admin-view .tk-card dt{font-size:12px}

/* long lists: show the latest few */
#tk-log.is-collapsed>*:nth-child(n+6),#tk-log .tk-log.is-collapsed>*:nth-child(n+6){display:none}
.usage-table-wrap.is-collapsed tbody tr:nth-child(n+21){display:none}
.list-more{margin:12px auto 0;display:flex}

/* usage log table: readable and compact */
.admin-view .usage-history table{font-size:13px}
.admin-view .usage-history th{font-size:12px;padding:11px 10px;position:sticky;top:0;background:#fff;z-index:1}
.admin-view .usage-history td{padding:11px 10px}
.admin-view .usage-history td b{font-size:13px}
.admin-view .usage-history td small{font-size:12px;color:var(--a-muted)}
.admin-view .usage-history tbody tr:hover{background:#f7faf8}

/* settings: the save button stays reachable; two columns on wide screens */
.admin-view form[data-settings]>button[type=submit]{position:sticky;bottom:14px;z-index:5;box-shadow:0 8px 24px rgba(20,102,108,.25)}
.admin-view .settings-panel label{font-size:13px}
.admin-view .settings-panel>p{font-size:13px;line-height:1.8}
@media (min-width:1280px){
 .admin-view form[data-settings]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;align-items:start}
 .admin-view form[data-settings]>.settings-panel{margin:0}
 .admin-view form[data-settings]>.form-error,.admin-view form[data-settings]>button[type=submit]{grid-column:1 / -1;justify-self:start}
}

/* unit editor: title and save stay in view while scrolling a long form */
.editor-modal .modal-head{position:sticky;top:-30px;z-index:3;background:#fff;padding:12px 0;margin-top:-12px}
.editor-modal .modal-actions{position:sticky;bottom:-30px;z-index:3;background:#fff;padding:14px 0 16px;margin-bottom:-16px;border-top:1px solid var(--a-line,#e2e8e2)}
@media (max-width:900px){.editor-modal .modal-head{top:-22px}.editor-modal .modal-actions{bottom:-22px}}

/* section shortcuts on long pages (desktop) */
.page-jump{position:sticky;top:calc(var(--hdr,90px) + 8px);z-index:20;display:flex;gap:6px;overflow-x:auto;scrollbar-width:none;padding:8px;margin:-6px 0 20px;background:#ffffffe8;backdrop-filter:blur(10px);border:1px solid var(--a-line,#e2e8e2);border-radius:14px;box-shadow:0 4px 16px rgba(25,50,44,.06)}
.page-jump::-webkit-scrollbar{display:none}
.page-jump button{flex:0 0 auto;border:0;background:none;color:#4a5f57;font:500 13px 'Alexandria',Arial;padding:8px 14px;border-radius:10px;cursor:pointer;white-space:nowrap}
.page-jump button:hover{background:var(--a-hover,#e8f0ea);color:var(--teal)}
.page-jump button.active{background:var(--teal);color:#fff}
/* unit editor: photo order controls big enough to hit */
.editor-images article>div{gap:6px}
.editor-images article>div button{min-width:34px;height:34px;font-size:15px;border-radius:9px}
.editor-images article{padding-bottom:42px}
@media (max-width:640px){
 .admin-view .stats-grid .stat-card{grid-template-columns:1fr;row-gap:6px;padding:14px}
 .admin-view .stats-grid .stat-card>.icon{grid-row:auto;width:34px;height:34px;padding:8px}
 .admin-view .stats-grid .stat-card>strong{font-size:22px}
}
