:root {
    --navy: #102a48;
    --navy-soft: #173b63;
    --primary: #1261a7;
    --teal: #0d8b9d;
    --surface: #ffffff;
    --canvas: #f4f7fb;
    --line: #e1e9f2;
    --muted: #6d7d91;
    --sidebar-width: 278px;
}

* { box-sizing: border-box; }
body { color: var(--navy); }
.admin-body { background: var(--canvas); min-height: 100vh; }
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    padding: 24px 18px;
    background: #0e2947;
    color: white;
    flex-direction: column;
    z-index: 1030;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    text-decoration: none;
    padding: 4px 8px 26px;
}
.sidebar-brand strong, .sidebar-brand small { display: block; }
.sidebar-brand small { color: #9eb3c9; font-size: .72rem; margin-top: 2px; }
.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    background: linear-gradient(135deg, #1768b1, #0f91a0);
    font-weight: 800;
    letter-spacing: -.02em;
    box-shadow: 0 9px 22px rgba(6, 112, 153, .25);
    flex: 0 0 auto;
}
.sidebar-nav { display: grid; gap: 7px; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    color: #aec0d1;
    text-decoration: none;
    transition: .18s ease;
}
.sidebar-nav a i { font-size: 1.1rem; }
.sidebar-nav a:hover, .sidebar-nav a.active {
    background: rgba(255,255,255,.10);
    color: #fff;
}
.sidebar-nav a.active { box-shadow: inset 3px 0 #38b8c5; }
.sidebar-user {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    border-top: 1px solid rgba(255,255,255,.12);
    padding: 18px 7px 2px;
}
.sidebar-user strong, .sidebar-user small { display: block; }
.sidebar-user strong {
    color: white;
    font-size: .88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-user small { color: #90a8bf; font-size: .72rem; }
.avatar {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #d9f4f5;
    color: #11798a;
    font-weight: 800;
    flex: 0 0 auto;
}
.min-w-0 { min-width: 0; }
.icon-button {
    border: 0;
    background: transparent;
    color: #9eb3c9;
    padding: 6px;
}
.admin-main { margin-left: var(--sidebar-width); min-height: 100vh; }
.topbar {
    height: 98px;
    padding: 18px 34px;
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(255,255,255,.92);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 1020;
    backdrop-filter: blur(12px);
}
.topbar > div:nth-child(2) { margin-right: auto; }
.topbar h1 { font-size: 1.55rem; margin: 2px 0 0; font-weight: 750; }
.topbar-kicker, .eyebrow {
    color: var(--primary);
    font-size: .7rem;
    letter-spacing: .14em;
    font-weight: 800;
}
.admin-content { padding: 30px 34px 48px; max-width: 1500px; margin: 0 auto; }
.panel-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 10px 28px rgba(18, 50, 83, .045);
}
.panel-card-header {
    padding: 20px 22px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.panel-card-body { padding: 22px; }
.metric-card {
    padding: 22px;
    height: 100%;
    position: relative;
    overflow: hidden;
}
.metric-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    background: #eaf3fc;
    color: var(--primary);
    font-size: 1.25rem;
}
.metric-card small { display: block; color: var(--muted); margin-top: 18px; }
.metric-card strong { display: block; font-size: 1.85rem; margin-top: 2px; }
.btn-primary {
    --bs-btn-bg: #1261a7;
    --bs-btn-border-color: #1261a7;
    --bs-btn-hover-bg: #0f528e;
    --bs-btn-hover-border-color: #0f528e;
    border-radius: 10px;
    font-weight: 650;
}
.btn, .form-control, .form-select { border-radius: 10px; }
.form-control, .form-select {
    border-color: #d8e2ed;
    min-height: 46px;
    padding: .68rem .85rem;
}
.form-control:focus, .form-select:focus {
    border-color: #75b4dd;
    box-shadow: 0 0 0 .22rem rgba(18, 97, 167, .11);
}
.form-label { font-size: .86rem; font-weight: 700; color: #29445f; }
.form-text { color: #8190a2; }
.table { --bs-table-bg: transparent; }
.table thead th {
    color: #789;
    font-size: .72rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    font-weight: 800;
    padding: 13px 16px;
    border-bottom-color: var(--line);
}
.table tbody td { padding: 15px 16px; border-bottom-color: #edf1f6; vertical-align: middle; }
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 750;
}
.status-badge.active { color: #0b795f; background: #e6f8f1; }
.status-badge.passive { color: #8a5960; background: #f7ecee; }
.status-badge::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}
.action-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.action-group .btn { padding: .38rem .58rem; }
.empty-state { text-align: center; padding: 52px 20px; color: var(--muted); }
.empty-state i { font-size: 2.5rem; color: #a8bfd4; }
.field-card {
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}
.field-order {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: #edf5fc;
    color: var(--primary);
    font-weight: 800;
}
.field-card .field-main { flex: 1; min-width: 0; }
.field-card .field-main strong, .field-card .field-main small { display: block; }
.field-card .field-main small { color: var(--muted); margin-top: 3px; }
.code-chip {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    padding: 3px 7px;
    background: #edf3f8;
    border-radius: 6px;
    font-size: .78rem;
}
.language-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 9px;
    border-radius: 9px;
    background: #edf5fc;
    color: #47647e;
    font-size: .76rem;
    white-space: nowrap;
}
.language-badge strong {
    color: var(--primary);
    font-size: .7rem;
    letter-spacing: .04em;
}
.option-row {
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #f9fbfd;
    margin-bottom: 12px;
}
.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 12% 15%, rgba(56,184,197,.13), transparent 24rem),
        radial-gradient(circle at 88% 90%, rgba(18,97,167,.13), transparent 28rem),
        #f3f7fb;
}
.auth-card {
    width: min(92vw, 460px);
    background: white;
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: 0 24px 70px rgba(16,42,72,.11);
    padding: 38px;
}
.admin-offcanvas { background: #0e2947; color: white; }
.admin-offcanvas .btn-close { filter: invert(1); }
.admin-offcanvas .offcanvas-body { padding-top: 0; }

@media (max-width: 991.98px) {
    .admin-main { margin-left: 0; }
    .admin-content { padding: 22px 18px 40px; }
    .topbar { height: 82px; padding: 14px 18px; }
    .topbar h1 { font-size: 1.25rem; }
}

@media (max-width: 575.98px) {
    .auth-card { padding: 26px 22px; }
    .panel-card-body, .panel-card-header { padding: 17px; }
    .field-card { align-items: flex-start; flex-wrap: wrap; }
    .field-card .action-group { width: 100%; padding-left: 52px; }
}
