:root {
    --bg: #edf2fb;
    --bg-soft: #f6f8ff;
    --surface: #ffffff;
    --surface-alt: #f8faff;
    --sidebar-start: #0f172a;
    --sidebar-end: #1e293b;
    --sidebar-border: rgba(255, 255, 255, 0.14);
    --primary: #2f5fff;
    --primary-strong: #2648ce;
    --teal: #0ea5a4;
    --text: #0f172a;
    --text-soft: #5a6b87;
    --border: #d8e1f1;
    --danger: #d9485f;
    --success: #1f9d61;
    --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.12);
    --shadow-md: 0 8px 20px rgba(15, 23, 42, 0.08);
    --radius-xl: 18px;
    --radius-lg: 14px;
    --radius-md: 10px;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    color: var(--text);
    font-family: 'Sora', 'Segoe UI', Tahoma, sans-serif;
    background:
        radial-gradient(1200px 500px at 8% -20%, rgba(47, 95, 255, 0.14), transparent 60%),
        radial-gradient(800px 400px at 100% 0%, rgba(14, 165, 164, 0.12), transparent 62%),
        var(--bg);
}

a {
    color: inherit;
    text-decoration: none;
}

.admin-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 272px 1fr;
    gap: 18px;
    padding: 18px;
}

.admin-sidebar {
    background: linear-gradient(160deg, var(--sidebar-start), var(--sidebar-end));
    border-radius: var(--radius-xl);
    border: 1px solid var(--sidebar-border);
    color: #dbe7ff;
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: sticky;
    top: 18px;
    max-height: calc(100vh - 36px);
    overflow: auto;
    box-shadow: var(--shadow-lg);
}

.admin-sidebar .brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 12px;
    margin-bottom: 4px;
    border-radius: var(--radius-md);
    background: linear-gradient(145deg, rgba(47, 95, 255, 0.24), rgba(14, 165, 164, 0.12));
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.brand-badge {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #fff;
    background: linear-gradient(145deg, #2f5fff, #5246e5);
    box-shadow: 0 8px 18px rgba(82, 70, 229, 0.45);
}

.brand-badge img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    border-radius: 8px;
}

.brand-copy strong {
    display: block;
    color: #f8fbff;
    font-size: 15px;
    margin-bottom: 2px;
}

.brand-copy small {
    color: #a8bbdc;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.admin-sidebar a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 10px;
    color: #d4def3;
    font-size: 13px;
    font-weight: 500;
    transition: 0.2s ease;
}

.admin-sidebar a::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: rgba(173, 188, 214, 0.5);
    transition: 0.2s ease;
}

.admin-sidebar a:hover,
.admin-sidebar a.active {
    color: #ffffff;
    background: linear-gradient(140deg, rgba(47, 95, 255, 0.3), rgba(47, 95, 255, 0.12));
    transform: translateX(2px);
}

.admin-sidebar a:hover::before,
.admin-sidebar a.active::before {
    background: #4ce0cf;
    box-shadow: 0 0 0 4px rgba(76, 224, 207, 0.18);
}

.admin-main {
    min-width: 0;
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 14px;
}

.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 16px 20px;
    background: linear-gradient(145deg, #ffffff, #f8fbff);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.topbar-title h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.topbar-title p {
    margin: 4px 0 0;
    color: var(--text-soft);
    font-size: 12px;
}

.topbar-user {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-alt);
    color: #1f3058;
    font-size: 12px;
    font-weight: 600;
}

.user-indicator {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #1dd983;
    box-shadow: 0 0 0 4px rgba(29, 217, 131, 0.16);
}

.admin-content {
    min-width: 0;
}

.admin-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    margin-bottom: 14px;
    overflow: hidden;
}

.admin-card .head {
    padding: 14px 16px;
    font-weight: 700;
    font-size: 13px;
    color: #1b2f53;
    background: linear-gradient(180deg, #f8faff, #f2f6ff);
    border-bottom: 1px solid var(--border);
}

.admin-card .body {
    padding: 16px;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.btn {
    appearance: none;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    padding: 10px 13px;
    cursor: pointer;
    transition: 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-blue {
    color: #fff;
    background: linear-gradient(145deg, var(--primary), #5246e5);
    box-shadow: 0 8px 18px rgba(47, 95, 255, 0.28);
}

.btn-blue:hover {
    background: linear-gradient(145deg, var(--primary-strong), #4338ca);
}

.btn-muted {
    color: #30476f;
    border-color: #cfdaef;
    background: linear-gradient(180deg, #ffffff, #f3f7ff);
}

.btn-muted:hover {
    border-color: #b8c7e1;
    background: linear-gradient(180deg, #f7faff, #edf3ff);
}

.btn-danger {
    color: #fff;
    background: linear-gradient(145deg, #ef476f, #d9485f);
    box-shadow: 0 8px 16px rgba(217, 72, 95, 0.24);
}

.btn-success {
    color: #fff;
    background: linear-gradient(145deg, #23b26d, #1f9d61);
    box-shadow: 0 8px 16px rgba(31, 157, 97, 0.25);
}

.btn-warning {
    color: #fff;
    background: linear-gradient(145deg, #ff9f1c, #ef6c1a);
    box-shadow: 0 8px 16px rgba(239, 108, 26, 0.24);
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #cfd9eb;
    border-radius: 10px;
    background: #ffffff;
    color: #1a2742;
    font-size: 13px;
    padding: 9px 11px;
    min-height: 38px;
    font-family: inherit;
    transition: 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #3e74ff;
    box-shadow: 0 0 0 4px rgba(62, 116, 255, 0.16);
}

textarea {
    min-height: 90px;
    resize: vertical;
}

.form-group {
    margin-bottom: 11px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #2f4469;
    font-size: 12px;
    font-weight: 600;
}

.toolbar input[type="text"],
.toolbar input[type="date"] {
    width: auto;
    min-width: 180px;
    flex: 1 1 200px;
}

.table-wrap {
    overflow: auto;
    border: 1px solid #dbe4f3;
    border-radius: 12px;
    background: #f8fbff;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1040px;
    background: #ffffff;
}

th,
td {
    border-bottom: 1px solid #e3eaf7;
    padding: 10px;
    font-size: 12px;
    vertical-align: top;
}

th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: linear-gradient(145deg, #273b80, #2f5fff);
    color: #fff;
    text-align: left;
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

tbody tr:nth-child(even) {
    background: #fbfdff;
}

tbody tr:hover {
    background: #f1f6ff;
}

td .inline {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.summary-box {
    border-radius: var(--radius-lg);
    border: 1px solid #d8e4fb;
    background: linear-gradient(145deg, #ffffff, #f8fbff);
    box-shadow: var(--shadow-md);
    padding: 15px;
}

.summary-box h4 {
    margin: 0;
    color: #5d7091;
    font-size: 12px;
    font-weight: 600;
}

.summary-box strong {
    display: block;
    margin-top: 10px;
    font-size: 28px;
    letter-spacing: -0.02em;
    color: #13264b;
}

.alert {
    border-radius: 12px;
    padding: 11px 13px;
    margin-bottom: 12px;
    border: 1px solid;
    font-size: 12px;
    font-weight: 600;
}

.alert-success {
    border-color: #b6eacb;
    background: #e5fbef;
    color: #0f6d3f;
}

.alert-error {
    border-color: #f5c4cc;
    background: #ffecef;
    color: #9d2437;
}

.state-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.state-pill::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: currentColor;
    opacity: .85;
}

.state-pill.is-active {
    color: #0e8a57;
    background: rgba(31, 157, 97, 0.12);
}

.state-pill.is-disabled {
    color: #9d2437;
    background: rgba(217, 72, 95, 0.12);
}

.state-pill.is-frozen {
    color: #b45309;
    background: rgba(245, 158, 11, 0.14);
}

.freeze-note {
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255, 248, 235, .9), rgba(255, 237, 213, .82));
    border: 1px solid rgba(245, 158, 11, .22);
    color: #7c3f08;
    font-size: 12px;
    line-height: 1.55;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(12, 20, 37, 0.54);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 900;
    padding: 10px;
}

.modal.active {
    display: flex;
}

.modal-dialog {
    width: min(760px, calc(100vw - 20px));
    max-height: calc(100vh - 20px);
    overflow: auto;
    border-radius: var(--radius-lg);
    border: 1px solid #d2def3;
    background: #ffffff;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 700;
    color: #1f305a;
    background: linear-gradient(180deg, #f8fbff, #eef4ff);
    border-bottom: 1px solid var(--border);
}

.modal-body {
    padding: 14px;
}

.quick-status {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 12px;
}

.quick-status button {
    border: 1px solid #ccdaf5;
    background: #f4f8ff;
    color: #2b406a;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    padding: 7px 10px;
    cursor: pointer;
    transition: 0.2s ease;
}

.quick-status button:hover {
    background: #e8f0ff;
    border-color: #9ab4ec;
}

.quick-status .quick-tag {
    border: 1px solid transparent;
    color: #ffffff;
}

.quick-status .quick-tag.qs-primary {
    background: linear-gradient(145deg, #5468ff, #6951f0);
}

.quick-status .quick-tag.qs-info {
    background: linear-gradient(145deg, #0ea5a4, #1288b0);
}

.quick-status .quick-tag.qs-success {
    background: linear-gradient(145deg, #14b86a, #0f9b56);
}

.quick-status .quick-tag.qs-warning {
    background: linear-gradient(145deg, #f59e0b, #ea7b1c);
}

.quick-status .quick-tag.qs-danger {
    background: linear-gradient(145deg, #ef476f, #d72f57);
}

.quick-status .quick-tag:hover {
    filter: brightness(0.95);
    border-color: rgba(255, 255, 255, 0.55);
}

.quick-status .quick-tag.is-selected {
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.16);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.form-grid .full {
    grid-column: 1 / -1;
}

.kyc-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.kyc-grid img {
    width: 100%;
    border: 1px solid #d4e0f3;
    border-radius: 12px;
    height: 220px;
    object-fit: cover;
    background: #f3f7ff;
}

hr {
    border: 0;
    border-top: 1px solid #e2ebf8;
    margin: 16px 0;
}

.admin-login-body {
    min-height: 100vh;
    margin: 0;
    display: grid;
    place-items: center;
    padding: 18px;
    background:
        radial-gradient(850px 450px at 0% 0%, rgba(47, 95, 255, 0.28), transparent 58%),
        radial-gradient(680px 350px at 100% 100%, rgba(14, 165, 164, 0.22), transparent 58%),
        #0f172a;
}

.admin-login-shell {
    width: min(430px, 100%);
}

.admin-login-card {
    border-color: rgba(255, 255, 255, 0.24);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.32);
}

.admin-login-card .head {
    text-align: center;
    font-size: 18px;
    letter-spacing: -0.01em;
    background: linear-gradient(145deg, #2f5fff, #4338ca);
    color: #ffffff;
    border-bottom: 0;
}

.auth-field {
    margin-bottom: 12px;
}

.auth-submit {
    width: 100%;
    margin-top: 4px;
    min-height: 40px;
}

@media (max-width: 1200px) {
    .admin-layout {
        grid-template-columns: 240px 1fr;
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }

    .kyc-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 930px) {
    .admin-layout {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 12px;
    }

    .admin-sidebar {
        position: static;
        max-height: none;
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px;
    }

    .admin-sidebar .brand {
        width: 100%;
        margin-bottom: 2px;
    }

    .admin-sidebar a {
        width: auto;
        padding: 9px 11px;
    }

    .admin-topbar {
        padding: 12px;
    }

    .topbar-title h1 {
        font-size: 18px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .admin-card .body,
    .modal-body {
        padding: 12px;
    }

    .btn {
        width: 100%;
    }

    td .inline .btn,
    td .inline form {
        width: 100%;
    }

    td .inline form .btn {
        width: 100%;
    }

    .toolbar input[type="text"],
    .toolbar input[type="date"] {
        min-width: 100%;
    }
}

/* ===== Liquid Glass Theme ===== */
body {
    position: relative;
    overflow-x: hidden;
}

body::before,
body::after {
    content: '';
    position: fixed;
    pointer-events: none;
    z-index: 0;
    width: 34rem;
    height: 34rem;
    border-radius: 50%;
    filter: blur(16px);
    opacity: .36;
}

body::before {
    top: -10rem;
    left: -8rem;
    background: radial-gradient(circle, rgba(126, 175, 255, .85), rgba(126, 175, 255, 0) 68%);
    animation: adminBlobFloatA 18s ease-in-out infinite;
}

body::after {
    right: -10rem;
    bottom: -14rem;
    background: radial-gradient(circle, rgba(86, 207, 202, .8), rgba(86, 207, 202, 0) 66%);
    animation: adminBlobFloatB 20s ease-in-out infinite;
}

@keyframes adminBlobFloatA {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(22px, 20px, 0) scale(1.07); }
}

@keyframes adminBlobFloatB {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(-20px, -18px, 0) scale(1.08); }
}

.admin-layout {
    position: relative;
    z-index: 1;
}

.admin-sidebar,
.admin-topbar,
.admin-card,
.summary-box,
.modal-dialog {
    background: rgba(255, 255, 255, .66);
    border: 1px solid rgba(255, 255, 255, .55);
    box-shadow: 0 14px 34px rgba(19, 40, 88, .18), 0 0 0 1px rgba(255, 255, 255, .22) inset;
    backdrop-filter: blur(16px) saturate(145%);
    -webkit-backdrop-filter: blur(16px) saturate(145%);
}

.admin-sidebar {
    background:
        linear-gradient(165deg, rgba(18, 32, 70, .8), rgba(30, 58, 118, .66));
    border-color: rgba(196, 216, 255, .28);
}

.admin-sidebar .brand {
    background: linear-gradient(145deg, rgba(80, 139, 255, .35), rgba(89, 210, 203, .2));
    border-color: rgba(216, 234, 255, .4);
}

.admin-topbar {
    background:
        linear-gradient(140deg, rgba(255, 255, 255, .72), rgba(240, 248, 255, .66)),
        radial-gradient(circle at 20% 20%, rgba(117, 157, 255, .2), transparent 50%);
}

.admin-card .head {
    background:
        linear-gradient(180deg, rgba(248, 252, 255, .76), rgba(240, 247, 255, .72));
}

table {
    background: rgba(255, 255, 255, .5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

thead th {
    background: rgba(235, 244, 255, .78);
}

tbody tr:nth-child(even) {
    background: rgba(248, 252, 255, .7);
}

tbody tr:hover {
    background: rgba(214, 232, 255, .5);
}

input,
select,
textarea {
    background: rgba(255, 255, 255, .72);
    border-color: rgba(178, 202, 234, .9);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .35) inset;
}

.btn-blue,
.btn-success {
    background:
        linear-gradient(135deg, rgba(56, 126, 255, .9), rgba(65, 100, 232, .92));
    border-color: rgba(199, 223, 255, .42);
    box-shadow: 0 8px 20px rgba(28, 66, 140, .22), 0 0 0 1px rgba(255, 255, 255, .16) inset;
}

.btn-danger {
    background:
        linear-gradient(135deg, rgba(225, 70, 90, .9), rgba(180, 38, 52, .92));
    border-color: rgba(255, 214, 220, .45);
    box-shadow: 0 8px 18px rgba(140, 34, 47, .22), 0 0 0 1px rgba(255, 255, 255, .14) inset;
}

.btn-muted {
    background: rgba(230, 238, 252, .72);
    border-color: rgba(173, 190, 222, .7);
}

.admin-login-body {
    background:
        radial-gradient(840px 460px at 0% 0%, rgba(108, 154, 255, .46), transparent 58%),
        radial-gradient(720px 380px at 100% 100%, rgba(86, 211, 205, .34), transparent 58%),
        linear-gradient(180deg, #0e1f49 0%, #14306d 100%);
}

@media (prefers-reduced-motion: reduce) {
    body::before,
    body::after {
        animation: none;
    }
}

/* Desktop polish */
@media (min-width: 1280px) {
    .admin-layout {
        grid-template-columns: 296px 1fr;
        gap: 22px;
        padding: 22px;
    }

    .admin-sidebar {
        border-radius: 22px;
        padding: 16px 14px;
    }

    .admin-sidebar .brand {
        border-radius: 14px;
        padding: 16px 14px;
    }

    .admin-topbar {
        border-radius: 16px;
        padding: 18px 22px;
    }

    .topbar-title h1 {
        font-size: 24px;
    }

    .admin-card {
        border-radius: 16px;
    }

    .admin-card .head {
        padding: 15px 18px;
        font-size: 14px;
    }

    .admin-card .body {
        padding: 18px;
    }

    .summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 14px;
    }

    .summary-box {
        min-height: 128px;
        border-radius: 14px;
    }

    .summary-box strong {
        font-size: 30px;
    }

    .table-wrap {
        border-radius: 14px;
    }
}

@media (hover: hover) and (min-width: 1024px) {
    .admin-card,
    .summary-box,
    .btn {
        transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
    }

    .admin-card:hover,
    .summary-box:hover {
        transform: translateY(-2px);
        box-shadow: 0 18px 34px rgba(19, 40, 88, .2), 0 0 0 1px rgba(255, 255, 255, .24) inset;
        border-color: rgba(221, 236, 255, .8);
    }

    .btn:hover {
        box-shadow: 0 10px 20px rgba(27, 59, 117, .24);
    }
}
