@font-face {
    font-family: "Be Vietnam Pro";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/be-vietnam-pro/be-vietnam-pro-400.ttf") format("truetype");
}

@font-face {
    font-family: "Be Vietnam Pro";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("../fonts/be-vietnam-pro/be-vietnam-pro-500.ttf") format("truetype");
}

@font-face {
    font-family: "Be Vietnam Pro";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("../fonts/be-vietnam-pro/be-vietnam-pro-600.ttf") format("truetype");
}

@font-face {
    font-family: "Be Vietnam Pro";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("../fonts/be-vietnam-pro/be-vietnam-pro-700.ttf") format("truetype");
}

@font-face {
    font-family: "Be Vietnam Pro";
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url("../fonts/be-vietnam-pro/be-vietnam-pro-800.ttf") format("truetype");
}

:root {
    color-scheme: light;
    --navy-950: #071426;
    --navy-900: #0b1d36;
    --navy-800: #12315a;
    --blue-700: #1859c9;
    --blue-600: #246bdb;
    --blue-500: #3b82f6;
    --blue-100: #dbeafe;
    --blue-50: #eff6ff;
    --green-600: #16a36a;
    --violet-600: #7657df;
    --amber-600: #d97706;
    --text: #152238;
    --muted: #65748b;
    --muted-light: #8d9aae;
    --line: #e3eaf3;
    --line-strong: #d3deeb;
    --surface: #ffffff;
    --surface-soft: #f7f9fc;
    --canvas: #f2f6fb;
    --shadow-xs: 0 1px 2px rgba(12, 35, 68, .04);
    --shadow-sm: 0 8px 24px rgba(12, 35, 68, .07);
    --shadow-md: 0 20px 50px rgba(12, 35, 68, .11);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;
}

* { box-sizing: border-box; }

html { min-width: 320px; }

body {
    margin: 0;
    background:
        radial-gradient(circle at 100% 0, rgba(59, 130, 246, .07), transparent 28rem),
        var(--canvas);
    color: var(--text);
    font-family: "Be Vietnam Pro", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea { font: inherit; }

button,
a { -webkit-tap-highlight-color: transparent; }

a { color: inherit; }

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid rgba(59, 130, 246, .22);
    outline-offset: 2px;
}

.app-shell {
    display: grid;
    grid-template-columns: 268px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    padding: 28px 20px 22px;
    background:
        radial-gradient(circle at 25% 0, rgba(59, 130, 246, .24), transparent 20rem),
        linear-gradient(165deg, var(--navy-950) 0%, var(--navy-900) 58%, #123a70 130%);
    color: #fff;
    box-shadow: 10px 0 35px rgba(7, 20, 38, .08);
}

.sidebar::after {
    position: absolute;
    right: -75px;
    bottom: 55px;
    width: 180px;
    height: 180px;
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: 50%;
    content: "";
}

.sidebar-brand {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 0 7px 32px;
}

.sidebar-logo,
.brand-mark,
.mobile-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #5b9bff, #2064d5);
    color: #fff;
    font-weight: 800;
    letter-spacing: .05em;
    box-shadow: 0 10px 26px rgba(37, 107, 219, .35);
}

.sidebar-logo {
    width: 48px;
    height: 46px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 14px;
    font-size: 14px;
}

.sidebar-brand strong,
.sidebar-brand small,
.sidebar-source strong,
.sidebar-source small { display: block; }

.sidebar-brand strong { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.sidebar-brand small { margin-top: 2px; color: #99abc3; font-size: 11px; }

.sidebar-nav {
    position: relative;
    z-index: 1;
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 7px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 13px;
    color: #b7c7dc;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}

.sidebar-nav a:hover {
    background: rgba(255, 255, 255, .06);
    color: #fff;
    transform: translateX(2px);
}

.sidebar-nav a.active {
    border-color: rgba(126, 174, 255, .18);
    background: linear-gradient(90deg, rgba(59, 130, 246, .25), rgba(59, 130, 246, .10));
    color: #fff;
    box-shadow: inset 3px 0 #6ca5ff;
}

.sidebar-nav svg {
    width: 19px;
    flex: 0 0 auto;
    fill: currentColor;
}

.sidebar-source {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 13px 14px;
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 14px;
    background: rgba(255, 255, 255, .055);
    backdrop-filter: blur(12px);
}

.sidebar-source strong { font-size: 12px; font-weight: 600; }
.sidebar-source small { margin-top: 2px; color: #93a7c1; font-size: 10px; }

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #2cd889;
    box-shadow: 0 0 0 5px rgba(44, 216, 137, .12);
}

.dashboard-main {
    min-width: 0;
    padding: 38px 42px 24px;
}

.topbar,
.filter-panel,
.metric-grid,
.usage-card,
.dashboard-footer,
.management-layout,
.notice {
    width: 100%;
    max-width: 1360px;
    margin-right: auto;
    margin-left: auto;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 28px;
}

.topbar h1 {
    margin: 5px 0 7px;
    color: var(--navy-900);
    font-size: clamp(30px, 3vw, 40px);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -.045em;
}

.eyebrow {
    margin: 0;
    color: var(--blue-600);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .15em;
}

.eyebrow.light { color: #9bc2ff; }
.subtitle { margin: 0; color: var(--muted); font-size: 13px; }

.topbar-actions { display: flex; align-items: center; gap: 12px; }

.source-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 9px 15px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: rgba(255, 255, 255, .86);
    box-shadow: var(--shadow-xs);
}

.source-badge small,
.source-badge strong { display: block; }
.source-badge small { margin-bottom: 1px; color: var(--muted); font-size: 10px; }
.source-badge strong { color: var(--navy-800); font-size: 12px; font-weight: 700; }

button,
.filter-button,
.secondary-button,
.primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 700;
    text-decoration: none;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}

button:hover,
.secondary-button:hover,
.primary-button:hover { transform: translateY(-1px); }

.icon-button {
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--muted);
    box-shadow: var(--shadow-xs);
}

.icon-button:hover { border-color: #bfd1e8; color: var(--blue-600); box-shadow: var(--shadow-sm); }
.icon-button svg { width: 20px; }

.sidebar-nav svg,
.icon-button svg,
.section-icon svg,
.metric-icon svg,
.empty-icon svg {
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.filter-panel,
.usage-card,
.management-card {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .94);
    box-shadow: var(--shadow-sm);
}

.filter-panel {
    margin-bottom: 22px;
    padding: 20px 22px;
    border-radius: var(--radius-md);
}

.filter-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 17px;
}

.filter-heading > div:first-child { display: flex; align-items: center; gap: 11px; }
.filter-heading strong,
.filter-heading small { display: block; }
.filter-heading strong { color: var(--navy-900); font-size: 13px; font-weight: 700; }
.filter-heading small { margin-top: 2px; color: var(--muted); font-size: 10px; }

.section-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 39px;
    height: 39px;
    border-radius: 11px;
    background: var(--blue-50);
    color: var(--blue-600);
}

.section-icon svg { width: 18px; }
.quick-filters { display: flex; gap: 5px; padding: 4px; border-radius: 11px; background: #f1f5f9; }

.filter-button {
    min-height: 33px;
    padding: 7px 12px;
    background: transparent;
    color: var(--muted);
    font-size: 10px;
}

.filter-button:hover { color: var(--blue-700); }
.filter-button.active { background: #fff; color: var(--blue-700); box-shadow: 0 2px 8px rgba(25, 66, 124, .10); }

.date-filter { display: flex; align-items: flex-end; gap: 10px; }
.date-filter label { display: grid; flex: 0 1 190px; gap: 5px; }
.date-filter label span { color: var(--muted); font-size: 10px; font-weight: 700; }

.date-filter input,
.customer-form input[type="text"],
.customer-form input[type="email"],
.customer-form input[type="password"],
.login-card input {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: #fff;
    color: var(--text);
    transition: border-color .18s ease, box-shadow .18s ease;
}

.date-filter input { min-height: 40px; padding: 9px 11px; font-size: 11px; }

.date-filter input:focus,
.customer-form input:focus,
.login-card input:focus {
    border-color: #78aaf5;
    outline: 0;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, .10);
}

.date-arrow { align-self: center; margin-top: 21px; color: var(--muted-light); }

.date-filter button,
.primary-button,
.login-submit {
    min-height: 40px;
    padding: 10px 16px;
    background: linear-gradient(135deg, var(--blue-600), var(--blue-700));
    color: #fff;
    box-shadow: 0 7px 16px rgba(36, 107, 219, .18);
    font-size: 11px;
}

.date-filter button:hover,
.primary-button:hover,
.login-submit:hover { box-shadow: 0 10px 22px rgba(36, 107, 219, .25); }

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 17px;
    margin-bottom: 22px;
}

.metric-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 0;
    min-height: 128px;
    overflow: hidden;
    padding: 21px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fff;
    box-shadow: var(--shadow-sm);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.metric-card:hover { transform: translateY(-3px); border-color: #cfdaea; box-shadow: var(--shadow-md); }

.metric-card.primary {
    border-color: transparent;
    background:
        radial-gradient(circle at 100% 0, rgba(129, 178, 255, .34), transparent 52%),
        linear-gradient(145deg, #10294d 0%, #1754a1 63%, #2574dd 120%);
    color: #fff;
}

.metric-card.primary::after {
    position: absolute;
    right: -28px;
    bottom: -65px;
    width: 135px;
    height: 135px;
    border: 20px solid rgba(255, 255, 255, .055);
    border-radius: 50%;
    content: "";
}

.metric-icon {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    border-radius: 13px;
    background: rgba(255, 255, 255, .16);
    color: #fff;
}

.metric-icon.blue { background: var(--blue-50); color: var(--blue-600); }
.metric-icon.violet { background: #f1edff; color: var(--violet-600); }
.metric-icon.green { background: #eafaf3; color: var(--green-600); }
.metric-icon svg { width: 21px; }

.metric-card > div:last-child { min-width: 0; }
.metric-card span,
.metric-card strong,
.metric-card small { display: block; }
.metric-card span { color: var(--muted); font-size: 10px; font-weight: 600; }
.metric-card strong { margin: 4px 0 3px; color: var(--navy-900); font-size: clamp(20px, 2vw, 25px); font-weight: 800; line-height: 1.25; letter-spacing: -.035em; overflow-wrap: anywhere; }
.metric-card small { color: var(--muted-light); font-size: 9px; }
.metric-card.primary span,
.metric-card.primary small { color: rgba(255, 255, 255, .72); }
.metric-card.primary strong { color: #fff; }

.usage-card { overflow: hidden; border-radius: var(--radius-md); }

.card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 21px 23px;
    border-bottom: 1px solid var(--line);
}

.card-heading h2 { margin: 0 0 3px; color: var(--navy-900); font-size: 17px; font-weight: 750; letter-spacing: -.025em; }
.card-heading p { margin: 0; color: var(--muted); font-size: 10px; }
.result-count { padding: 6px 11px; border-radius: 999px; background: var(--blue-50); color: var(--blue-700); font-size: 9px; font-weight: 700; white-space: nowrap; }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; min-width: 670px; border-collapse: collapse; }
th,
td { text-align: left; }

thead th {
    padding: 13px 20px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
}

tbody td { padding: 16px 20px; border-bottom: 1px solid #edf1f6; font-size: 11px; }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: #f8fbff; }

.api-cell { display: flex; align-items: center; gap: 12px; }
.api-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border-radius: 11px;
    background: linear-gradient(145deg, #e7f1ff, #d8e9ff);
    color: var(--blue-700);
    font-size: 12px;
    font-weight: 800;
}

.api-cell strong,
.api-cell small { display: block; }
.api-cell strong { color: var(--navy-900); font-size: 11px; font-weight: 700; }
.api-cell small { margin-top: 2px; color: var(--muted-light); font-size: 8px; }
.request-pill { display: inline-flex; min-width: 42px; justify-content: center; padding: 5px 9px; border-radius: 999px; background: #f1f5f9; color: #475569; font-size: 10px; font-weight: 700; }
.cost-value { color: var(--blue-700); font-size: 11px; font-weight: 750; }
tfoot th { padding: 15px 20px; background: #f8fafc; color: var(--navy-900); font-size: 10px; }

.empty { padding: 58px 24px !important; text-align: center; }
.empty-icon { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; margin-bottom: 10px; border-radius: 14px; background: var(--blue-50); color: var(--blue-600); }
.empty-icon svg { width: 22px; }
.empty strong { display: block; margin-bottom: 4px; color: var(--navy-900); }
.empty p { margin: 0; color: var(--muted); }

.dashboard-footer { padding: 18px 4px 0; color: var(--muted-light); font-size: 9px; text-align: center; }

.secondary-button {
    min-height: 42px;
    padding: 10px 15px;
    border: 1px solid var(--line-strong);
    background: #fff;
    color: var(--navy-800);
    box-shadow: var(--shadow-xs);
    font-size: 11px;
}

.secondary-button:hover { border-color: #b8c9df; box-shadow: var(--shadow-sm); }
.notice { margin-bottom: 18px; padding: 12px 15px; border: 1px solid #bdebd6; border-radius: 12px; background: #edfbf5; color: #10714a; font-size: 11px; font-weight: 600; }

.management-layout { display: grid; grid-template-columns: minmax(330px, .82fr) minmax(0, 1.35fr); align-items: start; gap: 22px; }
.management-card { padding: 24px; border-radius: var(--radius-md); }
.form-card { position: sticky; top: 28px; }
.management-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 21px; }
.management-heading h2 { margin: 4px 0 0; color: var(--navy-900); font-size: 20px; font-weight: 750; letter-spacing: -.03em; }
.management-heading a { color: var(--blue-600); font-size: 10px; font-weight: 700; text-decoration: none; }

.customer-form { display: grid; gap: 16px; }
.customer-form > label { display: grid; gap: 6px; }
.customer-form > label > span { color: #40506a; font-size: 10px; font-weight: 700; }
.customer-form input[type="text"],
.customer-form input[type="email"],
.customer-form input[type="password"] { min-height: 43px; padding: 11px 13px; font-size: 12px; }
.customer-form label > small { color: var(--muted-light); font-size: 9px; }
.customer-form em { color: #c03636; font-size: 9px; font-style: normal; }
.customer-form ul { display: grid; gap: 4px; max-height: 245px; margin: 0; padding: 8px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); list-style: none; }
.customer-form ul label { display: flex; align-items: center; gap: 9px; padding: 8px 9px; border-radius: 8px; color: #40506a; cursor: pointer; font-size: 10px; font-weight: 500; transition: background .15s ease; }
.customer-form ul label:hover { background: #fff; }
.customer-form input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--blue-600); }
.field-error { padding: 10px 12px; border: 1px solid #f3c7c7; border-radius: 10px; background: #fff2f2; color: #a83232; font-size: 10px; }
.primary-button { width: 100%; min-height: 44px; margin-top: 2px; }

.user-list { display: grid; gap: 10px; }
.user-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 13px; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: #fff; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.user-row:hover { transform: translateY(-1px); border-color: #c7d6e8; box-shadow: var(--shadow-sm); }
.user-avatar { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(145deg, #e8f2ff, #d9e9ff); color: var(--blue-700); font-size: 14px; font-weight: 800; }
.user-info { min-width: 0; }
.user-info > strong,
.user-info > span { display: block; }
.user-info > strong { color: var(--navy-900); font-size: 12px; font-weight: 700; }
.user-info > span { margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.api-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.api-tags small { padding: 4px 7px; border-radius: 999px; background: var(--blue-50); color: var(--blue-700); font-size: 8px; font-weight: 600; }
.api-tags .muted-tag { background: #f1f5f9; color: var(--muted); }
.user-actions { display: grid; justify-items: end; gap: 8px; }
.user-actions a { color: var(--blue-600); font-size: 9px; font-weight: 700; text-decoration: none; }
.status-pill { padding: 5px 8px; border-radius: 999px; background: #eafaf3; color: #108153; font-size: 8px; font-weight: 700; white-space: nowrap; }
.status-pill.inactive { background: #fff0f0; color: #b23b3b; }
.empty-user-list { padding: 45px 20px; border: 1px dashed var(--line-strong); border-radius: 13px; text-align: center; }
.empty-user-list strong { color: var(--navy-900); }
.empty-user-list p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }

.member-cost-report { width: 100%; max-width: 1360px; margin: 22px auto 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-md); background: #fff; box-shadow: var(--shadow-sm); }
.member-report-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 23px 24px 18px; }
.member-report-header h2 { margin: 4px 0; color: var(--navy-900); font-size: 20px; letter-spacing: -.03em; }
.member-report-header p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 10px; }
.member-total { min-width: 210px; padding: 13px 16px; border: 1px solid #d7e6f8; border-radius: 12px; background: linear-gradient(145deg, #f8fbff, #edf5ff); text-align: right; }
.member-total span,
.member-total strong { display: block; }
.member-total span { color: var(--muted); font-size: 9px; font-weight: 700; }
.member-total strong { margin-top: 2px; color: var(--blue-700); font-size: 20px; font-weight: 800; letter-spacing: -.035em; }
.member-report-filter { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; padding: 17px 24px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.member-date-filter { justify-content: flex-end; }
.member-cost-table .user-avatar.compact { width: 36px; height: 36px; font-size: 12px; }
.member-cost-table .api-cell small { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-tags { margin-top: 0; }
.member-cost-value { color: var(--blue-700); font-size: 13px; font-weight: 800; }

.management-page .dashboard-main {
    background:
        radial-gradient(circle at 92% 3%, rgba(59, 130, 246, .08), transparent 24rem),
        linear-gradient(180deg, #f6f9fd 0%, #f2f6fb 100%);
}

.management-page .topbar { margin-bottom: 24px; }
.management-page .management-layout { grid-template-columns: minmax(360px, .78fr) minmax(520px, 1.35fr); gap: 24px; }
.management-page .management-card { position: relative; overflow: hidden; border-color: #dce5f0; box-shadow: 0 14px 38px rgba(20, 49, 90, .08); }
.management-page .management-card::before { position: absolute; top: 0; right: 0; left: 0; height: 4px; background: linear-gradient(90deg, var(--blue-600), #6aa4ff); content: ""; }
.management-page .management-heading { padding-top: 5px; }
.management-page .management-heading h2 { font-size: 21px; }
.management-page .customer-form { gap: 17px; }
.management-page .customer-form > label > span { color: #31445f; font-size: 11px; }
.management-page .customer-form input[type="text"],
.management-page .customer-form input[type="email"],
.management-page .customer-form input[type="password"] { min-height: 46px; background: #fbfdff; }
.management-page .customer-form ul { max-height: 220px; padding: 9px; border-color: #d8e2ee; background: #f7faff; }
.management-page .customer-form ul label { min-height: 36px; background: rgba(255, 255, 255, .7); }
.management-page .customer-form [id$="api_ids"] { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; max-height: 252px; padding: 9px; overflow-x: hidden; overflow-y: auto; border: 1px solid #d8e2ee; border-radius: 12px; background: #f7faff; scrollbar-color: #b8c9dd transparent; scrollbar-width: thin; }
.management-page .customer-form [id$="api_ids"] > div { min-width: 0; }
.management-page .customer-form [id$="api_ids"] label { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 8px 9px; overflow: hidden; border: 1px solid #e7edf5; border-radius: 9px; background: #fff; color: #33445d; cursor: pointer; font-size: 9px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; transition: border-color .15s ease, background .15s ease, color .15s ease; }
.management-page .customer-form [id$="api_ids"] label:hover { border-color: #b9cde7; background: var(--blue-50); color: var(--blue-700); }
.management-page .customer-form [id$="api_ids"] input { width: 15px; height: 15px; flex: 0 0 auto; accent-color: var(--blue-600); }
.management-page .primary-button { min-height: 47px; font-size: 12px; }
.management-page .user-list { gap: 12px; }
.management-page .user-row { padding: 16px; border-color: #dfe7f1; background: linear-gradient(145deg, #fff, #fbfdff); }
.management-page .user-row:hover { border-color: #b9cde6; box-shadow: 0 12px 28px rgba(20, 49, 90, .09); }
.management-page .user-avatar { box-shadow: inset 0 0 0 1px rgba(37, 107, 219, .08); }
.management-page .user-info > strong { font-size: 13px; }
.management-page .user-info > span { font-size: 10px; }
.management-page .user-actions a { padding: 6px 9px; border-radius: 8px; background: var(--blue-50); font-size: 9px; }
.management-page .member-cost-report { margin-top: 26px; border-color: #dce5f0; box-shadow: 0 16px 42px rgba(20, 49, 90, .09); }
.management-page .member-report-header { padding: 26px 28px 22px; background: linear-gradient(135deg, #fff 0%, #f7fbff 100%); }
.management-page .member-report-header h2 { font-size: 23px; }
.management-page .member-total { min-width: 240px; padding: 15px 18px; border-color: #cfe0f5; box-shadow: inset 0 1px 0 #fff; }
.management-page .member-total strong { font-size: 23px; }
.management-page .member-report-filter { padding: 18px 28px; background: #f7f9fc; }
.management-page .member-report-filter .quick-filters { padding: 5px; border: 1px solid #e2e9f2; background: #edf2f8; }
.management-page .member-report-filter .filter-button { min-height: 36px; padding: 8px 15px; font-size: 10px; }
.management-page .member-report-filter .filter-button.active { color: #fff; background: linear-gradient(135deg, var(--blue-600), var(--blue-700)); box-shadow: 0 7px 16px rgba(36, 107, 219, .19); }
.management-page .member-date-filter input { min-width: 155px; background: #fff; }
.management-page .member-cost-table thead th { padding: 14px 24px; background: #f4f7fb; }
.management-page .member-cost-table tbody td { padding: 17px 24px; }
.management-page .member-cost-table tbody tr:last-child td { border-bottom: 0; }
.management-page .member-cost-value { display: inline-flex; min-width: 104px; justify-content: flex-end; padding: 7px 10px; border-radius: 9px; background: var(--blue-50); font-size: 13px; }

.login-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 30px;
    background:
        radial-gradient(circle at 10% 15%, rgba(59, 130, 246, .14), transparent 25rem),
        radial-gradient(circle at 90% 85%, rgba(80, 124, 197, .12), transparent 26rem),
        #edf3fa;
}

.login-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(430px, .9fr);
    width: min(1080px, 100%);
    min-height: 620px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .82);
    border-radius: 28px;
    background: #fff;
    box-shadow: 0 35px 95px rgba(14, 42, 80, .18);
}

.login-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    padding: 54px;
    background:
        radial-gradient(circle at 95% 5%, rgba(95, 156, 255, .32), transparent 19rem),
        linear-gradient(145deg, #08182d 0%, #123969 62%, #1e68bd 125%);
    color: #fff;
}

.login-brand::after {
    position: absolute;
    right: -90px;
    bottom: -95px;
    width: 300px;
    height: 300px;
    border: 45px solid rgba(255, 255, 255, .045);
    border-radius: 50%;
    content: "";
}

.brand-mark,
.mobile-mark { width: 52px; height: 50px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 15px; font-size: 15px; }
.mobile-mark { display: none; margin-bottom: 24px; }
.login-brand > div { position: relative; z-index: 1; }
.login-brand h1 { margin: 13px 0 17px; font-size: clamp(36px, 4vw, 46px); font-weight: 800; line-height: 1.17; letter-spacing: -.05em; }
.login-brand p:not(.eyebrow) { max-width: 460px; margin: 0; color: #c1d2e8; font-size: 13px; line-height: 1.8; }
.brand-features { display: grid; gap: 11px; color: #d7e4f3; font-size: 11px; font-weight: 500; }

.login-card { display: flex; flex-direction: column; justify-content: center; padding: 60px 55px; }
.login-heading { margin-bottom: 28px; }
.login-heading h2 { margin: 7px 0 9px; color: var(--navy-900); font-size: 29px; font-weight: 800; line-height: 1.25; letter-spacing: -.04em; }
.login-form { display: grid; gap: 17px; }
.login-form label { display: grid; gap: 7px; }
.login-form label > span { color: #40506a; font-size: 10px; font-weight: 700; }
.login-card input { min-height: 46px; padding: 12px 13px; font-size: 12px; }
.password-field { position: relative; }
.password-field input { padding-right: 65px; }
.password-toggle { position: absolute; top: 50%; right: 7px; min-height: 32px; padding: 6px 9px; transform: translateY(-50%); background: transparent; color: var(--blue-600); font-size: 9px; }
.password-toggle:hover { transform: translateY(-50%); background: var(--blue-50); }
.login-submit { display: flex; justify-content: space-between; width: 100%; min-height: 47px; margin-top: 3px; padding: 12px 16px; }
.error { display: grid; gap: 2px; margin: -8px 0 18px; padding: 12px 14px; border: 1px solid #f1c7c7; border-radius: 11px; background: #fff2f2; color: #a83636; font-size: 10px; }
.error strong { font-size: 11px; }
.login-help { margin: 18px 0 0; color: var(--muted-light); font-size: 9px; text-align: center; }

@media (max-width: 1180px) {
    .app-shell { grid-template-columns: 232px minmax(0, 1fr); }
    .dashboard-main { padding: 32px 28px 22px; }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .management-layout { grid-template-columns: minmax(300px, .8fr) minmax(0, 1.2fr); }
    .management-page .management-layout { grid-template-columns: minmax(320px, .8fr) minmax(460px, 1.2fr); }
}

@media (max-width: 900px) {
    .app-shell { display: block; }
    .sidebar { position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; width: 100%; height: auto; padding: 16px 20px; }
    .sidebar::after,
    .sidebar-source { display: none; }
    .sidebar-brand { padding: 0; }
    .sidebar-brand small { display: none; }
    .sidebar-logo { width: 43px; height: 41px; }
    .sidebar-nav { flex-direction: row; justify-content: flex-end; }
    .sidebar-nav a { min-height: 41px; padding: 9px 12px; }
    .sidebar-nav a.active { box-shadow: none; }
    .dashboard-main { padding: 28px 22px 20px; }
    .form-card { position: static; }
    .management-layout { grid-template-columns: 1fr; }
    .management-page .management-layout { grid-template-columns: 1fr; }
    .login-shell { grid-template-columns: 1fr; width: min(560px, 100%); min-height: 0; }
    .login-brand { display: none; }
    .mobile-mark { display: inline-flex; }
}

@media (max-width: 680px) {
    .sidebar { display: block; padding: 15px; }
    .sidebar-brand { justify-content: center; margin-bottom: 12px; }
    .sidebar-nav { justify-content: center; }
    .sidebar-nav a { flex: 1; justify-content: center; font-size: 11px; }
    .dashboard-main { padding: 24px 14px 18px; }
    .topbar { align-items: flex-start; margin-bottom: 22px; }
    .topbar h1 { font-size: 29px; }
    .topbar-actions { align-items: flex-end; }
    .source-badge { display: none; }
    .filter-panel { padding: 17px; }
    .filter-heading { align-items: flex-start; flex-direction: column; }
    .quick-filters { width: 100%; }
    .filter-button { flex: 1; }
    .date-filter { display: grid; grid-template-columns: 1fr 1fr; }
    .date-filter label { min-width: 0; }
    .date-arrow { display: none; }
    .date-filter button { grid-column: 1 / -1; }
    .metric-grid { grid-template-columns: 1fr 1fr; gap: 11px; }
    .metric-card { min-height: 122px; padding: 17px; }
    .metric-icon { width: 40px; height: 40px; }
    .metric-card strong { font-size: 19px; }
    .card-heading { padding: 18px; }
    .management-card { padding: 19px; }
    .user-row { grid-template-columns: 42px minmax(0, 1fr) auto; }
    .member-report-filter { align-items: stretch; flex-direction: column; }
    .member-date-filter { width: 100%; justify-content: flex-start; }
    .management-page .member-report-header,
    .management-page .member-report-filter { padding-right: 19px; padding-left: 19px; }
    .management-page .member-date-filter input { min-width: 0; }
    .management-page .customer-form [id$="api_ids"] { grid-template-columns: 1fr; }
    .login-page { padding: 16px; }
    .login-shell { border-radius: 22px; }
    .login-card { min-height: 590px; padding: 36px 26px; }
    .login-heading h2 { font-size: 26px; }
}

@media (max-width: 460px) {
    .sidebar-brand { justify-content: flex-start; }
    .sidebar-nav a { padding: 9px 8px; }
    .sidebar-nav svg { width: 17px; }
    .topbar { display: block; }
    .topbar > .secondary-button { margin-top: 16px; }
    .topbar-actions { position: absolute; top: 159px; right: 14px; }
    .metric-grid { grid-template-columns: 1fr; }
    .metric-card { min-height: 105px; }
    .card-heading { align-items: flex-start; }
    .result-count { white-space: normal; text-align: center; }
    .user-row { grid-template-columns: 42px minmax(0, 1fr); }
    .user-actions { grid-column: 1 / -1; grid-row: auto; display: flex; align-items: center; justify-content: space-between; }
    .member-report-header { align-items: stretch; flex-direction: column; }
    .member-total { min-width: 0; text-align: left; }
    .member-date-filter { display: grid; grid-template-columns: 1fr 1fr; }
    .member-date-filter button { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}
