/* ---------------------- ROOT & GLOBAL STYLES ---------------------- */
:root {
    --primary: #F59E0B;
    --primary-hover: #EA580C;

    --bg-main: #020617;
    --bg-gradient: linear-gradient(135deg, #020617 0%, #0F172A 40%, #1e1b4b 100%);

    --card-bg: #0F172A;
    --card-border: #1E293B;

    --text: #F8FAFC;
    --text-muted: #94A3B8;

    --status-active: #10B981;
    --status-expired: #EF4444;
    --status-pending: #F59E0B;

    --radius-lg: 1.5rem;
    --radius-md: 0.9rem;
    --shadow-big: 0 25px 60px rgba(0, 0, 0, 0.75);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-gradient);
    color: var(--text);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
}

/* ---------------------- MAIN WINDOW ---------------------- */
.app-container {
    width: 100%;
    max-width: 1250px;
    min-height: 85vh;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-big);
    border: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: fadeIn .5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------------------- HEADER ---------------------- */
.app-header {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--card-border);
}

.logo {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: 1.3rem;
    font-weight: 700;
}

.logo span {
    background: linear-gradient(to right, #FBBF24, #F97316);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.user-profile {
    display: flex;
    gap: 1rem;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.btn-sm {
    padding: .5rem 1rem;
    font-size: .8rem;
    border-radius: .7rem;
    border: 1px solid var(--status-expired);
    background: rgba(239, 68, 68, 0.08);
    color: #EF4444;
    text-decoration: none;
    transition: .2s;
}

.btn-sm:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* ---------------------- DOWNLOAD CARDS ---------------------- */
.downloads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.download-card {
    background: rgba(2, 6, 23, 0.65);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(6px);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.download-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
}

.download-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.file-icon {
    width: 3rem;
    height: 3rem;
    background: rgba(245, 158, 11, 0.1);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.file-info h3 {
    font-size: 1.1rem;
    color: white;
    margin-bottom: 0.2rem;
}

.file-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.download-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 1rem;
}

.btn-download {
    margin-top: 1rem;
    padding: 0.75rem;
    text-align: center;
    background: linear-gradient(135deg, #4F46E5, #4338CA);
    color: white;
    border-radius: 0.75rem;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: .2s;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-download:hover {
    filter: brightness(1.1);
    box-shadow: 0 8px 16px rgba(79, 70, 229, 0.4);
}


/* ---------------------- LAYOUT ---------------------- */
.app-body {
    display: flex;
    gap: 2rem;
    padding: 2rem;
    align-items: flex-start;
    height: auto;
}

/* ---------------------- SIDEBAR (DESKTOP) ---------------------- */
.sidebar {
    width: 260px;
    background: transparent;
    border-right: none;
    padding: 1.5rem 1rem;
    border-radius: 1rem;
    height: auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    margin-top: 1.8rem;
    position: relative;
    z-index: 1001;
}

.sidebar-card {
    background: radial-gradient(circle at 0% 0%, rgba(15, 23, 42, 0.95), #020617);
    border-radius: 1.4rem;
    border: 1px solid rgba(148, 163, 184, 0.22);
    padding: 0.9rem 0.9rem 1.1rem;
    width: 100%;
    box-shadow:
        0 18px 40px rgba(15, 23, 42, 0.95),
        0 0 0 1px rgba(15, 23, 42, 0.9);
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    padding: 0;
    margin: 0;
}

.nav-separator {
    margin: 0.55rem 0 0.35rem;
    height: 1px;
    background: rgba(148, 163, 184, 0.18);
}

.nav-link {
    position: relative;
    padding: 0.7rem 1.1rem;
    border-radius: 999px;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    background: linear-gradient(145deg,
            rgba(15, 23, 42, 0.98) 0%,
            rgba(15, 23, 42, 0.94) 45%,
            rgba(17, 24, 39, 1) 100%);
    border: 1px solid rgba(30, 64, 175, 0.35);
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    letter-spacing: 0.01em;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
    box-shadow:
        0 10px 24px rgba(15, 23, 42, 0.9),
        0 0 0 1px rgba(15, 23, 42, 0.9);
    overflow: hidden;
}

.nav-link::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.08),
            transparent 55%);
    opacity: 0.9;
    pointer-events: none;
}

.nav-link:hover {
    transform: translateY(-2px);
    box-shadow:
        0 18px 30px rgba(15, 23, 42, 0.95),
        0 0 0 1px rgba(56, 189, 248, 0.4);
    border-color: rgba(56, 189, 248, 0.45);
    color: #E5E7EB;
}

.nav-link.active {
    background: linear-gradient(135deg, #F59E0B, #EA580C);
    border-color: transparent;
    color: #0B1120;
    box-shadow:
        0 20px 40px rgba(248, 113, 22, 0.65),
        0 0 0 1px rgba(251, 191, 36, 0.6);
}

.nav-link.active::before {
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.2),
            transparent 60%);
}

.nav-link-ghost {
    background: linear-gradient(145deg,
            rgba(15, 23, 42, 0.98),
            rgba(15, 23, 42, 0.94));
    border-color: rgba(248, 250, 252, 0.1);
    color: #FBBF24;
    box-shadow:
        0 10px 24px rgba(15, 23, 42, 0.9),
        0 0 0 1px rgba(15, 23, 42, 0.9);
}

.nav-link-ghost:hover {
    transform: translateY(-2px);
    background: radial-gradient(circle at 0% 0%, rgba(30, 64, 175, 0.4), rgba(15, 23, 42, 0.98));
    box-shadow:
        0 18px 40px rgba(15, 23, 42, 0.95),
        0 0 0 1px rgba(59, 130, 246, 0.6);
    color: #FACC15;
}

/* ---------------------- CONTENT ---------------------- */
.main-content {
    flex: 1;
    padding: 2.5rem 2rem 2rem 0;
    overflow-y: auto;
}

h2 {
    font-size: 1.8rem;
    margin-bottom: .3rem;
    background: linear-gradient(to right, #FBBF24, #F97316);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-size: .95rem;
}

/* ---------------------- LICENSE TABLE (CARD) ---------------------- */
.card {
    background: rgba(2, 6, 23, 0.65);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(6px);
}

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

th {
    padding: 1rem;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--card-border);
}

td {
    padding: 1rem;
    border-bottom: 1px solid rgba(51, 65, 85, 0.3);
}

td:last-child,
th:last-child {
    text-align: right;
}

/* KEY STYLE */
td .key-box {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: .05em;
    color: #F8FAFC;
    font-family: monospace;
}

/* BADGE STYLES */
.badge {
    padding: .3rem .75rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
}

.badge-active {
    background: rgba(16, 185, 129, 0.2);
    color: var(--status-active);
}

.badge-expired {
    background: rgba(239, 68, 68, 0.2);
    color: var(--status-expired);
}

.badge-pending {
    background: rgba(245, 158, 11, 0.2);
    color: var(--status-pending);
}

/* ---------------------- BUTTON ---------------------- */
.btn-action {
    padding: .5rem 1rem;
    border-radius: .6rem;
    background: linear-gradient(135deg, #4F46E5, #4338CA);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35);
    transition: .2s ease;
    white-space: nowrap;
}

.btn-action:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

/* ---------------------- MODAL ---------------------- */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    z-index: 1200;
}

.modal-content {
    background: #0F172A;
    padding: 2rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--card-border);
    width: 90%;
    max-width: 450px;
}

.modal input {
    width: 100%;
    padding: .85rem;
    background: #020617;
    border: 1px solid #334155;
    color: white;
    border-radius: .7rem;
}

/* ---------------------- MOBILE RESPONSIVE ---------------------- */
.mobile-toggle {
    display: none;
    font-size: 1.5rem;
    color: var(--text);
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1100;
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.active {
    display: block;
    opacity: 1;
}

/* ---------- BREAKPOINT: TABLETS / TELAS MÉDIAS ---------- */
@media (max-width: 1200px) {
    body {
        padding: 1.5rem;
    }

    .app-body {
        gap: 1.5rem;
    }

    .main-content {
        padding-right: 1.5rem;
    }
}

/* ---------- BREAKPOINT: MOBILE / TELAS PEQUENAS ---------- */
@media (max-width: 900px) {
    body {
        padding: 0;
    }

    .app-container {
        height: 100vh;
        max-width: 100%;
        border-radius: 0;
        border: none;
    }

    .app-header {
        padding: 0.8rem 1rem;
        gap: 0.5rem;
    }

    .app-body {
        flex-direction: column;
        padding: 1rem;
        overflow-x: hidden;
    }

    /* sidebar vira CARD FLUTUANTE tipo MKX */
    .sidebar {
        position: fixed;
        left: -100%;
        top: 15px;
        height: auto;
        max-height: calc(100vh - 30px);
        width: 250px;
        flex-direction: column;
        background: linear-gradient(135deg,
                rgba(18, 25, 30, 0.98) 0%,
                rgba(25, 32, 40, 0.98) 50%,
                rgba(18, 25, 30, 0.98) 100%);
        backdrop-filter: blur(16px) saturate(160%);
        -webkit-backdrop-filter: blur(16px) saturate(160%);
        border-radius: 20px;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
        overflow-y: auto;
        padding: 60px 15px 15px;
        box-shadow:
            2px 2px 25px rgba(0, 0, 0, 0.5),
            inset -1px 0 0 rgba(255, 255, 255, 0.03);
        border: none;
        margin: 0;
    }

    .sidebar-card {
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 0;
    }

    .sidebar.active {
        left: 15px;
    }

    .mobile-toggle {
        display: block;
    }

    .logo {
        font-size: 1rem;
    }

    .user-profile span {
        display: none;
    }

    .btn-sm {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
    }

    .main-content {
        padding: 1.2rem 0.5rem 1.5rem 0.5rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    /* BOTÕES DA SIDEBAR NO MOBILE (estilo MKX) */
    .nav-links {
        gap: 0.6rem;
    }

    .nav-link {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 14px 16px;
        margin-bottom: 0;
        background: linear-gradient(135deg,
                rgba(255, 255, 255, 0.08) 0%,
                rgba(255, 255, 255, 0.05) 100%);
        color: rgba(255, 255, 255, 0.9);
        border-radius: 16px;
        font-weight: 600;
        font-size: 14px;
        border: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow:
            0 2px 8px rgba(0, 0, 0, 0.2),
            inset 0 1px 0 rgba(255, 255, 255, 0.1);
        position: relative;
        overflow: hidden;
        white-space: normal;
        flex-shrink: 1;
        background-clip: padding-box;
    }

    .nav-link::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg,
                transparent,
                rgba(255, 255, 255, 0.1),
                transparent);
        transition: left 0.5s;
    }

    .nav-link:hover::before {
        left: 100%;
    }

    .nav-link:hover {
        background: linear-gradient(135deg,
                rgba(255, 255, 255, 0.15) 0%,
                rgba(255, 255, 255, 0.1) 100%);
        color: #fff;
        transform: translateX(4px);
        border-color: rgba(255, 255, 255, 0.2);
        box-shadow:
            0 4px 12px rgba(0, 0, 0, 0.3),
            0 0 20px rgba(76, 175, 80, 0.1),
            inset 0 1px 0 rgba(255, 255, 255, 0.15);
    }

    .nav-link.active {
        background: linear-gradient(135deg,
                rgba(245, 158, 11, 0.35) 0%,
                rgba(234, 88, 12, 0.3) 100%);
        color: #FBBF24;
        font-weight: 700;
        border-color: rgba(248, 181, 69, 0.5);
        box-shadow:
            0 4px 15px rgba(248, 181, 69, 0.4),
            0 0 25px rgba(248, 181, 69, 0.3),
            inset 0 1px 0 rgba(248, 181, 69, 0.3);
    }

    .nav-link-ghost {
        background: linear-gradient(135deg,
                rgba(139, 0, 0, 0.3) 0%,
                rgba(100, 0, 0, 0.25) 100%);
        color: #FFD700;
        font-weight: 700;
        border: 1px solid rgba(255, 215, 0, 0.3);
        box-shadow:
            0 4px 15px rgba(139, 0, 0, 0.4),
            0 0 20px rgba(255, 215, 0, 0.2),
            inset 0 1px 0 rgba(255, 215, 0, 0.2);
    }

    .nav-link-ghost:hover {
        background: linear-gradient(135deg,
                rgba(139, 0, 0, 0.4) 0%,
                rgba(120, 0, 0, 0.35) 100%);
        border-color: rgba(255, 215, 0, 0.5);
        box-shadow:
            0 6px 20px rgba(139, 0, 0, 0.5),
            0 0 30px rgba(255, 215, 0, 0.3),
            inset 0 1px 0 rgba(255, 215, 0, 0.3);
    }

    /* CARD VIEW PARA TABELA */
    .card {
        background: transparent;
        border: none;
        padding: 0;
        overflow: visible;
    }

    table,
    thead,
    tbody,
    th,
    td,
    tr {
        display: block;
    }

    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    tr {
        margin-bottom: 0.75rem;
        background: rgba(2, 6, 23, 0.7);
        border: 1px solid var(--card-border);
        border-radius: 0.75rem;
        padding: 0.75rem;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    }

    td {
        border: none;
        position: relative;
        padding: 0.35rem 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
        font-size: 0.85rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.03);
        min-height: 2rem;
    }

    td:last-child {
        border-bottom: none;
        margin-top: 0.35rem;
        justify-content: center;
        width: 100%;
        padding-bottom: 0;
    }

    td:before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        text-transform: uppercase;
        font-size: 0.7rem;
        margin-right: 1rem;
        text-align: left;
        letter-spacing: 0.02em;
    }

    td[data-label="Key"] .key-box {
        font-size: 0.95rem;
    }

    td[data-label="Action"] button {
        width: 100%;
    }

    table {
        min-width: auto;
    }
}

/* ---------- EXTRA: CELULARES MUITO PEQUENOS (320-360px) ---------- */
@media (max-width: 480px) {
    .app-header {
        padding-inline: 0.75rem;
    }

    .btn-action {
        padding: 0.45rem 0.7rem;
        font-size: 0.78rem;
    }

    .sidebar {
        width: 240px;
        padding: 60px 12px 12px;
    }
}

/* ---------------------- STATS CARDS (ADMIN) ---------------------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.stat-card {
    background: rgba(2, 6, 23, 0.65);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
}

.stat-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-info h3 {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
    letter-spacing: 0.05em;
}

.stat-info p {
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
}

/* ---------------------- AUTH PAGES (Login) ---------------------- */
.auth-wrapper {
    width: 100%;
    max-width: 420px;
}

.auth-shell {
    background: radial-gradient(circle at top left, rgba(245, 158, 11, 0.18), transparent 55%),
        radial-gradient(circle at bottom right, rgba(59, 130, 246, 0.2), transparent 55%),
        var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 1px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85);
}

.auth-main {
    background: radial-gradient(circle at top, #020617 0%, #020617 35%, #020617 100%);
    border-radius: inherit;
    padding: 2.1rem 2rem 1.8rem;
    animation: fadeInUp 0.4s ease-out;
}

.logo-area {
    text-align: center;
    margin-bottom: 1.5rem;
}

.logo-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.3rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    font-size: 0.75rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.9rem;
}

.badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #22C55E;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.25);
}

.logo-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1.45rem;
    font-weight: 700;
}

.logo-title span.brand {
    background: linear-gradient(to right, #FBBF24, #F97316);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-icon {
    width: 2.1rem;
    height: 2.1rem;
    color: #F59E0B;
}

.auth-footer {
    margin-top: 1.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
}

/* ---------------------- MISSING UTILITIES ---------------------- */
.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.btn-new {
    display: inline-flex;
    align-items: center;
    padding: 0.6rem 1.2rem;
    background: linear-gradient(135deg, #F59E0B, #EA580C);
    color: #0B1120;
    font-weight: 600;
    border-radius: 999px;
    text-decoration: none;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn-new:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.45);
}

.delete-link {
    color: #EF4444;
    font-weight: 500;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.15s ease;
}

.delete-link:hover {
    color: #F87171;
    text-decoration: underline;
}

/* ---------------------- MODAL UTILITIES ---------------------- */
.modal-danger {
    text-align: center;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.btn-modal {
    padding: 0.6rem 1.2rem;
    border-radius: 0.6rem;
    font-size: 0.9rem;
    cursor: pointer;
    font-weight: 500;
    text-decoration: none;
    transition: 0.2s ease;
    border: none;
}

.btn-cancel {
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--text-muted);
}

.btn-cancel:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.btn-check-delete {
    background: #EF4444;
    color: white;
}

.btn-check-delete:hover {
    background: #DC2626;
}

/* ---------------------- FORM UTILITIES ---------------------- */
.form-card {
    background: rgba(2, 6, 23, 0.65);
    padding: 2rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(6px);
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}


.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="file"],
.form-group input[type="datetime-local"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    background: #020617;
    border: 1px solid #334155;
    color: var(--text);
    border-radius: 0.75rem;
    outline: none;
    transition: 0.2s all;
    font-size: 0.95rem;
    color-scheme: dark;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394A3B8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.2rem;
    padding-right: 2.5rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: #475569;
}

/* Custom File Input */
.form-group input[type="file"]::file-selector-button {
    margin-right: 1rem;
    border: none;
    background: linear-gradient(135deg, #F59E0B, #EA580C);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    color: #020617;
    cursor: pointer;
    font-weight: 600;
    transition: filter 0.2s;
}

.form-group input[type="file"]::file-selector-button:hover {
    filter: brightness(1.1);
}

.btn-submit {
    width: 100%;
    padding: 0.9rem;
    background: linear-gradient(135deg, #F59E0B, #EA580C);
    color: #0B1120;
    border: none;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.2s;
    margin-top: 1rem;
}

.btn-submit:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(245, 158, 11, 0.35);
}

/* ALERTS */
.alert {
    padding: 1rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    border: 1px solid transparent;
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    color: #10B981;
    border-color: rgba(16, 185, 129, 0.3);
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    color: #EF4444;
    border-color: rgba(239, 68, 68, 0.3);
}

/* ---------------------- UTILITIES ---------------------- */
.text-center {
    text-align: center;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.content-centered-wrapper {
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

.content-centered-wrapper h2 {
    margin-bottom: 1.5rem;
}

.content-centered-wrapper-large {
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
}

.content-centered-wrapper-large h2 {
    margin-bottom: 1.5rem;
}

/* Password Validation */
.validation-message {
    font-size: 0.85rem;
    margin-top: 0.5rem;
    min-height: 1.2rem;
    transition: color 0.2s;
}

.validation-message.valid {
    color: #10B981;
}

.validation-message.invalid {
    color: #EF4444;
}

/* ---------------------- RESPONSIVE / ZOOM FIXES ---------------------- */
.mobile-toggle {
    display: none;
    /* Hidden on desktop */
    background: transparent;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
}

.mobile-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.mobile-overlay.active {
    display: block;
}

@media (max-width: 1024px) {
    .app-body {
        padding: 1rem;
        gap: 0;
        display: block;
        /* Stack content */
    }

    .mobile-toggle {
        display: block;
        /* Show hamburger */
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 1002;
        margin: 0;
        transform: translateX(-110%);
        transition: transform 0.3s ease;
        background: #0F172A;
        /* Solid background since it overlaps */
        box-shadow: 4px 0 15px rgba(0, 0, 0, 0.5);
        border-radius: 0;
        width: 280px;
        overflow-y: auto;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        padding: 1rem 0;
        width: 100%;
    }

    /* Adjust centered wrapper for smaller spaces */
    .content-centered-wrapper {
        padding: 0 1rem;
    }
}