﻿/* ============================================================
   BASE — tokens, resets, typography, layout primitives
   ============================================================ */

/* ── Design tokens ── */
:root {
    /* Text */
    --color-dark-text: #1C1C1C;
    --color-light-text: #FFFFFF;
    --color-muted: #6D6D6D;
    /* Backgrounds */
    --color-primary-bg: #F8F7FA;
    --color-secondary-bg: #F8F0FA;
    --color-tertiary-bg: #dddddd;
    --color-card-bg: #FFFFFF;
    /* Buttons */
    --color-primary-button: #4b5563;
    --color-primary-button-hover: #374151;
    --color-secondary-button: #dddddd;
    --color-secondary-button-hover: #eeeeee;
    --color-secondary-button-active: #4b5563;
    --color-tertiary-button: #F8F7FA;
    --color-tertiary-button-hover: #dddddd;
    --color-tertiary-button-active: #4b5563;
    /* Typography — Inter for UI, Cormorant Garamond for editorial display.
       Use these vars everywhere instead of hard-coded font-family names. */
    --font-body: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --font-display: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
}

/* ── Reset / globals ── */
html, body {
    background-color: var(--color-primary-bg);
    font-family: var(--font-body);
    font-feature-settings: 'ss01', 'cv11';
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

main {
    width: 100%;
    background-color: var(--color-primary-bg);
}

a, .btn-link {
    color: #006bb7;
}

h1:focus {
    outline: none;
}

/* ── Utility ── */
.muted {
    opacity: 0.55;
}

.small {
    font-size: 0.83rem;
}

.italic {
    font-style: italic;
}

/* ── Page shell ── */
.page {
    display: flex;
    flex-direction: column;
    background-color: var(--color-primary-bg);
}

.content {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    padding-left: 1rem;
    padding-right: 1rem;
    background-color: var(--color-primary-bg);
    width: 100%;
}

/* ── Page header (shared across pages) ── */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.page-title-section {
    flex-grow: 1;
    min-width: 200px;
}

.page-title {
    font-size: 1.5rem;
    margin: 0;
}

.page-description,
.page-subtitle {
    font-size: 0.9rem;
    color: var(--color-muted);
    margin: 0.2rem 0 0;
    opacity: 0.6;
}

/* ── Flex helpers ── */
.flex-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.actions-container {
    display: flex;
    gap: 0.5rem;
}

/* ── Section label ── */
.section-label {
    font-size: 0.78rem;
    font-weight: 650;
    opacity: 0.55;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.inline-section-label {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.45;
    margin-bottom: 0.25rem;
}

.section-eyebrow {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.4;
    margin-bottom: 0.75rem;
}

.section-divider,
.rule-divider {
    border: none;
    border-top: 1px solid rgba(0,0,0,0.08);
    margin: 0.25rem 0;
}

/* ── Empty states ── */
.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

    .empty-state.centered {
        padding: 4rem 1rem;
    }

.empty-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.empty-title {
    font-weight: 700;
    font-size: 1.05rem;
}

/* ── Avatar ── */
.avatar-sm {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 0.78rem;
    background: var(--color-primary-bg);
    border: 1px solid rgba(0,0,0,0.12);
    flex-shrink: 0;
}

.avatar-lg {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 1.1rem;
    background: var(--color-primary-bg);
    border: 1px solid rgba(0,0,0,0.12);
    flex-shrink: 0;
}

/* ── Count badge ── */
.count-badge {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: var(--color-primary-bg);
    border: 1px solid rgba(0,0,0,0.1);
}

/* ── Dialog / modal ── */
.dialog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.dialog {
    background: var(--color-primary-bg);
    padding: 2rem;
    border-radius: 8px;
    width: 80%;
    max-height: 90vh;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--color-primary-bg);
    padding-bottom: 1rem;
    border-bottom: 1px solid #ccc;
    flex-shrink: 0;
}

.dialog-content {
    overflow-y: auto;
    max-height: calc(90vh - 70px);
    padding-right: 0.5rem;
}

/* ── Table ── */
.table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 12px;
    overflow: hidden;
    background: var(--color-card-bg);
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

    .table th,
    .table td {
        padding: 12px;
        text-align: center;
        border-bottom: 1px solid #eee;
    }

    .table thead {
        background-color: var(--color-card-bg);
        border-radius: 12px;
        font-weight: bold;
    }

    .table td.winecolor {
        border-left: 6px solid transparent;
        padding-left: 0.5rem;
        border-radius: 12px;
    }

        .table td.winecolor.red {
            border-left-color: #8B0000;
        }

        .table td.winecolor.white {
            border-left-color: #F5F5DC;
        }

        .table td.winecolor.rose {
            border-left-color: #F2A1B3;
        }

        .table td.winecolor.sparkling {
            border-left-color: #D4AF37;
        }

        .table td.winecolor.orange {
            border-left-color: #E67E22;
        }
        .table td.winecolor.sweet {
            border-left-color: #CD853F;
        }
