:root {
    --bg: #090b0f;
    --surface: #101318;
    --surface-2: #151a21;
    --surface-3: #1b212a;

    --border: #272d36;
    --border-light: #363e49;

    --text: #f3f4f6;
    --text-secondary: #a4abb5;
    --text-muted: #6f7884;

    --accent: #ffffff;
    --accent-soft: #d8dce1;

    --danger: #ff6b6b;

    --radius: 14px;
    --radius-small: 9px;

    --shadow:
        0 22px 70px rgba(0, 0, 0, 0.42);
}


/* =========================================================
   RESET
========================================================= */

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100vh;

    background:
        radial-gradient(
            circle at 50% -10%,
            rgba(255, 255, 255, 0.055),
            transparent 34%
        ),
        radial-gradient(
            circle at 100% 35%,
            rgba(255, 255, 255, 0.018),
            transparent 30%
        ),
        var(--bg);

    color: var(--text);

    font-family:
        "DM Sans",
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    font-size: 14px;
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

.hidden {
    display: none !important;
}


/* =========================================================
   LANDING HEADER
========================================================= */

.main-header {
    width: 100%;

    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 28px;

    padding: 32px 50px 0;

    position: relative;
}

.header-content {
    min-width: 0;
    flex: 1;
}

.gradient-text {
    display: inline-block;

    margin: 0;

    font-family:
        "Space Grotesk",
        "DM Sans",
        sans-serif;

    font-size: 2rem;
    font-weight: 600;

    line-height: 1.15;
    letter-spacing: -0.045em;
    text-transform: uppercase;

    background:
        linear-gradient(
            135deg,
            #ffffff 0%,
            #eeeeee 48%,
            #8d949d 100%
        );

    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.title-underline {
    width: min(360px, 75%);

    height: 2px;

    margin-top: 16px;

    background:
        linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.9),
            rgba(255, 255, 255, 0.08)
        );

    border-radius: 999px;
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;

    gap: 8px 22px;

    margin-top: 19px;
}

.nav-links a {
    position: relative;

    color: var(--text-muted) !important;

    text-decoration: none;

    font-size: 12px;
    font-weight: 600;

    letter-spacing: 0.015em;

    transition:
        color 0.2s ease,
        transform 0.2s ease;

    opacity: 1 !important;
}

.nav-links a::after {
    content: "";

    position: absolute;
    left: 0;
    bottom: -6px;

    width: 0;
    height: 1px;

    background: var(--accent);

    transition: width 0.2s ease;
}

.nav-links a:hover {
    color: var(--text) !important;
    transform: translateY(-1px);
}

.nav-links a:hover::after {
    width: 100%;
}

.app-logo {
    flex: 0 0 auto;

    width: 58px;
    height: 58px;

    object-fit: contain;

    margin-top: 2px;
    margin-left: 0;

    border-radius: 12px;

    filter:
        drop-shadow(0 0 12px rgba(255, 255, 255, 0.18));

    transition:
        transform 0.25s ease,
        filter 0.25s ease;

    opacity: 1 !important;
}

.app-logo:hover {
    transform: translateY(-2px) scale(1.035);

    filter:
        drop-shadow(0 0 17px rgba(255, 255, 255, 0.28));
}


/* =========================================================
   LOGIN
========================================================= */

.login-view {
    min-height: calc(100vh - 235px);

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 48px 20px 80px;
}

.login-card {
    width: 100%;
    max-width: 430px;

    padding: 36px 38px 38px;

    position: relative;

    background:
        linear-gradient(
            145deg,
            rgba(22, 27, 34, 0.98),
            rgba(13, 16, 21, 0.98)
        );

    border: 1px solid var(--border);

    border-radius: 18px;

    box-shadow:
        0 30px 90px rgba(0, 0, 0, 0.48),
        inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.login-card::before {
    content: "";

    position: absolute;

    top: 0;
    left: 34px;
    right: 34px;

    height: 1px;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(255, 255, 255, 0.22),
            transparent
        );
}

.login-heading {
    margin-bottom: 27px;
}

.login-heading h1 {
    margin: 0 0 9px;

    font-family:
        "Space Grotesk",
        "DM Sans",
        sans-serif;

    font-size: 28px;
    font-weight: 600;

    letter-spacing: -0.04em;
}

.login-heading p {
    margin: 0;

    color: var(--text-secondary);

    font-size: 13px;

    line-height: 1.65;
}


/* =========================================================
   FORMS
========================================================= */

label {
    display: block;

    margin: 18px 0 8px;

    color: var(--text-secondary);

    font-size: 11px;
    font-weight: 700;

    letter-spacing: 0.1em;
    text-transform: uppercase;
}

input,
select {
    width: 100%;

    min-height: 45px;

    padding: 0 13px;

    border: 1px solid var(--border);

    border-radius: var(--radius-small);

    outline: none;

    background:
        rgba(255, 255, 255, 0.025);

    color: var(--text);

    transition:
        border-color 0.18s ease,
        background 0.18s ease,
        box-shadow 0.18s ease;
}

input::placeholder {
    color: var(--text-muted);
}

input:hover,
select:hover {
    border-color: var(--border-light);
}

input:focus,
select:focus {
    border-color: rgba(255, 255, 255, 0.34);

    background:
        rgba(255, 255, 255, 0.045);

    box-shadow:
        0 0 0 3px rgba(255, 255, 255, 0.035);
}


/* =========================================================
   BUTTONS
========================================================= */

.primary-button,
.ghost-button,
.danger-button {
    min-height: 42px;

    padding: 0 16px;

    border-radius: var(--radius-small);

    font-size: 11px;
    font-weight: 700;

    letter-spacing: 0.07em;

    transition:
        opacity 0.18s ease,
        transform 0.18s ease,
        background 0.18s ease,
        border-color 0.18s ease;
}

.primary-button {
    border: 1px solid var(--accent);

    background: var(--accent);

    color: #090b0f;
}

.primary-button:hover {
    opacity: 0.88;
}

.primary-button:active,
.ghost-button:active,
.danger-button:active {
    transform: translateY(1px);
}

.primary-button.compact {
    min-height: 38px;
}

.ghost-button {
    border: 1px solid var(--border);

    background: transparent;

    color: var(--text-secondary);
}

.ghost-button:hover {
    background: var(--surface-2);

    color: var(--text);

    border-color: var(--border-light);
}

.danger-button {
    border:
        1px solid rgba(255, 107, 107, 0.35);

    background:
        rgba(255, 107, 107, 0.07);

    color: var(--danger);
}

.danger-button:hover {
    background:
        rgba(255, 107, 107, 0.13);
}

#loginButton {
    width: 100%;

    margin-top: 26px;

    min-height: 46px;
}


/* =========================================================
   MESSAGES
========================================================= */

.message {
    margin-bottom: 18px;

    padding: 12px 14px;

    border: 1px solid var(--border);

    border-radius: var(--radius-small);

    background: var(--surface-2);

    color: var(--text-secondary);

    font-size: 12px;

    line-height: 1.55;
}

.message.error {
    border-color:
        rgba(255, 107, 107, 0.3);

    color: var(--danger);

    background:
        rgba(255, 107, 107, 0.05);
}

.message.success {
    border-color:
        rgba(255, 255, 255, 0.16);

    color: var(--text);

    background:
        rgba(255, 255, 255, 0.025);
}


/* =========================================================
   FOOTER
========================================================= */

.footer-container {
    width: 100%;
    max-width: 1200px;

    margin: 0 auto;

    padding: 0 30px 30px;

    display: flex;
    justify-content: space-between;
    align-items: center;

    gap: 20px;

    flex-wrap: wrap;

    color: var(--text-muted);

    font-size: 11px;
}

.footer-left,
.footer-right {
    display: flex;
    align-items: center;

    gap: 9px;
}

.footer-built {
    display: flex;
    align-items: center;

    color: var(--text-muted);

    line-height: 1;
}

.footer-separator {
    color: var(--border-light);
}

.footer-logo {
    width: 30px;
    height: 30px;

    object-fit: contain;

    filter:
        drop-shadow(0 0 8px rgba(255, 255, 255, 0.18));

    transition:
        transform 0.2s ease;
}

.footer-logo:hover {
    transform: scale(1.07);
}

.tm-mark {
    position: relative;

    top: -6px;

    margin-left: -5px;

    color: var(--text-secondary);

    font-size: 12px;
}


/* =========================================================
   TOPBAR
========================================================= */

.topbar {
    min-height: 72px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 30px;

    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);

    position: sticky;
    top: 0;
    z-index: 20;

    background:
        rgba(9, 11, 15, 0.78);

    backdrop-filter: blur(16px);
}

.topbar-brand {
    display: flex;
    align-items: center;

    gap: 11px;
}

.topbar-title {
    font-size: 14px;
    font-weight: 700;
}

.topbar-subtitle {
    margin-top: 2px;

    color: var(--text-muted);

    font-size: 10px;

    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.topbar-actions {
    display: flex;
    align-items: center;

    gap: 14px;
}

.admin-identity {
    color: var(--text-secondary);

    font-size: 12px;
}


/* =========================================================
   MAIN
========================================================= */

.main-content {
    width: 100%;
    max-width: 1500px;

    margin: 0 auto;

    padding: 48px 30px 60px;
}

.page-section {
    margin-bottom: 30px;

    padding-bottom: 30px;

    border-bottom: 1px solid var(--border);
}

.page-section:last-child {
    border-bottom: none;
}

.section-heading {
    margin-bottom: 25px;
}

.section-heading.inline {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 20px;
}

.eyebrow {
    display: block;

    margin-bottom: 8px;

    color: var(--text-muted);

    font-size: 10px;
    font-weight: 700;

    letter-spacing: 0.15em;
}

.section-heading h1,
.section-heading h2 {
    margin: 0;

    font-family:
        "Space Grotesk",
        "DM Sans",
        sans-serif;

    letter-spacing: -0.03em;
}

.section-heading h1 {
    font-size: 30px;
}

.section-heading h2 {
    font-size: 21px;
}

.section-heading p {
    margin: 9px 0 0;

    color: var(--text-secondary);

    line-height: 1.6;
}


/* =========================================================
   STATS
========================================================= */

.stats-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 15px;
}

.stat-card {
    padding: 24px;

    border: 1px solid var(--border);

    border-radius: var(--radius);

    background: var(--surface);

    text-align: center;

    transition:
        border-color 0.18s ease,
        transform 0.18s ease;
}

.stat-card:hover {
    border-color: var(--border-light);

    transform: translateY(-2px);
}

.stat-label {
    color: var(--text-muted);

    font-size: 10px;
    font-weight: 700;

    letter-spacing: 0.14em;
}

.stat-value {
    margin-top: 14px;

    font-size: 32px;
    font-weight: 700;

    letter-spacing: -0.04em;
}


/* =========================================================
   CONTROLS
========================================================= */

.section-controls {
    display: flex;
    align-items: center;

    gap: 10px;
}

.section-controls select {
    width: 190px;
}


/* =========================================================
   TABLE
========================================================= */

.table-container {
    overflow-x: auto;

    border: 1px solid var(--border);

    border-radius: var(--radius);

    background: var(--surface);
}

table {
    width: 100%;

    min-width: 760px;

    border-collapse: collapse;
}

thead {
    background: var(--surface-2);
}

th {
    padding: 13px 16px;

    border-bottom: 1px solid var(--border);

    color: var(--text-muted);

    font-size: 10px;
    font-weight: 700;

    letter-spacing: 0.12em;

    text-align: center;

    white-space: nowrap;
}

td {
    padding: 15px 16px;

    border-bottom: 1px solid var(--border);

    color: var(--text-secondary);

    font-size: 13px;

    text-align: center;

    white-space: nowrap;
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background:
        rgba(255, 255, 255, 0.018);
}

.empty-row {
    padding: 40px !important;

    color: var(--text-muted);

    text-align: center;
}

.table-actions {
    display: flex;

    justify-content: center;

    gap: 7px;
}

.table-button {
    min-height: 31px;

    padding: 0 10px;

    border: 1px solid var(--border);

    border-radius: 6px;

    background: transparent;

    color: var(--text-secondary);

    font-size: 10px;
    font-weight: 700;

    letter-spacing: 0.05em;

    transition:
        background 0.18s ease,
        color 0.18s ease,
        border-color 0.18s ease;
}

.table-button:hover {
    background: var(--surface-2);

    color: var(--text);

    border-color: var(--border-light);
}

.table-button.danger {
    color: var(--danger);

    border-color:
        rgba(255, 107, 107, 0.25);
}


/* =========================================================
   STATUS
========================================================= */

.status {
    display: inline-flex;
    align-items: center;

    gap: 7px;

    font-size: 11px;
    font-weight: 600;
}

.status::before {
    content: "";

    width: 6px;
    height: 6px;

    flex: 0 0 auto;

    border-radius: 50%;

    background: currentColor;
}

.status.active {
    color: #d5dbe1;
}

.status.disabled {
    color: var(--text-muted);
}


/* =========================================================
   MODALS
========================================================= */

.modal {
    position: fixed;
    inset: 0;

    z-index: 100;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;
}

.modal-backdrop {
    position: absolute;
    inset: 0;

    background:
        rgba(0, 0, 0, 0.72);

    backdrop-filter: blur(7px);
}

.modal-card {
    position: relative;

    width: 100%;
    max-width: 470px;

    padding: 26px;

    border: 1px solid var(--border);

    border-radius: var(--radius);

    background: var(--surface);

    box-shadow: var(--shadow);
}

.small-modal {
    max-width: 400px;
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    margin-bottom: 24px;
}

.modal-header h2 {
    margin: 0;

    font-family:
        "Space Grotesk",
        "DM Sans",
        sans-serif;

    font-size: 20px;

    letter-spacing: -0.025em;
}

.modal-close {
    width: 32px;
    height: 32px;

    border: 1px solid var(--border);

    border-radius: 7px;

    background: transparent;

    color: var(--text-muted);

    font-size: 20px;
    line-height: 1;

    transition:
        background 0.18s ease,
        color 0.18s ease;
}

.modal-close:hover {
    color: var(--text);

    background: var(--surface-2);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;

    gap: 9px;

    margin-top: 27px;
}

.modal-card p {
    margin: 0;

    color: var(--text-secondary);

    line-height: 1.6;
}


/* =========================================================
   GLOBAL MESSAGE
========================================================= */

.global-message {
    position: fixed;

    right: 22px;
    bottom: 22px;

    z-index: 200;

    max-width: 360px;

    padding: 13px 16px;

    border: 1px solid var(--border);

    border-radius: var(--radius-small);

    background: var(--surface-3);

    color: var(--text);

    box-shadow: var(--shadow);

    font-size: 12px;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 850px) {

    .main-header {
        padding: 28px 24px 0;

        gap: 18px;
    }

    .gradient-text {
        font-size: 1.65rem;
    }

    .nav-links {
        gap: 8px 16px;
    }

    .app-logo {
        width: 50px;
        height: 50px;
    }

    .topbar {
        padding: 0 18px;
    }

    .main-content {
        padding: 35px 18px 60px;
    }

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

    .section-heading.inline {
        align-items: flex-start;
        flex-direction: column;
    }

    .section-controls {
        width: 100%;
    }

    .section-controls select {
        flex: 1;
        width: auto;
    }

    .topbar-subtitle,
    .admin-identity {
        display: none;
    }
}


@media (max-width: 600px) {

    .main-header {
        padding: 24px 18px 0;
    }

    .gradient-text {
        font-size: 1.4rem;
    }

    .title-underline {
        width: 220px;
    }

    .nav-links {
        margin-top: 16px;

        gap: 8px 14px;
    }

    .nav-links a {
        font-size: 11px;
    }

    .app-logo {
        width: 44px;
        height: 44px;
    }

    .login-view {
        min-height: calc(100vh - 220px);

        padding:
            38px 16px 60px;
    }

    .login-card {
        padding: 30px 22px 28px;

        border-radius: 15px;
    }

    .login-heading h1 {
        font-size: 25px;
    }

    .footer-container {
        padding:
            0 18px 24px;

        flex-direction: column;

        align-items: center;

        text-align: center;
    }

    .footer-left,
    .footer-right {
        justify-content: center;
    }

    .topbar {
        min-height: 64px;
    }

    .topbar-title {
        font-size: 12px;
    }

    .main-content {
        padding:
            28px 14px 50px;
    }

    .section-controls {
        flex-direction: column;

        align-items: stretch;
    }

    .section-controls select {
        width: 100%;
    }

    .modal-card {
        padding: 22px;
    }
}


@media (max-width: 420px) {

    .main-header {
        align-items: flex-start;
    }

    .app-logo {
        width: 40px;
        height: 40px;
    }

    .nav-links {
        gap: 7px 12px;
    }

    .nav-links a {
        font-size: 10px;
    }

    .login-card {
        padding:
            27px 19px 25px;
    }
}