/* =============================================================================
   AUTO-GENERATED FILE - DO NOT EDIT DIRECTLY

   This file is generated by scripts/build-css.sh from modules in css/
   Edit the source files in resources/public/css/ instead.

   To rebuild: ./scripts/build-css.sh
   To watch: ./scripts/watch-css.sh
   ============================================================================= */


/* Source: 00-variables.css */
/* =============================================================================
   Layer 0: Settings - CSS Variables & Design Tokens

   All CSS custom properties for theming. Includes light mode defaults,
   dark mode overrides, and system preference detection.
   ============================================================================= */

:root {
  /* Primary colors */
  --color-primary: #1976d2;
  --color-primary-dark: #1565c0;
  --color-primary-light: #42a5f5;
  --color-primary-hover: #1565c0;

  /* Secondary/Accent */
  --color-accent: #007bff;
  --color-accent-hover: #0056b3;

  /* Backgrounds */
  --bg-body: #f5f5f5;
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f5;
  --bg-tertiary: #e0e0e0;
  --bg-navbar: #333333;
  --bg-navbar-hover: #444444;
  --bg-header: #333333;
  --bg-input: #ffffff;
  --bg-card: #ffffff;
  --bg-modal-overlay: rgba(0, 0, 0, 0.5);
  --bg-table-even: #f2f2f2;
  --bg-table-odd: #e9e9e9;
  --bg-hover: #f0f0f0;
  --bg-selected: #e3f2fd;
  --bg-danger-subtle: #fff9f9;  /* Subtle red for warning rows */
  --bg-warning-subtle: #fffdf0;  /* Subtle yellow for warning rows */
  --bg-success-subtle: #e8f5e9;  /* Subtle green for success states */

  /* Text */
  --text-primary: #333333;
  --text-secondary: #666666;
  --text-muted: #999999;
  --text-inverse: #ffffff;
  --text-link: #007bff;

  /* Borders */
  --border-color: #ddd;
  --border-light: #e0e0e0;
  --border-input: #ddd;

  /* Status colors (semantic - consistent in both modes) */
  --color-success: #4caf50;
  --color-success-bg: #c8e6c9;
  --color-warning: #ff9800;
  --color-warning-bg: #fff3e0;
  --color-warning-text: #5d4037;
  --color-danger: #f44336;
  --color-danger-bg: #ffcccb;
  --color-info: #2196f3;
  --color-info-bg: #e3f2fd;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.15);
  --shadow-button: 0 2px 5px 0 rgba(0, 0, 0, 0.24), 0 2px 10px 0 rgba(0, 0, 0, 0.19);
  --shadow-button-hover: 0 4px 8px 0 rgba(0, 0, 0, 0.24), 0 6px 20px 0 rgba(0, 0, 0, 0.19);

  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 12px;
  --spacing-lg: 16px;
  --spacing-xl: 24px;

  /* Border radius */
  --radius-sm: 4px;
  --radius-md: 5px;
  --radius-lg: 8px;
  --radius-xl: 12px;

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.4s ease;

  /* Calendar grid */
  --calendar-zebra: rgba(0, 0, 0, 0.04);
  --calendar-grid-bg: white;

  /* FSP Calendar - appointment block colors */
  --cal-block-pending-bg: #fff8e1;
  --cal-block-pending-border: #ffb300;
  --cal-block-confirmed-bg: #e3f2fd;
  --cal-block-confirmed-border: #1976d2;
  --cal-block-completed-bg: #e8f5e9;
  --cal-block-completed-border: #4caf50;
  --cal-block-cancelled-bg: #f5f5f5;
  --cal-block-cancelled-border: #9e9e9e;
  --cal-block-noshow-bg: #ffebee;
  --cal-block-noshow-border: #ef5350;

  /* FSP Calendar - status badge colors */
  --cal-badge-pending-bg: #fff3e0;
  --cal-badge-pending-text: #ef6c00;
  --cal-badge-confirmed-bg: #e3f2fd;
  --cal-badge-confirmed-text: #1976d2;
  --cal-badge-completed-bg: #e8f5e9;
  --cal-badge-completed-text: #388e3c;
  --cal-badge-cancelled-bg: #ffebee;
  --cal-badge-cancelled-text: #c62828;
  --cal-badge-noshow-bg: #fce4ec;
  --cal-badge-noshow-text: #ad1457;

  /* FSP Calendar - modality indicator colors */
  --cal-modality-inperson: #2e7d32;
  --cal-modality-telehealth: #1565c0;
}

/* Dark mode overrides */
[data-theme="dark"] {
  /* Backgrounds */
  --bg-body: #121212;
  --bg-primary: #1e1e1e;
  --bg-secondary: #2d2d2d;
  --bg-tertiary: #404040;
  --bg-navbar: #1a1a1a;
  --bg-navbar-hover: #333333;
  --bg-header: #1a1a1a;
  --bg-input: #2d2d2d;
  --bg-card: #1e1e1e;
  --bg-modal-overlay: rgba(0, 0, 0, 0.7);
  --bg-table-even: #252525;
  --bg-table-odd: #1e1e1e;
  --bg-hover: #333333;
  --bg-selected: #1e3a5f;
  --bg-danger-subtle: #3d2020;  /* Subtle red for warning rows */
  --bg-warning-subtle: #3d3520;  /* Subtle yellow for warning rows */
  --bg-success-subtle: #1b3a1f;  /* Subtle green for success states */

  /* Calendar */
  --calendar-zebra: rgba(255, 255, 255, 0.04);
  --calendar-grid-bg: #1e1e1e;

  /* Status colors (dark mode overrides) */
  --color-warning-bg: #3d3520;
  --color-warning-text: #ffffff;

  /* Text */
  --text-primary: #e0e0e0;
  --text-secondary: #b0b0b0;
  --text-muted: #808080;
  --text-inverse: #ffffff;  /* Keep white for text on dark backgrounds like navbar */
  --text-link: #64b5f6;

  /* Borders */
  --border-color: #404040;
  --border-light: #333333;
  --border-input: #555555;

  /* Shadows (darker for dark mode) */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.4);
  --shadow-button: 0 2px 5px 0 rgba(0, 0, 0, 0.4), 0 2px 10px 0 rgba(0, 0, 0, 0.3);
  --shadow-button-hover: 0 4px 8px 0 rgba(0, 0, 0, 0.4), 0 6px 20px 0 rgba(0, 0, 0, 0.3);

  /* FSP Calendar - appointment block colors (dark) */
  --cal-block-pending-bg: #3d3520;
  --cal-block-pending-border: #ffb300;
  --cal-block-confirmed-bg: #1e3a5f;
  --cal-block-confirmed-border: #42a5f5;
  --cal-block-completed-bg: #1b3a1f;
  --cal-block-completed-border: #66bb6a;
  --cal-block-cancelled-bg: #2d2d2d;
  --cal-block-cancelled-border: #757575;
  --cal-block-noshow-bg: #3d2020;
  --cal-block-noshow-border: #ef5350;

  /* FSP Calendar - status badge colors (dark) */
  --cal-badge-pending-bg: #3d3520;
  --cal-badge-pending-text: #ffb74d;
  --cal-badge-confirmed-bg: #1e3a5f;
  --cal-badge-confirmed-text: #64b5f6;
  --cal-badge-completed-bg: #1b3a1f;
  --cal-badge-completed-text: #81c784;
  --cal-badge-cancelled-bg: #3d2020;
  --cal-badge-cancelled-text: #ef9a9a;
  --cal-badge-noshow-bg: #3d2025;
  --cal-badge-noshow-text: #f48fb1;

  /* FSP Calendar - modality indicator colors (dark) */
  --cal-modality-inperson: #81c784;
  --cal-modality-telehealth: #64b5f6;

  /* Generic badge colors (dark) */
  --badge-blue-bg: #1e3a5f;
  --badge-blue-text: #64b5f6;
  --badge-green-bg: #1b3a1f;
  --badge-green-text: #81c784;
  --badge-purple-bg: #2d1f3d;
  --badge-purple-text: #ce93d8;
}

/* System preference detection (when no explicit theme set) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-body: #121212;
    --bg-primary: #1e1e1e;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #404040;
    --bg-navbar: #1a1a1a;
    --bg-navbar-hover: #333333;
    --bg-header: #1a1a1a;
    --bg-input: #2d2d2d;
    --bg-card: #1e1e1e;
    --bg-modal-overlay: rgba(0, 0, 0, 0.7);
    --bg-table-even: #252525;
    --bg-table-odd: #1e1e1e;
    --bg-hover: #333333;
    --bg-selected: #1e3a5f;
    --bg-danger-subtle: #3d2020;  /* Subtle red for warning rows */
    --bg-warning-subtle: #3d3520;  /* Subtle yellow for warning rows */
    --bg-success-subtle: #1b3a1f;  /* Subtle green for success states */
    --color-warning-bg: #3d3520;
    --color-warning-text: #ffffff;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --text-muted: #808080;
    --text-inverse: #ffffff;  /* Keep white for text on dark backgrounds like navbar */
    --text-link: #64b5f6;
    --border-color: #404040;
    --border-light: #333333;
    --border-input: #555555;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.4);
    --shadow-button: 0 2px 5px 0 rgba(0, 0, 0, 0.4), 0 2px 10px 0 rgba(0, 0, 0, 0.3);
    --shadow-button-hover: 0 4px 8px 0 rgba(0, 0, 0, 0.4), 0 6px 20px 0 rgba(0, 0, 0, 0.3);

    /* Calendar grid (dark) */
    --calendar-zebra: rgba(255, 255, 255, 0.04);
    --calendar-grid-bg: #1e1e1e;

    /* FSP Calendar - appointment block colors (dark) */
    --cal-block-pending-bg: #3d3520;
    --cal-block-pending-border: #ffb300;
    --cal-block-confirmed-bg: #1e3a5f;
    --cal-block-confirmed-border: #42a5f5;
    --cal-block-completed-bg: #1b3a1f;
    --cal-block-completed-border: #66bb6a;
    --cal-block-cancelled-bg: #2d2d2d;
    --cal-block-cancelled-border: #757575;
    --cal-block-noshow-bg: #3d2020;
    --cal-block-noshow-border: #ef5350;

    /* FSP Calendar - status badge colors (dark) */
    --cal-badge-pending-bg: #3d3520;
    --cal-badge-pending-text: #ffb74d;
    --cal-badge-confirmed-bg: #1e3a5f;
    --cal-badge-confirmed-text: #64b5f6;
    --cal-badge-completed-bg: #1b3a1f;
    --cal-badge-completed-text: #81c784;
    --cal-badge-cancelled-bg: #3d2020;
    --cal-badge-cancelled-text: #ef9a9a;
    --cal-badge-noshow-bg: #3d2025;
    --cal-badge-noshow-text: #f48fb1;

    /* FSP Calendar - modality indicator colors (dark) */
    --cal-modality-inperson: #81c784;
    --cal-modality-telehealth: #64b5f6;

    /* Generic badge colors (dark) */
    --badge-blue-bg: #1e3a5f;
    --badge-blue-text: #64b5f6;
    --badge-green-bg: #1b3a1f;
    --badge-green-text: #81c784;
    --badge-purple-bg: #2d1f3d;
    --badge-purple-text: #ce93d8;
  }
}

/* Source: 01-base.css */
/* =============================================================================
   Base element styles (body, typography, links)
   
   Source: styles.css lines 163-274
   ============================================================================= */

/* =============================================================================
   Existing styles (updated to use CSS variables)
   ============================================================================= */

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.vertical-top {
    vertical-align: top;
}

/* Default table row backgrounds - only apply to .table class tables */
.table tr:nth-child(even),
.data-table tr:nth-child(even) {
    background-color: var(--bg-table-even);
}

.table tr:nth-child(odd),
.data-table tr:nth-child(odd) {
    background-color: var(--bg-table-odd);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-body);
    margin: 0;
    padding: 20px;
    line-height: 1.6;
    color: var(--text-primary);
}

/* New styles for a modern look */
button {
    background-color: var(--color-accent);
    color: var(--text-inverse);
    border: none;
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 4px 2px;
    transition-duration: var(--transition-normal);
    cursor: pointer;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-button);
}

/* Button hover effect */
button:hover {
    background-color: var(--color-accent-hover);
    box-shadow: var(--shadow-button-hover);
}

/* Button active/focus effect */
button:active, button:focus {
    outline: none;
    background-color: var(--color-primary-dark);
    box-shadow: var(--shadow-md);
}

/* Additional styles for inputs to match buttons */
input[type="text"], input[type="email"], input[type="password"], input[type="select"] {
    padding: 10px;
    margin: 5px 0;
    border: 1px solid var(--border-input);
    border-radius: var(--radius-md);
    box-sizing: border-box;
    background-color: var(--bg-input);
    color: var(--text-primary);
}

/* Style for form submission button to match other buttons */
input[type="submit"] {
    background-color: var(--color-accent);
    color: var(--text-inverse);
    padding: 14px 20px;
    border: none;
    cursor: pointer;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-button);
}

input[type="submit"]:hover {
    background-color: var(--color-accent-hover);
}

/* Modern style for headers */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    margin-top: 0;
    font-weight: normal;
}

/* Links with a modern feel */
a {
    color: var(--text-link);
    text-decoration: none;
}

a:hover {
    text-decoration: underline; /* Underline on hover for clarity */
}


/* Source: 02-loading.css */
/* =============================================================================
   Loading states, spinners, skeleton loading
   
   Source: styles.css lines 275-374
   ============================================================================= */

/* The Modal (background) */
.modal {
    position: fixed;
    z-index: 2000; /* Above sidebar (1000) and header-bar (1002) */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2vh 0;
}

/* Modal Content */
.modal-content {
    background-color: var(--bg-card);
    margin: 0;
    margin-top: 5vh;
    padding: 20px;
    border: 1px solid var(--border-color);
    width: 80%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
    position: relative; /* Ensure it stays within modal’s stacking context */
}

/* When modal has sticky action buttons, reduce top margin. */
.modal-content.has-modal-actions {
    margin-top: 2vh;
    max-height: 85vh;
}

.modal-actions {
    padding: 15px;
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    text-align: center;
    position: sticky;
    bottom: 0;
    z-index: 1;
}

/* The Close Button */
.close {
    color: var(--text-muted);
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, .1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border-left-color: #09f;
    animation: spin 1s ease infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Table loading state */
.table-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.table-loading .spinner {
    width: 40px;
    height: 40px;
    margin-bottom: 16px;
    border-color: rgba(var(--color-primary-rgb), 0.2);
    border-left-color: var(--color-primary);
}

.table-loading-text {
    font-size: 14px;
    opacity: 0.8;
}

/* Skeleton loading for forms */
.skeleton-loading {
    background: linear-gradient(90deg,
        var(--bg-input) 25%,
        var(--bg-card) 50%,
        var(--bg-input) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: 4px;
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

h1, h2, h3 {
    padding: 2px;
}


/* Source: 10-forms-base.css */
/* =============================================================================
   Form containers, select styling
   
   Source: styles.css lines 375-493
   ============================================================================= */

.delete-button {
    background-color: #ff4d4d; /* Red color for a cautionary feel */
    color: white; /* White text for contrast */
    padding: 10px 20px; /* Padding for size */
    border: none; /* No border */
    border-radius: 5px; /* Slightly rounded corners */
    font-weight: bold; /* Bold font for emphasis */
    cursor: pointer; /* Cursor changes to pointer to indicate it's clickable */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Slight shadow for depth */
    transition: all 0.3s; /* Smooth transition for hover effects */
}

.delete-button:hover {
    background-color: #ff3333; /* Slightly darker red on hover */
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3); /* Larger shadow on hover */
}

/* Style the container */
.select-container {
    margin: 10px;
}

.toggle-details-btn {
    background-color: var(--color-accent);
    color: white;
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    margin-top: 5px;
}

.toggle-details-btn:hover {
    background-color: var(--color-accent-hover);
}

/* Style the labels */
.select-container label {
    display: block;
    margin-bottom: 0.2em;
    color: var(--text-primary);
    font-family: Arial, sans-serif;
    font-size: 14px; /* Match .input-field label */
    font-weight: 600; /* Match .input-field label */
}

/* Specific adjustments */
.select-container .filter-label {
    margin-bottom: 5px; /* Consistent spacing */
}

.select-container .select-label {
    margin-top: 10px; /* Space between filter and select */
    margin-bottom: 5px;
}

/* Input and select consistency */
.select-container input,
.select-container select {
    display: block;
    width: 100%;
    max-width: 300px; /* Match .input-field inputs */
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
    margin-bottom: 10px; /* Consistent spacing */
}

/* From create-select-input: action-details */
.action-details {
    margin-top: 10px;
}

.action-details h3 {
    font-size: 14px; /* Match label size */
    font-weight: 600; /* Match label weight */
    color: var(--text-primary);
    margin-bottom: 5px;
}

.action-details textarea {
    width: 100%;
    max-width: 300px; /* Match input/select width */
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
}

/* Specific styles for select */
.select-container select {
    /* Restore native dropdown arrow - removed appearance: none which was hiding it */
    cursor: pointer;
    padding-right: 24px; /* Space for dropdown arrow */
}

/* Hover styles */
.select-container input:hover,
.select-container select:hover {
    border-color: var(--border-color);
}

/* Style the options */
.select-container select option {
    padding: 0.5em;
}

/* General body styles */
body {
    font-family: Arial, sans-serif;
    background-color: var(--bg-body);
    margin: 0;
    padding: 0;
}


/* Source: 11-login.css */
/* =============================================================================
   Login page styles
   
   Source: styles.css lines 494-616
   ============================================================================= */

/* Specific styles for the login page */

.login-container h1 {
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: bold;
    color: var(--text-primary);
}

.login-container label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    text-align: left;
}

.login-container input[type="text"],
.login-container input[type="password"] {
    width: calc(100% - 20px);
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 16px;
}

.login-container input[type="text"]:focus,
.login-container input[type="password"]:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
    outline: none;
}

.login-container input[type="checkbox"] {
    margin-right: 10px;
}

.login-container .btn-login {
    display: inline-block;
    width: 100%;
    padding: 10px;
    background-color: var(--color-accent);
    border: none;
    border-radius: 4px;
    color: white;
    font-size: 16px;
    cursor: pointer;
    margin-bottom: 15px;
    transition: background-color 0.3s;
}

.login-container .btn-login:hover {
    background-color: var(--color-accent-hover);
}

.login-container .forgot-password {
    display: block;
    margin-top: 10px;
    font-size: 14px;
    color: var(--text-link);
    text-decoration: none;
}

.login-container .forgot-password:hover {
    text-decoration: underline;
}

.home-page-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    text-align: center;
}

.home-page-header {
    margin-bottom: 20px;
    font-size: 36px;
    font-weight: bold;
}

.home-page-subheader {
    margin-bottom: 20px;
    font-size: 24px;
}

.client-selector {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 20px;
}

.client-selector label {
    margin-bottom: 5px;
    font-weight: bold;
}

.client-selector select {
    padding: 10px;
    font-size: 16px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.btn-send-message {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--color-accent);
    border: none;
    border-radius: 4px;
    color: white;
    font-size: 16px;
    cursor: pointer;
    margin-bottom: 20px;
    transition: background-color 0.3s;
}

.btn-send-message:hover {
    background-color: var(--color-accent-hover);
}

/* Login divider ("or" separator) */
.login-divider {
    display: flex;
    align-items: center;
    margin: 16px 0;
}

.login-divider-line {
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.login-divider-text {
    padding: 0 12px;
    color: var(--text-muted);
    font-size: 14px;
}

/* Passkey login button */
.login-container .btn-passkey {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 20px;
    background-color: var(--color-accent-secondary, #6366f1);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.login-container .btn-passkey:hover {
    background-color: var(--color-accent-secondary-hover, #4f46e5);
}


/* Source: 12-navbar.css */
/* =============================================================================
   Navbar and sidebar navigation
   
   Source: styles.css lines 617-1230
   ============================================================================= */

.navbar {
    width: 225px;
    min-height: 100vh;
    background-color: var(--bg-navbar);
    color: var(--text-inverse);
    padding: 10px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.dashboard-page {
    display: flex;
    flex-grow: 1;
    gap: 10px;
}

/* Main content */
.main-content {
    flex: 1 1 auto;
    padding: 20px;
    box-sizing: border-box;
}

/* Navbar list items */
.navbar ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.navbar li {
    padding: 0;
    margin-bottom: 5px;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
}

.navbar li:hover {
    background-color: var(--bg-navbar-hover);
}

.navbar li.active {
    background-color: var(--bg-tertiary);
    font-weight: bold;
    color: var(--text-inverse);
}

/* Style h3 within any .navbar (shared with sidebar) */
.navbar h3 {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-muted);
    padding: 10px 15px;
    margin: 0;
    text-transform: uppercase;
    transition: color var(--transition-fast);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.navbar h3:hover {
    color: var(--text-inverse);
}

/* Navbar as a Sidebar */
.navbar.sidebar {
    width: 195px;
    height: calc(100vh - 100px);
    min-height: 0; /* Override .navbar min-height: 100vh */
    top: 100px;
    position: fixed;
    left: 0;
    overflow-y: auto;
    scrollbar-gutter: stable; /* Reserve space for scrollbar to prevent layout shift */
    transition: width 0.3s ease;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

/* Collapsed state - only applies on mobile */
.navbar.sidebar.collapsed {
    width: 60px; /* Narrow width when collapsed */
}

/* Desktop: enable hover-based collapse/expand with OVERLAY */
@media (min-width: 769px) {
    /* Base: sidebar is collapsed, content has fixed margin for icons */
    .navbar.sidebar.collapsed {
        width: 60px; /* Narrow when collapsed */
        overflow: hidden; /* Hide overflowing text */
    }

    /* Content always has 60px margin for collapsed icons (overlay mode) */
    .page-container {
        margin-left: 60px !important;
        padding-left: 10px; /* Tighter gap when sidebar collapsed */
    }

    /* When pinned, content shifts to make room */
    body.sidebar-pinned .page-container {
        margin-left: 190px !important;
        padding-left: 20px; /* Normal padding when pinned */
    }

    /* Hide text labels when collapsed, keep icons visible */
    .navbar.sidebar.collapsed li.navbar-item span,
    .navbar.sidebar.collapsed .category-name,
    .navbar.sidebar.collapsed .navbar-help span {
        opacity: 0;
        width: 0;
        overflow: hidden;
        white-space: nowrap;
    }

    /* Category header styling */
    .navbar.sidebar .category-header {
        display: flex;
        align-items: center;
        gap: 10px;
        height: 36px; /* Fixed height for consistent collapsed/expanded */
        box-sizing: border-box;
    }

    .navbar.sidebar .category-icon {
        font-size: 16px;
        width: 20px;
        text-align: center;
        flex-shrink: 0;
    }

    /* Center icons when collapsed */
    .navbar.sidebar.collapsed li.navbar-item {
        justify-content: center;
        padding: 12px 0;
    }

    .navbar.sidebar.collapsed .category {
        padding: 0;
    }

    .navbar.sidebar.collapsed .category-header {
        justify-content: center;
        text-align: center;
        padding: 10px 0 !important; /* Override base h3 padding */
        width: 100%;
        gap: 0; /* Remove gap when collapsed */
    }

    .navbar.sidebar.collapsed .category-icon {
        margin: 0; /* Reset margin */
        width: auto; /* Remove fixed width so it centers naturally */
    }

    .navbar.sidebar.collapsed .category-name {
        display: none; /* Fully hide the text element */
    }

    /* Hide the ul (nav items) when collapsed - only show category icons */
    .navbar.sidebar.collapsed .category ul {
        display: none;
    }

    /* Expanded sidebar (hovered, not pinned) overlays content */
    .navbar.sidebar:not(.collapsed):not(.pinned) {
        box-shadow: 4px 0 15px rgba(0, 0, 0, 0.3);
        z-index: 1001; /* Above content */
    }

    /* Smooth transitions */
    .navbar.sidebar li.navbar-item span,
    .navbar.sidebar .category h3,
    .navbar.sidebar .navbar-help span {
        transition: opacity 0.2s ease, width 0.2s ease;
    }

    /* Toggle button - show pin icon, hide hamburger on desktop */
    .navbar-toggle {
        display: block;
        background: transparent;
        border: none;
        color: var(--text-muted);
        padding: 12px;
        cursor: pointer;
        transition: color 0.2s ease;
        width: auto;
        text-align: left;
    }

    .navbar-toggle:hover {
        color: var(--text-inverse);
        background: transparent;
    }

    .navbar-toggle .pin-icon {
        display: inline-block;
        transition: transform 0.2s ease, opacity 0.2s ease;
    }

    .navbar-toggle .pin-icon.unpinned {
        transform: rotate(45deg);
        opacity: 0.5;
    }

    .navbar.sidebar.pinned .navbar-toggle .pin-icon {
        color: var(--color-accent);
        opacity: 1;
        transform: rotate(0deg);
    }

    .navbar-toggle .mobile-toggle-icon {
        display: none; /* Hide hamburger on desktop */
    }

    /* Tooltips when collapsed - using native title attribute */
    .navbar.sidebar.collapsed li.navbar-item {
        position: relative;
    }
}

/* Mobile: hide pin icon, show hamburger */
@media (max-width: 768px) {
    .navbar-toggle .pin-icon {
        display: none;
    }

    .navbar-toggle .mobile-toggle-icon {
        display: inline-block;
    }
}

/* Category container */
.navbar .category {
    margin-bottom: 20px; /* Space between categories */
}

.navbar.sidebar .category h3 {
    cursor: pointer; /* Only sidebar h3 is clickable */
}

/* Category header */
.navbar .category h3 {
    font-size: 16px; /* Slightly smaller for hierarchy */
    font-weight: 500;
    color: var(--text-muted); /* Lighter gray for contrast */
    padding: 10px 15px; /* Comfortable padding */
    margin: 0;
    text-transform: uppercase; /* Distinguish categories */
    cursor: pointer; /* Indicate collapsibility */
    transition: color 0.3s ease;
}

/* Category header hover */
.navbar .category h3:hover {
    color: var(--text-inverse); /* Brighten on hover */
}

/* Hide category list when collapsed */
.navbar .category.collapsed ul {
    display: none; /* Hide items when category is collapsed */
}

/* Navbar list */
.navbar ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

/* Navbar items */
.navbar li.navbar-item {
    display: flex; /* Flex for icon + text alignment */
    align-items: center;
    padding: 12px 15px; /* More padding for comfort */
    margin-bottom: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease, padding-left 0.3s ease;
}

/* Icon styling */
.navbar li.navbar-item i.fa {
    font-size: 18px; /* Consistent icon size */
    margin-right: 10px; /* Space between icon and text */
    width: 20px; /* Fixed width for alignment */
    text-align: center; /* Center icon */
}

/* Text label */
.navbar li.navbar-item span {
    font-size: 14px; /* Readable size */
    white-space: nowrap; /* Prevent wrapping */
}

/* Hover effect */
.navbar li.navbar-item:hover {
    background-color: var(--bg-navbar-hover); /* Slightly lighter gray */
}

/* Active state */
.navbar li.navbar-item.active {
    background-color: var(--color-accent); /* Blue for active item */
    color: var(--text-inverse);
    font-weight: 500;
}

/* Hide text when sidebar is collapsed */
.navbar.sidebar.collapsed li.navbar-item span {
    display: none; /* Hide text labels */
}

/* Adjust padding when collapsed */
.navbar.sidebar.collapsed li.navbar-item {
    padding-left: 20px; /* Center icon when collapsed */
}

/* Toggle button (for collapsing sidebar) */
.navbar-toggle {
    display: none; /* Hidden by default on desktop */
    background-color: var(--color-accent);
    color: white;
    border: none;
    padding: 10px;
    font-size: 18px;
    cursor: pointer;
    width: 100%;
    text-align: center;
    border-radius: 4px;
}

/* Main content container */
.page-container {
    margin-left: 190px; /* Default offset for sidebar (mobile/fallback) */
    padding: 20px; /* Internal spacing */
    transition: margin-left 0.3s ease; /* Smooth shift */
    min-height: calc(100vh - 100px); /* Match sidebar height */
    box-sizing: border-box;
    flex: 1 1 auto; /* Allow it to grow/shrink within flex container */
    min-width: 0; /* Allow shrinking below content size (prevents kanban overflow) */
}

/* Desktop: margin controlled by media query for overlay behavior */
/* See @media (min-width: 769px) section for desktop rules */

/* Sidebar-specific list items */
.navbar.sidebar li.navbar-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    margin-bottom: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease, padding-left 0.3s ease;
}

.navbar.sidebar li.navbar-item i.fa {
    font-size: 18px;
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.navbar.sidebar li.navbar-item span {
    font-size: 14px;
    white-space: nowrap;
}

.navbar.sidebar li.navbar-item:hover {
    background-color: var(--bg-navbar-hover);
}

.navbar.sidebar li.navbar-item.active {
    background-color: var(--color-accent);
    color: var(--text-inverse);
    font-weight: 500;
}

.navbar.sidebar.collapsed li.navbar-item span {
    display: none;
}

.navbar.sidebar.collapsed li.navbar-item {
    padding-left: 20px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .navbar.sidebar {
        width: 225px; /* Slightly narrower on mobile */
        height: calc(100vh - 100px); /* Consistent with desktop */
        top: 70px;
    }

    .navbar.sidebar.collapsed {
        width: 0; /* Fully collapse on mobile */
        padding: 0; /* Remove padding */
    }

    .page-container {
        margin-left: 190px;
    }

    .navbar.sidebar.collapsed + .page-container {
        margin-left: 0;
    }

    .navbar-toggle {
        display: block; /* Show toggle button on mobile */
    }

    .navbar.sidebar.collapsed + .page-container {
        margin-left: 0; /* No offset when collapsed */
    }

    .navbar .category h3 {
        font-size: 14px; /* Smaller headers */
    }

    .navbar li.navbar-item {
        padding: 10px 12px; /* Slightly smaller padding */
    }
}

.client-selector-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 20px;
    font-family: Arial, sans-serif;
}

.client-selector-label {
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 14px;
    color: var(--text-primary);
}

.client-selector-select {
    padding: 10px;
    font-size: 16px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    width: 100%;
    max-width: 300px;
}

.client-selector-select:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
    outline: none;
}

.conversations-table-container {
    width: 100%;
    margin: 20px 0;
    font-family: Arial, sans-serif;
}

.filter-container {
    display: flex;
    flex-direction: column;  /* Stack vertically: filter row, then full-width timeline */
    align-items: flex-start;  /* Left-align filter row */
    gap: 8px;  /* Tight vertical space between filter and timeline */
    width: 100%;  /* Full parent width */
    justify-content: flex-start;  /* Override center for left alignment */
}

.filter-container:has(button) {  /* Targets button containers only */
    flex-direction: row;  /* Horizontal for toggles */
    align-items: center;
    gap: 8px;  /* Space between buttons */
}

.filter-container:has(label) {  /* Stacks filter row above timeline */
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.filter-container > span:first-child {
    margin-right: 4px;  /* Gap after "Filter:" */
}

.filter-container label {
    display: inline-flex;
    align-items: center;
    gap: 4px;  /* Tight checkbox-to-label gap */
    cursor: pointer;
    font-weight: 600;  /* Bolder for "criteria" emphasis */
    color: var(--text-link);  /* Blue like buttons for obvious interactivity */
}

.filter-container span {
    margin-left: 10px;
    font-size: 16px;
    font-weight: bold;
}

.filter-input {
    padding: 5px;
    font-size: 16px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    width: 200px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.table tr {
    vertical-align: top;
    transition: background-color 0.15s ease;
}


.table th,
.table td {
    padding: 10px;
    text-align: left;
    border: 1px solid var(--border-color);
}

.table th {
    background-color: var(--bg-tertiary);
    font-weight: bold;
    font-size: 16px;
    color: var(--text-primary);
}

.table thead tr th:first-child,
.table tbody tr td:first-child {
    border-left: 3px solid transparent;
}

.table tbody tr:hover {
    background-color: var(--bg-hover);
    cursor: pointer;
}

.table tbody tr:hover td:first-child {
    border-left-color: var(--color-primary);
}

.button {
    padding: 8px 16px;
    background-color: var(--color-accent);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.button:hover {
    background-color: var(--color-accent-hover);
}

.icon {
    font-size: 16px;
    color: green;
}

.customer-filter-container {
    font-family: Arial, sans-serif;
    margin: 20px 0;
}

.customer-filter-text {
    display: block;
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: bold;
}

.customer-filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.customer-filter-button {
    padding: 10px 15px;
    background-color: var(--color-accent);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 14px;
}

.customer-filter-button:hover {
    background-color: var(--color-accent-hover);
}


/* Logo inside the header */
.header-logo {
    height: 50px;
}

/* Header Area for Selector */
.header-area {
    padding: 4px 10px;
    background-color: var(--bg-secondary);
    z-index: 1001;
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

/* Compact selector in header — inline label + dropdown */
.header-area .select-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.header-area .select-container label {
    display: inline;
    margin-bottom: 0;
    font-size: 0.8em;
    white-space: nowrap;
}

.header-area .select-container select {
    display: inline;
    width: auto;
    max-width: none;
    padding: 4px 24px 4px 8px;
    font-size: 0.85em;
}

/* Global search bar in header */
.global-search-wrapper {
    position: relative;
    flex: 0 1 280px;
    min-width: 180px;
}

.global-search-input-container {
    display: flex;
    align-items: center;
    background: var(--bg-input, var(--bg-secondary));
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0 8px;
    height: 32px;
}

.global-search-icon {
    color: var(--text-muted, var(--text-secondary));
    font-size: 12px;
    margin-right: 6px;
    flex-shrink: 0;
}

.global-search-input {
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 13px;
    width: 100%;
    outline: none;
    padding: 4px 0;
}

.global-search-input::placeholder {
    color: var(--text-muted, var(--text-secondary));
}

.global-search-clear {
    border: none;
    background: none;
    color: var(--text-muted, var(--text-secondary));
    cursor: pointer;
    font-size: 16px;
    padding: 0 2px;
    line-height: 1;
    flex-shrink: 0;
}

.global-search-clear:hover {
    color: var(--text-primary);
}

.global-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    min-width: 320px;
    max-height: 320px;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1100;
}

.global-search-result-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-light, var(--border-color));
}

.global-search-result-item:last-child {
    border-bottom: none;
}

.global-search-result-item:hover,
.global-search-result-item.selected {
    background: var(--bg-hover, var(--bg-secondary));
}

.global-search-result-customer {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.global-search-result-match {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Hide global search on mobile (mobile has its own selector with search) */
@media (max-width: 768px) {
    .global-search-wrapper {
        display: none;
    }
}

.content-container {
    margin-top: 60px; /* Adjust this value based on the height of your header bar */
    padding: 20px;
}

/* Wrapper row: icon + text */
.navbar li.navbar-item .navbar-item-row {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 12px 15px;
    box-sizing: border-box;
}

/* Action Group SPA tile hover */
.action-group-tile:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}


/* Source: 12a-navbar-loading.css */
/* =============================================================================
   Navbar loading state
   
   Source: styles.css lines 6777-6795
   ============================================================================= */

/* =============================================================================
   Navbar Loading State
   ============================================================================= */

.navbar.sidebar.loading {
    opacity: 0.6;
    pointer-events: none;
}

.navbar.sidebar.loading li.navbar-item {
    cursor: not-allowed;
}

.navbar li.navbar-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}


/* Source: 12b-navigation-extended.css */
/* =============================================================================
   Extended navigation, sidebar tooltips
   
   Source: styles.css lines 2732-2970
   ============================================================================= */


/* 1) Allow label text to wrap but clamp at 2 lines */
.navbar.sidebar li.navbar-item span {
    white-space: normal; /* allow wrapping */
    display: -webkit-box; /* for line-clamp */
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2; /* max 2 lines */
    overflow: hidden; /* hide overflow */
    line-height: 1.2em; /* tweak to taste */
    max-height: 2.4em; /* 2 × line-height */
}

/* 2) Still show ellipsis if it truly overflows */
.navbar.sidebar li.navbar-item span {
    text-overflow: ellipsis;
}

/* 3) Tooltip on hover so you can always read the full label */
.navbar.sidebar li.navbar-item span {
    cursor: pointer; /* hint you can hover */
}

.navbar.sidebar li.navbar-item[title] span:hover::after {
    content: attr(title);
    position: absolute;
    white-space: nowrap;
    background: var(--bg-navbar);
    color: var(--text-inverse);
    padding: 4px 8px;
    border-radius: 4px;
    top: 100%;
    left: 0;
    transform: translateY(4px);
    z-index: 2000;
}

/* 4) (Optional) Slightly smaller text + tighter padding buys extra room */
.navbar.sidebar li.navbar-item span {
    font-size: 13px;
}

.navbar.sidebar li.navbar-item {
    padding: 10px 12px;
}

/* Target only the inner dashboard‐page navbar H3s */
.dashboard-page .navbar li h3 {
    white-space: normal; /* allow wrapping */
    display: -webkit-box; /* for -webkit-line-clamp below */
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2; /* max two lines */
    overflow: hidden; /* hide anything beyond line 2 */
    line-height: 1.2em;
    max-height: 2.4em; /* 2 × line-height */
    text-transform: none; /* optional—uppercase eats more width */
    padding: 8px 12px; /* tighten up */
    font-size: 14px; /* a smidge smaller for breathing room */
}

.dashboard-page .navbar li h3 {
    text-overflow: ellipsis;
}

.dashboard-page .navbar li h3:hover::after {
    content: attr(title);
    position: absolute;
    background: var(--bg-navbar);
    color: var(--text-inverse);
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 2000;
    top: 100%;
    left: 0;
    transform: translateY(4px);
}

.hero {
    position: relative; /* so pseudo‑overlay can be absolute */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 120px 20px;
    text-align: center;
    color: var(--text-inverse);
    background: linear-gradient(135deg, #0d47a1 0%, #1976d2 50%, #42a5f5 100%);
}

/* subtle dark overlay for readability */

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    z-index: 0; /* behind content */
}

.hero * {
    position: relative;
    z-index: 1;
}

/* lift content above overlay */
/* white text + shadow for crisp contrast */

.hero h1, .hero h2, .hero .lead {
    color: var(--text-inverse);
    text-shadow: 0 2px 4px rgba(0, 0, 0, .6);
}

.hero .cta-primary {
    margin-top: 32px;
}

.cta-primary {
    background: #ff7043;
    color: var(--text-inverse);
    padding: 14px 28px;
    border-radius: 6px;
    font-size: 18px;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(0, 0, 0, .15);
    transition: background .25s;
}

.cta-primary:hover {
    background: #e64a19;
}

.feature-grid {
    display: grid;
    grid-template-columns:repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.feature-card {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
    text-align: center;
}

.feature-icon {
    font-size: 48px;
    margin-bottom: 18px;
    color: var(--color-primary);
}

.section-title {
    text-align: center;
    margin-top: 80px;
    font-size: 32px;
}

.testimonials {
    background: var(--bg-secondary);
    padding: 60px 20px;
    text-align: center;
}

.quote {
    font-size: 20px;
    font-style: italic;
    margin-bottom: 10px;
}

.person {
    font-weight: 600;
    color: var(--text-secondary);
}

.cta-final {
    text-align: center;
    padding: 80px 20px;
}

.hero {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px 60px; /* reduced top & bottom to surface features sooner */
    text-align: center;
    color: var(--text-inverse);
    background: linear-gradient(135deg, #0d47a1 0%, #1976d2 50%, #42a5f5 100%);
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .25);
    z-index: 0;
}

.hero * {
    position: relative;
    z-index: 1;
}

.hero h1, .hero h2, .hero .lead {
    text-shadow: 0 2px 4px rgba(0, 0, 0, .6);
}

/* Shrink gap between hero & features */
.features {
    margin-top: 40px;
}

/* Hero CTAs - dual button layout */
.hero-ctas {
    display: flex;
    gap: 16px;
    margin-top: 32px;
    flex-wrap: wrap;
    justify-content: center;
}

.cta-secondary {
    background: transparent;
    color: var(--text-inverse);
    padding: 14px 28px;
    border-radius: 6px;
    font-size: 18px;
    font-weight: 600;
    border: 2px solid var(--text-inverse);
    transition: background .25s, color .25s;
}

.cta-secondary:hover {
    background: var(--text-inverse);
    color: var(--color-primary);
}


/* Source: 13-login-extended.css */
/* =============================================================================
   Login container extended styles
   
   Source: styles.css lines 1231-1330
   ============================================================================= */

/* Login page styles */
.login-page-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100%;
    background-color: var(--bg-hover);
    padding-top: 60px; /* Adjust for the height of the header */
}

.login-container {
    background-color: var(--bg-card);
    padding: 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    text-align: center;
    width: 300px;
}

.login-logo {
    height: 200px;
}

.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: var(--bg-header);
    color: var(--text-inverse);
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    box-shadow: var(--shadow-md);
    z-index: 1002;
}

.header-logo {
    height: 50px;
}

.header-nav {
    display: flex;
    gap: 15px;
    padding-right: 25px;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    text-transform: uppercase;
    padding: 5px 10px;
    transition: color var(--transition-fast), background-color var(--transition-fast);
}

.nav-link:hover {
    color: var(--text-inverse);
    background-color: var(--bg-navbar-hover);
    text-decoration: none;
}

/* Hamburger menu button - hidden on desktop */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 10px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1003;
}

.hamburger-line {
    display: block;
    width: 24px;
    height: 3px;
    background-color: var(--text-inverse);
    border-radius: 2px;
    transition: transform var(--transition-fast), opacity var(--transition-fast);
    pointer-events: none; /* Ensure clicks pass through to parent button (Safari fix) */
}

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

/* Adjust login content to avoid overlap */
.login-page-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100%;
    background-color: var(--bg-secondary);
    padding-top: 70px;
}



/* Source: 14-responsive-layout.css */
/* =============================================================================
   Responsive layout and mobile menu
   
   Source: styles.css lines 1331-1588
   ============================================================================= */

/* Responsive adjustments - Mobile hamburger menu */
@media (max-width: 768px) {
    .hamburger-btn {
        display: flex;
    }

    .header-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background-color: var(--bg-header);
        padding: 10px 0;
        box-shadow: var(--shadow-md);
    }

    .header-nav.open {
        display: flex;
    }

    .header-nav .nav-link {
        padding: 12px 20px;
        width: 100%;
        text-align: left;
        border-bottom: 1px solid var(--border-color);
    }

    .header-nav .nav-link:last-child {
        border-bottom: none;
    }
}

.cta-button {
    background-color: var(--color-accent);
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    font-size: 16px;
}

.cta-button:hover {
    background-color: var(--color-accent-hover);
}

.content-container {
    padding: 20px;
}

.service-item {
    margin-bottom: 20px;
}

.testimonials-section {
    margin-top: 40px;
}


.content-container {
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-panel {
    background-color: var(--bg-card); /* White background for clarity */
    padding: 20px; /* Comfortable padding */
    border-radius: 8px; /* Rounded corners */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Subtle shadow */
    max-width: 600px; /* Cap width for readability */
    margin: 20px auto; /* Center horizontally with spacing */
}


label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

input, select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 16px;
}

textarea {
    width: 100%; /* Full width of its container */
    height: 100px; /* Fixed height for multiple lines */
    resize: vertical; /* Allow vertical resizing */
    padding: 8px; /* Inner spacing for comfort */
    border: 1px solid var(--border-color); /* Simple border */
    border-radius: 4px; /* Rounded corners */
    font-size: 16px; /* Readable text size */
    box-sizing: border-box; /* Include padding/border in size */
}

input[type="text"], input[type="email"], input[type="tel"], select, textarea {
    margin-top: 5px;
}

button {
    background-color: var(--color-accent);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

button:hover {
    background-color: var(--color-accent-hover);
}

.call-to-action {
    margin-top: 30px;
    text-align: center;
}

.call-to-action p {
    font-size: 18px;
}


.checkbox-wrapper-4 * {
    box-sizing: border-box;
}

.checkbox-wrapper-4 .cbx {
    -webkit-user-select: none;
    user-select: none;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.2s ease;
    display: inline-block;
}

.checkbox-wrapper-4 .cbx:not(:last-child) {
    margin-right: 6px;
}

.checkbox-wrapper-4 .cbx:hover {
    background: rgba(0, 119, 255, 0.06);
}

.checkbox-wrapper-4 .cbx span {
    float: left;
    vertical-align: middle;
    transform: translate3d(0, 0, 0);
}

.checkbox-wrapper-4 .cbx span:first-child {
    position: relative;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    transform: scale(1);
    border: 1px solid #cccfdb;
    transition: all 0.2s ease;
    box-shadow: 0 1px 1px rgba(0, 16, 75, 0.05);
}

.checkbox-wrapper-4 .cbx span:first-child svg {
    position: absolute;
    top: 3px;
    left: 2px;
    fill: none;
    stroke: #fff;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 16px;
    stroke-dashoffset: 16px;
    transition: all 0.3s ease;
    transition-delay: 0.1s;
    transform: translate3d(0, 0, 0);
}

.checkbox-wrapper-4 .cbx span:last-child {
    padding-left: 8px;
    line-height: 18px;
}

.checkbox-wrapper-4 .cbx:hover span:first-child {
    border-color: #07f;
}

.checkbox-wrapper-4 .inp-cbx {
    position: absolute;
    visibility: hidden;
}

.checkbox-wrapper-4 .inp-cbx:checked + .cbx span:first-child {
    background: #07f;
    border-color: #07f;
    animation: wave-4 0.4s ease;
}

.checkbox-wrapper-4 .inp-cbx:checked + .cbx span:first-child svg {
    stroke-dashoffset: 0;
}

.checkbox-wrapper-4 .inline-svg {
    position: absolute;
    width: 0;
    height: 0;
    pointer-events: none;
    user-select: none;
}

@media screen and (max-width: 640px) {
    .checkbox-wrapper-4 .cbx {
        width: 100%;
        display: inline-block;
    }
}

@-moz-keyframes wave-4 {
    50% {
        transform: scale(0.9);
    }
}

@-webkit-keyframes wave-4 {
    50% {
        transform: scale(0.9);
    }
}

@-o-keyframes wave-4 {
    50% {
        transform: scale(0.9);
    }
}

@keyframes wave-4 {
    50% {
        transform: scale(0.9);
    }
}

.error-message {
    color: red;
    font-size: 14px;
    margin-top: 5px;
}


/* Source: 15-calendar.css */
/* =============================================================================
   Calendar and timeline navigation
   
   Source: styles.css lines 1589-1764
   ============================================================================= */

/* Override styles for navigation buttons within the mini calendar */
.mini-calendar .calendar-nav button {
    padding: 5px 10px; /* Reduced padding for a more compact button */
    font-size: 14px; /* Smaller font size to match header text */
    margin: 0 5px; /* Tighter spacing between elements */
    border-radius: 3px; /* Slightly less rounded corners */
    box-shadow: none; /* Remove the shadow for a flatter look */
}

.mini-calendar .calendar-nav .header-text {
    font-size: 16px;
    font-weight: bold;
    margin: 0 10px;
}

/* List Tile Container */
.list-tile {
    background-color: var(--bg-card); /* Clean white background */
    border: 1px solid var(--border-color); /* Subtle light gray border */
    border-radius: 8px; /* Rounded corners for a modern touch */
    padding: 20px; /* Comfortable internal padding */
    margin-bottom: 20px; /* Space between tiles */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Soft shadow for depth */
}

/* Header Styling */
.list-tile h3 {
    font-size: 20px; /* Slightly larger for prominence */
    font-weight: 600; /* Semi-bold for emphasis */
    color: var(--text-primary); /* Dark gray for strong contrast */
    margin: 0 0 15px 0; /* Space below header */
    font-family: Arial, sans-serif; /* Matches your body font */
}

/* Field Container */
.field {
    display: flex; /* Flexbox for side-by-side alignment */
    justify-content: space-between; /* Even spacing between name and value */
    align-items: center; /* Vertical centering */
    padding: 10px 0; /* Vertical padding for separation */
    border-bottom: 1px solid var(--border-light); /* Light border for field separation */
}

/* Field Name */
.field-name {
    font-weight: 500; /* Medium weight to stand out */
    color: var(--text-secondary); /* Medium gray for distinction */
    flex: 1; /* Takes available space */
    font-family: Arial, sans-serif; /* Consistent typography */
}

/* Field Value */
.field-value {
    font-weight: 400; /* Regular weight for readability */
    color: var(--text-primary); /* Dark gray for clarity */
    flex: 2; /* Larger proportion for value */
    text-align: right; /* Right-aligned for a clean look */
    font-family: Arial, sans-serif; /* Consistent typography */
}

/* Specific Styling for Title Type */
.field-value h4 {
    margin: 0; /* Remove default margin */
    font-size: 18px; /* Slightly larger for titles */
    font-weight: 600; /* Bold for emphasis */
    color: var(--text-primary); /* Matches header color */
}

/* Specific Styling for Boolean Type */
.field-value {
    /* No extra styling needed beyond base, but "Yes"/"No" handled by your code */
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .field {
        flex-direction: column; /* Stack vertically on small screens */
        align-items: flex-start; /* Align left for readability */
    }

    .field-value {
        text-align: left; /* Left-align text on small screens */
        margin-top: 5px; /* Small spacing above value */
    }
}

/* Timeline Tile Container */
.timeline-tile {
    background-color: var(--bg-card); /* Clean white background */
    border: 1px solid var(--border-color); /* Subtle light gray border */
    border-radius: 8px; /* Rounded corners for a modern feel */
    padding: 20px; /* Comfortable padding inside */
    margin-bottom: 20px; /* Space between tiles */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Subtle shadow for depth */
}

/* Header Styling */
.timeline-tile h3 {
    font-size: 20px; /* Larger size for emphasis */
    font-weight: 600; /* Semi-bold for prominence */
    color: var(--text-primary); /* Dark gray for readability */
    margin: 0 0 15px 0; /* Space below the header */
}

/* Timeline Entry Styling */
.timeline-entry {
    border-bottom: 1px solid var(--border-light); /* Light border to separate entries */
    padding: 10px 0; /* Vertical padding for spacing */
}

/* Remove border from the last entry */
.timeline-entry:last-child {
    border-bottom: none; /* No border on the final entry */
}

/* Paragraphs inside entries (e.g., Date, Type, Description) */
.timeline-entry p {
    margin: 8px 0; /* Spacing between fields */
    font-size: 16px; /* Readable text size */
    color: var(--text-primary); /* Dark gray for clarity */
    overflow-wrap: break-word; /* Wraps long text to prevent overflow */
}

/* Labels inside paragraphs (e.g., "Date:", "Type:") */
.timeline-entry p strong {
    font-weight: 600; /* Bold labels for distinction */
    color: var(--text-secondary); /* Medium gray to contrast with values */
}

/* Follow Up Button Styling */
.timeline-entry button {
    background-color: var(--color-accent); /* Primary blue to match common button styles */
    color: white; /* White text for contrast */
    padding: 5px 10px; /* Compact padding */
    border: none; /* No border for a clean look */
    border-radius: 4px; /* Slightly rounded corners */
    cursor: pointer; /* Hand cursor for interactivity */
    transition: background-color 0.3s ease; /* Smooth hover transition */
    margin-top: 10px; /* Space above the button */
}

/* Button hover effect */
.timeline-entry button:hover {
    background-color: var(--color-accent-hover); /* Darker blue on hover */
}

/* "No interactions found" message */
.timeline-tile > p {
    font-size: 16px; /* Consistent font size */
    color: var(--text-secondary); /* Muted gray for less emphasis */
    text-align: center; /* Centered for visibility */
    margin: 20px 0; /* Spacing around the message */
    font-style: italic; /* Italicized to stand out */
}

.timeline-markers {
    width: 100%;
    height: 100%;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .timeline-tile {
        padding: 15px; /* Reduced padding on smaller screens */
    }

    .timeline-entry p {
        font-size: 14px; /* Smaller text for better fit */
    }

    .timeline-entry button {
        padding: 4px 8px; /* Smaller button padding */
        font-size: 14px; /* Smaller button text */
    }
}


/* Source: 16-mobile-cards.css */
/* =============================================================================
   Mobile card view for tables
   
   Source: styles.css lines 3324-3406
   ============================================================================= */

/* =============================================================================
   Mobile Card View for Tables
   ============================================================================= */

/* Card view hidden on desktop by default */
.mobile-cards-wrapper {
    display: none;
}

/* Card container */
.mobile-cards-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 8px 0;
}

/* Individual card */
.mobile-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px;
    cursor: pointer;
    transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}

.mobile-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.mobile-card:active {
    transform: translateY(0);
}

/* Card header with title and arrow */
.mobile-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

.mobile-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.mobile-card-arrow {
    color: var(--text-muted);
    font-size: 14px;
}

/* Card body with field rows */
.mobile-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-card-field {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 14px;
}

.mobile-card-label {
    color: var(--text-secondary);
    flex-shrink: 0;
    margin-right: 12px;
}

.mobile-card-value {
    color: var(--text-primary);
    text-align: right;
    word-break: break-word;
}


/* Source: 16b-card-layout.css */
/* =============================================================================
   Card Layout View for Tables

   Responsive card grid that replaces table rows for information-dense display.
   Activated via :card-layout config in page definitions.
   ============================================================================= */

/* =============================================================================
   Card Grid Container
   ============================================================================= */

.data-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 16px;
    padding: 12px 0;
}

/* =============================================================================
   Individual Card
   ============================================================================= */

.data-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px;
    cursor: pointer;
    transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}

.data-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.data-card:active {
    transform: translateY(0);
}

/* =============================================================================
   Card Header
   ============================================================================= */

.data-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

.data-card-header-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.data-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.data-card-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    font-family: var(--font-mono, monospace);
}

.data-card-thumbnail {
    width: 48px;
    height: 36px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--border-light);
    flex-shrink: 0;
}

/* =============================================================================
   Badges
   ============================================================================= */

.data-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.card-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-badge.green {
    background: color-mix(in srgb, var(--color-success) 12%, transparent);
    color: var(--color-success);
}

.card-badge.red {
    background: color-mix(in srgb, var(--color-danger) 12%, transparent);
    color: var(--color-danger);
}

.card-badge.orange {
    background: color-mix(in srgb, var(--color-warning) 12%, transparent);
    color: var(--color-warning);
}

.card-badge.blue {
    background: color-mix(in srgb, var(--color-info) 12%, transparent);
    color: var(--color-info);
}

/* =============================================================================
   Field Grid
   ============================================================================= */

.data-card-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

.data-card-field-label {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.data-card-field-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

/* =============================================================================
   Expiration Color Coding
   ============================================================================= */

.card-expiration.expired {
    color: var(--color-danger);
    font-weight: 600;
}

.card-expiration.warning {
    color: var(--color-warning);
}

.card-expiration.upcoming {
    color: var(--color-info);
}

.card-expiration.ok {
    color: var(--color-success);
}

.card-exp-relative {
    font-size: 11px;
    opacity: 0.85;
}

/* =============================================================================
   View Toggle (toolbar)
   ============================================================================= */

.table-view-toggle {
    display: inline-flex;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}

.table-view-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 30px;
    border: none;
    background: var(--bg-primary);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.table-view-toggle-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.table-view-toggle-btn.active {
    background: var(--color-primary);
    color: white;
}

.table-view-toggle-btn + .table-view-toggle-btn {
    border-left: 1px solid var(--border-color);
}

/* =============================================================================
   Responsive
   ============================================================================= */

@media (max-width: 1200px) {
    .data-card-grid {
        grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    }
}

@media (max-width: 768px) {
    .data-card-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .data-card-fields {
        grid-template-columns: 1fr;
    }
}

/* Source: 17-responsive.css */
/* =============================================================================
   Mobile responsive breakpoints
   
   Source: styles.css lines 3407-3690
   ============================================================================= */

/* =============================================================================
   Mobile Responsive Styles
   ============================================================================= */

@media (max-width: 768px) {
    /* -------------------------------------------------------------------------
       Mobile Card View - Show cards, hide table
       ------------------------------------------------------------------------- */
    .mobile-cards-wrapper {
        display: block;
    }

    .table.hide-on-mobile {
        display: none;
    }

    /* -------------------------------------------------------------------------
       Dashboard Layout - Stack sidebar above content
       ------------------------------------------------------------------------- */
    .dashboard-page {
        flex-direction: column;
    }

    .action-sidebar {
        flex: none;
        width: 100%;
        height: auto;
        max-height: none;
        overflow-y: visible;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        position: relative;
    }

    .action-groups {
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    .action-group {
        margin-bottom: 4px;
    }

    .action-group .group-header {
        padding: 10px 12px;
    }

    /* Touch-friendly action buttons */
    .action-group > div:not(.group-header) {
        padding: 14px 16px;
        font-size: 14px;
        min-height: 44px;
        box-sizing: border-box;
    }

    /* -------------------------------------------------------------------------
       Page Container - Full width on mobile
       ------------------------------------------------------------------------- */
    .page-container {
        margin-left: 0 !important;
        padding: 10px;
        margin-top: 0;
    }

    /* -------------------------------------------------------------------------
       Header Navigation - Mobile hamburger menu
       ------------------------------------------------------------------------- */
    .header-bar {
        padding: 8px 10px;
        position: relative;
    }

    /* Hamburger button visible on mobile */
    .hamburger-btn {
        display: flex;
    }

    /* Nav hidden by default on mobile, shown when .open class added */
    .header-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background-color: var(--bg-header);
        padding: 0;
        box-shadow: var(--shadow-lg);
        z-index: 1002;
    }

    .header-nav.open {
        display: flex;
    }

    .header-nav a {
        padding: 14px 20px;
        text-align: left;
        font-size: 15px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        width: 100%;
        box-sizing: border-box;
    }

    .header-nav a:last-child {
        border-bottom: none;
    }

    /* -------------------------------------------------------------------------
       Form Panel - Full width with stacked fields
       ------------------------------------------------------------------------- */
    .form-panel {
        width: 100%;
        max-width: 100%;
        padding: 15px;
        margin: 0;
        border-radius: 0;
    }

    .group-fields {
        flex-direction: column;
    }

    .field {
        width: 100%;
        margin-bottom: 15px;
    }

    /* Prevent iOS zoom on input focus (requires 16px+ font) */
    input,
    select,
    textarea {
        font-size: 16px;
        min-height: 44px;
    }

    /* Full width submit buttons */
    .form-panel button,
    .submit-button,
    input[type="submit"] {
        width: 100%;
        padding: 14px;
        min-height: 44px;
        font-size: 16px;
    }

    /* -------------------------------------------------------------------------
       Modal - Better mobile sizing
       ------------------------------------------------------------------------- */
    .modal {
        width: 95%;
        max-width: 95%;
        max-height: 90vh;
        overflow-y: auto;
        margin: 5vh auto;
    }

    .modal-header {
        position: sticky;
        top: 0;
        background: white;
        z-index: 1;
        padding: 15px;
        border-bottom: 1px solid var(--border-color);
    }

    .modal-content {
        padding: 15px;
    }

    /* -------------------------------------------------------------------------
       Touch Target Sizes - Minimum 44x44px for accessibility
       ------------------------------------------------------------------------- */
    button,
    .button,
    [type="button"],
    [type="submit"] {
        min-height: 44px;
        min-width: 44px;
    }

    nav a,
    .nav-link {
        padding: 12px 16px;
    }

    input[type="checkbox"],
    input[type="radio"] {
        width: 22px;
        height: 22px;
    }

    /* Toggle switches need their own dimensions (overrides above) */
    .input-field input[type="checkbox"] {
        width: 44px;
        height: 24px;
        min-height: 24px;
    }

    /* -------------------------------------------------------------------------
       Tables - Horizontal scroll on mobile
       ------------------------------------------------------------------------- */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 600px;
    }

    /* -------------------------------------------------------------------------
       Mobile sidebar - hidden by default, shown when not collapsed
       ------------------------------------------------------------------------- */
    .navbar.sidebar {
        position: fixed;
        left: 0;
        top: 70px;
        width: 225px;
        height: calc(100vh - 70px);
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    /* Show sidebar when NOT collapsed (toggle opens it) */
    .navbar.sidebar:not(.collapsed) {
        transform: translateX(0);
    }

    /* Keep sidebar hidden when collapsed */
    .navbar.sidebar.collapsed {
        transform: translateX(-100%);
    }

    /* Smart Actions - Better mobile input */
    .ai-action-input {
        font-size: 16px;
        min-height: 60px;
    }

    /* -------------------------------------------------------------------------
       Mobile hamburger menu button
       ------------------------------------------------------------------------- */
    .mobile-menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        background-color: var(--bg-navbar);
        color: white;
        border: none;
        border-radius: 4px;
        font-size: 24px;
        cursor: pointer;
        flex-shrink: 0;
        margin-right: 10px;
        z-index: 1001;
    }

    .mobile-menu-toggle:hover {
        background-color: var(--bg-navbar-hover);
    }

    /* Overlay when sidebar is open */
    .navbar.sidebar:not(.collapsed)::after {
        content: '';
        position: fixed;
        top: 0;
        left: 225px;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.3);
        z-index: -1;
    }
}

/* Hide mobile menu button on desktop */
.mobile-menu-toggle {
    display: none;
}

/* Ensure button shows on mobile (restate for clarity) */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex !important;
    }
}


/* Source: 18-landing.css */
/* =============================================================================
   Landing page sections
   
   Source: styles.css lines 2971-3323
   ============================================================================= */

/* How It Works Section */
.how-it-works {
    background: var(--bg-secondary);
    padding: 60px 20px;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.step-card {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}

.step-number {
    width: 50px;
    height: 50px;
    background: var(--color-primary);
    color: var(--text-inverse);
    font-size: 24px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.step-card h3 {
    margin-bottom: 12px;
    color: var(--text-primary);
}

.step-card p {
    color: var(--text-secondary);
}

/* Industry Solutions Section */
.industry-solutions {
    padding: 60px 20px;
}

.industry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-top: 40px;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.industry-card {
    background: var(--bg-card);
    padding: 24px;
    border-radius: 8px;
    border-left: 4px solid var(--color-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}

.industry-icon {
    font-size: 32px;
    color: var(--color-primary);
    margin-bottom: 12px;
}

.industry-card h4 {
    margin-bottom: 8px;
    color: var(--text-primary);
}

.industry-card p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* CTA Final section improvements */
.cta-final p {
    color: var(--text-secondary);
    max-width: 600px;
    margin: 16px auto 32px;
}

.cta-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-final .cta-secondary {
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.cta-final .cta-secondary:hover {
    background: var(--color-primary);
    color: var(--text-inverse);
}

 .popup-container {
      position: fixed;
      top: 20px;
      left: 50%;
      transform: translateX(-50%);
      display: flex;
      flex-direction: column;
      gap: 12px;                 /* slightly larger gap */
      z-index: 5000;
    }

 /* Toast */
 .popup {
      background: var(--bg-card);
      color: var(--text-primary);
      border: 2px solid var(--color-primary);
      padding: 18px 28px;
      border-radius: 10px;
      box-shadow: var(--shadow-lg);
      max-width: 420px;          /* wider so long messages don't wrap awkwardly */
      min-width: 260px;          /* but not too tiny on mobile */
      width: fit-content;        /* grow with content until max‑width */
      word-break: break-word;    /* keep very long words from overflowing */
      opacity: 0;
      animation: toast-in 300ms forwards,
                 toast-out 300ms forwards var(--toast-lifetime, 3700ms);
      cursor: pointer;
      align-self: center;        /* ensure centered even if container flex changes */
    }

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

 @keyframes toast-out {
   to   {transform: translateY(-10px); opacity: 0;}
 }

/* Toast variants */
.popup.popup-success {
    border-color: #4caf50;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.1) 0%, var(--bg-card) 100%);
}
.popup.popup-success::before {
    content: "\f00c";  /* Font Awesome check */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    margin-right: 10px;
    color: #4caf50;
}

.popup.popup-error {
    border-color: #f44336;
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.1) 0%, var(--bg-card) 100%);
}
.popup.popup-error::before {
    content: "\f06a";  /* Font Awesome exclamation-circle */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    margin-right: 10px;
    color: #f44336;
}

.popup.popup-warning {
    border-color: #ff9800;
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.1) 0%, var(--bg-card) 100%);
}
.popup.popup-warning::before {
    content: "\f071";  /* Font Awesome triangle-exclamation */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    margin-right: 10px;
    color: #ff9800;
}

.popup.popup-info {
    border-color: #2196f3;
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.1) 0%, var(--bg-card) 100%);
}
.popup.popup-info::before {
    content: "\f05a";  /* Font Awesome info-circle */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    margin-right: 10px;
    color: #2196f3;
}

/* Timeline Container */
.timeline-container {
    position: relative;
    height: 300px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-card);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-top: 10px;
    max-width: none;
    overflow: visible;
    width: 100%;
}

/* Axis Line */
.timeline-axis .axis-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--color-accent);
    transform: translateY(-50%);
}

/* Current Time Indicator */
.timeline-axis .current-time {
    position: absolute;
    top: 50%;
    width: 2px;
    height: 100%;
    background-color: #ff4d4d;
    transform: translate(-50%, -50%);
}

/* Date Labels */
.timeline-axis .date-label {
    position: absolute;
    top: 60%;
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
}
.timeline-axis .date-label.start { left: 5px; }
.timeline-axis .date-label.end { right: 5px; }

/* Task Markers */
.task-marker {
    position: absolute;
    top: 50%;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    transition: transform 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.task-marker:hover {
    transform: translate(-50%, -50%) scale(1.5);
}
.task-marker .task-label {
    position: absolute;
    right: 120%;  /* To the right, not bottom-up */
    top: 50%;
    transform: translateY(-50%);  /* Center vertically on marker */
    background: var(--bg-navbar);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;  /* Prevent wrap for now; revert if needed */
    max-width: 250px;  /* Wider to fit full names */
    opacity: 0;
    transition: opacity 0.2s ease;
    margin-right: 8px;  /* Gap from marker */
    z-index: 20;  /* Above buttons */
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.task-marker:hover .task-label { opacity: 1; }

/* For left-edge markers, force right-side only */
.task-marker:first-child .task-label { right: auto; left: 120%; margin-left: 8px; margin-right: 0; }

.task-marker .function { font-weight: bold; display: block; }
.task-marker .status { opacity: 0.8; font-size: 10px; }

/* Status Colors */
.task-marker.pending { background-color: #007BFF; }  /* Matches your blue */
.task-marker.completed { background-color: #28a745; }
.task-marker.error { background-color: #dc3545; }
.task-marker.unknown { background-color: #6c757d; }

/* Legend */
.timeline-container .legend {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}
.legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--text-secondary);
}
.legend span::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.legend .pending::before { background-color: #007BFF; }
.legend .completed::before { background-color: #28a745; }
.legend .error::before { background-color: #dc3545; }

/* Responsive */
@media (max-width: 768px) {
    .timeline-container { height: 150px; }
    .legend { flex-direction: column; align-items: center; gap: 5px; }
    .task-marker .task-label { font-size: 10px; }
}
/* Smart Actions Loading Spinner */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-indicator {
    animation: fadeIn 0.3s ease-in;
}

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

.success-indicator {
    animation: slideIn 0.3s ease-out;
}

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


/* Source: 20-forms.css */
/* =============================================================================
   Form inputs, validation, checkboxes
   
   Source: styles.css lines 1765-2011
   ============================================================================= */

/* Container for the input field, label, and validation indicator */
.input-field {
    display: flex;
    flex-direction: column; /* Stack label, input, and validation vertically */
    margin-bottom: 20px; /* Space between multiple input fields */
    max-width: 100%; /* Prevent container from exceeding parent */
}

/* Style the label */
.input-field label {
    font-weight: 600; /* Slightly bolder for emphasis */
    color: var(--text-primary); /* Dark gray for contrast */
    margin-bottom: 8px; /* More space below label */
    font-size: 14px; /* Readable size */
}

/* Style the date input */
.input-field input[type="date"] {
    padding: 8px; /* Inner spacing for comfort */
    border: 1px solid var(--border-color); /* Light gray border */
    border-radius: 4px; /* Rounded corners for a modern look */
    font-size: 16px; /* Readable text size */
    box-sizing: border-box; /* Include padding and border in width */
    width: 100%; /* Full width of container (override the 25%) */
    max-width: 200px; /* Cap the width to avoid overflow */
}

/* Required Field Indicator */
.input-field.required label::after {
    content: " *"; /* Asterisk for required fields */
    color: var(--color-danger); /* Red to draw attention */
}

/* Input, Select, and Textarea Base Styles */
.input-field input,
.input-field select,
.input-field textarea {
    padding: 10px; /* Consistent padding */
    border: 1px solid var(--border-color); /* Light gray border */
    border-radius: 4px; /* Rounded corners */
    font-size: 16px; /* Readable text */
    box-sizing: border-box; /* Include padding/border in size */
    width: 100%; /* Full width */
    max-width: 100%; /* Prevent overflow */
    transition: border-color 0.3s ease, box-shadow 0.3s ease; /* Smooth focus effect */
}


.input-field textarea {
    height: 120px; /* Larger default height */
    resize: vertical; /* Allow vertical resizing only */
}

/* Focus State */
.input-field input:focus,
.input-field select:focus,
.input-field textarea:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.3);
}

/* Readonly/Disabled Input State */
.input-readonly,
.input-field input:disabled,
.input-field select:disabled,
.input-field textarea:disabled {
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: not-allowed;
}

/* Route Calculation Loading Indicator */
.result-loading {
    margin-top: 20px;
    padding: 16px;
    background-color: var(--bg-warning);
    border: 1px solid var(--color-warning);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.result-loading .spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--bg-secondary);
    border-top-color: var(--color-warning);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.result-loading span {
    color: var(--color-warning);
    font-weight: 500;
}

/* Toggle switch for boolean fields */
.input-field .checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 300px;
}

.input-field .checkbox-wrapper .toggle-label {
    font-size: 14px;
    font-weight: 500;
    transition: opacity 0.2s;
    user-select: none;
}

.input-field input[type="checkbox"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 44px;
    height: 24px;
    background: #888;
    border-radius: 12px;
    border: 1px solid #aaa;
    outline: none;
    cursor: pointer;
    position: relative;
    transition: background 0.2s, border-color 0.2s;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
}

.input-field input[type="checkbox"]::before {
    content: "";
    position: absolute;
    top: 1px;
    left: 1px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.input-field input[type="checkbox"]:checked {
    background: var(--color-accent, #007bff);
    border-color: var(--color-accent, #007bff);
}

.input-field input[type="checkbox"]:checked::before {
    transform: translateX(20px);
}

/* Ensure validation indicator aligns consistently */
.input-field .validation-indicator { /* Assuming ge/validation-indicator adds this class */
    margin-top: 5px;
}

/* Validation Indicators */
.input-field .error-message {
    color: var(--color-danger); /* Red for errors */
    font-size: 12px; /* Smaller text */
    margin-top: 5px; /* Space above */
}

.input-field .fa-check {
    color: var(--color-success); /* Green for success */
    font-size: 16px; /* Slightly larger icon */
    margin-top: 5px; /* Space above */
}

/* SSN input inline validation (border color indicates state) */
.input-field input.ssn-valid {
    border-color: var(--color-success, #28a745);
}
.input-field input.ssn-invalid {
    border-color: var(--color-danger, #dc3545);
}

/* Submit Button */
.form-panel button {
    background-color: var(--color-accent);
    color: white;
    padding: 12px 24px; /* Larger padding for prominence */
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 100%; /* Full width for emphasis */
    max-width: 200px; /* Cap width */
    margin-top: 20px; /* Space above */
}

.form-panel button:hover {
    background-color: var(--color-accent-hover); /* Darker blue on hover */
}

/* Responsive Design */
@media (max-width: 768px) {
    .form-panel {
        padding: 15px; /* Reduced padding */
        margin: 10px; /* Reduced margin */
    }

    .input-field {
        margin-bottom: 12px; /* Tighter spacing on mobile (was 20px) */
    }

    .input-field label {
        margin-bottom: 4px; /* Tighter label spacing on mobile (was 8px) */
        font-size: 13px; /* Slightly smaller labels on mobile */
    }

    .input-field input,
    .input-field select,
    .input-field textarea {
        max-width: 100%; /* Full width on small screens */
    }

    .form-panel button {
        max-width: 100%; /* Full width button on small screens */
    }
}

/* Style the date input when focused */
.input-field input[type="date"]:focus {
    border-color: var(--color-accent); /* Blue border on focus for accessibility */
    outline: none; /* Remove default browser outline */
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5); /* Subtle blue glow */
}

/* Style the date input */
.input-field input[type="date"] {
    padding: 8px; /* Inner spacing for comfort */
    border: 1px solid var(--border-color); /* Light gray border */
    border-radius: 4px; /* Rounded corners for a modern look */
    font-size: 16px; /* Readable text size */
    box-sizing: border-box; /* Include padding and border in width */
    width: 25%; /* Match the inline style from the code */
}

/* Style the textarea inside .input-field */
.input-field textarea {
    width: 100%; /* Full width for textarea */
    padding: 8px; /* Inner spacing for comfort */
    border: 1px solid var(--border-color); /* Light gray border */
    border-radius: 4px; /* Rounded corners */
    font-size: 16px; /* Readable text size */
    box-sizing: border-box; /* Include padding and border in size */
    height: 100px; /* Larger default height for usability */
    resize: vertical; /* Allow vertical resizing only */
}

/* Style the date input when focused */
.input-field input[type="date"]:focus {
    border-color: var(--color-accent); /* Blue border on focus for accessibility */
    outline: none; /* Remove default browser outline */
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5); /* Subtle blue glow */
}

/* Make the date picker calendar icon visible in dark mode */
[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
    opacity: 0.8;
}

[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* Style the text input within .input-field */
.input-field input[type="text"] {
    padding: 8px; /* Consistent inner spacing with date input */
    border: 1px solid var(--border-color); /* Light gray border matching other inputs */
    border-radius: 4px; /* Rounded corners for a modern look */
    font-size: 16px; /* Readable text size, matching date input */
    box-sizing: border-box; /* Include padding and border in width */
    width: 100%; /* Full width of container for responsiveness */
    max-width: 200px; /* Cap width to prevent overflow, adjustable */
}

/* Style the text input when focused */
.input-field input[type="text"]:focus {
    border-color: var(--color-accent); /* Blue border on focus, matching date input */
    outline: none; /* Remove default browser outline */
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5); /* Subtle blue glow, matching date input */
}

/* Style the select element within .input-field */
.input-field select {
    padding: 8px; /* Consistent inner spacing with other inputs */
    border: 1px solid var(--border-color); /* Light gray border matching other inputs */
    border-radius: 4px; /* Rounded corners for a modern look */
    font-size: 16px; /* Readable text size, matching other inputs */
    box-sizing: border-box; /* Include padding and border in width */
    width: 100%; /* Full width of container for responsiveness */
    max-width: 200px; /* Cap width to prevent overflow, adjustable */
    background-color: var(--bg-card); /* White background for clarity */
    cursor: pointer;
    /* Removed appearance: none to restore native dropdown functionality */
}

/* Style the select element when focused */
.input-field select:focus {
    border-color: var(--color-accent); /* Blue border on focus, matching other inputs */
    outline: none; /* Remove default browser outline */
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5); /* Subtle blue glow, matching other inputs */
}

/* Optional: Style the options (though limited control is possible) */
.input-field select option {
    padding: 8px; /* Padding for consistency (some browsers may ignore) */
    font-size: 16px; /* Match select font size */
}

/* =============================================================================
   Disclosure text (read-only legal/informational text blocks in forms)
   ============================================================================= */

.disclosure-content {
    border: 1px solid var(--border-color, #ddd);
    border-radius: 4px;
    padding: 16px;
    margin: 8px 0;
    background: var(--bg-secondary, #f9f9f9);
    max-height: 200px;
    overflow-y: auto;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-line;
    color: var(--text-primary, #333);
}

/* =============================================================================
   Signature pad component styles
   ============================================================================= */

.signature-canvas-wrapper {
    border: 2px solid var(--border-color, #ccc);
    background: var(--bg-card, #fff);
}

/* Canvas must always be white — signature exports as black-on-white PNG for PDFs */
.signature-canvas-wrapper canvas {
    background: #fff !important;
}

.signature-baseline {
    background: var(--border-color, #ccc);
}

.signature-x-marker {
    color: var(--text-muted, #999);
}

.signature-clear-btn {
    background: var(--bg-secondary, #f5f5f5);
    border: 1px solid var(--border-color, #ddd);
    color: var(--text-primary, #333);
}

.signature-clear-btn:hover {
    background: var(--bg-tertiary, #e0e0e0);
}

.signature-status-text {
    color: var(--text-secondary, #666);
}

.ssn-security-notice {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-secondary, #666);
    line-height: 1.4;
}

.ssn-security-notice .fa-lock {
    color: var(--color-success, #4caf50);
    font-size: 13px;
    flex-shrink: 0;
}

.file-uploaded-indicator {
    color: var(--color-success, #4caf50);
    font-weight: 500;
}

.file-uploaded-indicator .fa-check-circle {
    margin-right: 4px;
}

.required-asterisk {
    color: var(--color-danger, #d32f2f);
}

.signature-signed-badge {
    color: var(--color-success, #4caf50);
    font-size: 12px;
}

.signature-image-wrapper {
    border: 1px solid var(--border-color, #ccc);
    border-radius: 4px;
    padding: 8px;
}

/* =============================================================================
   Compact Form Layout
   Tighter spacing for settings pages with many toggle fields.
   Applied via :layout "compact" in action config.
   ============================================================================= */

.form-panel.form-compact .input-field {
    margin-bottom: 8px;
}

.form-panel.form-compact .input-field label {
    margin-bottom: 4px;
    font-size: 13px;
}

.form-panel.form-compact h1 {
    font-size: 20px;
    margin-bottom: 12px;
}

/* Source: 20a-buttons.css */
/* =============================================================================
   Button variant styles
   
   Source: styles.css lines 3691-3728
   ============================================================================= */

/* =============================================================================
   Button Variants
   ============================================================================= */

/* Secondary button - white background with border */
.btn-secondary {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
}

.btn-secondary:hover {
    background-color: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

/* Danger button - for destructive actions */
.btn-danger {
    background-color: var(--color-danger) !important;
    color: var(--text-inverse) !important;
    border: none !important;
}

.btn-danger:hover {
    background-color: var(--color-danger) !important;
}

/* Danger outline button */
.btn-danger-outline {
    background-color: var(--bg-card) !important;
    color: var(--color-danger) !important;
    border: 1px solid var(--color-danger) !important;
}

.btn-danger-outline:hover {
    background-color: var(--color-danger-bg) !important;
}


/* Source: 20b-form-grid.css */
/* ==========================================================================
   Form Grid Layout — two-column grid for action forms
   ========================================================================== */

.form-panel.form-grid { max-width: 900px; }
.form-panel.form-grid .form-fields-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px 20px;
}
.form-panel.form-grid .form-fields-grid > .input-field { margin-bottom: 4px; }
.form-panel.form-grid .form-fields-grid > .input-field.span-2 { grid-column: span 2; }

/* Override narrow max-widths from single-column layout */
.form-panel.form-grid .input-field select,
.form-panel.form-grid .input-field input[type="date"] {
    max-width: none;
    width: 100%;
}

@media (max-width: 768px) {
    .form-panel.form-grid { max-width: 100%; }
    .form-panel.form-grid .form-fields-grid { grid-template-columns: 1fr; }
    .form-panel.form-grid .form-fields-grid > .input-field.span-2 { grid-column: span 1; }
}

/* Source: 21-forms-extended.css */
/* =============================================================================
   Extended form components, data display
   
   Source: styles.css lines 2012-2731
   ============================================================================= */

}

/* Style the validation error message */
.input-field > span {
    color: red; /* Red color for error messages */
    font-size: 14px; /* Slightly smaller text for validation */
    margin-top: 5px; /* Space above the validation message */
}

/* Style the validation checkmark icon */
.input-field > i.fa.fa-check {
    color: green; /* Green color for success */
    font-size: 18px; /* Slightly larger icon for visibility */
    margin-top: 5px; /* Space above the checkmark */
}

.clickable {
    cursor: pointer; /* Keep the hand cursor */
    color: var(--text-link); /* Blue color to suggest interactivity (matches common link styles) */
    padding: 8px 12px; /* Comfortable padding for clickable area */
    border-radius: 4px; /* Slight rounding for a modern feel */
    transition: all 0.3s ease; /* Smooth transition for hover effects */
}

/* Hover state */
.clickable:hover {
    background-color: var(--bg-hover); /* Light gray background on hover */
    color: var(--color-primary-dark); /* Darker blue for contrast */
    text-decoration: underline; /* Underline to reinforce clickability */
}

/* Active state (when clicked) */
.clickable:active {
    background-color: var(--bg-tertiary); /* Slightly darker gray when pressed */
    color: #004494; /* Even darker blue for feedback */
}

/* Timeline Tile Container */
.tile {
    background-color: var(--bg-card); /* Clean white background */
    border: 1px solid var(--border-color); /* Subtle light gray border */
    border-radius: 8px; /* Rounded corners for a modern feel */
    padding: 20px; /* Comfortable padding inside */
    margin-bottom: 20px; /* Space between tiles */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Subtle shadow for depth */
}

/* Header Styling */
.tile h3 {
    font-size: 20px; /* Larger size for emphasis */
    font-weight: 600; /* Semi-bold for prominence */
    color: var(--text-primary); /* Dark gray for readability */
    margin: 0 0 15px 0; /* Space below the header */
}

/* Timeline Entry Styling */
.entry {
    border-bottom: 1px solid var(--border-light); /* Light border to separate entries */
    padding: 10px 0; /* Vertical padding for spacing */
}

/* Remove border from the last entry */
.entry:last-child {
    border-bottom: none; /* No border on the final entry */
}

/* Paragraphs inside entries (e.g., Date, Type, Description) */
.entry p {
    margin: 8px 0; /* Spacing between fields */
    font-size: 16px; /* Readable text size */
    color: var(--text-primary); /* Dark gray for clarity */
    overflow-wrap: break-word; /* Wraps long text to prevent overflow */
}

/* Labels inside paragraphs (e.g., "Date:", "Type:") */
.entry p strong {
    font-weight: 600; /* Bold labels for distinction */
    color: var(--text-secondary); /* Medium gray to contrast with values */
}

/* Follow Up Button Styling */
.entry button {
    background-color: var(--color-accent); /* Primary blue to match common button styles */
    color: white; /* White text for contrast */
    padding: 5px 10px; /* Compact padding */
    border: none; /* No border for a clean look */
    border-radius: 4px; /* Slightly rounded corners */
    cursor: pointer; /* Hand cursor for interactivity */
    transition: background-color 0.3s ease; /* Smooth hover transition */
    margin-top: 10px; /* Space above the button */
}

/* Button hover effect */
.entry button:hover {
    background-color: var(--color-accent-hover); /* Darker blue on hover */
}

/* "No interactions found" message */
.tile > p {
    font-size: 16px; /* Consistent font size */
    color: var(--text-secondary); /* Muted gray for less emphasis */
    text-align: center; /* Centered for visibility */
    margin: 20px 0; /* Spacing around the message */
    font-style: italic; /* Italicized to stand out */
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .tile {
        padding: 15px; /* Reduced padding on smaller screens */
    }

    .entry p {
        font-size: 14px; /* Smaller text for better fit */
    }

    .entry button {
        padding: 4px 8px; /* Smaller button padding */
        font-size: 14px; /* Smaller button text */
    }
}

.ambiguity-title {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #3498db;
}

.ambiguity-questions {
    background-color: var(--bg-secondary);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.ambiguity-question {
    color: var(--text-secondary);
    margin: 0.5rem 0;
    padding-left: 1rem;
    position: relative;
}

.ambiguity-question:before {
    content: "•";
    color: var(--color-info);
    position: absolute;
    left: 0;
}

.ambiguity-message {
    background-color: var(--color-warning-bg);
    padding: 1rem;
    border-left: 4px solid #e67e22;
    border-radius: 4px;
}

.ambiguity-message p {
    margin: 0.5rem 0;
    color: var(--text-muted);
}

.ambiguity-message p:first-child {
    color: #d35400;
    font-weight: 500;
}

.plan-container {
    padding: 1rem;
    background-color: var(--bg-card);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin: 1rem 0;
}

.plan-title {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #3498db;
}

.plan-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
}

.plan-item {
    padding: 0.75rem 1rem;
    margin: 0.5rem 0;
    background-color: var(--bg-secondary);
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.plan-item:hover {
    background-color: var(--bg-hover);
}

.approve-button {
    background-color: var(--color-success);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.approve-button:hover:not(:disabled) {
    background-color: var(--color-success);
}

.approve-button:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
    opacity: 0.7;
}

.result-entity {
    margin-bottom: 0.5rem; /* Consistent with your 5px */
    padding: 0.5rem;
    background-color: var(--bg-secondary);
    border-radius: 4px;
    list-style: none; /* Remove default bullet if in a ul */
    transition: background-color 0.2s ease;
}

.result-entity:hover {
    background-color: var(--bg-hover);
}

.result-field {
    display: flex;
    align-items: center;
    margin-bottom: 0.25rem; /* Space between fields */
}

.result-key {
    color: var(--text-primary); /* Dark blue for keys */
    font-weight: 500;
    margin-right: 0.5rem; /* Reduced from 10px for balance */
}

.result-value {
    color: var(--text-secondary); /* Slightly lighter for values */
}

.result-count {
    color: var(--color-info); /* Blue to highlight counts */
    font-weight: 500;
}

.result-text {
    color: var(--text-muted); /* Gray for strings */
    font-style: italic;
}

/* Remove max-width for consistency */
.input-field input[type="text"],
.input-field input[type="date"],
.input-field select {
    max-width: none; /* Let it grow to container width */
}

/* Checkbox Wrapper */
.input-field .checkbox-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
}

/* Toggle switch styles are in 20-forms.css — do not override width here */

/* Select Container (Filter + Select) */
.select-container {
    margin: 0; /* Remove extra margin */
}

/* Filter Label and Input */
.select-container .filter-label {
    margin-bottom: 5px;
}

.select-container input[type="text"] {
    width: 100%;
    max-width: none; /* Match other inputs */
    margin-bottom: 10px;
}

/* Select Label */
.select-container .select-label {
    margin-top: 5px;
    margin-bottom: 5px;
}

/* Action Details (Show Details Button and Pre) */
.action-details {
    margin-top: 10px;
    width: 100%;
}

.action-details .toggle-details-btn {
    background-color: var(--color-accent);
    color: white;
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 5px;
    width: 100%; /* Full width button */
    text-align: center;
}

.action-details .toggle-details-btn:hover {
    background-color: var(--color-accent-hover);
}

.action-details pre {
    width: 100%;
    margin-top: 5px;
    padding: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-x: auto;
    box-sizing: border-box;
}

/* Validation Messages */
.input-field .error-message {
    color: var(--color-danger);
    font-size: 12px;
    margin-top: 5px;
    width: 100%;
    text-align: left; /* Align with input */
}

/* Select Input Container */
.select-input {
    background-color: var(--bg-card);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    max-width: 600px; /* Consistent with form-panel */
}

/* Action Details Container */
.action-details {
    margin-top: 15px;
}

/* Toggle Details Button */
.toggle-details-btn {
    background-color: var(--color-accent);
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    width: 100%;
    text-align: center;
    transition: background-color 0.3s ease;
}

.toggle-details-btn:hover {
    background-color: var(--color-accent-hover);
}

/* Details Panel */
.details-panel {
    margin-top: 10px;
    padding: 15px;
    background-color: var(--bg-secondary);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

/* Action Badge */
.action-badge {
    display: inline-block;
    padding: 8px 16px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 20px;
    margin-bottom: 15px;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.action-new {
    background-color: var(--color-success); /* Green for New */
    color: white;
}

.action-deleted {
    background-color: var(--color-danger); /* Red for Deleted */
    color: white;
}

.action-updated {
    background-color: var(--color-warning); /* Yellow for Updated */
    color: var(--text-primary);
}

.action-unknown {
    background-color: #bdc3c7; /* Gray for unknown */
    color: var(--text-primary);
}

/* Diff Payload Container */
.diff-payload {
    font-family: 'Segoe UI', Arial, sans-serif;
}

/* Diff Field */
.diff-field {
    padding: 10px;
    margin-bottom: 5px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

/* Diff States */
.diff-added {
    background-color: rgba(46, 204, 113, 0.1); /* Light green */
    border-left: 4px solid #2ecc71; /* Solid green border */
}

.diff-removed {
    background-color: rgba(231, 76, 60, 0.1); /* Light red */
    border-left: 4px solid #e74c3c; /* Solid red border */
}

.diff-changed {
    background-color: rgba(241, 196, 15, 0.1); /* Light yellow */
    border-left: 4px solid #f1c40f; /* Solid yellow border */
}

.diff-unchanged {
    background-color: transparent;
}

/* Nested Diff Fields */
.diff-nested {
    margin-left: 20px;
    padding-left: 10px;
    border-left: 1px dashed #ccc;
}

/* Diff Key */
.diff-key {
    font-weight: 600;
    color: var(--text-primary);
    margin-right: 10px;
}

/* Diff Value */
.diff-value {
    color: var(--text-secondary);
}

/* Empty Payload Message */
.diff-empty {
    font-style: italic;
    color: var(--text-muted);
    text-align: center;
    padding: 10px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .select-input {
        padding: 10px;
    }

    .details-panel {
        padding: 10px;
    }

    .action-badge {
        font-size: 14px;
        padding: 6px 12px;
    }

    .diff-field {
        padding: 8px;
    }
}

.details-panel {
    margin-top: 10px;
    padding: 15px;
    background-color: var(--bg-secondary);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.action-badge {
    display: inline-block;
    padding: 8px 16px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 20px;
    margin-bottom: 15px;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.action-new {
    background-color: var(--color-success);
    color: white;
}

.action-deleted {
    background-color: var(--color-danger);
    color: white;
}

.action-updated {
    background-color: var(--color-warning);
    color: var(--text-primary);
}

.action-unknown {
    background-color: #bdc3c7;
    color: var(--text-primary);
}

.detail-list {
    font-family: 'Segoe UI', Arial, sans-serif;
}

.detail-field {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.detail-label {
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    margin-right: 20px;
}

.detail-value {
    color: var(--text-secondary);
    flex: 2;
    text-align: left;
    word-break: break-word;
}

.detail-nested {
    margin-left: 20px;
    padding-left: 10px;
    border-left: 1px dashed #ccc;
    width: 100%;
}

.diff-indicator {
    font-style: italic;
    margin-right: 5px;
}

.diff-added {
    background-color: rgba(46, 204, 113, 0.1);
    border-left: 4px solid #2ecc71;
}

.diff-removed {
    background-color: rgba(231, 76, 60, 0.1);
    border-left: 4px solid #e74c3c;
}

.diff-changed {
    background-color: rgba(241, 196, 15, 0.1);
    border-left: 4px solid #f1c40f;
}

.detail-empty, .error {
    font-style: italic;
    color: var(--text-muted);
    text-align: center;
    padding: 10px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .detail-field {
        flex-direction: column;
        align-items: flex-start;
    }

    .detail-label {
        margin-right: 0;
        margin-bottom: 5px;
    }

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

/* Group Input Container */
.group-input {
    background-color: var(--bg-secondary); /* Light gray background for distinction */
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

/* Group Label */
.group-input .group-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    display: block;
}

/* Group Instance Container */
.group-instance {
    background-color: var(--bg-card);
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 12px;
    border: 1px solid var(--border-color);
}

/* Subtable Container */
.subtable-container {
    margin-top: 8px;
    padding: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

/* Group Fields Container */
.group-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Style inputs within group fields */
.group-fields .input-field {
    flex: 1 1 300px; /* Allow fields to grow but cap at 300px */
    min-width: 200px; /* Ensure fields don’t get too narrow */
}

/* Add and Remove Buttons */
.group-input .button,
.group-input .delete-button {
    width: 100%;
    max-width: 200px;
    margin-top: 10px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .group-fields .input-field {
        flex: 1 1 100%; /* Full width on small screens */
    }

    .group-input {
        padding: 10px;
    }

    .group-instance {
        padding: 8px;
    }
}

.file-upload-controls {
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-upload-controls button {
    background-color: var(--color-accent);
    color: white;
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.file-upload-controls button:hover {
    background-color: var(--color-accent-hover);
}

.notification-banner {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Source: 21a-fields-grid.css */
/* =============================================================================
   Two-column fields grid
   
   Source: styles.css lines 10725-10765
   ============================================================================= */

/* =============================================================================
   Fields Grid (Two-Column Layout)
   ============================================================================= */

.fields-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.fields-grid .field {
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border-radius: 4px;
    padding: 8px 12px;
}

.fields-grid .field.span-2 {
    grid-column: span 2;
}

.fields-grid .field-name {
    font-size: 0.75em;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.fields-grid .field-value {
    color: var(--text-primary);
    font-size: 0.95em;
}

.fields-grid .field-value h4 {
    margin: 0;
    font-size: 1.1em;
    color: var(--text-primary);
}


/* Source: 21b-edit-fields-grid.css */
/* =============================================================================
   Edit modal two-column grid layout

   Opt-in via :modal-grid config on page definitions.
   Applied as .fields-container.fields-grid-layout in table.cljs.
   ============================================================================= */

.fields-container.fields-grid-layout {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px 20px;
}

.fields-container.fields-grid-layout > div > .input-field {
    margin-bottom: 0;  /* grid gap handles spacing */
}

.fields-container.fields-grid-layout .span-2 {
    grid-column: span 2;
}

@media (max-width: 768px) {
    .fields-container.fields-grid-layout {
        grid-template-columns: 1fr;
    }
    .fields-container.fields-grid-layout .span-2 {
        grid-column: span 1;
    }
}

/* Source: 21c-edit-modal-tabs.css */
/* =============================================================================
   Edit modal tab layout

   Opt-in via :edit-modal-tabs config on page definitions.
   Applied in table.cljs edit-modal when tabs are present.
   ============================================================================= */

/* Tab bar */
.edit-modal-tab-bar {
    display: flex;
    gap: 0;
    margin: 0 -20px;
    padding: 0 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 12px;
}

.edit-modal-tab-bar button {
    padding: 8px 16px;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.15s, border-color 0.15s;
}

.edit-modal-tab-bar button:hover {
    color: var(--text-primary);
}

.edit-modal-tab-bar button.active {
    color: #7b1fa2;
    font-weight: 600;
    border-bottom-color: #7b1fa2;
}

/* Inline actions (replaces sticky .modal-actions for tabbed modals) */
.edit-modal-inline-actions {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    margin-top: 8px;
    background: var(--bg-secondary);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

/* Tighter grid for tabbed modals */
.fields-grid-layout.tabbed-fields {
    gap: 2px 16px;
}

/* SPACE FIX: full-width inputs in grid layout */
.fields-grid-layout .input-field input[type="text"],
.fields-grid-layout .input-field input[type="date"],
.fields-grid-layout .input-field input[type="tel"],
.fields-grid-layout .input-field select {
    max-width: 100%;
    width: 100%;
}

/* Tighter modal padding when tabbed */
.modal-content.has-tabs {
    padding: 16px 20px;
}

.modal-content.has-tabs h1 {
    margin-bottom: 8px;
    font-size: 20px;
}

/* Checkbox alignment in tabbed grid */
.fields-grid-layout.tabbed-fields .checkbox-wrapper-4 {
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 8px 0;
}

/* Source: 22-modals.css */
/* =============================================================================
   Modal dialog styles
   
   Source: styles.css lines 6878-6924
   ============================================================================= */

/* =============================================================================
   Modal Styles (for migrating inline styles)
   ============================================================================= */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-modal-overlay);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
    color: var(--text-primary);
}

.modal-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.modal-footer {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
}

/* .modal-actions, .has-modal-actions rules are in 02-loading.css
   alongside the base .modal and .modal-content rules */


/* Source: 23-tables.css */
/* =============================================================================
   Table cell styles and data display
   
   Source: styles.css lines 4070-4218
   ============================================================================= */

/* =============================================================================
   Table Cell Styles
   ============================================================================= */

/* Warning cells - semantic, same in both modes */
.cell-warning {
    background-color: var(--color-warning-bg);
    color: #856404;
    font-weight: bold;
    padding: 8px;
}

/* Password cell */
.password-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.password-btn {
    cursor: pointer;
    border: none;
    background-color: var(--bg-secondary);
    padding: 4px;
    border-radius: 4px;
    color: var(--text-primary);
}

.password-btn:hover {
    background-color: var(--border-color);
}

/* Route summary cells */
.route-summary {
    font-size: 12px;
}

.route-summary .route-miles {
    font-weight: 500;
}

.route-summary .route-stops {
    color: var(--text-secondary);
    margin-left: 8px;
}

.route-no-data {
    color: var(--text-muted);
    font-style: italic;
}

/* Trip route map input */
.trip-route-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.trip-stat-total {
    padding: 8px 12px;
    background: var(--bg-info);
    border-radius: 4px;
}

.trip-stat-stops {
    padding: 8px 12px;
    background: var(--bg-success);
    border-radius: 4px;
}

.trip-regenerate-btn {
    padding: 8px 16px;
    background: var(--color-warning);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.trip-regenerate-btn:disabled {
    background: var(--text-muted);
    cursor: wait;
}

.trip-generate-btn {
    padding: 12px 24px;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.trip-generate-btn:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
}

/* Jurisdiction breakdown table */
.jurisdiction-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.jurisdiction-table thead tr {
    background: var(--bg-secondary);
}

.jurisdiction-table th,
.jurisdiction-table td {
    padding: 6px 8px;
    border: 1px solid var(--border-color);
}

.jurisdiction-table th {
    text-align: left;
}

.jurisdiction-table td.text-right {
    text-align: right;
}

/* Map container */
.trip-map-container {
    height: 300px;
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

/* Route generate placeholder */
.route-generate-placeholder {
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 8px;
    text-align: center;
}

.route-generate-placeholder p {
    color: var(--text-secondary);
    margin-bottom: 12px;
}

/* URL Thumbnail cell - shows link and image preview */
.url-thumbnail-cell {
    vertical-align: middle;
}

.url-thumbnail-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.url-thumbnail-link {
    color: var(--color-primary);
    text-decoration: none;
    white-space: nowrap;
    font-size: 13px;
}

.url-thumbnail-link:hover {
    text-decoration: underline;
}

.url-thumbnail-link i {
    margin-right: 4px;
}

.url-thumbnail-image {
    max-height: 60px;
    max-width: 80px;
    object-fit: contain;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    cursor: pointer;
}

.url-thumbnail-image:hover {
    border-color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}


/* Source: 23a-smart-actions.css */
/* =============================================================================
   Smart action table styles
   
   Source: styles.css lines 10686-10724
   ============================================================================= */

/* =============================================================================
   Smart Action Table Styles
   ============================================================================= */

.smart-action-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
    margin-top: 12px;
}

.smart-action-table th {
    background: var(--bg-secondary);
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
}

.smart-action-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
}

.smart-action-table tbody tr:hover {
    background-color: var(--bg-hover);
}

.tool-result-structured {
    margin-top: 8px;
}

.tool-result-structured .result-message {
    margin-bottom: 8px;
    color: var(--text-secondary);
}


/* Source: 23b-table-toolbar.css */
/* =============================================================================
   Table Toolbar - compact header layout
   Combines title + search + add button in one row
   ============================================================================= */

.table-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 40px;
    padding: 4px 0;
}

.table-toolbar-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
    color: var(--text-primary);
}

/* Compact filter input with search icon */
.filter-input-compact {
    position: relative;
    flex: 0 1 280px;
}

.filter-input-compact .filter-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 13px;
    pointer-events: none;
}

.filter-input-compact .filter-input {
    width: 100%;
    padding: 6px 10px 6px 32px;
    font-size: 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    box-sizing: border-box;
}

.filter-input-compact .filter-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb, 59, 130, 246), 0.15);
}

/* Add button pushed to right end of toolbar */
.table-toolbar-add {
    margin-left: auto;
    white-space: nowrap;
    padding: 6px 14px;
    font-size: 14px;
    border: none;
    border-radius: 6px;
    background: var(--color-primary);
    color: white;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.table-toolbar-add:hover {
    opacity: 0.9;
}

/* Bottom pagination */
.table-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-top: 1px solid var(--border-color);
    margin-top: 4px;
    font-size: 13px;
    color: var(--text-secondary);
}

.pagination-info {
    white-space: nowrap;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 2px;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding: 0 6px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 13px;
    text-decoration: none;
}

.pagination-btn:hover {
    background: var(--bg-secondary);
}

.pagination-btn.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
    font-weight: 600;
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

/* Mobile: toolbar wraps, title takes full width */
@media (max-width: 768px) {
    .table-toolbar {
        flex-wrap: wrap;
    }

    .table-toolbar-title {
        width: 100%;
        font-size: 18px;
    }

    .filter-input-compact {
        flex: 1 1 200px;
    }

    .table-pagination {
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
    }
}

/* Source: 23c-view-tabs.css */
/* =============================================================================
   View Tabs — Vinyl-style preset filter tabs rendered above a table.
   Keeps a distinct look from the adjacent quick-filters chips: tabs are
   larger, underline-active, and span the full width of the table header.
   ============================================================================= */

.view-tabs-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 4px;
    margin: 4px 0 8px;
    border-bottom: 1px solid var(--border-color);
}

.view-tabs-bar .view-tab {
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
    white-space: nowrap;
    margin-bottom: -1px; /* overlap the bar's border-bottom so active tab sits flush */
}

.view-tabs-bar .view-tab:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.view-tabs-bar .view-tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    font-weight: 600;
}

/* =============================================================================
   Expiration date cell tinting — mirrors the Vinyl permits grid.
   Applied by create-expiration-cell (components/table/cell_renderers.cljs).
   ============================================================================= */

td.expiration-cell.expired {
    background: #fca5a5;
    color: #7f1d1d;
    font-weight: 600;
}

td.expiration-cell.critical,
td.expiration-cell.urgent,
td.expiration-cell.warning,
td.expiration-cell.upcoming {
    background: #fef08a;
    color: #713f12;
    font-weight: 500;
}

@media (max-width: 768px) {
    .view-tabs-bar {
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .view-tabs-bar .view-tab {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* =============================================================================
   Clickable cell + cell popover (e.g., Unit # → truck details).
   ============================================================================= */

td.clickable-cell {
    color: var(--color-primary);
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
}

td.clickable-cell:hover {
    background: var(--bg-secondary);
}

.cell-popover-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
}

.cell-popover {
    background: var(--bg-card);
    border-radius: 8px;
    box-shadow: var(--shadow-lg, 0 10px 30px rgba(0, 0, 0, 0.25));
    min-width: 320px;
    max-width: 480px;
    padding: 0;
    color: var(--text-primary);
}

.cell-popover.cell-popover-wide {
    min-width: 640px;
    max-width: 880px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.cell-popover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.cell-popover-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.cell-popover-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 4px;
}

.cell-popover-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.truck-detail-body {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.truck-detail-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px dashed var(--border-color);
}

.truck-detail-row:last-child {
    border-bottom: none;
}

.truck-detail-label {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.truck-detail-value {
    font-size: 14px;
    color: var(--text-primary);
    word-break: break-all;
}

.truck-detail-empty {
    padding: 16px;
}

.truck-detail-empty .muted {
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 6px;
}

/* Compact 2-column grid used when the popover shows the full Trucks record.
   Mirrors .fields-container.fields-grid-layout so the popover looks like
   the edit-modal grid but read-only. */
.truck-detail-grid {
    padding: 12px 16px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 18px;
    overflow-y: auto;
}

.truck-detail-grid .truck-detail-field.span-2 {
    grid-column: span 2;
}

.truck-detail-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.truck-detail-field .truck-detail-label {
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.truck-detail-field .truck-detail-value {
    font-size: 14px;
    color: var(--text-primary);
    word-break: break-word;
}

.truck-detail-field .muted {
    color: var(--text-secondary);
}

.truck-detail-image {
    display: block;
    max-width: 100%;
    max-height: 180px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    object-fit: contain;
    background: var(--bg-secondary);
}

@media (max-width: 768px) {
    .cell-popover.cell-popover-wide {
        min-width: unset;
        width: 96vw;
    }
    .truck-detail-grid {
        grid-template-columns: 1fr;
    }
    .truck-detail-grid .truck-detail-field.span-2 {
        grid-column: span 1;
    }
}

/* Source: 24-release-notes.css */
/* =============================================================================
   Release notes modal
   
   Source: styles.css lines 6365-6666
   ============================================================================= */

/* =============================================================================
   Release Notes Modal
   ============================================================================= */

.release-notes-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2100;
    padding: 20px;
}

.release-notes-modal {
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.release-notes-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-secondary);
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.release-notes-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.release-notes-header {
    padding: 24px 24px 16px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.release-notes-title {
    margin: 0 0 8px 0;
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.release-notes-date {
    color: var(--text-secondary);
    font-size: 14px;
}

.release-notes-summary {
    padding: 16px 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.release-summary-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 16px;
}

.release-summary-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 20px;
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s, box-shadow 0.2s;
}

.release-summary-stat:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.release-summary-icon {
    font-size: 24px;
    margin-bottom: 4px;
}

.release-summary-count {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.release-summary-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.release-highlights {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 12px 16px;
}

.release-highlights-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.release-highlight {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 0;
    cursor: pointer;
    transition: color 0.2s;
}

.release-highlight:hover {
    color: var(--color-primary);
}

.release-highlight-bullet {
    color: var(--color-success);
    font-weight: bold;
}

.release-highlight-text {
    font-size: 14px;
    color: var(--text-primary);
}

.release-notes-content {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
    max-height: 300px;
}

.release-notes-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px;
}

.release-category {
    margin-bottom: 24px;
}

.release-category:last-child {
    margin-bottom: 0;
}

.release-category-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
    transition: background 0.2s;
}

.release-category-title:hover {
    background: var(--bg-hover);
}

.release-category-count {
    font-weight: 400;
    font-size: 14px;
    color: var(--text-secondary);
}

.release-category-chevron {
    font-size: 12px;
    color: var(--text-muted);
}

.release-category-icon {
    font-size: 18px;
}

.release-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.release-item {
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border-left: 3px solid #315efd;
}

.release-category-title[style*="color: rgb(40, 167, 69)"] + .release-items .release-item,
.release-category:first-child .release-item {
    border-left-color: #28a745;
}

.release-category:nth-child(3) .release-item {
    border-left-color: #fd7e14;
}

.release-item-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.release-item-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.release-notes-footer {
    padding: 16px 24px 24px;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.release-notes-button {
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.release-notes-button:hover {
    background: var(--color-primary-dark);
}

/* Responsive adjustments for release notes */
@media (max-width: 600px) {
    .release-notes-modal {
        max-height: 90vh;
        margin: 10px;
    }

    .release-notes-header {
        padding: 20px 20px 12px;
    }

    .release-notes-title {
        font-size: 24px;
    }

    .release-notes-content {
        padding: 16px 20px;
    }

    .release-notes-footer {
        padding: 12px 20px 20px;
    }
}


/* Source: 25-lists.css */
/* =============================================================================
   List input styles (email, phone)
   
   Source: styles.css lines 6667-6776
   ============================================================================= */

/* =============================================================================
   List Input Styles (email-list, phone-list)
   ============================================================================= */

.list-input-wrapper {
    margin-bottom: 16px;
}

.list-input-wrapper > label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.list-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}

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

.list-item input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
}

.list-item input:focus {
    outline: none;
    border-color: #315efd;
    box-shadow: 0 0 0 2px rgba(49, 94, 253, 0.1);
}

.list-remove-btn {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 4px !important;
    background: #fef3c7 !important;
    color: #d97706 !important;
    font-size: 18px !important;
    font-weight: bold;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    margin: 0 !important;
}

.list-remove-btn:hover {
    background: #fde68a !important;
}

.list-add-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.list-add-row input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
}

.list-add-row input:focus {
    outline: none;
    border-color: #315efd;
    box-shadow: 0 0 0 2px rgba(49, 94, 253, 0.1);
}

.list-add-btn {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 4px !important;
    background: #dcfce7 !important;
    color: #16a34a !important;
    font-size: 18px !important;
    font-weight: bold;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    margin: 0 !important;
}

.list-add-btn:hover {
    background: #bbf7d0 !important;
}


/* Source: 30-dashboard.css */
/* =============================================================================
   KPI Dashboard (Syphon)
   
   Source: styles.css lines 4384-4764
   ============================================================================= */

/* =========================================
   Syphon KPI Dashboard Styles
   ========================================= */

.dashboard-container {
    max-width: 95vw;
    height: calc(100vh - 95px);
    margin: 2px auto;
    padding: 6px 10px 12px 10px;
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(49,94,253,0.06);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.dashboard-header {
    display: flex;
    justify-content: space-around;
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
}

/* Loading overlay */
.loading-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    margin: 20px 0;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e8eef7;
    border-top-color: #315efd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    margin-top: 20px;
    font-size: 1.2em;
    font-weight: 600;
    color: var(--color-primary);
}

.loading-subtext {
    margin-top: 8px;
    font-size: 0.9em;
    color: var(--text-muted);
}

.refresh-btn {
    background: var(--color-primary);
    color: var(--text-inverse);
    border: none;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.refresh-btn:hover {
    background: var(--color-primary-dark);
}

.refresh-btn:disabled {
    background: #a0b4f7;
    cursor: not-allowed;
}

.button-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 4px;
}

.refreshing-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: 8px;
}

.dashboard-container {
    position: relative;
}

.kpi-row {
    display: grid;
    grid-template-columns: repeat(8, minmax(100px, 1fr));
    gap: 4px;
    margin-bottom: 4px;
    overflow-x: auto;
    white-space: nowrap;
    flex-shrink: 0;
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 2px 4px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(49,94,253, 0.03);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 48px;
}

.kpi-label {
    font-size: 0.85em;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 0;
    white-space: normal;
    line-height: 1.1;
}

.kpi-date {
    font-size: 0.6em;
    color: var(--text-muted);
    margin-bottom: 2px;
    white-space: nowrap;
}

.kpi-value {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--color-primary);
    white-space: nowrap;
}

.kpi-percent {
    font-size: 0.7em;
    margin-top: 1px;
    white-space: nowrap;
}

.percent-positive {
    color: var(--color-success);
}

.percent-negative {
    color: var(--color-danger);
}

.percent-neutral {
    color: var(--text-muted);
}

.kpi-sub-values {
    font-size: 0.8em;
    color: var(--text-muted);
    margin-top: 4px;
}

.kpi-sub-value {
    font-size: 0.7em;
    color: var(--text-muted);
    white-space: nowrap;
}

.charts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 6px;
    margin-bottom: 8px;
    height: 17vh;
    min-height: 95px;
}

.charts-row:last-of-type {
    margin-bottom: 4px;
    height: 15vh;
    min-height: 85px;
}

.chart-container {
    background: var(--bg-card);
    border-radius: 8px;
    box-shadow: 0 1px 8px rgba(80,80,80,0.09);
    padding: 4px 6px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.chart-container.has-chart {
    height: 100%;
    padding-bottom: 28px;
}

.chart-header {
    font-size: 0.75em;
    color: var(--text-primary);
    margin-bottom: 1px;
    font-weight: bold;
    flex-shrink: 0;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    margin-bottom: 2px;
    flex-shrink: 0;
}

.content-card {
    background: #f4f8fe;
    border-radius: 6px;
    padding: 10px;
    text-align: center;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.content-card img {
    max-height: 200px;
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    margin-bottom: 6px;
}

.content-metric {
    font-size: 0.6em;
    color: var(--text-muted);
    margin-top: 0;
}

/* Hide redundant page header when dashboard is present */
.page-container:has(.dashboard-container) > .home-page-header {
    display: none;
}

/* Responsive adjustments for KPI Dashboard */
@media (max-width: 1024px) {
    .dashboard-container {
        max-width: 98vw;
        padding: 4px;
        margin: 2px auto;
    }
    .kpi-row {
        grid-template-columns: repeat(8, minmax(90px, 1fr));
        gap: 3px;
        margin-bottom: 4px;
    }
    .kpi-card {
        padding: 2px 4px;
        min-height: 45px;
    }
    .kpi-label {
        font-size: 0.7em;
    }
    .kpi-date {
        font-size: 0.5em;
    }
    .kpi-value {
        font-size: 0.95em;
    }
    .kpi-percent {
        font-size: 0.6em;
    }
    .charts-row {
        gap: 4px;
        margin-bottom: 4px;
    }
    .chart-container {
        padding: 4px;
    }
    .chart-container.has-chart {
        padding-bottom: 24px;
    }
    .content-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 3px;
        margin-bottom: 2px;
    }
    .content-card {
        padding: 4px;
        min-height: 50px;
    }
    .content-card img {
        max-height: 60px;
        max-width: 100%;
    }
    .content-metric {
        font-size: 0.55em;
    }
}

@media (max-width: 768px) {
    .kpi-row {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 6px;
        margin-bottom: 12px;
    }
    .kpi-card {
        min-width: 100px;
        padding: 6px;
        min-height: 50px;
    }
    .kpi-label {
        font-size: 0.75em;
    }
    .kpi-date {
        font-size: 0.6em;
    }
    .kpi-value {
        font-size: 1em;
    }
    .kpi-percent {
        font-size: 0.7em;
    }
    .charts-row {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 10px;
        height: auto;
        min-height: auto;
    }
    .chart-container {
        padding: 8px;
    }
    .chart-container.has-chart {
        height: 180px;
        padding-bottom: 25px;
    }
    .content-grid {
        grid-template-columns: 1fr;
        gap: 3px;
        margin-bottom: 3px;
    }
    .content-card {
        padding: 4px;
        min-height: 50px;
    }
    .content-card img {
        max-height: 70px;
        max-width: 100%;
    }
    .content-metric {
        font-size: 0.6em;
    }
}

@media (max-width: 480px) {
    .kpi-row {
        gap: 4px;
    }
    .kpi-card {
        min-width: 80px;
        padding: 4px;
    }
    .kpi-label {
        font-size: 0.65em;
        line-height: 1.2;
    }
    .kpi-value {
        font-size: 0.9em;
    }
    .kpi-percent {
        font-size: 0.6em;
    }
}


/* Source: 30a-workflow-base.css */
/* =============================================================================
   Workflow and Kanban base styles
   
   Source: styles.css lines 3729-3865
   ============================================================================= */

/* =============================================================================
   Workflow & Kanban Styles
   ============================================================================= */

/* Kanban Board */
.kanban-board {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 8px 0;
    height: calc(100vh - 280px);
}

/* Kanban Column */
.kanban-column {
    flex: 0 0 280px;
    min-width: 280px;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    max-height: 100%;
}

.kanban-column.not-started-column {
    border: 2px dashed var(--border-color);
    background-color: var(--bg-secondary);
}

/* Column Header */
.kanban-column .column-header {
    padding: 12px 16px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kanban-column .column-header .instance-count,
.kanban-column .column-header .entity-count {
    background-color: rgba(0, 0, 0, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
}

/* Column Filter */
.kanban-column .column-filter {
    padding: 8px;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
}

.kanban-column .column-filter input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 12px;
    box-sizing: border-box;
}

/* Column Cards Container */
.kanban-column .column-cards {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

/* Kanban Card */
.kanban-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.2s, transform 0.2s;
}

.kanban-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.kanban-card.entity-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
}

.kanban-card.entity-card.selected {
    background-color: var(--color-info-bg);
    border: 2px solid var(--color-primary);
}

.kanban-card .card-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.kanban-card .card-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
}

.kanban-card .card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Bulk Actions Bar */
.kanban-column .bulk-actions {
    padding: 8px;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

/* Empty Column Message */
.kanban-column .empty-column {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}


/* Source: 30d-graph-workflow.css */
/* Graph Workflow - State Machine Diagram */
.sm-diagram {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.sm-diagram-header { margin-bottom: 1rem; }
.sm-title { font-size: 1rem; font-weight: 600; margin: 0 0 0.25rem; }
.sm-subtitle { font-size: 0.8rem; color: var(--text-muted); margin: 0; }

.sm-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 0.5rem;
  align-items: start;
}

.sm-col-header {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.25rem 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.sm-node {
  border: 2px solid;
  border-radius: 20px;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.2rem 0;
}

.sm-node-badge {
  font-size: 0.7rem;
  opacity: 0.8;
  font-weight: 400;
}

.sm-badge-current { font-weight: 700; }

.sm-transitions {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.2rem 0;
}

.sm-transition {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
}

.sm-transition-arrow { color: var(--text-muted); }
.sm-transition-label { font-weight: 500; }
.sm-transition-target { color: var(--text-muted); font-size: 0.75rem; }
.sm-no-transitions { font-size: 0.8rem; color: var(--text-muted); font-style: italic; }

/* Graph Wizard */
.graph-wizard {
  max-width: 800px;
  margin: 0 auto;
  padding: 1.5rem;
}

.gw-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.gw-header-left {}
.gw-title { font-size: 1.25rem; font-weight: 600; margin: 0 0 0.5rem; }

.gw-current-node {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 2px solid;
  border-radius: 20px;
  padding: 0.3rem 0.8rem;
  font-size: 0.9rem;
}

.gw-node-label { font-weight: 400; }
.gw-terminal-badge {
  background: var(--text-muted);
  color: #fff;
  border-radius: 4px;
  padding: 0 0.4rem;
  font-size: 0.7rem;
  margin-left: 0.25rem;
}

.gw-close-btn {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 0.3rem 0.8rem;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
}

.gw-diagram-section { margin-bottom: 1.5rem; }

.gw-transitions-section {}
.gw-transitions-title { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; }
.gw-transitions-list { display: flex; flex-direction: column; gap: 1rem; }

.gw-transition-card {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  background: var(--bg-primary);
}

.gw-transition-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.gw-transition-event {
  font-family: monospace;
  font-size: 0.8rem;
  background: var(--bg-secondary);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
}

.gw-transition-arrow { color: var(--text-muted); }

.gw-transition-target { font-weight: 600; }
.gw-transition-label { font-size: 0.85rem; color: var(--text-muted); margin: 0 0 0.75rem; }

.gw-form { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 0.75rem; }
.gw-field { display: flex; flex-direction: column; gap: 0.25rem; }
.gw-field-label { font-size: 0.85rem; font-weight: 500; }
.gw-required { color: var(--danger); }

.gw-input {
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 0.4rem 0.6rem;
  font-size: 0.9rem;
  background: var(--bg-primary);
  color: var(--text-primary);
  width: 100%;
}

.gw-textarea { min-height: 80px; resize: vertical; }

.gw-fire-btn {
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.5rem;
}

.gw-fire-btn:hover { opacity: 0.9; }

.gw-terminal-msg {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  color: var(--text-muted);
}

.gw-no-transitions {
  color: var(--text-muted);
  font-style: italic;
}

/* Source: 31-dashboard-lfp.css */
/* =============================================================================
   LFP-specific dashboard components
   
   Source: styles.css lines 4765-5147
   ============================================================================= */

/* =============================================================================
   LFP Dashboard Components
   ============================================================================= */

/* Disposition Grid */
.disposition-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 8px;
}

.disposition-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.disposition-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
}

.disposition-label {
    font-size: 0.75em;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

.disposition-value {
    font-size: 1.1em;
    font-weight: 700;
    color: var(--text-primary);
}

.disposition-pct {
    font-size: 0.7em;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Airline Charts */
.airline-chart {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
}

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

.airline-name {
    flex: 0 0 100px;
    font-size: 0.75em;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.airline-bar-container {
    flex: 1;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
}

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

.airline-count,
.airline-revenue {
    flex: 0 0 60px;
    text-align: right;
    font-size: 0.8em;
    font-weight: 600;
    color: var(--text-primary);
}

.airline-sold {
    flex: 0 0 50px;
    text-align: right;
    font-size: 0.7em;
    color: var(--text-muted);
}

/* Stage Grid */
.stage-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px;
}

.stage-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-radius: 6px;
    min-width: 80px;
}

.stage-name {
    font-size: 0.7em;
    color: var(--text-muted);
    text-transform: capitalize;
}

.stage-count {
    font-size: 1.1em;
    font-weight: 700;
    color: var(--text-primary);
}

/* Pending Workflows Grid */
.pending-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 8px;
}

.pending-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px;
    background: var(--bg-secondary);
    border-radius: 6px;
}

.pending-label {
    font-size: 0.75em;
    color: var(--text-primary);
    text-align: center;
    font-weight: 600;
    line-height: 1.4;
}

.pending-count {
    font-size: 1.2em;
    font-weight: 700;
    color: var(--text-primary);
}

/* Listings Grid */
.listings-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 8px;
}

.listing-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px;
}

.listing-value {
    font-size: 1.1em;
    font-weight: 700;
    color: var(--text-primary);
}

.listing-label {
    font-size: 0.7em;
    color: var(--text-muted);
    text-align: center;
}

/* LFP Dashboard Mobile Breakpoints */
@media (max-width: 768px) {
    .disposition-grid,
    .pending-grid,
    .listings-grid {
        grid-template-columns: repeat(2, 1fr);  /* 2x2 instead of 1x4 */
        gap: 6px;
        padding: 8px;
    }

    .airline-name {
        flex: 0 0 80px;  /* Narrower but still readable */
    }

    .airline-revenue,
    .airline-count {
        flex: 0 0 50px;
    }

    .airline-sold {
        display: none;  /* Hide "X sold" on mobile - less critical */
    }
}

@media (max-width: 480px) {
    .disposition-grid,
    .pending-grid,
    .listings-grid {
        grid-template-columns: 1fr 1fr;  /* Keep 2-column for very small */
        gap: 8px;
        padding: 8px;
    }

    .disposition-item {
        flex-direction: row;
        justify-content: flex-start;
        gap: 8px;
    }

    .disposition-label {
        font-size: 0.8em;
        color: var(--text-primary);
    }

    .disposition-value {
        font-size: 1.1em;
        font-weight: 700;
    }

    .pending-item {
        padding: 10px 8px;
    }

    .pending-label {
        font-size: 0.8em;
        color: var(--text-primary);
        font-weight: 600;
    }

    .pending-count {
        font-size: 1.3em;
    }

    .listing-label {
        font-size: 0.7em;
    }

    .listing-value {
        font-size: 1em;
    }

    /* Improved airline chart readability at 480px */
    .airline-name {
        flex: 0 0 70px;
        font-size: 0.75em;
        font-weight: 500;
    }

    .airline-bar-container {
        min-width: 40px;
    }

    .airline-revenue,
    .airline-count {
        flex: 0 0 50px;
        font-size: 0.8em;
        font-weight: 600;
    }
}

/* Very narrow screens (375px and below) - stack airline rows */
@media (max-width: 375px) {
    /* Airline charts - vertical stack layout */
    .airline-row {
        flex-wrap: wrap;
        gap: 4px;
    }

    .airline-name {
        flex: 1 0 100%;  /* Full width on own line */
        font-size: 0.8em;
        font-weight: 500;
    }

    .airline-bar-container {
        flex: 1;
        min-width: 60px;
    }

    .airline-count,
    .airline-revenue {
        flex: 0 0 auto;
        font-size: 0.85em;
        font-weight: 600;
    }

    /* Active Workflows - better visibility */
    .pending-label {
        font-size: 0.8em;
        color: var(--text-primary);
        font-weight: 600;
    }

    .pending-count {
        font-size: 1.4em;
    }

    .pending-item {
        padding: 12px 8px;
    }
}

/* Location List Input Styles */
.location-list-input {
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.location-list-input .location-field {
    margin-bottom: 12px;
}

.location-list-input .location-field:last-of-type {
    margin-bottom: 0;
}

.location-list-input input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    background: var(--bg-card);
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.location-list-input input[type="text"]:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2);
}

.location-list-input .stops-container {
    margin: 12px 0;
    padding-left: 16px;
    border-left: 3px solid var(--color-primary);
}

.location-list-input .add-stop-btn {
    padding: 8px 20px;
    background: var(--bg-info);
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    box-shadow: none;
}

.location-list-input .add-stop-btn:hover {
    background: var(--color-primary);
    color: white;
}

.location-list-input .remove-stop-btn {
    padding: 6px 12px;
    background: var(--color-danger);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    transition: background 0.2s;
    box-shadow: none;
}

.location-list-input .remove-stop-btn:hover {
    background: var(--color-danger);
}

/* City suggestions dropdown */
.city-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    list-style: none;
    margin: 0;
    padding: 0;
}

.city-suggestions li {
    padding: 8px 12px;
    cursor: pointer;
}

.city-suggestions li:hover {
    background: var(--bg-secondary);
}

/* Stop label */
.location-list-input .stop-label {
    font-weight: 500;
    margin-bottom: 4px;
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
}

/* Trip Route Map Styles */
.trip-route-map-container {
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.trip-route-map-container table {
    margin-bottom: 12px;
}

.trip-route-map-container table thead tr {
    background: var(--bg-secondary) !important;
}

.trip-route-map-container table th,
.trip-route-map-container table td {
    padding: 6px 8px;
    border: 1px solid var(--border-color);
}

/* Route summary in table cells */
.route-summary {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Map marker animation for loading state */
@keyframes pulse-marker {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}


/* Source: 31-smart-note.css */
/**
 * Smart Note Chat - AI-powered note generation overlay
 * Used by Full Spectrum Psychology mobile note creation
 */

/* =============================================================================
   Chat Overlay Animation
   ============================================================================= */

@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.4;
  }
  50% {
    opacity: 1;
  }
}

/* =============================================================================
   Chat Overlay Container
   ============================================================================= */

.smart-note-chat-overlay {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  top: 30%;
  background: var(--bg-card);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  animation: slideUp 0.3s ease-out;
}

/* =============================================================================
   Chat Header
   ============================================================================= */

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}

.chat-header .fa-magic {
  color: #9c27b0;
  font-size: 18px;
}

/* =============================================================================
   Messages Container
   ============================================================================= */

.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  padding-bottom: 100px;  /* Scroll buffer for input + apply button areas */
  display: flex;
  flex-direction: column;
}

/* =============================================================================
   Message Bubbles
   ============================================================================= */

.smart-note-message {
  max-width: 85%;
  padding: 10px 14px;
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.4;
}

.smart-note-message.user {
  align-self: flex-end;
  background: #1976d2;
  color: white;
  border-radius: 16px 16px 4px 16px;
}

.smart-note-message.assistant {
  align-self: flex-start;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-radius: 16px 16px 16px 4px;
}

/* =============================================================================
   Loading Indicator
   ============================================================================= */

.smart-note-loading {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  margin-bottom: 8px;
  align-self: flex-start;
}

.smart-note-loading div {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: pulse 1s infinite;
}

.smart-note-loading div:nth-child(2) {
  animation-delay: 0.2s;
}

.smart-note-loading div:nth-child(3) {
  animation-delay: 0.4s;
}

/* =============================================================================
   Note Preview
   ============================================================================= */

.note-preview {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
}

.note-section-card {
  background: var(--bg-card);
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.note-section-card:last-child {
  margin-bottom: 0;
}

/* =============================================================================
   Chat Input
   ============================================================================= */

.chat-input-container {
  padding: 12px 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.chat-input-container textarea {
  flex: 1;
  min-height: 40px;
  max-height: 100px;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 14px;
  resize: none;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: inherit;
}

.chat-input-container textarea:focus {
  outline: none;
  border-color: #1976d2;
}

.chat-input-container button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s;
}

.chat-input-container button:disabled {
  cursor: not-allowed;
  background: var(--bg-secondary);
  color: var(--text-muted);
}

.chat-input-container button:not(:disabled) {
  background: #1976d2;
  color: white;
}

.chat-input-container button:not(:disabled):hover {
  background: #1565c0;
}

/* =============================================================================
   AI Generate Button (in note form)
   ============================================================================= */

.ai-generate-button {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #9c27b0 0%, #673ab7 100%);
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 2px 8px rgba(156, 39, 176, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}

.ai-generate-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(156, 39, 176, 0.4);
}

.ai-generate-button:active {
  transform: translateY(0);
}

/* =============================================================================
   Dark Mode Adjustments
   ============================================================================= */

.dark .smart-note-chat-overlay {
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}

.dark .smart-note-message.assistant {
  background: var(--bg-tertiary, #2d2d2d);
}

.dark .note-preview {
  background: var(--bg-tertiary, #2d2d2d);
}

/* =============================================================================
   Responsive Adjustments
   ============================================================================= */

@media (min-width: 768px) {
  .smart-note-chat-overlay {
    max-width: 500px;
    left: auto;
    right: 20px;
    border-radius: 20px;
    bottom: 20px;
    top: auto;
    max-height: 70vh;
  }
}

/* =============================================================================
   Desktop Smart Note Panel
   ============================================================================= */

.ai-generate-section {
  margin-bottom: 20px;
}

/* Panel Overlay - covers the whole screen with semi-transparent backdrop */
.smart-note-panel-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1000;
  display: flex;
  justify-content: flex-end;
}

/* Panel - slides in from right */
.smart-note-panel {
  width: 450px;
  max-width: 90vw;
  height: 100%;
  background: var(--bg-card);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  animation: slideInRight 0.3s ease-out;
}

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

/* Panel Header */
.smart-note-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.smart-note-panel-header .header-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.smart-note-panel-header .header-title .fa-magic {
  color: #9c27b0;
  font-size: 20px;
}

.smart-note-panel-header .header-title span {
  font-weight: 600;
  font-size: 18px;
  color: var(--text-primary);
}

.smart-note-panel-header .close-btn {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: var(--text-secondary);
  border-radius: 4px;
  transition: background-color 0.2s;
}

.smart-note-panel-header .close-btn:hover {
  background: var(--bg-tertiary, rgba(0, 0, 0, 0.05));
}

.smart-note-panel-header .close-btn .fa-times {
  font-size: 18px;
}

/* Panel Messages */
.smart-note-panel-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Note Preview in Panel */
.smart-note-panel .note-preview {
  margin-top: 16px;
}

.smart-note-panel .note-preview-title {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.smart-note-panel .note-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  color: white;
}

.smart-note-panel .note-section-header .fa {
  font-size: 14px;
}

.smart-note-panel .note-section-header span {
  font-weight: 500;
  font-size: 13px;
}

.smart-note-panel .note-section-content {
  padding: 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-primary);
  white-space: pre-wrap;
}

/* Panel Input */
.smart-note-panel-input {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.smart-note-panel-input textarea {
  flex: 1;
  min-height: 44px;
  max-height: 120px;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  resize: none;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: inherit;
}

.smart-note-panel-input textarea:focus {
  outline: none;
  border-color: #1976d2;
  box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.1);
}

.smart-note-panel-input .send-btn {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.smart-note-panel-input .send-btn:disabled {
  cursor: not-allowed;
  background: var(--bg-secondary);
  color: var(--text-muted);
}

.smart-note-panel-input .send-btn:not(:disabled) {
  background: #1976d2;
  color: white;
}

.smart-note-panel-input .send-btn:not(:disabled):hover {
  background: #1565c0;
}

/* Panel Actions */
.smart-note-panel-actions {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
}

.smart-note-panel-actions .apply-btn {
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-radius: 8px;
  background: #4caf50;
  color: white;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background-color 0.2s;
}

.smart-note-panel-actions .apply-btn:hover {
  background: #43a047;
}

/* Dark Mode for Desktop Panel */
.dark .smart-note-panel-overlay {
  background: rgba(0, 0, 0, 0.6);
}

.dark .smart-note-panel {
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.4);
}

.dark .smart-note-panel-header .close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Source: 32-dashboard-interactions.css */
/* =============================================================================
   Dashboard interactions panel
   
   Source: styles.css lines 5148-5288
   ============================================================================= */

/* =============================================================================
   Latest Interactions Dashboard Panel
   ============================================================================= */

.timeline-tile {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}

.timeline-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.timeline-actions {
    display: flex;
    gap: 8px;
}

.timeline-actions .btn-primary,
.timeline-actions .btn-secondary {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 4px;
}

.timeline-actions .btn-secondary {
    background: #6c757d;
}

.timeline-actions .btn-secondary:hover {
    background: #5a6268;
}

.interaction-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 450px;
    overflow-y: auto;
}

.interaction-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.interaction-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-color: var(--border-color);
}

.interaction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.interaction-type {
    font-weight: 600;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.interaction-type.type-email { color: #1976d2; }
.interaction-type.type-sms { color: #388e3c; }

.interaction-time {
    font-size: 12px;
    color: var(--text-secondary);
}

.interaction-meta {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 12px;
}

.interaction-meta .direction {
    font-weight: 500;
}

.direction.dir-inbound { color: #0288d1; }
.direction.dir-outbound { color: #7b1fa2; }

.interaction-meta .status {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.status.status-sent { background: #e3f2fd; color: #1565c0; }
.status.status-delivered { background: #e8f5e9; color: #2e7d32; }
.status.status-received { background: #f3e5f5; color: #7b1fa2; }
.status.status-scheduled { background: #fff3e0; color: #ef6c00; }
.status.status-failed { background: #ffebee; color: #c62828; }

.interaction-subject {
    font-weight: 500;
    font-size: 13px;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.interaction-body {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.timeline-tile .no-data {
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    padding: 30px 20px;
    background: var(--bg-secondary);
    border-radius: 8px;
}


/* Source: 32a-communications-tile.css */
/* =============================================================================
   Communications Tile — chat feed + inline compose
   Chat bubbles reuse 37-chat.css classes
   ============================================================================= */

.comms-tile {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.comms-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    flex-shrink: 0;
}

.comms-mode-toggle {
    display: flex;
    gap: 4px;
}

.comms-mode-btn {
    padding: 3px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.75em;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.comms-mode-btn:hover {
    background: var(--bg-hover);
}

.comms-mode-btn.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.comms-mode-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Feed area */
.comms-feed {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    padding: 4px 2px;
}

.comms-feed::-webkit-scrollbar {
    width: 4px;
}

.comms-feed::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

.comms-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-size: 0.85em;
}

/* Input area */
.comms-input-area {
    flex-shrink: 0;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    margin-bottom: 4px;
}

.comms-subject-input {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.8em;
    margin-bottom: 4px;
    box-sizing: border-box;
}

.comms-input-row {
    display: flex;
    gap: 6px;
    align-items: flex-end;
}

.comms-textarea {
    flex: 1;
    resize: none;
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.8em;
    min-height: 36px;
    max-height: 80px;
    box-sizing: border-box;
    font-family: inherit;
}

.comms-send-btn {
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    background: var(--color-primary);
    color: white;
    font-size: 0.8em;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

.comms-send-btn:hover {
    filter: brightness(1.1);
}

.comms-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.comms-warning {
    font-size: 0.75em;
    color: var(--text-muted);
    padding: 4px 0 0;
}

/* Compact chat bubbles inside tile */
.comms-feed .chat-bubble {
    padding: 6px 10px;
    margin-bottom: 6px;
    font-size: 0.82em;
}

.comms-feed .chat-type-badge {
    font-size: 0.65em;
}

.comms-feed .chat-timestamp {
    font-size: 0.7em;
}

.comms-feed .chat-body {
    font-size: 0.85em;
}

/* Source: 32b-contacts-tile.css */
/* =============================================================================
   Contacts Tile — multi-contact management per customer
   ============================================================================= */

.contacts-tile {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.contacts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    flex-shrink: 0;
}

.contact-add-btn {
    padding: 2px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.75em;
    cursor: pointer;
    transition: background 0.15s;
}

.contact-add-btn:hover {
    background: var(--bg-hover);
}

/* Contact list */
.contacts-list {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    padding: 2px;
}

.contacts-list::-webkit-scrollbar {
    width: 4px;
}

.contacts-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

.contacts-empty {
    color: var(--text-muted);
    font-size: 0.85em;
    text-align: center;
    padding: 16px 0;
}

/* Contact card */
.contact-card {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 6px;
    background: var(--bg-secondary);
    transition: border-color 0.15s;
}

.contact-card.primary {
    border-left: 3px solid var(--color-primary);
}

.contact-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4px;
}

.contact-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.contact-star {
    color: #f5a623;
    font-size: 0.9em;
}

.contact-role-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 0.65em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-hover);
    color: var(--text-secondary);
}

.contact-role-badge.role-owner { background: #e3f2fd; color: #1565c0; }
.contact-role-badge.role-billing { background: #e8f5e9; color: #2e7d32; }
.contact-role-badge.role-legal { background: #fff3e0; color: #e65100; }
.contact-role-badge.role-front-office { background: #f3e5f5; color: #7b1fa2; }
.contact-role-badge.role-driver { background: #e0f2f1; color: #00695c; }

.contact-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.contact-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 4px;
    font-size: 0.8em;
    color: var(--text-muted);
    border-radius: 3px;
    transition: background 0.15s, color 0.15s;
}

.contact-action-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.contact-action-btn.danger:hover {
    color: #d32f2f;
}

.contact-title {
    font-size: 0.78em;
    color: var(--text-secondary);
    margin-bottom: 3px;
}

.contact-detail {
    font-size: 0.78em;
    color: var(--text-secondary);
    padding: 1px 0;
}

.contact-detail-icon {
    margin-right: 4px;
}

/* Contact form */
.contact-form {
    border: 1px solid var(--color-primary);
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 8px;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.contact-input {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.8em;
    box-sizing: border-box;
}

.contact-checkbox {
    font-size: 0.8em;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.contact-form-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.contact-save-btn {
    padding: 4px 14px;
    border: none;
    border-radius: 4px;
    background: var(--color-primary);
    color: white;
    font-size: 0.8em;
    cursor: pointer;
}

.contact-save-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.contact-cancel-btn {
    padding: 4px 14px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.8em;
    cursor: pointer;
}

.contact-confirm-delete {
    font-size: 0.75em;
    color: #d32f2f;
    padding: 4px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Customer info summary at bottom */
.contact-customer-info {
    border-top: 1px solid var(--border-color);
    padding-top: 8px;
    padding-left: 10px;
    margin-top: 8px;
    flex-shrink: 0;
}

/* Communications tile: contact selector */
.comms-contact-selector {
    flex-shrink: 0;
    padding-bottom: 6px;
}

.comms-contact-select {
    width: 100%;
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.8em;
    box-sizing: border-box;
}

/* Contact label on chat bubbles */
.chat-contact-label {
    font-size: 0.7em;
    color: var(--text-muted);
    font-style: italic;
    margin-left: 6px;
}

/* Source: 33-workflow.css */
/* =============================================================================
   Workflow components
   
   Source: styles.css lines 9131-9231
   ============================================================================= */

/* =============================================================================
   Workflow Components - Kanban, Wizard, Filter Bar
   ============================================================================= */

/* Workflow Page Layout */
.workflow-page {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.workflow-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-primary);
}

.workflow-header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.workflow-header-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.workflow-header h1 {
    margin: 0;
    color: var(--text-primary);
}

.workflow-header-subtitle {
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
}

/* Workflow Filter Bar */
.workflow-filter-bar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.workflow-filter-main {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
}

.workflow-filter-bar .my-items-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-primary);
}

.workflow-filter-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.workflow-filter-field > span {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
}

.workflow-filter-bar .workflow-filter-field select,
.workflow-filter-bar .workflow-filter-field input[type="text"] {
    padding: 8px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
    color: var(--text-primary);
    min-width: 120px;
}

.workflow-filter-bar .workflow-search-field .filter-search {
    width: 260px;
}

.workflow-filter-bar .hide-empty-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    cursor: pointer;
    margin-left: auto;
}

.workflow-filter-bar .filter-chip-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 20px;
    border-radius: 10px;
    padding: 0 8px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
}

.workflow-filter-bar .clear-filters {
    padding: 8px 16px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-primary);
}

.workflow-filter-bar .clear-filters:hover {
    background-color: var(--bg-secondary);
}

.workflow-filter-bar .clear-filters.disabled,
.workflow-filter-bar .clear-filters:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.workflow-filter-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-results-count {
    color: var(--text-secondary);
    font-size: 12px;
    white-space: nowrap;
}

.workflow-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.workflow-filter-bar .filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 4px 10px;
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 12px;
}

.workflow-filter-bar .filter-chip:hover {
    background: var(--bg-secondary);
}

/* Stage Summary */
.workflow-stage-summary {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-primary);
}

.workflow-metric-card {
    border: 1px solid var(--border-color);
    border-top: 3px solid var(--color-primary);
    border-radius: 8px;
    padding: 10px;
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 74px;
}

.workflow-metric-card.not-started {
    border-top-color: var(--text-muted);
}

.workflow-metric-card.is-empty {
    opacity: 0.7;
}

.workflow-metric-card .metric-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}

.workflow-metric-card .metric-value {
    font-size: 24px;
    line-height: 1;
    color: var(--text-primary);
    font-weight: 700;
}

.workflow-metric-card .metric-meta {
    font-size: 11px;
    color: var(--text-muted);
}

/* Workflow Content */
.workflow-content {
    flex: 1;
    overflow: auto;
    padding: 16px;
}

/* View Toggle Button */
.view-toggle {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.view-toggle button {
    padding: 8px 16px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.view-toggle button.active,
.view-toggle button:hover {
    background-color: var(--color-primary);
    color: var(--text-inverse);
    border-color: var(--color-primary);
}

/* Workflow Table */
.workflow-table-wrapper {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
    overflow: hidden;
}

.workflow-table {
    width: 100%;
    border-collapse: collapse;
}

.workflow-table th,
.workflow-table td {
    border-bottom: 1px solid var(--border-color);
    padding: 10px 12px;
    text-align: left;
    color: var(--text-primary);
}

.workflow-table th {
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--bg-secondary);
}

.workflow-table tbody tr:last-child td {
    border-bottom: none;
}

.workflow-table-row {
    cursor: pointer;
}

.workflow-table-row:hover {
    background: var(--bg-hover);
}

.table-primary {
    font-weight: 600;
    color: var(--text-primary);
}

.table-secondary {
    color: var(--text-secondary);
    font-size: 12px;
    margin-top: 2px;
}

.workflow-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid transparent;
}

.workflow-status-badge.status-active {
    background: var(--color-info-bg);
    color: var(--color-info);
    border-color: var(--color-info);
}

.workflow-status-badge.status-completed {
    background: var(--color-success-bg);
    color: var(--color-success);
    border-color: var(--color-success);
}

.workflow-status-badge.status-cancelled {
    background: var(--color-danger-bg);
    color: var(--color-danger);
    border-color: var(--color-danger);
}

.workflow-empty-state {
    padding: 40px 24px;
    text-align: center;
}

.workflow-empty-state h3 {
    margin: 0 0 8px;
}

.workflow-empty-state p {
    margin: 0;
    color: var(--text-secondary);
}

@media (max-width: 1024px) {
    .workflow-filter-bar .workflow-search-field .filter-search {
        width: 220px;
    }

    .workflow-filter-bar .hide-empty-toggle {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .workflow-header-content {
        flex-direction: column;
        align-items: stretch;
    }

    .view-toggle {
        width: 100%;
    }

    .view-toggle button {
        flex: 1;
    }

    .workflow-filter-bar .workflow-search-field .filter-search {
        width: 100%;
    }

    .workflow-filter-main {
        flex-direction: column;
        align-items: stretch;
    }

    .workflow-filter-field {
        width: 100%;
    }

    .workflow-filter-bar .workflow-filter-field select,
    .workflow-filter-bar .workflow-filter-field input[type="text"] {
        min-width: 0;
        width: 100%;
    }

    .workflow-table-wrapper {
        overflow-x: auto;
    }

    .workflow-table {
        min-width: 680px;
    }
}

/* Source: 34a-kanban.css */
/* =============================================================================
   Kanban board styles
   
   Source: styles.css lines 5289-5770
   ============================================================================= */

/* =============================================================================
   Kanban Board Styles
   ============================================================================= */

.kanban-simple {
    height: 100%;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.kanban-simple .kanban-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding: 0 4px;
    flex-shrink: 0;
}

.kanban-simple .kanban-header h2 {
    margin: 0;
}

.kanban-simple .kanban-header .kanban-btn {
    flex-shrink: 0;
    white-space: nowrap;
    margin-left: 12px;
}

.kanban-simple .kanban-columns {
    display: flex;
    flex: 1;
    overflow-x: auto;
    padding-bottom: 8px;
}

/* Kanban Column */
.kanban-column {
    flex: 1;
    min-width: 280px;
    max-width: 350px;
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 12px;
    margin-right: 12px;
    transition: background 0.2s;
}

.kanban-column.drag-over {
    background: var(--bg-hover);
}

.kanban-column .column-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
}

.kanban-column .column-header .column-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.kanban-column .column-header .column-count {
    margin-left: 8px;
    color: var(--text-inverse);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
}

.kanban-column .column-cards {
    min-height: 100px;
}

/* Kanban Card */
.kanban-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: box-shadow 0.2s;
}

.kanban-card:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.kanban-card .card-title {
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.kanban-card .card-meta {
    font-size: 12px;
    color: var(--text-secondary);
}

.kanban-card .card-meta .requester {
    margin-right: 8px;
}

.kanban-card .card-meta .timestamp {
    color: var(--text-muted);
}

/* Modal Overlay */
.kanban-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 1000;
    overflow-y: auto;
    padding: 100px 0 20px;
}

/* Modal Content */
.kanban-modal {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 24px;
    width: 500px;
    max-width: 90vw;
    flex-shrink: 0;
}

.kanban-modal h3 {
    margin: 0 0 20px 0;
}

.kanban-modal .form-group {
    margin-bottom: 16px;
}

.kanban-modal .form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
}

.kanban-modal .form-group select,
.kanban-modal .form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-sizing: border-box;
}

.kanban-modal .form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.kanban-modal .button-group {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Detail Panel */
.kanban-detail-panel {
    position: fixed;
    top: 93px;
    right: 40px;
    bottom: 0;
    width: 450px;
    background: var(--bg-card);
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.kanban-detail-panel .panel-header {
    padding: 16px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kanban-detail-panel .panel-header h3 {
    margin: 0;
}

.kanban-detail-panel .panel-header .close-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    box-shadow: none;
}

.kanban-detail-panel .panel-header .close-btn:hover {
    color: var(--text-primary);
    background: none;
    box-shadow: none;
}

.kanban-detail-panel .panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.kanban-detail-panel .panel-footer {
    padding: 12px 16px;
    border-top: 1px solid #eee;
    font-size: 12px;
    color: var(--text-muted);
}

.kanban-detail-panel .field-group {
    margin-bottom: 16px;
}

.kanban-detail-panel .field-label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
}

.kanban-detail-panel .field-value {
    margin-top: 4px;
}

.kanban-detail-panel .field-value.pre-wrap {
    white-space: pre-wrap;
}

.kanban-detail-panel .status-badge {
    color: var(--text-inverse);
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    display: inline-block;
}

.kanban-detail-panel .edit-buttons {
    margin-bottom: 24px;
}

.kanban-detail-panel .edit-buttons .button-group {
    display: flex;
    gap: 8px;
}

/* Comments Section */
.kanban-detail-panel .comments-section .comments-label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    margin-bottom: 8px;
    display: block;
}

.kanban-detail-panel .comment {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
}

.kanban-detail-panel .comment .comment-header {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.kanban-detail-panel .comment .comment-header strong {
    color: var(--text-primary);
}

.kanban-detail-panel .comment .comment-header .comment-time {
    margin-left: 8px;
}

.kanban-detail-panel .comment .comment-text {
    white-space: pre-wrap;
}

.kanban-detail-panel .add-comment {
    margin-top: 12px;
}

.kanban-detail-panel .add-comment textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    min-height: 60px;
    resize: vertical;
    box-sizing: border-box;
}

/* Kanban Buttons */
.kanban-btn {
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    box-shadow: none;
}

.kanban-btn:hover {
    box-shadow: none;
}

.kanban-btn.btn-primary {
    border: none;
    background: var(--color-info);
    color: var(--text-inverse);
}

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

.kanban-btn.btn-primary:disabled {
    background: #90caf9;
    cursor: not-allowed;
}

.kanban-btn.btn-secondary {
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
}

.kanban-btn.btn-secondary:hover {
    background: var(--bg-secondary);
}

.kanban-btn.btn-success {
    border: none;
    background: var(--color-success);
    color: var(--text-inverse);
}

.kanban-btn.btn-success:hover {
    background: var(--color-success);
}

.kanban-btn.btn-outline-primary {
    border: 1px solid var(--color-info);
    background: var(--bg-card);
    color: #2196f3;
}

.kanban-btn.btn-outline-primary:hover {
    background: var(--color-info-bg);
}

.kanban-btn.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.kanban-btn.btn-danger {
    background: var(--color-danger, #e53935);
    color: white;
}

.kanban-btn.btn-danger:hover {
    background: #c62828;
}

/* Conversation Reply Box */
.conversation-reply-box {
    border-top: 1px solid var(--border-color);
    padding: 12px;
    background: var(--bg-secondary);
}

.conversation-reply-box .type-selector {
    margin-bottom: 8px;
}

.conversation-reply-box .type-selector select {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
}

.conversation-reply-box .subject-input {
    width: 100%;
    margin-bottom: 8px;
    padding: 8px;
    box-sizing: border-box;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
}

.conversation-reply-box .message-textarea {
    width: 100%;
    margin-bottom: 8px;
    padding: 8px;
    resize: vertical;
    box-sizing: border-box;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.conversation-reply-box .send-button {
    background: var(--color-primary);
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    box-shadow: none;
}

.conversation-reply-box .send-button:hover {
    background: var(--color-primary-dark);
}

/* Attach button */
.conversation-reply-box .attach-button {
    padding: 6px 12px;
    margin-left: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-size: 16px;
}

.conversation-reply-box .attach-button:hover {
    background: var(--bg-hover);
}

/* Attachment preview area */
.conversation-reply-box .attachment-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
    padding: 8px;
    background: var(--bg-card);
    border: 1px dashed var(--border-color);
    border-radius: 4px;
}

.conversation-reply-box .attachment-item {
    position: relative;
    display: inline-block;
}

.conversation-reply-box .attachment-item img {
    max-width: 80px;
    max-height: 80px;
    border-radius: 4px;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

.conversation-reply-box .remove-attachment {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: var(--color-danger);
    color: white;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.conversation-reply-box .remove-attachment:hover {
    background: var(--color-danger);
}

/* File upload widget in create form */
.kanban-file-input {
    margin-top: 4px;
}

.kanban-file-input .uploading {
    color: var(--text-secondary);
    font-size: 13px;
}

.kanban-file-preview {
    position: relative;
    display: inline-block;
}

.kanban-file-preview img {
    max-width: 200px;
    max-height: 150px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    object-fit: cover;
}

.kanban-file-preview .remove-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: var(--color-danger, #e53935);
    color: white;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kanban-file-preview .remove-btn:hover {
    background: #c62828;
}

/* Card image thumbnail */
.kanban-card-image {
    margin-top: 8px;
}

.kanban-card-image img {
    max-width: 100%;
    max-height: 80px;
    border-radius: 4px;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

/* Card PDF thumbnail */
.kanban-card-pdf {
    margin-top: 8px;
    text-align: center;
}

.kanban-card-pdf .fa-file-pdf {
    font-size: 24px;
    color: #c62828;
}

/* Form PDF preview */
.kanban-pdf-preview {
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 4px;
    border: 1px solid var(--border-color);
    text-align: center;
    max-width: 200px;
}

.kanban-pdf-preview .fa-file-pdf {
    font-size: 32px;
    color: #c62828;
    display: block;
    margin-bottom: 4px;
}

.kanban-pdf-preview .pdf-filename {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
    word-break: break-all;
}

/* Detail panel PDF */
.detail-pdf {
    text-align: center;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 4px;
    border: 1px solid var(--border-color);
    margin-top: 4px;
    cursor: pointer;
}

.detail-pdf:hover {
    opacity: 0.9;
}

.detail-pdf .fa-file-pdf {
    font-size: 48px;
    color: #c62828;
    display: block;
    margin-bottom: 8px;
}

.detail-pdf .pdf-filename {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Detail panel image */
.detail-image {
    max-width: 100%;
    border-radius: 4px;
    margin-top: 4px;
    cursor: pointer;
    border: 1px solid var(--border-color);
}

.detail-image:hover {
    opacity: 0.9;
}

/* Issues kanban tile - compact list hover */
.issue-row:hover {
    background: var(--bg-secondary);
}


/* Source: 34b-kanban-extended.css */
/* =============================================================================
   Kanban board extended
   
   Source: styles.css lines 9232-9596
   ============================================================================= */

/* =============================================================================
   Kanban Board
   ============================================================================= */

.kanban-board {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 8px 0;
    height: calc(100vh - 280px);
}

/* Kanban Column */
.kanban-column {
    flex: 1 1 0;
    min-width: 140px;
    max-width: 320px;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    max-height: 100%;
}

.kanban-column.not-started-column {
    flex: 1 1 0;
    min-width: 140px;
    max-width: 320px;
    background-color: var(--bg-tertiary);
    border: 2px dashed var(--border-color);
}

/* Column Header */
.kanban-column .column-header {
    padding: 12px 16px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kanban-column .column-header span {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);  /* Dark text for contrast against colored backgrounds */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kanban-column .column-header .instance-count,
.kanban-column .column-header .entity-count {
    background-color: rgba(0,0,0,0.1);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
}

[data-theme="dark"] .kanban-column .column-header .instance-count,
[data-theme="dark"] .kanban-column .column-header .entity-count {
    background-color: rgba(255,255,255,0.15);
}

/* Column Filter */
.kanban-column .column-filter {
    padding: 8px;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
}

.kanban-column .column-filter input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 12px;
    box-sizing: border-box;
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

/* Column Cards Container */
.kanban-column .column-cards {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.kanban-column .empty-column {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* Kanban Card */
.kanban-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s, transform 0.2s;
}

.kanban-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.kanban-card .card-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kanban-card .card-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kanban-card .card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-muted);
}

/* Card ID Row */
.kanban-card .card-id-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.kanban-card .card-id-left {
    display: flex;
    align-items: center;
}

.kanban-card .card-id {
    font-family: monospace;
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 1px 4px;
    border-radius: 3px;
}

/* Card Assigned User */
.kanban-card .card-assigned {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.kanban-card .card-assigned i {
    margin-right: 4px;
    font-size: 10px;
}

/* Priority Badge */
.priority-badge {
    display: inline-block;
    padding: 1px 6px;
    font-size: 10px;
    font-weight: 600;
    border-radius: 8px;
    margin-left: 6px;
}

.priority-badge.priority-high {
    background: var(--color-warning-bg, #fff3e0);
    color: var(--color-warning-dark, #e65100);
    border: 1px solid var(--color-warning, #ffb74d);
}

.priority-badge.priority-urgent {
    background: var(--color-danger-bg, #ffebee);
    color: var(--color-danger, #c62828);
    border: 1px solid var(--color-danger-light, #ef5350);
}

/* Dark mode priority badges */
[data-theme="dark"] .priority-badge.priority-high {
    background: rgba(255, 152, 0, 0.2);
    color: #ffb74d;
    border-color: rgba(255, 183, 77, 0.4);
}

[data-theme="dark"] .priority-badge.priority-urgent {
    background: rgba(244, 67, 54, 0.2);
    color: #ef5350;
    border-color: rgba(239, 83, 80, 0.4);
}

/* Entity Card (Not Started) */
.kanban-card.entity-card {
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.kanban-card.entity-card.selected {
    background-color: var(--color-primary-light);
    border: 2px solid var(--color-primary);
}

[data-theme="dark"] .kanban-card.entity-card.selected {
    background-color: rgba(25, 118, 210, 0.2);
}

.kanban-card.entity-card .card-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0;
}

.kanban-card.entity-card .card-subtitle {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0;
}

/* Bulk Actions Bar */
.kanban-column .bulk-actions {
    padding: 8px;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

/* Workflow Action Buttons */
.btn-workflow-primary {
    padding: 4px 12px;
    font-size: 12px;
    background-color: var(--color-primary);
    color: var(--text-inverse);
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.btn-workflow-primary:hover {
    background-color: var(--color-primary-dark);
}

.btn-workflow-success {
    padding: 4px 12px;
    font-size: 12px;
    background-color: var(--color-success);
    color: var(--text-inverse);
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.btn-workflow-success:hover {
    opacity: 0.9;
}

/* Dialog Overlay */
.dialog-overlay,
.start-dialog-overlay,
.create-prospect-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

/* Dialog Box */
.dialog,
.start-dialog,
.create-prospect-dialog {
    background-color: var(--bg-card);
    padding: 24px;
    border-radius: 8px;
    min-width: 320px;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    color: var(--text-primary);
}

.dialog h3,
.start-dialog h3,
.create-prospect-dialog h3 {
    margin: 0 0 16px 0;
    color: var(--text-primary);
}

.dialog p,
.start-dialog p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.dialog label,
.start-dialog label,
.create-prospect-dialog label {
    display: block;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.dialog select,
.dialog input,
.dialog textarea,
.start-dialog select,
.start-dialog input,
.create-prospect-dialog select,
.create-prospect-dialog input,
.create-prospect-dialog textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-sizing: border-box;
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

.dialog textarea,
.create-prospect-dialog textarea {
    min-height: 80px;
    resize: vertical;
}

.dialog .form-group,
.create-prospect-dialog .form-group {
    margin-bottom: 12px;
}


/* Source: 35-smart-actions.css */
/* =============================================================================
   Smart Actions - Progress, Plan, and Dashboard Styling
   ============================================================================= */

/* -----------------------------------------------------------------------------
   Streaming Progress Feed
   ----------------------------------------------------------------------------- */

.smart-action-progress {
  background: var(--bg-secondary, #f8f9fa);
  border: 1px solid var(--border-color, #dee2e6);
  border-radius: 8px;
  padding: 16px;
  margin: 10px 0;
}

.progress-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.progress-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-color, #dee2e6);
  border-radius: 50%;
  flex-shrink: 0;
}

.progress-spinner.active {
  border-top-color: var(--primary, #3498db);
  animation: spin 1s linear infinite;
}

.progress-message {
  font-weight: 500;
  color: var(--text-primary, #333);
  flex: 1;
}

.progress-iteration {
  font-size: 0.8em;
  color: var(--text-muted, #6c757d);
  white-space: nowrap;
}

.progress-tools {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  padding-left: 26px;
}

.progress-tool {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9em;
  padding: 4px 8px;
  border-radius: 4px;
  background: var(--bg-primary, #fff);
}

.progress-tool.running {
  color: var(--primary, #3498db);
}

.progress-tool.completed {
  color: var(--success, #28a745);
}

.progress-tool.failed {
  color: var(--danger, #dc3545);
}

.progress-tool-icon {
  font-weight: bold;
  width: 16px;
  text-align: center;
  flex-shrink: 0;
}

.progress-tool-name {
  font-family: monospace;
  font-size: 0.9em;
}

.progress-tool-summary {
  color: var(--text-muted, #6c757d);
  font-size: 0.85em;
  margin-left: auto;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* -----------------------------------------------------------------------------
   Plan Approval
   ----------------------------------------------------------------------------- */

.smart-action-plan {
  background: var(--bg-secondary, #f8f9fa);
  border: 1px solid var(--warning-border, #ffc107);
  border-radius: 8px;
  padding: 16px;
  margin: 10px 0;
}

.plan-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-weight: 600;
  color: var(--text-primary, #333);
}

.plan-steps {
  list-style: none;
  padding: 0;
  margin: 0 0 16px 0;
}

.plan-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light, #eee);
}

.plan-step:last-child {
  border-bottom: none;
}

.plan-step-number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary, #3498db);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75em;
  font-weight: 600;
  flex-shrink: 0;
}

.plan-step-content {
  flex: 1 1 auto;
  /* Without min-width: 0, flex children refuse to shrink below their
     intrinsic content width and long values (emails, URLs) push the diff
     card off the right edge of the 350px Smart Actions panel. */
  min-width: 0;
}

.plan-step-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.plan-step-writes-data {
  font-size: 0.7em;
  padding: 2px 8px;
  background: #fff3e0;
  color: #e65100;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.plan-step-description {
  font-size: 0.85em;
  color: var(--text-muted, #6c757d);
  word-break: break-word;
}

.plan-step-tool {
  display: inline-block;
  font-family: monospace;
  font-size: 0.8em;
  background: var(--bg-primary, #fff);
  border: 1px solid var(--border-color, #dee2e6);
  border-radius: 3px;
  padding: 1px 6px;
  margin-right: 6px;
  /* Long tool names get truncated rather than pushing siblings off-row. */
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.plan-approve-btn {
  padding: 8px 20px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  font-weight: 500;
  background: var(--success, #28a745);
  color: #fff;
}

.plan-approve-btn:hover {
  opacity: 0.9;
}

.plan-reject-btn {
  padding: 8px 20px;
  border-radius: 4px;
  border: 1px solid var(--border-color, #dee2e6);
  cursor: pointer;
  font-weight: 500;
  background: var(--bg-primary, #fff);
  color: var(--text-primary, #333);
}

.plan-reject-btn:hover {
  background: var(--bg-secondary, #f8f9fa);
}

/* -----------------------------------------------------------------------------
   Tool Result Compact Chip
   Read-only / meta tools that succeed without surfacing data render as a
   one-line ✓ chip instead of the two-line Success/Completed-successfully
   pair, which used to dominate the panel after every multi-tool turn.
   ----------------------------------------------------------------------------- */

.tool-result-compact {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  margin: 2px 4px 2px 0;
  background: var(--bg-primary, #fff);
  border: 1px solid var(--border-light, #e0e0e0);
  border-radius: 12px;
  font-size: 0.8em;
  color: var(--text-muted, #6c757d);
}

.tool-result-compact .tool-result-check {
  color: #28a745;
  font-weight: 600;
}

.tool-result-compact .tool-name {
  font-family: monospace;
  font-size: 0.9em;
}

/* Quiet variant for LLM-mistake errors (e.g. start_walkthrough invoked on a
   plain CRUD intent) — the tool *did* fail, but it's not a failure the user
   should be asked to react to, so we render it like the success chip with a
   subdued cross and a 'skipped' tag instead of a red banner. */
.tool-result-compact-skipped {
  opacity: 0.7;
}

.tool-result-compact-skipped .tool-result-cross {
  color: var(--text-muted, #999);
  font-weight: 600;
}

.tool-result-compact-skipped .tool-result-skipped-label {
  font-size: 0.75em;
  font-style: italic;
  color: var(--text-muted, #999);
}

/* -----------------------------------------------------------------------------
   Conversation History — Tool Chips
   Small inline chips under each historical turn listing the user-meaningful
   tools that ran (meta-tools filtered out). Avoids the previous
   'Assistant: tool1, tool2 - response' pattern that mixed plumbing with prose.
   ----------------------------------------------------------------------------- */

.history-tool-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 4px 0 6px 0;
  padding-left: 4px;
}

.history-tool-chip {
  display: inline-block;
  font-family: monospace;
  font-size: 0.7em;
  padding: 1px 6px;
  background: var(--bg-tertiary, #f0f0f0);
  border-radius: 8px;
  color: var(--text-muted, #6c757d);
}

[data-theme="dark"] .history-tool-chip {
  background: var(--bg-tertiary, #2d2d2d);
}

[data-theme="dark"] .tool-result-compact {
  background: var(--bg-secondary);
  border-color: var(--border-color);
}

/* -----------------------------------------------------------------------------
   Confirm Dialog (email/SMS preview)
   ----------------------------------------------------------------------------- */

.smart-action-confirm {
  background: var(--bg-secondary, #f8f9fa);
  border: 1px solid var(--info-border, #17a2b8);
  border-radius: 8px;
  padding: 16px;
  margin: 10px 0;
}

.confirm-header {
  font-weight: 600;
  margin-bottom: 12px;
}

.confirm-preview {
  background: var(--bg-primary, #fff);
  border: 1px solid var(--border-color, #dee2e6);
  border-radius: 4px;
  padding: 12px;
  margin-bottom: 12px;
}

.confirm-preview-label {
  font-size: 0.8em;
  color: var(--text-muted, #6c757d);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.confirm-preview-value {
  margin-bottom: 8px;
}

.confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* -----------------------------------------------------------------------------
   Actions Dashboard Cards
   ----------------------------------------------------------------------------- */

.actions-dashboard-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.actions-dashboard-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-radius: 8px;
  background: var(--bg-primary, #fff);
  border: 1px solid var(--border-color, #dee2e6);
  transition: box-shadow 0.15s;
}

.actions-dashboard-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.actions-dashboard-card .card-icon {
  font-size: 1.4em;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}

.actions-dashboard-card.card-completed .card-icon { color: #155724; background: #d4edda; }
.actions-dashboard-card.card-failed .card-icon { color: #721c24; background: #f8d7da; }
.actions-dashboard-card.card-pending-approval .card-icon { color: #4a2479; background: #e2d5f1; }
.actions-dashboard-card.card-in-progress .card-icon { color: #004085; background: #cce5ff; }

.actions-dashboard-card .card-count {
  font-size: 1.5em;
  font-weight: 700;
  line-height: 1;
  color: var(--text-primary, #333);
}

.actions-dashboard-card .card-label {
  font-size: 0.8em;
  color: var(--text-muted, #6c757d);
  margin-top: 2px;
}

/* Status badges in table */
.status-badge.status-completed { background: #d4edda; color: #155724; }
.status-badge.status-failed { background: #f8d7da; color: #721c24; }
.status-badge.status-pending { background: #fff3cd; color: #856404; }
.status-badge.status-in-progress { background: #cce5ff; color: #004085; }
.status-badge.status-pending-approval { background: #e2d5f1; color: #4a2479; }

/* Tool badge in detail modal */
.tool-badge {
  display: inline-block;
  font-family: monospace;
  font-size: 0.8em;
  padding: 2px 8px;
  border-radius: 3px;
  background: var(--bg-secondary, #f8f9fa);
  border: 1px solid var(--border-color, #dee2e6);
  margin: 2px 4px 2px 0;
}

/* -----------------------------------------------------------------------------
   Action Detail Modal
   ----------------------------------------------------------------------------- */

.action-detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1050;
}

.action-detail-modal {
  background: var(--bg-primary, #fff);
  border-radius: 8px;
  width: 90%;
  max-width: 640px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.action-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color, #dee2e6);
}

.action-detail-header h3 {
  margin: 0;
  font-size: 1.1em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.action-detail-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1em;
  color: var(--text-muted, #6c757d);
  padding: 4px;
}

.action-detail-body {
  padding: 20px;
  overflow-y: auto;
}

.action-detail-status {
  margin-bottom: 16px;
}

.action-detail-section {
  margin-bottom: 16px;
}

.action-detail-section h4 {
  font-size: 0.85em;
  text-transform: uppercase;
  color: var(--text-muted, #6c757d);
  margin: 0 0 8px 0;
}

.action-detail-query {
  font-style: italic;
  color: var(--text-primary, #333);
}

.action-detail-plan {
  padding-left: 20px;
  margin: 0;
}

.action-detail-plan li {
  padding: 4px 0;
}

.action-detail-timeline {
  padding: 0;
  margin: 0;
}

.action-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
}

.action-step .step-icon {
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.action-step.step-success .step-icon { color: var(--success, #28a745); }
.action-step.step-failure .step-icon { color: var(--danger, #dc3545); }

.action-step .step-tool {
  font-family: monospace;
  font-size: 0.9em;
}

.action-step .step-time {
  margin-left: auto;
  font-size: 0.8em;
  color: var(--text-muted, #6c757d);
}

.action-detail-tools {
  display: flex;
  flex-wrap: wrap;
}

.action-detail-meta {
  font-size: 0.9em;
  line-height: 1.6;
}

.action-detail-error {
  background: #f8d7da;
  border-radius: 4px;
  padding: 12px;
}

.action-detail-error pre {
  margin: 0;
  font-size: 0.85em;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Responsive: stack cards on small screens */
@media (max-width: 768px) {
  .actions-dashboard-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* -----------------------------------------------------------------------------
   Markdown Content in Assistant Responses
   ----------------------------------------------------------------------------- */

.markdown-content {
  line-height: 1.6;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.markdown-content .md-heading {
  margin: 12px 0 6px 0;
  font-weight: 600;
  color: var(--text-primary, #333);
}

.markdown-content h3.md-heading { font-size: 1.1em; }
.markdown-content h4.md-heading { font-size: 1.0em; }
.markdown-content h5.md-heading { font-size: 0.95em; }
.markdown-content h6.md-heading { font-size: 0.9em; }

.markdown-content .md-paragraph {
  margin: 6px 0;
}

.markdown-content .md-list {
  margin: 6px 0;
  padding-left: 20px;
}

.markdown-content .md-list li {
  margin: 3px 0;
}

.markdown-content code {
  font-family: monospace;
  font-size: 0.9em;
  background: var(--bg-secondary, #f0f0f0);
  padding: 1px 5px;
  border-radius: 3px;
}

.markdown-content strong {
  font-weight: 600;
}

/* Dark mode overrides */
[data-theme="dark"] .smart-action-progress,
[data-theme="dark"] .smart-action-plan,
[data-theme="dark"] .smart-action-confirm {
  background: var(--bg-secondary);
  border-color: var(--border-color);
}

[data-theme="dark"] .progress-tool,
[data-theme="dark"] .confirm-preview {
  background: var(--bg-tertiary, #2d2d2d);
}

[data-theme="dark"] .actions-dashboard-card {
  background: var(--bg-secondary);
  border-color: var(--border-color);
}

[data-theme="dark"] .actions-dashboard-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .actions-dashboard-card.card-completed .card-icon { color: #c3e6cb; background: #1a3a2a; }
[data-theme="dark"] .actions-dashboard-card.card-failed .card-icon { color: #f5c6cb; background: #3a1a1a; }
[data-theme="dark"] .actions-dashboard-card.card-pending-approval .card-icon { color: #d1c4e9; background: #2a1a3a; }
[data-theme="dark"] .actions-dashboard-card.card-in-progress .card-icon { color: #b8daff; background: #1a2a3a; }

[data-theme="dark"] .action-detail-modal {
  background: var(--bg-secondary);
}

[data-theme="dark"] .action-detail-header {
  border-color: var(--border-color);
}

[data-theme="dark"] .action-detail-error {
  background: #3a1a1a;
  color: #f5c6cb;
}

[data-theme="dark"] .tool-badge {
  background: var(--bg-tertiary, #2d2d2d);
  border-color: var(--border-color);
}

[data-theme="dark"] .status-badge.status-completed { background: #1a3a2a; color: #c3e6cb; }
[data-theme="dark"] .status-badge.status-failed { background: #3a1a1a; color: #f5c6cb; }
[data-theme="dark"] .status-badge.status-pending { background: #3a3520; color: #ffeeba; }
[data-theme="dark"] .status-badge.status-in-progress { background: #1a2a3a; color: #b8daff; }
[data-theme="dark"] .status-badge.status-pending-approval { background: #2a1a3a; color: #d1c4e9; }

/* Source: 35a-wizard.css */
/* =============================================================================
   Multi-step wizard components
   
   Source: styles.css lines 3866-4069
   ============================================================================= */

/* =============================================================================
   Wizard Styles
   ============================================================================= */

.wizard-view {
    max-width: 900px;
    margin: 0 auto;
}

.wizard-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

/* Stage Progress */
.stage-progress {
    display: flex;
    align-items: flex-start;
    padding: 24px;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 24px;
    overflow-x: auto;
}

.stage-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.stage-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.stage-label {
    margin-top: 8px;
    font-size: 12px;
    text-align: center;
    max-width: 80px;
}

.stage-connector {
    flex: 1;
    height: 2px;
    margin-top: 15px;
    min-width: 20px;
}

/* Instance Details */
.instance-details {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

/* Stage Form */
.stage-form {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
}

/* Stage History */
.stage-history {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin-top: 24px;
}

.history-entry {
    padding: 12px;
    border-left: 3px solid;
    margin-bottom: 12px;
    background-color: var(--bg-secondary);
}

/* Workflow Dialog Overlay */
.dialog-overlay,
.start-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.dialog-overlay .dialog,
.start-dialog-overlay .start-dialog {
    background-color: var(--bg-card);
    padding: 24px;
    border-radius: 8px;
    min-width: 300px;
    max-width: 400px;
}

/* Workflow Filter Bar (wizard contexts only) */
.wizard-view .workflow-filter-bar {
    display: flex;
    flex-direction: row;
    gap: 16px;
    padding: 16px;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    align-items: center;
    flex-wrap: wrap;
}

.wizard-view .workflow-filter-bar select,
.wizard-view .workflow-filter-bar input[type="text"] {
    padding: 8px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    min-width: 120px;
}

/* Completion/Cancellation Messages */
.completion-message {
    padding: 24px;
    background-color: var(--color-success-bg);
    border-radius: 8px;
    text-align: center;
}

.cancelled-message {
    padding: 24px;
    background-color: var(--color-danger-bg);
    border-radius: 8px;
    text-align: center;
}

/* Confirmation Step */
.confirmation-message {
    padding: 20px;
    background-color: var(--color-success-bg);
    border-radius: 8px;
    margin-bottom: 16px;
}

/* Quick Filters for Table Columns */
.quick-filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    padding: 6px 0;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--border-color);
}

.quick-filters-bar .filter-group {
    display: flex;
    align-items: center;
    gap: 0;
    flex-wrap: nowrap;
}

.quick-filters-bar .filter-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-right: 8px;
    opacity: 0.7;
    white-space: nowrap;
}

.quick-filters-bar .filter-chip {
    padding: 4px 12px;
    border-radius: 0;
    border: 1px solid var(--border-color);
    border-right: none;
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 12px;
    transition: all 0.15s ease;
    position: relative;
    z-index: 0;
    white-space: nowrap;
}

.quick-filters-bar .filter-group button.filter-chip:first-of-type {
    border-radius: 4px 0 0 4px;
}

.quick-filters-bar .filter-group button.filter-chip:last-of-type {
    border-radius: 0 4px 4px 0;
    border-right: 1px solid var(--border-color);
}

.quick-filters-bar .filter-chip:hover {
    background: var(--bg-secondary);
}

.quick-filters-bar .filter-chip.active {
    background: var(--color-primary);
    color: var(--text-inverse);
    border-color: var(--color-primary);
    z-index: 1;
}

.quick-filters-bar .filter-group button.filter-chip.active:last-of-type {
    border-right: 1px solid var(--color-primary);
}

/* Collection-based dropdown filters */
.quick-filters-bar .filter-dropdown {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quick-filters-bar .filter-dropdown .filter-label {
    margin-right: 4px;
}

.quick-filters-bar .filter-select {
    padding: 5px 10px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    min-width: 150px;
    cursor: pointer;
    font-size: 13px;
}

.quick-filters-bar .filter-select:focus {
    outline: none;
    border-color: var(--color-primary);
}

.quick-filters-bar .filter-select:hover {
    border-color: var(--color-primary-light, var(--color-primary));
}

/* Per-column text filters (opt-in via :filter-as "text"). */
.quick-filters-bar .filter-text {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quick-filters-bar .filter-text .filter-label {
    margin-right: 4px;
}

.quick-filters-bar .filter-text-input {
    padding: 5px 10px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    min-width: 140px;
    font-size: 13px;
}

.quick-filters-bar .filter-text-input:focus {
    outline: none;
    border-color: var(--color-primary);
}

/* Source: 35b-wizard-extended.css */
/* =============================================================================
   Wizard extended components
   
   Source: styles.css lines 9597-9902
   ============================================================================= */

/* =============================================================================
   Wizard Components
   ============================================================================= */

.wizard-view {
    max-width: 900px;
    margin: 0 auto;
}

.wizard-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.wizard-header h2 {
    margin: 0;
    color: var(--text-primary);
}

/* Stage Progress */
.stage-progress {
    display: flex;
    align-items: flex-start;
    padding: 24px;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 24px;
    overflow-x: auto;
}

.stage-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.stage-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.stage-circle.completed {
    background-color: var(--color-success);
    color: var(--text-inverse);
}

.stage-circle.current {
    box-shadow: 0 0 0 4px rgba(25, 118, 210, 0.2);
}

.stage-circle.pending {
    background-color: var(--bg-tertiary);
    color: var(--text-muted);
}

.stage-label {
    margin-top: 8px;
    font-size: 12px;
    text-align: center;
    max-width: 80px;
    color: var(--text-secondary);
}

.stage-label.current {
    font-weight: 600;
    color: var(--text-primary);
}

.stage-connector {
    flex: 1;
    height: 2px;
    margin-top: 15px;
    min-width: 20px;
    background-color: var(--bg-tertiary);
}

.stage-connector.completed {
    background-color: var(--color-success);
}

/* Stage Form */
.stage-form {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
}

.stage-form h3 {
    margin: 0 0 16px 0;
    color: var(--text-primary);
}

.stage-form p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.stage-form .form-fields {
    margin-bottom: 16px;
}

.stage-form .confirmation-message {
    padding: 20px;
    background-color: var(--bg-success-subtle);
    border-radius: 8px;
    margin-bottom: 16px;
}

.stage-form .confirmation-message p {
    margin: 0;
    color: var(--color-success);
}

[data-theme="dark"] .stage-form .confirmation-message {
    background-color: rgba(76, 175, 80, 0.15);
}

.stage-form .submit-area {
    margin-top: 24px;
    display: flex;
    gap: 12px;
}

/* Instance Details */
.instance-details {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.instance-details h3 {
    margin: 0 0 4px 0;
    color: var(--text-primary);
}

.instance-details p {
    margin: 0;
    color: var(--text-secondary);
}

.instance-details label {
    font-size: 12px;
    color: var(--text-muted);
}

.instance-details .detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.instance-details .action-buttons {
    display: flex;
    gap: 8px;
}

/* Stage History */
.stage-history {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin-top: 24px;
}

.stage-history h4 {
    margin: 0 0 16px 0;
    color: var(--text-primary);
}

.history-entry {
    padding: 12px;
    border-left: 3px solid var(--color-primary);
    margin-bottom: 12px;
    background-color: var(--bg-secondary);
}

.history-entry.completed {
    border-color: var(--color-success);
}

.history-entry.cancelled {
    border-color: var(--color-danger);
}

.history-entry strong {
    color: var(--text-primary);
}

.history-entry .meta {
    font-size: 12px;
    color: var(--text-secondary);
}

.history-entry details summary {
    cursor: pointer;
    font-size: 12px;
    color: var(--color-primary);
}

.history-entry details pre {
    font-size: 11px;
    background: var(--bg-primary);
    padding: 8px;
    border-radius: 4px;
    overflow-x: auto;
    margin-top: 4px;
    color: var(--text-primary);
}

/* Completion / Cancelled Messages */
.completion-message {
    padding: 24px;
    background-color: var(--bg-success-subtle);
    border-radius: 8px;
    text-align: center;
}

.completion-message h3 {
    margin: 0 0 8px 0;
    color: var(--color-success);
}

.completion-message p {
    margin: 0;
    color: var(--text-secondary);
}

[data-theme="dark"] .completion-message {
    background-color: rgba(76, 175, 80, 0.15);
}

.cancelled-message {
    padding: 24px;
    background-color: var(--bg-danger-subtle);
    border-radius: 8px;
    text-align: center;
}

.cancelled-message h3 {
    margin: 0 0 8px 0;
    color: var(--color-danger);
}

.cancelled-message p {
    margin: 0 0 16px 0;
    color: var(--text-secondary);
}

[data-theme="dark"] .cancelled-message {
    background-color: rgba(244, 67, 54, 0.15);
}

/* Dark Mode overrides for workflow components */
[data-theme="dark"] .kanban-column {
    background-color: var(--bg-secondary);
}

[data-theme="dark"] .kanban-column.not-started-column {
    background-color: var(--bg-tertiary);
    border-color: var(--border-color);
}

[data-theme="dark"] .kanban-column .column-header span {
    color: #e0e0e0;  /* Light text for dark mode backgrounds */
}

[data-theme="dark"] .stage-progress {
    background-color: var(--bg-secondary);
}

[data-theme="dark"] .history-entry {
    background-color: var(--bg-tertiary);
}

/* Dark mode: Not Started column header - use a blue-gray color for visibility */
[data-theme="dark"] .not-started-column .column-header {
    background-color: #546e7a !important;
    border-radius: 8px 8px 0 0;
}

[data-theme="dark"] .not-started-column .column-header span {
    color: #ffffff !important;
}

[data-theme="dark"] .not-started-column .column-header .entity-count {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.2) !important;
}

/* Note: System dark mode preference for these components is handled by the
   comprehensive @media (prefers-color-scheme: dark) block in the main dark mode section */


/* Source: 35c-clinical-calendar.css */
/* =============================================================================
   Clinical Calendar Styles
   Multi-provider calendar with front desk and provider views
   ============================================================================= */

/* Calendar Container */
.full-calendar {
  font-family: var(--font-primary, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
}

/* Header */
.full-calendar .calendar-header {
  position: sticky;
  top: 0;
  z-index: 20;
}

/* Filter Panel */
.calendar-filter-panel {
  position: sticky;
  top: 56px;
  z-index: 19;
}

/* Override global form styles for filter panel selects */
.calendar-filter-panel select {
  width: auto !important;
  min-width: 120px;
  max-width: 160px;
  flex-shrink: 0;
}

.calendar-filter-provider:hover {
  background: rgba(123, 31, 162, 0.08) !important;
}

/* Time Gutter */
.time-gutter {
  position: sticky;
  left: 0;
  z-index: 5;
  background: var(--bg-secondary, #f5f5f5);
}

/* Border-box for grid alignment: time gutter hours and grid slots must
   include their 1px borders in their declared height, otherwise the
   gutter (1 border/hour) drifts from the grid (4 borders/hour). */
.time-gutter > div,
.time-slot {
  box-sizing: border-box;
}

/* Appointment cards use width instead of right, so border-box ensures
   padding + border-left are included in the declared width. */
.appointment-card {
  box-sizing: border-box;
}

/* Appointment Cards */
.appointment-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  z-index: 15 !important;
}

/* Provider Column Headers */
.provider-column-header:hover {
  background: rgba(123, 31, 162, 0.03) !important;
}

/* Day Headers in Week View */
.day-header:hover {
  background: rgba(123, 31, 162, 0.05) !important;
}

/* Month Day Cells */
.month-day-cell:hover {
  background: rgba(123, 31, 162, 0.03) !important;
}

/* Provider Sidebar */
.provider-sidebar {
  border-left: 1px solid #e0e0e0;
}

/* Time Slot Hover Overlay */
.time-slot {
  position: relative;
  transition: background 0.1s ease;
}

.time-slot:hover {
  background: rgba(123, 31, 162, 0.08) !important;
  cursor: pointer;
}

.time-slot:hover::before {
  content: "+ " attr(data-time);
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  line-height: 1;
  color: rgba(123, 31, 162, 0.6);
  font-weight: 500;
  pointer-events: none;
  z-index: 4;
  white-space: nowrap;
}

[data-theme="dark"] .time-slot:hover {
  background: rgba(186, 104, 200, 0.12) !important;
}

[data-theme="dark"] .time-slot:hover::before {
  color: rgba(186, 104, 200, 0.7);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .time-slot:hover {
    background: rgba(186, 104, 200, 0.12) !important;
  }
  :root:not([data-theme="light"]) .time-slot:hover::before {
    color: rgba(186, 104, 200, 0.7);
  }
}

/* Quick Action Buttons */
.appointment-card button:hover {
  opacity: 0.85;
  transform: scale(1.02);
}

/* Current Time Indicator */
.current-time-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: #e53935;
  z-index: 12;
  pointer-events: none;
}

.current-time-line::before {
  content: '';
  position: absolute;
  left: -5px;
  top: -4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e53935;
}

/* Scrollbar Styling */
.full-calendar ::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.full-calendar ::-webkit-scrollbar-track {
  background: transparent;
}

.full-calendar ::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.full-calendar ::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* Schedule Appointment Button */
.btn-schedule-appointment {
  background: #7b1fa2;
  color: white;
  transition: background 0.15s, opacity 0.15s;
}
.btn-schedule-appointment:hover:not(:disabled) {
  background: #9c27b0;
}
.btn-schedule-appointment.disabled,
.btn-schedule-appointment:disabled {
  background: var(--bg-tertiary, #ccc);
  color: var(--text-muted, #999);
}

/* Mobile Provider Summary Bar (hidden on desktop, shown on mobile) */
.mobile-provider-summary,
.mobile-schedule-overlay {
  display: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .calendar-filter-panel {
    flex-direction: column;
    align-items: flex-start;
  }

  .provider-sidebar {
    display: none;
  }

  /* Mobile summary bar replaces hidden sidebar */
  .mobile-provider-summary {
    display: flex !important;
  }
  .mobile-schedule-overlay {
    display: block !important;
  }

  /* Time gutter: shrink for mobile */
  .time-gutter { width: 45px !important; }
  .time-gutter span { font-size: 10px; }

  /* Week view columns: narrower */
  .week-day-column, .provider-day-column { min-width: 80px !important; }
  .provider-column-header { min-width: 80px !important; font-size: 11px; }

  /* Day headers compact */
  .day-header { padding: 6px !important; }
  .day-header div:first-child { font-size: 10px; }
  .day-header div:last-child { font-size: 16px; }

  /* Appointment cards: touch-friendly */
  .appointment-card { font-size: 10px; padding: 2px 4px !important; min-height: 30px; }

  /* Calendar header: compact */
  .calendar-header { padding: 8px 12px; }

  /* Create appointment modal: full-screen on mobile */
  .create-appointment-overlay .modal-content {
    min-width: unset !important;
    width: 100%;
    height: 100%;
    border-radius: 0;
  }

  .full-calendar {
    height: calc(100vh - 80px) !important;
  }
}

/* Disable hover overlay on touch devices */
@media (hover: none) {
  .time-slot:hover { background: transparent !important; }
  .time-slot:hover::before { display: none; }
}

/* Print styles */
@media print {
  .calendar-filter-panel,
  .calendar-header button,
  .appointment-card button {
    display: none !important;
  }

  .full-calendar {
    height: auto !important;
    border: none !important;
  }
}

/* Source: 35c-wizard-form.css */
/* =============================================================================
   Wizard Form Panel — progressive multi-step form
   ============================================================================= */

.wizard-panel {
    width: 100%;
    max-width: 100%;
}

/* --- Progress bar --- */
.wizard-progress {
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    margin-bottom: 24px;
    overflow: hidden;
}

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

/* --- Header: step info + dots --- */
.wizard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 12px;
}

.wizard-step-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wizard-step-number {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-primary);
}

.wizard-step-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.wizard-step-title .fa {
    font-size: 18px;
    color: var(--text-muted);
}

/* --- Step dots --- */
.wizard-dots {
    display: flex;
    align-items: center;
    gap: 6px;
}

.wizard-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: transparent;
    color: var(--text-muted);
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
}

.wizard-dot:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.wizard-dot.visited {
    border-color: var(--text-muted);
    background: var(--bg-secondary);
}

.wizard-dot.complete {
    border-color: var(--color-success);
    background: var(--color-success);
    color: #fff;
}

.wizard-dot.active {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: #fff;
    transform: scale(1.15);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 25%, transparent);
}

/* --- Form content --- */
.wizard-content {
    min-height: 200px;
    margin-bottom: 24px;
}

.wizard-content .form-group {
    max-width: 100%;
}

.wizard-content input[type="text"],
.wizard-content input[type="date"],
.wizard-content input[type="number"],
.wizard-content input[type="email"],
.wizard-content input[type="tel"],
.wizard-content select,
.wizard-content textarea {
    width: 100%;
    box-sizing: border-box;
}

.wizard-validation {
    color: var(--color-danger);
    font-size: 13px;
    margin-top: 16px;
    padding: 10px 14px;
    background: color-mix(in srgb, var(--color-danger) 8%, transparent);
    border-radius: 6px;
    border-left: 3px solid var(--color-danger);
}

/* --- Navigation --- */
.wizard-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    gap: 12px;
}

.wizard-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.wizard-btn-back {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.wizard-btn-back:hover {
    background: var(--bg-card);
    border-color: var(--text-muted);
}

.wizard-btn-next {
    background: var(--color-primary);
    color: #fff;
    margin-left: auto;
}

.wizard-btn-next:hover {
    filter: brightness(1.1);
}

.wizard-btn-submit {
    background: var(--color-success, #4caf50);
    color: #fff;
    margin-left: auto;
}

.wizard-btn-submit:hover {
    filter: brightness(1.1);
}

.wizard-btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: none;
}

/* --- Auto-save status indicator --- */
.wizard-auto-save-status {
    display: flex;
    align-items: center;
    margin-left: 12px;
    font-size: 13px;
    font-weight: 500;
    min-width: 90px;
}

.auto-save-saving {
    color: var(--text-muted);
}

.auto-save-saving .fa-spinner {
    margin-right: 4px;
}

.auto-save-saved {
    color: var(--color-success, #4caf50);
}

.auto-save-saved .fa-check-circle {
    margin-right: 4px;
}

/* --- Mobile --- */
@media (max-width: 600px) {
    .wizard-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .wizard-step-title {
        font-size: 18px;
    }

    .wizard-dots {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .wizard-dot {
        width: 24px;
        height: 24px;
        font-size: 9px;
    }

    .wizard-btn {
        padding: 12px 18px;
        font-size: 14px;
    }

    .wizard-nav {
        flex-wrap: wrap;
    }
}

/* Source: 36-patient-chart.css */
/* =============================================================================
   Patient Chart Styles
   Comprehensive clinical chart with two-column layout
   ============================================================================= */

/* Responsive: single column on mobile */
@media (max-width: 768px) {
  .patient-chart-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Print styles */
@media print {
  .patient-chart-header button,
  .patient-chart-tabs {
    display: none !important;
  }
}

/* Source: 36-scheduler.css */
/* =============================================================================
   Calendar and scheduling
   
   Source: styles.css lines 9903-10405
   ============================================================================= */

/* =============================================================================
   Scheduler Page Components
   ============================================================================= */

.scheduler-page {
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

.scheduler-page h1 {
    color: var(--color-primary);
    font-weight: 800;
    margin: 0 0 8px 0;
    font-size: 28px;
}

.scheduler-page > p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 15px;
}

/* Task badges */
.scheduler-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.scheduler-badge.active {
    background: var(--color-success-bg);
    color: #2e7d32;
}

.scheduler-badge.inactive {
    background: #fbe9e7;
    color: #c62828;
}

.scheduler-badge.prod {
    background: var(--color-warning-bg);
    color: #e65100;
    margin-left: 8px;
}

.scheduler-badge.success {
    background: var(--color-success-bg);
    color: #2e7d32;
}

.scheduler-badge.failed {
    background: var(--color-danger-bg);
    color: #c62828;
}

.scheduler-badge.neutral {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

/* Scheduler cards */
.scheduler-card {
    background: var(--bg-card);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.scheduler-card-light {
    background: var(--bg-card);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.scheduler-info-section {
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.scheduler-info-card {
    background: var(--bg-card);
    padding: 16px;
    border-radius: 8px;
}

.scheduler-info-label {
    color: var(--text-secondary);
    font-size: 12px;
    margin-bottom: 4px;
}

.scheduler-info-value {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
}

.scheduler-info-value.mono {
    font-family: monospace;
    font-size: 13px;
}

/* Scheduler header bar */
.scheduler-header-bar {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 16px;
}

.scheduler-back-btn {
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.scheduler-back-btn:hover {
    background: var(--bg-hover);
}

.scheduler-detail-title {
    margin: 0 0 4px 0;
    font-size: 18px;
    color: var(--text-primary);
}

.scheduler-detail-desc {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Scheduler tables */
.scheduler-table {
    width: 100%;
    border-collapse: collapse;
}

.scheduler-table thead tr {
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--border-color);
}

.scheduler-table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.scheduler-table th.center {
    text-align: center;
}

.scheduler-table tbody tr {
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background 0.15s ease;
}

.scheduler-table tbody tr:hover {
    background: var(--bg-hover);
}

.scheduler-table td {
    padding: 14px 16px;
    color: var(--text-primary);
    font-size: 14px;
}

.scheduler-table td.center {
    text-align: center;
}

.scheduler-table td.secondary {
    color: var(--text-secondary);
}

.scheduler-table td.muted {
    color: var(--text-muted);
    font-size: 13px;
}

.scheduler-table td.error {
    color: #c62828;
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.scheduler-task-name {
    display: flex;
    align-items: center;
    gap: 8px;
}

.scheduler-task-name span:first-child {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.scheduler-task-arrow {
    color: var(--color-primary);
    font-size: 12px;
}

/* Execution logs section */
.scheduler-logs-section {
    padding: 20px;
}

.scheduler-logs-section h3 {
    margin: 0 0 16px 0;
    font-size: 16px;
    color: var(--text-primary);
}

.scheduler-empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border-radius: 8px;
}

.scheduler-empty-state .icon {
    font-size: 24px;
    margin-bottom: 8px;
}

/* Summary cards */
.scheduler-summary {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.scheduler-summary-card {
    background: var(--bg-card);
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 12px;
}

.scheduler-summary-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-primary);
}

.scheduler-summary-value.muted {
    color: var(--text-secondary);
}

.scheduler-summary-label {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Legend */
.scheduler-legend {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.scheduler-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.scheduler-legend-dot {
    width: 14px;
    height: 14px;
    border-radius: 3px;
}

.scheduler-legend-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* View navigation */
.scheduler-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.scheduler-view-toggle {
    display: flex;
    gap: 8px;
}

.scheduler-view-btn {
    padding: 10px 20px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
}

.scheduler-view-btn:hover {
    background: var(--bg-hover);
}

.scheduler-view-btn.active {
    border: 2px solid var(--color-primary);
    background: var(--color-primary);
    color: white;
}

.scheduler-date-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.scheduler-nav-btn {
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.scheduler-nav-btn:hover {
    background: var(--bg-hover);
}

.scheduler-nav-btn.today {
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
    margin-left: 8px;
}

.scheduler-date-label {
    font-weight: 600;
    min-width: 200px;
    text-align: center;
    color: var(--text-primary);
}

/* Calendar views */
.scheduler-calendar {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow-md);
}

.scheduler-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.scheduler-calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
}

.scheduler-calendar-dow {
    text-align: center;
    font-weight: bold;
    color: var(--text-secondary);
    padding: 8px;
}

/* Week day cell */
.scheduler-week-day {
    border: 1px solid var(--border-color);
    min-height: 120px;
    padding: 8px;
    background: var(--bg-card);
}

.scheduler-week-day.today {
    background: var(--bg-selected);
}

.scheduler-day-header {
    font-weight: bold;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.scheduler-day-header.today {
    color: var(--color-primary-dark);
}

/* Month day cell */
.scheduler-month-day {
    border: 1px solid var(--border-color);
    min-height: 80px;
    padding: 4px;
    background: var(--bg-card);
}

.scheduler-month-day.today {
    background: var(--bg-selected);
}

.scheduler-month-day.outside {
    background: var(--bg-secondary);
    opacity: 0.5;
}

.scheduler-month-date {
    font-weight: bold;
    font-size: 0.9em;
    margin-bottom: 4px;
    color: var(--text-secondary);
}

.scheduler-month-date.today {
    color: var(--color-primary-dark);
}

/* Task items in calendar */
.scheduler-task-item {
    background: var(--bg-secondary);
    border-radius: 4px;
    padding: 4px 8px;
    margin-bottom: 4px;
    font-size: 0.85em;
}

.scheduler-task-item .name {
    font-weight: 500;
    color: var(--text-primary);
}

.scheduler-task-item .time {
    color: var(--text-muted);
    font-size: 0.85em;
}

/* Task dot (month view) */
.scheduler-task-dot {
    color: white;
    border-radius: 4px;
    padding: 2px 4px;
    margin-bottom: 2px;
    font-size: 0.7em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.scheduler-more-tasks {
    font-size: 0.7em;
    color: var(--text-secondary);
}

/* Loading state */
.scheduler-loading {
    text-align: center;
    padding: 60px;
    background: var(--bg-card);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    color: var(--text-secondary);
    font-size: 16px;
}


/* Source: 36a-encounter.css */
/* =============================================================================
   Encounter Workflow

   Multi-step encounter wizard: pre-encounter, in-session, documenting,
   billing review, finalized. Provider-facing on both desktop and mobile.
   ============================================================================= */

/* -------------------------------------------------------------------------
   Encounter Header
   ------------------------------------------------------------------------- */
.encounter-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    background: var(--bg-primary, white);
    border-bottom: 1px solid var(--border-color, #e0e0e0);
}

.encounter-header .encounter-back-btn {
    background: none;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    color: var(--text-primary, #333);
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.encounter-header .encounter-info {
    flex: 1;
    min-width: 0;
}

.encounter-header .encounter-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary, #333);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.encounter-header .encounter-provider {
    font-size: 13px;
    color: var(--text-secondary, #666);
    margin-top: 2px;
}

.encounter-header .encounter-cancel-btn {
    background: none;
    border: 1px solid #e53935;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    color: #e53935;
    font-size: 12px;
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

/* -------------------------------------------------------------------------
   Step Content Container
   ------------------------------------------------------------------------- */
.encounter-step {
    max-width: 600px;
    margin: 24px auto;
    padding: 0 16px;
}

.encounter-step--wide {
    max-width: 800px;
    margin: 24px auto;
    padding: 0 16px;
}

/* -------------------------------------------------------------------------
   Session Timer
   ------------------------------------------------------------------------- */
.session-timer {
    background: var(--bg-secondary, #f5f5f5);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
}

.session-timer .timer-display {
    font-size: 48px;
    font-weight: 700;
    font-family: monospace;
    letter-spacing: 2px;
}

.session-timer .timer-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 12px;
}

.session-timer .timer-controls button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* -------------------------------------------------------------------------
   Note Workspace
   ------------------------------------------------------------------------- */
.note-workspace {
    background: var(--bg-primary, white);
    border-radius: 12px;
    padding: 24px;
    border: 1px solid var(--border-color, #e0e0e0);
}

.note-workspace .template-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.note-workspace .template-selector button {
    padding: 8px 20px;
    border-radius: 8px;
    cursor: pointer;
    min-height: 44px;
}

.note-workspace textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 8px;
    font-size: 16px;  /* 16px prevents iOS zoom on focus */
    font-family: inherit;
    resize: vertical;
    line-height: 1.5;
    background: var(--bg-primary, white);
    color: var(--text-primary, #333);
    box-sizing: border-box;
}

/* -------------------------------------------------------------------------
   Copy from Previous Session Picker
   ------------------------------------------------------------------------- */
.previous-notes-picker {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 100;
    min-width: 300px;
    max-width: 400px;
    max-height: 320px;
    overflow-y: auto;
    margin-top: 4px;
    background: var(--bg-primary, white);
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.previous-note-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color, #eee);
    transition: background 0.15s;
}

.previous-note-item:last-child {
    border-bottom: none;
}

.previous-note-item:hover {
    background: var(--bg-secondary, #f5f5f5);
}

/* -------------------------------------------------------------------------
   Billing Panel
   ------------------------------------------------------------------------- */
.billing-panel {
    background: var(--bg-primary, white);
    border-radius: 12px;
    padding: 24px;
    border: 1px solid var(--border-color, #e0e0e0);
}

.billing-panel select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 8px;
    font-size: 16px;  /* 16px prevents iOS zoom on focus */
    background: var(--bg-primary, white);
    color: var(--text-primary, #333);
    min-height: 44px;
}

/* -------------------------------------------------------------------------
   Audio Recorder
   ------------------------------------------------------------------------- */
.audio-recorder {
    background: var(--bg-primary, white);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid var(--border-color, #e0e0e0);
}

.audio-recorder button {
    min-height: 44px;
}

.audio-recorder audio {
    width: 100%;
}

/* -------------------------------------------------------------------------
   Checklist Panel
   ------------------------------------------------------------------------- */
.checklist-panel {
    background: var(--bg-primary, white);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border-color, #e0e0e0);
}

.checklist-panel .begin-session-btn {
    width: 100%;
    padding: 14px 32px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: #1976d2;
    color: white;
    font-weight: 600;
    font-size: 15px;
    min-height: 48px;
}

/* -------------------------------------------------------------------------
   Finalized / Cancelled States
   ------------------------------------------------------------------------- */
.encounter-final {
    max-width: 600px;
    margin: 24px auto;
    text-align: center;
    padding: 40px 16px;
}

/* -------------------------------------------------------------------------
   Appointment Popover
   ------------------------------------------------------------------------- */
.appointment-popover {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 260px;
    max-width: 320px;
    background: var(--bg-primary, white);
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    z-index: 200;
    margin-top: 4px;
    overflow: hidden;
}

/* -------------------------------------------------------------------------
   In-Session Two-Column Layout
   ------------------------------------------------------------------------- */
.encounter-session-layout {
    display: flex;
    gap: 20px;
    padding: 24px;
    max-width: 1100px;
    margin: 0 auto;
}

.encounter-session-main {
    flex: 1;
    min-width: 0;
}

.encounter-session-main .encounter-step {
    margin: 0;
    padding: 0;
}

.encounter-session-sidebar {
    width: 300px;
    flex-shrink: 0;
}

/* -------------------------------------------------------------------------
   Clinical Sidebar
   ------------------------------------------------------------------------- */
.clinical-sidebar {
    background: var(--bg-primary, white);
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 12px;
    padding: 16px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

/* -------------------------------------------------------------------------
   Compliance Date Fields
   ------------------------------------------------------------------------- */
.compliance-date-field input[type="date"] {
    min-height: 32px;
    font-family: inherit;
}

/* -------------------------------------------------------------------------
   Socratic Assessment Questions
   ------------------------------------------------------------------------- */
.socratic-questions {
    margin: -8px 0 16px;
    padding: 8px 12px;
    background: var(--bg-secondary, #f8f9fa);
    border-left: 3px solid #7e57c2;
    border-radius: 0 6px 6px 0;
}

.socratic-question {
    font-size: 13px;
    color: var(--text-secondary, #555);
    padding: 4px 0;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.socratic-question i {
    color: #7e57c2;
    margin-top: 3px;
    font-size: 12px;
    flex-shrink: 0;
}

/* -------------------------------------------------------------------------
   Supervisor Co-sign Review Panel
   ------------------------------------------------------------------------- */
.cosign-review-panel {
    background: var(--bg-primary, white);
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #c5cae9;
    border-left: 4px solid #3949ab;
}

.cosign-actions {
    margin-top: 16px;
}

.revision-notes-input {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
    background: var(--bg-primary, white);
    color: var(--text-primary, #333);
}

.pending-cosign-banner {
    padding: 12px 20px;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 8px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.pending-cosign-banner i {
    color: #f57f17;
    font-size: 18px;
}

/* =============================================================================
   Mobile Responsive (≤768px)
   ============================================================================= */
@media (max-width: 768px) {
    /* Header: stack vertically on mobile */
    .encounter-header {
        flex-wrap: wrap;
        padding: 12px 16px;
        gap: 10px;
    }

    .encounter-header .encounter-title {
        font-size: 16px;
    }

    .encounter-header .encounter-info {
        order: 3;
        flex-basis: 100%;
    }

    .encounter-header .encounter-cancel-btn {
        margin-left: auto;
    }

    /* Step containers: full width, reduced margins */
    .encounter-step,
    .encounter-step--wide {
        max-width: 100%;
        margin: 12px auto;
        padding: 0 12px;
    }

    /* Timer: compact on mobile */
    .session-timer {
        padding: 16px;
        border-radius: 8px;
    }

    .session-timer .timer-display {
        font-size: 36px;
        letter-spacing: 1px;
    }

    .session-timer .timer-controls {
        flex-direction: column;
        gap: 8px;
    }

    .session-timer .timer-controls button {
        width: 100%;
        justify-content: center;
        padding: 14px;
    }

    /* Note workspace: full-width, stacked */
    .note-workspace {
        padding: 16px;
        border-radius: 8px;
    }

    .note-workspace .template-selector {
        flex-direction: column;
    }

    .note-workspace .template-selector button {
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    .note-workspace textarea {
        min-height: 150px; /* Taller on mobile for easier editing */
    }

    /* Billing panel: compact */
    .billing-panel {
        padding: 16px;
        border-radius: 8px;
    }

    /* Checklist: compact */
    .checklist-panel {
        padding: 16px;
        border-radius: 8px;
    }

    /* Audio recorder */
    .audio-recorder {
        padding: 12px;
    }

    /* Finalized state */
    .encounter-final {
        padding: 24px 16px;
    }

    .encounter-final h2 {
        font-size: 18px;
    }

    /* Session layout: stack on mobile */
    .encounter-session-layout {
        flex-direction: column;
        padding: 12px;
        gap: 12px;
    }

    .encounter-session-sidebar {
        width: 100%;
    }

    .clinical-sidebar {
        max-height: none;
        padding: 12px;
    }

    /* Co-sign panel: compact on mobile */
    .cosign-review-panel {
        padding: 16px;
        border-radius: 8px;
    }

    .pending-cosign-banner {
        padding: 10px 14px;
        font-size: 13px;
    }

    /* Popover: fixed centered on mobile (avoids off-screen overflow) */
    .appointment-popover {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        min-width: unset;
        max-width: unset;
        width: 100%;
        border-radius: 12px 12px 0 0;
        margin-top: 0;
    }

    /* Clinical sidebar: collapsible on mobile */
    .clinical-sidebar-toggle {
        display: flex !important;
    }
    .sidebar-collapsed .clinical-sidebar {
        display: none;
    }

    /* Copy from previous: full-width dropdown on mobile */
    .previous-notes-picker {
        min-width: unset;
        max-width: unset;
        left: 0;
        right: 0;
    }

    /* Scroll margin so anchor scrolls clear sticky headers */
    .encounter-step,
    .encounter-step--wide,
    .session-timer,
    .note-workspace,
    .billing-panel {
        scroll-margin-top: 80px;
    }
}

/* =============================================================================
   Small phones (≤480px)
   ============================================================================= */
@media (max-width: 480px) {
    .encounter-header .encounter-title {
        font-size: 14px;
    }

    .session-timer .timer-display {
        font-size: 28px;
    }

    .encounter-step,
    .encounter-step--wide {
        padding: 0 8px;
        margin: 8px auto;
    }
}

/* Source: 37-chat.css */
/* =============================================================================
   Conversation and chat components
   
   Source: styles.css lines 4219-4383
   ============================================================================= */

/* =============================================================================
   Conversation/Chat Components
   ============================================================================= */

.chat-thread {
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.chat-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 16px;
    margin-bottom: 12px;
}

.chat-bubble-outbound {
    margin-left: auto;
    background: var(--color-primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-bubble-inbound {
    margin-right: auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
}

.chat-bubble-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.chat-type-badge {
    font-size: 0.7em;
    padding: 2px 6px;
    border-radius: 4px;
    color: white;
    margin-right: 8px;
}

.chat-type-badge.sms {
    background: var(--color-success);
}

.chat-type-badge.email {
    background: var(--color-primary);
}

.chat-timestamp {
    font-size: 0.75em;
    color: var(--text-secondary);
}

.chat-bubble-outbound .chat-timestamp {
    color: rgba(255, 255, 255, 0.8);
}

.chat-subject {
    font-weight: bold;
    margin-bottom: 4px;
    font-size: 0.9em;
}

.chat-body {
    white-space: pre-wrap;
    word-break: break-word;
}

.chat-direction {
    font-size: 0.7em;
    color: var(--text-muted);
    margin-top: 4px;
    text-align: right;
}

.chat-bubble-outbound .chat-direction {
    color: rgba(255, 255, 255, 0.7);
}

/* Conversation row (grouped table) */
.conversation-row {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 8px;
    background: var(--bg-card);
}

.conversation-header {
    display: flex;
    align-items: center;
    padding: 12px;
    cursor: pointer;
    border-radius: 8px;
}

.conversation-header.expanded {
    background: var(--bg-info);
    border-radius: 8px 8px 0 0;
}

.conversation-expand-icon {
    margin-right: 12px;
    font-size: 1.2em;
}

.conversation-info {
    flex: 1;
    display: flex;
    gap: 20px;
    align-items: center;
}

.conversation-participant {
    font-weight: bold;
    min-width: 250px;
}

.conversation-type-badge {
    background: var(--bg-secondary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8em;
}

.conversation-count {
    color: var(--text-secondary);
}

.conversation-preview {
    flex: 1;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-time {
    color: var(--text-secondary);
    font-size: 0.85em;
}

.conversation-content {
    border-top: 1px solid var(--border-color);
    padding: 12px;
}

.conversation-stats {
    margin: 12px 0;
    color: var(--text-secondary);
}

.conversation-empty {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

/* =============================================================================
   Mobile Responsive — Conversation Components
   ============================================================================= */

@media (max-width: 768px) {
    .conversation-info {
        flex-direction: column;
        gap: 4px;
        align-items: flex-start;
    }

    .conversation-participant {
        min-width: 0;
        width: 100%;
    }

    .conversation-header {
        padding: 10px;
        flex-wrap: wrap;
    }

    .conversation-preview {
        width: 100%;
    }

    .chat-thread {
        max-height: 300px;
    }
}

/* Source: 38-chat-widget.css */
/* =============================================================================
   Floating chat widget overlay
   
   Source: styles.css lines 5972-6364
   ============================================================================= */

/* =============================================================================
   Chat Widget Styles
   ============================================================================= */

.chat-widget-container {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 3000;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Collapsed button */
.chat-widget-button {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--color-accent);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
    color: white;
    font-size: 22px;
}

.chat-widget-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.chat-widget-button .unread-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #ff4757;
    color: white;
    font-size: 12px;
    font-weight: bold;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* Expanded widget */
.chat-widget-expanded {
    width: 350px;
    height: 450px;
    background-color: var(--bg-primary);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.chat-widget-expanded .chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background-color: var(--color-accent);
    color: white;
}

.chat-widget-expanded .chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    flex: 1;
    text-align: center;
    color: white;
}

.chat-widget-expanded .chat-header .back-btn,
.chat-widget-expanded .chat-header .chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    margin: 0;
    box-shadow: none;
    min-width: 30px;
}

.chat-widget-expanded .chat-header .back-btn:hover,
.chat-widget-expanded .chat-header .chat-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

/* New chat button */
.new-chat-btn {
    margin: 8px;
    padding: 8px 16px;
    background-color: var(--bg-hover);
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    box-shadow: none;
}

.new-chat-btn:hover {
    background-color: var(--bg-tertiary);
}

/* Chat list */
.chat-list {
    flex: 1;
    overflow-y: auto;
}

.chat-list-view {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-list-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background-color 0.15s;
}

.chat-list-item:hover {
    background-color: var(--bg-secondary);
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--color-accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    margin-right: 12px;
    flex-shrink: 0;
}

.chat-info {
    flex: 1;
    min-width: 0;
}

.chat-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.chat-preview {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-left: 8px;
}

.chat-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.chat-unread-badge {
    background-color: var(--color-accent);
    color: white;
    font-size: 11px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.no-chats {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

/* Messages container */
.conversation-view {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px 16px 32px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background-color: var(--bg-secondary);
}

.message-bubble {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 16px;
    position: relative;
}

.message-bubble.mine {
    align-self: flex-end;
    background-color: var(--color-accent);
    color: white;
    border-bottom-right-radius: 4px;
}

.message-bubble.theirs {
    align-self: flex-start;
    background-color: var(--bg-card);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message-sender {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.message-content {
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.message-time {
    font-size: 10px;
    opacity: 0.7;
    margin-top: 4px;
    text-align: right;
}

/* Message input */
.message-input-container {
    display: flex;
    padding: 12px;
    border-top: 1px solid var(--border-light);
    background-color: var(--bg-primary);
}

.message-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    background-color: var(--bg-input);
    color: var(--text-primary);
    resize: none;
    min-height: 40px;
    max-height: 120px;
    line-height: 1.4;
    font-family: inherit;
    overflow-y: auto;
}

.message-input:focus {
    border-color: var(--color-accent);
}

.send-btn {
    margin-left: 8px;
    padding: 10px 16px;
    background-color: var(--color-accent);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    box-shadow: none;
}

.send-btn:hover {
    background-color: var(--color-accent-hover);
}

/* New chat view */
.new-chat-view {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.new-chat-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 12px;
    overflow: hidden;
}

.user-search {
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 12px;
    background-color: var(--bg-input);
    color: var(--text-primary);
}

.user-list {
    flex: 1;
    overflow-y: auto;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    background-color: var(--bg-primary);
}

.user-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
}

.user-item:hover {
    background-color: var(--bg-secondary);
}

.user-item.selected {
    background-color: var(--bg-selected);
}

.user-name {
    font-size: 14px;
    color: var(--text-primary);
}

.check-mark {
    color: var(--text-link);
    font-weight: bold;
}

.group-name {
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    margin: 12px 0;
    background-color: var(--bg-input);
    color: var(--text-primary);
}

.create-chat-btn {
    padding: 12px;
    background-color: var(--color-accent);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    margin-top: auto;
}

.create-chat-btn:disabled {
    background-color: var(--bg-tertiary);
    color: var(--text-muted);
    cursor: not-allowed;
}

.create-chat-btn:not(:disabled):hover {
    background-color: var(--color-accent-hover);
}

/* =============================================================================
   Mobile Responsive — Chat Widget
   ============================================================================= */

@media (max-width: 768px) {
    /* Full-screen chat widget on mobile */
    .chat-widget-container {
        bottom: 0 !important;
        right: 0 !important;
        left: 0;
        top: 0;
        z-index: 4000;
    }

    .chat-widget-expanded {
        width: 100% !important;
        height: 100% !important;
        border-radius: 0;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }

    /* Keep FAB in corner on mobile */
    .chat-widget-button {
        position: fixed;
        bottom: 20px;
        right: 20px;
    }

    /* Prevent iOS zoom on input focus */
    .message-input {
        font-size: 16px !important;
    }

    .user-search {
        font-size: 16px !important;
    }

    /* Wider bubbles on mobile */
    .message-bubble {
        max-width: 85%;
    }

    /* Larger touch targets for chat items */
    .chat-list-item {
        padding: 14px 16px;
        min-height: 44px;
    }

    .user-item {
        padding: 14px 16px;
        min-height: 44px;
    }

    /* Touch-friendly header buttons */
    .chat-widget-expanded .chat-header .back-btn,
    .chat-widget-expanded .chat-header .chat-close {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Hide new-chat button for client role (they can't create chats) */
    .client-messaging .new-chat-btn {
        display: none;
    }
}

/* Safe area insets for notched phones (iPhone X+, Dynamic Island) */
@supports (padding: env(safe-area-inset-bottom)) {
    @media (max-width: 768px) {
        .chat-widget-expanded .message-input-container {
            padding-bottom: calc(12px + env(safe-area-inset-bottom));
        }

        .chat-widget-expanded .chat-header {
            padding-top: calc(12px + env(safe-area-inset-top));
        }

        .chat-widget-button {
            bottom: calc(20px + env(safe-area-inset-bottom));
            right: calc(20px + env(safe-area-inset-right));
        }
    }
}

/* Source: 39-compliance.css */
/* =============================================================================
   Compliance dashboard
   
   Source: styles.css lines 10406-10685
   ============================================================================= */

/* =============================================================================
   Compliance Dashboard Components
   ============================================================================= */

.compliance-page {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.compliance-page h1 {
    color: var(--color-primary);
    font-weight: 800;
    margin: 0;
}

.compliance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.compliance-card {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow-md);
}

.compliance-card h3 {
    margin: 0 0 16px 0;
    color: var(--text-primary);
}

.compliance-empty {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

/* Compliance table */
.compliance-table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--bg-card);
}

.compliance-table thead tr {
    border-bottom: 2px solid var(--border-color);
    background-color: var(--bg-secondary);
}

.compliance-table th {
    padding: 12px;
    text-align: left;
    color: var(--text-primary);
    background-color: inherit;
}

.compliance-table th.center {
    text-align: center;
}

.compliance-table th.right {
    text-align: right;
}

/* Semantic colors for alert headers */
.compliance-table th.expired-header,
.compliance-table th.critical-header {
    color: #dc3545;
}

.compliance-table th.urgent-header {
    color: #fd7e14;
}

.compliance-table th.warning-header {
    color: #ffc107;
}

.compliance-table tbody {
    background-color: var(--bg-card);
}

.compliance-table tbody tr {
    cursor: pointer;
    transition: background 0.2s;
    background-color: var(--bg-card);
}

.compliance-table tbody tr:hover {
    background-color: var(--bg-hover);
}

.compliance-table td {
    padding: 12px;
    color: var(--text-primary);
    /* No background-color - let it inherit from tr */
}

.compliance-table td.center {
    text-align: center;
}

.compliance-table td.right {
    text-align: right;
}

/* Alert rows */
.compliance-table tr.has-issues {
    background-color: var(--bg-danger-subtle);
}

.compliance-table tr.alert-expired,
.compliance-table tr.alert-critical {
    background-color: var(--bg-danger-subtle);
}

.compliance-table tr.alert-urgent,
.compliance-table tr.alert-warning {
    background-color: var(--bg-warning-subtle);
}

/* Alert badges */
.compliance-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: bold;
    display: inline-block;
}

.compliance-badge.expired,
.compliance-badge.critical {
    background: var(--color-danger);
    color: white;
}

.compliance-badge.urgent {
    background: var(--color-warning);
    color: white;
}

.compliance-badge.warning {
    background: var(--color-warning);
    color: var(--text-primary);
}

.compliance-badge.ok {
    background: #28a745;
    color: white;
}

/* Status badge (alternate style) */
.compliance-status-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: bold;
}

.compliance-status-badge.expired,
.compliance-status-badge.critical {
    background-color: var(--color-danger);
    color: white;
}

.compliance-status-badge.urgent {
    background-color: var(--color-warning);
    color: white;
}

.compliance-status-badge.warning {
    background-color: var(--color-warning);
    color: var(--text-primary);
}

.compliance-status-badge.ok {
    background-color: var(--color-success);
    color: white;
}

/* Days text */
.compliance-days.expired {
    color: #dc3545;
    font-weight: bold;
}

.compliance-days.critical {
    color: #dc3545;
    font-weight: bold;
}

.compliance-days.urgent {
    color: #fd7e14;
    font-weight: bold;
}

.compliance-days.warning {
    color: #ffc107;
    font-weight: bold;
}

.compliance-days.ok {
    color: #28a745;
    font-weight: bold;
}

/* Back button */
.compliance-back-btn {
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

.compliance-back-btn:hover {
    background: var(--color-primary-dark);
}

/* View details button */
.compliance-view-btn {
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
}

.compliance-view-btn:hover {
    background: var(--color-primary-dark);
}

/* Loading state */
.compliance-loading {
    text-align: center;
    padding: 60px;
}

.compliance-loading .message {
    color: var(--text-secondary);
    font-size: 1.1em;
}

.compliance-loading .submessage {
    color: var(--text-muted);
    font-size: 0.9em;
    margin-top: 8px;
}

/* Filter bar */
.compliance-filter-bar {
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
}

/* Summary cards grid */
.compliance-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

/* Clickable KPI cards */
.metric-card[role="button"]:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Sortable table headers */
.compliance-table th.sorted {
    background-color: var(--bg-hover);
}

.compliance-table th:hover {
    background-color: var(--bg-hover);
}


/* Source: 39a-expiring-permits.css */
/* =============================================================================
   Expiring permits tile
   
   Source: styles.css lines 10766-10873
   ============================================================================= */

/* =============================================================================
   Expiring Permits Tile
   ============================================================================= */

.expiring-permits-tile {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
    box-shadow: var(--shadow-sm);
}

.expiring-permits-tile h3 {
    margin: 0 0 16px 0;
    color: var(--text-primary);
    font-size: 1em;
    font-weight: 600;
}

.expiring-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.expiring-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border-radius: 6px;
    border-left: 3px solid transparent;
}

.expiring-item.expired,
.expiring-item.critical {
    border-left-color: #dc3545;
    background-color: var(--bg-danger-subtle);
}

.expiring-item.urgent {
    border-left-color: #fd7e14;
    background-color: var(--bg-warning-subtle);
}

.expiring-item.warning {
    border-left-color: #ffc107;
    background-color: var(--bg-warning-subtle);
}

.permit-info {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    align-items: center;
}

.permit-type {
    font-weight: 500;
    color: var(--text-primary);
}

.permit-unit,
.permit-state {
    font-size: 0.85em;
    color: var(--text-secondary);
}

.days-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
    white-space: nowrap;
}

.days-badge.expired,
.days-badge.critical {
    background: #dc3545;
    color: white;
}

.days-badge.urgent {
    background: #fd7e14;
    color: white;
}

.days-badge.warning {
    background: #ffc107;
    color: #333;
}

.expiring-permits-tile .tile-footer {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
    text-align: center;
}

.expiring-permits-tile .tile-footer a {
    text-decoration: none;
}

.expiring-permits-tile .tile-footer a:hover {
    text-decoration: underline;
}


/* Source: 39b-action-screen.css */
/* =============================================================================
   Action Screen — compliance resolution modal
   ============================================================================= */

/* Overlay */
.action-screen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Modal */
.action-screen-modal {
    background: var(--bg-card, #fff);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Header */
.action-screen-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border-color, #e0e0e0);
}

.action-screen-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary, #1a1a1a);
}

.action-screen-subtitle {
    margin: 4px 0 0;
    font-size: 0.85rem;
    color: var(--text-muted, #888);
}

.action-screen-close {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: var(--text-muted, #888);
    padding: 0 4px;
    flex-shrink: 0;
}

.action-screen-close:hover {
    color: var(--text-primary, #1a1a1a);
}

/* Body */
.action-screen-body {
    padding: 20px 24px;
}

.action-screen-body.center {
    text-align: center;
    padding: 40px 24px;
}

.action-screen-hint {
    color: var(--text-muted, #888);
    margin-bottom: 16px;
    font-size: 0.9rem;
}

/* Upload slots */
.action-screen-upload-slot {
    border: 2px dashed var(--border-color, #ccc);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    transition: border-color 0.2s;
}

.action-screen-upload-slot.has-file {
    border-style: solid;
    border-color: var(--color-primary, #1565c0);
}

.upload-slot-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-primary, #1a1a1a);
}

.upload-preview {
    display: block;
    max-width: 300px;
    max-height: 200px;
    margin-top: 8px;
    border-radius: 4px;
    border: 1px solid var(--border-color, #ddd);
}

/* Error */
.action-screen-error {
    color: #c62828;
    padding: 8px 12px;
    background: #fce4ec;
    border-radius: 4px;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

/* Spinner */
.action-screen-spinner {
    font-size: 48px;
    margin-bottom: 16px;
    animation: action-spin 1s linear infinite;
}

/* Edit section */
.action-screen-edit-section {
    margin-top: 20px;
    padding: 16px;
    background: var(--bg-secondary, #f5f5f5);
    border-radius: 8px;
}

.action-screen-edit-section h4 {
    margin: 0 0 12px 0;
    font-size: 0.95rem;
    color: var(--text-primary, #1a1a1a);
}

.action-screen-edit-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.edit-field-label {
    min-width: 120px;
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--text-secondary, #555);
}

.edit-field-input {
    flex: 1;
    padding: 4px 8px;
    border: 1px solid var(--border-color, #ccc);
    border-radius: 4px;
    font-size: 0.85rem;
    background: var(--bg-card, #fff);
    color: var(--text-primary, #1a1a1a);
}

/* Actions bar */
.action-screen-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.action-screen-btn {
    padding: 10px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    border: none;
    transition: opacity 0.2s;
}

.action-screen-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.action-screen-btn.primary {
    background: var(--color-primary, #1565c0);
    color: #fff;
}

.action-screen-btn.primary:hover:not(:disabled) {
    opacity: 0.9;
}

.action-screen-btn.secondary {
    background: transparent;
    color: var(--text-secondary, #555);
    border: 1px solid var(--border-color, #ccc);
}

.action-screen-btn.secondary:hover:not(:disabled) {
    background: var(--bg-secondary, #f5f5f5);
}

.action-screen-btn.danger {
    background: transparent;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.action-screen-btn.danger:hover:not(:disabled) {
    background: #ffebee;
}

/* Workflow summary step */
.action-screen-summary {
    padding: 4px 0;
}

.summary-fields {
    margin-bottom: 12px;
}

.summary-field-row:last-child {
    border-bottom: none !important;
}

/* Form flow section */
.action-screen-form-section textarea.edit-field-input {
    font-family: inherit;
}

/* Deactivate warning box */
.action-screen-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    color: #856404;
    font-size: 0.9em;
}

.action-screen-warning p { margin: 0 0 8px; }
.action-screen-warning ul { margin: 0; padding-left: 20px; }

.action-screen-warning-title {
    margin: 0 0 8px;
    color: #856404;
}

.action-screen-warning-note {
    font-style: italic;
    margin-top: 8px;
}

/* Dark mode — explicit */
[data-theme="dark"] .action-screen-warning {
    background: #3a2e00;
    border-color: #7a6a00;
    color: #ffe082;
}

[data-theme="dark"] .action-screen-warning-title {
    color: #ffd54f;
}

[data-theme="dark"] .action-screen-btn.danger {
    color: #ef5350;
    border-color: #7f1d1d;
}

[data-theme="dark"] .action-screen-btn.danger:hover:not(:disabled) {
    background: #3e1212;
}

/* Dark mode — system preference */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .action-screen-warning {
        background: #3a2e00;
        border-color: #7a6a00;
        color: #ffe082;
    }

    :root:not([data-theme="light"]) .action-screen-warning-title {
        color: #ffd54f;
    }

    :root:not([data-theme="light"]) .action-screen-btn.danger {
        color: #ef5350;
        border-color: #7f1d1d;
    }

    :root:not([data-theme="light"]) .action-screen-btn.danger:hover:not(:disabled) {
        background: #3e1212;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .action-screen-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .action-screen-modal {
        max-width: 100%;
        max-height: 95vh;
        border-radius: 12px 12px 0 0;
    }

    .action-screen-edit-row {
        flex-direction: column;
        align-items: stretch;
    }

    .edit-field-label {
        min-width: unset;
    }

    .upload-preview {
        max-width: 100%;
    }
}

/* Source: 40-visitor-desktop.css */
/* =============================================================================
   Desktop visitor experience
   
   Source: styles.css lines 7867-8065
   ============================================================================= */

/* =============================================================================
   Visitor Single-Page Experience (Desktop)
   ============================================================================= */

.visitor-single-page {
    min-height: 100vh;
    background: var(--bg-body);
}

.visitor-application-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.visitor-page-header {
    display: flex;
    justify-content: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.visitor-page-header img {
    height: 60px;
    width: auto;
}

/* Status Banner */
.visitor-status-banner {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    color: white;
}

.visitor-status-banner .status-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.visitor-status-banner .status-label {
    font-size: 18px;
    font-weight: 600;
}

.visitor-status-banner .status-message {
    font-size: 14px;
    opacity: 0.9;
}

/* Options Container */
.visitor-options-container {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 32px;
    box-shadow: var(--shadow-md);
    text-align: center;
}

.visitor-options-container h1 {
    margin-bottom: 24px;
    color: var(--text-primary);
}

/* Pre-submission options */
.pre-submission-options .app-option-text {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 16px;
}

.pre-submission-options .app-option-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.pre-submission-options .app-btn-scanner,
.pre-submission-options .app-btn-manual {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px 32px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    min-width: 180px;
}

.pre-submission-options .app-btn-scanner {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
}

.pre-submission-options .app-btn-manual {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    color: white;
}

.pre-submission-options .app-btn-scanner:hover,
.pre-submission-options .app-btn-manual:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Post-submission view */
.post-submission-options .app-status-info {
    background: var(--bg-secondary);
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 16px;
    text-align: left;
}

.post-submission-options .app-status-info p {
    margin: 6px 0;
    color: var(--text-primary);
}

/* Update Button */
.app-btn-update {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 8px;
}

.app-btn-update:hover {
    background: var(--color-primary-dark, #1565c0);
}

/* Main content area */
.visitor-main-content {
    margin-top: 20px;
}

/* Scanner container */
.scanner-container {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-md);
}

/* Form container */
.form-container {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-md);
}

.scan-results-actions {
    display: flex;
    gap: 10px;
    padding: 16px;
    background-color: var(--bg-card);
    border-radius: 8px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.scanner-btn-use {
    padding: 14px 20px;
    background-color: var(--color-success);
    color: var(--text-inverse);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    flex: 1;
}

.scanner-btn-rescan {
    padding: 14px 20px;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
}


/* Source: 40a-client-portal.css */
/* =============================================================================
   Client Portal responsive styles
   
   The client portal uses inline styles for desktop layout.
   These rules provide mobile overrides via CSS classes added to key elements.
   ============================================================================= */

/* =============================================================================
   Mobile Responsive — Client Portal
   ============================================================================= */

@media (max-width: 768px) {
    /* Portal header: stack on narrow screens */
    .portal-header {
        flex-wrap: wrap !important;
        padding: 12px 15px !important;
    }

    .portal-header-actions {
        gap: 8px !important;
    }

    /* Portal content: reduce padding on mobile */
    .portal-content {
        padding: 12px !important;
    }

    /* Welcome card: smaller padding */
    .portal-welcome-card {
        padding: 18px !important;
        margin-bottom: 15px !important;
    }

    .portal-welcome-card h2 {
        font-size: 18px !important;
    }

    /* Messages card: stack vertically on mobile */
    .portal-messaging-card {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px;
    }

    .portal-messaging-card button {
        width: 100%;
        min-height: 44px;
    }

    /* Section spacing tighter on mobile */
    .portal-section {
        margin-bottom: 15px !important;
    }

    /* Cards: full-width buttons */
    .portal-card-actions button {
        width: 100%;
        min-height: 44px;
        justify-content: center;
    }

    /* Appointment/Invoice cards: stack on narrow */
    .portal-item-card {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px;
    }

    .portal-item-card .portal-card-actions {
        width: 100%;
    }

    /* Modal adjustments for portal */
    .portal-modal {
        padding: 20px !important;
    }
}

@media (max-width: 480px) {
    .portal-content {
        padding: 8px !important;
    }

    .portal-welcome-card {
        padding: 15px !important;
        border-radius: 8px !important;
    }

    .portal-welcome-card h2 {
        font-size: 16px !important;
    }

    .portal-messaging-card {
        padding: 15px !important;
    }
}

/* =============================================================================
   Client Messaging Page (main app for client role)
   ============================================================================= */

@media (max-width: 768px) {
    .client-messaging-header {
        padding: 10px 15px !important;
        flex-wrap: wrap !important;
        gap: 8px;
    }

    .client-messaging-header a,
    .client-messaging-header button {
        padding: 8px 12px !important;
        font-size: 13px !important;
        min-height: 44px;
    }

    .client-messaging-center {
        padding: 15px !important;
    }

    .client-messaging-center p {
        font-size: 14px !important;
    }
}

/* Source: 41-visitor-mobile.css */
/* =============================================================================
   Mobile visitor application
   
   Source: styles.css lines 7090-7313
   ============================================================================= */

/* =============================================================================
   Mobile Visitor Application Styles
   ============================================================================= */

.mobile-visitor-app {
    min-height: 100vh;
    background-color: var(--bg-body);
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.visitor-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    padding-top: calc(12px + env(safe-area-inset-top));
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
}

.visitor-header img {
    height: 40px;
    max-width: 240px;
    object-fit: contain;
}

.visitor-options {
    padding: 20px;
}

.visitor-options h2 {
    margin-bottom: 16px;
    text-align: center;
    color: var(--text-primary);
}

.visitor-options p {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 24px;
}

.visitor-btn-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.visitor-btn {
    width: 100%;
    padding: 20px 24px;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.visitor-btn-success {
    background-color: var(--color-success);
    color: var(--text-inverse);
    box-shadow: 0 2px 8px rgba(76,175,80,0.3);
}

.visitor-btn-primary {
    background-color: var(--color-primary);
    color: var(--text-inverse);
    box-shadow: 0 2px 8px rgba(25,118,210,0.3);
}

.visitor-btn-secondary {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.visitor-btn i {
    font-size: 24px;
}

.visitor-scanner-view {
    padding: 16px;
}

.visitor-form-view {
    padding: 16px;
}

.visitor-status-view {
    padding: 16px;
    text-align: center;
    max-width: 720px;
    margin: 0 auto;
}

.visitor-status-view h2 {
    margin-bottom: 12px;
    color: var(--text-primary);
}

.visitor-status-summary {
    color: var(--text-primary);
    margin: 12px 0 8px;
    line-height: 1.45;
    font-weight: 500;
}

.visitor-status-next-step {
    color: var(--text-secondary);
    margin: 0 0 16px;
    line-height: 1.45;
}

.visitor-status-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 16px;
    text-align: left;
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
}

.visitor-status-card p {
    margin: 6px 0;
    color: var(--text-primary);
}

.visitor-update-button {
    margin-top: 4px;
}

.visitor-update-help {
    margin: 10px 2px 0;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.visitor-notes-section {
    margin-top: 20px;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
    text-align: left;
}

.visitor-notes-title {
    margin: 0 0 8px;
    color: var(--text-primary);
    font-weight: 600;
}

.visitor-notes-guidance {
    margin: 0 0 14px;
    color: var(--text-secondary);
    line-height: 1.45;
    font-size: 14px;
}

.visitor-notes-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.visitor-note-item {
    border-radius: 10px;
    padding: 12px;
    background: var(--bg-secondary);
}

.visitor-note-text {
    margin: 0;
    color: var(--text-primary);
    line-height: 1.45;
    font-size: 14px;
    word-break: break-word;
}

.visitor-note-meta {
    margin: 8px 0 0;
    color: var(--text-secondary);
    font-size: 12px;
}

.visitor-notes-empty {
    margin: 0 0 12px;
    color: var(--text-secondary);
    font-size: 14px;
}

.visitor-note-form {
    margin-top: 14px;
}

.visitor-note-input {
    width: 100%;
    min-height: 92px;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 16px;
    line-height: 1.45;
    resize: vertical;
}

.visitor-note-input::placeholder {
    color: var(--text-secondary);
    opacity: 1;
    font-family: inherit;
    letter-spacing: 0;
}

.visitor-note-submit {
    margin-top: 10px;
    margin-bottom: 0;
}

.visitor-loading {
    padding: 40px;
    text-align: center;
    color: var(--text-primary);
}

/* Status badge - semantic colors preserved */
.status-badge {
    display: inline-block;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 700;
    border-radius: 999px;
    margin-bottom: 8px;
    letter-spacing: 0.01em;
    text-transform: capitalize;
}

/* Positive status variants (green) */
.status-badge.status-active,
.status-badge.status-completed,
.status-badge.status-confirmed,
.status-badge.status-met,
.status-badge.status-paid {
    background: #e8f5e9;
    color: #2e7d32;
}

/* Neutral/pending status variants (blue) */
.status-badge.status-pending,
.status-badge.status-scheduled,
.status-badge.status-in-progress,
.status-badge.status-waitlist {
    background: #e3f2fd;
    color: #1565c0;
}

/* Warning status variants (amber/orange) */
.status-badge.status-on-leave,
.status-badge.status-partially-met,
.status-badge.status-no-show {
    background: #fff3e0;
    color: #ef6c00;
}

/* Inactive/negative status variants (gray/red) */
.status-badge.status-inactive,
.status-badge.status-cancelled,
.status-badge.status-discharged,
.status-badge.status-discontinued,
.status-badge.status-revoked {
    background: #fafafa;
    color: #757575;
}

.status-badge.status-failed,
.status-badge.status-overdue {
    background: #ffebee;
    color: #c62828;
}

/* Dark mode overrides */
[data-theme="dark"] .status-badge.status-active,
[data-theme="dark"] .status-badge.status-completed,
[data-theme="dark"] .status-badge.status-confirmed,
[data-theme="dark"] .status-badge.status-met,
[data-theme="dark"] .status-badge.status-paid {
    background: rgba(46, 125, 50, 0.2);
    color: #81c784;
}

[data-theme="dark"] .status-badge.status-pending,
[data-theme="dark"] .status-badge.status-scheduled,
[data-theme="dark"] .status-badge.status-in-progress,
[data-theme="dark"] .status-badge.status-waitlist {
    background: rgba(21, 101, 192, 0.2);
    color: #64b5f6;
}

[data-theme="dark"] .status-badge.status-on-leave,
[data-theme="dark"] .status-badge.status-partially-met,
[data-theme="dark"] .status-badge.status-no-show {
    background: rgba(239, 108, 0, 0.2);
    color: #ffb74d;
}

[data-theme="dark"] .status-badge.status-inactive,
[data-theme="dark"] .status-badge.status-cancelled,
[data-theme="dark"] .status-badge.status-discharged,
[data-theme="dark"] .status-badge.status-discontinued,
[data-theme="dark"] .status-badge.status-revoked {
    background: rgba(117, 117, 117, 0.2);
    color: #bdbdbd;
}

[data-theme="dark"] .status-badge.status-failed,
[data-theme="dark"] .status-badge.status-overdue {
    background: rgba(198, 40, 40, 0.2);
    color: #ef9a9a;
}

[data-theme="dark"] .visitor-notes-section,
[data-theme="dark"] .visitor-status-card {
    border-color: var(--border-color);
}

[data-theme="dark"] .visitor-note-item {
    background: var(--bg-secondary);
}

[data-theme="dark"] .visitor-note-input {
    background: var(--bg-body);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .visitor-notes-section,
    :root:not([data-theme="light"]) .visitor-status-card {
        border-color: var(--border-color);
    }

    :root:not([data-theme="light"]) .visitor-note-item {
        background: var(--bg-secondary);
    }

    :root:not([data-theme="light"]) .visitor-note-input {
        background: var(--bg-body);
    }
}

/* Source: 42-scanner.css */
/* =============================================================================
   Photo and document scanner
   
   Source: styles.css lines 7314-7591
   ============================================================================= */

/* =============================================================================
   Photo Scanner Styles (Resume and Item scanners)
   ============================================================================= */

.resume-photo-scanner,
.item-photo-scanner {
    padding: 20px;
    padding-bottom: 100px;
    background-color: var(--bg-body);
}

.resume-photo-scanner h2,
.item-photo-scanner h2 {
    margin-bottom: 20px;
    color: var(--text-primary);
}

.resume-photo-scanner > p,
.item-photo-scanner > p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.scanner-btn-row {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.scanner-btn-camera {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background-color: var(--color-primary);
    color: var(--text-inverse);
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    border: none;
}

.scanner-btn-camera.disabled {
    background-color: var(--text-muted);
    cursor: not-allowed;
}

.scanner-btn-file {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background-color: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}

.scanner-btn-file.disabled {
    background-color: var(--bg-secondary);
    color: var(--text-muted);
    cursor: not-allowed;
}

.photo-preview {
    margin-bottom: 20px;
}

.photo-preview > p {
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.photo-preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.photo-thumbnail-wrapper {
    position: relative;
}

.photo-thumbnail {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: var(--shadow-sm);
}

.photo-remove-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background-color: var(--color-danger);
    color: var(--text-inverse);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 24px;
    padding: 0;
}

.scanner-actions {
    display: flex;
    gap: 10px;
}

.scanner-btn-analyze {
    padding: 10px 20px;
    background-color: var(--color-success);
    color: var(--text-inverse);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}

.scanner-btn-clear {
    padding: 10px 20px;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
}

.scanning-indicator {
    text-align: center;
    padding: 20px;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 20px;
}

.scanning-indicator .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

.scanning-indicator span {
    color: var(--text-secondary);
}

.scan-results {
    background-color: var(--bg-secondary);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
}

.scan-results h3 {
    margin-bottom: 15px;
    color: var(--text-primary);
}

.scan-results-section {
    margin-bottom: 20px;
}

.scan-results-section h4 {
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-size: 14px;
    text-transform: uppercase;
}

.scan-result-field {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.scan-result-field .field-label {
    font-weight: 500;
    color: var(--text-secondary);
}

.scan-result-field .field-value {
    color: var(--text-primary);
}

.employment-card,
.driving-exp-card {
    padding: 10px;
    margin-bottom: 8px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.employment-card .employer-name {
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.employment-card .position-info {
    color: var(--text-secondary);
    font-size: 14px;
}

.employment-card .date-range {
    color: var(--text-muted);
    font-size: 13px;
}

.driving-exp-card {
    padding: 8px;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
}

.driving-exp-card .miles {
    color: var(--text-secondary);
}

.confidence-indicator {
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
}

.confidence-indicator.high {
    background-color: rgba(76, 175, 80, 0.1);
    border-left: 4px solid var(--color-success);
}

.confidence-indicator.medium {
    background-color: rgba(255, 152, 0, 0.1);
    border-left: 4px solid var(--color-warning);
}

.confidence-indicator.low {
    background-color: rgba(244, 67, 54, 0.1);
    border-left: 4px solid var(--color-danger);
}

.confidence-indicator span {
    font-weight: 500;
}

.scanner-notes {
    margin-top: 10px;
    padding: 10px;
    background-color: var(--color-warning-bg);
    border: 1px solid var(--color-warning);
    border-radius: 4px;
    color: var(--color-warning-text);
}

.scanner-notes-header {
    font-weight: 500;
    margin-bottom: 8px;
}

.scan-results-images {
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

/* =============================================================================
   Mobile Receipts Page - Tab Bar and Fuel Purchases List
   ============================================================================= */

.mobile-receipts-page {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Tab bar */
.receipts-tab-bar {
    display: flex;
    gap: 10px;
    padding: 10px 15px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.receipts-tab-bar button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.receipts-tab-bar button.active {
    background: var(--color-primary);
    color: white;
}

.receipts-tab-bar button i {
    font-size: 16px;
}

.receipts-tab-bar .tab-count {
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    margin-left: 4px;
}

.receipts-tab-bar button:not(.active) .tab-count {
    background: var(--bg-tertiary);
}

/* Scanner container */
.receipts-scanner-container {
    flex: 1;
    overflow-y: auto;
}

/* Fuel purchases list */
.fuel-purchases-list {
    padding: 15px;
    overflow-y: auto;
    flex: 1;
}

/* Fuel purchase card */
.fp-card {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border-left: 4px solid var(--color-primary);
}

.fp-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.fp-vendor {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
}

.fp-amount {
    font-weight: 700;
    font-size: 18px;
    color: var(--color-primary);
}

.fp-card-body {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

.fp-date {
    display: flex;
    align-items: center;
    gap: 4px;
}

.fp-date::before {
    content: "\f073"; /* fa-calendar */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 11px;
    color: var(--text-muted);
}

.fp-details {
    display: flex;
    align-items: center;
    gap: 4px;
}

.fp-details::before {
    content: "\f52f"; /* fa-gas-pump */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 11px;
    color: var(--text-muted);
}

.fp-jurisdiction {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-secondary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}

/* Empty state */
.fp-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.fp-empty-state i {
    font-size: 56px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.fp-empty-state p {
    font-size: 16px;
    margin: 0;
}

.fp-empty-hint {
    font-size: 14px !important;
    color: var(--text-muted) !important;
    margin-top: 8px !important;
}


/* Source: 43a-onboarding.css */
/* =============================================================================
   Tutorial and onboarding styles
   
   Source: styles.css lines 5771-5971
   ============================================================================= */

/* =============================================================================
   Tutorial / Onboarding Styles
   ============================================================================= */

.tutorial-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3050;
    pointer-events: none;
}

.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 3050;
    pointer-events: none;
}

/* Hide overlay background when spotlight is active - spotlight provides its own shadow */
.tutorial-overlay.has-spotlight {
    background: transparent;
}

.tutorial-spotlight {
    position: fixed;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.7);
    border-radius: 4px;
    z-index: 3075;
    pointer-events: none;
    background: transparent;
}

.tutorial-popover {
    position: fixed;
    background: var(--bg-card);
    border-radius: 8px;
    padding: 20px;
    max-width: 320px;
    min-width: 280px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 3100;
    pointer-events: auto;
}

.tutorial-popover h3 {
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.tutorial-popover p {
    margin: 0 0 16px 0;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

.tutorial-popover .buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 16px;
}

.tutorial-popover button {
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.tutorial-popover .skip-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.tutorial-popover .skip-btn:hover {
    background: var(--bg-secondary);
}

.tutorial-popover .prev-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.tutorial-popover .prev-btn:hover {
    background: var(--bg-tertiary);
}

.tutorial-popover .next-btn {
    background: var(--color-primary);
    color: white;
    border: none;
}

.tutorial-popover .next-btn:hover {
    background: var(--color-primary-dark);
}

.tutorial-progress {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 12px;
}

.tutorial-progress .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-color);
    transition: background 0.2s;
}

.tutorial-progress .dot.active {
    background: var(--color-primary);
}

.tutorial-progress .dot.completed {
    background: var(--color-success);
}

/* Help/Tutorial button in navbar */
.help-tutorial-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.help-tutorial-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

/* Navbar help buttons container */
.navbar-help {
    padding: 8px 15px;
}

.navbar-help .help-tutorial-btn {
    width: 100%;
    justify-content: flex-start;
    border: none;
    background: transparent;
    color: var(--text-muted);
    padding: 10px 0;
    margin: 0;
    font-size: 14px;
}

.navbar-help .help-tutorial-btn:hover {
    color: var(--text-inverse);
    background: transparent;
}

.navbar-help .help-tutorial-btn i {
    font-size: 18px;
    width: 20px;
    text-align: center;
    margin-right: 10px;
}

/* Collapsed state for help buttons */
@media (min-width: 769px) {
    .navbar.sidebar.collapsed .navbar-help {
        padding: 8px 0;
        display: flex;
        justify-content: center;
    }

    .navbar.sidebar.collapsed .navbar-help .help-tutorial-btn {
        justify-content: center;
        padding: 10px 0;
        width: auto;
    }

    .navbar.sidebar.collapsed .navbar-help .help-tutorial-btn span {
        display: none;
    }

    .navbar.sidebar.collapsed .navbar-help .help-tutorial-btn i {
        margin-right: 0;
    }
}


/* Source: 43b-walkthrough.css */
/* =============================================================================
   AI-driven walkthrough
   
   Source: styles.css lines 10874-11018
   ============================================================================= */

/* =============================================================================
   Walkthrough Styles (AI-driven guidance)
   ============================================================================= */

.walkthrough-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9996;
    pointer-events: none;
}

.walkthrough-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.walkthrough-spotlight {
    position: fixed;
    border: 3px solid var(--color-primary);
    border-radius: 8px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    z-index: 9998;
    pointer-events: none;
    animation: walkthrough-pulse 1.5s ease-in-out infinite;
}

@keyframes walkthrough-pulse {
    0%, 100% {
        box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5), 0 0 0 0 rgba(33, 150, 243, 0.4);
    }
    50% {
        box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5), 0 0 20px 10px rgba(33, 150, 243, 0);
    }
}

.walkthrough-popover {
    position: fixed;
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    padding: 20px;
    max-width: 340px;
    z-index: 9999;
    pointer-events: auto;
}

.walkthrough-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.walkthrough-header i {
    font-size: 18px;
}

.walkthrough-header span {
    font-weight: 600;
    color: var(--text-primary);
}

.walkthrough-instruction {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.walkthrough-progress {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 15px 0;
}

.walkthrough-progress .progress-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.walkthrough-buttons {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 16px;
}

.walkthrough-skip,
.walkthrough-prev,
.walkthrough-next {
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.walkthrough-skip {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.walkthrough-skip:hover {
    background: var(--bg-secondary);
}

.walkthrough-prev {
    background: white;
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
}

.walkthrough-prev:hover {
    background: var(--color-primary-light);
}

.walkthrough-next {
    background: var(--color-primary);
    border: none;
    color: white;
    font-weight: 500;
}

.walkthrough-next:hover {
    background: var(--color-primary-dark);
}

/* Dark mode support */
[data-theme="dark"] .walkthrough-popover {
    background: var(--bg-card);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}


/* Source: 44a-application-status.css */
/* =============================================================================
   Application status component
   
   Source: styles.css lines 7592-7866
   ============================================================================= */

/* =============================================================================
   Application Status Component
   ============================================================================= */

.application-status-page {
    padding: 40px;
    max-width: 700px;
    margin: 0 auto;
}

.application-status-page h1 {
    margin-bottom: 24px;
    color: var(--text-primary);
}

.app-status-loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.app-status-error {
    padding: 20px;
    background-color: var(--color-danger-bg);
    border-radius: 8px;
    color: var(--color-danger);
}

.app-status-warning {
    padding: 24px;
    background-color: var(--color-warning-bg);
    border-radius: 8px;
    color: var(--color-warning-text);
}

.app-status-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px;
    gap: 16px;
}

.app-status-loading .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.app-status-loading p {
    color: var(--color-text-secondary);
    font-size: 16px;
}

.app-info-banner {
    margin-bottom: 24px;
    padding: 16px;
    background-color: var(--color-info-bg);
    border-radius: 8px;
}

.app-info-banner p {
    margin: 0;
    color: var(--color-info-text);
}

.app-form-email {
    margin-bottom: 16px;
}

.app-form-email label {
    display: block;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.app-form-email input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
}

.app-option-text {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.app-option-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.app-btn-scanner {
    flex: 1;
    min-width: 200px;
    padding: 16px 24px;
    background-color: var(--color-success);
    color: var(--text-inverse);
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.app-btn-manual {
    flex: 1;
    min-width: 200px;
    padding: 16px 24px;
    background-color: var(--color-primary);
    color: var(--text-inverse);
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.app-btn-back {
    margin-bottom: 16px;
    padding: 8px 16px;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
}

.app-btn-back i {
    margin-right: 8px;
}

.app-status-card {
    padding: 24px;
    background-color: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

.app-status-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.app-status-header h2 {
    margin: 0;
    color: var(--text-primary);
}

.app-status-info {
    margin-top: 16px;
}

.app-status-info p {
    margin: 4px 0;
    color: var(--text-secondary);
}

.app-status-message {
    margin-top: 16px;
    padding: 16px;
    background-color: var(--bg-secondary);
    border-radius: 8px;
}

.app-status-message p {
    margin: 0;
    color: var(--text-primary);
}

/* Notes Section */
.notes-section {
    margin-top: 32px;
    padding: 24px;
    background-color: var(--bg-card);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.notes-section h3 {
    margin-bottom: 16px;
    color: var(--text-primary);
}

.notes-loading {
    color: var(--text-secondary);
}

.notes-empty {
    color: var(--text-muted);
    font-style: italic;
}

.notes-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 16px;
}

.note-item {
    padding: 12px;
    background-color: var(--bg-secondary);
    border-radius: 4px;
    margin-bottom: 8px;
}

.note-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.note-author {
    font-weight: 500;
    color: var(--text-primary);
}

.note-date {
    font-size: 12px;
    color: var(--text-muted);
}

.note-text {
    margin: 0;
    color: var(--text-secondary);
}

.add-note-form textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    resize: vertical;
    font-family: inherit;
    background-color: var(--bg-card);
    color: var(--text-primary);
}

.add-note-btn {
    margin-top: 8px;
    padding: 10px 20px;
    background-color: var(--color-primary);
    color: var(--text-inverse);
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.add-note-btn:disabled {
    background-color: var(--bg-tertiary);
    cursor: not-allowed;
}


/* Source: 44b-automation.css */
/* =============================================================================
   Automation editor
   
   Source: styles.css lines 11019-11116
   ============================================================================= */

/* =============================================================================
   Automation Editor Styles
   ============================================================================= */

.automation-config-container {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-secondary);
    margin-top: 4px;
}

.automation-param-container {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-secondary);
    margin-top: 4px;
}

.automation-param-card {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin-bottom: 8px;
    padding: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.automation-btn-outline {
    padding: 8px 16px;
    border: 1px solid var(--color-accent);
    background: var(--bg-input);
    color: var(--color-accent);
    border-radius: 4px;
    cursor: pointer;
}

.automation-btn-outline:hover {
    background: var(--bg-hover);
}

.automation-label {
    display: block;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.automation-input {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-input);
    color: var(--text-primary);
}

.automation-select {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-input);
    color: var(--text-primary);
}

.automation-textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: monospace;
}

.automation-helper-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.automation-section-divider {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.automation-section-title {
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
}



/* Source: 45-admin.css */
/* =============================================================================
   Super admin metrics page
   
   Source: styles.css lines 11117-11123
   ============================================================================= */

/* =============================================================================
   Super Admin Metrics Page
   ============================================================================= */

.table-row-hover:hover {
    background-color: var(--bg-hover) !important;
}

/* Source: 46-mobile-graph-workflow.css */
/* ==========================================================================
   46-mobile-graph-workflow.css
   Mobile Graph Workflow page (.mgw-*)
   ========================================================================== */

/* Page container */
.mgw-page {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  background: var(--bg-primary);
}

/* Page header banner */
.mgw-page-header {
  background: linear-gradient(135deg, #3f51b5 0%, #303f9f 100%);
  color: white;
  padding: 20px 16px 16px;
}

/* Instance list cards */
.mgw-instance-card {
  background: var(--bg-card);
  border-radius: 8px;
  margin-bottom: 10px;
  padding: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mgw-instance-card:active {
  opacity: 0.8;
}

.mgw-card-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.mgw-card-status {
  font-size: 12px;
  font-weight: 500;
}

/* Detail view */
.mgw-detail {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.mgw-detail-header {
  padding: 16px;
  color: white;
}

.mgw-detail-title {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 4px;
}

.mgw-detail-current {
  margin-top: 6px;
}

/* Transitions section */
.mgw-transitions {
  padding: 16px;
}

.mgw-transitions-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 12px 0;
}

/* Individual transition card */
.mgw-transition-card {
  background: var(--bg-card);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.mgw-transition-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.mgw-transition-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Fire transition button */
.mgw-fire-btn {
  width: 100%;
  min-height: 44px;
  padding: 12px;
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
}

.mgw-fire-btn:active {
  opacity: 0.85;
}

/* Terminal state message */
.mgw-terminal-msg {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
}

.mgw-terminal-msg .fa {
  font-size: 32px;
  color: #4caf50;
  display: block;
  margin-bottom: 12px;
}

/* Empty / no-data state */
.mgw-empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-secondary);
  font-size: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* Form inside transition card */
.mgw-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}

.mgw-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Input/select/textarea shared style */
.mgw-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: var(--bg-secondary);
  color: var(--text-primary);
  box-sizing: border-box;
  min-height: 44px;
}

.mgw-input:focus {
  outline: none;
  border-color: var(--color-primary, #3f51b5);
}

textarea.mgw-input {
  min-height: 80px;
  resize: vertical;
}

/* Source: 46a-fsp-encounter.css */
/* ==========================================================================
   Mobile FSP Encounter — .mfe-* prefix
   Minimal overrides; most styling is inline via ClojureScript.
   ========================================================================== */

/* Timer hero treatment — larger on mobile */
.mfe-timer-hero .session-timer .timer-display {
  font-size: 56px;
  font-weight: 700;
  letter-spacing: 2px;
}

/* Recording pulse animation */
@keyframes mfe-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.15); }
}

.mfe-recording-pulse {
  animation: mfe-pulse 1.5s ease-in-out infinite;
}

/* Clinical reference bottom sheet */
.mfe-clinical-sheet {
  max-height: 70vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Bottom safe area for iPhone notch */
.mfe-bottom-safe {
  padding-bottom: env(safe-area-inset-bottom, 0);
}

/* Encounter page full-screen layout */
.mfe-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary, #f5f5f5);
}

/* Sticky header */
.mfe-header {
  position: sticky;
  top: 0;
  z-index: 50;
}

/* Touch-friendly buttons */
.mfe-action-btn {
  min-height: 44px;
  min-width: 44px;
}

/* Source: 47-group-session.css */
/* ==========================================================================
   Group Session Components — .gs-* prefix
   ========================================================================== */

/* Header */
.gs-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  background: var(--bg-primary, white);
  border-bottom: 1px solid var(--border-color, #e0e0e0);
  flex-wrap: wrap;
}

.gs-back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--border-color, #ddd);
  border-radius: 6px;
  background: var(--bg-primary, white);
  color: var(--text-primary, #333);
  cursor: pointer;
  font-size: 13px;
  min-height: 36px;
}

.gs-back-btn:hover {
  background: var(--bg-secondary, #f5f5f5);
}

.gs-header-info {
  flex: 1;
  min-width: 0;
}

.gs-header-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary, #333);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gs-header-meta {
  font-size: 13px;
  color: var(--text-secondary, #666);
  margin-top: 2px;
}

.gs-status-badge {
  padding: 6px 16px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
}

.gs-type-badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.gs-type-badge--standalone { background: #e8f5e9; color: #2e7d32; }
.gs-type-badge--iop { background: #e3f2fd; color: #1565c0; }
.gs-type-badge--php { background: #f3e5f5; color: #6a1b9a; }

/* Steps */
.gs-step {
  padding: 24px;
  max-width: 1000px;
  margin: 0 auto;
}

/* Participant Grid */
.gs-participant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.gs-participant-card {
  background: var(--bg-primary, white);
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: border-color 0.15s;
}

.gs-participant-card:hover {
  border-color: var(--text-muted, #888);
}

.gs-participant-card--has-note {
  border-left: 3px solid #2e7d32;
}

.gs-participant-card--missing-note {
  border-left: 3px solid #e65100;
}

.gs-participant-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-secondary, #f0f0f0);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary, #666);
  flex-shrink: 0;
}

.gs-participant-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary, #333);
}

.gs-participant-status {
  font-size: 11px;
  color: var(--text-secondary, #666);
  margin-top: 2px;
}

/* Note Tabs */
.gs-note-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border-color, #e0e0e0);
  margin-bottom: 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.gs-note-tab {
  padding: 10px 18px;
  border: none;
  background: transparent;
  color: var(--text-secondary, #666);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}

.gs-note-tab:hover {
  color: var(--text-primary, #333);
}

.gs-note-tab--active {
  color: #1565c0;
  border-bottom-color: #1565c0;
  font-weight: 600;
}

.gs-note-tab--complete {
  color: #2e7d32;
}

.gs-note-tab--complete::after {
  content: " \2713";
  font-size: 11px;
}

/* Note Editor */
.gs-note-editor {
  background: var(--bg-primary, white);
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 8px;
  padding: 20px;
}

.gs-note-section {
  margin-bottom: 16px;
}

.gs-note-section:last-child {
  margin-bottom: 0;
}

.gs-note-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #333);
  margin-bottom: 6px;
}

.gs-note-textarea {
  width: 100%;
  min-height: 80px;
  padding: 10px 12px;
  border: 1px solid var(--border-color, #ddd);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
  color: var(--text-primary, #333);
  background: var(--bg-primary, white);
}

.gs-note-textarea:focus {
  outline: none;
  border-color: #1565c0;
  box-shadow: 0 0 0 2px rgba(21, 101, 192, 0.15);
}

.gs-note-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color, #ddd);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: var(--bg-primary, white);
  color: var(--text-primary, #333);
  cursor: pointer;
}

/* Billing Summary */
.gs-billing-summary {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.gs-billing-summary th {
  text-align: left;
  padding: 10px 12px;
  background: var(--bg-secondary, #f5f5f5);
  font-weight: 600;
  color: var(--text-primary, #333);
  border-bottom: 2px solid var(--border-color, #e0e0e0);
}

.gs-billing-summary td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color, #eee);
  color: var(--text-primary, #333);
}

.gs-billing-deferred {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: #fff3e0;
  color: #e65100;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

/* Action Buttons */
.gs-action-bar {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.gs-btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  min-height: 44px;
  background: #1565c0;
  color: white;
}

.gs-btn-primary:hover { background: #0d47a1; }
.gs-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.gs-btn-success {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  min-height: 44px;
  background: #2e7d32;
  color: white;
}

.gs-btn-success:hover { background: #1b5e20; }
.gs-btn-success:disabled { opacity: 0.5; cursor: not-allowed; }

.gs-btn-danger {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: 1px solid #c62828;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  min-height: 44px;
  background: transparent;
  color: #c62828;
}

.gs-btn-danger:hover { background: #fce4ec; }

.gs-btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: 1px solid var(--border-color, #ddd);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  min-height: 44px;
  background: var(--bg-primary, white);
  color: var(--text-primary, #333);
}

.gs-btn-secondary:hover { background: var(--bg-secondary, #f5f5f5); }

/* Creation Form / Modal */
.gs-create-form {
  background: var(--bg-primary, white);
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 20px;
}

.gs-create-form h3 {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary, #333);
}

.gs-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.gs-form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gs-form-field--full {
  grid-column: 1 / -1;
}

.gs-form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #333);
}

.gs-form-input {
  padding: 10px 12px;
  border: 1px solid var(--border-color, #ddd);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary, #333);
  background: var(--bg-primary, white);
}

.gs-form-input:focus {
  outline: none;
  border-color: #1565c0;
  box-shadow: 0 0 0 2px rgba(21, 101, 192, 0.15);
}

/* List Page Table Overrides */
.gs-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.gs-list-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary, #333);
}

/* Timer display within group session */
.gs-timer {
  text-align: center;
  padding: 20px;
}

.gs-timer-display {
  font-size: 48px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 2px;
  color: var(--text-primary, #333);
}

.gs-timer-label {
  font-size: 13px;
  color: var(--text-secondary, #666);
  margin-top: 4px;
}

/* Multi-select checkboxes for participant picker */
.gs-multi-select {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--border-color, #ddd);
  border-radius: 6px;
  padding: 4px 0;
}

.gs-multi-select-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-primary, #333);
}

.gs-multi-select-item:hover {
  background: var(--bg-secondary, #f5f5f5);
}

/* Finalized summary */
.gs-finalized {
  text-align: center;
  padding: 40px 20px;
}

.gs-finalized-icon {
  font-size: 64px;
  margin-bottom: 16px;
  color: #2e7d32;
}

/* Responsive */
@media (max-width: 768px) {
  .gs-header {
    padding: 12px 16px;
  }
  .gs-step {
    padding: 16px;
  }
  .gs-participant-grid {
    grid-template-columns: 1fr;
  }
  .gs-form-row {
    grid-template-columns: 1fr;
  }
  .gs-timer-display {
    font-size: 36px;
  }
}

/* Source: 48-denials-dashboard.css */
/* Denials Management Dashboard */

.denials-dashboard {
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;
}

.denials-dashboard h2 {
  margin: 0 0 20px 0;
  font-size: 1.5rem;
  color: var(--text-primary, #333);
}

/* KPI Cards Row */
.denials-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.denials-kpi-card {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}

.denials-kpi-card .kpi-label {
  font-size: 0.8rem;
  color: var(--text-secondary, #666);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.denials-kpi-card .kpi-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary, #333);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.denials-kpi-card .kpi-value.text-value {
  font-size: 0.95rem;
  font-weight: 600;
  white-space: normal;
  word-wrap: break-word;
  line-height: 1.3;
}

.denials-kpi-card .kpi-value.danger {
  color: var(--danger-color, #dc3545);
}

.denials-kpi-card .kpi-value.warning {
  color: var(--warning-color, #ffc107);
}

.denials-kpi-card .kpi-value.success {
  color: var(--success-color, #28a745);
}

/* Filters Bar */
.denials-filters-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: center;
}

.denials-filters-bar select {
  padding: 6px 12px;
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 4px;
  background: var(--input-bg, #fff);
  color: var(--text-primary, #333);
  font-size: 0.9rem;
}

/* Denial Table */
.denials-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

.denials-table th,
.denials-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-color, #e0e0e0);
  font-size: 0.9rem;
}

.denials-table th {
  background: var(--header-bg, #f8f9fa);
  font-weight: 600;
  color: var(--text-secondary, #666);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  cursor: pointer;
  user-select: none;
}

.denials-table th:hover {
  background: var(--hover-bg, #e9ecef);
}

.denials-table tr.clickable-row {
  cursor: pointer;
  transition: background 0.15s;
}

.denials-table tr.clickable-row:hover {
  background: var(--hover-bg, #f5f5f5);
}

.denials-table tr.selected-row {
  background: var(--selected-bg, #e3f2fd);
}

/* Denial Reason Badge */
.denial-reason-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  background: #fce4ec;
  color: #c62828;
}

.denial-reason-badge.appealed {
  background: #fff3e0;
  color: #e65100;
}

/* Status Badge */
.denial-status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
}

.denial-status-badge.denied {
  background: #fce4ec;
  color: #c62828;
}

.denial-status-badge.appealed {
  background: #fff3e0;
  color: #e65100;
}

.denial-status-badge.approved {
  background: #e8f5e9;
  color: #2e7d32;
}

/* Detail Panel */
.denial-detail-panel {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.denial-detail-panel h3 {
  margin: 0 0 16px 0;
  font-size: 1.1rem;
  color: var(--text-primary, #333);
  border-bottom: 1px solid var(--border-color, #e0e0e0);
  padding-bottom: 8px;
}

.denial-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.denial-detail-grid .detail-item {
  display: flex;
  flex-direction: column;
}

.denial-detail-grid .detail-label {
  font-size: 0.75rem;
  color: var(--text-secondary, #666);
  text-transform: uppercase;
  margin-bottom: 2px;
}

.denial-detail-grid .detail-value {
  font-size: 0.95rem;
  color: var(--text-primary, #333);
}

/* Appeal History */
.appeal-history-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px 0;
}

.appeal-history-list li {
  padding: 8px 12px;
  border-left: 3px solid var(--border-color, #e0e0e0);
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.appeal-history-list li.pending {
  border-left-color: var(--warning-color, #ffc107);
}

.appeal-history-list li.approved {
  border-left-color: var(--success-color, #28a745);
}

.appeal-history-list li.rejected {
  border-left-color: var(--danger-color, #dc3545);
}

/* Action Buttons */
.denial-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.denial-actions button {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: opacity 0.15s;
}

.denial-actions button:hover {
  opacity: 0.85;
}

.denial-actions .btn-appeal {
  background: var(--warning-color, #ffc107);
  color: #333;
}

.denial-actions .btn-analyze {
  background: var(--info-color, #17a2b8);
  color: #fff;
}

/* Appeal Form */
.appeal-form {
  background: var(--bg-secondary, #f8f9fa);
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 16px;
}

.appeal-form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-primary, #333);
}

.appeal-form textarea,
.appeal-form input[type="text"] {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 4px;
  font-size: 0.9rem;
  margin-bottom: 12px;
  background: var(--input-bg, #fff);
  color: var(--text-primary, #333);
  box-sizing: border-box;
}

.appeal-form textarea {
  min-height: 80px;
  resize: vertical;
}

.appeal-form .form-actions {
  display: flex;
  gap: 8px;
}

.appeal-form .btn-submit {
  background: var(--primary-color, #007bff);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
}

.appeal-form .btn-cancel {
  background: transparent;
  color: var(--text-secondary, #666);
  border: 1px solid var(--border-color, #e0e0e0);
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
}

/* AI Analysis Section */
.denial-ai-section {
  background: var(--bg-secondary, #f8f9fa);
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 6px;
  padding: 16px;
}

.denial-ai-section h4 {
  margin: 0 0 12px 0;
  font-size: 0.95rem;
  color: var(--text-primary, #333);
}

/* Empty state */
.denials-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary, #666);
}

.denials-empty i {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.3;
}

.denials-empty p {
  font-size: 1rem;
  margin: 0;
}

/* =============================================================================
   Dark Mode Overrides
   ============================================================================= */

[data-theme="dark"] .denials-kpi-card {
  background: var(--bg-card);
  border-color: var(--border-color);
}

[data-theme="dark"] .denials-kpi-card .kpi-label {
  color: var(--text-secondary);
}

[data-theme="dark"] .denials-kpi-card .kpi-value {
  color: var(--text-primary);
}

[data-theme="dark"] .denial-reason-badge {
  background: rgba(198, 40, 40, 0.15);
  color: #ef5350;
}

[data-theme="dark"] .denial-reason-badge.appealed {
  background: rgba(230, 81, 0, 0.15);
  color: #ff9800;
}

[data-theme="dark"] .denial-status-badge.denied {
  background: rgba(198, 40, 40, 0.15);
  color: #ef5350;
}

[data-theme="dark"] .denial-status-badge.appealed {
  background: rgba(230, 81, 0, 0.15);
  color: #ff9800;
}

[data-theme="dark"] .denial-status-badge.approved {
  background: rgba(46, 125, 50, 0.15);
  color: #66bb6a;
}

[data-theme="dark"] .denial-detail-panel {
  background: var(--bg-card);
  border-color: var(--border-color);
}

[data-theme="dark"] .btn-analyze {
  background: var(--info-color, #17a2b8);
}

/* Source: 48a-invoice-table.css */
/* =============================================================================
   Invoice Table — Row-level status tinting + missing badge variants
   ============================================================================= */

/* Row-level status tinting (subtle left border + background) */
tr.row-status {
    transition: background-color 0.15s ease;
}

tr.row-status-paid {
    border-left: 3px solid #2e7d32;
    background-color: rgba(46, 125, 50, 0.04);
}

tr.row-status-pending {
    border-left: 3px solid #1565c0;
    background-color: rgba(21, 101, 192, 0.04);
}

tr.row-status-partial {
    border-left: 3px solid #f57c00;
    background-color: rgba(245, 124, 0, 0.04);
}

tr.row-status-overdue {
    border-left: 3px solid #c62828;
    background-color: rgba(198, 40, 40, 0.06);
}

tr.row-status-void {
    border-left: 3px solid #9e9e9e;
    background-color: rgba(158, 158, 158, 0.04);
}

tr.row-status-void td {
    color: #999;
    text-decoration: line-through;
    text-decoration-color: rgba(0,0,0,0.2);
}

tr.row-status-void td .status-badge {
    text-decoration: none;
}

/* Hover states — slightly stronger tint */
tr.row-status-paid:hover { background-color: rgba(46, 125, 50, 0.08); }
tr.row-status-pending:hover { background-color: rgba(21, 101, 192, 0.08); }
tr.row-status-partial:hover { background-color: rgba(245, 124, 0, 0.08); }
tr.row-status-overdue:hover { background-color: rgba(198, 40, 40, 0.10); }
tr.row-status-void:hover { background-color: rgba(158, 158, 158, 0.08); }

/* Missing status badge variants */
.status-badge.status-partial {
    background: #fff3e0;
    color: #f57c00;
}

.status-badge.status-void {
    background: #fafafa;
    color: #9e9e9e;
    text-decoration: line-through;
}

/* Dark mode overrides */
[data-theme="dark"] tr.row-status-paid {
    border-left-color: #81c784;
    background-color: rgba(46, 125, 50, 0.08);
}
[data-theme="dark"] tr.row-status-pending {
    border-left-color: #64b5f6;
    background-color: rgba(21, 101, 192, 0.08);
}
[data-theme="dark"] tr.row-status-partial {
    border-left-color: #ffb74d;
    background-color: rgba(245, 124, 0, 0.08);
}
[data-theme="dark"] tr.row-status-overdue {
    border-left-color: #ef9a9a;
    background-color: rgba(198, 40, 40, 0.10);
}
[data-theme="dark"] tr.row-status-void {
    border-left-color: #757575;
    background-color: rgba(158, 158, 158, 0.06);
}

[data-theme="dark"] .status-badge.status-partial {
    background: rgba(245, 124, 0, 0.2);
    color: #ffb74d;
}
[data-theme="dark"] .status-badge.status-void {
    background: rgba(158, 158, 158, 0.2);
    color: #bdbdbd;
}
/* Invoice modal action buttons */
.has-modal-actions .modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px 0;
    border-top: 1px solid #eee;
    margin-top: 12px;
}

.has-modal-actions .modal-actions button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    transition: opacity 0.15s ease, transform 0.1s ease;
}

.has-modal-actions .modal-actions button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.has-modal-actions .modal-actions button:active {
    transform: translateY(0);
}

[data-theme="dark"] .has-modal-actions .modal-actions {
    border-top-color: #333;
}

/* Source: 49-driver-documents.css */
/* =============================================================================
   Driver Documents Section (edit modal)
   ============================================================================= */

.driver-documents-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color, #e0e0e0);
}

.driver-docs-header {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary, #333);
  margin: 0 0 12px 0;
  display: flex;
  align-items: center;
}

/* Thumbnail grid */
.driver-doc-thumbnails {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.driver-doc-thumbnail {
  border: 1px solid var(--border-color, #ddd);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.15s;
  background: var(--bg-secondary, #fafafa);
}

.driver-doc-thumbnail:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.driver-doc-thumbnail img {
  width: 100%;
  height: 90px;
  object-fit: cover;
  display: block;
}

.driver-doc-thumbnail-placeholder {
  width: 100%;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary, #f0f0f0);
  color: var(--text-secondary, #888);
  font-size: 28px;
}

.driver-doc-thumbnail-label {
  padding: 4px 6px;
  font-size: 11px;
  color: var(--text-secondary, #666);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Document list */
.driver-doc-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.driver-doc-row {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 4px;
  gap: 10px;
  transition: background 0.1s;
}

.driver-doc-row:hover {
  background: var(--bg-hover, #f5f5f5);
}

.driver-doc-icon {
  flex-shrink: 0;
  width: 28px;
  text-align: center;
  color: var(--text-secondary, #888);
  font-size: 16px;
}

.driver-doc-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.driver-doc-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary, #333);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.driver-doc-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-secondary, #999);
}

.driver-doc-type-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--bg-tertiary, #e8e8e8);
  color: var(--text-secondary, #666);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.driver-doc-download {
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--border-color, #ddd);
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
  color: var(--text-secondary, #888);
  transition: color 0.15s, border-color 0.15s;
}

.driver-doc-download:hover {
  color: var(--text-link, #007bff);
  border-color: var(--text-link, #007bff);
}

/* Group headers */
.driver-doc-group-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-color, #e0e0e0);
}

.driver-doc-group-header:first-child {
  margin-top: 0;
}

.driver-doc-group-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-secondary, #666);
}

.driver-doc-group-count {
  font-size: 11px;
  color: var(--text-muted, #999);
}

/* Empty state */
.driver-docs-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: var(--text-secondary, #888);
}

.driver-docs-empty p {
  margin: 0;
  font-size: 14px;
}

/* Filename secondary text */
.driver-doc-filename {
  font-size: 10px;
  font-style: italic;
  color: var(--text-muted, #999);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Source: 50-dark-mode.css */
/* =============================================================================
   Dark mode component overrides
   
   Source: styles.css lines 8066-9130
   ============================================================================= */

/* =============================================================================
   Dark Mode Component Overrides
   ============================================================================= */

/* Override all hardcoded white backgrounds in dark mode */
[data-theme="dark"] .modal,
[data-theme="dark"] .modal-content,
[data-theme="dark"] .release-notes-modal,
[data-theme="dark"] .release-notes-content,
[data-theme="dark"] .form-panel {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-body,
[data-theme="dark"] .modal-footer {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

/* Dialog dark mode */
[data-theme="dark"] .dialog,
[data-theme="dark"] .start-dialog,
[data-theme="dark"] .create-prospect-dialog,
[data-theme="dark"] .dialog-overlay .dialog,
[data-theme="dark"] .start-dialog-overlay .start-dialog,
[data-theme="dark"] .create-prospect-dialog-overlay .create-prospect-dialog {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .dialog h3,
[data-theme="dark"] .start-dialog h3,
[data-theme="dark"] .create-prospect-dialog h3 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .dialog p,
[data-theme="dark"] .start-dialog p,
[data-theme="dark"] .dialog label,
[data-theme="dark"] .start-dialog label,
[data-theme="dark"] .create-prospect-dialog label {
    color: var(--text-secondary) !important;
}

/* Form labels in dark mode */
[data-theme="dark"] .input-field label,
[data-theme="dark"] label {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .dialog input,
[data-theme="dark"] .dialog select,
[data-theme="dark"] .dialog textarea,
[data-theme="dark"] .start-dialog input,
[data-theme="dark"] .start-dialog select,
[data-theme="dark"] .create-prospect-dialog input,
[data-theme="dark"] .create-prospect-dialog select,
[data-theme="dark"] .create-prospect-dialog textarea {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

/* Popup dark mode */
[data-theme="dark"] .popup,
[data-theme="dark"] .popup-container .popup {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border-color: var(--color-primary) !important;
}

/* Action list/dropdown backgrounds */
[data-theme="dark"] .action-container,
[data-theme="dark"] .action-list,
[data-theme="dark"] .action-list-container,
[data-theme="dark"] .action-item,
[data-theme="dark"] .action-dropdown,
[data-theme="dark"] .dropdown-content,
[data-theme="dark"] .dropdown-menu,
[data-theme="dark"] .select-wrapper,
[data-theme="dark"] .custom-select {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .action-item:hover,
[data-theme="dark"] .action-list li:hover {
    background-color: var(--bg-hover) !important;
}

/* Smart Actions card */
[data-theme="dark"] .smart-actions-container,
[data-theme="dark"] .smart-actions,
[data-theme="dark"] .ai-chat-container,
[data-theme="dark"] .chat-input-container {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .smart-actions input,
[data-theme="dark"] .smart-actions textarea,
[data-theme="dark"] .ai-chat-container input,
[data-theme="dark"] .ai-chat-container textarea {
    background-color: var(--bg-input) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

/* Main content area */
[data-theme="dark"] .page-container,
[data-theme="dark"] .main-content,
[data-theme="dark"] .content-area,
[data-theme="dark"] .dashboard-container {
    background-color: var(--bg-body) !important;
    color: var(--text-primary) !important;
}

/* Cards and containers */
[data-theme="dark"] .card,
[data-theme="dark"] .info-card,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .data-card,
[data-theme="dark"] .panel,
[data-theme="dark"] .box,
[data-theme="dark"] .container-card {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

/* Form elements */
[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
    background-color: var(--bg-input) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] select option {
    background-color: #2d2d2d;
    color: #e0e0e0;
}

/* Toggle switch — override generic input dark mode styles */
[data-theme="dark"] .input-field input[type="checkbox"] {
    background: #888 !important;
    border-color: #aaa !important;
    height: 24px !important;
    min-height: 24px !important;
    padding: 0 !important;
}

[data-theme="dark"] .input-field input[type="checkbox"]:checked {
    background: var(--color-accent, #007bff) !important;
    border-color: var(--color-accent, #007bff) !important;
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
    color: var(--text-muted) !important;
}

/* Tables */
[data-theme="dark"] table,
[data-theme="dark"] .table-container,
[data-theme="dark"] .data-table {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] th {
    background-color: #2a2a2a !important;  /* Darker background for better contrast */
    color: #ffffff !important;  /* White text for strong contrast */
    border-color: var(--border-color) !important;
    font-weight: 600;
}

[data-theme="dark"] td {
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] tr:nth-child(even) {
    background-color: var(--bg-table-even) !important;
}

[data-theme="dark"] tr:nth-child(odd) {
    background-color: var(--bg-table-odd) !important;
}

[data-theme="dark"] tr:hover {
    background-color: var(--bg-hover) !important;
}

/* Tooltips */
[data-theme="dark"] .tooltip,
[data-theme="dark"] [data-tooltip]::after,
[data-theme="dark"] .tippy-box,
[data-theme="dark"] .tippy-content {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
}

/* Kanban and workflow */
[data-theme="dark"] .kanban-column,
[data-theme="dark"] .kanban-card,
[data-theme="dark"] .workflow-card,
[data-theme="dark"] .entity-card {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

/* Kanban column headers use inline background-color from stage config.
   In dark mode those bright colors make text unreadable, so we dim the
   header background with a filter and force white text. */
[data-theme="dark"] .kanban-column .column-header {
    filter: brightness(0.7) saturate(0.8);
}

[data-theme="dark"] .kanban-column .column-header span {
    color: #fff !important;
}

[data-theme="dark"] .kanban-column .column-header .instance-count,
[data-theme="dark"] .kanban-column .column-header .entity-count {
    color: #fff !important;
}

/* Headers and titles */
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6,
[data-theme="dark"] .title,
[data-theme="dark"] .header,
[data-theme="dark"] .heading {
    color: var(--text-primary) !important;
}

/* Labels and text */
[data-theme="dark"] label,
[data-theme="dark"] .label,
[data-theme="dark"] .field-label,
[data-theme="dark"] p,
[data-theme="dark"] span:not(.fa):not([class*="icon"]) {
    color: var(--text-primary);
}

[data-theme="dark"] .text-muted,
[data-theme="dark"] .muted,
[data-theme="dark"] .hint,
[data-theme="dark"] .help-text {
    color: var(--text-muted) !important;
}

/* Borders */
[data-theme="dark"] hr {
    border-color: var(--border-color) !important;
}

/* Scrollbars */
[data-theme="dark"] ::-webkit-scrollbar {
    background-color: var(--bg-secondary);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background-color: var(--bg-tertiary);
    border-radius: 4px;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-muted);
}

/* Action group headers */
.action-group .group-header {
    padding: 8px 12px !important;
    background-color: var(--bg-secondary) !important;
    font-weight: 600 !important;
    font-size: 10px !important;
    color: var(--text-secondary) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    border-bottom: 1px solid var(--border-light) !important;
    border-left-width: 3px !important;
    border-left-style: solid !important;
    border-left-color: var(--color-primary);  /* fallback if group color is null */
}

/* Action category headers */
[data-theme="dark"] .category-header,
[data-theme="dark"] .section-header,
[data-theme="dark"] .group-header,
[data-theme="dark"] .action-group .group-header,
[data-theme="dark"] .action-group > .group-header {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    border-bottom-color: var(--border-color);
}

/* Release notes specific */
[data-theme="dark"] .release-notes-modal .highlights,
[data-theme="dark"] .release-notes-modal .feature-list {
    background-color: var(--bg-secondary) !important;
}

[data-theme="dark"] .release-notes-modal .feature-item,
[data-theme="dark"] .release-notes-modal li {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .release-category-title,
[data-theme="dark"] .section-features h3 {
    color: var(--text-primary) !important;
    background-color: transparent !important;
}

[data-theme="dark"] .release-item {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .release-item-title {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .release-item-description {
    color: var(--text-secondary) !important;
}

/* Root, HTML, and Body dark mode - CRITICAL for scrolling background */
html[data-theme="dark"],
html[data-theme="dark"] body {
    background-color: var(--bg-body) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] #app {
    background-color: var(--bg-body) !important;
    min-height: 100vh;
}

/* Action sidebar and items */
[data-theme="dark"] .action-sidebar {
    background-color: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .action-sidebar .category-header {
    background-color: transparent !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .action-groups {
    background-color: var(--bg-secondary) !important;
}

/* Action form area */
[data-theme="dark"] .action-form-area {
    background-color: var(--bg-body) !important;
}

/* Dashboard layout components */
[data-theme="dark"] .dashboard-page {
    background-color: var(--bg-body) !important;
}

[data-theme="dark"] .left-panel,
[data-theme="dark"] .center-panel,
[data-theme="dark"] .right-panel {
    background-color: var(--bg-body) !important;
}

/* Interaction cards */
[data-theme="dark"] .interaction-card {
    background-color: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .interaction-header,
[data-theme="dark"] .interaction-meta,
[data-theme="dark"] .interaction-body {
    color: var(--text-primary) !important;
}

/* Timeline tiles */
[data-theme="dark"] .timeline-tile {
    background-color: var(--bg-card) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .timeline-header {
    color: var(--text-primary) !important;
}

/* Calendar tiles */
[data-theme="dark"] .calendar-tile,
[data-theme="dark"] .mini-calendar {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
}

/* List tiles */
[data-theme="dark"] .list-tile {
    background-color: var(--bg-card) !important;
    border-color: var(--border-color) !important;
}

/* Info banners and alerts */
[data-theme="dark"] .info-banner,
[data-theme="dark"] .alert-box:not(.alert-danger):not(.alert-warning):not(.alert-success) {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

/* Header area */
[data-theme="dark"] .header-area {
    background-color: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

/* Catch-all for inline white backgrounds */
[data-theme="dark"] div[style*="background: #fff"],
[data-theme="dark"] div[style*="background-color: #fff"],
[data-theme="dark"] div[style*="background: white"],
[data-theme="dark"] div[style*="background-color: white"],
[data-theme="dark"] div[style*="background:#fff"],
[data-theme="dark"] div[style*="background-color:#fff"] {
    background-color: var(--bg-card) !important;
}

/* Scheduler components */
[data-theme="dark"] .scheduler-container,
[data-theme="dark"] .scheduler-header,
[data-theme="dark"] .scheduler-view,
[data-theme="dark"] .day-column,
[data-theme="dark"] .week-view,
[data-theme="dark"] .month-view {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
}

/* Compliance dashboard */
[data-theme="dark"] .compliance-section,
[data-theme="dark"] .compliance-card,
[data-theme="dark"] .compliance-item,
[data-theme="dark"] .alert-summary,
[data-theme="dark"] .issue-card {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

/* Compliance table dark mode (explicit toggle) */
[data-theme="dark"] .compliance-table,
[data-theme="dark"] .compliance-table tbody,
[data-theme="dark"] .compliance-table tbody tr {
    background-color: var(--bg-card) !important;
}

[data-theme="dark"] .compliance-table tbody tr.has-issues {
    background-color: var(--bg-danger-subtle) !important;
}

[data-theme="dark"] .compliance-table tbody tr:hover {
    background-color: var(--bg-hover) !important;
}

[data-theme="dark"] .compliance-table th,
[data-theme="dark"] .compliance-table td {
    color: var(--text-primary) !important;
}

/* System preference dark mode for compliance dashboard */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .compliance-section,
    :root:not([data-theme="light"]) .compliance-card,
    :root:not([data-theme="light"]) .compliance-item,
    :root:not([data-theme="light"]) .alert-summary,
    :root:not([data-theme="light"]) .issue-card {
        background-color: var(--bg-card) !important;
        color: var(--text-primary) !important;
        border-color: var(--border-color) !important;
    }

    :root:not([data-theme="light"]) .compliance-table,
    :root:not([data-theme="light"]) .compliance-table tbody,
    :root:not([data-theme="light"]) .compliance-table tbody tr {
        background-color: var(--bg-card) !important;
    }

    :root:not([data-theme="light"]) .compliance-table tbody tr.has-issues {
        background-color: var(--bg-danger-subtle) !important;
    }

    :root:not([data-theme="light"]) .compliance-table tbody tr:hover {
        background-color: var(--bg-hover) !important;
    }

    :root:not([data-theme="light"]) .compliance-table th,
    :root:not([data-theme="light"]) .compliance-table td {
        color: var(--text-primary) !important;
    }
}

/* Tables - comprehensive dark mode */
[data-theme="dark"] table,
[data-theme="dark"] .table {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] tbody,
[data-theme="dark"] table tbody {
    background-color: var(--bg-card) !important;
}

[data-theme="dark"] tr,
[data-theme="dark"] table tr,
[data-theme="dark"] tbody tr,
[data-theme="dark"] table tbody tr {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] tr:nth-child(odd),
[data-theme="dark"] table tr:nth-child(odd),
[data-theme="dark"] tbody tr:nth-child(odd) {
    background-color: var(--bg-card) !important;
}

[data-theme="dark"] tr:nth-child(even),
[data-theme="dark"] table tr:nth-child(even),
[data-theme="dark"] tbody tr:nth-child(even) {
    background-color: var(--bg-table-even) !important;
}

[data-theme="dark"] tr:hover,
[data-theme="dark"] table tr:hover,
[data-theme="dark"] tbody tr:hover {
    background-color: var(--bg-hover) !important;
}

[data-theme="dark"] thead tr,
[data-theme="dark"] table thead tr {
    background-color: #2a2a2a !important;
}

[data-theme="dark"] .metric-card {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
}

/* Super admin metrics */
[data-theme="dark"] .metrics-card,
[data-theme="dark"] .metrics-container,
[data-theme="dark"] .stats-card,
[data-theme="dark"] .usage-card {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

/* Wizard components */
[data-theme="dark"] .wizard-container,
[data-theme="dark"] .wizard-step,
[data-theme="dark"] .wizard-content,
[data-theme="dark"] .wizard-footer {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
}

/* Notes components (application status, wizard) */
[data-theme="dark"] .note-item {
    background-color: var(--bg-tertiary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .note-author {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .note-date {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .note-text {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .notes-list {
    background-color: var(--bg-card) !important;
}

[data-theme="dark"] .add-note-form textarea {
    background-color: var(--bg-input) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

/* Kanban components */
[data-theme="dark"] .kanban-board,
[data-theme="dark"] .kanban-column,
[data-theme="dark"] .kanban-card,
[data-theme="dark"] .kanban-item {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

/* Exception page */
[data-theme="dark"] .exception-item,
[data-theme="dark"] .exception-details {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
}

/* Persona page */
[data-theme="dark"] .persona-card,
[data-theme="dark"] .persona-item {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
}

/* Mobile components */
[data-theme="dark"] .mobile-card,
[data-theme="dark"] .mobile-list-item,
[data-theme="dark"] .meal-card,
[data-theme="dark"] .chore-card {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
}

/* Form elements with inline backgrounds */
[data-theme="dark"] .form-group,
[data-theme="dark"] .field-wrapper,
[data-theme="dark"] .input-group {
    color: var(--text-primary) !important;
}

/* Disclosure text blocks */
[data-theme="dark"] .disclosure-content {
    background: var(--bg-tertiary) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

/* Signature pad */
[data-theme="dark"] .signature-canvas-wrapper {
    border-color: var(--border-color) !important;
    background: var(--bg-card) !important;
}

[data-theme="dark"] .signature-baseline {
    background: var(--border-color) !important;
}

[data-theme="dark"] .signature-x-marker {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .signature-clear-btn {
    background: var(--bg-tertiary) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .signature-status-text {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .signature-image-wrapper {
    border-color: var(--border-color) !important;
    background: var(--bg-secondary) !important;
}

/* System preference dark mode - same overrides */
@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]),
    html:not([data-theme="light"]) body {
        background-color: var(--bg-body) !important;
        color: var(--text-primary) !important;
    }

    :root:not([data-theme="light"]) #app {
        background-color: var(--bg-body) !important;
        min-height: 100vh;
    }

    :root:not([data-theme="light"]) .modal,
    :root:not([data-theme="light"]) .modal-content,
    :root:not([data-theme="light"]) .action-container,
    :root:not([data-theme="light"]) .action-list,
    :root:not([data-theme="light"]) .page-container,
    :root:not([data-theme="light"]) .card,
    :root:not([data-theme="light"]) .action-sidebar,
    :root:not([data-theme="light"]) .action-form-area,
    :root:not([data-theme="light"]) .dashboard-page,
    :root:not([data-theme="light"]) .form-panel,
    :root:not([data-theme="light"]) input,
    :root:not([data-theme="light"]) textarea,
    :root:not([data-theme="light"]) select {
        background-color: var(--bg-card) !important;
        color: var(--text-primary) !important;
        border-color: var(--border-color) !important;
    }

    :root:not([data-theme="light"]) select option {
        background-color: #2d2d2d;
        color: #e0e0e0;
    }

    :root:not([data-theme="light"]) .input-field label,
    :root:not([data-theme="light"]) label {
        color: var(--text-secondary) !important;
    }

    /* Toggle switch — override generic input dark mode styles */
    :root:not([data-theme="light"]) .input-field input[type="checkbox"] {
        background: #888 !important;
        border-color: #aaa !important;
        height: 24px !important;
        min-height: 24px !important;
        padding: 0 !important;
    }

    :root:not([data-theme="light"]) .input-field input[type="checkbox"]:checked {
        background: var(--color-accent, #007bff) !important;
        border-color: var(--color-accent, #007bff) !important;
    }

    /* Mobile Visitor App dark mode - now uses CSS variables from base styles */
    /* Visitor button colors need to stay bright in dark mode */
    :root:not([data-theme="light"]) .visitor-btn-success {
        background-color: var(--color-success) !important;
        color: var(--text-inverse) !important;
    }

    :root:not([data-theme="light"]) .visitor-btn-primary {
        background-color: var(--color-primary) !important;
        color: var(--text-inverse) !important;
    }

    /* Resume scanner dark mode */
    :root:not([data-theme="light"]) .resume-scanner {
        background-color: var(--bg-card) !important;
    }

    :root:not([data-theme="light"]) .scan-results,
    :root:not([data-theme="light"]) .scan-results-container {
        background-color: var(--bg-secondary) !important;
    }

    :root:not([data-theme="light"]) .scan-results h3,
    :root:not([data-theme="light"]) .scan-results h4 {
        color: var(--text-primary) !important;
    }

    :root:not([data-theme="light"]) .result-field-value {
        color: var(--text-primary) !important;
    }

    /* Scanner labels (used as buttons) in dark mode */
    :root:not([data-theme="light"]) .resume-photo-scanner label[for*="file-input"],
    :root:not([data-theme="light"]) .item-photo-scanner label[for*="file-input"] {
        background-color: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border-color: var(--border-color) !important;
    }

    :root:not([data-theme="light"]) .resume-photo-scanner,
    :root:not([data-theme="light"]) .item-photo-scanner {
        background-color: var(--bg-body) !important;
    }

    :root:not([data-theme="light"]) .resume-photo-scanner h2,
    :root:not([data-theme="light"]) .item-photo-scanner h2,
    :root:not([data-theme="light"]) .resume-photo-scanner p,
    :root:not([data-theme="light"]) .item-photo-scanner p {
        color: var(--text-primary) !important;
    }

    :root:not([data-theme="light"]) .scan-result-field {
        border-color: var(--border-color) !important;
    }

    :root:not([data-theme="light"]) .scan-result-field span {
        color: var(--text-primary) !important;
    }

    :root:not([data-theme="light"]) .photo-preview p {
        color: var(--text-secondary) !important;
    }

    /* Dialog dark mode */
    :root:not([data-theme="light"]) .dialog,
    :root:not([data-theme="light"]) .start-dialog,
    :root:not([data-theme="light"]) .create-prospect-dialog,
    :root:not([data-theme="light"]) .dialog-overlay .dialog,
    :root:not([data-theme="light"]) .start-dialog-overlay .start-dialog,
    :root:not([data-theme="light"]) .create-prospect-dialog-overlay .create-prospect-dialog {
        background-color: var(--bg-card) !important;
        color: var(--text-primary) !important;
        border-color: var(--border-color) !important;
    }

    :root:not([data-theme="light"]) .dialog h3,
    :root:not([data-theme="light"]) .start-dialog h3,
    :root:not([data-theme="light"]) .create-prospect-dialog h3 {
        color: var(--text-primary) !important;
    }

    :root:not([data-theme="light"]) .dialog p,
    :root:not([data-theme="light"]) .start-dialog p,
    :root:not([data-theme="light"]) .dialog label,
    :root:not([data-theme="light"]) .start-dialog label,
    :root:not([data-theme="light"]) .create-prospect-dialog label {
        color: var(--text-secondary) !important;
    }

    :root:not([data-theme="light"]) .dialog input,
    :root:not([data-theme="light"]) .dialog select,
    :root:not([data-theme="light"]) .dialog textarea,
    :root:not([data-theme="light"]) .start-dialog input,
    :root:not([data-theme="light"]) .start-dialog select,
    :root:not([data-theme="light"]) .create-prospect-dialog input,
    :root:not([data-theme="light"]) .create-prospect-dialog select,
    :root:not([data-theme="light"]) .create-prospect-dialog textarea {
        background-color: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border-color: var(--border-color) !important;
    }

    /* Popup dark mode */
    :root:not([data-theme="light"]) .popup,
    :root:not([data-theme="light"]) .popup-container .popup {
        background-color: var(--bg-card) !important;
        color: var(--text-primary) !important;
        border-color: var(--color-primary) !important;
    }

    /* Action list/dropdown backgrounds */
    :root:not([data-theme="light"]) .action-list-container,
    :root:not([data-theme="light"]) .action-item,
    :root:not([data-theme="light"]) .action-dropdown,
    :root:not([data-theme="light"]) .dropdown-content,
    :root:not([data-theme="light"]) .dropdown-menu,
    :root:not([data-theme="light"]) .select-wrapper,
    :root:not([data-theme="light"]) .custom-select {
        background-color: var(--bg-card) !important;
        color: var(--text-primary) !important;
        border-color: var(--border-color) !important;
    }

    :root:not([data-theme="light"]) .action-item:hover,
    :root:not([data-theme="light"]) .action-list li:hover {
        background-color: var(--bg-hover) !important;
    }

    /* Smart Actions card */
    :root:not([data-theme="light"]) .smart-actions-container,
    :root:not([data-theme="light"]) .smart-actions,
    :root:not([data-theme="light"]) .ai-chat-container,
    :root:not([data-theme="light"]) .chat-input-container {
        background-color: var(--bg-card) !important;
        color: var(--text-primary) !important;
        border-color: var(--border-color) !important;
    }

    :root:not([data-theme="light"]) .smart-actions input,
    :root:not([data-theme="light"]) .smart-actions textarea,
    :root:not([data-theme="light"]) .ai-chat-container input,
    :root:not([data-theme="light"]) .ai-chat-container textarea {
        background-color: var(--bg-input) !important;
        color: var(--text-primary) !important;
        border-color: var(--border-color) !important;
    }

    /* Main content area */
    :root:not([data-theme="light"]) .main-content,
    :root:not([data-theme="light"]) .content-area,
    :root:not([data-theme="light"]) .dashboard-container {
        background-color: var(--bg-body) !important;
        color: var(--text-primary) !important;
    }

    /* Cards and containers */
    :root:not([data-theme="light"]) .info-card,
    :root:not([data-theme="light"]) .stat-card,
    :root:not([data-theme="light"]) .data-card,
    :root:not([data-theme="light"]) .panel,
    :root:not([data-theme="light"]) .box,
    :root:not([data-theme="light"]) .container-card {
        background-color: var(--bg-card) !important;
        color: var(--text-primary) !important;
        border-color: var(--border-color) !important;
    }

    /* Tables */
    :root:not([data-theme="light"]) table,
    :root:not([data-theme="light"]) .table-container,
    :root:not([data-theme="light"]) .data-table {
        background-color: var(--bg-card) !important;
        color: var(--text-primary) !important;
    }

    :root:not([data-theme="light"]) th {
        background-color: #2a2a2a !important;
        color: #ffffff !important;
        border-color: var(--border-color) !important;
    }

    :root:not([data-theme="light"]) td {
        border-color: var(--border-color) !important;
        color: var(--text-primary) !important;
    }

    :root:not([data-theme="light"]) tr:nth-child(even) {
        background-color: var(--bg-table-even) !important;
    }

    :root:not([data-theme="light"]) tr:nth-child(odd) {
        background-color: var(--bg-table-odd) !important;
    }

    :root:not([data-theme="light"]) tr:hover {
        background-color: var(--bg-hover) !important;
    }

    /* Tooltips */
    :root:not([data-theme="light"]) .tooltip,
    :root:not([data-theme="light"]) [data-tooltip]::after,
    :root:not([data-theme="light"]) .tippy-box,
    :root:not([data-theme="light"]) .tippy-content {
        background-color: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
    }

    /* Kanban and workflow */
    :root:not([data-theme="light"]) .kanban-column,
    :root:not([data-theme="light"]) .kanban-card,
    :root:not([data-theme="light"]) .workflow-card,
    :root:not([data-theme="light"]) .entity-card {
        background-color: var(--bg-card) !important;
        color: var(--text-primary) !important;
        border-color: var(--border-color) !important;
    }

    :root:not([data-theme="light"]) .kanban-column .column-header {
        filter: brightness(0.7) saturate(0.8);
    }

    :root:not([data-theme="light"]) .kanban-column .column-header span {
        color: #fff !important;
    }

    :root:not([data-theme="light"]) .kanban-column .column-header .instance-count,
    :root:not([data-theme="light"]) .kanban-column .column-header .entity-count {
        color: #fff !important;
    }

    /* Headers and titles */
    :root:not([data-theme="light"]) h1,
    :root:not([data-theme="light"]) h2,
    :root:not([data-theme="light"]) h3,
    :root:not([data-theme="light"]) h4,
    :root:not([data-theme="light"]) h5,
    :root:not([data-theme="light"]) h6,
    :root:not([data-theme="light"]) .title,
    :root:not([data-theme="light"]) .header,
    :root:not([data-theme="light"]) .heading {
        color: var(--text-primary) !important;
    }

    /* Labels and text */
    :root:not([data-theme="light"]) .label,
    :root:not([data-theme="light"]) .field-label {
        color: var(--text-primary);
    }

    :root:not([data-theme="light"]) .text-muted,
    :root:not([data-theme="light"]) .muted,
    :root:not([data-theme="light"]) .hint,
    :root:not([data-theme="light"]) .help-text {
        color: var(--text-muted) !important;
    }

    /* Borders */
    :root:not([data-theme="light"]) hr {
        border-color: var(--border-color) !important;
    }

    /* Action category headers */
    :root:not([data-theme="light"]) .category-header,
    :root:not([data-theme="light"]) .section-header,
    :root:not([data-theme="light"]) .group-header,
    :root:not([data-theme="light"]) .action-group .group-header {
        background-color: var(--bg-tertiary);
        color: var(--text-secondary);
        border-bottom-color: var(--border-color);
    }

    /* Release notes */
    :root:not([data-theme="light"]) .release-notes-modal .highlights,
    :root:not([data-theme="light"]) .release-notes-modal .feature-list {
        background-color: var(--bg-secondary) !important;
    }

    :root:not([data-theme="light"]) .release-notes-modal .feature-item,
    :root:not([data-theme="light"]) .release-notes-modal li {
        color: var(--text-primary) !important;
    }

    :root:not([data-theme="light"]) .release-category-title,
    :root:not([data-theme="light"]) .section-features h3 {
        color: var(--text-primary) !important;
        background-color: transparent !important;
    }

    :root:not([data-theme="light"]) .release-item {
        background-color: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
    }

    :root:not([data-theme="light"]) .release-item-title {
        color: var(--text-primary) !important;
    }

    :root:not([data-theme="light"]) .release-item-description {
        color: var(--text-secondary) !important;
    }

    /* Action sidebar */
    :root:not([data-theme="light"]) .action-sidebar .category-header {
        background-color: transparent !important;
        border-color: var(--border-color) !important;
    }

    :root:not([data-theme="light"]) .action-groups {
        background-color: var(--bg-secondary) !important;
    }

    /* Dashboard layout */
    :root:not([data-theme="light"]) .left-panel,
    :root:not([data-theme="light"]) .center-panel,
    :root:not([data-theme="light"]) .right-panel {
        background-color: var(--bg-body) !important;
    }

    /* Interaction cards */
    :root:not([data-theme="light"]) .interaction-card {
        background-color: var(--bg-card) !important;
        border-color: var(--border-color) !important;
        color: var(--text-primary) !important;
    }

    :root:not([data-theme="light"]) .interaction-header,
    :root:not([data-theme="light"]) .interaction-meta,
    :root:not([data-theme="light"]) .interaction-body {
        color: var(--text-primary) !important;
    }

    /* Timeline tiles */
    :root:not([data-theme="light"]) .timeline-tile {
        background-color: var(--bg-card) !important;
        border-color: var(--border-color) !important;
    }

    :root:not([data-theme="light"]) .timeline-header {
        color: var(--text-primary) !important;
    }

    /* Calendar tiles */
    :root:not([data-theme="light"]) .calendar-tile,
    :root:not([data-theme="light"]) .mini-calendar {
        background-color: var(--bg-card) !important;
        color: var(--text-primary) !important;
    }

    /* List tiles */
    :root:not([data-theme="light"]) .list-tile {
        background-color: var(--bg-card) !important;
        border-color: var(--border-color) !important;
    }

    /* Info banners and alerts */
    :root:not([data-theme="light"]) .info-banner,
    :root:not([data-theme="light"]) .alert-box:not(.alert-danger):not(.alert-warning):not(.alert-success) {
        background-color: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border-color: var(--border-color) !important;
    }

    /* Header area */
    :root:not([data-theme="light"]) .header-area {
        background-color: var(--bg-secondary) !important;
        border-color: var(--border-color) !important;
    }

    /* Scheduler components */
    :root:not([data-theme="light"]) .scheduler-container,
    :root:not([data-theme="light"]) .scheduler-header,
    :root:not([data-theme="light"]) .scheduler-view,
    :root:not([data-theme="light"]) .day-column,
    :root:not([data-theme="light"]) .week-view,
    :root:not([data-theme="light"]) .month-view {
        background-color: var(--bg-card) !important;
        color: var(--text-primary) !important;
    }

    /* Workflow components */
    :root:not([data-theme="light"]) .workflow-container,
    :root:not([data-theme="light"]) .exception-item,
    :root:not([data-theme="light"]) .exception-details {
        background-color: var(--bg-card) !important;
        color: var(--text-primary) !important;
        border-color: var(--border-color) !important;
    }

    :root:not([data-theme="light"]) .completion-message {
        background-color: var(--bg-card) !important;
        color: var(--text-primary) !important;
    }

    :root:not([data-theme="light"]) .cancelled-message {
        background-color: var(--bg-card) !important;
        color: var(--text-primary) !important;
    }

    :root:not([data-theme="light"]) .not-started-column {
        background-color: var(--bg-secondary) !important;
    }

    :root:not([data-theme="light"]) .not-started-column .column-header {
        background-color: #546e7a !important;
        border-radius: 8px 8px 0 0;
    }

    :root:not([data-theme="light"]) .not-started-column .column-header span {
        color: #ffffff !important;
    }

    :root:not([data-theme="light"]) .not-started-column .column-header .entity-count {
        color: #ffffff !important;
        background-color: rgba(255, 255, 255, 0.2) !important;
    }

    :root:not([data-theme="light"]) .stage-progress {
        background-color: var(--bg-secondary) !important;
    }

    :root:not([data-theme="light"]) .history-entry {
        background-color: var(--bg-card) !important;
        border-color: var(--border-color) !important;
    }

    /* Chore cards */
    :root:not([data-theme="light"]) .chore-card {
        background-color: var(--bg-card) !important;
        color: var(--text-primary) !important;
        border-color: var(--border-color) !important;
    }

    /* Notes components (application status, wizard) */
    :root:not([data-theme="light"]) .note-item {
        background-color: var(--bg-tertiary) !important;
        border-color: var(--border-color) !important;
    }

    :root:not([data-theme="light"]) .note-author {
        color: var(--text-primary) !important;
    }

    :root:not([data-theme="light"]) .note-date {
        color: var(--text-muted) !important;
    }

    :root:not([data-theme="light"]) .note-text {
        color: var(--text-secondary) !important;
    }

    :root:not([data-theme="light"]) .notes-list {
        background-color: var(--bg-card) !important;
    }

    :root:not([data-theme="light"]) .add-note-form textarea {
        background-color: var(--bg-input) !important;
        color: var(--text-primary) !important;
        border-color: var(--border-color) !important;
    }

    /* Disclosure text blocks */
    :root:not([data-theme="light"]) .disclosure-content {
        background: var(--bg-tertiary) !important;
        border-color: var(--border-color) !important;
        color: var(--text-primary) !important;
    }

    /* Signature pad */
    :root:not([data-theme="light"]) .signature-canvas-wrapper {
        border-color: var(--border-color) !important;
        background: var(--bg-card) !important;
    }

    :root:not([data-theme="light"]) .signature-baseline {
        background: var(--border-color) !important;
    }

    :root:not([data-theme="light"]) .signature-x-marker {
        color: var(--text-muted) !important;
    }

    :root:not([data-theme="light"]) .signature-clear-btn {
        background: var(--bg-tertiary) !important;
        border-color: var(--border-color) !important;
        color: var(--text-primary) !important;
    }

    :root:not([data-theme="light"]) .signature-status-text {
        color: var(--text-muted) !important;
    }

    :root:not([data-theme="light"]) .signature-image-wrapper {
        border-color: var(--border-color) !important;
        background: var(--bg-secondary) !important;
    }

    /* Catch-all for inline white backgrounds */
    :root:not([data-theme="light"]) div[style*="background: #fff"],
    :root:not([data-theme="light"]) div[style*="background-color: #fff"],
    :root:not([data-theme="light"]) div[style*="background: white"],
    :root:not([data-theme="light"]) div[style*="background-color: white"],
    :root:not([data-theme="light"]) div[style*="background:#fff"],
    :root:not([data-theme="light"]) div[style*="background-color:#fff"] {
        background-color: var(--bg-card) !important;
    }
}

/* Edit modal tabs */
[data-theme="dark"] .edit-modal-tab-bar {
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .edit-modal-tab-bar button {
    color: var(--text-secondary);
}

[data-theme="dark"] .edit-modal-tab-bar button:hover {
    color: var(--text-primary);
}

[data-theme="dark"] .edit-modal-tab-bar button.active {
    color: #ce93d8;
    border-bottom-color: #ce93d8;
}

[data-theme="dark"] .edit-modal-inline-actions {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

/* Login page dark mode */
[data-theme="dark"] .login-container .btn-passkey {
    background-color: #818cf8;
}

[data-theme="dark"] .login-container .btn-passkey:hover {
    background-color: #6366f1;
}

/* Action screen dark mode */
[data-theme="dark"] .action-screen-modal {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .action-screen-error {
    background: #4a1c1c;
    color: #ff8a80;
}

[data-theme="dark"] .action-screen-upload-slot {
    border-color: var(--border-color);
}

[data-theme="dark"] .action-screen-upload-slot.has-file {
    border-color: var(--color-primary);
}


/* Source: 51-theme-toggle.css */
/* =============================================================================
   Dark/light mode toggle button
   
   Source: styles.css lines 6796-6877
   ============================================================================= */

/* =============================================================================
   Theme Toggle
   ============================================================================= */

.theme-dropdown {
    position: relative;
    display: inline-block;
}

.theme-toggle {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: var(--text-secondary) !important;
    font-size: 18px !important;
    padding: 8px 12px !important;
    cursor: pointer;
    transition: color var(--transition-fast);
    margin: 0 !important;
}

.theme-toggle:hover {
    color: var(--color-primary-light) !important;
    background: transparent !important;
    box-shadow: none !important;
}

.logout-button {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: var(--text-secondary) !important;
    font-size: 18px !important;
    cursor: pointer !important;
    padding: 8px !important;
    transition: color var(--transition-fast);
    margin: 0 !important;
}

.logout-button:hover {
    color: var(--color-danger) !important;
    background: transparent !important;
    box-shadow: none !important;
}

[data-theme="dark"] .theme-toggle,
[data-theme="dark"] .logout-button {
    color: var(--text-inverse) !important;
}

.theme-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 120px;
    z-index: 1100;
    overflow: hidden;
}

.theme-menu-item {
    padding: 10px 16px;
    cursor: pointer;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color var(--transition-fast);
}

.theme-menu-item:hover {
    background-color: var(--bg-hover);
}

.theme-menu-item.active {
    background-color: var(--bg-selected);
    color: var(--color-primary);
}

.theme-menu-item i {
    width: 16px;
    text-align: center;
}


/* Source: 52-messaging-page.css */
/* =============================================================================
   Messaging Page — Full-page messaging with channels, DMs, threading
   ============================================================================= */

.msg-page {
  display: flex;
  height: calc(100vh - 60px);
  background: var(--bg-primary, #fff);
  overflow: hidden;
}

/* Sidebar */
.msg-sidebar {
  width: 280px;
  min-width: 280px;
  border-right: 1px solid var(--border-color, #e0e0e0);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: var(--bg-secondary, #f5f5f5);
}

.msg-sidebar-search {
  padding: 12px;
  border-bottom: 1px solid var(--border-color, #e0e0e0);
}

.msg-search-input-wrapper {
  display: flex;
  align-items: center;
  background: var(--bg-primary, #fff);
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 6px;
  padding: 6px 10px;
  gap: 8px;
}

.msg-search-input-wrapper i {
  color: var(--text-secondary, #888);
  font-size: 12px;
}

.msg-search-input-wrapper input {
  border: none;
  outline: none;
  background: transparent;
  flex: 1;
  font-size: 13px;
  color: var(--text-primary, #333);
}

/* Sidebar sections */
.msg-sidebar-section-wrapper {
  border-bottom: 1px solid var(--border-color, #e0e0e0);
}

.msg-sidebar-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary, #888);
  letter-spacing: 0.5px;
}

.msg-add-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary, #888);
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.15s;
}

.msg-add-btn:hover {
  background: var(--bg-hover, #e8e8e8);
  color: var(--text-primary, #333);
}

/* Section header (collapsible) */
.msg-sidebar-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 12px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-secondary, #888);
}

/* Chat items in sidebar */
.msg-sidebar-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  cursor: pointer;
  gap: 10px;
  transition: background 0.15s;
  border-left: 3px solid transparent;
}

.msg-sidebar-item:hover {
  background: var(--bg-hover, #e8e8e8);
}

.msg-sidebar-item.active {
  background: var(--bg-primary, #fff);
  border-left-color: var(--color-primary, #4a90d9);
}

.msg-sidebar-item-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--bg-primary, #fff);
  color: var(--text-secondary, #888);
  font-size: 12px;
  flex-shrink: 0;
}

.msg-sidebar-item.active .msg-sidebar-item-icon {
  background: var(--color-primary, #4a90d9);
  color: #fff;
}

.msg-sidebar-item-info {
  flex: 1;
  min-width: 0;
}

.msg-sidebar-item-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary, #333);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-sidebar-item-preview {
  font-size: 12px;
  color: var(--text-secondary, #888);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-sidebar-item-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.msg-sidebar-item-time {
  font-size: 11px;
  color: var(--text-secondary, #888);
}

.msg-sidebar-item-badge {
  background: var(--color-primary, #4a90d9);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

/* New channel / DM forms */
.msg-new-channel-form,
.msg-new-dm-form {
  padding: 10px 12px;
  border-top: 1px solid var(--border-color, #e0e0e0);
  background: var(--bg-primary, #fff);
}

.msg-form-field {
  margin-bottom: 8px;
}

.msg-form-field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary, #888);
  margin-bottom: 4px;
  text-transform: uppercase;
}

.msg-form-field input,
.msg-form-field select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 4px;
  font-size: 13px;
  background: var(--bg-primary, #fff);
  color: var(--text-primary, #333);
}

.msg-form-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.msg-form-actions .btn-secondary {
  flex: 1;
  padding: 6px;
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 4px;
  background: var(--bg-secondary, #f5f5f5);
  cursor: pointer;
  font-size: 12px;
}

.msg-form-actions .btn-primary {
  flex: 1;
  padding: 6px;
  border: none;
  border-radius: 4px;
  background: var(--color-primary, #4a90d9);
  color: #fff;
  cursor: pointer;
  font-size: 12px;
}

.msg-form-actions .btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.msg-user-list {
  max-height: 160px;
  overflow-y: auto;
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 4px;
  margin-top: 4px;
}

.msg-user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.15s;
}

.msg-user-item:hover {
  background: var(--bg-hover, #e8e8e8);
}

.msg-user-item.selected {
  background: var(--color-primary-light, #e8f0fe);
}

/* Conversation area */
.msg-conv-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.msg-conv-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.msg-conv-empty-content {
  text-align: center;
  color: var(--text-secondary, #888);
}

.msg-conv-empty-content h3 {
  margin: 8px 0;
  color: var(--text-primary, #333);
}

/* Conversation header */
.msg-conv-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color, #e0e0e0);
  background: var(--bg-primary, #fff);
  min-height: 48px;
}

.msg-conv-header-left {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.msg-conv-header-left h3 {
  margin: 0;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-conv-desc {
  font-size: 12px;
  color: var(--text-secondary, #888);
  margin-left: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-conv-header-actions {
  display: flex;
  gap: 4px;
}

.msg-conv-header-actions button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 4px;
  color: var(--text-secondary, #888);
  transition: background 0.15s;
}

.msg-conv-header-actions button:hover,
.msg-conv-header-actions button.active {
  background: var(--bg-hover, #e8e8e8);
  color: var(--text-primary, #333);
}

/* Message body */
.msg-conv-body {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}

.msg-messages-scroll {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.msg-messages-list {
  flex: 1;
  padding: 16px;
}

.msg-messages-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-secondary, #888);
}

/* Individual message */
.msg-message {
  display: flex;
  gap: 10px;
  padding: 6px 0;
  position: relative;
}

.msg-message:hover {
  background: var(--bg-hover, #fafafa);
  border-radius: 4px;
}

.msg-message-avatar {
  flex-shrink: 0;
}

.msg-avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-primary, #4a90d9);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
}

.msg-message-body {
  flex: 1;
  min-width: 0;
}

.msg-message-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 2px;
}

.msg-sender {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #333);
}

.msg-time {
  font-size: 11px;
  color: var(--text-secondary, #888);
}

.msg-pinned-icon {
  font-size: 10px;
  color: var(--color-primary, #4a90d9);
}

.msg-message-content {
  font-size: 14px;
  color: var(--text-primary, #333);
  line-height: 1.5;
  word-break: break-word;
}

/* Thread indicator on messages */
.msg-thread-indicator {
  display: inline-flex;
  align-items: center;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--color-primary, #4a90d9);
  cursor: pointer;
  transition: background 0.15s;
}

.msg-thread-indicator:hover {
  background: var(--color-primary-light, #e8f0fe);
}

/* Message hover actions */
.msg-actions {
  position: absolute;
  top: -8px;
  right: 8px;
  display: flex;
  gap: 2px;
  background: var(--bg-primary, #fff);
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 6px;
  padding: 2px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.msg-actions button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--text-secondary, #888);
  transition: background 0.15s;
}

.msg-actions button:hover {
  background: var(--bg-hover, #e8e8e8);
  color: var(--text-primary, #333);
}

/* Input bar */
.msg-input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border-color, #e0e0e0);
  background: var(--bg-primary, #fff);
}

.msg-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  background: var(--bg-secondary, #f5f5f5);
  color: var(--text-primary, #333);
  transition: border-color 0.2s;
}

.msg-input:focus {
  border-color: var(--color-primary, #4a90d9);
}

.msg-send-btn {
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  background: var(--color-primary, #4a90d9);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  transition: opacity 0.15s;
}

.msg-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.msg-send-btn:hover:not(:disabled) {
  opacity: 0.9;
}

/* Thread panel */
.msg-thread-panel {
  width: 360px;
  min-width: 360px;
  border-left: 1px solid var(--border-color, #e0e0e0);
  display: flex;
  flex-direction: column;
  background: var(--bg-primary, #fff);
}

.msg-thread-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color, #e0e0e0);
}

.msg-thread-header button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text-secondary, #888);
}

.msg-thread-header h4 {
  margin: 0;
  font-size: 14px;
}

.msg-thread-parent {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color, #e0e0e0);
  background: var(--bg-secondary, #f5f5f5);
}

.msg-thread-divider {
  padding: 8px 16px;
  font-size: 12px;
  color: var(--text-secondary, #888);
  border-bottom: 1px solid var(--border-color, #e0e0e0);
}

.msg-thread-messages {
  flex: 1;
  overflow-y: auto;
  padding: 8px 16px;
}

/* Pinned messages panel */
.msg-pinned-panel {
  border-bottom: 1px solid var(--border-color, #e0e0e0);
  background: var(--bg-secondary, #f5f5f5);
  max-height: 200px;
  overflow-y: auto;
}

.msg-pinned-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border-color, #e0e0e0);
}

.msg-pinned-header h4 {
  margin: 0;
  font-size: 13px;
}

.msg-pinned-header button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary, #888);
}

.msg-pinned-empty {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-secondary, #888);
  text-align: center;
}

.msg-pinned-item {
  padding: 8px 16px;
  border-bottom: 1px solid var(--border-color, #e0e0e0);
}

.msg-pinned-sender {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary, #333);
}

.msg-pinned-content {
  font-size: 13px;
  color: var(--text-primary, #333);
  margin-top: 2px;
}

.msg-pinned-time {
  font-size: 11px;
  color: var(--text-secondary, #888);
  margin-top: 2px;
}

/* Search panel */
.msg-search-panel {
  border-bottom: 1px solid var(--border-color, #e0e0e0);
  background: var(--bg-secondary, #f5f5f5);
}

.msg-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
}

.msg-search-bar input {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 4px;
  font-size: 13px;
  background: var(--bg-primary, #fff);
  color: var(--text-primary, #333);
}

.msg-search-bar button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  color: var(--text-secondary, #888);
}

.msg-search-results {
  max-height: 200px;
  overflow-y: auto;
}

.msg-search-empty {
  padding: 12px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary, #888);
}

.msg-search-result {
  padding: 8px 16px;
  border-top: 1px solid var(--border-color, #e0e0e0);
  cursor: pointer;
  transition: background 0.15s;
}

.msg-search-result:hover {
  background: var(--bg-hover, #e8e8e8);
}

.msg-search-result-sender {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary, #333);
}

.msg-search-result-content {
  font-size: 13px;
  color: var(--text-primary, #333);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-search-result-time {
  font-size: 11px;
  color: var(--text-secondary, #888);
  margin-top: 2px;
}

/* Responsive */
@media (max-width: 768px) {
  .msg-sidebar {
    width: 100%;
    min-width: 100%;
    position: absolute;
    z-index: 10;
    height: 100%;
  }

  .msg-thread-panel {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 10;
    width: 100%;
    min-width: 100%;
  }
}

/* Source: 53-billing-queue.css */
/* ==========================================================================
   53 — Billing Queue
   ========================================================================== */

.billing-queue-table table {
  font-size: 13px;
}

.billing-queue-table tbody tr:hover {
  background: var(--hover-bg, #f0f7ff) !important;
}

.billing-detail-panel {
  height: 100%;
}

/* Responsive: stack detail panel below table on narrow screens */
@media (max-width: 900px) {
  .billing-queue-page > div:last-child {
    flex-direction: column !important;
  }
  .billing-detail-panel {
    width: 100% !important;
    min-width: unset !important;
    border-left: none !important;
    border-top: 1px solid var(--border-color, #e0e0e0);
  }
}

/* Source: 54-ifta-ops.css */
/* =============================================================================
   IFTA Operations Page Styles
   Extends compliance page styles for IFTA-specific components
   ============================================================================= */

/* Stage badge pills */
.ifta-stage-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.5;
}

/* Credential link indicators */
.ifta-credential-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ifta-credential-link a {
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.15s ease;
}

.ifta-credential-link a:hover {
  opacity: 1;
}

/* Credential cards in detail view */
.ifta-credential-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  min-width: 280px;
  transition: box-shadow 0.15s ease;
}

.ifta-credential-card:hover {
  box-shadow: var(--shadow-md);
}

/* Source: 55-maintenance-dashboard.css */
/* =============================================================================
   55 — Maintenance Dashboard
   Uses CSS variables from 00-variables.css so dark mode works automatically.
   ============================================================================= */

.maintenance-dashboard {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 20px;
}

.maintenance-dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.maintenance-dashboard-header h1 {
  color: var(--text-link, #315efd);
  font-weight: 800;
  font-size: 1.4em;
  margin: 0;
}

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

.maintenance-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: #315efd;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.85em;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.maintenance-upload-btn:hover {
  background: #2347d0;
}

.maintenance-upload-btn i {
  font-size: 0.9em;
}

/* Tab Bar */
.maintenance-tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border-color, #e0e0e0);
  margin-bottom: 16px;
}

.maintenance-tab {
  padding: 8px 18px;
  font-size: 0.85em;
  font-weight: 600;
  color: var(--text-muted, #666);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}

.maintenance-tab:hover {
  color: var(--text-link, #315efd);
}

.maintenance-tab.active {
  color: var(--text-link, #315efd);
  border-bottom-color: var(--text-link, #315efd);
}

/* KPI Cards */
.maintenance-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.maintenance-kpi-card {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-color, #e8e8e8);
  border-left: 4px solid #315efd;
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
}

.maintenance-kpi-card.warning {
  border-left-color: #ffc107;
}

.maintenance-kpi-card.danger {
  border-left-color: #dc3545;
}

.maintenance-kpi-card.success {
  border-left-color: #28a745;
}

.maintenance-kpi-label {
  font-size: 0.75em;
  font-weight: 600;
  color: var(--text-muted, #888);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 4px;
}

.maintenance-kpi-value {
  font-size: 1.5em;
  font-weight: 800;
  color: var(--text-primary, #222);
  line-height: 1.2;
}

.maintenance-kpi-sub {
  font-size: 0.75em;
  color: var(--text-muted, #999);
  margin-top: 4px;
}

/* Chart Containers */
.maintenance-chart-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.maintenance-chart-card {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-color, #e8e8e8);
  border-radius: 8px;
  padding: 16px;
  min-height: 280px;
}

.maintenance-chart-card.full-width {
  grid-column: 1 / -1;
}

.maintenance-chart-title {
  font-size: 0.9em;
  font-weight: 700;
  color: var(--text-primary, #333);
  margin-bottom: 12px;
}

.maintenance-chart-card canvas {
  width: 100% !important;
  max-height: 250px;
}

/* Data Tables */
.maintenance-table-wrapper {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-color, #e8e8e8);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 20px;
}

.maintenance-table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color, #e8e8e8);
}

.maintenance-table-header h3 {
  font-size: 0.95em;
  font-weight: 700;
  color: var(--text-primary, #333);
  margin: 0;
}

.maintenance-table-header span {
  color: var(--text-muted, #888);
}

.maintenance-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85em;
}

.maintenance-table th {
  text-align: left;
  padding: 10px 12px;
  font-weight: 700;
  color: var(--text-secondary, #555);
  border-bottom: 1px solid var(--border-color, #e8e8e8);
  background: var(--bg-secondary, #fafbfc);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.maintenance-table th:hover {
  background: var(--bg-hover, #f0f2f5);
}

.maintenance-table th .sort-arrow {
  margin-left: 4px;
  font-size: 0.75em;
  color: var(--text-muted, #aaa);
}

.maintenance-table th .sort-arrow.active {
  color: var(--text-link, #315efd);
}

.maintenance-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-light, #f0f0f0);
  color: var(--text-primary, #333);
}

.maintenance-table tr:hover td {
  background: var(--bg-hover, #f8f9ff);
}

.maintenance-table tr.expandable {
  cursor: pointer;
}

.maintenance-table tr.expanded td {
  background: var(--bg-selected, #f0f4ff);
  font-weight: 600;
}

/* Status Badges */
.maintenance-status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.8em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.maintenance-status.ok {
  background: var(--bg-success-subtle, #e8f5e9);
  color: #2e7d32;
}

.maintenance-status.due-soon {
  background: var(--bg-warning-subtle, #fff8e1);
  color: #f57f17;
}

.maintenance-status.overdue {
  background: var(--bg-danger-subtle, #ffebee);
  color: #c62828;
}

.maintenance-status.in-progress {
  background: var(--bg-selected, #e3f2fd);
  color: #1565c0;
}

.maintenance-status.scheduled {
  background: #f3e5f5;
  color: #7b1fa2;
}

/* Recommendation Badges */
.maintenance-recommendation {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 12px;
  font-size: 0.8em;
  font-weight: 700;
}

.maintenance-recommendation.keep {
  background: var(--bg-success-subtle, #e8f5e9);
  color: #2e7d32;
}

.maintenance-recommendation.monitor {
  background: var(--bg-warning-subtle, #fff8e1);
  color: #f57f17;
}

.maintenance-recommendation.replace {
  background: var(--bg-danger-subtle, #ffebee);
  color: #c62828;
}

/* Detail Panel (expanded row) */
.maintenance-detail-panel {
  padding: 16px 20px;
  background: var(--bg-secondary, #fafbfc);
  border-bottom: 2px solid var(--border-color, #e0e0e0);
}

.maintenance-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.maintenance-detail-section h4 {
  font-size: 0.85em;
  font-weight: 700;
  color: var(--text-secondary, #555);
  margin: 0 0 8px 0;
}

/* Vendor Scorecard */
.maintenance-vendor-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.maintenance-vendor-card {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-color, #e8e8e8);
  border-radius: 8px;
  padding: 14px 16px;
}

.maintenance-vendor-name {
  font-size: 0.95em;
  font-weight: 700;
  color: var(--text-primary, #333);
  margin-bottom: 8px;
}

.maintenance-vendor-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.maintenance-vendor-stat {
  font-size: 0.8em;
}

.maintenance-vendor-stat-label {
  color: var(--text-muted, #888);
  font-weight: 600;
}

.maintenance-vendor-stat-value {
  color: var(--text-primary, #333);
  font-weight: 700;
}

.maintenance-vendor-card.flagged {
  border-left: 4px solid #dc3545;
}

/* Upload Area */
.maintenance-upload-area {
  border: 2px dashed var(--border-color, #ccc);
  border-radius: 12px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: var(--bg-secondary, #fafbfc);
  margin-bottom: 20px;
}

.maintenance-upload-area:hover {
  border-color: var(--text-link, #315efd);
  background: var(--bg-hover, #f0f4ff);
}

.maintenance-upload-area i {
  font-size: 2.5em;
  color: var(--text-muted, #aaa);
  margin-bottom: 12px;
}

.maintenance-upload-area p {
  color: var(--text-secondary, #666);
  font-size: 0.9em;
  margin: 4px 0 0;
}

.maintenance-upload-area .upload-hint {
  font-size: 0.8em;
  color: var(--text-muted, #aaa);
}

/* Recent uploads table */
.maintenance-recent-uploads {
  margin-top: 16px;
}

/* Empty state */
.maintenance-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted, #999);
}

.maintenance-empty i {
  font-size: 2em;
  margin-bottom: 8px;
  display: block;
}

/* Quick Actions */
.maintenance-quick-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.maintenance-quick-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: var(--bg-selected, #f0f4ff);
  color: var(--text-link, #315efd);
  border: 1px solid var(--border-color, #d0dcff);
  border-radius: 6px;
  font-size: 0.8em;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.maintenance-quick-action:hover {
  background: var(--bg-hover, #dde6ff);
}

/* Explanatory text */
.maintenance-dashboard p {
  color: var(--text-secondary, #666);
}

/* =============================================================================
   Upload Modal
   ============================================================================= */

.maint-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.maint-modal-backdrop {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-modal-overlay, rgba(0,0,0,0.5));
}

.maint-modal-content {
  position: relative;
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-color, transparent);
  border-radius: 12px;
  padding: 24px;
  max-width: 800px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  color: var(--text-primary, #333);
}

.maint-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.maint-modal-header h2 {
  margin: 0;
  font-size: 1.1em;
  font-weight: 800;
  color: var(--text-primary, #333);
}

.maint-modal-close {
  background: none;
  border: none;
  font-size: 1.4em;
  cursor: pointer;
  color: var(--text-muted, #888);
  line-height: 1;
  padding: 4px 8px;
  border-radius: 4px;
}

.maint-modal-close:hover {
  background: var(--bg-hover, #f0f0f0);
}

/* Form fields */
.maint-modal-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.maint-modal-field {
  margin-bottom: 8px;
}

.maint-modal-label {
  display: block;
  font-size: 0.75em;
  font-weight: 600;
  color: var(--text-muted, #888);
  margin-bottom: 2px;
}

.maint-modal-input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border-color, #ddd);
  border-radius: 4px;
  font-size: 0.85em;
  background: var(--bg-input, #fff);
  color: var(--text-primary, #333);
  box-sizing: border-box;
}

.maint-modal-back-btn {
  padding: 7px 14px;
  border: 1px solid var(--border-color, #ddd);
  border-radius: 6px;
  background: var(--bg-secondary, #fff);
  color: var(--text-primary, #333);
  cursor: pointer;
  font-size: 0.85em;
}

.maint-modal-back-btn:hover {
  background: var(--bg-hover, #f0f0f0);
}

/* Responsive */
@media (max-width: 900px) {
  .maintenance-chart-row {
    grid-template-columns: 1fr;
  }
  .maintenance-kpi-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .maintenance-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .maintenance-dashboard {
    padding: 10px 12px;
  }
  .maintenance-kpi-row {
    grid-template-columns: 1fr;
  }
  .maintenance-tab-bar {
    overflow-x: auto;
  }
  .maintenance-tab {
    white-space: nowrap;
    padding: 8px 12px;
    font-size: 0.8em;
  }
}

/* Dark mode badge color adjustments (badges use subtle bg that need specific dark values) */
[data-theme="dark"] .maintenance-status.ok,
[data-theme="dark"] .maintenance-recommendation.keep {
  color: #66bb6a;
}

[data-theme="dark"] .maintenance-status.due-soon,
[data-theme="dark"] .maintenance-recommendation.monitor {
  color: #ffb74d;
}

[data-theme="dark"] .maintenance-status.overdue,
[data-theme="dark"] .maintenance-recommendation.replace {
  color: #ef5350;
}

[data-theme="dark"] .maintenance-status.in-progress {
  color: #64b5f6;
}

[data-theme="dark"] .maintenance-status.scheduled {
  background: #2a1a3a;
  color: #ba68c8;
}

/* System dark mode — same badge adjustments */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .maintenance-status.ok,
  :root:not([data-theme="light"]) .maintenance-recommendation.keep {
    color: #66bb6a;
  }

  :root:not([data-theme="light"]) .maintenance-status.due-soon,
  :root:not([data-theme="light"]) .maintenance-recommendation.monitor {
    color: #ffb74d;
  }

  :root:not([data-theme="light"]) .maintenance-status.overdue,
  :root:not([data-theme="light"]) .maintenance-recommendation.replace {
    color: #ef5350;
  }

  :root:not([data-theme="light"]) .maintenance-status.in-progress {
    color: #64b5f6;
  }

  :root:not([data-theme="light"]) .maintenance-status.scheduled {
    background: #2a1a3a;
    color: #ba68c8;
  }
}

/* Source: 56-account-menu.css */
/* =============================================================================
   User Account Dropdown & Customer Settings Button
   ============================================================================= */

/* =============================================================================
   User Account Dropdown
   ============================================================================= */

.user-account-dropdown {
    position: relative;
    display: inline-block;
}

.user-account-toggle {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: var(--text-secondary) !important;
    font-size: 13px !important;
    padding: 6px 10px !important;
    cursor: pointer;
    transition: color var(--transition-fast);
    margin: 0 !important;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.user-account-toggle:hover {
    color: var(--color-primary-light) !important;
    background: transparent !important;
    box-shadow: none !important;
}

.user-account-toggle .fa-caret-down {
    font-size: 10px;
    opacity: 0.7;
}

[data-theme="dark"] .user-account-toggle {
    color: var(--text-inverse) !important;
}

.user-account-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    z-index: 1100;
    overflow: hidden;
}

.user-account-menu-item {
    padding: 10px 16px;
    cursor: pointer;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background-color var(--transition-fast);
    font-size: 13px;
}

.user-account-menu-item:hover {
    background-color: var(--bg-hover);
}

.user-account-menu-item.logout:hover {
    color: var(--color-danger);
}

.user-account-menu-item i {
    width: 16px;
    text-align: center;
    font-size: 14px;
}

.user-account-menu-divider {
    border-top: 1px solid var(--border-color);
    margin: 4px 0;
}

/* =============================================================================
   Customer Settings Button
   ============================================================================= */

.customer-settings-toggle {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: var(--text-secondary) !important;
    font-size: 13px !important;
    padding: 6px 10px !important;
    cursor: pointer;
    transition: color var(--transition-fast);
    margin: 0 !important;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    max-width: 200px;
}

.customer-settings-toggle:hover {
    color: var(--color-primary-light) !important;
    background: transparent !important;
    box-shadow: none !important;
}

.customer-settings-toggle .customer-name-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.customer-settings-toggle .fa-cog {
    font-size: 11px;
    opacity: 0.7;
}

[data-theme="dark"] .customer-settings-toggle {
    color: var(--text-inverse) !important;
}

/* =============================================================================
   Customer Settings Modal
   ============================================================================= */

.customer-settings-modal-content {
    max-width: 800px;
    width: 90vw;
    max-height: 85vh;
    overflow-y: auto;
    background: var(--bg-card);
    border-radius: var(--radius-lg, 12px);
    box-shadow: var(--shadow-lg);
    padding: 0;
}

.customer-settings-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.customer-settings-modal-header h3 {
    margin: 0;
    font-size: 16px;
    color: var(--text-primary);
}

.customer-settings-modal-body {
    padding: 0;
}

/* =============================================================================
   Account Action Modal
   ============================================================================= */

.account-action-modal-content {
    max-width: 500px;
    width: 90vw;
    max-height: 85vh;
    overflow-y: auto;
    background: var(--bg-card);
    border-radius: var(--radius-lg, 12px);
    box-shadow: var(--shadow-lg);
    padding: 0;
}

.account-action-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.account-action-modal-header h3 {
    margin: 0;
    font-size: 16px;
    color: var(--text-primary);
}

.account-action-modal-body {
    padding: 16px 20px;
}

/* Shared modal close button */
.modal-close-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px 8px;
    line-height: 1;
}

.modal-close-btn:hover {
    color: var(--text-primary);
}

/* Source: 60-spinal-rest-embed.css */
/* ============================================================================
   Spinal Rest — embeddable quiz UI.
   Brand colors per Derek (2026-04-24):
     primary: #8c57b4 purple, #1f1a5e navy, #ffffff white
     secondary: #98ded9 mint, #d62ee5 magenta, #2a62d4 blue, #f4b53f amber
   Used as a STANDALONE page (no admin shell). Loaded by /quiz and any
   WooCommerce iframe embed. Mobile-first: 320px → 414px → desktop.
   ============================================================================ */

:root {
  /* Brand */
  --sr-purple:      #8c57b4;
  --sr-navy:        #1f1a5e;
  --sr-white:       #ffffff;
  --sr-mint:        #98ded9;
  --sr-magenta:     #d62ee5;
  --sr-blue:        #2a62d4;
  --sr-amber:       #f4b53f;
  --sr-ink:         #1a1a1a;

  /* Derived */
  --sr-purple-soft: rgba(140, 87, 180, 0.12);
  --sr-purple-mid:  rgba(140, 87, 180, 0.32);
  --sr-navy-soft:   rgba(31, 26, 94, 0.06);
  --sr-mint-soft:   rgba(152, 222, 217, 0.20);
  --sr-shadow:      0 6px 20px rgba(31, 26, 94, 0.08);
  --sr-shadow-lg:   0 12px 40px rgba(31, 26, 94, 0.16);

  /* Type */
  --sr-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
             "Helvetica Neue", Arial, sans-serif;

  /* Spacing scale */
  --sr-space-1: 4px;
  --sr-space-2: 8px;
  --sr-space-3: 12px;
  --sr-space-4: 16px;
  --sr-space-5: 24px;
  --sr-space-6: 32px;
  --sr-space-8: 48px;
  --sr-space-10: 64px;

  /* Radii */
  --sr-radius-sm: 6px;
  --sr-radius:    12px;
  --sr-radius-lg: 18px;
  --sr-radius-xl: 24px;
}

/* ----- Reset for the embed root only (don't bleed into host page) -------- */

#sr-embed-root,
#sr-embed-root *,
#sr-embed-root *::before,
#sr-embed-root *::after {
  box-sizing: border-box;
}

#sr-embed-root {
  font-family: var(--sr-font);
  color: var(--sr-ink);
  background: var(--sr-white);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100%;
}

#sr-embed-root h1,
#sr-embed-root h2,
#sr-embed-root h3,
#sr-embed-root p {
  margin: 0;
}

/* ----- Layout shell ----------------------------------------------------- */

.sr-shell {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--sr-space-5) var(--sr-space-4);
}

.sr-shell--wide {
  max-width: 960px;
}

@media (min-width: 768px) {
  .sr-shell {
    padding: var(--sr-space-8) var(--sr-space-5);
  }
}

/* ----- Header ----------------------------------------------------------- */

.sr-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sr-space-4);
  margin-bottom: var(--sr-space-5);
}

.sr-header__logo {
  font-weight: 700;
  font-size: 20px;
  color: var(--sr-navy);
  letter-spacing: -0.01em;
}

.sr-header__logo .sr-mark {
  color: var(--sr-purple);
}

.sr-progress {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--sr-space-1);
  flex: 0 1 auto;
  min-width: 140px;
}

.sr-progress__label {
  font-size: 12px;
  color: rgba(31, 26, 94, 0.70);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sr-progress__bar {
  width: 140px;
  height: 6px;
  background: var(--sr-navy-soft);
  border-radius: 999px;
  overflow: hidden;
}

.sr-progress__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--sr-purple) 0%, var(--sr-magenta) 100%);
  transition: width 280ms ease-out;
}

/* ----- Question card ---------------------------------------------------- */

.sr-card {
  background: var(--sr-white);
  border-radius: var(--sr-radius-lg);
  box-shadow: var(--sr-shadow);
  padding: var(--sr-space-6);
  border: 1px solid var(--sr-purple-soft);
}

@media (min-width: 768px) {
  .sr-card {
    padding: var(--sr-space-8);
  }
}

.sr-question__phase {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sr-purple);
  font-weight: 600;
  margin-bottom: var(--sr-space-3);
}

.sr-question__prompt {
  font-size: 22px;
  font-weight: 600;
  color: var(--sr-navy);
  line-height: 1.3;
  margin-bottom: var(--sr-space-5);
}

@media (min-width: 768px) {
  .sr-question__prompt {
    font-size: 26px;
  }
}

/* ----- Conversational layer (Module 2) -------------------------------- */

.sr-question__ack {
  font-size: 14px;
  color: var(--sr-purple);
  margin-bottom: var(--sr-space-3);
  font-style: italic;
}

.sr-education-moment {
  background: var(--sr-mint-soft);
  border-left: 4px solid var(--sr-mint);
  border-radius: var(--sr-radius-sm);
  padding: var(--sr-space-3) var(--sr-space-4);
  font-size: 14px;
  line-height: 1.55;
  color: var(--sr-navy);
  margin-bottom: var(--sr-space-4);
}

.sr-clarify {
  margin-top: var(--sr-space-4);
  padding-top: var(--sr-space-4);
  border-top: 1px dashed var(--sr-navy-soft);
}

.sr-clarify__panel {
  margin-top: var(--sr-space-3);
  display: flex;
  flex-direction: column;
  gap: var(--sr-space-3);
}

.sr-clarify__reply {
  background: var(--sr-purple-soft);
  border-radius: var(--sr-radius-sm);
  padding: var(--sr-space-3) var(--sr-space-4);
  font-size: 14px;
  line-height: 1.55;
  color: var(--sr-navy);
}

/* ----- Options ---------------------------------------------------------- */

.sr-options {
  display: grid;
  gap: var(--sr-space-3);
  grid-template-columns: 1fr;
}

@media (min-width: 540px) {
  .sr-options--cols {
    grid-template-columns: repeat(2, 1fr);
  }
}

.sr-option {
  appearance: none;
  border: 2px solid var(--sr-navy-soft);
  background: var(--sr-white);
  color: var(--sr-ink);
  padding: var(--sr-space-4) var(--sr-space-5);
  border-radius: var(--sr-radius);
  text-align: left;
  font-size: 16px;
  font-weight: 500;
  font-family: var(--sr-font);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 80ms ease;
  display: flex;
  align-items: center;
  gap: var(--sr-space-3);
  width: 100%;
}

.sr-option:hover {
  border-color: var(--sr-purple-mid);
  background: var(--sr-purple-soft);
}

.sr-option:focus-visible {
  outline: 3px solid var(--sr-mint);
  outline-offset: 2px;
}

.sr-option--selected {
  border-color: var(--sr-purple);
  background: var(--sr-purple-soft);
  color: var(--sr-navy);
}

.sr-option--pending {
  border-color: var(--sr-purple);
  background: var(--sr-purple-soft);
  color: var(--sr-navy);
}

.sr-option--locked {
  opacity: 0.45;
  cursor: not-allowed;
}

.sr-option--with-explanation {
  align-items: flex-start;
  padding: var(--sr-space-4) var(--sr-space-5);
}

.sr-option__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 auto;
}

.sr-option__label {
  font-weight: 600;
  line-height: 1.35;
}

.sr-option__explanation {
  font-size: 13px;
  font-weight: 400;
  color: var(--sr-ink-muted, #5b5b6e);
  line-height: 1.4;
}

.sr-option--locked:hover {
  border-color: var(--sr-navy-soft);
  background: var(--sr-white);
}

.sr-option__spinner {
  width: 12px;
  height: 12px;
  border: 2px solid var(--sr-purple-soft);
  border-top-color: var(--sr-white);
  border-radius: 999px;
  animation: sr-spin 700ms linear infinite;
  display: inline-block;
}

.sr-option--pending .sr-option__check {
  background: var(--sr-purple);
  border-color: var(--sr-purple);
}

.sr-spinner--inline {
  width: 14px;
  height: 14px;
  border-width: 2px;
  vertical-align: middle;
  margin-right: var(--sr-space-2);
}

.sr-thinking {
  display: inline-flex;
  align-items: center;
  gap: var(--sr-space-2);
  font-size: 13px;
  color: var(--sr-purple);
  margin-top: var(--sr-space-3);
  font-weight: 500;
}

.sr-option--selected .sr-option__check {
  background: var(--sr-purple);
  border-color: var(--sr-purple);
}

.sr-option__check {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border: 2px solid var(--sr-purple-mid);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 120ms ease, border-color 120ms ease;
}

.sr-option__check::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: transparent;
}

.sr-option--selected .sr-option__check::before {
  background: var(--sr-white);
}

/* Multi-select uses a checkbox-style indicator */
.sr-option--multi .sr-option__check {
  border-radius: 6px;
}

.sr-option--multi.sr-option--selected .sr-option__check::before {
  width: 12px;
  height: 6px;
  border-left: 2px solid var(--sr-white);
  border-bottom: 2px solid var(--sr-white);
  background: transparent;
  border-radius: 0;
  transform: rotate(-45deg) translate(1px, -1px);
}

/* ----- Free-text + email inputs ----------------------------------------- */

.sr-input {
  width: 100%;
  padding: var(--sr-space-4);
  border: 2px solid var(--sr-navy-soft);
  border-radius: var(--sr-radius);
  font-family: var(--sr-font);
  font-size: 16px;
  color: var(--sr-ink);
  transition: border-color 160ms ease;
}

.sr-input:focus {
  outline: none;
  border-color: var(--sr-purple);
}

.sr-input--error {
  border-color: var(--sr-magenta);
}

.sr-input__error {
  display: block;
  margin-top: var(--sr-space-2);
  color: var(--sr-magenta);
  font-size: 14px;
}

/* ----- Footer / nav ---------------------------------------------------- */

.sr-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--sr-space-6);
  gap: var(--sr-space-3);
}

.sr-btn {
  appearance: none;
  border: none;
  border-radius: var(--sr-radius);
  font-family: var(--sr-font);
  font-size: 16px;
  font-weight: 600;
  padding: var(--sr-space-3) var(--sr-space-5);
  cursor: pointer;
  transition: transform 80ms ease, background 160ms ease;
  display: inline-flex;
  align-items: center;
  gap: var(--sr-space-2);
}

.sr-btn:focus-visible {
  outline: 3px solid var(--sr-mint);
  outline-offset: 2px;
}

.sr-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.sr-btn--primary {
  background: var(--sr-purple);
  color: var(--sr-white);
}

.sr-btn--primary:hover:not(:disabled) {
  background: var(--sr-navy);
}

.sr-btn--ghost {
  background: transparent;
  color: var(--sr-navy);
  border: 2px solid var(--sr-navy-soft);
}

.sr-btn--ghost:hover:not(:disabled) {
  border-color: var(--sr-purple);
  color: var(--sr-purple);
}

.sr-btn--text {
  background: transparent;
  color: var(--sr-purple);
  padding: var(--sr-space-2) var(--sr-space-3);
}

/* ----- Recommendation page --------------------------------------------- */

.sr-rec-header {
  margin-bottom: var(--sr-space-6);
}

.sr-rec-header__title {
  font-size: 28px;
  font-weight: 700;
  color: var(--sr-navy);
  margin-bottom: var(--sr-space-3);
  line-height: 1.2;
}

@media (min-width: 768px) {
  .sr-rec-header__title {
    font-size: 34px;
  }
}

.sr-rec-header__sub {
  color: rgba(31, 26, 94, 0.75);
  font-size: 16px;
}

.sr-cards {
  display: grid;
  gap: var(--sr-space-5);
  margin-bottom: var(--sr-space-6);
}

@media (min-width: 880px) {
  .sr-cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

.sr-rec-card {
  background: var(--sr-white);
  border-radius: var(--sr-radius-lg);
  padding: var(--sr-space-5);
  box-shadow: var(--sr-shadow);
  border: 1px solid var(--sr-purple-soft);
  display: flex;
  flex-direction: column;
  gap: var(--sr-space-3);
  position: relative;
  overflow: hidden;
}

.sr-rec-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--sr-purple), var(--sr-magenta));
}

.sr-rec-card--rank-1::before {
  background: linear-gradient(90deg, var(--sr-purple), var(--sr-amber));
}

.sr-rec-card__rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--sr-mint-soft);
  color: var(--sr-navy);
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
}

.sr-rec-card--rank-1 .sr-rec-card__rank {
  background: var(--sr-amber);
}

.sr-rec-card--stretch {
  border-color: var(--sr-amber, #f5b400);
}

.sr-rec-card__stretch-badge {
  display: inline-block;
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--sr-amber, #f5b400);
  color: var(--sr-navy, #1f1a5e);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sr-rec-card__brand {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sr-purple);
  font-weight: 600;
}

.sr-rec-card__model {
  font-size: 20px;
  font-weight: 700;
  color: var(--sr-navy);
  line-height: 1.2;
}

.sr-rec-card__best-for {
  background: var(--sr-mint-soft);
  border-radius: var(--sr-radius-sm);
  padding: var(--sr-space-2) var(--sr-space-3);
  font-size: 14px;
  color: var(--sr-navy);
  font-weight: 500;
}

.sr-rec-card__narrative {
  color: var(--sr-ink);
  font-size: 14px;
  line-height: 1.55;
  flex: 1;
}

.sr-rec-card__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--sr-purple);
  color: var(--sr-white);
  padding: var(--sr-space-3) var(--sr-space-4);
  border-radius: var(--sr-radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  transition: background 160ms ease;
}

.sr-rec-card__cta:hover {
  background: var(--sr-navy);
}

.sr-chiropractor-prompt,
.sr-bonus-rec,
.sr-clinical-override {
  background: var(--sr-purple-soft);
  border-left: 4px solid var(--sr-purple);
  padding: var(--sr-space-4);
  border-radius: var(--sr-radius-sm);
  margin-bottom: var(--sr-space-4);
  color: var(--sr-navy);
  font-size: 15px;
}

.sr-bonus-rec { border-left-color: var(--sr-amber); background: rgba(244, 181, 63, 0.10); }
.sr-clinical-override { border-left-color: var(--sr-magenta); background: rgba(214, 46, 229, 0.06); }

/* ----- Opt-in panel ---------------------------------------------------- */

.sr-optin {
  background: var(--sr-navy);
  border-radius: var(--sr-radius-lg);
  padding: var(--sr-space-6);
  color: var(--sr-white);
  margin-top: var(--sr-space-5);
}

.sr-optin__title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: var(--sr-space-2);
}

.sr-optin__sub {
  color: rgba(255, 255, 255, 0.80);
  margin-bottom: var(--sr-space-4);
  font-size: 15px;
}

.sr-optin__form {
  display: flex;
  gap: var(--sr-space-2);
  flex-wrap: wrap;
}

.sr-optin .sr-input {
  flex: 1 1 240px;
  background: rgba(255, 255, 255, 0.96);
}

/* ----- Empty / loading / human-review states --------------------------- */

.sr-state {
  text-align: center;
  padding: var(--sr-space-8) var(--sr-space-4);
  color: var(--sr-navy);
}

.sr-state__icon {
  width: 48px;
  height: 48px;
  margin: 0 auto var(--sr-space-4);
  border-radius: 999px;
  background: var(--sr-mint-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sr-purple);
  font-weight: 700;
}

.sr-state--review .sr-state__icon {
  background: rgba(244, 181, 63, 0.20);
  color: var(--sr-amber);
}

.sr-state__title {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: var(--sr-space-2);
  color: var(--sr-navy);
}

.sr-state__msg {
  color: rgba(31, 26, 94, 0.75);
  font-size: 16px;
}

/* ----- Spinner --------------------------------------------------------- */

.sr-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--sr-purple-soft);
  border-top-color: var(--sr-purple);
  border-radius: 999px;
  animation: sr-spin 700ms linear infinite;
  display: inline-block;
}

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

/* ----- Footer attribution ---------------------------------------------- */

.sr-footnote {
  text-align: center;
  margin-top: var(--sr-space-6);
  color: rgba(31, 26, 94, 0.55);
  font-size: 13px;
}

.sr-footnote a {
  color: var(--sr-purple);
  text-decoration: underline;
}

/* ----- Welcome screen --------------------------------------------------- */
.sr-welcome {
  background: var(--sr-white);
  border-radius: var(--sr-radius-lg);
  padding: var(--sr-space-6) var(--sr-space-5);
  box-shadow: var(--sr-shadow);
  text-align: left;
}
@media (min-width: 768px) {
  .sr-welcome {
    padding: var(--sr-space-8) var(--sr-space-8);
  }
}

.sr-welcome__phase {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sr-purple);
  margin-bottom: var(--sr-space-3);
}

.sr-welcome__title {
  margin: 0 0 var(--sr-space-4);
  font-size: 28px;
  line-height: 1.15;
  color: var(--sr-navy);
}
@media (min-width: 768px) {
  .sr-welcome__title { font-size: 36px; }
}

.sr-welcome__body {
  margin: 0 0 var(--sr-space-6);
  font-size: 16px;
  line-height: 1.6;
  color: var(--sr-ink);
}

.sr-welcome__cta {
  width: 100%;
}
@media (min-width: 540px) {
  .sr-welcome__cta { width: auto; }
}

/* ----- Why-we-ask callout ----------------------------------------------- */
.sr-why-we-ask {
  background: var(--sr-purple-soft);
  border-left: 4px solid var(--sr-purple);
  border-radius: var(--sr-radius-sm);
  padding: var(--sr-space-3) var(--sr-space-4);
  margin: var(--sr-space-3) 0 var(--sr-space-4);
}

.sr-why-we-ask__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sr-purple);
  margin-bottom: var(--sr-space-1);
}

.sr-why-we-ask__body {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--sr-navy);
}

/* ----- Back button row -------------------------------------------------- */
.sr-back-row {
  margin-bottom: var(--sr-space-3);
}

.sr-back-btn {
  padding: 0;
  font-size: 13px;
  color: rgba(31, 26, 94, 0.65);
}

.sr-back-btn:hover:not(:disabled) {
  color: var(--sr-purple);
}

/* ----- Email gate (Phase 4 of Derek feedback) --------------------------- */
.sr-email-gate__sub {
  margin: 0 0 var(--sr-space-4);
  font-size: 14px;
  line-height: 1.55;
  color: rgba(31, 26, 94, 0.75);
}

.sr-email-gate__footnote {
  margin: var(--sr-space-3) 0 0;
  font-size: 12px;
  color: rgba(31, 26, 94, 0.55);
}

.sr-checkbox {
  display: flex;
  align-items: flex-start;
  gap: var(--sr-space-2);
  margin: var(--sr-space-3) 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--sr-navy);
  cursor: pointer;
}

.sr-checkbox input[type="checkbox"] {
  margin-top: 2px;
  accent-color: var(--sr-purple);
  cursor: pointer;
}

/* ----- Complex-profile note (replaces the old human-review handoff) ----- */
.sr-complex-note {
  background: rgba(244, 181, 63, 0.12);
  border-left: 4px solid var(--sr-amber);
  border-radius: var(--sr-radius-sm);
  padding: var(--sr-space-3) var(--sr-space-4);
  margin-bottom: var(--sr-space-4);
  font-size: 14px;
  line-height: 1.55;
  color: var(--sr-navy);
}

/* Source: 61-spinal-rest-admin.css */
/* ============================================================================
   Spinal Rest — admin shell. Brand-themed, light by default.
   Loaded by /spinal-rest/admin. Mounts at #sr-admin-root.
   ============================================================================ */

#sr-admin-root,
#sr-admin-root *,
#sr-admin-root *::before,
#sr-admin-root *::after { box-sizing: border-box; }

#sr-admin-root {
  font-family: var(--sr-font);
  color: var(--sr-ink);
  background: #f7f5fb;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

/* ----- Layout shell ---------------------------------------------------- */

.sra-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}

.sra-sidebar {
  background: var(--sr-navy);
  color: var(--sr-white);
  padding: var(--sr-space-5) var(--sr-space-4);
  display: flex;
  flex-direction: column;
  gap: var(--sr-space-1);
  min-height: 100vh;
}

.sra-sidebar__logo {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: var(--sr-space-6);
  letter-spacing: -0.01em;
}

.sra-sidebar__logo .sr-mark { color: var(--sr-mint); }

.sra-nav-link {
  background: none;
  border: none;
  appearance: none;
  text-align: left;
  color: rgba(255,255,255,0.78);
  padding: var(--sr-space-3) var(--sr-space-3);
  border-radius: var(--sr-radius-sm);
  font-family: var(--sr-font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}

.sra-nav-link:hover { background: rgba(255,255,255,0.07); color: var(--sr-white); }
.sra-nav-link--active {
  background: rgba(140, 87, 180, 0.32);
  color: var(--sr-white);
}

.sra-sidebar__footer {
  margin-top: auto;
  font-size: 12px;
  color: rgba(255,255,255,0.55);
}

/* ----- Main pane ------------------------------------------------------- */

.sra-main {
  padding: var(--sr-space-6) var(--sr-space-8);
  overflow-y: auto;
  max-width: 1280px;
}

.sra-page-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--sr-navy);
  margin-bottom: var(--sr-space-5);
}

.sra-page-subtitle {
  color: rgba(31, 26, 94, 0.65);
  font-size: 14px;
  margin-top: -16px;
  margin-bottom: var(--sr-space-5);
}

/* ----- Dashboard widgets ---------------------------------------------- */

.sra-tiles {
  display: grid;
  gap: var(--sr-space-4);
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: var(--sr-space-6);
}

.sra-tile {
  background: var(--sr-white);
  border-radius: var(--sr-radius);
  padding: var(--sr-space-4) var(--sr-space-5);
  border: 1px solid var(--sr-purple-soft);
  box-shadow: var(--sr-shadow);
}

.sra-tile__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--sr-purple);
  font-weight: 600;
  margin-bottom: var(--sr-space-2);
}

.sra-tile__value {
  font-size: 28px;
  font-weight: 700;
  color: var(--sr-navy);
  line-height: 1.1;
}

.sra-tile__sub {
  font-size: 13px;
  color: rgba(31,26,94,0.65);
  margin-top: var(--sr-space-2);
}

.sra-tile--wide {
  grid-column: 1 / -1;
}

/* ----- Tables --------------------------------------------------------- */

.sra-table-card {
  background: var(--sr-white);
  border-radius: var(--sr-radius);
  border: 1px solid var(--sr-purple-soft);
  overflow: hidden;
  margin-bottom: var(--sr-space-5);
}

.sra-table-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sr-space-4) var(--sr-space-5);
  border-bottom: 1px solid var(--sr-navy-soft);
}

.sra-table-card__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--sr-navy);
}

.sra-table {
  width: 100%;
  border-collapse: collapse;
}

.sra-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(31,26,94,0.65);
  padding: var(--sr-space-3) var(--sr-space-5);
  border-bottom: 1px solid var(--sr-navy-soft);
  font-weight: 600;
}

.sra-table td {
  padding: var(--sr-space-3) var(--sr-space-5);
  border-bottom: 1px solid var(--sr-navy-soft);
  vertical-align: top;
  color: var(--sr-ink);
}

.sra-table tr:last-child td { border-bottom: none; }
.sra-table tr:hover td { background: var(--sr-purple-soft); }

.sra-table__empty {
  padding: var(--sr-space-6);
  text-align: center;
  color: rgba(31,26,94,0.55);
}

.sra-table-row--clickable { cursor: pointer; }

/* ----- Buttons + forms ------------------------------------------------ */

.sra-btn {
  appearance: none;
  border: none;
  border-radius: var(--sr-radius-sm);
  font-family: var(--sr-font);
  font-size: 13px;
  font-weight: 600;
  padding: var(--sr-space-2) var(--sr-space-3);
  cursor: pointer;
  background: var(--sr-purple);
  color: var(--sr-white);
  transition: background 120ms ease;
}

.sra-btn:hover:not(:disabled) { background: var(--sr-navy); }
.sra-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.sra-btn--ghost {
  background: transparent;
  color: var(--sr-purple);
  border: 1px solid var(--sr-purple);
}
.sra-btn--ghost:hover:not(:disabled) {
  background: var(--sr-purple-soft);
}

.sra-form {
  display: grid;
  gap: var(--sr-space-4);
  max-width: 640px;
}

.sra-field {
  display: flex;
  flex-direction: column;
  gap: var(--sr-space-2);
}

.sra-field__label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--sr-purple);
  font-weight: 600;
}

.sra-field__input {
  padding: var(--sr-space-3);
  border: 2px solid var(--sr-navy-soft);
  border-radius: var(--sr-radius-sm);
  font-family: var(--sr-font);
  font-size: 14px;
}

.sra-field__input:focus {
  outline: none;
  border-color: var(--sr-purple);
}

.sra-field__hint {
  font-size: 12px;
  color: rgba(31,26,94,0.55);
}

/* ----- Detail panel -------------------------------------------------- */

.sra-detail {
  background: var(--sr-white);
  border-radius: var(--sr-radius);
  border: 1px solid var(--sr-purple-soft);
  padding: var(--sr-space-5);
  margin-bottom: var(--sr-space-4);
}

.sra-detail__row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--sr-space-4);
  padding: var(--sr-space-2) 0;
  border-bottom: 1px dashed var(--sr-navy-soft);
}

.sra-detail__row:last-child { border-bottom: none; }
.sra-detail__label { color: rgba(31,26,94,0.65); font-size: 13px; }
.sra-detail__value { color: var(--sr-ink); font-size: 13px; word-break: break-word; }

/* ----- Code/snippet ---------------------------------------------------- */

.sra-snippet {
  background: var(--sr-navy);
  color: var(--sr-mint);
  padding: var(--sr-space-3) var(--sr-space-4);
  border-radius: var(--sr-radius-sm);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.5;
}

/* ----- Status pills --------------------------------------------------- */

.sra-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sra-pill--fired   { background: var(--sr-mint-soft);             color: #1d6e6a; }
.sra-pill--dedup   { background: rgba(214,46,229,0.12);           color: var(--sr-magenta); }
.sra-pill--velocity{ background: rgba(244,181,63,0.18);           color: #8a5b00; }
.sra-pill--expired { background: rgba(31,26,94,0.10);             color: var(--sr-navy); }
.sra-pill--active  { background: var(--sr-mint-soft);             color: #1d6e6a; }
.sra-pill--inactive{ background: rgba(31,26,94,0.10);             color: var(--sr-navy); }

/* Source: 90-utilities.css */
/* =============================================================================
   Utility and helper classes
   
   Source: styles.css lines 6925-7089
   ============================================================================= */

/* =============================================================================
   Utility Classes
   ============================================================================= */

/* Spacing utilities */
.p-0 { padding: 0 !important; }
.p-1 { padding: var(--spacing-xs) !important; }
.p-2 { padding: var(--spacing-sm) !important; }
.p-3 { padding: var(--spacing-md) !important; }
.p-4 { padding: var(--spacing-lg) !important; }
.p-5 { padding: var(--spacing-xl) !important; }

.px-1 { padding-left: var(--spacing-xs) !important; padding-right: var(--spacing-xs) !important; }
.px-2 { padding-left: var(--spacing-sm) !important; padding-right: var(--spacing-sm) !important; }
.px-3 { padding-left: var(--spacing-md) !important; padding-right: var(--spacing-md) !important; }
.px-4 { padding-left: var(--spacing-lg) !important; padding-right: var(--spacing-lg) !important; }

.py-1 { padding-top: var(--spacing-xs) !important; padding-bottom: var(--spacing-xs) !important; }
.py-2 { padding-top: var(--spacing-sm) !important; padding-bottom: var(--spacing-sm) !important; }
.py-3 { padding-top: var(--spacing-md) !important; padding-bottom: var(--spacing-md) !important; }
.py-4 { padding-top: var(--spacing-lg) !important; padding-bottom: var(--spacing-lg) !important; }

.m-0 { margin: 0 !important; }
.m-1 { margin: var(--spacing-xs) !important; }
.m-2 { margin: var(--spacing-sm) !important; }
.m-3 { margin: var(--spacing-md) !important; }
.m-4 { margin: var(--spacing-lg) !important; }

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

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

/* Flex utilities */
.flex { display: flex !important; }
.inline-flex { display: inline-flex !important; }
.flex-col { flex-direction: column !important; }
.flex-row { flex-direction: row !important; }
.flex-wrap { flex-wrap: wrap !important; }
.items-center { align-items: center !important; }
.items-start { align-items: flex-start !important; }
.items-end { align-items: flex-end !important; }
.justify-center { justify-content: center !important; }
.justify-between { justify-content: space-between !important; }
.justify-end { justify-content: flex-end !important; }
.justify-start { justify-content: flex-start !important; }
.flex-1 { flex: 1 !important; }
.flex-grow { flex-grow: 1 !important; }
.flex-shrink-0 { flex-shrink: 0 !important; }

.gap-1 { gap: var(--spacing-xs) !important; }
.gap-2 { gap: var(--spacing-sm) !important; }
.gap-3 { gap: var(--spacing-md) !important; }
.gap-4 { gap: var(--spacing-lg) !important; }

/* Text utilities */
.text-xs { font-size: 11px !important; }
.text-sm { font-size: 12px !important; }
.text-base { font-size: 14px !important; }
.text-lg { font-size: 16px !important; }
.text-xl { font-size: 18px !important; }
.text-2xl { font-size: 24px !important; }

.font-normal { font-weight: normal !important; }
.font-medium { font-weight: 500 !important; }
.font-semibold { font-weight: 600 !important; }
.font-bold { font-weight: bold !important; }

.text-left { text-align: left !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }

.text-primary { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-inverse { color: var(--text-inverse) !important; }
.text-link { color: var(--text-link) !important; }
.text-success { color: var(--color-success) !important; }
.text-warning { color: var(--color-warning) !important; }
.text-danger { color: var(--color-danger) !important; }

/* Background utilities */
.bg-primary { background-color: var(--bg-primary) !important; }
.bg-secondary { background-color: var(--bg-secondary) !important; }
.bg-tertiary { background-color: var(--bg-tertiary) !important; }
.bg-card { background-color: var(--bg-card) !important; }
.bg-success { background-color: var(--color-success-bg) !important; }
.bg-warning { background-color: var(--color-warning-bg) !important; }
.bg-danger { background-color: var(--color-danger-bg) !important; }
.bg-info { background-color: var(--color-info-bg) !important; }

/* Border utilities */
.border { border: 1px solid var(--border-color) !important; }
.border-0 { border: none !important; }
.border-t { border-top: 1px solid var(--border-color) !important; }
.border-b { border-bottom: 1px solid var(--border-color) !important; }
.border-l { border-left: 1px solid var(--border-color) !important; }
.border-r { border-right: 1px solid var(--border-color) !important; }

.rounded { border-radius: var(--radius-sm) !important; }
.rounded-md { border-radius: var(--radius-md) !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }
.rounded-xl { border-radius: var(--radius-xl) !important; }
.rounded-full { border-radius: 9999px !important; }

/* Shadow utilities */
.shadow-none { box-shadow: none !important; }
.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow { box-shadow: var(--shadow-md) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }

/* Width/Height utilities */
.w-full { width: 100% !important; }
.h-full { height: 100% !important; }
.min-h-screen { min-height: 100vh !important; }

/* Display utilities */
.hidden { display: none !important; }
.block { display: block !important; }
.inline-block { display: inline-block !important; }

/* Cursor utilities */
.cursor-pointer { cursor: pointer !important; }
.cursor-default { cursor: default !important; }
.cursor-not-allowed { cursor: not-allowed !important; }

/* Overflow utilities */
.overflow-auto { overflow: auto !important; }
.overflow-hidden { overflow: hidden !important; }
.overflow-x-auto { overflow-x: auto !important; }
.overflow-y-auto { overflow-y: auto !important; }

/* Position utilities */
.relative { position: relative !important; }
.absolute { position: absolute !important; }
.fixed { position: fixed !important; }
.sticky { position: sticky !important; }

/* Card component */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.card-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
}

.card-body {
    padding: var(--spacing-lg);
}

.card-footer {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
}

