:root {
    /* Material 3 Color Scheme - Dark Theme */
    --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-surface: #141218;
    --md-sys-color-on-surface: #E6E0E9;
    --md-sys-color-surface-variant: #49454F;
    --md-sys-color-on-surface-variant: #CAC4D0;
    
    --md-sys-color-surface-container: #211F26;
    --md-sys-color-surface-container-low: #1D1B20;
    --md-sys-color-surface-container-high: #2B2930;
    --md-sys-color-surface-container-highest: #36343B;
    
    --md-sys-color-outline: #938F99;
    --md-sys-color-outline-variant: #49454F;
    
    /* Elevation */
    --md-sys-elevation-1: 0 1px 3px 1px rgba(0,0,0,0.15), 0 1px 2px rgba(0,0,0,0.3);
    --md-sys-elevation-2: 0 2px 6px 2px rgba(0,0,0,0.15), 0 1px 2px rgba(0,0,0,0.3);
    --md-sys-elevation-3: 0 4px 8px 3px rgba(0,0,0,0.15), 0 1px 3px rgba(0,0,0,0.3);
    
    /* Typography */
    --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;
    --md-sys-typescale-title-large: 400 22px/28px 'Roboto', sans-serif;
    --md-sys-typescale-headline-small: 400 24px/32px 'Roboto', sans-serif;
}

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

body {
    font: var(--md-sys-typescale-body-large);
    background: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface);
    min-height: 100vh;
}

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

.md-button .material-icons {
    font-size: 18px;
}

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

.md-button-filled:hover {
    box-shadow: var(--md-sys-elevation-1);
    filter: brightness(1.08);
}

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

.md-button-outlined:hover {
    background: rgba(208, 188, 255, 0.08);
}

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

.md-button-text:hover {
    background: rgba(208, 188, 255, 0.08);
}

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

.md-button-tonal:hover {
    box-shadow: var(--md-sys-elevation-1);
    filter: brightness(1.08);
}

.md-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--md-sys-color-on-surface-variant);
    cursor: pointer;
    transition: all 0.2s ease;
}

.md-icon-button:hover {
    background: rgba(202, 196, 208, 0.08);
}

.full-width {
    width: 100%;
}

/* Text Fields */
.md-text-field {
    position: relative;
    margin-bottom: 24px;
}

.md-text-field input,
.md-text-field textarea {
    width: 100%;
    padding: 16px;
    background: var(--md-sys-color-surface-container-highest);
    border: none;
    border-bottom: 2px solid var(--md-sys-color-outline);
    border-radius: 4px 4px 0 0;
    font: var(--md-sys-typescale-body-large);
    color: var(--md-sys-color-on-surface);
    transition: all 0.2s ease;
}

.md-text-field input:focus,
.md-text-field textarea:focus {
    outline: none;
    border-bottom-color: var(--md-sys-color-primary);
}

.md-text-field label {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font: var(--md-sys-typescale-body-large);
    color: var(--md-sys-color-on-surface-variant);
    pointer-events: none;
    transition: all 0.2s ease;
}

.md-text-field input:focus + label,
.md-text-field input:not(:placeholder-shown) + label,
.md-text-field textarea:focus + label,
.md-text-field textarea:not(:placeholder-shown) + label {
    top: 8px;
    font-size: 12px;
    color: var(--md-sys-color-primary);
}

.md-text-field input::placeholder,
.md-text-field textarea::placeholder {
    color: transparent;
}

/* Cards */
.md-card {
    background: var(--md-sys-color-surface-container);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.md-card-elevated {
    box-shadow: var(--md-sys-elevation-1);
}

.md-card-elevated:hover {
    box-shadow: var(--md-sys-elevation-2);
}

.md-card-image {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    background: var(--md-sys-color-surface-container-high);
}

.md-card-content {
    padding: 16px;
}

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

.md-card-subtitle {
    font: var(--md-sys-typescale-body-medium);
    color: var(--md-sys-color-on-surface-variant);
}

.md-card-actions {
    display: flex;
    gap: 8px;
    padding: 8px 16px 16px;
}

/* App Bar */
.md-app-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: var(--md-sys-color-surface);
    position: sticky;
    top: 0;
    z-index: 100;
}

.md-app-bar-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font: var(--md-sys-typescale-title-large);
    color: var(--md-sys-color-on-surface);
}

.md-app-bar-title .material-icons {
    font-size: 28px;
    color: var(--md-sys-color-primary);
}

.md-app-bar-actions {
    display: flex;
    gap: 8px;
}

/* FAB */
.md-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 24px;
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    border: none;
    border-radius: 16px;
    font: var(--md-sys-typescale-label-large);
    cursor: pointer;
    box-shadow: var(--md-sys-elevation-3);
    transition: all 0.2s ease;
}

.md-fab:hover {
    filter: brightness(1.08);
}

.md-fab .material-icons {
    font-size: 24px;
}

/* Dialog */
.md-dialog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.md-dialog-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.md-dialog {
    width: 100%;
    max-width: 560px;
    background: var(--md-sys-color-surface-container-high);
    border-radius: 28px;
    padding: 24px;
    transform: scale(0.9);
    transition: transform 0.2s ease;
}

.md-dialog-overlay.active .md-dialog {
    transform: scale(1);
}

.md-dialog-title {
    font: var(--md-sys-typescale-headline-small);
    color: var(--md-sys-color-on-surface);
    margin-bottom: 16px;
}

.md-dialog-content {
    font: var(--md-sys-typescale-body-medium);
    color: var(--md-sys-color-on-surface-variant);
    margin-bottom: 24px;
}

.md-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Snackbar */
.md-snackbar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--md-sys-color-surface-container-highest);
    color: var(--md-sys-color-on-surface);
    padding: 14px 16px;
    border-radius: 4px;
    box-shadow: var(--md-sys-elevation-3);
    font: var(--md-sys-typescale-body-medium);
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s ease;
}

.md-snackbar.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* File Input */
.md-file-input {
    position: relative;
}

.md-file-input input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

.md-file-drop {
    border: 2px dashed var(--md-sys-color-outline);
    border-radius: 16px;
    padding: 48px 24px;
    text-align: center;
    transition: all 0.2s ease;
}

.md-file-drop:hover,
.md-file-drop.dragover {
    border-color: var(--md-sys-color-primary);
    background: rgba(208, 188, 255, 0.08);
}

.md-file-drop .material-icons {
    font-size: 48px;
    color: var(--md-sys-color-primary);
    margin-bottom: 16px;
}

.md-file-drop-text {
    font: var(--md-sys-typescale-body-large);
    color: var(--md-sys-color-on-surface);
    margin-bottom: 8px;
}

.md-file-drop-hint {
    font: var(--md-sys-typescale-body-medium);
    color: var(--md-sys-color-on-surface-variant);
}

/* Loading */
.md-progress {
    width: 100%;
    height: 4px;
    background: var(--md-sys-color-surface-container-highest);
    border-radius: 2px;
    overflow: hidden;
}

.md-progress-bar {
    height: 100%;
    background: var(--md-sys-color-primary);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Empty State */
.md-empty-state {
    text-align: center;
    padding: 80px 24px;
}

.md-empty-state .material-icons {
    font-size: 96px;
    color: var(--md-sys-color-outline);
    margin-bottom: 24px;
}

.md-empty-state-title {
    font: var(--md-sys-typescale-headline-small);
    color: var(--md-sys-color-on-surface);
    margin-bottom: 8px;
}

.md-empty-state-text {
    font: var(--md-sys-typescale-body-large);
    color: var(--md-sys-color-on-surface-variant);
}

/* Grid */
.md-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    padding: 24px;
}

/* Chips */
.md-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: var(--md-sys-color-surface-container-high);
    border: 1px solid var(--md-sys-color-outline);
    border-radius: 8px;
    font: var(--md-sys-typescale-body-medium);
    color: var(--md-sys-color-on-surface-variant);
}

.md-chip .material-icons {
    font-size: 18px;
}
