.admin-body { min-height: 100vh; background: #f4f7fb; }
.admin-shell { display: grid; min-height: 100vh; grid-template-columns: 258px 1fr; }
.admin-sidebar { position: sticky; top: 0; display: flex; flex-direction: column; height: 100dvh; padding: 25px 18px 18px; color: #b7c4d7; background: #0a1020; }
.admin-sidebar .brand { padding: 0 9px 24px; }
.admin-sidebar .brand strong { color: #fff; }
.admin-sidebar .brand small { color: #71829d; }
.admin-sidebar nav { display: flex; flex: 1; min-height: 0; overflow-y: auto; flex-direction: column; gap: 3px; margin-top: 14px; padding-right: 5px; scrollbar-width: thin; scrollbar-color: #344561 transparent; }
.admin-sidebar nav a { display: flex; align-items: center; gap: 11px; padding: 11px 13px; border-radius: 10px; color: #9eacc1; font-size: .86rem; font-weight: 650; }
.admin-sidebar nav a:hover, .admin-sidebar nav a.active { color: #fff; background: #152440; }
.admin-sidebar nav a span { width: 7px; height: 7px; border: 1px solid #5f718f; border-radius: 50%; }
.admin-sidebar nav a.active span { border-color: #6ee7d6; background: #14b8a6; box-shadow: 0 0 0 4px rgba(20,184,166,.12); }
.admin-sidebar-bottom { padding: 17px 8px 0; border-top: 1px solid #24314a; }
.admin-sidebar-bottom a, .admin-sidebar-bottom button { display: block; width: 100%; padding: 8px 5px; border: 0; color: #8292aa; background: transparent; text-align: left; font-size: .78rem; }
.admin-sidebar-bottom a:hover, .admin-sidebar-bottom button:hover { color: #fff; }
.admin-main { min-width: 0; }
.admin-topbar { display: flex; min-height: 68px; align-items: center; justify-content: space-between; gap: 20px; padding: 0 32px; border-bottom: 1px solid #e2e8f0; background: #fff; }
.admin-topbar div { display: grid; }
.admin-topbar span { color: #64748b; font-size: .62rem; font-weight: 800; letter-spacing: .1em; }
.admin-topbar strong { font-size: .9rem; }
.admin-topbar em { padding: 7px 10px; border-radius: 9px; color: #126956; background: #e9fbf6; font-size: .72rem; font-style: normal; font-weight: 750; }
.admin-topbar .topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-actions > a { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid #dce6f3; border-radius: 9px; color: #475569; font-size: .72rem; font-weight: 800; }
.topbar-actions > a b, .nav-badge { display: inline-grid; min-width: 20px; height: 20px; place-items: center; padding-inline: 5px; border-radius: 999px; color: #fff; background: #ef4444; font-size: .62rem; }
.admin-sidebar nav a .nav-badge { margin-left: auto; }
.admin-content { width: min(calc(100% - 54px), 1240px); margin: 0 auto; padding: 34px 0 50px; }
.admin-content[aria-busy="true"] { opacity: .65; pointer-events: none; transition: opacity .16s ease; }
.admin-heading { margin-bottom: 25px; }
.admin-heading > span { color: #2563eb; font-size: .66rem; font-weight: 850; letter-spacing: .12em; }
.admin-heading h1 { margin-top: 5px; font-size: 2rem; }
.admin-heading p { margin: 5px 0 0; color: #64748b; }
.admin-alert { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; padding: 14px 16px; border: 1px solid #bfd6fb; border-radius: 12px; color: #234f91; background: #eff6ff; font-size: .82rem; }
.admin-alert strong { min-width: max-content; }
.admin-alert span { flex: 1; }
.admin-alert a { color: #1d4ed8; font-weight: 750; }
.admin-alert.warning { border-color: #f3d69a; color: #7c5709; background: #fff9e9; }
.admin-alert.success { border-color: #b8eadf; color: #176654; background: #effcf8; }
.admin-alert.error { border-color: #fecaca; color: #991b1b; background: #fef2f2; }
.admin-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; }
.admin-metrics article, .admin-card { border: 1px solid #e2e8f0; border-radius: 15px; background: #fff; box-shadow: 0 9px 30px rgba(15,23,42,.035); }
.admin-metrics article { display: grid; padding: 21px; }
.admin-metrics article > span { color: #64748b; font-size: .63rem; font-weight: 850; letter-spacing: .08em; }
.admin-metrics article > strong { margin: 7px 0 2px; font-size: 1.8rem; line-height: 1.1; }
.admin-metrics article > small { color: #64748b; font-size: .72rem; }
.admin-grid { display: grid; grid-template-columns: 1.35fr .65fr; gap: 16px; margin-top: 17px; }
.admin-card { padding: 24px; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.card-title div { display: grid; }
.card-title span { color: #64748b; font-size: .62rem; font-weight: 850; letter-spacing: .08em; }
.card-title h2, .admin-card > h2 { margin-top: 3px; font-size: 1.08rem; }
.card-title a { color: #2563eb; font-size: .76rem; font-weight: 750; }
.empty-state { display: grid; min-height: 185px; place-content: center; gap: 5px; border: 1px dashed #cbd5e1; border-radius: 12px; color: #64748b; text-align: center; }
.empty-state strong { color: #334155; }
.empty-state span { font-size: .8rem; }
.admin-list { display: grid; }
.admin-list > div { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 13px 0; border-bottom: 1px solid #edf0f5; }
.admin-list > div:last-child { border-bottom: 0; }
.admin-list span { display: grid; }
.admin-list strong { font-size: .85rem; }
.admin-list small, .admin-list em { color: #64748b; font-size: .72rem; font-style: normal; }
.release-summary { margin: 14px 0 20px; }
.release-summary > div { display: grid; gap: 2px; padding: 11px 0; border-bottom: 1px solid #edf0f5; }
.release-summary dt { color: #64748b; font-size: .67rem; font-weight: 750; }
.release-summary dd { margin: 0; overflow-wrap: anywhere; font-size: .82rem; }
.release-summary .hash-value { font-family: ui-monospace, "Cascadia Mono", monospace; font-size: .67rem; }
.admin-form { display: grid; gap: 19px; }
.admin-form label { font-size: .8rem; }
.admin-form input, .admin-form textarea, .admin-form select { min-height: 44px; font-size: .86rem; }
.form-section { display: grid; gap: 16px; padding-bottom: 23px; border-bottom: 1px solid #e2e8f0; }
.form-section h2 { font-size: 1.08rem; }
.admin-form .button { justify-self: start; }
.admin-note { display: flex; gap: 14px; padding: 14px 16px; border: 1px solid #cfe0fb; border-radius: 11px; color: #334155; background: #f2f7ff; font-size: .8rem; }
.admin-note strong { min-width: max-content; color: #1d4ed8; }
.plan-editor-head, .plan-editor-row { display: grid; grid-template-columns: 1.1fr .65fr 1fr .8fr 65px; align-items: center; gap: 12px; }
.plan-editor-head { padding: 0 10px; color: #64748b; font-size: .63rem; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.plan-editor-row { padding: 12px 10px; border: 1px solid #e2e8f0; border-radius: 11px; }
.plan-editor-row strong { font-size: .85rem; }
.plan-editor-row input { min-height: 40px; }
.switch { position: relative; display: block; width: 44px; height: 24px; }
.switch input { position: absolute; opacity: 0; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #cbd5e1; cursor: pointer; transition: .2s ease; }
.switch span::after { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(15,23,42,.18); content: ""; transition: .2s ease; }
.switch input:checked + span { background: #2563eb; }
.switch input:checked + span::after { transform: translateX(20px); }
.release-admin { grid-template-columns: 1fr 1fr; }
.admin-card > p { color: #64748b; font-size: .82rem; }
.admin-card > small { color: #64748b; font-size: .7rem; }
.table-card { padding: 0; overflow: hidden; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 17px; border-bottom: 1px solid #edf0f5; text-align: left; white-space: nowrap; }
th { color: #64748b; background: #f8fafc; font-size: .63rem; letter-spacing: .07em; text-transform: uppercase; }
td { color: #475569; font-size: .78rem; }
td strong { color: #0f172a; }
td small { display: block; margin-top: 2px; color: #64748b; }
td code { color: #334155; font-size: .7rem; }
.table-status { display: inline-flex; padding: 5px 8px; border-radius: 7px; color: #176654; background: #e9fbf6; font-size: .67rem; font-weight: 750; }
.table-card > .empty-state { margin: 24px; }
.account-grid { grid-template-columns: .7fr 1.3fr; }
.password-rule { margin: -8px 0 0; color: #64748b; font-size: .72rem; }

.period-toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin: -8px 0 18px; padding: 14px 16px; border: 1px solid #dce6f3; border-radius: 14px; background: linear-gradient(135deg,#fff,#f7faff); box-shadow: 0 8px 24px rgba(15,23,42,.035); }
.period-toolbar label { display: grid; gap: 5px; color: #64748b; font-size: .64rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.period-toolbar select, .period-toolbar input { min-width: 135px; min-height: 39px; padding: 7px 10px; border: 1px solid #dbe3ef; border-radius: 9px; color: #24324a; background: #fff; }
.period-toolbar .period-label { margin-left: auto; padding: 9px 11px; border-radius: 9px; color: #1d4ed8; background: #eaf2ff; font-size: .72rem; font-weight: 800; }
.executive-metrics, .finance-metrics { grid-template-columns: repeat(5,minmax(150px,1fr)); }
.executive-metrics { grid-template-columns: repeat(4,minmax(170px,1fr)); }
.metric-income { border-color: #bdeadd !important; background: linear-gradient(145deg,#fff,#effcf8) !important; }
.metric-expense { border-color: #ffd0cc !important; background: linear-gradient(145deg,#fff,#fff4f2) !important; }
.metric-profit { border-color: #bed5ff !important; background: linear-gradient(145deg,#fff,#eff5ff) !important; }
.metric-income > strong, .value-income { color: #08745f !important; }
.metric-expense > strong, .value-expense { color: #b42318 !important; }
.metric-profit > strong { color: #1d4ed8; }
.executive-grid { grid-template-columns: 1.3fr .7fr; }
.compact-empty { min-height: 128px; }
.finance-feed { display: grid; }
.finance-feed > div { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 11px; padding: 11px 0; border-bottom: 1px solid #edf0f5; }
.finance-feed > div:last-child { border-bottom: 0; }
.finance-feed span:not(.entry-icon) { display: grid; }
.finance-feed small { color: #64748b; font-size: .69rem; }
.finance-feed b { font-size: .78rem; }
.entry-icon { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 9px; font-weight: 900; }
.entry-icon.income { color: #08745f; background: #e6faf4; }
.entry-icon.expense { color: #b42318; background: #fff0ee; }
.performance-hero { display: grid; margin: 12px 0 5px; padding: 20px; border-radius: 13px; color: #fff; background: linear-gradient(135deg,#1d4ed8,#2563eb 58%,#0ea5a0); }
.performance-hero strong { font-size: 2.5rem; line-height: 1; }
.performance-hero span { margin-top: 5px; color: #dbeafe; font-size: .75rem; }
.finance-layout { display: grid; grid-template-columns: minmax(0,1.7fr) minmax(330px,.7fr); align-items: start; gap: 16px; margin-top: 18px; }
.finance-ledger { min-width: 0; }
.finance-filters { grid-template-columns: 1fr 1fr auto; }
.segmented-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.segmented-fields label { position: relative; }
.segmented-fields input { position: absolute; opacity: 0; }
.segmented-fields span { display: grid; min-height: 44px; place-items: center; padding: 8px 10px; border: 1px solid #dbe3ef; border-radius: 10px; color: #526078; background: #f8fafc; cursor: pointer; font-weight: 750; }
.segmented-fields input:checked + span { color: #1d4ed8; border-color: #93b4f9; background: #edf4ff; box-shadow: inset 0 0 0 1px #93b4f9; }
.report-metrics { margin-bottom: 18px; }
.report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ranking-list { display: grid; gap: 18px; }
.ranking-list > div { display: grid; gap: 6px; }
.ranking-list header { display: flex; justify-content: space-between; gap: 14px; color: #24324a; font-size: .8rem; }
.ranking-list header b { color: #2563eb; }
.ranking-list > div > span { height: 8px; overflow: hidden; border-radius: 999px; background: #eaf0f8; }
.ranking-list i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#2563eb,#14b8a6); }
.ranking-list small { color: #64748b; font-size: .7rem; }
.report-note { margin-top: 17px; }

.gateway-banner { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 17px 0; padding: 16px 18px; border: 1px solid #fed7aa; border-radius: 14px; background: linear-gradient(135deg,#fffaf3,#fff7ed); }
.gateway-banner.ready { border-color: #b7e9dc; background: linear-gradient(135deg,#f7fffc,#edfbf7); }
.gateway-banner > div { display: grid; gap: 3px; }
.gateway-banner strong { color: #17233a; font-size: .88rem; }
.gateway-banner span { color: #64748b; font-size: .75rem; }
.gateway-banner form { margin: 0; }
.payment-grid { grid-template-columns: minmax(0,1.25fr) minmax(330px,.75fr); align-items: start; }
.payment-metrics article > strong { font-size: 1.35rem; }
.status-pill { display: inline-flex; align-items: center; padding: 6px 9px; border-radius: 999px; color: #9a5d08; background: #fff7df; font-size: .62rem; font-weight: 850; }
.status-pill.ok { color: #08745f; background: #e6faf4; }
.certificate-upload { display: grid; gap: 14px; padding: 16px; border: 1px dashed #b9c7da; border-radius: 12px; background: #f8fbff; }
.certificate-upload small { color: #64748b; font-size: .7rem; overflow-wrap: anywhere; }
.certificate-upload code { color: #334155; font-size: .68rem; }
.payment-status-card { position: sticky; top: 88px; }
.security-checklist { display: grid; gap: 2px; margin: 18px 0; padding: 0; list-style: none; }
.security-checklist li { display: grid; grid-template-columns: 34px 1fr; gap: 11px; align-items: center; padding: 13px 0; border-bottom: 1px solid #edf0f5; }
.security-checklist li > b { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 9px; color: #64748b; background: #eef2f7; }
.security-checklist li.done > b { color: #fff; background: #14b8a6; }
.security-checklist li span { display: grid; gap: 2px; }
.security-checklist li strong { font-size: .8rem; }
.security-checklist li small { color: #64748b; font-size: .69rem; }
.readonly-field { display: grid; gap: 6px; margin-top: 14px; color: #64748b; font-size: .7rem; }
.readonly-field input { width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid #dce6f3; border-radius: 9px; color: #475569; background: #f8fafc; font-size: .7rem; }
.danger-note { display: grid; gap: 4px; margin-top: 15px; padding: 14px; border: 1px solid #fecaca; border-radius: 11px; color: #7f1d1d; background: #fff5f5; }
.danger-note strong { font-size: .78rem; }
.danger-note span { font-size: .7rem; line-height: 1.45; }
.payment-details { position: relative; margin-top: 5px; }
.payment-details summary { color: #2563eb; cursor: pointer; font-size: .68rem; font-weight: 800; }
.payment-details[open] { display: grid; width: 290px; gap: 8px; padding: 12px; border: 1px solid #dbe6f5; border-radius: 10px; background: #fff; box-shadow: 0 14px 35px rgba(15,23,42,.12); }
.payment-details img { width: 160px; height: 160px; object-fit: contain; }
.payment-details textarea { width: 100%; resize: none; border: 1px solid #dbe3ef; border-radius: 8px; font-size: .66rem; }
.payment-details a { color: #2563eb; font-size: .7rem; font-weight: 800; }
.notification-list { display: grid; }
.notification-item { display: grid; grid-template-columns: 40px 1fr auto; gap: 14px; align-items: center; padding: 17px 20px; border-bottom: 1px solid #edf0f5; }
.notification-item.unread { background: #f7faff; box-shadow: inset 3px 0 #2563eb; }
.notification-icon { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 11px; color: #1d4ed8; background: #eaf2ff; font-weight: 900; }
.notification-item > div { min-width: 0; }
.notification-item header { display: flex; justify-content: space-between; gap: 15px; }
.notification-item header strong { color: #17233a; font-size: .84rem; }
.notification-item time, .notification-item small { color: #64748b; font-size: .67rem; }
.notification-item p { margin: 4px 0; color: #475569; font-size: .77rem; }
.notification-item form { display: flex; gap: 6px; }
.notification-item select, .notification-item button { min-height: 34px; padding: 6px 8px; border: 1px solid #dbe3ef; border-radius: 8px; background: #fff; font-size: .69rem; }
.notification-item button { color: #1d4ed8; background: #edf4ff; font-weight: 800; cursor: pointer; }
.integration-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.connection-state { display: flex; align-items: center; gap: 10px; padding: 13px 14px; border: 1px solid #e1e8f3; border-radius: 11px; background: #fbfcfe; }
.connection-state > div { display: grid; gap: 2px; }
.connection-state strong { font-size: .78rem; }
.connection-state small { color: #64748b; font-size: .68rem; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: #f59e0b; box-shadow: 0 0 0 4px #fef3c7; }
.status-dot.online { background: #10b981; box-shadow: 0 0 0 4px #d1fae5; }
.qr-panel { display: grid; justify-items: center; gap: 10px; padding: 18px; border: 1px solid #bcd0f2; border-radius: 13px; background: #f4f8ff; text-align: center; }
.qr-panel img { width: 230px; height: 230px; padding: 8px; border-radius: 10px; background: #fff; object-fit: contain; }
.qr-panel code { padding: 8px 12px; border-radius: 8px; color: #1d4ed8; background: #eaf2ff; font-size: 1rem; font-weight: 900; letter-spacing: .12em; }
.qr-panel small { max-width: 390px; color: #64748b; font-size: .69rem; line-height: 1.45; }

.admin-sidebar { overflow-y: auto; }
.admin-sidebar nav { padding-bottom: 14px; }
.tenant-chip { display: grid; gap: 4px; margin: 0 4px 18px; padding: 13px; border: 1px solid #253450; border-radius: 12px; background: #111d34; }
.tenant-chip small { color: #7083a1; font-size: .62rem; font-weight: 800; letter-spacing: .08em; }
.tenant-chip strong { overflow: hidden; color: #fff; font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }
.billing-dot { justify-self: start; margin-top: 4px; padding: 4px 7px; border-radius: 999px; color: #8ef0d8; background: #123d3a; font-size: .62rem; font-weight: 800; }
.billing-dot.overdue, .billing-dot.blocked, .billing-dot.trial_expired { color: #fecaca; background: #4b1f29; }
.operations-grid { grid-template-columns: minmax(0, 1.55fr) minmax(310px, .75fr); align-items: start; }
.compact-form { position: sticky; top: 88px; }
.compact-form h2 { margin-bottom: 2px; font-size: 1.05rem; }
.table-filters { display: grid; grid-template-columns: minmax(180px, 1fr) 180px auto; gap: 9px; padding: 16px; border-bottom: 1px solid #e8edf5; background: #fbfcfe; }
.table-filters input, .table-filters select { min-height: 39px; padding: 8px 10px; border: 1px solid #dbe3ef; border-radius: 8px; background: #fff; }
.row-actions { display: flex; align-items: center; gap: 8px; }
.row-actions > a, .cancel-edit { color: #2563eb; font-size: .72rem; font-weight: 750; }
.row-actions form, .inline-status { display: inline-flex; gap: 5px; }
.row-actions select, .inline-status select { width: 128px; min-height: 31px; padding: 5px; border: 1px solid #dbe3ef; border-radius: 7px; background: #fff; font-size: .7rem; }
.row-actions button, .inline-status button { min-height: 31px; padding: 5px 8px; border: 0; border-radius: 7px; color: #1d4ed8; background: #eaf1ff; font-size: .68rem; font-weight: 800; cursor: pointer; }
.row-actions .danger-link { color: #b91c1c; background: #fff1f2; }
.pagination { display: flex; gap: 6px; padding: 14px 17px; }
.pagination a { display: grid; width: 32px; height: 32px; place-items: center; border: 1px solid #dbe3ef; border-radius: 8px; color: #475569; font-size: .75rem; font-weight: 750; }
.pagination a.active { color: #fff; border-color: #2563eb; background: #2563eb; }
.status-overdue, .status-blocked, .status-cancelled { color: #b42318; background: #fff0ee; }
.status-waiting, .status-pending, .status-trial { color: #9a5d08; background: #fff7df; }
.status-in_progress, .status-open, .status-scheduled { color: #1d4ed8; background: #edf3ff; }
.status-paid, .status-resolved, .status-completed, .status-done, .status-active { color: #176654; background: #e9fbf6; }
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.action-grid a { display: grid; gap: 4px; padding: 15px; border: 1px solid #e1e8f3; border-radius: 11px; background: #fbfcfe; }
.action-grid strong { color: #17233a; font-size: .82rem; }
.action-grid span { color: #64748b; font-size: .7rem; line-height: 1.45; }
.login-points { display: grid; gap: 9px; margin-top: 24px; color: #c8d5e8; font-size: .85rem; }
.login-card label span { color: #94a3b8; font-weight: 500; }
.login-card > small { color: #94a3b8; text-align: center; font-size: .66rem; line-height: 1.45; }

.login-body { min-height: 100vh; background: #f7f9fc; }
.login-layout { display: grid; min-height: 100vh; grid-template-columns: .9fr 1.1fr; }
.login-brand { display: grid; grid-template-rows: auto 1fr auto; padding: 50px; color: #b3c0d4; background: radial-gradient(circle at 80% 20%, rgba(37,99,235,.25), transparent 32%), radial-gradient(circle at 5% 90%, rgba(20,184,166,.14), transparent 28%), #0a1020; }
.login-brand .brand strong { color: #fff; }
.login-brand .brand small { color: #7385a1; }
.login-brand > div { max-width: 520px; align-self: center; }
.login-brand h1 { color: #fff; font-size: clamp(2.6rem, 5vw, 4.5rem); }
.login-brand p { color: #95a5ba; font-size: 1.03rem; }
.login-brand > small { color: #64748b; }
.login-panel { display: grid; place-items: center; padding: 28px; }
.login-card { display: grid; width: min(100%, 430px); gap: 17px; padding: 38px; border: 1px solid #e2e8f0; border-radius: 20px; background: #fff; box-shadow: 0 24px 70px rgba(15,23,42,.1); }
.login-card > img { margin-bottom: 5px; }
.login-card h2 { font-size: 1.7rem; }
.login-card > p { margin: -8px 0 5px; color: #64748b; }
.login-card > a { color: #64748b; text-align: center; font-size: .78rem; }

@media (max-width: 1050px) {
  .admin-shell { grid-template-columns: 220px 1fr; }
  .admin-metrics { grid-template-columns: 1fr 1fr; }
  .admin-grid, .release-admin { grid-template-columns: 1fr; }
  .operations-grid { grid-template-columns: 1fr; }
  .compact-form { position: static; }
  .executive-metrics, .finance-metrics { grid-template-columns: repeat(2,1fr); }
  .finance-layout, .report-grid, .executive-grid, .payment-grid { grid-template-columns: 1fr; }
  .payment-status-card { position: static; }
}

@media (max-width: 760px) {
  .admin-shell { display: block; }
  .admin-sidebar { position: static; height: auto; grid-template-rows: auto auto auto; }
  .admin-sidebar nav { display: grid; grid-template-columns: 1fr 1fr; }
  .admin-sidebar-bottom { display: flex; justify-content: space-between; }
  .admin-topbar { padding-inline: 18px; }
  .admin-content { width: min(calc(100% - 28px), 1240px); }
  .plan-editor-head { display: none; }
  .plan-editor-row { grid-template-columns: 1fr 1fr; }
  .plan-editor-row strong { grid-column: 1 / -1; }
  .login-layout { grid-template-columns: 1fr; }
  .login-brand { min-height: 370px; padding: 30px; }
  .login-brand h1 { font-size: 2.7rem; }
}

@media (max-width: 510px) {
  .admin-metrics { grid-template-columns: 1fr; }
  .admin-sidebar nav { grid-template-columns: 1fr; }
  .admin-alert { align-items: flex-start; flex-direction: column; }
  .admin-note { flex-direction: column; }
  .field-row { grid-template-columns: 1fr; }
  .login-card { padding: 28px 22px; }
  .table-filters { grid-template-columns: 1fr; }
  .period-toolbar { align-items: stretch; flex-direction: column; }
  .period-toolbar .period-label { margin-left: 0; text-align: center; }
  .executive-metrics, .finance-metrics { grid-template-columns: 1fr; }
  .row-actions { align-items: flex-start; flex-direction: column; }
  .action-grid { grid-template-columns: 1fr; }
  .gateway-banner { align-items: stretch; flex-direction: column; }
  .notification-item { grid-template-columns: 1fr; }
  .notification-item form { flex-wrap: wrap; }
  .admin-topbar .topbar-actions { align-items: flex-end; flex-direction: column; }
}
/* Workspace navigation, shared by master, company and technician. */
.admin-body { background: #f3f6fb; }
.admin-shell { grid-template-columns: 270px minmax(0, 1fr); }
.admin-sidebar { background: linear-gradient(165deg, #111e35 0%, #0a1324 72%); }
.admin-sidebar .brand { flex-shrink: 0; padding-bottom: 18px; }
.admin-sidebar nav a { min-height: 42px; flex-shrink: 0; padding: 11px 12px; border: 1px solid transparent; transition: background .15s, color .15s; }
.admin-sidebar nav a.active { color: #fff; background: #245fe5; border-color: #477bee; box-shadow: 0 5px 16px #07122945; }
.admin-sidebar nav a.active span { background: #b8f5e8; border-color: #b8f5e8; box-shadow: none; }
.admin-sidebar nav > .nav-section-label { width: auto; height: auto; border: 0; border-radius: 0; margin: 18px 12px 6px; color: #8d9fb9; font-size: .6rem; font-weight: 800; letter-spacing: .13em; }
.admin-sidebar nav > .nav-section-label:first-child { margin-top: 0; }
.admin-sidebar-bottom { flex-shrink: 0; margin-top: 14px; }
.admin-topbar { position: sticky; top: 0; z-index: 20; min-height: 76px; box-shadow: 0 3px 14px #15264204; }
.admin-heading h1 { font-size: clamp(1.65rem, 3vw, 2.2rem); letter-spacing: -.035em; }
.admin-heading p { max-width: 760px; line-height: 1.65; }
.admin-card { border-color: #e3eaf4; border-radius: 16px; }
.admin-metrics article { border-top: 3px solid #3b72ef; padding: 22px; }
.admin-metrics article > strong { letter-spacing: -.04em; }
.admin-sidebar a:focus-visible, .admin-sidebar button:focus-visible, .workspace-menu-toggle:focus-visible { outline: 2px solid #8abaff; outline-offset: 2px; }
.workspace-menu-toggle { display: none; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid #dbe3ef; border-radius: 9px; background: white; color: #243b60; cursor: pointer; }
.admin-content[aria-busy="true"] { opacity: .75; pointer-events: auto; }
.admin-topbar .workspace-menu-toggle span { font-size: .75rem; color: inherit; letter-spacing: 0; }
@media (max-width: 1050px) { .admin-shell { grid-template-columns: 230px minmax(0,1fr); } .admin-topbar { padding-inline: 20px; } }
@media (max-width: 760px) {
 .admin-shell { display: block; }
 .workspace-menu-toggle { display: inline-flex; }
 .admin-sidebar { display: none; position: fixed; top: 76px; left: 0; bottom: 0; width: min(310px, 88vw); height: calc(100dvh - 76px); z-index: 30; padding: 20px 16px; box-shadow: 16px 0 40px #0a13243d; }
 .workspace-menu-open .admin-sidebar { display: flex; }
 .admin-sidebar nav { display: flex; }
 .admin-sidebar-bottom { display: block; }
 .admin-topbar { gap: 12px; padding-inline: 14px; }
 .admin-topbar > div { min-width: 0; }
 .admin-topbar strong { overflow-wrap: anywhere; }
 .admin-topbar em { display: none; }
 .admin-content { padding-top: 24px; }
}
@media (prefers-reduced-motion: reduce) { .admin-sidebar nav a { transition: none; } }
