:root {
    /* =========================================
       GOOGLE ECOSYSTEM DESIGN TOKENS
       ========================================= */

    /* CORE BRAND PALETTE */
    --google-blue: #4285F4;
    --google-blue-hover: #3367D6;
    /* Darker for hover */
    --google-red: #EA4335;
    --google-yellow: #FBBC04;
    --google-green: #34A853;

    /* CORE TEXT COLORS */
    --text-primary: #202124;
    /* High emphasis */
    --text-secondary: #5F6368;
    /* Medium emphasis */
    --text-tertiary: #9AA0A6;
    /* Disabled/Low emphasis */

    /* CORE SURFACES */
    --surface-white: #FFFFFF;
    --surface-grey: #F8F9FA;
    /* Google's off-white background */
    --border-color: #DADCE0;
    /* Standard border */

    /* MATERIAL 3 COMPATIBILITY TOKENS */
    --md-sys-color-primary: var(--google-blue);
    --md-sys-color-on-primary: #FFFFFF;
    --md-sys-color-secondary: var(--text-secondary);
    --md-sys-color-background: var(--surface-white);
    --md-sys-color-on-background: var(--text-primary);
    --md-sys-color-surface: var(--surface-white);
    --md-sys-color-on-surface: var(--text-primary);
    --md-sys-color-surface-variant: var(--surface-grey);
    --md-sys-color-outline: var(--border-color);

    /* TYPOGRAPHY */
    --font-brand: 'Google Sans', 'Roboto', 'Arial', sans-serif;
    --font-plain: 'Roboto', 'Arial', sans-serif;

    /* SHAPES */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 24px;
    /* Pill shapes for main buttons */
    --radius-pill: 999px;

    /* ANIMATION */
    --easing-std: cubic-bezier(0.4, 0.0, 0.2, 1);
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-plain);
    background-color: var(--md-sys-color-background);
    color: var(--md-sys-color-on-background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* TYPOGRAPHY CLASSES */
.display-large {
    font-size: 57px;
    line-height: 64px;
    letter-spacing: -0.25px;
}

.headline-large {
    font-size: 32px;
    line-height: 40px;
}

.headline-medium {
    font-size: 28px;
    line-height: 36px;
}

.title-large {
    font-size: 22px;
    line-height: 28px;
    font-weight: 500;
}

.body-large {
    font-size: 16px;
    line-height: 24px;
    letter-spacing: 0.5px;
}

.body-medium {
    font-size: 14px;
    line-height: 20px;
    letter-spacing: 0.25px;
}

.label-large {
    font-size: 14px;
    line-height: 20px;
    letter-spacing: 0.1px;
    font-weight: 500;
}

/* COMPONENT: BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    /* Standard Google button height */
    padding: 0 24px;
    border-radius: var(--radius-sm);
    /* Standard is 4px for many apps, or pill. We'll stick to 4px for enterprise, Pill for landing */
    font-family: var(--font-brand);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.25px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background-color 0.2s, box-shadow 0.2s, transform 0.1s;
    text-decoration: none;
    line-height: 20px;
}

.btn-primary {
    background-color: var(--google-blue);
    color: #FFFFFF;
    box-shadow: 0 1px 2px rgba(66, 133, 244, 0.3);
}

.btn-primary:hover {
    background-color: var(--google-blue-hover);
    box-shadow: 0 2px 4px rgba(66, 133, 244, 0.4);
}

.btn-secondary {
    background-color: var(--surface-grey);
    color: var(--google-blue);
    border: 1px solid transparent;
}

.btn-secondary:hover {
    background-color: #E8EAED;
    /* Darker grey */
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--google-blue);
}

.btn-outline:hover {
    background-color: rgba(66, 133, 244, 0.04);
    border-color: var(--google-blue);
}

.btn-lg {
    height: 48px;
    font-size: 16px;
    padding: 0 32px;
}

/* COMPONENT: CARDS */
.card-filled {
    background-color: var(--md-sys-color-surface-variant);
    color: var(--md-sys-color-on-surface-variant);
    border-radius: var(--md-sys-shape-corner-medium);
    padding: 24px;
}

.card-elevated {
    background-color: var(--md-sys-color-surface-1);
    color: var(--md-sys-color-on-surface);
    border-radius: var(--md-sys-shape-corner-medium);
    padding: 24px;
    box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15), 0px 1px 2px 0px rgba(0, 0, 0, 0.3);
}

.card-outlined {
    background-color: var(--md-sys-color-surface);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-corner-medium);
    padding: 24px;
}

/* COMPONENT: TEXT FIELD (Outlined) */
.form-group {
    margin-bottom: 24px;
    position: relative;
}

.form-field {
    position: relative;
}

.form-input {
    width: 100%;
    height: 56px;
    padding: 0 16px;
    background: transparent;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: 4px;
    /* Small radius for text fields in M3 */
    color: var(--md-sys-color-on-surface);
    font-size: 16px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: var(--md-sys-color-primary);
    border-width: 2px;
    padding: 0 15px;
    /* Adjust for width change */
}

.form-label {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--md-sys-color-background);
    padding: 0 4px;
    font-size: 16px;
    color: var(--md-sys-color-on-surface-variant);
    transition: all 0.2s ease;
    pointer-events: none;
}

.form-input:focus~.form-label,
.form-input:not(:placeholder-shown)~.form-label {
    top: 0;
    font-size: 12px;
    color: var(--md-sys-color-primary);
    transform: translateY(-50%);
}

.form-error {
    color: var(--md-sys-color-error);
    font-size: 12px;
    margin-top: 4px;
    margin-left: 16px;
}

/* Utilities */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.d-flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.gap-2 {
    gap: 8px;
}

.gap-4 {
    gap: 16px;
}

.w-full {
    width: 100%;
}

/* Alerts / Toasts */
.toast-container {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background-color: var(--md-sys-color-inverse-surface, #313033);
    color: var(--md-sys-color-inverse-on-surface, #F4EFF4);
    padding: 14px 16px;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    font-size: 14px;
    min-width: 288px;
    animation: fadeUp 0.3s ease forwards;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Layout placeholders to prevent breaking existing */
/* Layout placeholders to prevent breaking existing */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
    background-color: var(--md-sys-color-background);
}

.main-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

/* SIDEBAR STYLES */
.sidebar {
    width: 280px;
    background-color: var(--md-sys-color-surface);
    /* White/Light Grey */
    border-right: 1px solid var(--md-sys-color-outline-variant);
    display: flex;
    flex-direction: column;
    padding: 12px;
    height: 100vh;
    position: sticky;
    top: 0;
    flex-shrink: 0;
    /* Prevent shrinking */
    z-index: 50;
}

.sidebar.surface-1 {
    background-color: var(--md-sys-color-surface);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 9999px;
    /* Pill shape */
    color: var(--md-sys-color-on-surface-variant);
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
    cursor: pointer;
}

.nav-link:hover {
    background-color: var(--md-sys-color-surface-variant);
    color: var(--md-sys-color-on-surface);
}

.nav-link.active,
.nav-link.active-page {
    /* Add active class logic later if needed */
    background-color: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
}

.nav-link .material-icons {
    font-size: 24px;
}

.sidebar-footer {
    border-top: 1px solid var(--md-sys-color-outline-variant);
    padding-top: 12px;
    margin-top: auto;
}

/* Badge fix */
.badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.badge-error {
    background: var(--md-sys-color-error);
    color: white;
}

.badge-warning {
    background: var(--google-yellow);
    color: black;
}

.badge-success {
    background: var(--google-green);
    color: white;
}

.badge-primary {
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
}

/* Utility fixes from dashboard.css conflict prevention */
.rounded-full {
    border-radius: 50%;
}

.justify-between {
    justify-content: space-between;
}

.items-center {
    align-items: center;
}

.text-muted {
    color: var(--text-secondary);
}