/*
 * ============================================================
 * authenticated-shell.css
 * Shared visual foundation for all authenticated app pages.
 *
 * Defines:
 *   1. Design tokens (surface, border, shadow, radius, typography, accent)
 *   2. Page container / header / spacing
 *   3. Surface classes (card, panel, muted, widget)
 *   4. Stat tiles
 *   5. Widget layout (title, link, list, item)
 *   6. Side-panel stack
 *   7. Interaction polish (hover elevation, focus, link treatment)
 *
 * Usage:
 *   Every authenticated page should wrap its content in .app-page.
 *   Page headers should use .app-page-header / .app-page-title / .app-page-subtitle.
 *   Cards use .surface-card, panels use .surface-panel,
 *   nested metadata blocks use .surface-muted.
 *   Widget panels use .surface-panel + .widget-title / .widget-list etc.
 *   Stats use .stat-grid / .stat-tile / .stat-label / .stat-value.
 *   Right-column widget stacks use .app-panel-stack.
 * ============================================================
 */

/* ============================================================
   1. Design Tokens
   Cascade from .app-shell so role-specific variations are
   automatic everywhere inside the authenticated shell.
   ============================================================ */

.app-shell {
    /* --- Surface --- */
    --surface-card:        #ffffff;
    --surface-card-muted:  #f7f9fc;
    --surface-widget:      #ffffff;
    --surface-subtle:      #f2f5f8;

    /* --- Borders --- */
    --border-subtle:       #e5eaef;
    --border-medium:       #d4dbe4;

    /* --- Shadows --- */
    --shadow-sm:  0 1px 4px rgba(0, 0, 0, 0.06), 0 0 1px rgba(0, 0, 0, 0.04);
    --shadow-md:  0 3px 10px rgba(0, 0, 0, 0.09), 0 0 2px rgba(0, 0, 0, 0.04);
    --shadow-sm-hover: 0 4px 14px rgba(0, 0, 0, 0.10), 0 0 2px rgba(0, 0, 0, 0.05);

    /* --- Shape --- */
    --radius-sm:  6px;
    --radius-md:  10px;
    --radius-lg:  14px;

    /* --- Typography --- */
    --text-heading: #1a2332;
    --text-body:    #2d3748;
    --text-muted:   #6c7a89;
    --text-meta:    #8a95a3;

    /* --- Accent link (volunteer / default) --- */
    --accent-link: #4e298e;
    --accent-link-hover: #3b1e6e;
}

/* Role-specific accent link colors */
.app-shell.shell-role-association {
    --accent-link:       #4a42d1;
    --accent-link-hover: #3830b8;
}

.app-shell.shell-role-company {
    --accent-link:       #20104a;
    --accent-link-hover: #32196e;
}

/* ============================================================
   2. Page Container & Page Header
   ============================================================ */

.app-page {
    width: 100%;
}

.app-page-header {
    margin-bottom: 20px;
}

.app-page-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.app-page-header-meta {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.45;
}

.app-page-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-heading);
    letter-spacing: -0.01em;
    margin: 0 0 2px;
    line-height: 1.3;
}

.app-page-subtitle {
    margin: 2px 0 0;
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.5;
}

/* ============================================================
   3. Surface Classes
   ============================================================ */

/* Primary card surface — for main content cards */
.surface-card {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.surface-card > .card-header {
    background: var(--surface-card-muted);
    border-bottom: 1px solid var(--border-subtle);
}

/* Panel surface — for widget panels and side panels */
.surface-panel {
    background: var(--surface-widget);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 14px 16px;
}

/* Muted surface — for nested metadata / grouping blocks */
.surface-muted {
    background: var(--surface-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
}

/* ============================================================
   4. Stat Tiles
   ============================================================ */

.stat-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.stat-tile {
    background: var(--surface-card-muted);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
}

.stat-label {
    font-size: 0.76rem;
    color: var(--text-muted);
    line-height: 1.3;
}

.stat-value {
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--text-heading);
    line-height: 1.3;
}

/* ============================================================
   5. Widget Layout (titles, links, lists, items)
   Used inside .surface-panel blocks in right-column widgets.
   ============================================================ */

.widget-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-heading);
    margin: 0 0 10px;
    line-height: 1.3;
}

.widget-link {
    font-size: 0.8rem;
    color: var(--accent-link);
    text-decoration: none;
    transition: color 0.15s ease;
}

.widget-link:hover {
    color: var(--accent-link-hover);
    text-decoration: underline;
}

.widget-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.widget-item {
    background: var(--surface-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
}

.widget-item-title {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-heading);
    line-height: 1.35;
}

.widget-item-link {
    display: block;
    text-decoration: none;
    color: var(--text-heading);
}

.widget-item-link:hover {
    color: var(--accent-link);
    text-decoration: underline;
}

.widget-item-meta {
    font-size: 0.77rem;
    color: var(--text-meta);
    line-height: 1.3;
    margin-top: 2px;
}

/* ============================================================
   6. Side-Panel Stack
   Container for stacked widget panels in right column areas.
   ============================================================ */

.app-panel-stack {
    display: grid;
    gap: 12px;
}

/* ============================================================
   7. Interaction Polish
   ============================================================ */

/* Card hover — subtle elevation lift */
.surface-card:hover {
    box-shadow: var(--shadow-sm-hover);
    transition: box-shadow 0.18s ease;
}

/* Panel hover */
.surface-panel:hover {
    box-shadow: var(--shadow-md);
    transition: box-shadow 0.18s ease;
}

/* Clickable surface-card (linked cards, clickable tiles) */
a.surface-card:hover,
button.surface-card:hover {
    box-shadow: var(--shadow-md);
}

/* Focus-visible outlines for keyboard nav — consistent across app */
.surface-card:focus-visible,
.surface-panel:focus-visible,
.stat-tile:focus-visible {
    outline: 2px solid var(--accent-link);
    outline-offset: 2px;
}

/* Link treatment within app content */
.app-page a:not(.btn):not(.widget-link):not([class]) {
    color: var(--accent-link);
    text-decoration: none;
}

.app-page a:not(.btn):not(.widget-link):not([class]):hover {
    color: var(--accent-link-hover);
    text-decoration: underline;
}

/* ============================================================
   8. Stat Tile Modifiers & Stat Action Links
   ============================================================ */

.stat-tile--warning {
    border-left: 3px solid #f59e0b;
    background: #fffdf0;
}

.stat-action-link {
    font-size: 0.78rem;
    color: var(--accent-link);
    text-decoration: none;
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.stat-action-link:hover {
    color: var(--accent-link-hover);
    text-decoration: underline;
}

/* ============================================================
   9. Empty State
   Centered illustration + title + description for zero-data views.
   Usage: <div class="empty-state"><div class="empty-state-icon">...</div>
          <p class="empty-state-title">...</p>
          <p class="empty-state-description">...</p></div>
   ============================================================ */

.empty-state {
    text-align: center;
    padding: 48px 24px;
}

.empty-state-icon {
    font-size: 2.4rem;
    line-height: 1;
    margin-bottom: 14px;
    opacity: 0.75;
}

.empty-state-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-heading);
    margin: 0 0 6px;
}

.empty-state-description {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0 auto 18px;
    max-width: 360px;
    line-height: 1.55;
}

/* ============================================================
   10. Notification List Items
   Used in the Notifications page list layout.
   ============================================================ */

.notification-list-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-subtle);
    transition: background-color 0.15s ease;
}

.notification-list-item:last-child {
    border-bottom: none;
}

.notification-list-item:hover {
    background: var(--surface-card-muted);
}

.notification-list-item.is-unread {
    background: var(--surface-card-muted);
}

.notification-unread-dot {
    width: 8px;
    min-width: 8px;
    height: 8px;
    border-radius: 999px;
    margin-top: 6px;
    background: var(--accent-link);
    flex-shrink: 0;
}

.notification-read-dot {
    width: 8px;
    min-width: 8px;
    height: 8px;
    border-radius: 999px;
    margin-top: 6px;
    background: transparent;
    border: 1.5px solid var(--border-medium);
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-body);
    line-height: 1.4;
    margin: 0 0 2px;
}

.notification-title.is-unread {
    font-weight: 700;
    color: var(--text-heading);
}

.notification-message {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0 0 4px;
    line-height: 1.45;
}

.notification-time {
    font-size: 0.76rem;
    color: var(--text-meta);
}

.notification-day-group {
    padding: 7px 20px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-meta);
    background: var(--surface-subtle);
    border-bottom: 1px solid var(--border-subtle);
}

.notification-action-btn {
    flex-shrink: 0;
    align-self: center;
}

/* ============================================================
   11. Page Section Header Row
   For section headings with an optional action button on the right.
   ============================================================ */

.section-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-heading);
    margin: 0;
    line-height: 1.3;
}
