/* Admin panel simplification: new components only (status chips, row menus, sub-tabs,
   grouped navigation, customer record header, save bar, Home). LiveTV+ Blue tokens
   come from livetv-theme.css, which is loaded just before this file. */

/* ---- Status chips (invoices, overdue, roles) ---- */
html body .status-chip{display:inline-flex;align-items:center;gap:4px;padding:2px 9px;border-radius:999px;font-size:11.5px;font-weight:700;line-height:1.5;white-space:nowrap;background:var(--lt-card-hi);color:var(--lt-text)}
html body .status-chip.tone-good{background:#5ee3a126;color:var(--lt-good)}
html body .status-chip.tone-warn{background:#ffcc6626;color:var(--lt-warn)}
html body .status-chip.tone-bad{background:#ff8a8030;color:#ffb4ad}
html body .status-chip.tone-muted{background:#ffffff14;color:var(--lt-text2)}

/* ---- Row "⋯" menu ---- */
html body .row-menu{position:relative;display:inline-block}
html body .row-menu>summary{list-style:none;cursor:pointer;display:inline-grid;place-items:center;min-width:32px;min-height:32px;border-radius:999px;background:var(--lt-card-hi);font-weight:800;letter-spacing:1px}
html body .row-menu>summary::-webkit-details-marker{display:none}
html body .row-menu[open]>summary{background:var(--lt-focus);color:var(--lt-on-focus)}
html body .row-menu-items{position:absolute;right:0;top:calc(100% + 4px);z-index:30;display:grid;gap:2px;min-width:150px;padding:6px;background:var(--lt-surface);border:1px solid var(--lt-line);border-radius:12px;box-shadow:0 10px 24px #0006}
html body .row-menu-items button,html body .row-menu-items a{justify-content:flex-start;text-align:left;width:100%;background:transparent!important;border-radius:8px!important}
html body .row-menu-items button:hover,html body .row-menu-items a:hover{background:var(--lt-card-hi)!important}
html body .customer-compact-list tbody tr{cursor:pointer}
html body .customer-compact-list tbody tr:hover td{background:#ffffff0a}

/* ---- Chips and sub-tabs (one filter system, tabs instead of selects) ---- */
html body .filter-chips,html body .admin-subtabs{display:flex;gap:6px;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;padding:2px 0 8px;margin:4px 0 8px;-webkit-overflow-scrolling:touch}
html body .filter-chips::-webkit-scrollbar,html body .admin-subtabs::-webkit-scrollbar{display:none}
html body .filter-chips>button,html body .admin-subtabs>button,html body .admin-subtabs>a{flex:0 0 auto;white-space:nowrap}
html body .admin-subtabs{border-bottom:1px solid var(--lt-line)}
html body .admin-subtabs>a{display:inline-flex;align-items:center;min-height:32px;padding:5px 13px;border-radius:999px;color:var(--lt-text2);text-decoration:none;font-weight:600}
html body .admin-subtabs>a:hover{background:var(--lt-card-hi);color:var(--lt-text)}
html body .admin-subtabs>a[aria-current=page]{background:var(--lt-focus)!important;color:var(--lt-on-focus)!important}
html body .hint-details{margin:4px 0 10px}
html body .hint-details>summary{cursor:pointer;color:var(--lt-text2);font-size:12px}
html body .link-button{display:inline!important;background:transparent!important;color:var(--lt-accent)!important;padding:0!important;min-height:0!important;text-decoration:underline}
html body .invoice-actions{flex-wrap:wrap}

/* ---- Customer record: sticky header + six tabs ---- */
html body .record-head{display:block;position:sticky;top:0;z-index:20;background:linear-gradient(180deg,#14299ef5,#0e2185f5);backdrop-filter:blur(8px);border:1px solid var(--lt-line);border-radius:14px;padding:8px 12px 0;margin:0 0 10px;box-shadow:0 6px 18px #0004}
html body .record-head-row{display:flex;justify-content:space-between;align-items:center;gap:8px}
html body .record-head-actions{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}
html body .record-head-main{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:2px}
html body .record-head-main h2{margin:0;font-size:19px;line-height:1.25;overflow-wrap:anywhere}
html body .record-head-meta{display:flex;flex-wrap:wrap;gap:2px 14px;margin:3px 0 4px;font-size:12.5px;color:var(--lt-text2)}
html body .record-due-late{color:#ffb4ad!important;font-weight:700}
html body .record-tabs{display:flex;gap:4px;overflow-x:auto;scrollbar-width:none;padding:4px 0 8px;-webkit-overflow-scrolling:touch}
html body .record-tabs::-webkit-scrollbar{display:none}
html body .record-tabs>button{flex:0 0 auto}
html body .record-subtabs{margin-top:0}
html body .danger-zone{border:1px solid #ff8a8055!important;background:#ff8a800d!important}
html body .account-page .account-section-heading{display:none}
html body .record-tabs>button[aria-current=page],html body .record-tabs>button[aria-current=page]:hover,html body .admin-subtabs>button[aria-pressed=true]:hover,html body .filter-chips>button[aria-pressed=true]:hover{background:var(--lt-focus)!important;color:var(--lt-on-focus)!important}
html body .record-back{white-space:nowrap;text-decoration:none!important;font-weight:700}
@media (max-width:600px){
 html body .record-head{padding:6px 10px 0;border-radius:12px}
 html body .record-head-row{align-items:flex-start}
 html body .record-head-actions{gap:4px}
 html body .record-head-actions>button{padding:4px 10px!important;min-height:30px!important;font-size:12px}
 html body .record-head-main h2{font-size:17px}
}
html body .account-page .section-head>h2,html body .account-page .section-head>h3{margin-right:auto}

/* ---- Header: brand · seven areas · search · user menu ---- */
html body.has-user-menu #logout{display:none!important}
/* The blurred header creates a stacking context; lift that parent above page tabs. */
html body>header{position:relative;z-index:100}
html body #admin-navigation{display:flex;align-items:center;gap:8px;min-width:0}
html body #admin-navigation .billing-tabs>a{display:inline-flex;align-items:center;gap:6px;text-decoration:none;white-space:nowrap}
html body #admin-navigation .billing-tabs>a[aria-current=page]{background:var(--lt-focus)!important;color:var(--lt-on-focus)!important}
html body .user-menu{position:relative;margin-left:auto;flex:0 0 auto}
html body .user-menu>summary{list-style:none;cursor:pointer;display:flex;align-items:center;gap:6px;padding:3px 10px 3px 3px;border-radius:999px;background:var(--lt-card-hi);font-weight:600;min-height:32px;white-space:nowrap}
html body .user-menu>summary::-webkit-details-marker{display:none}
html body .user-menu-avatar{display:grid!important;place-items:center;width:26px;height:26px;border-radius:50%;background:var(--lt-focus);color:var(--lt-on-focus)!important;font-weight:800;font-size:12px}
html body .user-menu-items{position:absolute;right:0;top:calc(100% + 6px);z-index:80;display:grid;gap:2px;min-width:220px;padding:6px;background:var(--lt-surface);border:1px solid var(--lt-line);border-radius:12px;box-shadow:0 12px 28px #0007}
html body .user-menu-items a,html body .user-menu-items button{display:block;width:100%;text-align:left;padding:9px 12px!important;border-radius:8px!important;background:transparent!important;color:var(--lt-text)!important;text-decoration:none;font-weight:600}
html body .user-menu-items a:hover,html body .user-menu-items button:hover{background:var(--lt-card-hi)!important}
html body .section-subtabs{margin:0 0 12px}
html body .profile-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,340px),1fr));gap:12px}
@media (min-width:1000px){
 html body>header{flex-wrap:nowrap!important;padding:8px 20px!important;gap:14px!important}
 html body #admin-navigation{flex:1 1 auto}
 html body #admin-navigation .billing-navigation .billing-tabs{flex-wrap:nowrap;padding:0}
 html body .universal-search-trigger{order:3}
}
/* Phones and small tablets: one slim bar (logo · search · menu · you). */
@media (max-width:999px){
 html body>header{flex-wrap:nowrap!important;align-items:center!important;padding:6px 12px!important;min-height:52px!important;gap:6px!important}
 html body>header>div:first-child>span{display:none!important}
 html body #admin-navigation{order:2!important;flex:0 1 auto!important;flex-basis:auto!important;margin-left:auto}
 html body #admin-navigation .billing-navigation{position:static;background:transparent!important;border:0!important;margin:0}
 html body #admin-navigation .billing-navigation>summary{min-height:34px!important;padding:3px 12px!important;border-radius:999px!important;gap:6px!important}
 html body #admin-navigation .billing-navigation>summary>span:first-child{font-size:0}
 html body #admin-navigation .billing-navigation>summary>span:first-child::before{content:'☰';font-size:16px}
 html body #admin-navigation .billing-navigation>summary strong{margin-left:0!important;font-size:13px!important}
 html body #admin-navigation .billing-navigation[open]>nav{position:absolute;left:8px;right:8px;top:calc(100% + 4px);z-index:90;display:grid!important;gap:2px;padding:6px!important;background:var(--lt-surface)!important;border:1px solid var(--lt-line);border-radius:14px;box-shadow:0 14px 30px #0008}
 html body #admin-navigation .billing-navigation[open]>nav>a{justify-content:flex-start;padding:10px 14px!important;min-height:40px!important}
 html body .user-menu{margin-left:0}
 html body .user-menu-name,html body .user-menu>summary>span[aria-hidden]:last-child{display:none!important}
 html body .user-menu>summary{padding:3px!important}
 html body .universal-search-trigger{order:1;margin-left:auto;font-size:0!important;width:36px;min-height:36px!important;padding:0!important;border-radius:999px!important;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6'/%3E%3Cpath d='M15 15l5 5'/%3E%3C/svg%3E")!important;background-repeat:no-repeat!important;background-position:center!important;background-size:18px!important}
 html body .user-menu-items{right:-4px}
}

/* ---- Home: needs attention first ---- */
html body .needs-attention{margin:0 0 14px}
html body .needs-attention>h2{margin:0 0 8px;font-size:16px}
html body .attention-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,190px),1fr));gap:10px}
html body .attention-tile{display:grid!important;justify-items:start;gap:2px;text-align:left;padding:12px 14px!important;border-radius:14px!important;min-height:86px;background:var(--lt-card)!important;border:1px solid var(--lt-line)!important}
html body .attention-tile strong{font-size:24px;line-height:1.1}
html body .attention-tile span{font-weight:600;color:var(--lt-text)}
html body .attention-tile small{color:var(--lt-text2)}
html body .attention-tile.has-items{border-color:#ffcc6680!important;background:#ffcc6612!important}
html body .attention-tile.has-items small{color:var(--lt-warn)}
html body .attention-tile.is-clear strong{color:var(--lt-text2)}
html body .network-health{margin-top:14px;border:1px solid var(--lt-line);border-radius:14px;background:var(--lt-card)}
html body .network-health>summary{cursor:pointer;padding:12px 14px;font-weight:700;list-style:none;display:flex;gap:10px;align-items:baseline;flex-wrap:wrap}
html body .network-health>summary small{font-weight:400;color:var(--lt-text2)}
html body .network-health>.dashboard-widget-grid{padding:0 12px 12px}

/* ---- Services: one Save bar ---- */
html body .svc-savebar{position:sticky;bottom:10px;z-index:40;display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-top:12px;padding:10px 14px;border-radius:14px;background:#0a1450f2;border:1px solid var(--lt-accent);box-shadow:0 10px 26px #0008;backdrop-filter:blur(8px)}
html body .svc-savebar[hidden]{display:none!important}
html body .svc-savebar>p{margin:0;font-weight:600;color:var(--lt-text)!important}
html body .svc-savebar-actions{display:flex;gap:8px;margin-left:auto}
html body .svc-overdue{display:block;color:#ffb4ad!important;font-weight:700}
html body .svc-lines .svc-line{display:flex;justify-content:space-between;gap:10px;margin:4px 0}

/* ---- Money: payments filters ---- */
html body .payment-filters{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,170px),1fr));gap:8px 12px;align-items:end;margin:6px 0 12px;padding:10px 12px;border:1px solid var(--lt-line);border-radius:12px;background:var(--lt-card)}
html body .payment-filters .billing-actions{grid-column:1/-1;display:flex;gap:8px;flex-wrap:wrap}
html body .payment-filters [role=status]{grid-column:1/-1;margin:0}
html body [data-billing-content]>.section-head{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
html body [data-billing-content]>.section-head>h2{margin:0 auto 0 0}

/* ---- Ticket view with customer context ---- */
html body dialog.ticket-dialog{max-width:min(1040px,96vw)!important;width:min(1040px,96vw)}
html body .ticket-layout{display:grid;grid-template-columns:minmax(0,1fr) 280px;gap:14px;align-items:start}
html body .ticket-context{position:sticky;top:0;padding:12px;border:1px solid var(--lt-line);border-radius:12px;background:var(--lt-card)}
html body .ticket-context h3{margin:0 0 2px}
html body .ticket-context-facts{display:grid;grid-template-columns:auto 1fr;gap:4px 10px;margin:8px 0;font-size:12.5px}
html body .ticket-context-facts dt{color:var(--lt-text2)}
html body .ticket-context-facts dd{margin:0}
html body .ticket-answer-quick{display:flex;flex-wrap:wrap;gap:6px;margin:4px 0 8px}
html body .ticket-answer-quick button{font-size:12px;padding:4px 10px!important;min-height:28px!important}
@media (max-width:760px){html body .ticket-layout{grid-template-columns:1fr}html body .ticket-context{position:static}}
html body .ticket-answer-picker{display:grid!important;grid-template-columns:minmax(0,1fr) auto;gap:6px 10px;align-items:end}
html body .ticket-answer-picker>.ticket-answer-search,html body .ticket-answer-picker>.ticket-answer-quick,html body .ticket-answer-picker>p{grid-column:1/-1}
html body .ticket-answer-picker>label{display:grid;gap:4px;min-width:0}
html body .ticket-answer-quick button{width:auto!important;flex:0 0 auto;text-align:left}

/* ---- New customer wizard ---- */
html body .wizard-steps{display:flex;gap:6px;flex-wrap:wrap;list-style:none;padding:0;margin:0 0 10px}
html body .wizard-steps li{padding:3px 10px;border-radius:999px;background:var(--lt-card);color:var(--lt-text2);font-size:12px;font-weight:600}
html body .wizard-steps li[aria-current=step]{background:var(--lt-focus);color:var(--lt-on-focus)}
html body .wizard-actions{justify-content:flex-end}
html body .permission-areas{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr));gap:10px}
html body .permission-area{border:1px solid var(--lt-line);border-radius:12px;padding:8px 12px;margin:0}
html body .permission-area>legend{font-weight:700;padding:0 6px}

/* ---- Phones: filters behind a button, compact list chrome ---- */
html body .filters-toggle{display:none}
html body .filters-panel>summary{cursor:pointer;font-weight:700;padding:6px 0;list-style:none;display:inline-flex;align-items:center;gap:6px}
@media (max-width:700px){
 html body .customer-list-toolbar.admin-filters{display:flex!important;flex-wrap:wrap;gap:8px!important;align-items:center}
 html body .customer-list-toolbar.admin-filters>label:not(.channel-search){display:none!important}
 html body .customer-list-toolbar.admin-filters.show-filters>label{display:grid!important;flex:1 1 45%}
 html body .customer-list-toolbar.admin-filters>.channel-search{flex:1 1 100%}
 html body .customer-list-toolbar.admin-filters .filters-toggle{display:inline-flex;width:auto!important;flex:0 0 auto}
 html body .customer-list-toolbar.admin-filters [data-create]{width:auto!important;flex:0 0 auto}
 html body .customer-bulk-bar>small{display:none}
 html body .customer-bulk-bar{gap:6px!important;flex-wrap:wrap}
 html body .customer-bulk-bar button{padding:4px 10px!important;font-size:12px}
}
