/* =========================================================
   BLUEBACK WEB — GLOBAL STYLES
   ========================================================= */


/* =========================================================
   1. DESIGN TOKENS
   ========================================================= */

:root {

    /* Colours */

    --colour-app-bg: #17191d;
    --colour-surface: #1d2025;
    --colour-surface-hover: #23272d;

    --colour-border: #34383f;

    --colour-text: #f1f3f5;
    --colour-text-secondary: #a6abb3;
    --colour-text-muted: #747a84;

    --colour-primary: #3b9ed8;
    --colour-success: #4caf7d;
    --colour-warning: #d9a441;
    --colour-danger: #d95c5c;


    /* Typography */

    --font-family: Arial, sans-serif;

    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.375rem;


    /* Spacing */

    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;


    /* Borders */

    --radius-sm: 6px;
    --radius-md: 8px;


    /* Layout */

    --header-height: 60px;
}


/* =========================================================
   2. RESET / BASE
   ========================================================= */

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    flex-direction: column;

    overflow: hidden;

    background: var(--colour-app-bg);
    color: var(--colour-text);

    font-family: var(--font-family);
    font-size: var(--font-size-base);
}


/* =========================================================
   3. APP SHELL
   ========================================================= */

.app-header {
    height: 60px;
    flex: 0 0 60px;

    display: flex;
    align-items: center;

    padding: 0 1.5rem;

    background: var(--colour-surface);
    border-bottom: 1px solid var(--colour-border);
    color: var(--colour-text);

    position: relative;
}

.app-header__brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;

    flex: 0 0 auto;

    font-size: 1.1rem;
    font-weight: 600;
}


.app-header__logo {
    width: 28px;
    height: 28px;
}

#app {
    flex: 1 1 auto;

    min-width: 0;
    min-height: 0;

    overflow-y: auto;
}


/* =========================================================
   4. TYPOGRAPHY
   ========================================================= */

.app-header__title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--colour-text);
}


/* =========================================================
   5. NAVIGATION
   ========================================================= */

.app-header__nav {
    display: flex;
    align-self: stretch;
    gap: 1.5rem;

    margin-left: 2.5rem;
}

.app-header__nav-link {
    display: flex;
    align-items: center;
    position: relative;

    padding: 0 0.25rem;

    color: var(--colour-text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
}

.app-header__nav-link:hover {
    color: var(--colour-text);
}

.app-header__nav-link.active {
    color: var(--colour-text);
}

.app-header__nav-link.active::after {
    content: "";

    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;

    height: 2px;

    background: var(--colour-primary);
}
/* ----------------------------------------
   Right-hand actions
   ---------------------------------------- */

.app-header__actions {
    display: flex;
    align-items: center;
    gap: 1.25rem;

    margin-left: auto;
}

.app-header__action {
    color: var(--colour-text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
}

.app-header__action:hover {
    color: var(--colour-text);
}


/* ----------------------------------------
   User
   ---------------------------------------- */

.app-header__user {
    position: relative;
}

.app-header__user-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    background: none;
    padding: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
}

.app-header__user-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #333;
    color: white;
    font-weight: 600;
}

.app-header__user-arrow {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid currentColor;
}

.app-header__user-menu {
    display: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 120px;
    padding: 0.4rem;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
}

.app-header__user-menu.open {
    display: block;
}

.app-header__logout {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: none;
    background: none;
    text-align: left;
    font: inherit;
    cursor: pointer;
    border-radius: 4px;
}

.app-header__logout:hover {
    background: #f2f2f2;
}

/* =========================================================
   6. CARDS / SURFACES
   ========================================================= */

.card {
    background: var(--colour-surface);
    border: 1px solid var(--colour-border);
    border-radius: 8px;
}

.card__header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--colour-border);
}

.card__title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
}

.card__body {
    padding: 1.25rem;
}


/* =========================================================
   7. BUTTONS
   ========================================================= */
.btn {
    padding: 0.65rem 1rem;

    border: 1px solid #666;
    border-radius: 8px;

    background: #333;
    color: #eee;

    font-size: 0.95rem;
    font-weight: 500;

    cursor: pointer;
}

.btn:hover {
    background: #444;
}

.btn:active {
    background: #2a2a2a;
}

/* =========================================================
   8. FORM CONTROLS
   ========================================================= */


/* =========================================================
   9. DASHBOARD
   ========================================================= */

.dashboard {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.dashboard__header {
    margin-bottom: 1.5rem;
}

.dashboard__title {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 600;
}

.dashboard__subtitle {
    margin: 0.4rem 0 0;
    color: var(--colour-text-secondary);
}

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

.dashboard__grid--wide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 1rem;
}

.dashboard__card {
    min-width: 0;
}

.dashboard__stat {
    font-size: 2rem;
    font-weight: 600;
}

.dashboard__stat-label {
    margin: 0.35rem 0 0;
    color: var(--colour-text-secondary);
}

/* =========================================================
   10. UTILITIES
   ========================================================= */


/* =========================================================
   11. RESPONSIVE
   ========================================================= */
   @media (max-width: 600px) {

    .app-header {
        padding: 0 0.75rem;
    }

    .app-header__nav,
    .app-header__action {
        display: none;
    }

    .app-header__mobile-menu-button {
        display: block;

        order: -1;
        margin-left: 0;
        margin-right: 1rem;

        border: none;
        background: none;

        font-size: 1.5rem;
        color: var(--colour-text);

        cursor: pointer;
    }

    .app-header__mobile-menu {
        display: none;
    }

    .app-header__mobile-menu.open {
        display: flex;
        flex-direction: column;

        position: absolute;
        top: 60px;
        left: 0;
        right: 0;

        background: var(--colour-surface);
        border-bottom: 1px solid var(--colour-border);

        padding: 0.5rem 0;

        z-index: 1000;
    }

    .app-header__mobile-menu .app-header__nav-link {
        display: block;
        padding: 0.75rem 1rem;
    }

    .app-header__mobile-menu .app-header__nav-link.active::after {
        display: none;
    }
}

@media (min-width: 601px) {

    .app-header__mobile-menu-button,
    .app-header__mobile-menu {
        display: none;
    }
}

@media (max-width: 600px) {

    .dashboard {
        padding: 1rem;
    }

    .dashboard__grid,
    .dashboard__grid--wide {
        grid-template-columns: 1fr;
    }
}