:root {
    --bg-color: #000000;
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --border-color: #27272a;
    /* Zinc-800 */
    --input-bg: #09090b;
    /* Zinc-950 */
    --primary-color: #ffffff;
    --danger-color: #ef4444;
    --success-color: #22c55e;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    --radius-input: 16px;
    --radius-btn: 9999px;
    /* Pill shape */
    --radius-card: 24px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    outline: none;
    /* Custom focus styles used instead */
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    font-size: 16px;
    /* Increased base size for readability */
    height: 100vh;
    -webkit-font-smoothing: antialiased;
}

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

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

.d-flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.align-center {
    align-items: center;
}

.mt-4 {
    margin-top: 24px;
}

.mb-4 {
    margin-bottom: 24px;
}

/* Layouts */
#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Auth Layout - "No Box" but structured */
.center-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: transparent;
    border: none;
    padding: 0;
    /* No visual box, just content */
}

/* Dashboard Layout */
.dashboard-wrapper {
    display: flex;
    height: 100vh;
    width: 100vw;
    background: var(--bg-color);
    overflow: hidden;
}

.sidebar {
    width: 280px;
    border-right: 1px solid var(--border-color);
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    background: var(--bg-color);
}

.sidebar-brand {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 48px;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.main-content {
    flex: 1;
    padding: 48px;
    overflow-y: auto;
    width: 100%;
    /* Removed max-width per user request for edge-to-edge feeling */
}

/* Typography */
h1,
h2,
h3 {
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.025em;
    line-height: 1.2;
}

h2 {
    font-size: 28px;
    margin-bottom: 12px;
}

h3 {
    font-size: 20px;
    margin-top: 40px;
    margin-bottom: 20px;
}

p {
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-size: 15px;
}

a {
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 1px;
    transition: all 0.2s;
}

a:hover {
    border-bottom-color: var(--text-primary);
}

/* Forms - Rounded & Optimized */
.form-group {
    margin-bottom: 24px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-left: 12px;
    /* Align with rounded input padding */
}

.form-control {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 16px 20px;
    /* Larger touch targets */
    border-radius: var(--radius-input);
    font-size: 16px;
    font-family: inherit;
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: var(--text-primary);
    background: #18181b;
    /* Slightly lighter on focus */
}

/* Buttons - Pills */
.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 16px 24px;
    background: var(--text-primary);
    color: var(--bg-color);
    border: 1px solid var(--text-primary);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    border-radius: var(--radius-btn);
    transition: transform 0.1s, opacity 0.2s;
    text-transform: none;
    /* Modern look */
}

.btn:hover {
    opacity: 0.9;
}

.btn:active {
    transform: scale(0.98);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--text-primary);
    opacity: 1;
}

.btn-discord {
    background: #5865F2;
    /* Brand color allowed for trademark buttons generally, but user asked for 'not purple'? */
    /* Reverting to black/white per user request "niet paars" */
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-discord:hover {
    border-color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.btn-sm {
    width: auto;
    padding: 10px 20px;
    font-size: 14px;
}

/* Nav - Sidebar Items */
.nav-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    padding: 14px 20px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    border-radius: var(--radius-input);
    /* Match input roundness */
    transition: all 0.2s;
    font-family: inherit;
    width: 100%;
    text-align: left;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--text-primary);
    color: var(--bg-color);
    font-weight: 600;
}

/* Panels & Cards */
.panel {
    display: none;
    /* Default to hidden */
    animation: fadein 0.3s ease;
}

.panel.active {
    display: block;
    /* Show when active */
}

.panel.hidden {
    display: none !important;
    /* Force hide */
}

@keyframes fadein {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

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

.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.app-card {
    border: 1px solid var(--border-color);
    padding: 32px;
    border-radius: var(--radius-card);
    background: var(--input-bg);
}

.tag {
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 99px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tag-success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.tag-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.divider {
    height: 1px;
    background: var(--border-color);
    margin: 32px 0;
    width: 100%;
}

.alert {
    padding: 16px 20px;
    border-radius: var(--radius-input);
    margin-bottom: 24px;
    font-size: 14px;
    font-weight: 500;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Mobile Optimization */
@media (max-width: 768px) {
    .dashboard-wrapper {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 20px;
        position: sticky;
        top: 0;
        z-index: 100;
    }

    .sidebar-brand {
        margin-bottom: 20px;
        text-align: center;
    }

    .nav-links {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
        gap: 12px;
    }

    .nav-item {
        white-space: nowrap;
        padding: 10px 16px;
        width: auto;
        font-size: 14px;
    }

    .main-content {
        padding: 24px 20px;
    }

    .center-layout {
        padding: 16px;
        align-items: flex-start;
        padding-top: 60px;
    }

    h2 {
        font-size: 24px;
    }

    .auth-card {
        padding: 0;
    }
}