:root {
    --sa-primary: #008773;
    --sa-primary-dark: #006b5c;
    --sa-bg: #F5F7FA;
    --sa-surface: #ffffff;
    --sa-text: #17253F;
    --sa-muted: #667085;
    --sa-line: #e7ebf0;
    --sa-danger: #b42318;
    --sa-radius-card: 16px;
    --sa-radius-control: 10px;
    --sa-shadow: 0 8px 24px rgba(23, 37, 63, 0.04);
    --sa-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
    --sa-dur-press: 140ms;
    --sa-dur-pop: 160ms;
    --sa-dur-content: 180ms;
    --sa-dur-layer: 220ms;
    --sa-z-sticky: 20;
    --sa-z-dropdown: 40;
    --sa-z-overlay: 60;
    --sa-z-modal: 70;
    --sa-z-toast: 80;
    --sa-z-tooltip: 90;
    --green: var(--sa-primary);
    --green-dark: var(--sa-primary-dark);
    --ink: var(--sa-text);
    --muted: #8b919a;
    --line: #eceff3;
    --paper: var(--sa-bg);
    --card: var(--sa-surface);
    --danger: #9f2d22;
    --warn: #8a5a12;
    --info: #1d5f8a;
    --shadow: 0 10px 30px rgba(28, 36, 48, 0.05);
    --sidebar: 252px;
    --radius: 22px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--paper);
    font-size: 14.5px;
    line-height: 1.45;
}
a { color: var(--green-dark); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, p { margin: 0; }
h1 { font-size: 1.65rem; letter-spacing: -0.035em; font-weight: 700; }
h2 { font-size: 1.02rem; font-weight: 600; }
button { cursor: pointer; }
.sr-only, .skip {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); border: 0;
}
.skip:focus {
    position: fixed; left: 12px; top: 12px; width: auto; height: auto; margin: 0;
    clip: auto; background: white; padding: 8px 12px; border-radius: 10px; z-index: 90;
}

.nav-toggle { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.sidebar-backdrop {
    display: none; position: fixed; inset: 0; background: rgba(20, 24, 28, 0.28);
    z-index: 20; opacity: 0; transition: opacity .2s ease;
}
.app-frame { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar);
    flex: 0 0 var(--sidebar);
    background: #fbfbfc;
    border-right: 1px solid #eef0f3;
    display: flex;
    flex-direction: column;
    padding: 18px 14px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 30;
    transition: width .22s ease, flex-basis .22s ease;
}
.sidebar-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 6px 8px; }
.brand { display: flex; align-items: center; color: var(--ink); text-decoration: none; min-width: 0; }
.brand-logo { display: block; height: 40px; width: auto; }
.brand-mark { display: none; width: 36px; height: 36px; object-fit: contain; }
body.sidebar-collapsed .brand-logo { display: none; }
body.sidebar-collapsed .brand-mark { display: block; }
.auth-card .brand-logo { height: 52px; }
.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 14px; overflow: auto; padding-right: 2px; }
.nav-label {
    margin: 16px 12px 6px;
    color: #a0a6ae;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #8d939c;
    text-decoration: none;
    padding: 10px 12px 10px 16px;
    border-radius: 12px;
    border: 0;
    background: transparent;
    width: 100%;
    text-align: left;
    font-weight: 500;
    transition: background .16s ease, color .16s ease, transform .16s ease;
}
.nav-link i { font-size: 1.05rem; width: 1.15rem; text-align: center; }
.nav-link:hover { background: #f3f4f6; color: #3c4450; }
.nav-link.is-active { color: #1b1f26; font-weight: 700; }
.nav-link.is-active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 99px;
    background: #1c1f24;
}
.nav-link.is-profile.is-active,
.nav-link.is-subs.is-active {
    background: #e7f6f2;
    color: #008773;
}
.nav-link.is-profile.is-active i,
.nav-link.is-subs.is-active i { color: #008773; }
.nav-link.is-profile.is-active::before,
.nav-link.is-subs.is-active::before { background: #008773; }
.nav form { margin: 0; }

.workspace { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.nav-progress {
    position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 80;
    background: linear-gradient(90deg, var(--green), #1aa88a);
    box-shadow: 0 0 12px rgba(8, 127, 104, 0.45);
    pointer-events: none;
}
body.is-loading .nav-progress { width: 72%; transition: width .7s ease; }

.topbar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 28px 6px;
    position: sticky;
    top: 0;
    z-index: 15;
    background: linear-gradient(var(--paper) 70%, rgba(243, 244, 246, 0));
}
.top-search {
    position: relative;
    flex: 1;
    max-width: 460px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border-radius: 999px;
    padding: 0 16px;
    min-height: 46px;
    box-shadow: 0 8px 24px rgba(28, 36, 48, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.8);
}
.top-search i { color: #b0b6be; }
.top-search input {
    border: 0; background: transparent; padding: 12px 0; width: 100%; outline: none; box-shadow: none;
}
.top-search input:focus { outline: none; border: 0; }
.search-panel, .popover {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: white;
    border-radius: 16px;
    box-shadow: 0 18px 50px rgba(28, 36, 48, 0.12);
    border: 1px solid var(--line);
    padding: 6px;
    z-index: 20;
}
.search-panel button, .popover a, .popover button {
    display: flex; width: 100%; align-items: center; gap: 10px;
    text-align: left; background: transparent; border: 0; border-radius: 10px;
    padding: 10px 12px; color: var(--ink); text-decoration: none;
}
.search-panel button small, .popover small { color: var(--muted); margin-left: auto; }
.search-panel button.is-on, .search-panel button:hover, .popover a:hover, .popover button:hover { background: #f4f6f8; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.today-chip {
    color: #6d7480; background: white; border-radius: 999px; padding: 10px 14px;
    box-shadow: 0 8px 24px rgba(28, 36, 48, 0.04); font-size: 0.84rem; font-weight: 600;
}
.icon-btn {
    width: 42px; height: 42px; border-radius: 50%; border: 0; background: white;
    display: inline-grid; place-items: center; color: #5d6570; position: relative;
    box-shadow: 0 8px 24px rgba(28, 36, 48, 0.05);
    transition: transform .16s ease, background .16s ease;
}
.icon-btn:hover { transform: translateY(-1px); }
.icon-btn:active { transform: scale(.94); }
.alert-dot {
    position: absolute; top: -2px; right: -2px; min-width: 16px; height: 16px; padding: 0 4px;
    border-radius: 99px; background: #e11d48; color: white; font-size: 0.65rem; font-weight: 700;
    display: grid; place-items: center;
}
.popover-wrap { position: relative; }
.popover { left: auto; right: 0; width: 280px; }
.popover-user { width: 220px; }
.popover-title { padding: 8px 12px 4px; font-size: 0.75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.popover-empty { padding: 8px 12px 12px; color: var(--muted); }
.user-chip {
    display: flex; align-items: center; gap: 10px;
    background: white; border: 0; border-radius: 999px; padding: 6px 12px 6px 6px;
    box-shadow: 0 8px 24px rgba(28, 36, 48, 0.05);
    transition: transform .16s ease;
}
.user-chip:hover { transform: translateY(-1px); }
.user-chip:active { transform: scale(.98); }
.avatar {
    width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
    background: #d9f3ec; color: #008773; font-weight: 700; font-size: 0.82rem; overflow: hidden;
}
.avatar img, .avatar span { grid-area: 1 / 1; }
.avatar img { width: 36px; height: 36px; object-fit: cover; border-radius: 50%; display: block; }
.user-copy { display: grid; text-align: left; line-height: 1.15; }
.user-copy strong { font-size: 0.86rem; }
.user-copy small { color: var(--muted); font-size: 0.72rem; }
.user-chip .bi-chevron-down { color: #b0b6be; font-size: 0.75rem; }
.burger { display: none; }

body.sidebar-collapsed .sidebar { width: 88px; flex-basis: 88px; }
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .nav-link span { display: none; }
body.sidebar-collapsed .nav-link { justify-content: center; padding-left: 0; padding-right: 0; }
body.sidebar-collapsed .sidebar-top { flex-direction: column; padding-left: 0; padding-right: 0; }

.main { position: relative; flex: 1; padding: 12px 28px 48px; }
.skeleton-screen {
    display: none;
    position: absolute;
    inset: 8px 28px auto;
    z-index: 5;
    pointer-events: none;
}
body.is-navigating .skeleton-screen { display: grid; gap: 12px; }
.sk-line, .sk-stats span, .sk-card {
    background: linear-gradient(90deg, #eceff3 25%, #f7f8fa 37%, #eceff3 63%);
    background-size: 400% 100%;
    animation: shimmer 1.15s ease infinite;
    border-radius: 14px;
}
.sk-title { height: 28px; width: 220px; }
.sk-sub { height: 14px; width: 320px; }
.sk-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.sk-stats span { height: 84px; }
.sk-card { height: 180px; }
.sk-short { height: 120px; width: 70%; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }

.page { animation: rise .38s ease; }
.page-head, .card-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; }
.page-head { margin-bottom: 22px; }
.kicker { color: var(--green); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 4px; }
.lede { color: #6d7480; max-width: 62ch; margin-top: 6px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.stats article, .card {
    background: var(--card);
    border: 1px solid rgba(255,255,255,.7);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.stats article { padding: 18px 18px 16px; }
.stats span { display: block; color: var(--muted); font-size: 0.8rem; font-weight: 600; }
.stats strong { display: block; margin-top: 10px; font-size: 1.7rem; letter-spacing: -0.04em; }
.grid-2 { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 16px; margin-bottom: 16px; }
.grid-form { display: grid; grid-template-columns: 1.4fr 0.8fr; gap: 16px; align-items: start; }
.card { padding: 8px 8px 4px; }
.card-head, .form, .system-list, .plain, .empty { padding-left: 12px; padding-right: 12px; }
.card-head { padding-top: 12px; margin-bottom: 8px; }
.card-head a { font-size: 0.9rem; font-weight: 600; }
.narrow { max-width: 760px; }
.form { display: grid; gap: 12px; padding-bottom: 18px; }
.form h2 { margin-bottom: 4px; }
label { display: grid; gap: 6px; font-size: 0.82rem; color: #6d7480; font-weight: 600; }
input, select, textarea {
    width: 100%; border: 1px solid #e6e9ee; background: #fff; border-radius: 12px;
    padding: 11px 12px; color: var(--ink); transition: border-color .16s ease, box-shadow .16s ease;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus {
    outline: none; border-color: #b7ddd4; box-shadow: 0 0 0 4px rgba(8, 127, 104, 0.12);
}
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 500; }
.check input { width: auto; }
.form-actions { display: flex; justify-content: flex-end; }
.filters { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.filters input, .filters select { width: auto; min-width: 180px; background: white; }
.btn, button.btn {
    border: 1px solid var(--line); background: white; border-radius: 999px; padding: 10px 16px;
    text-decoration: none; color: var(--ink); display: inline-flex; align-items: center; justify-content: center;
    font-weight: 600; position: relative;
    transition: transform .16s cubic-bezier(.2,.8,.2,1), box-shadow .16s ease, background .16s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(28, 36, 48, 0.08); }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--green); border-color: var(--green); color: white; }
.btn-primary:hover { background: var(--green-dark); }
.btn-ghost { background: transparent; box-shadow: none; }
.btn.is-busy { color: transparent !important; pointer-events: none; }
.btn.is-busy::after {
    content: "";
    position: absolute; inset: 0; margin: auto;
    width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid rgba(8, 127, 104, 0.25); border-top-color: var(--green);
    animation: spin .7s linear infinite;
}
.btn-primary.is-busy::after { border-color: rgba(255,255,255,.35); border-top-color: white; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
td strong, td small { display: block; }
td small, .code { color: var(--muted); font-size: 0.82rem; }
.num { text-align: right; white-space: nowrap; }
.actions { white-space: nowrap; }
.actions a, .actions button {
    background: none; border: 0; color: var(--green-dark); padding: 0 8px 0 0; text-decoration: none; font-weight: 600;
    transition: color .15s ease;
}
.actions a:hover, .actions button:hover { color: var(--ink); }
.actions form { display: inline; }
.badge { display: inline-flex; border-radius: 999px; padding: 3px 8px; font-size: 0.75rem; background: #eef3f1; color: var(--muted); font-weight: 600; }
.badge-ok { background: #e5f6f1; color: var(--green-dark); }
.badge-info { background: #e7f2f8; color: var(--info); }
.badge-warn { background: #fbf3e4; color: var(--warn); }
.badge-bad { background: #fdeceb; color: var(--danger); }
.system-list, .plain { list-style: none; margin: 0; padding: 0 12px 10px; }
.system-list li, .plain li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.system-list small, .plain span { display: block; color: var(--muted); }
.empty { color: var(--muted); padding: 16px 12px 18px; }
.flash { border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; font-weight: 600; }
.flash-ok { background: #e5f6f1; color: var(--green-dark); }
.flash-error { background: #fdeceb; color: var(--danger); }
.auth-body {
    min-height: 100vh; display: grid; place-items: center; padding: 24px;
    background:
        radial-gradient(circle at top left, rgba(8,127,104,0.18), transparent 28%),
        var(--paper);
}
.auth-card {
    width: min(440px, 100%); background: white; border-radius: 28px; padding: 28px;
    border: 1px solid var(--line); box-shadow: var(--shadow);
}
.auth-card h1 { margin: 18px 0 8px; }
.stack { display: grid; gap: 12px; margin-top: 18px; }
.swal2-popup { border-radius: 20px !important; font-family: "Plus Jakarta Sans", sans-serif !important; }
.swal2-styled.swal2-cancel { color: var(--ink) !important; }

@media (max-width: 980px) {
    .stats, .grid-2, .grid-form, .split, .sk-stats { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed; transform: translateX(-105%);
        transition: transform .22s ease; box-shadow: none;
    }
    .nav-toggle:checked ~ .app-frame .sidebar { transform: none; box-shadow: 0 20px 60px rgba(0,0,0,.18); }
    .nav-toggle:checked ~ .sidebar-backdrop { display: block; opacity: 1; }
    .main { padding: 8px 16px 40px; }
    .topbar { padding: 14px 16px 4px; }
    .burger { display: inline-grid; }
    .collapse-btn, .today-chip, .user-copy, .user-chip .bi-chevron-down { display: none; }
    .user-chip { padding: 4px; }
    body.sidebar-collapsed .sidebar { width: var(--sidebar); flex-basis: var(--sidebar); }
    body.sidebar-collapsed .brand-logo { display: block; }
    body.sidebar-collapsed .brand-mark { display: none; }
    body.sidebar-collapsed .nav-label,
    body.sidebar-collapsed .nav-link span { display: initial; }
    body.sidebar-collapsed .nav-link { justify-content: flex-start; padding-left: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}

.profile-skel { display: grid; gap: 16px; }
.profile-skel-grid { display: grid; grid-template-columns: 32% 1fr; gap: 24px; }
.profile-skel .sk-card { height: 320px; }
.profile-app { display: none; }
html.profile-ready .profile-skel { display: none; }
html.profile-ready .profile-app { display: block; }
.profile-head { margin-bottom: 18px; }
.crumbs { color: #8b95a7; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.crumbs span { margin: 0 6px; color: #c3cad6; }
.profile-app h1, .profile-app h2 { color: #17253f; }
.profile-grid { display: grid; grid-template-columns: minmax(260px, 32%) minmax(0, 1fr); gap: 24px; align-items: start; }
.profile-card {
    padding: 24px;
    border: 1px solid #e7ebf0;
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(23, 37, 63, 0.04);
}
.profile-hero { display: flex; flex-direction: column; align-items: center; text-align: center; }
.profile-avatar-wrap { position: relative; width: 140px; height: 140px; margin-bottom: 16px; }
.profile-avatar {
    width: 140px; height: 140px; border-radius: 50%;
    display: grid; place-items: center; overflow: hidden;
    background: #d9f3ec; color: #008773; font-size: 42px; font-weight: 700;
}
.profile-avatar img, .profile-avatar span { grid-area: 1 / 1; }
.profile-avatar img { width: 140px; height: 140px; object-fit: cover; }
.avatar-cam {
    position: absolute; right: 4px; bottom: 4px; width: 36px; height: 36px; border: 3px solid #fff;
    border-radius: 50%; background: #008773; color: #fff; display: grid; place-items: center;
}
.profile-hero h2 { font-size: 1.25rem; margin-bottom: 4px; }
.profile-mail { color: #8b95a7; margin-bottom: 12px; }
.profile-badges { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-bottom: 16px; }
.pill {
    display: inline-flex; align-items: center; gap: 6px;
    border-radius: 999px; padding: 4px 10px; background: #f2f4f7; color: #667085; font-size: 12px; font-weight: 650;
}
.pill-ok { background: #e7f6f2; color: #008773; }
.profile-side .btn { width: min(100%, 240px); margin-top: 8px; }
.btn-solid, .btn-line { border-radius: 10px; min-height: 44px; padding: 0 16px; font-weight: 650; }
.btn-solid { background: #008773; border-color: #008773; color: #fff; }
.btn-solid:hover { background: #006e5e; }
.btn-solid:disabled { opacity: .45; transform: none; box-shadow: none; cursor: default; }
.btn-line { background: #fff; color: #008773; border: 1px solid #008773; }
.btn-line:hover { background: #f3fbf8; }
.link-danger {
    margin-top: 8px; border: 0; background: transparent; color: #98a2b3; font-weight: 600; padding: 4px;
}
.link-danger:hover { color: #b42318; }
.hint { color: #98a2b3; font-size: 12px; margin-top: 8px; }
.hint button { border: 0; background: none; color: #008773; font-weight: 650; padding: 0; }
.profile-meta { margin-top: 20px; padding-top: 16px; border-top: 1px solid #eef1f5; display: grid; gap: 12px; }
.profile-meta p { display: grid; grid-template-columns: 18px 1fr auto; gap: 8px; align-items: center; color: #667085; margin: 0; }
.profile-meta i { color: #98a2b3; }
.profile-meta strong { color: #17253f; font-weight: 650; }
.protect {
    margin-top: 16px; display: flex; gap: 10px; text-align: left;
    background: #e8f7f3; color: #17253f; border-radius: 14px; padding: 14px;
}
.protect i { color: #008773; font-size: 1.1rem; margin-top: 2px; }
.protect p { color: #667085; font-size: 13px; margin-top: 4px; }
.profile-main { display: grid; gap: 24px; }
.profile-card-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 18px; }
.profile-card-head > i {
    width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
    background: #e8f7f3; color: #008773;
}
.profile-card-head p { color: #8b95a7; margin-top: 2px; font-size: 13px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field-wide { grid-column: 1 / -1; }
.field label { color: #17253f; font-size: 13px; font-weight: 650; margin-bottom: 6px; }
.field-icon, .pw { position: relative; }
.field-icon > i, .pw-toggle {
    position: absolute; top: 50%; transform: translateY(-50%); color: #98a2b3;
}
.field-icon > i { left: 14px; pointer-events: none; }
.profile-card input:not([type="checkbox"]) {
    height: 44px; border-radius: 10px; border: 1px solid #e4e7ec; background: #fff; padding: 0 12px;
}
.profile-card .check { color: #344054; font-size: 14px; font-weight: 550; }
.profile-card .check input { width: 16px; height: 16px; margin: 0; accent-color: #008773; }
.profile-mail, .role-note { overflow-wrap: anywhere; }
.profile-main, .profile-side { min-width: 0; }
.profile-card .field-icon input { padding-left: 42px; }
.profile-card .pw input { width: 100%; padding-right: 44px; }
.pw-toggle {
    right: 8px; width: 32px; height: 32px; border: 0; background: transparent; border-radius: 8px;
}
.pw-toggle:focus-visible, .profile-card input:focus-visible, .btn:focus-visible, .avatar-cam:focus-visible {
    outline: 2px solid #008773; outline-offset: 2px;
}
.email-row { display: flex; gap: 10px; align-items: center; }
.email-row .field-icon { flex: 1; }
.field-error { color: #b42318; font-size: 12px; margin: 6px 0 0; }
.field-error[hidden], [hidden] { display: none !important; }
.profile-card input[aria-invalid="true"] { border-color: #f04438; }
.profile-card-foot {
    margin-top: 18px; padding-top: 16px; border-top: 1px solid #eef1f5;
    display: flex; justify-content: space-between; gap: 16px; align-items: center;
}
.role-note { display: flex; gap: 8px; align-items: center; color: #667085; font-size: 13px; margin: 0; }
.profile-status { min-height: 1.2em; margin: 10px 0 0; font-size: 13px; font-weight: 650; }
.profile-status.is-ok { color: #008773; }
.profile-status.is-bad { color: #b42318; }
.strength { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.strength-bar { flex: 1; height: 4px; background: #eef1f5; border-radius: 99px; overflow: hidden; }
.strength-bar i { display: block; height: 100%; width: 0; background: #f04438; }
.strength em { font-style: normal; font-size: 12px; color: #667085; white-space: nowrap; }
.rules { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.rules li { display: flex; gap: 6px; align-items: center; color: #98a2b3; font-size: 12px; }
.rules li.is-met { color: #008773; }
.upload-bar { width: min(100%, 240px); height: 4px; background: #e7f6f2; border-radius: 99px; margin-top: 8px; overflow: hidden; }
.upload-bar span { display: block; height: 100%; width: 0; background: #008773; }
.crop-modal {
    position: fixed; inset: 0; z-index: 70; background: rgba(23, 37, 63, .45);
    display: grid; place-items: center; padding: 24px;
}
.crop-dialog { width: min(520px, 100%); background: #fff; border-radius: 18px; padding: 20px; }
.crop-dialog h2 { color: #17253f; margin-bottom: 4px; }
.crop-dialog p { color: #667085; margin-bottom: 12px; }
.crop-stage { max-height: 360px; background: #f3f4f6; border-radius: 12px; overflow: hidden; }
.crop-stage img { display: block; max-width: 100%; }
.crop-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
@media (max-width: 992px) {
    .profile-grid, .profile-skel-grid, .form-grid { grid-template-columns: 1fr; }
    .profile-card-foot { flex-direction: column; align-items: stretch; }
    .profile-side .btn, .profile-card-foot .btn { width: 100%; }
    .email-row { flex-direction: column; align-items: stretch; }
}

.subs-skel { display: grid; gap: 16px; }
.subs-skel + .subs-app { display: none; }
html.subs-ready .subs-skel { display: none; }
html.subs-ready .subs-skel + .subs-app { display: block; }
.crumbs { color: #8b95a7; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.crumbs span { margin: 0 6px; color: #c5ccd6; }
.subs-app h1, .subs-app h2 { color: #17253f; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.stat {
    display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid #e7ebf0;
    border-radius: 16px; padding: 16px; box-shadow: 0 8px 24px rgba(23, 37, 63, 0.04);
}
.stat strong { display: block; color: #17253f; font-size: 1.25rem; }
.stat small { color: #8b95a7; }
.stat-go { margin-left: auto; color: #c5ccd6; }
.stat-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1.1rem; }
.stat-green { background: #e7f6f2; color: #008773; }
.stat-red { background: #fdecec; color: #d92d20; }
.stat-blue { background: #e8f1ff; color: #2563eb; }
.stat-purple { background: #f3e8ff; color: #7c3aed; }
.filter-bar, .company-card, .detail-card, .empty-card {
    background: #fff; border: 1px solid #e7ebf0; border-radius: 16px;
    box-shadow: 0 8px 24px rgba(23, 37, 63, 0.04);
}
.filter-bar { display: flex; gap: 12px; align-items: center; padding: 12px; margin-bottom: 16px; }
.filter-search { position: relative; flex: 1 1 280px; min-width: 180px; }
.filter-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #98a2b3; }
.filter-search input, .filter-bar select, .history-tools select {
    height: 44px; border-radius: 10px; border: 1px solid #e4e7ec; background: #fff; padding: 0 12px;
}
.filter-search input { width: 100%; padding-left: 36px; }
.filter-bar select { width: 210px; max-width: 100%; flex: 0 0 210px; }
.seg-row { display: flex; gap: 8px; margin: 8px 0 16px; }
.seg {
    display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px;
    border-radius: 10px; color: #667085; font-weight: 650; text-decoration: none;
}
.seg.is-on { background: #008773; color: #fff; }
.company-list { display: grid; gap: 16px; }
.company-card { padding: 8px 8px 4px; }
.company-toggle {
    width: 100%; display: flex; align-items: center; gap: 12px; border: 0; background: transparent;
    text-align: left; padding: 10px 12px; border-radius: 12px;
}
.company-avatar {
    width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
    background: #e7f6f2; color: #008773; font-weight: 700;
}
.company-card:nth-child(3n+2) .company-avatar { background: #efeaff; color: #6941c6; }
.company-card:nth-child(3n) .company-avatar { background: #fff4e5; color: #b54708; }
.company-name { display: grid; color: #17253f; font-size: 1rem; }
.company-name small, .subrow small, .cell small { color: #98a2b3; font-weight: 500; }
.company-toggle .pill { margin-left: auto; }
.company-toggle .bi-chevron-up, .company-toggle .bi-chevron-down { color: #98a2b3; }
.subhead, .subrow, .history-row {
    display: grid; grid-template-columns: 1.3fr .9fr .8fr 1fr 1fr auto; gap: 12px; align-items: center;
    padding: 12px 16px;
}
.history-head, .history-row { grid-template-columns: 1.3fr .8fr .8fr .7fr .7fr .9fr auto; }
.subhead { color: #98a2b3; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.subrow { border-top: 1px solid #f2f4f7; }
.subrow .cell:first-child, .detail-title { display: flex; align-items: center; gap: 10px; }
.sys-icon {
    width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
    background: #e7f6f2; color: #008773;
}
.sys-icon-lg { width: 48px; height: 48px; border-radius: 14px; }
.cell { color: #17253f; }
.cell small { display: block; }
.cell.num, .next-amount { font-variant-numeric: tabular-nums; font-weight: 700; }
.cell-action a { color: #008773; font-weight: 700; text-decoration: none; white-space: nowrap; }
.late { color: #d92d20; }
.pill-bad { background: #fdecec; color: #d92d20; }
.pill-warn { background: #fff6e8; color: #b54708; }
.list-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: #667085; margin-top: 16px; }
.pager { display: flex; align-items: center; gap: 8px; }
.pager a { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: #fff; color: #17253f; text-decoration: none; }
.empty-card, .detail-card { padding: 20px; }
.empty-card { text-align: center; display: grid; gap: 8px; justify-items: center; }
.back-link { display: inline-flex; gap: 6px; align-items: center; color: #008773; font-weight: 700; text-decoration: none; margin-bottom: 8px; }
.detail-head, .detail-card-head, .detail-actions { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.detail-head { margin: 8px 0 16px; flex-wrap: wrap; }
.detail-actions { flex: 0 0 auto; }
.detail-actions .btn { white-space: nowrap; }
.detail-title h1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.detail-title p, .detail-card-head p, .hint, .timeline p { color: #667085; }
.bill-banner { display: flex; gap: 12px; align-items: flex-start; border-radius: 16px; padding: 16px; margin-bottom: 16px; }
.bill-ok { background: #e7f6f2; color: #067568; }
.bill-bad { background: #fdecec; color: #b42318; }
.bill-banner p { margin-top: 2px; }
.detail-card { margin-bottom: 16px; }
.history-tools { display: flex; gap: 8px; align-items: center; }
.data-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; margin-top: 16px; }
.data-list dt { color: #98a2b3; font-size: 12px; font-weight: 700; }
.data-list dd { margin: 2px 0 0; color: #17253f; }
.timeline { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 16px; }
.timeline time { color: #98a2b3; font-size: 12px; }
.change { color: #17253f; }
.detail-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.next-range { color: #667085; margin-top: 12px; }
.next-amount { font-size: 1.4rem; margin: 8px 0; display: flex; gap: 8px; align-items: center; }
.punct { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 8px; }
.punct li { display: flex; gap: 8px; align-items: center; }
.pay-lines { padding: 0 16px 12px 64px; color: #667085; }
.pay-modal { position: fixed; inset: 0; z-index: 70; background: rgba(23, 37, 63, .45); display: grid; place-items: center; padding: 24px; }
.pay-dialog { width: min(680px, 100%); max-height: calc(100vh - 48px); overflow: auto; background: #fff; border-radius: 16px; padding: 20px; }
.pay-dialog h2 { color: #17253f; }
.pay-choice { align-items: flex-start; margin: 8px 0; }
.pay-split { background: #f8fafc; border-radius: 12px; padding: 12px; margin: 12px 0; color: #344054; }
.company-toggle:focus-visible, .seg:focus-visible, .cell-action a:focus-visible, .back-link:focus-visible {
    outline: 2px solid #008773; outline-offset: 2px;
}
@media (max-width: 992px) {
    .stat-grid, .detail-bottom, .data-list { grid-template-columns: 1fr 1fr; }
    .subs-app .page-head, .filter-bar, .detail-head, .detail-card-head, .history-tools { flex-direction: column; align-items: stretch; }
    .filter-search, .filter-bar select { flex: 0 0 auto; width: 100%; }
    .filter-bar select { height: 44px; }
    .subs-app .page-head .btn { align-self: flex-start; }
}
@media (max-width: 760px) {
    .stat-grid, .detail-bottom, .data-list { grid-template-columns: 1fr; }
    .subhead { display: none; }
    .subrow, .history-row { grid-template-columns: 1fr; gap: 6px; margin: 8px; border: 1px solid #eef1f5; border-radius: 12px; }
    .cell::before { content: attr(data-label); display: block; color: #98a2b3; font-size: 11px; font-weight: 700; text-transform: uppercase; }
    .cell-action::before { content: none; }
    .pay-lines { padding-left: 16px; }
}
