﻿/* ========================================
   App shell
======================================== */

.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(11, 18, 32, 0.88);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.topbar-inner {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

    .brand:hover {
        color: var(--text);
    }

.brand-logo {
    height: 28px; /* tweak depending on your logo */
    width: auto;
    display: block;
}

.brand-text {
    font-weight: 600;
    font-size: 1rem;
    color: inherit;
}

.brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), #3c7dd9);
    box-shadow: 0 6px 20px rgba(111, 177, 255, 0.2);
}

@media (min-width: 768px) {
    .brand-logo {
        height: 32px;
    }
}

@media (max-width: 480px) {
    .brand-text {
        display: none;
    }
}

.topbar-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .topbar-nav a {
        display: inline-flex;
        align-items: center;
        min-height: 38px;
        padding: 0 0.85rem;
        border-radius: 9px;
        color: var(--text-muted);
        font-weight: 500;
    }

        .topbar-nav a:hover,
        .topbar-nav a.active {
            background: var(--surface-alt);
            color: var(--text);
        }

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* ========================================
   Main page layout
======================================== */

.page-shell {
    flex: 1;
    padding: 1.5rem 0 2rem;
}

.page {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.page-header-main {
    min-width: 0;
}

.page-title {
    margin: 0;
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.page-subtitle {
    margin: 0.45rem 0 0;
    color: var(--text-muted);
    max-width: 75ch;
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ========================================
   Content grids
======================================== */

.grid {
    display: grid;
    gap: 1rem;
}

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

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

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

.stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ========================================
   Stat cards
======================================== */

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1rem 1.1rem;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text);
}

.stat-meta {
    margin-top: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ========================================
   Auth layout
======================================== */

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem 1rem;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 1.75rem;
}

.auth-header {
    margin-bottom: 1.5rem;
    text-align: center;
}

.auth-title {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
}

.auth-subtitle {
    margin: 0.5rem 0 0;
    color: var(--text-muted);
}

.auth-links {
    margin-top: 1rem;
    text-align: center;
}

/* ========================================
   Footer
======================================== */

.app-footer {
    padding: 1rem 0 2rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ========================================
   Responsive
======================================== */

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

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

@media (max-width: 768px) {
    .topbar-inner {
        flex-wrap: wrap;
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }

    .topbar-nav {
        width: 100%;
        flex-wrap: wrap;
    }

    .page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .page-actions {
        width: 100%;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .auth-card {
        padding: 1.25rem;
    }
}
