/* ========================================
   Material 3 Expressive Design System
   ======================================== */

/* CSS Variables - Material 3 Color Tokens */
:root {
    /* Primary Colors - Vibrant Purple */
    --md-sys-color-primary: #6750A4;
    --md-sys-color-on-primary: #FFFFFF;
    --md-sys-color-primary-container: #EADDFF;
    --md-sys-color-on-primary-container: #21005D;
    
    /* Secondary Colors - Teal */
    --md-sys-color-secondary: #00897B;
    --md-sys-color-on-secondary: #FFFFFF;
    --md-sys-color-secondary-container: #A7F3EC;
    --md-sys-color-on-secondary-container: #00201E;
    
    /* Tertiary Colors - Coral */
    --md-sys-color-tertiary: #FF6B6B;
    --md-sys-color-on-tertiary: #FFFFFF;
    --md-sys-color-tertiary-container: #FFD9D9;
    --md-sys-color-on-tertiary-container: #410002;
    
    /* Error Colors */
    --md-sys-color-error: #B3261E;
    --md-sys-color-on-error: #FFFFFF;
    --md-sys-color-error-container: #F9DEDC;
    --md-sys-color-on-error-container: #410E0B;
    
    /* Surface Colors */
    --md-sys-color-surface: #FEF7FF;
    --md-sys-color-on-surface: #1D1B20;
    --md-sys-color-surface-variant: #E7E0EC;
    --md-sys-color-on-surface-variant: #49454F;
    --md-sys-color-surface-container: #F3EDF7;
    --md-sys-color-surface-container-high: #ECE6F0;
    --md-sys-color-surface-container-highest: #E6E0E9;
    
    /* Outline Colors */
    --md-sys-color-outline: #79747E;
    --md-sys-color-outline-variant: #CAC4D0;
    
    /* Background */
    --md-sys-color-background: #FEF7FF;
    --md-sys-color-on-background: #1D1B20;
    
    /* Success */
    --md-sys-color-success: #4CAF50;
    --md-sys-color-on-success: #FFFFFF;
    
    /* Typography */
    --md-sys-typescale-display-large: 600 57px/64px 'Outfit', sans-serif;
    --md-sys-typescale-display-medium: 600 45px/52px 'Outfit', sans-serif;
    --md-sys-typescale-headline-large: 600 32px/40px 'Outfit', sans-serif;
    --md-sys-typescale-headline-medium: 500 28px/36px 'Outfit', sans-serif;
    --md-sys-typescale-title-large: 500 22px/28px 'Outfit', sans-serif;
    --md-sys-typescale-title-medium: 500 16px/24px 'Outfit', sans-serif;
    --md-sys-typescale-body-large: 400 16px/24px 'Inter', sans-serif;
    --md-sys-typescale-body-medium: 400 14px/20px 'Inter', sans-serif;
    --md-sys-typescale-label-large: 500 14px/20px 'Inter', sans-serif;
    --md-sys-typescale-label-medium: 500 12px/16px 'Inter', sans-serif;
    
    /* 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);
    --md-sys-elevation-4: 0 6px 10px 4px rgba(0,0,0,0.15), 0 2px 3px rgba(0,0,0,0.3);
    
    /* Shape */
    --md-sys-shape-corner-none: 0;
    --md-sys-shape-corner-extra-small: 4px;
    --md-sys-shape-corner-small: 8px;
    --md-sys-shape-corner-medium: 12px;
    --md-sys-shape-corner-large: 16px;
    --md-sys-shape-corner-extra-large: 28px;
    --md-sys-shape-corner-full: 9999px;
    
    /* Transitions */
    --md-sys-motion-duration-short: 100ms;
    --md-sys-motion-duration-medium: 250ms;
    --md-sys-motion-duration-long: 400ms;
    --md-sys-motion-easing-standard: cubic-bezier(0.2, 0, 0, 1);
    --md-sys-motion-easing-emphasized: cubic-bezier(0.2, 0, 0, 1);
}

/* Dark Theme */
[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: #4DB6AC;
    --md-sys-color-on-secondary: #003735;
    --md-sys-color-secondary-container: #00504D;
    --md-sys-color-on-secondary-container: #A7F3EC;
    
    --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-high: #2B2930;
    --md-sys-color-surface-container-highest: #36343B;
    
    --md-sys-color-background: #141218;
    --md-sys-color-on-background: #E6E0E9;
    
    --md-sys-color-outline: #938F99;
    --md-sys-color-outline-variant: #49454F;
}

/* ========================================
   Global Styles
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Outfit:wght@500;600;700&display=swap');

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font: var(--md-sys-typescale-body-large);
    background: var(--md-sys-color-background);
    color: var(--md-sys-color-on-background);
    min-height: 100vh;
    transition: background-color var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-standard);
}

/* ========================================
   Layout Components
   ======================================== */

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Top App Bar */
.top-app-bar {
    background: linear-gradient(135deg, var(--md-sys-color-primary), var(--md-sys-color-secondary));
    color: var(--md-sys-color-on-primary);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--md-sys-elevation-2);
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-app-bar__title {
    font: var(--md-sys-typescale-title-large);
    display: flex;
    align-items: center;
    gap: 12px;
}

.top-app-bar__title svg {
    width: 28px;
    height: 28px;
}

.top-app-bar__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Navigation Rail / Bottom Navigation */
.nav-rail {
    background: var(--md-sys-color-surface-container);
    display: flex;
    flex-direction: column;
    padding: 12px 4px;
    gap: 4px;
    width: 80px;
    position: fixed;
    left: 0;
    top: 72px;
    bottom: 0;
    box-shadow: var(--md-sys-elevation-1);
}

.nav-rail__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 16px;
    gap: 4px;
    text-decoration: none;
    color: var(--md-sys-color-on-surface-variant);
    border-radius: var(--md-sys-shape-corner-large);
    transition: all var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-standard);
    cursor: pointer;
}

.nav-rail__item:hover {
    background: var(--md-sys-color-surface-container-high);
    color: var(--md-sys-color-on-surface);
}

.nav-rail__item.active {
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
}

.nav-rail__item svg {
    width: 24px;
    height: 24px;
}

.nav-rail__item span {
    font: var(--md-sys-typescale-label-medium);
}

.content-with-nav {
    margin-left: 80px;
}

@media (max-width: 768px) {
    .nav-rail {
        flex-direction: row;
        width: 100%;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        justify-content: space-around;
        padding: 8px 0;
        height: 80px;
    }
    
    .content-with-nav {
        margin-left: 0;
        margin-bottom: 80px;
    }
}

/* ========================================
   Card Components
   ======================================== */

.card {
    background: var(--md-sys-color-surface-container);
    border-radius: var(--md-sys-shape-corner-large);
    padding: 20px;
    box-shadow: var(--md-sys-elevation-1);
    transition: all var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-standard);
}

.card:hover {
    box-shadow: var(--md-sys-elevation-2);
    transform: translateY(-2px);
}

.card--elevated {
    background: var(--md-sys-color-surface);
    box-shadow: var(--md-sys-elevation-2);
}

.card--filled {
    background: var(--md-sys-color-surface-container-highest);
    box-shadow: none;
}

.card--outlined {
    background: var(--md-sys-color-surface);
    border: 1px solid var(--md-sys-color-outline-variant);
    box-shadow: none;
}

.card__header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.card__avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--md-sys-shape-corner-full);
    background: linear-gradient(135deg, var(--md-sys-color-primary), var(--md-sys-color-tertiary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font: var(--md-sys-typescale-title-medium);
}

.card__title {
    font: var(--md-sys-typescale-title-large);
    color: var(--md-sys-color-on-surface);
}

.card__subtitle {
    font: var(--md-sys-typescale-body-medium);
    color: var(--md-sys-color-on-surface-variant);
}

.card__content {
    font: var(--md-sys-typescale-body-medium);
    color: var(--md-sys-color-on-surface-variant);
}

.card__actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    justify-content: flex-end;
}

/* ========================================
   Button Components
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font: var(--md-sys-typescale-label-large);
    border: none;
    border-radius: var(--md-sys-shape-corner-full);
    cursor: pointer;
    transition: all var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-emphasized);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: currentColor;
    opacity: 0;
    transition: opacity var(--md-sys-motion-duration-short);
}

.btn:hover::before {
    opacity: 0.08;
}

.btn:active::before {
    opacity: 0.12;
}

.btn:disabled {
    opacity: 0.38;
    cursor: not-allowed;
}

.btn--filled {
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    box-shadow: var(--md-sys-elevation-1);
}

.btn--filled:hover {
    box-shadow: var(--md-sys-elevation-2);
}

.btn--outlined {
    background: transparent;
    color: var(--md-sys-color-primary);
    border: 1px solid var(--md-sys-color-outline);
}

.btn--text {
    background: transparent;
    color: var(--md-sys-color-primary);
    padding: 12px 16px;
}

.btn--tonal {
    background: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
}

.btn--elevated {
    background: var(--md-sys-color-surface-container);
    color: var(--md-sys-color-primary);
    box-shadow: var(--md-sys-elevation-1);
}

.btn--fab {
    width: 56px;
    height: 56px;
    padding: 0;
    border-radius: var(--md-sys-shape-corner-large);
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    box-shadow: var(--md-sys-elevation-3);
    position: fixed;
    bottom: 24px;
    right: 24px;
}

.btn--fab:hover {
    box-shadow: var(--md-sys-elevation-4);
}

.btn--fab svg {
    width: 24px;
    height: 24px;
}

.btn--icon {
    width: 48px;
    height: 48px;
    padding: 0;
    background: transparent;
    color: var(--md-sys-color-on-surface-variant);
}

.btn--danger {
    background: var(--md-sys-color-error);
    color: var(--md-sys-color-on-error);
}

/* ========================================
   Form Components
   ======================================== */

.form-field {
    margin-bottom: 20px;
}

.text-field {
    position: relative;
    width: 100%;
}

.text-field__input {
    width: 100%;
    padding: 16px;
    padding-top: 24px;
    font: var(--md-sys-typescale-body-large);
    color: var(--md-sys-color-on-surface);
    background: var(--md-sys-color-surface-container-highest);
    border: none;
    border-bottom: 2px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-extra-small) var(--md-sys-shape-corner-extra-small) 0 0;
    outline: none;
    transition: all var(--md-sys-motion-duration-short);
}

.text-field__input:focus {
    border-bottom-color: var(--md-sys-color-primary);
    background: var(--md-sys-color-surface-container-high);
}

.text-field__input:focus + .text-field__label,
.text-field__input:not(:placeholder-shown) + .text-field__label {
    top: 8px;
    font-size: 12px;
    color: var(--md-sys-color-primary);
}

.text-field__label {
    position: absolute;
    left: 16px;
    top: 20px;
    font: var(--md-sys-typescale-body-large);
    color: var(--md-sys-color-on-surface-variant);
    pointer-events: none;
    transition: all var(--md-sys-motion-duration-short);
}

.text-field--outlined .text-field__input {
    background: transparent;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-extra-small);
    padding: 16px;
}

.text-field--outlined .text-field__input:focus {
    border: 2px solid var(--md-sys-color-primary);
    padding: 15px;
}

.text-field--outlined .text-field__label {
    background: var(--md-sys-color-background);
    padding: 0 4px;
}

.text-field--error .text-field__input {
    border-bottom-color: var(--md-sys-color-error);
}

.text-field__helper {
    font: var(--md-sys-typescale-body-medium);
    color: var(--md-sys-color-on-surface-variant);
    padding: 4px 16px;
}

.text-field--error .text-field__helper {
    color: var(--md-sys-color-error);
}

textarea.text-field__input {
    min-height: 120px;
    resize: vertical;
}

/* ========================================
   Auth Form - Login/Register
   ======================================== */

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--md-sys-color-primary) 0%, var(--md-sys-color-secondary) 50%, var(--md-sys-color-tertiary) 100%);
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.auth-container::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    top: -200px;
    right: -200px;
    animation: float 6s ease-in-out infinite;
}

.auth-container::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
    bottom: -100px;
    left: -100px;
    animation: float 8s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(10deg); }
}

.auth-card {
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-extra-large);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--md-sys-elevation-4);
    position: relative;
    z-index: 1;
    animation: slideUp 0.5s var(--md-sys-motion-easing-emphasized);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-card__logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-card__logo svg {
    width: 72px;
    height: 72px;
    color: var(--md-sys-color-primary);
}

.auth-card__logo h1 {
    font: var(--md-sys-typescale-headline-medium);
    background: linear-gradient(135deg, var(--md-sys-color-primary), var(--md-sys-color-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-top: 16px;
}

.auth-card__logo p {
    font: var(--md-sys-typescale-body-medium);
    color: var(--md-sys-color-on-surface-variant);
    margin-top: 8px;
}

.auth-tabs {
    display: flex;
    margin-bottom: 32px;
    background: var(--md-sys-color-surface-container);
    border-radius: var(--md-sys-shape-corner-full);
    padding: 4px;
}

.auth-tabs__tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    font: var(--md-sys-typescale-label-large);
    color: var(--md-sys-color-on-surface-variant);
    background: transparent;
    border: none;
    border-radius: var(--md-sys-shape-corner-full);
    cursor: pointer;
    transition: all var(--md-sys-motion-duration-medium);
}

.auth-tabs__tab.active {
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.auth-form__submit {
    width: 100%;
    margin-top: 24px;
}

.divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--md-sys-color-outline-variant);
}

.divider span {
    font: var(--md-sys-typescale-label-medium);
    color: var(--md-sys-color-on-surface-variant);
}

/* ========================================
   Data Table
   ======================================== */

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-large);
    overflow: hidden;
    box-shadow: var(--md-sys-elevation-1);
}

.data-table thead {
    background: var(--md-sys-color-surface-container);
}

.data-table th {
    font: var(--md-sys-typescale-label-large);
    color: var(--md-sys-color-on-surface-variant);
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.data-table td {
    font: var(--md-sys-typescale-body-medium);
    color: var(--md-sys-color-on-surface);
    padding: 16px;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.data-table tbody tr {
    transition: background var(--md-sys-motion-duration-short);
}

.data-table tbody tr:hover {
    background: var(--md-sys-color-surface-container-low);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* ========================================
   Chips
   ======================================== */

.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    font: var(--md-sys-typescale-label-large);
    border-radius: var(--md-sys-shape-corner-small);
    transition: all var(--md-sys-motion-duration-short);
}

.chip--filled {
    background: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
}

.chip--outlined {
    background: transparent;
    border: 1px solid var(--md-sys-color-outline);
    color: var(--md-sys-color-on-surface-variant);
}

.chip--success {
    background: rgba(76, 175, 80, 0.15);
    color: var(--md-sys-color-success);
}

.chip--error {
    background: var(--md-sys-color-error-container);
    color: var(--md-sys-color-on-error-container);
}

/* ========================================
   Dialog / Modal
   ======================================== */

.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;
    visibility: hidden;
    transition: all var(--md-sys-motion-duration-medium);
}

.dialog-overlay.active {
    opacity: 1;
    visibility: visible;
}

.dialog {
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-extra-large);
    padding: 24px;
    width: 90%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--md-sys-elevation-4);
    transform: scale(0.9);
    transition: transform var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-emphasized);
}

.dialog-overlay.active .dialog {
    transform: scale(1);
}

.dialog__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.dialog__title {
    font: var(--md-sys-typescale-headline-medium);
    color: var(--md-sys-color-on-surface);
}

.dialog__content {
    margin-bottom: 24px;
}

.dialog__actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ========================================
   Snackbar / Toast
   ======================================== */

.snackbar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--md-sys-color-on-surface);
    color: var(--md-sys-color-surface);
    padding: 14px 24px;
    border-radius: var(--md-sys-shape-corner-small);
    box-shadow: var(--md-sys-elevation-3);
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 2000;
    opacity: 0;
    transition: all var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-emphasized);
}

.snackbar.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.snackbar--success {
    background: var(--md-sys-color-success);
    color: var(--md-sys-color-on-success);
}

.snackbar--error {
    background: var(--md-sys-color-error);
    color: var(--md-sys-color-on-error);
}

/* ========================================
   Loading Spinner
   ======================================== */

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--md-sys-color-surface-container);
    border-top-color: var(--md-sys-color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

/* ========================================
   Empty State
   ======================================== */

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--md-sys-color-on-surface-variant);
}

.empty-state svg {
    width: 96px;
    height: 96px;
    opacity: 0.5;
    margin-bottom: 24px;
}

.empty-state__title {
    font: var(--md-sys-typescale-title-large);
    margin-bottom: 8px;
}

.empty-state__description {
    font: var(--md-sys-typescale-body-medium);
}

/* ========================================
   Map Container
   ======================================== */

.map-container {
    width: 100%;
    height: 500px;
    border-radius: var(--md-sys-shape-corner-large);
    overflow: hidden;
    box-shadow: var(--md-sys-elevation-2);
}

/* ========================================
   File Upload
   ======================================== */

.file-upload {
    border: 2px dashed var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-large);
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: all var(--md-sys-motion-duration-short);
}

.file-upload:hover {
    border-color: var(--md-sys-color-primary);
    background: var(--md-sys-color-surface-container);
}

.file-upload.dragover {
    border-color: var(--md-sys-color-primary);
    background: var(--md-sys-color-primary-container);
}

.file-upload__icon {
    width: 48px;
    height: 48px;
    color: var(--md-sys-color-on-surface-variant);
    margin-bottom: 16px;
}

.file-upload__text {
    font: var(--md-sys-typescale-body-large);
    color: var(--md-sys-color-on-surface-variant);
}

.file-upload input[type="file"] {
    display: none;
}

.file-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}

.file-preview__item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: var(--md-sys-shape-corner-medium);
    overflow: hidden;
    box-shadow: var(--md-sys-elevation-1);
}

.file-preview__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-preview__remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: var(--md-sys-color-error);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========================================
   Utilities
   ======================================== */

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.p-4 { padding: 16px; }
.p-6 { padding: 24px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.hidden { display: none !important; }

.grid {
    display: grid;
    gap: 24px;
}

.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 768px) {
    .grid-cols-2, .grid-cols-3 {
        grid-template-columns: 1fr;
    }
    
    .main-content {
        padding: 12px;
    }
    
    .auth-card {
        padding: 24px;
    }
    
    .top-app-bar {
        padding: 12px 16px;
    }
    
    .top-app-bar__title {
        font-size: 18px;
    }
    
    .top-app-bar__title span {
        display: none;
    }
    
    .card {
        padding: 16px;
    }
    
    .dialog {
        width: 95%;
        padding: 16px;
        max-height: 85vh;
    }
    
    .panel-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
    
    .panel-card {
        min-height: 180px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .btn--fab {
        width: 48px;
        height: 48px;
        bottom: 90px;
        right: 16px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .map-stats {
        flex-direction: column;
        gap: 8px;
    }
    
    .map-stat {
        padding: 12px;
    }
    
    #map {
        height: calc(100vh - 280px) !important;
    }
}

@media (max-width: 480px) {
    .top-app-bar__actions {
        gap: 4px;
    }
    
    .btn--icon {
        width: 40px;
        height: 40px;
    }
    
    .text-field__input {
        padding: 12px;
        padding-top: 20px;
        font-size: 14px;
    }
    
    .nav-rail__item span {
        font-size: 10px;
    }
}

