/* ==========================================================================
   Campus Pulse - Modern Dark Design System
   Pure Vanilla CSS with vibrant accents, glassmorphism, and responsive layout
   ========================================================================== */

:root {
    /* Color Palette */
    --bg-main: #0a0e17;
    --bg-surface: #111827;
    --bg-surface-elevated: #1a233a;
    --bg-surface-hover: #222f4c;
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-accent: rgba(99, 102, 241, 0.35);

    /* Text Colors */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Accent & Brand Colors */
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.25);
    
    --accent-purple: #a855f7;
    --accent-cyan: #06b6d4;
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-rose: #f43f5e;

    /* Status Colors */
    --urgent-bg: rgba(244, 63, 94, 0.12);
    --urgent-border: rgba(244, 63, 94, 0.4);
    --urgent-text: #fb7185;

    /* Typography */
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Transitions & Radii */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-full: 9999px;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Accessibility Skip Link */
.skip-link {
    position: absolute;
    top: -60px;
    left: 1.5rem;
    background: var(--primary);
    color: #ffffff;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    z-index: 9999;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    box-shadow: 0 4px 14px var(--primary-glow);
    transition: top 0.2s ease-in-out;
}

.skip-link:focus {
    top: 1rem;
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

.app-shell {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem 3rem 1.5rem;
}

/* Top Navigation Bar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.brand-logo {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary), var(--accent-purple));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px var(--primary-glow);
}

.pulse-icon {
    font-size: 1.5rem;
}

.brand-text h1 {
    font-family: var(--font-heading);
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(to right, #ffffff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-tagline {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: block;
}

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

/* Status Indicator Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

.status-badge.connected .status-dot {
    background: var(--accent-emerald);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.status-badge.missing-key .status-dot {
    background: var(--accent-amber);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.15rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    font-family: var(--font-body);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #4f46e5);
    color: #ffffff;
    box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: var(--bg-surface-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
    background: var(--bg-surface-hover);
    border-color: var(--border-accent);
}

.plus-icon {
    font-size: 1.1rem;
    font-weight: bold;
}

/* Hero / Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--border-accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.stat-card.urgent-highlight {
    background: linear-gradient(145deg, var(--bg-surface), rgba(244, 63, 94, 0.07));
    border-color: rgba(244, 63, 94, 0.25);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--bg-surface-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 0.15rem;
}

/* Toolbar: Search & Category Chips */
.toolbar {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.search-box input {
    width: 100%;
    background: var(--bg-main);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.75rem 2.5rem 0.75rem 2.75rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: var(--font-body);
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Toolbar: Top Row, Search & View Switcher */
.toolbar-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.toolbar-top-row .search-box {
    flex: 1;
    min-width: 260px;
}

.view-mode-toggle {
    display: flex;
    background: var(--bg-main);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.25rem;
    gap: 0.25rem;
}

.btn-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-body);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-toggle:hover {
    color: var(--text-primary);
}

.btn-toggle.active {
    background: var(--bg-surface-elevated);
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Secondary Filter & Sort Row */
.toolbar-sub-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    border-top: 1px solid var(--border-subtle);
    padding-top: 0.85rem;
}

.status-filters-group {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.status-chips {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.chip-status {
    background: var(--bg-main);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.chip-status:hover {
    background: var(--bg-surface-elevated);
    color: var(--text-primary);
}

.chip-status.active {
    background: var(--bg-surface-elevated);
    color: var(--text-primary);
    border-color: var(--border-accent);
}

.chip-status.chip-urgent.active {
    background: var(--urgent-bg);
    color: var(--urgent-text);
    border-color: var(--urgent-border);
}

.chip-status.chip-today.active {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-amber);
    border-color: rgba(245, 158, 11, 0.4);
}

.sort-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-select {
    background: var(--bg-main);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    font-family: var(--font-body);
    cursor: pointer;
    outline: none;
    transition: var(--transition);
}

.sort-select:focus {
    border-color: var(--primary);
}

/* Timeline & Calendar View */
.timeline-view {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.timeline-bucket {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: var(--transition);
}

.timeline-bucket:hover {
    border-color: var(--border-accent);
}

.timeline-bucket.bucket-today {
    border-color: rgba(245, 158, 11, 0.4);
    background: linear-gradient(180deg, var(--bg-surface), rgba(245, 158, 11, 0.04));
}

.timeline-bucket-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--border-subtle);
}

.bucket-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bucket-count {
    font-size: 0.75rem;
    background: var(--bg-main);
    border: 1px solid var(--border-subtle);
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
    color: var(--text-secondary);
}

.bucket-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

/* Priority & Countdown Badges on Notice Cards */
.badge-countdown {
    background: var(--bg-main);
    border: 1px solid var(--border-subtle);
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 600;
}

.badge-countdown.countdown-today {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-amber);
    border-color: rgba(245, 158, 11, 0.4);
    animation: pulse 1.6s infinite;
}

.badge-countdown.countdown-tomorrow {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.4);
}

.badge-countdown.countdown-soon {
    background: rgba(168, 85, 247, 0.12);
    color: var(--accent-purple);
}

.badge-countdown.countdown-expired {
    background: var(--bg-main);
    color: var(--text-muted);
}

.card-actions-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.btn-toggle-urgency {
    background: none;
    border: 1px solid transparent;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.btn-toggle-urgency:hover {
    color: var(--accent-rose);
    background: rgba(244, 63, 94, 0.1);
    border-color: rgba(244, 63, 94, 0.2);
}

.btn-toggle-urgency.is-urgent {
    color: var(--accent-rose);
}

/* Sections */
.spotlight-section {
    margin-bottom: 2.5rem;
    background: linear-gradient(180deg, rgba(244, 63, 94, 0.05) 0%, transparent 100%);
    border: 1px solid var(--urgent-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.pulse-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-rose);
    box-shadow: 0 0 10px var(--accent-rose);
    display: inline-block;
    animation: pulse 1.6s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.8; }
}

.badge-urgent-count {
    background: var(--urgent-bg);
    color: var(--urgent-text);
    border: 1px solid var(--urgent-border);
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.notices-count-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Notice Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}

.notice-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.notice-card:hover {
    border-color: var(--border-accent);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.notice-card.urgent {
    border-color: var(--urgent-border);
    background: linear-gradient(180deg, var(--bg-surface), rgba(244, 63, 94, 0.04));
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.85rem;
    gap: 0.5rem;
}

.badges-wrapper {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.card-badge {
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-urgent {
    background: var(--urgent-bg);
    color: var(--urgent-text);
    border: 1px solid var(--urgent-border);
}

.badge-category {
    background: var(--bg-surface-elevated);
    color: var(--primary);
    border: 1px solid var(--border-subtle);
}

.badge-cat-exam { color: #f43f5e; border-color: rgba(244, 63, 94, 0.3); background: rgba(244, 63, 94, 0.1); }
.badge-cat-club { color: #10b981; border-color: rgba(16, 185, 129, 0.3); background: rgba(16, 185, 129, 0.1); }
.badge-cat-placement { color: #a855f7; border-color: rgba(168, 85, 247, 0.3); background: rgba(168, 85, 247, 0.1); }
.badge-cat-academic { color: #38bdf8; border-color: rgba(56, 189, 248, 0.3); background: rgba(56, 189, 248, 0.1); }
.badge-cat-sports { color: #fb923c; border-color: rgba(251, 146, 60, 0.3); background: rgba(251, 146, 60, 0.1); }

.btn-card-delete {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.btn-card-delete:hover {
    color: var(--accent-rose);
    background: rgba(244, 63, 94, 0.1);
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.85rem;
    line-height: 1.35;
}

.card-meta-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.card-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.card-meta-icon {
    font-size: 0.95rem;
}

.raw-text-preview {
    background: var(--bg-main);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0.65rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 100px;
    overflow-y: auto;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-subtle);
    padding-top: 0.75rem;
    margin-top: 0.75rem;
}

.timing-status {
    font-size: 0.75rem;
    font-weight: 600;
}

.status-today {
    color: var(--accent-amber);
}

.status-upcoming {
    color: var(--accent-cyan);
}

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

.raw-toggle-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    text-decoration: underline;
}

.raw-toggle-btn:hover {
    color: var(--primary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 1.5rem;
    background: var(--bg-surface);
    border: 1px dashed var(--border-subtle);
    border-radius: var(--radius-lg);
    margin-top: 1rem;
}

.empty-illustration {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 14, 23, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1.5rem;
}

.modal-card {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 580px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-card-wide {
    max-width: 680px;
}

/* Modal Tabs */
.modal-tabs {
    display: flex;
    background: var(--bg-main);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0.5rem 1.5rem 0 1.5rem;
    gap: 0.75rem;
}

.modal-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    padding: 0.6rem 0.85rem;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-body);
}

.modal-tab:hover {
    color: var(--text-primary);
}

.modal-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Sample chips */
.sample-chips-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.sample-label {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.btn-sample-chip {
    background: var(--bg-main);
    border: 1px dashed var(--border-accent);
    color: var(--text-secondary);
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-sample-chip:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
    border-style: solid;
}

/* AI Action Row & Pulse */
.ai-action-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.btn-ai-pulse {
    position: relative;
    overflow: hidden;
}

.ai-sparkle {
    display: inline-block;
    animation: sparkleSpin 3s linear infinite;
}

@keyframes sparkleSpin {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.15); }
    100% { transform: rotate(360deg) scale(1); }
}

.ai-extract-status {
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 500;
}

/* AI Extracted Preview Card */
.extracted-preview-box {
    background: linear-gradient(145deg, rgba(99, 102, 241, 0.08), rgba(168, 85, 247, 0.05));
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-top: 1rem;
    animation: previewFadeIn 0.3s ease-out;
}

@keyframes previewFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
}

.preview-badge {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-purple);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.preview-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.preview-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.6rem;
    margin-bottom: 0.75rem;
    background: var(--bg-main);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
}

.preview-meta-item {
    display: flex;
    flex-direction: column;
    font-size: 0.8rem;
}

.preview-meta-label {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.72rem;
    text-transform: uppercase;
}

.preview-meta-val {
    color: var(--text-primary);
    font-weight: 600;
    margin-top: 0.1rem;
}

.preview-summary-text {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 1rem;
}

.preview-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
}

.modal-badge {
    font-size: 0.72rem;
    text-transform: uppercase;
    color: var(--primary);
    font-weight: 700;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 0.2rem;
}

.modal-title-group h2 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
}

.btn-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.btn-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.modal-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    line-height: 1.45;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.15rem;
}

.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.required {
    color: var(--accent-rose);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

input[type="text"],
input[type="date"],
select,
textarea {
    width: 100%;
    background: var(--bg-main);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.65rem 0.85rem;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: var(--transition);
}

input[type="text"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.custom-checkbox {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    gap: 0.5rem;
    font-size: 0.88rem;
    color: var(--text-primary);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* Digest Content & Loading States */
.digest-loading {
    text-align: center;
    padding: 3rem 1.5rem;
}

.digest-spinner {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: inline-block;
    animation: sparkleSpin 2s linear infinite;
}

.digest-loading h4,
.digest-loading-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.digest-loading-sub {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

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

.digest-header-banner {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(168, 85, 247, 0.1));
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-md);
    padding: 1.25rem;
}

.digest-headline {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.digest-overview {
    font-size: 0.9rem;
    color: #cbd5e1;
    line-height: 1.55;
}

.digest-section-box {
    background: var(--bg-main);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.15rem;
}

.digest-section-box.urgent-box {
    border-color: var(--urgent-border);
    background: linear-gradient(180deg, var(--bg-main), rgba(244, 63, 94, 0.05));
}

.digest-section-heading {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.digest-items-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.digest-item-row {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.digest-item-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.digest-item-title {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-primary);
}

.digest-item-time {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.digest-item-action {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 500;
}

.digest-tip-box {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.03));
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
}

.tip-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.tip-body strong {
    color: var(--accent-amber);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: block;
    margin-bottom: 0.2rem;
}

.tip-body p {
    font-size: 0.85rem;
    color: #cbd5e1;
    line-height: 1.45;
}

.digest-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    border-top: 1px solid var(--border-subtle);
    padding-top: 1rem;
    margin-top: 1rem;
}

/* Toast System */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 2000;
}

.toast {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-accent);
    color: var(--text-primary);
    padding: 0.75rem 1.15rem;
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: toastSlide 0.25s ease-out;
}

@keyframes toastSlide {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Helpers & Accessibility Utilities */
.hidden {
    display: none !important;
}

/* Screen Reader Only Utility */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Visible Focus Styles on all interactive elements */
:focus-visible {
    outline: 2px solid #a5b4fc !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.45) !important;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.btn:focus-visible,
.btn-toggle:focus-visible,
.btn-close:focus-visible,
.btn-sample-chip:focus-visible,
.btn-toggle-urgency:focus-visible,
.btn-card-delete:focus-visible,
.raw-toggle-btn:focus-visible,
.chip:focus-visible,
.chip-status:focus-visible,
.modal-tab:focus-visible,
.search-clear:focus-visible {
    outline: 2px solid #c7d2fe !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.45) !important;
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .nav-actions {
        width: 100%;
        justify-content: space-between;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }
}
