/* Material Design 3 Complete Implementation */

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

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

/* Material Design 3 Tokens */
:root {
    /* Primary Colors */
    --md-sys-color-primary: #6750a4;
    --md-sys-color-primary-container: #eaddff;
    --md-sys-color-on-primary: #ffffff;
    --md-sys-color-on-primary-container: #21005d;

    /* Secondary Colors */
    --md-sys-color-secondary: #625b71;
    --md-sys-color-secondary-container: #e8def8;
    --md-sys-color-on-secondary: #ffffff;
    --md-sys-color-on-secondary-container: #1d192b;

    /* Tertiary Colors */
    --md-sys-color-tertiary: #7d5260;
    --md-sys-color-tertiary-container: #ffd8e4;
    --md-sys-color-on-tertiary: #ffffff;
    --md-sys-color-on-tertiary-container: #31111d;

    /* Error Colors */
    --md-sys-color-error: #ba1a1a;
    --md-sys-color-error-container: #ffdad6;
    --md-sys-color-on-error: #ffffff;
    --md-sys-color-on-error-container: #410002;

    /* Surface Colors */
    --md-sys-color-surface: #fffbfe;
    --md-sys-color-surface-variant: #e7e0ec;
    --md-sys-color-on-surface: #1d1b20;
    --md-sys-color-on-surface-variant: #49454f;

    /* Background */
    --md-sys-color-background: #fffbfe;
    --md-sys-color-on-background: #1d1b20;

    /* Outline */
    --md-sys-color-outline: #79747e;
    --md-sys-color-outline-variant: #cac4d0;

    /* States */
    --md-sys-color-primary-hover: #56358d;
    --md-sys-color-primary-focus: #4c2882;
    --md-sys-color-error-hover: #93000a;
    --md-sys-color-error-focus: #93000a;

    /* Legacy Colors for Compatibility */
    --md-sys-color-primary: #6750a4;
    --md-sys-color-primary-hover: #56358d;
    --md-sys-color-secondary: #625b71;
    --md-sys-color-secondary-container: #4c4858;
    --md-sys-color-background: #fffbfe;
    --md-sys-color-surface: #fffbfe;
    --md-sys-color-error: #ba1a1a;
    --md-sys-color-on-primary: #ffffff;
    --md-sys-color-on-secondary: #ffffff;
    --md-sys-color-on-background: #1d1b20;
    --md-sys-color-on-surface: #1d1b20;
    --md-sys-color-on-error: #ffffff;

    /* Typography */
    --md-sys-typescale-display-large-font-family: 'Roboto', sans-serif;
    --md-sys-typescale-display-large-font-size: 57px;
    --md-sys-typescale-display-large-font-weight: 400;
    --md-sys-typescale-display-large-line-height: 64px;
    --md-sys-typescale-display-large-letter-spacing: -0.25px;

    --md-sys-typescale-display-medium-font-family: 'Roboto', sans-serif;
    --md-sys-typescale-display-medium-font-size: 45px;
    --md-sys-typescale-display-medium-font-weight: 400;
    --md-sys-typescale-display-medium-line-height: 52px;

    --md-sys-typescale-display-small-font-family: 'Roboto', sans-serif;
    --md-sys-typescale-display-small-font-size: 36px;
    --md-sys-typescale-display-small-font-weight: 400;
    --md-sys-typescale-display-small-line-height: 44px;

    --md-sys-typescale-headline-large-font-family: 'Roboto', sans-serif;
    --md-sys-typescale-headline-large-font-size: 32px;
    --md-sys-typescale-headline-large-font-weight: 400;
    --md-sys-typescale-headline-large-line-height: 40px;

    --md-sys-typescale-headline-medium-font-family: 'Roboto', sans-serif;
    --md-sys-typescale-headline-medium-font-size: 28px;
    --md-sys-typescale-headline-medium-font-weight: 400;
    --md-sys-typescale-headline-medium-line-height: 36px;

    --md-sys-typescale-headline-small-font-family: 'Roboto', sans-serif;
    --md-sys-typescale-headline-small-font-size: 24px;
    --md-sys-typescale-headline-small-font-weight: 400;
    --md-sys-typescale-headline-small-line-height: 32px;

    --md-sys-typescale-title-large-font-family: 'Roboto', sans-serif;
    --md-sys-typescale-title-large-font-size: 22px;
    --md-sys-typescale-title-large-font-weight: 500;
    --md-sys-typescale-title-large-line-height: 28px;

    --md-sys-typescale-title-medium-font-family: 'Roboto', sans-serif;
    --md-sys-typescale-title-medium-font-size: 16px;
    --md-sys-typescale-title-medium-font-weight: 500;
    --md-sys-typescale-title-medium-line-height: 24px;
    --md-sys-typescale-title-medium-letter-spacing: 0.15px;

    --md-sys-typescale-title-small-font-family: 'Roboto', sans-serif;
    --md-sys-typescale-title-small-font-size: 14px;
    --md-sys-typescale-title-small-font-weight: 500;
    --md-sys-typescale-title-small-line-height: 20px;
    --md-sys-typescale-title-small-letter-spacing: 0.1px;

    --md-sys-typescale-label-large-font-family: 'Roboto', sans-serif;
    --md-sys-typescale-label-large-font-size: 14px;
    --md-sys-typescale-label-large-font-weight: 500;
    --md-sys-typescale-label-large-line-height: 20px;
    --md-sys-typescale-label-large-letter-spacing: 0.1px;

    --md-sys-typescale-label-medium-font-family: 'Roboto', sans-serif;
    --md-sys-typescale-label-medium-font-size: 12px;
    --md-sys-typescale-label-medium-font-weight: 500;
    --md-sys-typescale-label-medium-line-height: 16px;
    --md-sys-typescale-label-medium-letter-spacing: 0.5px;

    --md-sys-typescale-label-small-font-family: 'Roboto', sans-serif;
    --md-sys-typescale-label-small-font-size: 11px;
    --md-sys-typescale-label-small-font-weight: 500;
    --md-sys-typescale-label-small-line-height: 16px;
    --md-sys-typescale-label-small-letter-spacing: 0.5px;

    --md-sys-typescale-body-large-font-family: 'Roboto', sans-serif;
    --md-sys-typescale-body-large-font-size: 16px;
    --md-sys-typescale-body-large-font-weight: 400;
    --md-sys-typescale-body-large-line-height: 24px;
    --md-sys-typescale-body-large-letter-spacing: 0.15px;

    --md-sys-typescale-body-medium-font-family: 'Roboto', sans-serif;
    --md-sys-typescale-body-medium-font-size: 14px;
    --md-sys-typescale-body-medium-font-weight: 400;
    --md-sys-typescale-body-medium-line-height: 20px;
    --md-sys-typescale-body-medium-letter-spacing: 0.25px;

    --md-sys-typescale-body-small-font-family: 'Roboto', sans-serif;
    --md-sys-typescale-body-small-font-size: 12px;
    --md-sys-typescale-body-small-font-weight: 400;
    --md-sys-typescale-body-small-line-height: 16px;
    --md-sys-typescale-body-small-letter-spacing: 0.4px;

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-xxl: 48px;
    --spacing-xxxl: 64px;

    /* Shape Scale */
    --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;

    /* Elevation */
    --md-sys-elevation-level0: none;
    --md-sys-elevation-level1: 0px 1px 2px 0px rgba(0,0,0,0.30), 0px 1px 3px 1px rgba(0,0,0,0.15);
    --md-sys-elevation-level2: 0px 1px 2px 0px rgba(0,0,0,0.30), 0px 2px 6px 2px rgba(0,0,0,0.15);
    --md-sys-elevation-level3: 0px 1px 3px 0px rgba(0,0,0,0.30), 0px 4px 8px 3px rgba(0,0,0,0.15);
    --md-sys-elevation-level4: 0px 2px 3px 0px rgba(0,0,0,0.30), 0px 6px 10px 4px rgba(0,0,0,0.15);
    --md-sys-elevation-level5: 0px 4px 4px 0px rgba(0,0,0,0.30), 0px 8px 12px 6px rgba(0,0,0,0.15);

    /* Motion */
    --md-sys-motion-easing-standard: cubic-bezier(0.2, 0.0, 0, 1.0);
    --md-sys-motion-easing-emphasized: cubic-bezier(0.05, 0.7, 0.1, 1.0);
    --md-sys-motion-duration-short1: 50ms;
    --md-sys-motion-duration-short2: 100ms;
    --md-sys-motion-duration-short3: 150ms;
    --md-sys-motion-duration-short4: 200ms;
    --md-sys-motion-duration-medium1: 250ms;
    --md-sys-motion-duration-medium2: 300ms;
    --md-sys-motion-duration-medium3: 350ms;
    --md-sys-motion-duration-medium4: 400ms;
    --md-sys-motion-duration-long1: 450ms;
    --md-sys-motion-duration-long2: 500ms;
    --md-sys-motion-duration-long3: 550ms;
    --md-sys-motion-duration-long4: 600ms;

    /* Legacy Typography for compatibility */
    --md-sys-typescale-body-large-font-family: 'Roboto', sans-serif;
    --md-sys-typescale-headline-large-font-size: 32px;
    --md-sys-typescale-headline-medium-font-size: 28px;
    --md-sys-typescale-headline-small-font-size: 24px;
    --md-sys-typescale-title-large-font-size: 22px;
    --md-sys-typescale-title-medium-font-size: 20px;
    --md-sys-typescale-title-small-font-size: 18px;
    --md-sys-typescale-body-large-font-size: 16px;
    --md-sys-typescale-body-medium-font-size: 14px;
    --md-sys-typescale-body-large-font-size: 16px;
    --md-sys-typescale-body-medium-font-size: 14px;
    --md-sys-typescale-label-large-font-size: 14px;
    --md-sys-typescale-body-small-font-size: 12px;
    --md-sys-typescale-label-small-font-size: 10px;

    /* Legacy shadows for compatibility */
    --md-sys-elevation-level1: 0px 1px 2px 0px rgba(0,0,0,0.30), 0px 1px 3px 1px rgba(0,0,0,0.15);
    --md-sys-elevation-level2: 0px 1px 2px 0px rgba(0,0,0,0.30), 0px 2px 6px 2px rgba(0,0,0,0.15);
    --md-sys-elevation-level3: 0px 1px 3px 0px rgba(0,0,0,0.30), 0px 4px 8px 3px rgba(0,0,0,0.15);
    --md-sys-elevation-level4: 0px 2px 3px 0px rgba(0,0,0,0.30), 0px 6px 10px 4px rgba(0,0,0,0.15);
    --md-sys-elevation-level5: 0px 4px 4px 0px rgba(0,0,0,0.30), 0px 8px 12px 6px rgba(0,0,0,0.15);

    --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-motion-duration-short3: 150ms;
    --md-sys-motion-duration-short4: 200ms;
    --md-sys-motion-duration-medium1: 250ms;
}

@media (prefers-color-scheme: dark) {
    :root {
        /* Dark theme */
        --md-sys-color-primary: #cfbcff;
        --md-sys-color-primary-container: #4f378b;
        --md-sys-color-on-primary: #371e73;
        --md-sys-color-on-primary-container: #eaddff;

        --md-sys-color-secondary: #ccc2dc;
        --md-sys-color-secondary-container: #4a4458;
        --md-sys-color-on-secondary: #332d41;
        --md-sys-color-on-secondary-container: #e8def8;

        --md-sys-color-tertiary: #efb8c8;
        --md-sys-color-tertiary-container: #633b48;
        --md-sys-color-on-tertiary: #492532;
        --md-sys-color-on-tertiary-container: #ffd8e4;

        --md-sys-color-error: #ffb4ab;
        --md-sys-color-error-container: #93000a;
        --md-sys-color-on-error: #690005;
        --md-sys-color-on-error-container: #ffdad6;

        --md-sys-color-surface: #141218;
        --md-sys-color-surface-variant: #49454f;
        --md-sys-color-on-surface: #e6e1e5;
        --md-sys-color-on-surface-variant: #cac4d0;

        --md-sys-color-background: #141218;
        --md-sys-color-on-background: #e6e1e5;

        --md-sys-color-outline: #938f99;
        --md-sys-color-outline-variant: #49454f;

        --md-sys-color-primary-hover: #b39edf;
        --md-sys-color-primary-focus: #a085d5;
        --md-sys-color-error-hover: #ff897d;
        --md-sys-color-error-focus: #ff897d;
    }

    /* Force light colors for input elements to disable dark mode */
    input, select, textarea {
        background-color: #fffbfe !important; /* Light surface color */
        color: #1d1b20 !important; /* Dark text */
        border-color: rgba(0, 0, 0, 0.12) !important;
    }

    input:focus, select:focus, textarea:focus {
        border-color: #6750a4 !important; /* Primary color for focus */
        box-shadow: 0 0 0 2px rgba(103, 80, 164, 0.1) !important;
    }

    input:hover, select:hover, textarea:hover {
        border-color: rgba(0, 0, 0, 0.24) !important;
    }

    /* Override password toggle button colors as well */
    .password-toggle:hover {
        background-color: rgba(0, 0, 0, 0.04) !important;
    }
}

/* Base Styles */
body {
    font-family: var(--md-sys-typescale-body-large-font-family);
    font-size: var(--md-sys-typescale-body-large-font-size);
    font-weight: var(--md-sys-typescale-body-large-font-weight);
    line-height: var(--md-sys-typescale-body-large-line-height);
    letter-spacing: var(--md-sys-typescale-body-large-letter-spacing);
    background: url('img/DSC_1100.jpeg') no-repeat center center fixed;
    background-size: cover;
    color: #000000;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-lg);
}

/* Material Design App Bar */
.logo {
    max-width: 100px;
    height: auto;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #ffffff !important;
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-2);
    margin-bottom: var(--spacing-lg);
    border-radius: 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

header h1 {
    flex-grow: 1;
    text-align: center;
    font-size: var(--font-size-h6);
    font-weight: 500;
    color: var(--on-surface);
    margin: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

/* Material Design Cards */
.login-form, .dashboard {
    background-color: #ffffff !important;
    border-radius: var(--md-sys-shape-corner-large);
    background-color: var(--surface);
    padding: var(--spacing-xl);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-2);
    max-width: 400px;
    margin: var(--spacing-xxl) auto;
    transition: box-shadow var(--transition-normal), transform var(--transition-normal);
}

.dashboard-wide {

    max-width: none;
    width: 100%;
    margin: var(--spacing-lg) auto;
}

.dashboard {
  background-color: #ffffff !important;
    margin: var(--spacing-xxl) auto;
    max-width: 100% !important;
    width: 100%;
    border-radius: 20px !important;
}

/* Left align DataTable content */
#patientsTable th,
#patientsTable td {
    text-align: left;
}

.login-form:hover, .dashboard:hover {
    box-shadow: var(--shadow-4);
    transform: translateY(-2px);
}

.login-form h2, .dashboard h2 {
    text-align: center;
    margin-bottom: var(--spacing-lg);
    font-size: var(--font-size-h5);
    font-weight: 400;
    color: var(--on-surface);
}

/* Material Design Form Elements */
.form-field {
    margin-bottom: var(--spacing-lg);
}

.form-field label {
    display: block;
    font-size: var(--font-size-caption);
    font-weight: 400;
    color: var(--on-surface);
    margin-bottom: var(--spacing-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input, select, textarea {
    width: 100%;
    padding: var(--md-sys-shape-corner-small) var(--md-sys-shape-corner-medium);
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: var(--md-sys-shape-corner-extra-small);
    font-size: var(--md-sys-typescale-body-large-font-size);
    font-family: var(--md-sys-typescale-body-large-font-family);
    background-color: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface);
    transition: border-color var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard), box-shadow var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
    outline: none;
}

/* Material Design Buttons */
button, .btn {
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: var(--md-sys-typescale-label-large-font-size);
    font-weight: var(--md-sys-typescale-label-large-font-weight);
    font-family: var(--md-sys-typescale-label-large-font-family);
    text-transform: uppercase;
    letter-spacing: var(--md-sys-typescale-label-large-letter-spacing);
    padding: var(--md-sys-shape-corner-small) var(--md-sys-shape-corner-large);
    border-radius: var(--md-sys-shape-corner-extra-large);
    min-height: 36px;
    position: relative;
    overflow: hidden;
    transition: background-color var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard), box-shadow var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard), transform var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
    outline: none;
    user-select: none;
    -webkit-user-select: none;
}

button:hover, .btn:hover {
    background-color: var(--md-sys-color-primary-hover);
    box-shadow: var(--md-sys-elevation-level2);
    transform: translateY(-1px);
}
    background-color: var(--primary-variant);
    box-shadow: var(--shadow-2);
    transform: translateY(-1px);
}

button:active, .btn:active {
    transform: translateY(0);
    box-shadow: var(--md-sys-elevation-level1);
}
    transform: translateY(0);
    box-shadow: var(--shadow-1);
}

button:disabled, .btn:disabled {
    background-color: rgba(0, 0, 0, 0.12);
    color: rgba(0, 0, 0, 0.38);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
    background-color: rgba(0, 0, 0, 0.12);
    color: rgba(0, 0, 0, 0.38);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Material Design Button Variants */
.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--on-secondary);
}

.btn-secondary:hover {
    background-color: var(--secondary-variant);
}

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

.btn-outline:hover {
    background-color: var(--primary-color);
    color: var(--on-primary);
}

/* Material Design Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 400;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
}

h1 {
    font-size: var(--font-size-h4);
    font-weight: 300;
}

h2 {
    font-size: var(--font-size-h5);
    font-weight: 400;
}

h3 {
    font-size: var(--font-size-h6);
    font-weight: 500;
}

p {
    margin-bottom: var(--spacing-md);
    line-height: 1.6;
}

/* Material Design Status Messages */
.error {
    color: var(--error);
    text-align: center;
    font-size: var(--font-size-body2);
    margin-bottom: var(--spacing-md);
}

.alert {
    background-color: #ffebee;
    color: #c62828;
    padding: var(--spacing-md);
    border-radius: var(--border-radius-sm);
    margin-bottom: var(--spacing-lg);
    border-left: 4px solid var(--error);
    font-size: var(--font-size-body2);
}

.notification {
    color: var(--primary-color);
    font-weight: 500;
    font-size: var(--font-size-body2);
}

.success {
    background-color: #e8f5e8;
    color: #2e7d32;
    padding: var(--spacing-md);
    border-radius: var(--border-radius-sm);
    margin-bottom: var(--spacing-lg);
    border-left: 4px solid #4caf50;
    font-size: var(--font-size-body2);
}

.info {
    background-color: #e3f2fd;
    color: #1976d2;
    padding: var(--spacing-md);
    border-radius: var(--border-radius-sm);
    margin-bottom: var(--spacing-lg);
    border-left: 4px solid #2196f3;
    font-size: var(--font-size-body2);
}

.dashboard .btn {
    margin: var(--spacing-sm) 0;
    width: 100%;
}

.login-form button[type="submit"] {
    width: 100%;
    margin-top: var(--spacing-lg);
}

.dashboard .btn,
.dashboard button[type="submit"] {
    margin-top: var(--spacing-lg);
}

/* Material Design Responsive Layout */
@media (max-width: 768px) {
    .container {
        padding: var(--spacing-md);
    }

    header {
        flex-direction: column;
        text-align: center;
        padding: var(--spacing-md);
    }

    header h1 {
        margin: var(--spacing-sm) 0;
        font-size: var(--font-size-body1);
    }

    .user-info {
        margin-top: var(--spacing-sm);
        justify-content: center;
    }

    .login-form, .dashboard {
    background-color: #ffffff;
    border-radius: var(--md-sys-shape-corner-large);
        margin: var(--spacing-xl) auto;
        padding: var(--spacing-lg);
        max-width: none;
        width: 100%;
    }

    input, select, textarea {
    width: 100%;
    padding: var(--md-sys-shape-corner-small) var(--md-sys-shape-corner-medium);
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: var(--md-sys-shape-corner-extra-small);
    font-size: var(--md-sys-typescale-body-large-font-size);
    font-family: var(--md-sys-typescale-body-large-font-family);
    background-color: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface);
    transition: border-color var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard), box-shadow var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
    outline: none;
}
        font-size: 16px; /* Prevent zoom on iOS */
    }

    button, .btn {
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: var(--md-sys-typescale-label-large-font-size);
    font-weight: var(--md-sys-typescale-label-large-font-weight);
    font-family: var(--md-sys-typescale-label-large-font-family);
    text-transform: uppercase;
    letter-spacing: var(--md-sys-typescale-label-large-letter-spacing);
    padding: var(--md-sys-shape-corner-small) var(--md-sys-shape-corner-large);
    border-radius: var(--md-sys-shape-corner-extra-large);
    min-height: 36px;
    position: relative;
    overflow: hidden;
    transition: background-color var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard), box-shadow var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard), transform var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
    outline: none;
    user-select: none;
    -webkit-user-select: none;
}
        min-height: 44px; /* Touch target size */
        font-size: var(--font-size-body1);
    }
}

@media (max-width: 480px) {
    .logo {
        max-width: 80px;
    }

    header {
        padding: var(--spacing-sm);
    }

    .login-form, .dashboard {
    background-color: #ffffff;
    border-radius: var(--md-sys-shape-corner-large);
        margin: var(--spacing-lg) auto;
        padding: var(--spacing-md);
    }

    .container {
        padding: var(--spacing-sm);
    }

    /* Stack form elements on small screens */
    .form-field {
        margin-bottom: var(--spacing-md);
    }

    button, .btn {
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: var(--md-sys-typescale-label-large-font-size);
    font-weight: var(--md-sys-typescale-label-large-font-weight);
    font-family: var(--md-sys-typescale-label-large-font-family);
    text-transform: uppercase;
    letter-spacing: var(--md-sys-typescale-label-large-letter-spacing);
    padding: var(--md-sys-shape-corner-small) var(--md-sys-shape-corner-large);
    border-radius: var(--md-sys-shape-corner-extra-large);
    min-height: 36px;
    position: relative;
    overflow: hidden;
    transition: background-color var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard), box-shadow var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard), transform var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
    outline: none;
    user-select: none;
    -webkit-user-select: none;
}
        width: 100%;
        margin-top: var(--spacing-sm);
    }
}

/* Material Design Utility Classes */
.text-center {
    text-align: center;
}

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

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

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }
.mb-5 { margin-bottom: var(--spacing-xl); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }
.mt-5 { margin-top: var(--spacing-xl); }

.p-0 { padding: 0; }
.p-1 { padding: var(--spacing-xs); }
.p-2 { padding: var(--spacing-sm); }
.p-3 { padding: var(--spacing-md); }
.p-4 { padding: var(--spacing-lg); }
.p-5 { padding: var(--spacing-xl); }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-inline-flex { display: inline-flex; }

.flex-column { flex-direction: column; }
.flex-row { flex-direction: row; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

/* Material Design Focus Styles for Accessibility */
button:focus-visible, .btn:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Material Design Loading Animation */
@keyframes material-loading {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(98, 0, 238, 0.2);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: material-loading 1s ease-in-out infinite;
}

/* Material Design Ripple Effect */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width var(--transition-normal), height var(--transition-normal);
}

.ripple:active::before {
    width: 300px;
    height: 300px;
}

/* Password Toggle Styles */
.password-field {
    position: relative;
}

.password-field input {
    width: 100%;
    padding-right: 44px; /* Make room for the toggle button */
}

.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    background: none;
    cursor: pointer;
    padding: var(--spacing-xs);
    border-radius: 50%;
    transition: background-color var(--transition-fast);
}

.password-toggle:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

.password-toggle:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.password-icon {
    display: block;
    width: 20px;
    height: 20px;
    fill: var(--on-surface);
    opacity: 0.6;
    transition: opacity var(--transition-fast);
}

.show-icon:hover {
    opacity: 0.8;
}

.hide-icon:hover {
    opacity: 0.8;
}

.hidden {
    display: none !important;
}

/* Action Buttons */
.action-btn {
    background: none;
    border: none;
    padding: 5px 8px;
    margin: 0 2px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s, opacity 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.action-btn:hover {
    opacity: 0.8;
}

.edit-btn {
    color: #1976d2;
}

.edit-btn:hover {
    background-color: rgba(25, 118, 210, 0.1);
}

.delete-btn {
    color: #d32f2f;
}

.delete-btn:hover {
    background-color: rgba(211, 47, 47, 0.1);
}

/* Badge Styles */
.badge-success {
    background-color: #4caf50;
    color: white;
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-warning {
    background-color: #ff9800;
    color: white;
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

/* DataTable Responsive */
.table-responsive {
    overflow-x: auto;
}

#outreachesTable {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

#outreachesTable th,
#outreachesTable td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

#outreachesTable th {
    background-color: transparent;
    color: var(--md-sys-color-on-surface-variant);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

#outreachesTable tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

/* Mobile responsive table */
@media (max-width: 768px) {
    #outreachesTable th,
    #outreachesTable td {
        padding: 8px 4px;
        font-size: 14px;
    }

    .action-btn {
        padding: 8px 12px;
        min-width: 36px;
    }
}

/* Outreach Setup Toggle */
.btn-toggle {
    margin: var(--spacing-sm) 0;
    min-width: auto;
    padding: var(--spacing-sm) var(--spacing-md);
}

/* Form Field Enhancements */
.form-field {
    position: relative;
}

.form-field .error {
    color: var(--error);
    font-size: var(--font-size-caption);
    margin-top: var(--spacing-xs);
}

/* Outreach Setup Styles */
#outreach-setup {
    margin-top: var(--spacing-lg);
    padding: var(--spacing-lg);
    background-color: var(--surface);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-2);
}

#outreach-setup h3 {
    margin-bottom: var(--spacing-lg);
    font-size: var(--font-size-h6);
    font-weight: 500;
    color: var(--on-surface);
}

#outreach-setup .form-field {
    margin-bottom: var(--spacing-md);
}

#outreach-setup input,
#outreach-setup textarea {
    width: 100%;
    padding: var(--spacing-md);
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: var(--border-radius-sm);
    font-size: var(--font-size-body1);
    font-family: var(--font-family);
    background-color: var(--surface);
    color: var(--on-surface);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

#outreach-setup input:focus,
#outreach-setup textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(98, 0, 238, 0.1);
}

/* Success message */
.success {
    color: #388e3c;
    background-color: #e8f5e8;
    padding: var(--spacing-md);
    border-radius: var(--border-radius-sm);
    border-left: 4px solid #388e3c;
    margin-bottom: var(--spacing-lg);
    font-size: var(--font-size-body2);
}

/* Enhanced Notification Styles */
.notification-bell {
    position: relative;
    display: inline-block;
    margin-right: var(--spacing-md);
    cursor: pointer;
    font-size: 20px;
}

.notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #ff5722;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: var(--spacing-xs);
    animation: pulse 2s infinite;
}

.notification-badge.hidden {
    display: none;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 87, 34, 0.7);
    }
    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(255, 87, 34, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 87, 34, 0);
    }
}

.notification-panel {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    width: 320px;
    max-height: 400px;
    background-color: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-4);
    z-index: 1000;
    border: 1px solid rgba(0, 0, 0, 0.1);
    overflow: hidden;
    animation: slideDown 0.3s ease-out;
}

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

.notification-header {
    padding: var(--spacing-md) var(--spacing-lg);
    background-color: var(--primary-color);
    color: white;
    font-weight: 500;
    font-size: var(--font-size-title-small);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.notification-list {
    max-height: 320px;
    overflow-y: auto;
}

.notification-item {
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: background-color 0.2s ease;
    position: relative;
}

.notification-item:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.notification-item.unread {
    background-color: #fff9c4;
    border-left: 3px solid var(--primary-color);
}

.notification-item.unread:hover {
    background-color: #fff3c4;
}

.notification-time {
    font-size: 12px;
    color: #666;
    margin-top: var(--spacing-xs);
    font-style: italic;
}

.notification-from {
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
}

.notification-message {
    font-size: 14px;
    color: #333;
    line-height: 1.4;
}

.notification-item.unread .notification-message {
    font-weight: 500;
}

.notification-no-items {
    padding: var(--spacing-xl) var(--spacing-lg);
    text-align: center;
    color: #666;
    font-style: italic;
}

/* Alert Styles Enhancement */
.alert {
    position: relative;
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-2);
    transition: all 0.3s ease;
    animation: slideInRight 0.4s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.alert-danger {
    background-color: #fee;
    color: #d32f2f;
    border-left: 4px solid #d32f2f;
    border-right: 4px solid #d32f2f;
}

.alert-success {
    background-color: #e8f5e8;
    color: #2e7d32;
    border-left: 4px solid #2e7d32;
    border-right: 4px solid #2e7d32;
}

.alert-info {
    background-color: #e3f2fd;
    color: #1976d2;
    border-left: 4px solid #1976f3;
    border-right: 4px solid #1976f3;
}

.alert-warning {
    background-color: #fff3e0;
    color: #f57c00;
    border-left: 4px solid #f57c00;
    border-right: 4px solid #f57c00;
}

.alert-dismissible {
    padding-right: 60px;
}

.alert-dismissible .btn-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: inherit;
    padding: 4px;
    line-height: 1;
    transition: opacity 0.2s ease;
}

.alert-dismissible .btn-close:hover {
    opacity: 0.7;
}

/* Floating Notification */
.floating-alert {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    min-width: 300px;
    max-width: 400px;
    animation: slideInRight 0.4s ease-out, fadeInUp 0.4s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    border-radius: 4px;
    background-color: #666;
    color: white;
    margin-left: 8px;
}

.badge-success {
    background-color: #4caf50;
}

.badge-danger {
    background-color: #f44336;
}

.badge-warning {
    background-color: #ff9800;
}

.badge-info {
    background-color: #2196f3;
}

/* Modal Styles - Always Light Mode */
.modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease-out;
}

/* Modal text colors for accessibility */
#dynamicModal .modal-content,
#dynamicModal .modal-header,
#dynamicModal .modal-body,
#dynamicModal .modal-footer {
    color: #000; /* Black text for light backgrounds */
}

#dynamicModal .modal-header h3 {
    color: #fff; /* Keep header title white on colored background */
}

#dynamicModal .modal-message {
    color: #000; /* Ensure message text is black */
}

#dynamicModal .modal-button {
    color: white; /* Keep button text white on colored backgrounds */
}

/* Position edit outreach modal at top to avoid scrolling */
#editOutreachModal .modal-content {
    margin: 50px auto;
    position: relative;
    top: 0;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    position: relative;
    /* Force light background for edit modal */
    background-color: #ffffff !important;
    margin: 15% auto;
    padding: 0;
    border-radius: var(--md-sys-shape-corner-large);
    box-shadow: var(--md-sys-elevation-level5);
    width: 90%;
    max-width: 400px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-corner-large) var(--md-sys-shape-corner-large) 0 0;
    position: relative;
    background: linear-gradient(135deg, var(--md-sys-color-primary) 0%, var(--md-sys-color-primary-container) 100%);
}

.modal-header h3 {
    margin: 0;
    color: var(--md-sys-color-on-primary);
    font-size: var(--md-sys-typescale-title-large-font-size);
    font-weight: var(--md-sys-typescale-title-large-font-weight);
    text-align: center;
}

.close {
    position: absolute;
    right: var(--spacing-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--md-sys-color-on-primary);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    transition: opacity 0.2s ease;
}

.close:hover,
.close:focus {
    opacity: 0.7;
}

.modal-body {
    padding: var(--spacing-xl);
}

.modal-message {
    text-align: center;
    font-size: var(--md-sys-typescale-body-large-font-size);
    font-weight: var(--md-sys-typescale-body-medium-font-weight);
    color: var(--md-sys-color-on-surface);
    line-height: var(--md-sys-typescale-body-large-line-height);
    margin-bottom: var(--spacing-lg);
}

.modal-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--spacing-md);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

.modal-icon.success {
    background: linear-gradient(135deg, #4caf50, #66bb6a);
    color: white;
}

.modal-icon.error {
    background: linear-gradient(135deg, #f44336, #ef5350);
    color: white;
}

.modal-icon.info {
    background: linear-gradient(135deg, #2196f3, #42a5f5);
    color: white;
}

.modal-icon.warning {
    background: linear-gradient(135deg, #ff9800, #ffb74d);
    color: white;
}

.modal-footer {
    padding: 0 var(--spacing-xl) var(--spacing-xl);
    text-align: center;
}

.modal-button {
    padding: var(--spacing-sm) var(--spacing-lg);
    border: none;
    border-radius: var(--md-sys-shape-corner-large);
    font-size: var(--md-sys-typescale-label-large-font-size);
    font-weight: var(--md-sys-typescale-label-large-font-weight);
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
}

.modal-button.success {
    background-color: #4caf50;
    color: white;
}

.modal-button.error {
    background-color: #f44336;
    color: white;
}

.modal-button:hover,
.modal-button:focus {
    transform: translateY(-2px);
    box-shadow: var(--md-sys-elevation-level2);
}

/* Print Styles */
@media print {
    * {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    header {
        position: static;
        box-shadow: none;
        border-bottom: 1px solid #ccc;
    }

    .btn {
        border: 1px solid #ccc;
        background: transparent;
        color: black;
    }

    .login-form, .dashboard {
    background-color: #ffffff;
    border-radius: var(--md-sys-shape-corner-large);
        box-shadow: none;
        border: 1px solid #ccc;
    }

    .modal {
        display: none !important;
    }
}
