:root {
    --bg-100: #020617;
    --bg-150: #07111f;
    --bg-200: #0f172a;
    --bg-250: #111c31;
    --bg-300: #1e293b;
    --border: rgba(148, 163, 184, .18);
    --border-strong: rgba(148, 163, 184, .28);
    --white-100: #ffffff;
    --white-90: rgba(255, 255, 255, .9);
    --white-70: rgba(255, 255, 255, .7);
    --white-50: rgba(255, 255, 255, .5);
    --muted: #94a3b8;
    --blue: #38bdf8;
    --green: #22c55e;
    --yellow: #facc15;
    --orange: #fb923c;
    --red: #ef4444;
    --purple: #a78bfa;
    --pink: #f472b6;
    --cyan: #22d3ee;
    --teal: #2dd4bf;
    --indigo: #818cf8;
    --shadow: 0 24px 70px rgba(0, 0, 0, .35);
    --radius: 18px;
    --sidebar-width: 282px;
    --sidebar-mini: 86px;
}

[data-theme="light"] {
    --bg-100: #f8fafc;
    --bg-150: #f1f5f9;
    --bg-200: #ffffff;
    --bg-250: #f8fafc;
    --bg-300: #e2e8f0;
    --border: rgba(15, 23, 42, .12);
    --border-strong: rgba(15, 23, 42, .22);
    --white-100: #020617;
    --white-90: rgba(2, 6, 23, .9);
    --white-70: rgba(2, 6, 23, .7);
    --white-50: rgba(2, 6, 23, .5);
    --muted: #64748b;
    --shadow: 0 24px 70px rgba(15, 23, 42, .12);
}

* {
    box-sizing: border-box;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

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

body {
    margin: 0;
    font-family: Inter, Segoe UI, Arial, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(56, 189, 248, .12), transparent 34%),
        radial-gradient(circle at bottom right, rgba(167, 139, 250, .12), transparent 28%),
        var(--bg-100);
    color: var(--white-90);
}

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

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

.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    min-height: 100dvh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100dvh;
    background: linear-gradient(180deg, var(--bg-200), var(--bg-150));
    border-right: 1px solid var(--border);
    padding: 18px 14px 82px;
    overflow-y: auto;
    overflow-x: hidden;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 10px 18px;
}

.brand-icon-soft,
.auth-icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(56, 189, 248, .2), rgba(244, 114, 182, .16));
    border: 1px solid var(--border);
    color: var(--blue);
    font-size: 24px;
}

.brand-text strong {
    display: block;
    font-size: 18px;
    letter-spacing: -.02em;
}

.brand-text span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-top: 3px;
}

.sidebar-user-card {
    margin: 0 8px 18px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(255, 255, 255, .03);
}

.sidebar-user-meta strong,
.sidebar-user-meta span {
    font-size: 13px;
}

.sidebar-user-meta span {
    color: var(--muted);
}


.sidebar-edge-toggle {
    position: fixed;
    left: calc(var(--sidebar-width) - 18px);
    top: 88px;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-200);
    color: var(--white-90);
    cursor: pointer;
    z-index: 10;
}

.sidebar-collapsed {
    grid-template-columns: var(--sidebar-mini) 1fr;
}

.sidebar-collapsed .sidebar {
    padding-left: 12px;
    padding-right: 12px;
}

.sidebar-collapsed .brand-text,
.sidebar-collapsed .sidebar-user-card,
.sidebar-collapsed .nav-section,
.sidebar-collapsed .nav span {
    display: none;
}

.sidebar-collapsed .brand {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

.sidebar-collapsed .nav a {
    justify-content: center;
}

.sidebar-collapsed .sidebar-edge-toggle {
    left: calc(var(--sidebar-mini) - 18px);
}

.sidebar-collapsed .sidebar-edge-toggle i {
    transform: rotate(180deg);
}

.main {
    min-width: 0;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 26px;
    background: rgba(2, 6, 23, .72);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border);
}

[data-theme="light"] .topbar {
    background: rgba(248, 250, 252, .82);
}

.topbar-title h1 {
    margin: 0;
    font-size: 24px;
    letter-spacing: -.03em;
}

.topbar-title p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.topbar-actions,
.actions,
.form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.theme-toggle,
.logout-btn,
.btn {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, .05);
    color: var(--white-90);
    padding: 0 15px;
    cursor: pointer;
    transition: .18s ease;
}

.theme-toggle {
    width: 42px;
    padding: 0;
}

.btn:hover,
.theme-toggle:hover,
.logout-btn:hover {
    border-color: var(--border-strong);
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, rgba(56, 189, 248, .95), rgba(99, 102, 241, .95));
    color: #fff;
    border-color: transparent;
}

.btn-secondary {
    background: rgba(255, 255, 255, .07);
}

.btn-light {
    background: transparent;
}

.btn-sm {
    min-height: 34px;
    padding: 0 12px;
    font-size: 13px;
}

.btn-full {
    width: 100%;
}

.content {
    padding: 26px;
    padding-bottom: 110px;
}

.grid {
    display: grid;
    gap: 18px;
}

.cards-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 18px;
}

.two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel,
.stat-card,
.auth-card {
    background: rgba(15, 23, 42, .78);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

[data-theme="light"] .panel,
[data-theme="light"] .stat-card,
[data-theme="light"] .auth-card {
    background: rgba(255, 255, 255, .9);
}

.panel {
    padding: 18px;
    margin-bottom: 18px;
}

.max-760 {
    max-width: 760px;
}

.panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.panel-head h2 {
    margin: 0;
    font-size: 18px;
}

.panel-head p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.stat-card {
    min-height: 118px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px;
}

.stat-card span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.stat-card strong {
    display: block;
    margin-top: 8px;
    font-size: 26px;
    letter-spacing: -.04em;
}

.stat-card i {
    font-size: 26px;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 13px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

th {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
}

td small {
    display: block;
    color: var(--muted);
    margin-top: 4px;
    word-break: break-all;
}

.text-right {
    text-align: right;
}

.empty {
    color: var(--muted);
    text-align: center;
    padding: 34px 12px;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    background: rgba(148, 163, 184, .14);
    border: 1px solid var(--border);
    color: var(--white-70);
    font-size: 12px;
}

.badge-green {
    background: rgba(34, 197, 94, .12);
    color: var(--green);
}

.badge-blue {
    background: rgba(56, 189, 248, .12);
    color: var(--blue);
}

.form-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field-grow {
    flex: 1;
}

label {
    color: var(--white-70);
    font-size: 13px;
    font-weight: 600;
}

input,
select,
textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: rgba(255, 255, 255, .05);
    color: var(--white-90);
    padding: 0 13px;
    outline: none;
}

textarea {
    min-height: 160px;
    padding: 13px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(56, 189, 248, .55);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, .08);
}

select option {
    color: #020617;
}

.field small {
    color: var(--muted);
    font-size: 12px;
}

.toolbar-form {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}

.alert {
    padding: 13px 15px;
    border-radius: 14px;
    margin-bottom: 18px;
    border: 1px solid var(--border);
}

.alert-success {
    background: rgba(34, 197, 94, .12);
    color: var(--green);
}

.alert-danger {
    background: rgba(239, 68, 68, .12);
    color: var(--red);
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.pagination a {
    min-width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    border: 1px solid var(--border);
    color: var(--white-70);
}

.pagination a.active {
    background: rgba(56, 189, 248, .15);
    color: var(--blue);
}

.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.filter-pills a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--white-70);
    background: rgba(255, 255, 255, .04);
    font-size: 13px;
}

.filter-pills a.active {
    color: var(--blue);
    border-color: rgba(56, 189, 248, .4);
    background: rgba(56, 189, 248, .11);
}

.filter-pills span {
    color: var(--muted);
}

.code-view {
    max-height: 72vh;
    overflow: auto;
    margin: 0;
    padding: 18px;
    border-radius: 16px;
    background: #020617;
    border: 1px solid var(--border);
    color: #dbeafe;
    font: 13px/1.6 Consolas, Monaco, monospace;
    white-space: pre;
}

.auth-shell {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-card {
    width: min(460px, 100%);
    padding: 24px;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
}

.auth-brand h1 {
    margin: 0;
    font-size: 26px;
}

.auth-brand p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.auth-footer {
    margin-top: 18px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.mobile-nav,
.mobile-fab-backdrop,
.mobile-fab-menu {
    display: none;
}

.icon-blue { color: var(--blue); }
.icon-green { color: var(--green); }
.icon-yellow { color: var(--yellow); }
.icon-orange { color: var(--orange); }
.icon-red { color: var(--red); }
.icon-purple { color: var(--purple); }
.icon-pink { color: var(--pink); }
.icon-cyan { color: var(--cyan); }
.icon-teal { color: var(--teal); }
.icon-indigo { color: var(--indigo); }

@media (max-width: 1120px) {
    .cards-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .two-col {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        display: none;
    }

    .topbar {
        height: auto;
        padding: 16px;
    }

    .logout-btn span {
        display: none;
    }

    .content {
        padding: 16px;
        padding-bottom: 104px;
    }

    .cards-4 {
        grid-template-columns: 1fr;
    }

    .panel-head,
    .toolbar-form,
    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .mobile-nav {
        position: fixed;
        left: 14px;
        right: 14px;
        bottom: 14px;
        z-index: 50;
        height: 66px;
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        align-items: center;
        background: rgba(15, 23, 42, .92);
        border: 1px solid var(--border);
        border-radius: 22px;
        backdrop-filter: blur(18px);
        box-shadow: var(--shadow);
    }

    [data-theme="light"] .mobile-nav {
        background: rgba(255, 255, 255, .94);
    }

    .mobile-nav a,
    .mobile-fab-wrap {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        color: var(--white-70);
        font-size: 11px;
    }

    .mobile-nav i {
        font-size: 17px;
    }

    .mobile-fab {
        width: 54px;
        height: 54px;
        border: 0;
        border-radius: 999px;
        background: linear-gradient(135deg, var(--blue), var(--purple));
        color: #fff;
        box-shadow: 0 16px 40px rgba(56, 189, 248, .3);
        cursor: pointer;
    }

    .mobile-fab.open i {
        transform: rotate(45deg);
    }

    .mobile-fab-backdrop {
        position: fixed;
        inset: 0;
        z-index: 45;
        background: rgba(0, 0, 0, .48);
    }

    .mobile-fab-backdrop.open {
        display: block;
    }

    .mobile-fab-menu {
        position: fixed;
        left: 18px;
        right: 18px;
        bottom: 92px;
        z-index: 55;
        display: block;
        opacity: 0;
        pointer-events: none;
        transform: translateY(12px);
        transition: .18s ease;
    }

    .mobile-fab-menu.open {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    .fab-group {
        padding: 14px;
        border-radius: 20px;
        background: var(--bg-200);
        border: 1px solid var(--border);
        box-shadow: var(--shadow);
    }

    .fab-group small {
        display: block;
        color: var(--muted);
        margin-bottom: 10px;
    }

    .fab-group a {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 12px;
        border-radius: 13px;
        color: var(--white-80);
    }
}

.inline-form {
    display: inline-flex;
    margin-left: 6px;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--white-70);
}

.check-row input {
    width: auto;
    min-height: auto;
}

.info-list {
    display: grid;
    gap: 12px;
}

.info-list div {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, .04);
}

.info-list strong,
.info-list span {
    display: block;
}

.info-list span {
    color: var(--muted);
    margin-top: 5px;
    font-size: 13px;
}

.sidebar-edge-toggle {
    position: absolute;
    right: -13px;
    top: 50%;
    transform: translateY(-50%);
    width: 26px;
    height: 50px;
    border-radius: 999px;
    padding: 0;
    background: var(--bg-200);
    color: var(--white-70);
    border: 1px solid var(--border);
    box-shadow: 0 8px 25px rgba(15,23,42,.12);
    z-index: 50;
}

element {
}
.sidebar-edge-toggle i {
  transition: transform .2s ease;
}

.sidebar-edge-toggle {
  color: var(--white-70);
}


.sidebar-edge-toggle i {
    transition: transform .2s ease;
}

.app-shell.sidebar-collapsed .sidebar-edge-toggle {
    right: -13px;
    background: var(--bg-200);
}

.app-shell.sidebar-collapsed .sidebar-edge-toggle i {
    transform: rotate(180deg);
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-section {
    padding: 18px 12px 7px;
    color: var(--white-50);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.nav a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 12px;
    border-radius: 14px;
    color: var(--white-70);
    transition: .18s ease;
}

.nav a i {
    width: 20px;
    text-align: center;
}

.nav a:hover,
.nav a.active {
    color: var(--white-100);
    background: rgba(255, 255, 255, .07);
}

.nav a.active {
    border: 1px solid var(--border);
}

/* Chrome, Edge, Opera */
.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: transparent;
    border: 0;
}

.sidebar::-webkit-scrollbar-corner {
    background: transparent;
}

/* Firefox */
.sidebar {
    scrollbar-width: none;
}

.sidebar {
    overflow-y: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE */
}

.sidebar::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.span-2 {
    grid-column: span 2;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    color: var(--white-70);
}

.check-row input {
    width: auto;
    min-height: auto;
}

.inline-form {
    display: inline-flex;
    margin-left: 6px;
}

.badge-red {
    background: rgba(239, 68, 68, .12);
    color: var(--red);
}

@media (max-width: 820px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .span-2 {
        grid-column: span 1;
    }
}

.check-row-inline {
    margin: 0;
    min-height: auto;
}

.check-row-inline input {
    width: auto;
    min-height: auto;
}