:root {
    /* Material Design 3 Color Tokens - Light Theme (Default) */
    --md-sys-color-primary: #6750A4;
    --md-sys-color-on-primary: #FFFFFF;
    --md-sys-color-primary-container: #EADDFF;
    --md-sys-color-on-primary-container: #21005D;

    --md-sys-color-secondary: #625B71;
    --md-sys-color-on-secondary: #FFFFFF;
    --md-sys-color-secondary-container: #E8DEF8;
    --md-sys-color-on-secondary-container: #1D192B;

    --md-sys-color-tertiary: #7D5260;
    --md-sys-color-on-tertiary: #FFFFFF;
    --md-sys-color-tertiary-container: #FFD8E4;
    --md-sys-color-on-tertiary-container: #31111D;

    --md-sys-color-error: #B3261E;
    --md-sys-color-on-error: #FFFFFF;
    --md-sys-color-error-container: #F9DEDC;
    --md-sys-color-on-error-container: #410E0B;

    --md-sys-color-background: #FDFBFF;
    --md-sys-color-on-background: #1C1B1F;
    --md-sys-color-surface: #FDFBFF;
    --md-sys-color-on-surface: #1C1B1F;

    --md-sys-color-surface-variant: #E7E0EC;
    --md-sys-color-on-surface-variant: #49454F;
    --md-sys-color-outline: #79747E;

    /* Elevations */
    --md-sys-elevation-1: 0px 1px 3px 1px rgba(0, 0, 0, 0.15), 0px 1px 2px 0px rgba(0, 0, 0, 0.3);
    --md-sys-elevation-2: 0px 2px 6px 2px rgba(0, 0, 0, 0.15), 0px 1px 2px 0px rgba(0, 0, 0, 0.3);
    --md-sys-elevation-3: 0px 4px 8px 3px rgba(0, 0, 0, 0.15), 0px 1px 3px 0px rgba(0, 0, 0, 0.3);

    /* Typography */
    --md-sys-typescale-display-large: 400 57px/64px 'Roboto', sans-serif;
    --md-sys-typescale-headline-large: 400 32px/40px 'Roboto', sans-serif;
    --md-sys-typescale-headline-medium: 400 28px/36px 'Roboto', sans-serif;
    --md-sys-typescale-title-large: 400 22px/28px 'Roboto', sans-serif;
    --md-sys-typescale-body-large: 400 16px/24px 'Roboto', sans-serif;
    --md-sys-typescale-body-medium: 400 14px/20px 'Roboto', sans-serif;
    --md-sys-typescale-label-large: 500 14px/20px 'Roboto', sans-serif;

    /* Spacing & Layout */
    --layout-max-width: 1200px;
    --border-radius-lg: 16px;
    --border-radius-md: 12px;
    --border-radius-sm: 8px;
}

/* ============================= */
/* Fluent Design System - Light Theme */
/* ============================= */
[data-design="fluent"] {
    --md-sys-color-primary: #0078D4;
    --md-sys-color-on-primary: #FFFFFF;
    --md-sys-color-primary-container: #C7E0F4;
    --md-sys-color-on-primary-container: #001A2C;

    --md-sys-color-secondary: #605E5C;
    --md-sys-color-on-secondary: #FFFFFF;
    --md-sys-color-secondary-container: #E1DFDD;
    --md-sys-color-on-secondary-container: #1B1A19;

    --md-sys-color-tertiary: #8764B8;
    --md-sys-color-on-tertiary: #FFFFFF;
    --md-sys-color-tertiary-container: #E6D5F5;
    --md-sys-color-on-tertiary-container: #2B1541;

    --md-sys-color-error: #D13438;
    --md-sys-color-on-error: #FFFFFF;
    --md-sys-color-error-container: #FDEAEA;
    --md-sys-color-on-error-container: #410E0B;

    --md-sys-color-background: #F3F2F1;
    --md-sys-color-on-background: #201F1E;
    --md-sys-color-surface: #FFFFFF;
    --md-sys-color-on-surface: #201F1E;

    --md-sys-color-surface-variant: #F3F2F1;
    --md-sys-color-on-surface-variant: #605E5C;
    --md-sys-color-outline: #8A8886;

    /* Fluent-style elevations (softer shadows) */
    --md-sys-elevation-1: 0 1.6px 3.6px 0 rgba(0, 0, 0, 0.132), 0 0.3px 0.9px 0 rgba(0, 0, 0, 0.108);
    --md-sys-elevation-2: 0 3.2px 7.2px 0 rgba(0, 0, 0, 0.132), 0 0.6px 1.8px 0 rgba(0, 0, 0, 0.108);
    --md-sys-elevation-3: 0 6.4px 14.4px 0 rgba(0, 0, 0, 0.132), 0 1.2px 3.6px 0 rgba(0, 0, 0, 0.108);

    /* Fluent Design uses Segoe UI primarily, fallback to system fonts */
    --md-sys-typescale-display-large: 400 57px/64px 'Segoe UI', system-ui, -apple-system, sans-serif;
    --md-sys-typescale-headline-large: 600 32px/40px 'Segoe UI', system-ui, -apple-system, sans-serif;
    --md-sys-typescale-headline-medium: 600 28px/36px 'Segoe UI', system-ui, -apple-system, sans-serif;
    --md-sys-typescale-title-large: 600 22px/28px 'Segoe UI', system-ui, -apple-system, sans-serif;
    --md-sys-typescale-body-large: 400 16px/24px 'Segoe UI', system-ui, -apple-system, sans-serif;
    --md-sys-typescale-body-medium: 400 14px/20px 'Segoe UI', system-ui, -apple-system, sans-serif;
    --md-sys-typescale-label-large: 600 14px/20px 'Segoe UI', system-ui, -apple-system, sans-serif;

    /* Fluent uses smaller, sharper border radius */
    --border-radius-lg: 8px;
    --border-radius-md: 4px;
    --border-radius-sm: 2px;
}

[data-design="fluent"][data-theme="dark"] {
    --md-sys-color-primary: #60CDFF;
    --md-sys-color-on-primary: #003E51;
    --md-sys-color-primary-container: #004E68;
    --md-sys-color-on-primary-container: #B3E5FC;

    --md-sys-color-secondary: #D2D0CE;
    --md-sys-color-on-secondary: #3B3A39;
    --md-sys-color-secondary-container: #484644;
    --md-sys-color-on-secondary-container: #E1DFDD;

    --md-sys-color-tertiary: #C2A9E1;
    --md-sys-color-on-tertiary: #412D5C;
    --md-sys-color-tertiary-container: #5A3F7A;
    --md-sys-color-on-tertiary-container: #E6D5F5;

    --md-sys-color-error: #F48B8E;
    --md-sys-color-on-error: #601410;
    --md-sys-color-error-container: #8C1D18;
    --md-sys-color-on-error-container: #FDEAEA;

    --md-sys-color-background: #201F1E;
    --md-sys-color-on-background: #E1DFDD;
    --md-sys-color-surface: #292827;
    --md-sys-color-on-surface: #E1DFDD;

    --md-sys-color-surface-variant: #3B3A39;
    --md-sys-color-on-surface-variant: #C8C6C4;
    --md-sys-color-outline: #979593;
}

/* ============================= */
/* Glassmorphism Design - Light Theme */
/* ============================= */
[data-design="glass"] {
    --md-sys-color-primary: #667eea;
    --md-sys-color-on-primary: #FFFFFF;
    --md-sys-color-primary-container: rgba(102, 126, 234, 0.15);
    --md-sys-color-on-primary-container: #667eea;

    --md-sys-color-secondary: #764ba2;
    --md-sys-color-on-secondary: #FFFFFF;
    --md-sys-color-secondary-container: rgba(118, 75, 162, 0.15);
    --md-sys-color-on-secondary-container: #764ba2;

    --md-sys-color-tertiary: #f093fb;
    --md-sys-color-on-tertiary: #FFFFFF;
    --md-sys-color-tertiary-container: rgba(240, 147, 251, 0.15);
    --md-sys-color-on-tertiary-container: #764ba2;

    --md-sys-color-error: #ff6b6b;
    --md-sys-color-on-error: #FFFFFF;
    --md-sys-color-error-container: rgba(255, 107, 107, 0.15);
    --md-sys-color-on-error-container: #ff6b6b;

    /* Glassmorphism uses transparent/translucent backgrounds */
    --md-sys-color-background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --md-sys-color-on-background: #1a1a2e;
    --md-sys-color-surface: rgba(255, 255, 255, 0.25);
    --md-sys-color-on-surface: #1a1a2e;

    --md-sys-color-surface-variant: rgba(255, 255, 255, 0.15);
    --md-sys-color-on-surface-variant: #2d2d44;
    --md-sys-color-outline: rgba(255, 255, 255, 0.3);

    /* Glassmorphism specific properties */
    --glass-blur: blur(10px);
    --glass-border: 1px solid rgba(255, 255, 255, 0.18);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);

    /* Softer elevations with glass effect */
    --md-sys-elevation-1: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    --md-sys-elevation-2: 0 8px 32px 0 rgba(31, 38, 135, 0.25);
    --md-sys-elevation-3: 0 8px 32px 0 rgba(31, 38, 135, 0.37);

    /* Typography - modern sans-serif */
    --md-sys-typescale-display-large: 400 57px/64px 'Roboto', sans-serif;
    --md-sys-typescale-headline-large: 600 32px/40px 'Roboto', sans-serif;
    --md-sys-typescale-headline-medium: 600 28px/36px 'Roboto', sans-serif;
    --md-sys-typescale-title-large: 600 22px/28px 'Roboto', sans-serif;
    --md-sys-typescale-body-large: 400 16px/24px 'Roboto', sans-serif;
    --md-sys-typescale-body-medium: 400 14px/20px 'Roboto', sans-serif;
    --md-sys-typescale-label-large: 600 14px/20px 'Roboto', sans-serif;

    /* Rounded corners for glass effect */
    --border-radius-lg: 20px;
    --border-radius-md: 16px;
    --border-radius-sm: 12px;
}

/* Glassmorphism-specific body background */
[data-design="glass"] body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    min-height: 100vh;
}

/* Glass effect for cards and surfaces */
[data-design="glass"] .card,
[data-design="glass"] .app-bar,
[data-design="glass"] .article-item {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

/* Stronger glass for status card */
[data-design="glass"] .status-card {
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Glass buttons */
[data-design="glass"] .btn-primary {
    background: rgba(102, 126, 234, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

[data-design="glass"] .btn-primary:hover {
    background: rgba(102, 126, 234, 0.9);
    box-shadow: 0 8px 16px 0 rgba(102, 126, 234, 0.4);
}

[data-design="glass"] .btn-secondary {
    background: rgba(118, 75, 162, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

[data-design="glass"] .btn-outlined {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--md-sys-color-on-surface);
}

/* Glass input fields */
[data-design="glass"] .text-field,
[data-design="glass"] .select-field,
[data-design="glass"] .design-select,
[data-design="glass"] .date-input {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* ============================= */
/* Glassmorphism Design - Dark Theme */
/* ============================= */
[data-design="glass"][data-theme="dark"] {
    --md-sys-color-primary: #a78bfa;
    --md-sys-color-on-primary: #1a1a2e;
    --md-sys-color-primary-container: rgba(167, 139, 250, 0.15);
    --md-sys-color-on-primary-container: #c4b5fd;

    --md-sys-color-secondary: #c084fc;
    --md-sys-color-on-secondary: #1a1a2e;
    --md-sys-color-secondary-container: rgba(192, 132, 252, 0.15);
    --md-sys-color-on-secondary-container: #e9d5ff;

    --md-sys-color-tertiary: #f0abfc;
    --md-sys-color-on-tertiary: #1a1a2e;
    --md-sys-color-tertiary-container: rgba(240, 171, 252, 0.15);
    --md-sys-color-on-tertiary-container: #fae8ff;

    --md-sys-color-error: #fca5a5;
    --md-sys-color-on-error: #1a1a2e;
    --md-sys-color-error-container: rgba(252, 165, 165, 0.15);
    --md-sys-color-on-error-container: #fee2e2;

    --md-sys-color-background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    --md-sys-color-on-background: #e5e7eb;
    --md-sys-color-surface: rgba(30, 30, 46, 0.4);
    --md-sys-color-on-surface: #e5e7eb;

    --md-sys-color-surface-variant: rgba(30, 30, 46, 0.3);
    --md-sys-color-on-surface-variant: #d1d5db;
    --md-sys-color-outline: rgba(255, 255, 255, 0.2);

    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);

    --md-sys-elevation-1: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    --md-sys-elevation-2: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    --md-sys-elevation-3: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
}

[data-design="glass"][data-theme="dark"] body {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    background-attachment: fixed;
}

[data-design="glass"][data-theme="dark"] .card,
[data-design="glass"][data-theme="dark"] .app-bar,
[data-design="glass"][data-theme="dark"] .article-item {
    background: rgba(30, 30, 46, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
}

[data-design="glass"][data-theme="dark"] .status-card {
    background: rgba(167, 139, 250, 0.2);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

[data-design="glass"][data-theme="dark"] .btn-primary {
    background: rgba(167, 139, 250, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

[data-design="glass"][data-theme="dark"] .btn-primary:hover {
    background: rgba(167, 139, 250, 0.8);
}

[data-design="glass"][data-theme="dark"] .btn-secondary {
    background: rgba(192, 132, 252, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

[data-design="glass"][data-theme="dark"] .btn-outlined {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

[data-design="glass"][data-theme="dark"] .text-field,
[data-design="glass"][data-theme="dark"] .select-field,
[data-design="glass"][data-theme="dark"] .design-select,
[data-design="glass"][data-theme="dark"] .date-input {
    background: rgba(30, 30, 46, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--md-sys-color-on-surface);
}

/* Dark Theme */
@media (prefers-color-scheme: dark) {
    :root {
        --md-sys-color-primary: #D0BCFF;
        --md-sys-color-on-primary: #381E72;
        --md-sys-color-primary-container: #4F378B;
        --md-sys-color-on-primary-container: #EADDFF;

        --md-sys-color-secondary: #CCC2DC;
        --md-sys-color-on-secondary: #332D41;
        --md-sys-color-secondary-container: #4A4458;
        --md-sys-color-on-secondary-container: #E8DEF8;

        --md-sys-color-tertiary: #EFB8C8;
        --md-sys-color-on-tertiary: #492532;
        --md-sys-color-tertiary-container: #633B48;
        --md-sys-color-on-tertiary-container: #FFD8E4;

        --md-sys-color-error: #F2B8B5;
        --md-sys-color-on-error: #601410;
        --md-sys-color-error-container: #8C1D18;
        --md-sys-color-on-error-container: #F9DEDC;

        --md-sys-color-background: #1C1B1F;
        --md-sys-color-on-background: #E6E1E5;
        --md-sys-color-surface: #1C1B1F;
        --md-sys-color-on-surface: #E6E1E5;

        --md-sys-color-surface-variant: #49454F;
        --md-sys-color-on-surface-variant: #CAC4D0;
        --md-sys-color-outline: #938F99;
    }
}

[data-theme="dark"] {
    --md-sys-color-primary: #D0BCFF;
    --md-sys-color-on-primary: #381E72;
    --md-sys-color-primary-container: #4F378B;
    --md-sys-color-on-primary-container: #EADDFF;

    --md-sys-color-secondary: #CCC2DC;
    --md-sys-color-on-secondary: #332D41;
    --md-sys-color-secondary-container: #4A4458;
    --md-sys-color-on-secondary-container: #E8DEF8;

    --md-sys-color-background: #1C1B1F;
    --md-sys-color-on-background: #E6E1E5;
    --md-sys-color-surface: #1C1B1F;
    --md-sys-color-on-surface: #E6E1E5;

    --md-sys-color-surface-variant: #49454F;
    --md-sys-color-on-surface-variant: #CAC4D0;
    --md-sys-color-outline: #938F99;
}

[data-theme="light"] {
    --md-sys-color-primary: #6750A4;
    --md-sys-color-on-primary: #FFFFFF;
    --md-sys-color-background: #FDFBFF;
    --md-sys-color-on-background: #1C1B1F;
    --md-sys-color-surface: #FDFBFF;
    --md-sys-color-on-surface: #1C1B1F;
}

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

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--md-sys-color-background);
    color: var(--md-sys-color-on-background);
    line-height: 1.5;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Layout */
.app-bar {
    background-color: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--md-sys-elevation-1);
    border-bottom: 1px solid var(--md-sys-color-surface-variant);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 24px;
}

.app-title {
    font: var(--md-sys-typescale-title-large);
    font-weight: 500;
}

.actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
}

.theme-toggle:hover {
    background-color: var(--md-sys-color-surface-variant);
}

.design-select {
    padding: 8px 32px 8px 12px;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: 20px;
    background-color: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface);
    font: var(--md-sys-typescale-body-medium);
    cursor: pointer;
    transition: all 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23605E5C' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.design-select:hover {
    background-color: var(--md-sys-color-surface-variant);
    border-color: var(--md-sys-color-primary);
}

.design-select:focus {
    outline: none;
    border-color: var(--md-sys-color-primary);
    border-width: 2px;
    padding: 7px 31px 7px 11px;
}


.main-container {
    max-width: var(--layout-max-width);
    margin: 0 auto;
    padding: 24px;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
}

/* Login Page Layout */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(135deg,
            var(--md-sys-color-background) 0%,
            var(--md-sys-color-surface-variant) 100%);
}

.login-container .card {
    width: 100%;
    max-width: 420px;
    box-shadow: var(--md-sys-elevation-3);
}

/* Components: Cards */
.card {
    background-color: var(--md-sys-color-surface);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: var(--md-sys-elevation-1);
    border: 1px solid var(--md-sys-color-outline);
    border-color: rgba(121, 116, 126, 0.12);
    /* Subtle border */
}

.card-title {
    font: var(--md-sys-typescale-title-large);
    color: var(--md-sys-color-on-surface);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.highlight-card {
    border: 2px solid var(--md-sys-color-primary-container);
    background: linear-gradient(to bottom right, var(--md-sys-color-surface), rgba(103, 80, 164, 0.03));
}

.status-card {
    background-color: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
}

.status-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.status-title {
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.status-text {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Components: Tabs */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--md-sys-color-outline);
    padding-bottom: 0;
}

.tab {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--md-sys-color-on-surface-variant);
    font: var(--md-sys-typescale-label-large);
    cursor: pointer;
    transition: all 0.2s;
}

.tab:hover {
    background-color: var(--md-sys-color-surface-variant);
}

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

.tab-info {
    color: var(--md-sys-color-on-surface-variant);
}

.loading-state {
    text-align: center;
    padding: 40px;
}

/* Buttons */
.btn {
    padding: 10px 24px;
    border-radius: 20px;
    border: none;
    font: var(--md-sys-typescale-label-large);
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    justify-content: center;
    min-height: 40px;
}

.btn-primary {
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}

.btn-primary:hover {
    box-shadow: var(--md-sys-elevation-1);
    background-color: color-mix(in srgb, var(--md-sys-color-primary), white 10%);
}

.btn-secondary {
    background-color: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
}

.btn-secondary:hover {
    box-shadow: var(--md-sys-elevation-1);
    background-color: color-mix(in srgb, var(--md-sys-color-secondary-container), black 5%);
}

.btn-outlined {
    background-color: transparent;
    border: 1px solid var(--md-sys-color-outline);
    color: var(--md-sys-color-primary);
}

.btn-outlined:hover {
    background-color: var(--md-sys-color-surface-variant);
}

.btn-text {
    background-color: transparent;
    color: var(--md-sys-color-primary);
    padding: 4px 12px;
}

.btn-text:hover {
    background-color: var(--md-sys-color-surface-variant);
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.form-label {
    margin-bottom: 8px;
    color: var(--md-sys-color-on-surface);
    font: var(--md-sys-typescale-label-large);
}

.text-field,
.select-field {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 16px;
    background-color: var(--md-sys-color-surface);
    border: 1px solid var(--md-sys-color-outline);
    border-radius: 4px;
    color: var(--md-sys-color-on-surface);
    font: var(--md-sys-typescale-body-large);
    transition: all 0.2s;
    appearance: none;
}

.text-field:focus,
.select-field:focus {
    outline: none;
    border-color: var(--md-sys-color-primary);
    border-width: 2px;
    padding: 11px 15px;
}

.text-field-area {
    min-height: 120px;
    font-family: monospace;
    line-height: 1.4;
}

/* Settings Layout */
.settings-page .main-container {
    grid-template-columns: 1fr;
    max-width: 1400px;
}

.settings-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
    align-items: start;
}

.settings-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.settings-col .card {
    margin-bottom: 0;
}

/* Env Grid */
.env-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.env-item {
    background-color: var(--md-sys-color-surface);
    border: 1px solid var(--md-sys-color-surface-variant);
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: background-color 0.2s;
}

.env-item:hover {
    background-color: rgba(0, 0, 0, 0.01);
}

.env-label-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.env-label-text {
    font: var(--md-sys-typescale-label-large);
    color: var(--md-sys-color-secondary);
}

.env-value {
    font-family: 'Roboto Mono', monospace;
    color: var(--md-sys-color-on-surface);
    font-size: 0.95rem;
    word-break: break-all;
    margin-left: 16px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-ok {
    background-color: #27ae60;
}

.status-error {
    background-color: var(--md-sys-color-error);
}

/* Select Wrapper for Arrow */
.select-wrapper {
    position: relative;
    width: 100%;
}

.select-wrapper::after {
    content: "▼";
    font-size: 0.8rem;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--md-sys-color-outline);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--md-sys-color-on-surface);
    color: var(--md-sys-color-surface);
    padding: 14px 28px;
    border-radius: 28px;
    box-shadow: var(--md-sys-elevation-3);
    font: var(--md-sys-typescale-body-medium);
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
    z-index: 2000;
}

.toast.show {
    opacity: 0.95;
    transform: translateX(-50%) translateY(0);
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 88px;
    align-self: start;
    max-height: calc(100vh - 104px);
    overflow-y: auto;
}

.sidebar-title {
    font-size: 1.1rem;
    margin-bottom: 12px;
    color: var(--md-sys-color-on-surface);
}

.sidebar-section-title {
    font-size: 0.9rem;
    color: var(--md-sys-color-primary);
    margin-top: 10px;
}

.sidebar-divider {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--md-sys-color-outline);
}

.date-search {
    display: flex;
    gap: 8px;
}

.date-input {
    padding: 8px;
    border-radius: 8px;
    border: 1px solid var(--md-sys-color-outline);
    background: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface);
    flex-grow: 1;
    font: var(--md-sys-typescale-body-medium);
}

/* Date Selection */
.date-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 12px;
}

.chip {
    padding: 8px 16px;
    background-color: var(--md-sys-color-surface-variant);
    border: 1px solid var(--md-sys-color-outline);
    border-radius: 16px;
    font: var(--md-sys-typescale-label-large);
    color: var(--md-sys-color-on-surface);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.chip:hover {
    background-color: var(--md-sys-color-primary-container);
    border-color: var(--md-sys-color-primary);
}

.chip.active {
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    border-color: var(--md-sys-color-primary);
}

/* Article Cards */
.article-item {
    background-color: var(--md-sys-color-surface);
    border: 1px solid var(--md-sys-color-outline);
    border-color: rgba(121, 116, 126, 0.12);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--md-sys-elevation-1);
    transition: box-shadow 0.2s, transform 0.2s;
}

.article-item:hover {
    box-shadow: var(--md-sys-elevation-2);
    transform: translateY(-2px);
}

.article-header {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 12px;
}

.article-index {
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    font-size: 0.9rem;
}

.article-title {
    font: var(--md-sys-typescale-title-large);
    color: var(--md-sys-color-on-surface);
    margin-bottom: 4px;
    line-height: 1.3;
}

.article-source {
    display: inline-block;
    padding: 4px 12px;
    background-color: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
    border-radius: 12px;
    font-size: 0.85rem;
    margin-top: 4px;
}

.article-summary {
    color: var(--md-sys-color-on-surface-variant);
    line-height: 1.6;
    margin-bottom: 16px;
    font: var(--md-sys-typescale-body-large);
}

/* Loading Spinner */
.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--md-sys-color-surface-variant);
    border-top-color: var(--md-sys-color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Utils */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mb-4 {
    margin-bottom: 16px;
}

/* Settings Page Enhancements */
.settings-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

.settings-actions>div:first-child {
    flex: 1;
    min-width: 200px;
}

.settings-actions .btn-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

/* Responsive */
@media (max-width: 900px) {
    .settings-layout {
        grid-template-columns: 1fr;
    }

    .main-container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        order: -1;
    }

    .settings-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .settings-actions .btn-group {
        width: 100%;
    }

    .settings-actions .btn-group button {
        flex: 1;
    }

    .actions {
        flex-wrap: wrap;
    }

    .design-select {
        order: -1;
        width: 100%;
    }
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--md-sys-color-surface-variant);
    border: 2px solid var(--md-sys-color-outline);
    transition: all 0.3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: var(--md-sys-color-on-surface-variant);
    transition: all 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--md-sys-color-primary);
    border-color: var(--md-sys-color-primary);
}

input:checked + .slider:before {
    background-color: var(--md-sys-color-on-primary);
    transform: translateX(24px);
}

input:focus + .slider {
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.1);
}