/* CSS Variables */
:root {
    /* Colors - Primary */
    --color-primary: #1a73e8;
    --color-primary-dark: #1557b0;
    --color-primary-light: #4285f4;

    /* Colors - Status */
    --color-success: #34a853;
    --color-warning: #fbbc04;
    --color-error: #ea4335;
    --color-error-dark: #c5221f;
    --color-info: #4285f4;

    /* Colors - Neutral */
    --color-white: #ffffff;
    --color-gray-50: #f8f9fa;
    --color-gray-100: #f1f3f4;
    --color-gray-200: #e8eaed;
    --color-gray-300: #dadce0;
    --color-gray-400: #bdc1c6;
    --color-gray-500: #9aa0a6;
    --color-gray-600: #80868b;
    --color-gray-700: #5f6368;
    --color-gray-800: #3c4043;
    --color-gray-900: #202124;

    /* Colors - Background */
    --color-bg-main: #f5f5f5;
    --color-bg-card: #ffffff;
    --color-bg-hover: #f1f3f4;

    /* Semantic aliases */
    --bg-secondary: var(--color-gray-50);
    --bg-hover: var(--color-bg-hover);
    --accent-color: var(--color-primary);
    --text-primary: var(--color-gray-900);
    --text-secondary: var(--color-gray-700);

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

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

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.1), 0 10px 20px rgba(0, 0, 0, 0.15);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.2s ease;
    --transition-slow: 0.3s ease;

    /* Font Families */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;

    /* Font Sizes */
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2rem;

    /* Z-index layers */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    --z-notification: 9999;
}

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

/* Typography */
body {
    font-family: var(--font-sans);
    font-size: var(--font-size-base);
    line-height: 1.5;
    color: var(--color-gray-900);
    background: var(--color-bg-main);
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
}

h1 {
    font-size: var(--font-size-2xl);
}

h2 {
    font-size: var(--font-size-xl);
}

h3 {
    font-size: var(--font-size-lg);
}

h4, h5, h6 {
    font-size: var(--font-size-base);
}

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

p:last-child {
    margin-bottom: 0;
}

code, pre {
    font-family: var(--font-mono);
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Layout Grid and Structure */

header {
    background: var(--color-primary);
    color: white;
    padding: var(--spacing-md) var(--spacing-xl);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: var(--font-size-2xl);
}

#account-selector {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

#account-selector select {
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
    border: none;
    min-width: 200px;
}

main {
    padding: var(--spacing-xl);
    max-width: 1600px;
    margin: 0 auto;
}

#summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

/* Header right section */
#header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Admin-only elements (visible based on user role) */
.admin-only {
    display: none;
}

.admin-only.visible {
    display: inline-block;
}

/* Navigation - User menu and header navigation */

/* User menu dropdown */
#user-menu {
    position: relative;
}

#user-menu.hidden {
    display: none;
}

#user-menu-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

#user-menu-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

#user-menu-btn .caret {
    font-size: 0.7rem;
}

/* Header role badge */
.header-role-badge {
    display: inline-block;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 0.5rem;
}

.header-role-badge.role-admin {
    background: rgba(234, 67, 53, 0.9);
    color: white;
}

.header-role-badge.role-operator {
    background: rgba(66, 133, 244, 0.9);
    color: white;
}

.header-role-badge.role-viewer {
    background: rgba(52, 168, 83, 0.9);
    color: white;
}

/* User dropdown menu */
#user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: white;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    z-index: 1000;
}

#user-dropdown.hidden {
    display: none;
}

#user-dropdown a {
    display: block;
    padding: 0.75rem 1rem;
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
}

#user-dropdown a:hover {
    background: #f5f5f5;
}

#user-dropdown a:first-child {
    border-radius: 4px 4px 0 0;
}

#user-dropdown a:last-child {
    border-radius: 0 0 4px 4px;
    border-top: 1px solid #eee;
    color: #ea4335;
}

/* Login button (shown when user is not logged in) */
.header-login-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 0.5rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.header-login-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
}

.header-login-btn.hidden {
    display: none;
}


/* Responsive Breakpoints */

@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 1rem;
    }

    table {
        display: block;
        overflow-x: auto;
    }

    .modal-content {
        width: 95%;
    }

    .bulk-action-bar {
        flex-wrap: wrap;
    }

    .tabs {
        padding: 0 1rem;
    }

    .tab-btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .date-range-picker {
        flex-direction: column;
        align-items: stretch;
    }

    .date-range-picker label {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Button Components */

/* Base button styles */
button {
    padding: 0.4rem 0.8rem;
    border: none;
    border-radius: 4px;
    background: #1a73e8;
    color: white;
    cursor: pointer;
    font-size: 0.8rem;
}

button:hover {
    background: #1557b0;
}

button.secondary {
    background: #666;
}

button.secondary:hover {
    background: #555;
}

/* Generic button class */
.btn {
    padding: 0.625rem 1.25rem;
    border-radius: 4px;
    border: none;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

/* Small button variant */
.btn-small {
    padding: 0.35rem 0.6rem !important;
    font-size: 0.8rem !important;
    width: auto !important;
}

/* Primary button */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #5568d3 0%, #6a3f8f 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Secondary button */
.btn-secondary {
    background: #f1f3f4;
    color: #202124;
}

.btn-secondary:hover {
    background: #e8eaed;
}

/* Danger button */
.btn-danger {
    background: #ea4335 !important;
    color: white !important;
    border: 1px solid #c5221f !important;
}

.btn-danger:hover:not(:disabled) {
    background: #c5221f !important;
    box-shadow: 0 2px 4px rgba(234, 67, 53, 0.3) !important;
    transform: translateY(-1px);
}

.btn-danger:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-danger .icon {
    margin-right: 0.25rem;
}

/* Action buttons group */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

/* Icon buttons */
.icon-btn {
    padding: 0.5rem 0.75rem;
    background: #f1f3f4;
    color: #202124;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.icon-btn.secondary {
    background: white;
    border: 1px solid #e0e0e0;
}

.icon-btn.secondary:hover {
    background: #f5f5f5;
}

/* Button loading state */
button.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

button.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: button-spin 0.6s linear infinite;
}

@keyframes button-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Additional button hover states (simplified versions) */
.btn-primary:hover {
    background: #1557b0 !important;
}

.btn-danger:hover {
    background: #c5221f !important;
}

/* Button size variations */
.btn-large {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}


/* ============================================================================
   Form Validation Styles
   ============================================================================ */

/* Error state for form inputs */
input.field-error,
select.field-error,
textarea.field-error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2);
}

input.field-error:focus,
select.field-error:focus,
textarea.field-error:focus {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.3);
    outline: none;
}

/* Success state for form inputs */
input.field-success,
select.field-success,
textarea.field-success {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.2);
}

input.field-success:focus,
select.field-success:focus,
textarea.field-success:focus {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.3);
    outline: none;
}

/* Inline error message */
.field-error-message {
    color: #dc3545;
    font-size: 0.8125rem;
    margin-top: 4px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.field-error-message::before {
    content: "\26A0"; /* Warning sign */
    font-size: 0.75rem;
}

/* Date range error container */
.date-range-error {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 8px;
    padding: 8px 12px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    display: none;
}

.date-range-error.visible {
    display: block;
}

/* Form field wrapper with error support */
.form-field {
    margin-bottom: 1rem;
}

.form-field label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
    color: #333;
}

.form-field .help-text {
    color: #666;
    font-size: 0.8125rem;
    margin-top: 4px;
}

.form-field.has-error .help-text {
    display: none;
}

/* Validation feedback icons */
.input-with-icon {
    position: relative;
}

.input-with-icon input {
    padding-right: 2.5rem;
}

.input-with-icon .validation-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    pointer-events: none;
}

.input-with-icon .validation-icon.success {
    color: #28a745;
}

.input-with-icon .validation-icon.error {
    color: #dc3545;
}

/* Disabled nav button for permissions */
.nav-btn.permission-disabled,
button.permission-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.nav-btn.permission-disabled:hover,
button.permission-disabled:hover {
    background-color: inherit;
    transform: none;
}

/* Form unsaved changes indicator */
.form-dirty-indicator {
    color: #856404;
    background: #fff3cd;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    display: none;
}

.form-dirty-indicator.visible {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-dirty-indicator::before {
    content: "\26A0";
}

/* Permission restricted list */
.permission-restricted-list {
    margin: 0.5rem 0 1rem 1.5rem;
    padding: 0;
    list-style: disc;
    color: #666;
}

.permission-restricted-list li {
    margin-bottom: 0.25rem;
}

/* Required field indicators */
.required-indicator {
    color: #dc3545;
    margin-left: 2px;
    font-weight: 600;
}

label.required::after {
    content: " *";
    color: #dc3545;
    margin-left: 0.25rem;
    font-weight: 600;
}

/* Form help text for required fields */
.form-required-note {
    font-size: 0.75rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.form-required-note .required-indicator {
    font-size: 0.875rem;
}

/* Read-only input styling */
input[readonly],
input[disabled],
select[disabled],
textarea[readonly],
textarea[disabled] {
    background-color: #e9ecef;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Read-only field label */
.readonly-label {
    font-size: 0.75rem;
    color: #6c757d;
    font-style: italic;
}

/* Checkbox label in forms */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Field error message hidden state */
.field-error-message.hidden {
    display: none;
}

/* Error and warning message states */
.error-message {
    padding: 1rem;
    background: #fce8e6;
    border: 1px solid #ea4335;
    border-radius: 4px;
    color: #c5221f;
    margin-top: 1rem;
}

.error-message.hidden {
    display: none;
}

.warning-message.hidden {
    display: none;
}



/* Form Sections */
.form-section {
    margin: 1.5rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
}

.form-section h3 {
    margin-bottom: 1rem;
    color: #333;
    font-size: 1.1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.form-group input[type="checkbox"] {
    margin-right: 0.5rem;
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.form-actions button {
    padding: 0.6rem 1.2rem;
}

.form-actions button:first-child {
    background: #666;
}

.form-actions button:first-child:hover {
    background: #555;
}

/* Controls Section */
.controls-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.controls-row select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-width: 180px;
}

.controls-row button {
    padding: 0.5rem 1rem;
}

/* Responsive adjustments for multi-company UI */
@media (max-width: 768px) {
    #header-right {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    #company-selector,
    #account-selector {
        width: 100%;
    }

    #company-selector select,
    #account-selector select {
        width: 100%;
        min-width: auto;
    }

    .company-card,
    .account-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .account-actions,
    .company-actions {
        margin-top: 1rem;
        width: 100%;
    }

    .controls-row {
        flex-direction: column;
        align-items: stretch;
    }

    .controls-row select,
    .controls-row button {
        width: 100%;
    }
}



.card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card h3 {
    color: #666;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.card .value {
    font-size: 1.5rem;
    font-weight: bold;
}

.card .monthly {
    font-size: 0.9rem;
    color: #888;
    margin-top: 0.25rem;
}

.card .hourly {
    font-size: 0.85rem;
    color: #888;
    margin-top: 0.25rem;
}

.card .yearly {
    font-size: 0.75rem;
    color: #aaa;
    margin-top: 0.15rem;
}

.savings {
    color: #34a853;
}

.potential {
    color: #fbbc04;
}

.potential .pending {
    color: #999;
    font-style: italic;
}


.error {
    color: #ea4335;
    padding: 1rem;
    background: #fce8e6;
    border-radius: 4px;
}

.info-banner {
    background: #e8f0fe;
    border: 1px solid #1a73e8;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
    color: #174ea6;
}

.info-banner h3 {
    color: #1a73e8;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.info-banner p {
    margin: 0.5rem 0;
    line-height: 1.5;
}

.info-banner strong {
    color: #174ea6;
}

.empty {
    color: #666;
    padding: 2rem;
    text-align: center;
}

table {
    width: 100%;
    background: white;
    border-radius: 8px;
    overflow: visible;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-collapse: collapse;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}

th {
    background: #f8f9fa;
    font-weight: 600;
    overflow: visible;
}

thead {
    overflow: visible;
}

tr.enabled {
    background: #f0fff4;
}

tr.disabled {
    background: #fff8f0;
}

tr:hover {
    background: #f1f3f4;
}


/* Bulk Action Bar */
/* Bulk action bar */
.bulk-action-bar {
    display: none;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: #e8f0fe;
    border-radius: 8px 8px 0 0;
    border-bottom: 1px solid #d2e3fc;
}

.bulk-action-bar.visible {
    display: flex;
}

.bulk-action-bar .selected-count {
    font-weight: 600;
    color: #1a73e8;
}

.bulk-action-bar button.secondary {
    background: #666;
}


/* Checkbox column */
.checkbox-col {
    width: 40px;
    text-align: center;
}

.checkbox-col input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Selected row highlighting */
tr.selected {
    background: #e8f0fe !important;
}

tr.selected:hover {
    background: #d2e3fc !important;
}

/* Empty state for tables */
.table-empty-state {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

.table-empty-state .empty-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.table-empty-state p {
    margin: 0;
}

.table-empty-state .empty-hint {
    font-size: 0.875rem;
    color: #868e96;
    margin-top: 0.5rem;
}

/* Tabs */
.tabs {
    display: flex;
    background: white;
    border-bottom: 2px solid #e0e0e0;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 2rem;
}

.tab-btn {
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: #666;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 0;
}

.tab-btn:hover {
    background: #f5f5f5;
    color: #1a73e8;
}

.tab-btn.active {
    color: #1a73e8;
    border-bottom-color: #1a73e8;
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}


/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    position: relative;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    width: 400px;
    max-width: 90%;
    box-sizing: border-box; /* Include padding in width calculation */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.modal-content h2 {
    margin-bottom: 1.5rem;
}

.modal-content label {
    display: block;
    margin-bottom: 1rem;
}

.modal-content input[type="number"],
.modal-content input[type="text"] {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-top: 0.25rem;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.modal-buttons button {
    padding: 0.5rem 1rem;
    background: #1a73e8;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}

.modal-buttons button:hover {
    background: #1557b0;
}

.modal-buttons button:first-child {
    background: #666;
}

.modal-buttons button:first-child:hover {
    background: #555;
}

/* Wide modal for history - use higher specificity to override other .modal-content rules */
.modal-content.modal-wide {
    width: 95vw;
    max-width: 1400px;
    max-height: 90vh;
    overflow-y: auto;
}

/* Modal overlay for full-screen modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

/* Modal content input elements */
.modal-content input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.modal-content input:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

.modal-content p {
    margin-bottom: 1rem;
    color: #5f6368;
}

/* Modal hint box */
.modal-hint {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.modal-hint a {
    color: #1a73e8;
    text-decoration: none;
    font-weight: 500;
}

.modal-hint a:hover {
    text-decoration: underline;
}

/* Medium modal size */
.modal-medium {
    width: 550px;
    max-width: 90vw;
}

/* Wide modal specific overrides */
.modal-wide .date-range-picker {
    margin-bottom: 1rem;
}

.modal-wide .table-wrapper {
    max-height: 60vh;
    overflow-y: auto;
}

.modal-wide table {
    margin-top: 1rem;
    min-width: 1200px;
    width: 100%;
    font-size: 0.9rem;
}



/* ==========================================
   Native HTML <dialog> Element Styles
   ========================================== */

/* Base dialog styling */
dialog {
    /* Explicit centering */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    border: none;
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 10px 20px rgba(0, 0, 0, 0.15);
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto; /* Enable scrolling when content is too tall */
}

/* Dialog backdrop (native ::backdrop pseudo-element) */
dialog::backdrop {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    animation: fadeIn 0.2s ease-out;
}

/* Dialog size variants */
/* dialog-default: no width - sizes to .modal-content inside */

dialog.dialog-medium {
    width: 600px;
}

dialog.dialog-large {
    width: 800px;
}

dialog.dialog-wide {
    width: 95vw;
    max-width: 1400px;
}

/* Dialog close button (positioned in top-right) */
.dialog-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    line-height: 1;
    z-index: 1;
    transition: color 0.2s ease;
}

.dialog-close-btn:hover {
    color: #333;
}

.dialog-close-btn:focus {
    outline: 2px solid #1a73e8;
    outline-offset: 2px;
}

/* Dialog keyboard navigation hint */
.dialog-keyboard-hint {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0.75rem 2rem 0.75rem 1rem; /* Extra right padding for close button */
    margin-top: 1rem;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    font-size: 0.875rem;
    color: #5f6368;
}

.dialog-keyboard-hint.hidden {
    display: none;
}

.dialog-keyboard-hint kbd {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    background: white;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.875rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Close button for keyboard hint */
.dialog-keyboard-hint .hint-close-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #5f6368;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    font-size: 1.2rem;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.dialog-keyboard-hint .hint-close-btn:hover {
    opacity: 1;
}

dialog[open] {
    animation: dialogSlideIn 0.3s ease-out;
}

/* Focus visible styles for keyboard navigation */
dialog *:focus-visible {
    outline: 2px solid #1a73e8;
    outline-offset: 2px;
}

/* Override modal-content styles when inside dialog */
dialog .modal-content {
    box-shadow: none; /* Dialog already has shadow */
    position: relative; /* Required for absolutely-positioned close button */
    border-radius: 8px;
    max-width: none; /* Remove max-width constraint - dialog handles sizing */
    margin: 0; /* Remove any margins */
}

/* ========================================== */

/* Toggle switch */
.toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    border-radius: 26px;
    transition: 0.3s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
}

input:checked + .slider {
    background-color: #34a853;
}

input:checked + .slider:before {
    transform: translateX(24px);
}


/*
 * Badge Component Styles
 *
 * Note: Event type badge styles (.action-type.*, .event-type.*) are defined in
 * styles/features/history.css to avoid duplication.
 *
 * This file contains only general badge utilities not specific to history events.
 */

/* Base badge placeholder - keep file non-empty for CSS validation tests */
.badge-placeholder { display: inline; }


/* ============================================================================
   Tooltips
   ========================================================================= */

/* Tooltip container */
[data-tooltip] {
    position: relative;
    cursor: help;
}

/* Tooltip bubble */
[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    z-index: 1000;
    padding: 0.5rem 0.75rem;
    background: #333;
    color: white;
    border-radius: 4px;
    font-size: 0.875rem;
    line-height: 1.4;
    white-space: normal;
    max-width: 300px;
    word-wrap: break-word;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Tooltip arrow */
[data-tooltip]::after {
    content: '';
    position: absolute;
    z-index: 1000;
    border: 5px solid transparent;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

/* Show tooltip on hover */
[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
    opacity: 1;
}

/* Top position (default) */
[data-tooltip]:not([data-tooltip-position])::before,
[data-tooltip][data-tooltip-position="top"]::before {
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
}

[data-tooltip]:not([data-tooltip-position])::after,
[data-tooltip][data-tooltip-position="top"]::after {
    bottom: calc(100% + 5px);
    left: 50%;
    transform: translateX(-50%);
    border-top-color: #333;
}

/* Bottom position */
[data-tooltip][data-tooltip-position="bottom"]::before {
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
}

[data-tooltip][data-tooltip-position="bottom"]::after {
    top: calc(100% + 5px);
    left: 50%;
    transform: translateX(-50%);
    border-bottom-color: #333;
}

/* Left position */
[data-tooltip][data-tooltip-position="left"]::before {
    right: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
}

[data-tooltip][data-tooltip-position="left"]::after {
    right: calc(100% + 5px);
    top: 50%;
    transform: translateY(-50%);
    border-left-color: #333;
}

/* Right position */
[data-tooltip][data-tooltip-position="right"]::before {
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
}

[data-tooltip][data-tooltip-position="right"]::after {
    left: calc(100% + 5px);
    top: 50%;
    transform: translateY(-50%);
    border-right-color: #333;
}

/* ============================================================================
   LOADING STATES & SPINNERS (Phase 2)
   ============================================================================ */

/* Small Spinner (16px) - For inline/button contexts */
.spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(26, 115, 232, 0.2);
    border-top-color: #1a73e8;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
    vertical-align: middle;
}

/* Default Spinner (32px) - Standard loading states */
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(26, 115, 232, 0.2);
    border-top-color: #1a73e8;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Large Spinner (48px) - Full-page/modal loading */
.spinner-large {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(26, 115, 232, 0.2);
    border-top-color: #1a73e8;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Spinner Container - Centered with optional label */
.spinner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem;
}

.spinner-label {
    color: #5f6368;
    font-size: 0.9rem;
}

/* Loading & Error States */
#companies-loading,
#accounts-loading {
    text-align: center;
    padding: 2rem;
    color: #666;
}

#companies-error,
#accounts-error {
    padding: 1rem;
    background: #ffebee;
    color: #c62828;
    border-radius: 4px;
    margin: 1rem 0;
}



/* Enhanced empty state card (for RI/SP coverage, etc.) */
.empty-state-card {
    text-align: center;
    padding: 3rem 2rem;
    background: #f8f9fa;
    border: 2px dashed #e0e0e0;
    border-radius: 12px;
    margin: 2rem 0;
}

.empty-state-card .empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.empty-state-card h3 {
    color: #333;
    margin-bottom: 0.5rem;
}

.empty-state-card .empty-state-message {
    color: #666;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.empty-state-card .empty-state-hint {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.empty-state-card .empty-state-note {
    color: #aaa;
    font-size: 0.8rem;
    font-style: italic;
    margin-top: 1rem;
}


/* Empty States */
p.empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #999;
    font-style: italic;
}

/* Standard Empty State Component */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    max-width: 500px;
    margin: 0 auto;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.7;
}

.empty-title {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: #202124;
    font-weight: 500;
}

.empty-message {
    color: #5f6368;
    margin-bottom: 1.5rem;
    line-height: 1.6;
    font-size: 1rem;
}

.empty-action {
    margin-top: 1.5rem;
}

/* Empty State Variants */
.empty-state.search-empty .empty-icon {
    opacity: 0.5;
}

.empty-state.search-empty .empty-title {
    font-size: 1.25rem;
}

.empty-state.error-empty .empty-icon {
    color: #ea4335;
    opacity: 1;
}

.empty-state.error-empty .empty-title {
    color: #ea4335;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .empty-state {
        padding: 3rem 1.5rem;
    }

    .empty-icon {
        font-size: 3rem;
    }

    .empty-title {
        font-size: 1.25rem;
    }

    .empty-message {
        font-size: 0.9375rem;
    }
}

/* Error Display Components */
/* API Error Recovery Section */
.error-with-retry {
    text-align: center;
    padding: 2rem;
    color: #dc3545;
}

.error-with-retry .error-message {
    margin-bottom: 1rem;
    font-size: 1rem;
    line-height: 1.5;
}

.error-with-retry .troubleshooting {
    text-align: left;
    max-width: 600px;
    margin: 1.5rem auto;
    padding: 1rem;
    background: #f8f9fa;
    border-left: 4px solid #ffc107;
    border-radius: 4px;
    color: #495057;
}

.error-with-retry .troubleshooting strong {
    display: block;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: #212529;
}

.error-with-retry .troubleshooting strong:first-child {
    margin-top: 0;
}

.error-with-retry .troubleshooting ul {
    margin: 0.5rem 0 0 1.5rem;
    padding: 0;
}

.error-with-retry .troubleshooting li {
    margin: 0.25rem 0;
}

.error-with-retry .error-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.error-with-retry .retry-btn {
    background: #1a73e8;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.error-with-retry .retry-btn:hover {
    background: #1557b0;
}

.error-with-retry .retry-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.error-with-retry .retry-btn.secondary {
    background: #6c757d;
}

.error-with-retry .retry-btn.secondary:hover {
    background: #5a6268;
}

.error-with-retry .contact-link {
    color: #1a73e8;
    text-decoration: none;
    padding: 0.5rem 1rem;
}

.error-with-retry .contact-link:hover {
    text-decoration: underline;
}


/* Loading timeout warning */
.loading-timeout-warning {
    color: #856404;
    background: #fff3cd;
    padding: 12px 16px;
    border-radius: 4px;
    margin-top: 1rem;
    font-size: 0.875rem;
    text-align: center;
    animation: fadeIn 0.3s ease-in;
}

/* Error with action button */
.error-with-action {
    text-align: center;
}

.error-with-action p {
    margin-bottom: 1rem;
}

.request-new-link-btn {
    background: #1a73e8;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
}

.request-new-link-btn:hover {
    background: #1557b0;
}

/* Error hint text */
.error-hint {
    font-size: 0.875rem;
    color: #666;
    margin-top: 0.5rem;
}

/* Warning message for email verification */
.warning-message {
    background: #fff3cd;
    color: #856404;
    padding: 12px 16px;
    border-radius: 4px;
    border: 1px solid #ffeeba;
    margin-top: 1rem;
    line-height: 1.5;
}

/* ===================================================================
   Date Range Picker & Presets
   ================================================================ */

.date-range-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

/* When presets are inside a date-range-picker, adjust layout */
.date-range-picker .date-range-presets {
    margin-right: 1rem;
    flex-shrink: 0;
}

/* ===================================================================
   Modal/Dialog Date Range Picker Layout
   Two-row layout: presets on top row, date controls on bottom row
   ================================================================ */

/* History modal date picker - use ID for high specificity */
#history-modal-controls.date-range-picker,
#bulk-history-modal-controls.date-range-picker {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    row-gap: 0.75rem;
    column-gap: 1rem;
    align-items: center;
}

/* Presets take full width, forcing date inputs to new line */
#history-modal-controls .date-range-presets,
#bulk-history-modal-controls .date-range-presets {
    flex: 1 0 100%;
    order: -1;  /* Ensure presets are first */
    margin-right: 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
    justify-content: flex-start;
}

/* Date labels stay inline on second row */
#history-modal-controls > label,
#bulk-history-modal-controls > label {
    flex: 0 0 auto;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
}

/* Refresh/Load button stays inline with dates */
#history-modal-controls > button:not(.preset-btn),
#bulk-history-modal-controls > button:not(.preset-btn) {
    flex: 0 0 auto;
}

/* Generic modal date-range-picker fallback */
.modal-content .date-range-picker,
dialog .date-range-picker {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    row-gap: 0.75rem;
    column-gap: 1rem;
    align-items: center;
}

/* Generic presets layout in modals */
.modal-content .date-range-picker .date-range-presets,
dialog .date-range-picker .date-range-presets {
    flex: 1 0 100%;
    order: -1;
    margin-right: 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
    justify-content: flex-start;
}

/* Generic date labels in modals */
.modal-content .date-range-picker > label,
dialog .date-range-picker > label {
    flex: 0 0 auto;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
}

/* Generic button in modals */
.modal-content .date-range-picker > button:not(.preset-btn),
dialog .date-range-picker > button:not(.preset-btn) {
    flex: 0 0 auto;
}

/* ===================================================================
   Preset Button Styles
   ================================================================ */

.preset-btn {
    padding: 0.375rem 0.75rem;
    border: 1px solid #dfe1e5;
    background: white;
    border-radius: 16px;
    font-size: 0.875rem;
    color: #202124;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.preset-btn:hover:not(.active) {
    background: #f5f5f5;
    border-color: #c5c7ca;
}

.preset-btn.active {
    background: #1a73e8;
    color: white;
    border-color: #1a73e8;
}

.preset-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

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

@media (max-width: 576px) {
    .date-range-presets {
        flex-direction: column;
    }

    .preset-btn {
        width: 100%;
        text-align: center;
    }

    /* On mobile, stack date controls vertically too */
    .modal-content .date-range-picker > label,
    dialog .date-range-picker > label {
        flex: 1 0 100%;
    }
}

/* ===================================================================
   Notification Banners
   ================================================================ */

/* Offline connection banner */
.offline-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #ff9800;
    color: white;
    padding: 0.75rem 1rem;
    text-align: center;
    z-index: 9999;
    animation: slideDown 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.offline-banner strong {
    font-weight: 600;
}

/**
 * Progress Tracker Styles
 * Visual styles for multi-step progress indicators
 * All classes namespaced with .progress-tracker- to avoid conflicts
 * Note: Main container uses .multi-step-progress to avoid conflict with date-range.css
 */

.multi-step-progress {
    width: 100%;
    padding: 1.5rem;
}

/* Progress Bar */
.progress-tracker-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.progress-tracker-fill {
    height: 100%;
    background: linear-gradient(90deg, #1a73e8 0%, #4285f4 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Progress Label */
.progress-tracker-label {
    text-align: center;
    font-size: 0.875rem;
    color: #5f6368;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

/* Progress Steps Container */
.progress-tracker-steps {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Individual Step */
.progress-tracker-step {
    flex: 1;
    min-width: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

/* Step States */
.progress-tracker-step-pending {
    opacity: 0.6;
}

.progress-tracker-step-active {
    background: #e8f0fe;
}

.progress-tracker-step-complete {
    background: #e6f4ea;
}

.progress-tracker-step-error {
    background: #fce8e6;
}

/* Step Indicator */
.progress-tracker-indicator {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: white;
    border: 2px solid #e0e0e0;
    transition: all 0.2s ease;
}

.progress-tracker-step-active .progress-tracker-indicator {
    border-color: #1a73e8;
    background: #e8f0fe;
}

.progress-tracker-step-complete .progress-tracker-indicator {
    border-color: #1e8e3e;
    background: #e6f4ea;
}

.progress-tracker-step-error .progress-tracker-indicator {
    border-color: #ea4335;
    background: #fce8e6;
}

/* Step Icons */
.progress-tracker-icon-complete {
    color: #1e8e3e;
    font-size: 1.25rem;
    font-weight: bold;
}

.progress-tracker-icon-error {
    color: #ea4335;
    font-size: 1.25rem;
    font-weight: bold;
}

.progress-tracker-icon-pending {
    color: #9aa0a6;
    font-size: 1.25rem;
}

/* Step Label */
.progress-tracker-step-label {
    text-align: center;
    font-size: 0.875rem;
    color: #202124;
    font-weight: 500;
}

.progress-tracker-step-pending .progress-tracker-step-label {
    color: #5f6368;
}

.progress-tracker-step-error .progress-tracker-step-label {
    color: #ea4335;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .progress-tracker-steps {
        flex-direction: column;
    }

    .progress-tracker-step {
        flex-direction: row;
        justify-content: flex-start;
        min-width: unset;
    }

    .progress-tracker-indicator {
        width: 32px;
        height: 32px;
    }

    .progress-tracker-step-label {
        text-align: left;
        flex: 1;
    }
}

/* Animation for active spinner */
.progress-tracker-step-active .spinner-small {
    animation: spin 0.8s linear infinite;
}

/* Compact variant */
.multi-step-progress.compact {
    padding: 1rem;
}

.multi-step-progress.compact .progress-tracker-bar {
    height: 4px;
}

.multi-step-progress.compact .progress-tracker-indicator {
    width: 32px;
    height: 32px;
}

.multi-step-progress.compact .progress-tracker-step-label {
    font-size: 0.75rem;
}

/* Accessible focus states */
.progress-tracker-step:focus-within {
    outline: 2px solid #1a73e8;
    outline-offset: 2px;
}

/**
 * Search and Filter Component Styles
 * Styles for search inputs and filter chips
 */

/* Search Filter Bar */
.search-filter-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

/* Search Box */
.search-box {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.search-input {
    width: 100%;
    padding: 0.625rem 2.5rem 0.625rem 1rem;
    border: 1px solid #dfe1e5;
    border-radius: 24px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.search-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.5;
    pointer-events: none;
}

/* Quick Filters */
.quick-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-chip {
    padding: 0.375rem 0.75rem;
    border: 1px solid #dfe1e5;
    border-radius: 16px;
    background: white;
    color: #202124;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.filter-chip:hover {
    background: #f5f5f5;
    border-color: #c5c7ca;
}

.filter-chip.active {
    background: #1a73e8;
    color: white;
    border-color: #1a73e8;
}

.filter-chip:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Filter Results Info */
.filter-results {
    font-size: 0.875rem;
    color: #5f6368;
    white-space: nowrap;
}

.filter-results strong {
    color: #202124;
    font-weight: 600;
}

/* Clear Filters Button */
.clear-filters {
    padding: 0.375rem 0.75rem;
    background: none;
    border: 1px solid #ea4335;
    color: #ea4335;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.clear-filters:hover {
    background: #fce8e6;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .search-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        min-width: unset;
    }

    .quick-filters {
        justify-content: flex-start;
    }

    .filter-results {
        text-align: center;
    }
}

/**
 * Pagination Component Styles
 * Styles for page controls and page size selection
 */

/* Pagination Container */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border-top: 1px solid #dfe1e5;
    background: #f8f9fa;
    flex-wrap: wrap;
}

/* Page Size Selector */
.page-size-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #5f6368;
}

.page-size-selector label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.page-size-select {
    padding: 0.375rem 2rem 0.375rem 0.5rem;
    border: 1px solid #dfe1e5;
    border-radius: 4px;
    background: white;
    font-size: 0.875rem;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.page-size-select:hover {
    border-color: #1a73e8;
}

.page-size-select:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

/* Page Info */
.page-info {
    font-size: 0.875rem;
    color: #5f6368;
    white-space: nowrap;
}

/* Page Controls */
.page-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-number {
    font-size: 0.875rem;
    color: #202124;
    padding: 0 0.5rem;
    white-space: nowrap;
}

/* Page Buttons */
.page-btn {
    padding: 0.5rem 0.75rem;
    border: 1px solid #dfe1e5;
    border-radius: 4px;
    background: white;
    color: #1a73e8;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-btn:hover:not(:disabled) {
    background: #f5f5f5;
    border-color: #1a73e8;
}

.page-btn:active:not(:disabled) {
    background: #e8f0fe;
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    color: #5f6368;
}

.page-btn:focus:not(:disabled) {
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .pagination {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .page-size-selector,
    .page-info,
    .page-controls {
        justify-content: center;
    }

    .page-controls {
        flex-wrap: wrap;
    }
}

/* Compact Pagination (for smaller spaces) */
.pagination.compact {
    padding: 0.5rem;
    gap: 0.5rem;
}

.pagination.compact .page-btn {
    min-width: 32px;
    height: 32px;
    padding: 0.375rem 0.5rem;
}

.pagination.compact .page-size-select {
    padding: 0.25rem 1.5rem 0.25rem 0.375rem;
}

/**
 * Column Visibility Toggle Styles
 * Styles for column selection dropdown menu
 */

/* Column Toggle Container */
.column-toggle-container {
    margin-bottom: 1rem;
}

.column-toggle {
    position: relative;
    display: inline-block;
}

/* Toggle Button */
.column-toggle-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #dfe1e5;
    border-radius: 4px;
    background: white;
    color: #202124;
    cursor: pointer;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    transition: all 0.2s ease;
}

.column-toggle-btn:hover {
    background: #f5f5f5;
    border-color: #1a73e8;
}

.column-toggle-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.column-toggle-btn::after {
    content: '▼';
    font-size: 0.75rem;
    opacity: 0.6;
    margin-left: 0.25rem;
}

/* Column Menu Dropdown */
.column-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 200px;
    background: white;
    border: 1px solid #dfe1e5;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 0.5rem;
    z-index: 1000;
    animation: columnMenuSlideDown 0.2s ease;
}

.column-menu.hidden {
    display: none;
}

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

/* Column Options */
.column-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.875rem;
    color: #202124;
    transition: background 0.2s ease;
    margin: 0;
}

.column-option:hover {
    background: #f5f5f5;
}

.column-option input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
    margin: 0;
}

.column-option input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* Disabled Option */
.column-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.column-option.disabled:hover {
    background: transparent;
}

/* Column Menu Divider */
.column-menu hr {
    margin: 0.5rem 0;
    border: none;
    border-top: 1px solid #dfe1e5;
}

/* Table Column Hiding */
th[data-column].column-hidden,
td.column-hidden {
    display: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .column-menu {
        left: 0;
        right: 0;
        min-width: auto;
    }

    /* Auto-hide mobile columns */
    th[data-mobile-hide="true"],
    td.mobile-hide {
        display: none;
    }
}

/**
 * Table Sorting Styles
 * Styles for sortable table columns with visual indicators
 */

/* Sortable Column Headers */
th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 2rem;
    transition: background 0.2s ease;
}

th.sortable:hover {
    background: #f5f5f5;
}

th.sortable:active {
    background: #e8f0fe;
}

/* Sort Indicator */
.sort-indicator {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.3;
    font-size: 0.875rem;
    transition: opacity 0.2s ease;
}

th.sortable:hover .sort-indicator {
    opacity: 0.6;
}

/* Default state - both arrows */
.sort-indicator::after {
    content: '↕';
    color: #5f6368;
}

/* Ascending sort indicator */
th.sort-asc .sort-indicator {
    opacity: 1;
}

th.sort-asc .sort-indicator::after {
    content: '↑';
    color: #1a73e8;
}

/* Descending sort indicator */
th.sort-desc .sort-indicator {
    opacity: 1;
}

th.sort-desc .sort-indicator::after {
    content: '↓';
    color: #1a73e8;
}

/* Keyboard Focus */
th.sortable:focus {
    outline: 2px solid #1a73e8;
    outline-offset: -2px;
}

/* Alternative Unicode arrows (can uncomment if preferred) */
/*
.sort-indicator::after {
    content: '⇅';
}

th.sort-asc .sort-indicator::after {
    content: '⬆';
}

th.sort-desc .sort-indicator::after {
    content: '⬇';
}
*/

/* Sort Badge (optional alternative to arrow) */
.sort-badge {
    display: inline-block;
    background: #1a73e8;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

/* Multi-column sort indicator (if implementing multi-sort) */
th.sort-asc.sort-multi .sort-indicator::before,
th.sort-desc.sort-multi .sort-indicator::before {
    content: attr(data-sort-order);
    position: absolute;
    top: -0.5rem;
    right: -0.25rem;
    background: #1a73e8;
    color: white;
    border-radius: 50%;
    width: 14px;
    height: 14px;
    font-size: 0.625rem;
    line-height: 14px;
    text-align: center;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    th.sortable {
        padding-right: 1.5rem;
    }

    .sort-indicator {
        right: 0.25rem;
        font-size: 0.75rem;
    }
}

/* Accessibility - High Contrast Mode */
@media (prefers-contrast: high) {
    th.sortable:hover {
        background: #e0e0e0;
    }

    .sort-indicator::after {
        font-weight: bold;
    }
}

/**
 * Bulk Operations Styles
 * Phase 5: Multi-select, bulk toolbar, progress tracker
 */

/* ===== Multi-Select Checkboxes ===== */

.select-col {
    width: 40px;
    text-align: center;
    padding: 0.75rem 0.5rem;
}

.select-row {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

#select-all {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

/* Selected row styling - defined in table-addons.css */

/* ===== Bulk Toolbar ===== */

.bulk-toolbar {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border: 1px solid #dfe1e5;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15), 0 2px 4px rgba(0,0,0,0.1);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    z-index: 100;
    animation: bulkToolbarSlideUp 0.3s ease;
    max-width: 90%;
}

@keyframes bulkToolbarSlideUp {
    from {
        transform: translateX(-50%) translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

.bulk-info {
    font-size: 0.875rem;
    color: #5f6368;
    white-space: nowrap;
}

.bulk-info strong {
    color: #202124;
    font-weight: 600;
}

.bulk-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.bulk-actions button {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    white-space: nowrap;
}

.clear-selection {
    color: #5f6368;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    padding: 0.5rem;
    text-decoration: underline;
}

.clear-selection:hover {
    color: #202124;
}

/* ===== Progress Tracker ===== */

/* .progress-bar and .progress-fill defined in date-range.css */

.progress-label {
    font-size: 0.875rem;
    color: #5f6368;
    margin-bottom: 1rem;
    text-align: center;
}

.progress-items {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #dfe1e5;
    border-radius: 4px;
    padding: 0.5rem;
    margin: 1rem 0;
    background: #f8f9fa;
}

.progress-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    margin-bottom: 0.25rem;
    background: white;
    border-radius: 4px;
    border-left: 3px solid transparent;
}

.progress-item.pending {
    border-left-color: #fbbf24;
}

.progress-item.success {
    border-left-color: #34a853;
    background: #f0fdf4;
}

.progress-item.error {
    border-left-color: #ea4335;
    background: #fef2f2;
}

.progress-item-icon {
    font-size: 1.125rem;
    min-width: 24px;
    text-align: center;
}

.progress-item.pending .progress-item-icon {
    color: #fbbf24;
}

.progress-item.success .progress-item-icon {
    color: #34a853;
    font-weight: bold;
}

.progress-item.error .progress-item-icon {
    color: #ea4335;
    font-weight: bold;
}

.progress-item-label {
    flex: 1;
    font-size: 0.875rem;
}

.progress-item-error {
    font-size: 0.75rem;
    color: #ea4335;
    margin-left: auto;
}

/* ===== Bulk Progress Summary ===== */

.bulk-progress-summary {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 4px;
    background: #f8f9fa;
}

.completion-summary {
    text-align: center;
}

.summary-status {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.summary-status.success {
    color: #34a853;
}

.summary-status.partial {
    color: #fbbf24;
}

.summary-status.cancelled {
    color: #5f6368;
}

.error-details {
    margin-top: 1rem;
    text-align: left;
}

.error-details ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.error-details li {
    font-size: 0.875rem;
    margin: 0.25rem 0;
}

/* ===== Item List (for bulk confirmations) ===== */

.item-list {
    margin: 1rem 0;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #dfe1e5;
}

.item-list ul {
    margin: 0;
    padding-left: 1.5rem;
}

.item-list li {
    margin: 0.25rem 0;
    font-size: 0.875rem;
    color: #202124;
}

.item-list-more {
    color: #5f6368;
    font-style: italic;
}

/* .warning-box defined in permissions.css */

/* ===== Export Menu ===== */

.export-menu {
    position: relative;
    display: inline-block;
}

.export-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: white;
    border: 1px solid #dfe1e5;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    min-width: 200px;
    z-index: 1000;
}

.export-dropdown button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.75rem 1rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.875rem;
    color: #202124;
}

.export-dropdown button:hover {
    background: #f1f3f4;
}

.export-dropdown hr {
    margin: 0.5rem 0;
    border: none;
    border-top: 1px solid #dfe1e5;
}

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

@media (max-width: 768px) {
    .bulk-toolbar {
        bottom: 1rem;
        left: 1rem;
        right: 1rem;
        transform: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .bulk-actions {
        flex-direction: column;
    }

    .bulk-actions button {
        width: 100%;
    }
}

/* Loading state */
.loading {
    color: #666;
    padding: 2rem;
    text-align: center;
}

.loading.hidden {
    display: none;
}

/* Summary row in modal */
.summary-row {
    display: flex;
    gap: 2rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.summary-label {
    color: #666;
    font-size: 0.9rem;
}

.summary-value {
    font-weight: 600;
    font-size: 1rem;
}

/* Instance types column */
.instance-types {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: monospace;
    font-size: 0.85rem;
}

/* Info icon with tooltip */
.info-icon {
    display: inline-block;
    cursor: help;
    color: #666;
    font-size: 0.85rem;
    margin-left: 0.25rem;
    vertical-align: middle;
    position: relative;
}

.info-icon:hover {
    color: #1a73e8;
}

.info-icon .tooltip-text {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: #fff;
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: normal;
    width: 280px;
    line-height: 1.4;
    text-align: left;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: opacity 0.2s, visibility 0.2s;
    white-space: normal;
    word-wrap: break-word;
    display: block;
    overflow: visible;
    height: auto;
}

.info-icon .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

.info-icon:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

.selected-info {
    font-weight: 600;
    color: #1a73e8;
    margin-bottom: 1rem;
}


/* Settings tab styles */
#settings-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#settings-section h2 {
    margin-bottom: 0.5rem;
    color: #333;
}

.settings-form {
    display: block;
}

.settings-form.hidden {
    display: none;
}

.settings-category {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.settings-category legend {
    font-weight: 600;
    font-size: 1.1rem;
    color: #1a73e8;
    padding: 0 0.5rem;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1rem 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.setting-info {
    flex: 1;
    padding-right: 2rem;
}

.setting-info label {
    font-weight: 500;
    color: #333;
    display: block;
    margin-bottom: 0.25rem;
}

.setting-input {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    min-width: 200px;
}

.setting-description {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.4;
}

/* Hierarchy badges for settings */
.hierarchy-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    flex-shrink: 0;
}

.hierarchy-badge.hierarchy-global {
    background: #e3f2fd;
    color: #1976d2;
    border: 1px solid #90caf9;
}

.hierarchy-badge.hierarchy-override {
    background: #fff3e0;
    color: #f57c00;
    border: 1px solid #ffb74d;
}

.hierarchy-badge.hierarchy-inherited {
    background: #f5f5f5;
    color: #757575;
    border: 1px solid #e0e0e0;
}

/* Highlight customized settings */
.setting-row.setting-customized {
    background: #fffbf0;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    margin-left: -0.5rem;
    margin-right: -0.5rem;
    border-radius: 4px;
}

.setting-input input[type="text"],
.setting-input input[type="number"],
.setting-input select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.setting-input input[type="number"] {
    width: 120px;
}

.setting-input select {
    min-width: 200px;
}

/* Toggle label for settings */
.toggle-label {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.toggle-label input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-label .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    border-radius: 26px;
    transition: 0.3s;
}

.toggle-label .slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-label input:checked + .slider {
    background-color: #34a853;
}

.toggle-label input:checked + .slider:before {
    transform: translateX(24px);
}

/* Settings search and filter bar */
.settings-search-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    flex-wrap: wrap;
}

.settings-search-bar .search-box {
    flex: 1;
    min-width: 250px;
}

.settings-filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.settings-filter label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin: 0;
}

.settings-filter select {
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.875rem;
    background: white;
    cursor: pointer;
}

.settings-filter select:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

/* Settings form action buttons */
.settings-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

.settings-buttons button[type="button"] {
    background: #666;
}

.settings-buttons button[type="button"]:hover {
    background: #555;
}


/* Users and Groups sections */
#users-section,
#groups-section {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

/* User and Group cards */
.user-card,
.group-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

.user-card:hover,
.group-card:hover {
    border-color: #ddd;
    background: #fafafa;
}

.user-info,
.group-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #1a73e8;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
}

.user-details,
.group-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.user-name,
.group-name {
    font-weight: 600;
    color: #333;
}

.user-email,
.group-description {
    font-size: 0.85rem;
    color: #666;
}

.user-meta,
.group-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 280px;
    flex-shrink: 0;
}

.role-badge,
.permission-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.role-badge.admin {
    background: #fce8e6;
    color: #c5221f;
}

.role-badge.operator {
    background: #e8f0fe;
    color: #1a73e8;
}

.role-badge.viewer {
    background: #e6f4ea;
    color: #137333;
}

.scope-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.scope-badge.scope-global {
    background: #fce8e6;
    color: #c5221f;
}

.scope-badge.scope-company {
    background: #e8f0fe;
    color: #1a73e8;
}

.scope-badge.scope-account {
    background: #e6f4ea;
    color: #137333;
}

.user-actions,
.group-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
    justify-content: flex-end;
    min-width: 200px;
}

/* Members list in group modal */
.members-list {
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.member-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #eee;
}

.member-item:last-child {
    border-bottom: none;
}

.member-item .member-name {
    font-size: 0.9rem;
}

.member-item .remove-btn {
    background: none;
    border: none;
    color: #ea4335;
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1rem;
}

/* Add member row */
.add-member-row {
    display: flex;
    gap: 0.5rem;
}

.add-member-row select {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}



/* Groups selection container (for checkbox lists) */
.groups-selection {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px;
    background: #fff;
}

.groups-selection .checkbox-label {
    margin-bottom: 8px;
    padding: 4px;
}

.groups-selection .checkbox-label:hover {
    background: #f5f5f5;
}

.groups-selection .empty {
    text-align: center;
    color: #999;
    padding: 20px;
    font-style: italic;
}


/* Admin Assumption Banner */
.assumption-banner {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    padding: 12px 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 999;
    border-bottom: 2px solid #d63031;
}

.assumption-banner-content {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: center;
}

.assumption-icon {
    font-size: 1.5rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

.assumption-text {
    font-size: 0.95rem;
    flex: 1;
    text-align: center;
}

.assumption-text strong {
    font-weight: 600;
    margin-right: 8px;
}

.exit-assumption-btn {
    background: white;
    color: #d63031;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.exit-assumption-btn:hover {
    background: #f8f8f8;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.exit-assumption-btn:active {
    transform: translateY(0);
}

/* SES Status Section */
#ses-status-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ses-status-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.ses-status-cards .status-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid #e0e0e0;
}

.ses-status-cards .status-card h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: #333;
    border-bottom: 2px solid #1a73e8;
    padding-bottom: 0.5rem;
}

.ses-status-info,
.quota-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.status-item,
.quota-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e8e8e8;
}

.status-item:last-child,
.quota-item:last-child {
    border-bottom: none;
}

.status-item .label,
.quota-item .label {
    font-weight: 500;
    color: #666;
    font-size: 0.9rem;
}

.status-item .value,
.quota-item .value {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.status-item .value.success {
    color: #0f9d58;
}

.status-item .value.error {
    color: #d93025;
}

.status-item .value.warning {
    color: #f9ab00;
}

.quota-item .value.success {
    color: #0f9d58;
}

.quota-item .value.warning {
    color: #f9ab00;
}

.quota-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.quota-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.quota-fill.success {
    background: linear-gradient(90deg, #0f9d58, #34a853);
}

.quota-fill.warning {
    background: linear-gradient(90deg, #f9ab00, #fbbc04);
}

@media (max-width: 768px) {
    .ses-status-cards {
        grid-template-columns: 1fr;
    }
}

/* SES Guidance Panel - shown when SES is not configured */
.ses-guidance-panel {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #fff8e1;
    border: 1px solid #ffcc02;
    border-left: 4px solid #f9ab00;
    border-radius: 6px;
    padding: 16px;
    margin-top: 16px;
}

.ses-guidance-panel .guidance-icon {
    font-size: 24px;
    color: #f9ab00;
    flex-shrink: 0;
}

.ses-guidance-panel .guidance-content {
    flex: 1;
}

.ses-guidance-panel .guidance-content strong {
    display: block;
    color: #b8860b;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.ses-guidance-panel .guidance-content p {
    margin: 0 0 8px 0;
    color: #6d5d00;
    font-size: 0.9rem;
    line-height: 1.5;
}

.ses-guidance-panel .guidance-content ul {
    margin: 8px 0;
    padding-left: 20px;
    color: #6d5d00;
    font-size: 0.875rem;
}

.ses-guidance-panel .guidance-content ul li {
    margin: 4px 0;
}

.ses-guidance-panel .guidance-content .guidance-help {
    background: #fff;
    border: 1px solid #ffe082;
    border-radius: 4px;
    padding: 12px;
    margin-top: 12px;
}

.ses-guidance-panel .guidance-content .guidance-help code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85em;
    color: #d97706;
    border: 1px solid #e0e0e0;
}

/* Company and Account Settings Styles */

/* ===================================
   Multi-Company SaaS Platform Styles
   =================================== */

/* Header - Company Selector */

#company-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#company-selector label {
    font-size: 0.9rem;
    font-weight: 500;
}

#company-selector select {
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.15);
    color: white;
    min-width: 180px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}

#company-selector select:hover {
    background: rgba(255, 255, 255, 0.25);
}

#company-selector select option {
    color: #333;
    background: white;
}

/* Admin-only elements */

/* Status Badges */

.badge.status-pending {
    background: #fff8e1;
    color: #f57c00;
}

.badge.status-approved {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge.status-rejected {
    background: #ffebee;
    color: #c62828;
}

.badge.danger {
    background: #ffebee;
    color: #c62828;
}

/* Company Cards */
.company-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
    transition: box-shadow 0.2s;
}

.company-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.company-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.company-header h3 {
    font-size: 1.25rem;
    color: #333;
    margin-bottom: 0.25rem;
}

.company-id {
    font-size: 0.85rem;
    color: #666;
    font-family: 'Courier New', monospace;
    background: #f5f5f5;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    margin-left: 0.5rem;
}

.company-details p {
    color: #666;
    margin-bottom: 1rem;
}

.company-stats {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.company-stats span {
    font-size: 0.9rem;
    color: #666;
}

.company-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Account Cards */
.account-card {
    background: white;
    padding: 1.25rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: box-shadow 0.2s;
}

.account-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.account-card.pending {
    border-left: 4px solid #f57c00;
}

.account-info h4 {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 0.5rem;
}

.account-info span {
    display: block;
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.25rem;
}

/* Inline editable fields */
.editable-field {
    border: 1px solid transparent;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s;
    cursor: text;
}

.editable-field:hover {
    background: #f8f9fa;
    border-color: #e0e0e0;
}

.editable-field:focus {
    outline: none;
    background: white;
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.1);
}

.editable-field[contenteditable="true"]:empty:before {
    content: attr(placeholder);
    color: #999;
    font-style: italic;
}

.account-description {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.5rem;
    min-height: 1.5em;
}

.account-stats {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #eee;
}

.account-stats span {
    font-size: 0.9rem;
    color: #666;
    margin-right: 1rem;
}

.account-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Lists */
#companies-list,
#accounts-list,
#unassigned-list,
#pending-list {
    margin-top: 1rem;
}

#pending-approvals,
#unassigned-accounts {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #fff8e1;
    border-radius: 8px;
    border-left: 4px solid #f57c00;
}

#pending-approvals h3,
#unassigned-accounts h3 {
    color: #f57c00;
    margin-bottom: 1rem;
}

/* Signup Modal - Company Mode Selection */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1rem 0;
}

.radio-group label {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.radio-group label:hover {
    border-color: #1a73e8;
    background: #f8f9fa;
}

.radio-group input[type="radio"] {
    margin-right: 0.75rem;
    cursor: pointer;
}

.radio-group input[type="radio"]:checked + label,
.radio-group label:has(input:checked) {
    border-color: #1a73e8;
    background: #e8f0fe;
}


/* Account event reason column - ensure full text display */

/* Cost Impact Styling */




/* ASG Event Details */

/* Company and Account Settings Styles */
.company-context-display,
.account-context-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    background-color: var(--bg-secondary, #f5f5f5);
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.company-context-display .label,
.account-context-display .label {
    color: var(--text-secondary, #666);
    font-weight: normal;
}

.company-context-display strong,
.account-context-display strong {
    color: var(--text-primary, #333);
    font-weight: 600;
}

.inherit-indicator {
    display: inline-block;
    color: var(--text-secondary, #666);
    font-style: italic;
    font-size: 0.9em;
    margin-top: 0.25rem;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary-color, #007bff);
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    font-size: 0.9em;
}

.btn-link:hover {
    color: var(--primary-hover, #0056b3);
}



/* Account Settings Modal */
#account-settings-modal .modal-content {
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .company-context-display,
    .account-context-display {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    #account-settings-modal .modal-content {
        max-width: 95%;
        max-height: 95vh;
    }
}


/* ===================================================================
   Permission-Based UI Controls
   ================================================================ */

/* Permission-disabled fields - visual indicator for read-only access */
input.permission-disabled,
select.permission-disabled,
textarea.permission-disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
    border-color: #ddd;
    opacity: 0.7;
}

/* Hover state for disabled fields to show they're not editable */
input.permission-disabled:hover,
select.permission-disabled:hover,
textarea.permission-disabled:hover {
    background-color: #f5f5f5;
    border-color: #ddd;
}

/* Permission warning banner in modals */
.permission-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    padding: 12px 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
    line-height: 1.5;
}

.permission-warning .warning-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.permission-warning code {
    background: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
    color: #d97706;
    border: 1px solid #fbbf24;
}

/* Enhanced permission warning content */
.permission-warning-content {
    flex: 1;
}

.permission-warning-content strong {
    display: block;
    color: #92400e;
    margin-bottom: 4px;
}

.permission-warning-content p {
    margin: 0 0 6px 0;
    color: #78350f;
}

.permission-warning-content p:last-child {
    margin-bottom: 0;
}

.permission-warning-content .permission-description {
    font-size: 0.85em;
    color: #a16207;
    font-style: italic;
}

.permission-warning-content .permission-help {
    font-size: 0.85em;
    color: #92400e;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #fcd34d;
}

/* Checkbox labels with permission-disabled state */
.checkbox-label input.permission-disabled {
    opacity: 0.5;
}

.checkbox-label input.permission-disabled + span {
    color: #999;
}

/* Form fieldsets with all disabled fields */
fieldset:has(input.permission-disabled:only-of-type) legend,
fieldset:has(select.permission-disabled:only-of-type) legend {
    color: #999;
}

/* Override help text styling for disabled permissions */
.permission-disabled + .help-text {
    color: #999;
}

/* Modal large size for complex forms with many fields */
.modal-large {
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    width: 90%;
}

/* Fieldset styling for grouped form sections */
fieldset {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 16px;
    margin-bottom: 16px;
    background: #fafafa;
}

fieldset legend {
    font-weight: 600;
    padding: 0 8px;
    color: #333;
    font-size: 0.95em;
}

/* Form grid for 2-column layouts */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.form-col {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-col fieldset {
    margin-bottom: 0;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 1.25rem;
}

.form-col fieldset legend {
    font-weight: 600;
    font-size: 0.95rem;
    color: #374151;
    padding: 0 0.5rem;
    margin-bottom: 0.5rem;
}

.form-col fieldset label {
    margin-bottom: 1rem;
}

.form-col fieldset label:last-of-type {
    margin-bottom: 0;
}

/* Form row for side-by-side fields within a column */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-row:last-child {
    margin-bottom: 0;
}

.form-row label {
    margin-bottom: 0;
}

/* Transfer ownership section styling */
.transfer-ownership-fieldset {
    background: #fef3c7;
    border: 2px solid #f59e0b;
    border-radius: 6px;
    padding: 1.25rem;
    margin-top: 1.5rem;
}

.transfer-ownership-fieldset legend {
    color: #d97706;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0 0.5rem;
}

.transfer-ownership-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.warning-box {
    color: #d97706;
    background: #fffbeb;
    padding: 0.75rem;
    border-radius: 4px;
    border-left: 4px solid #f59e0b;
    margin: 0;
    font-size: 0.9rem;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.5;
    max-width: 100%;
    overflow: visible;
}

.transfer-ownership-controls {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.transfer-ownership-controls label {
    flex: 1;
    margin-bottom: 0;
}

.transfer-ownership-controls button {
    flex-shrink: 0;
    margin-bottom: 0;
}

/* Responsive form rows and grid */
@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .transfer-ownership-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .transfer-ownership-controls button {
        width: 100%;
    }

    .modal-large {
        max-width: 100%;
    }
}

/* Permissions fieldset for grouped permissions */
.permissions-fieldset {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1rem;
    margin: 1rem 0;
}

.permissions-fieldset legend {
    font-weight: 600;
    padding: 0 0.5rem;
}

/* Permission item checkbox */
.permission-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.permission-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

.permission-item label {
    font-size: 0.9rem;
    color: #333;
    cursor: pointer;
}



/* History controls */
#history-controls {
    margin-bottom: 1.5rem;
}

.date-range-picker {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.date-range-picker label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
    font-size: 0.9rem;
}

.date-range-picker input[type="date"],
.date-range-picker select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.date-range-picker > button,
.date-range-picker > label + button {
    padding: 0.5rem 1rem;
    background: #1a73e8;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}

.date-range-picker > button:hover,
.date-range-picker > label + button:hover {
    background: #1557b0;
}

/* Preset buttons have their own styling - don't override */
.date-range-picker .preset-btn {
    background: white;
    color: #202124;
    border: 1px solid #dfe1e5;
}

.date-range-picker .preset-btn.active {
    background: #1a73e8;
    color: white;
    border-color: #1a73e8;
}

/* History summary */
#history-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

/* Actions table */
#actions-list table {
    width: 100%;
}

.action-type, .event-type {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.action-type.replacement, .event-type.replacement {
    background: #e6f4ea;
    color: #137333;
}

.action-type.interruption, .event-type.interruption {
    background: #fce8e6;
    color: #c5221f;
}

.action-type.rebalance, .event-type.rebalance {
    background: #fff3e0;
    color: #e65100;
}

.action-type.launch-attempt, .event-type.launch-attempt {
    background: #e3f2fd;
    color: #1565c0;
}

.action-type.launch-success, .event-type.launch-success {
    background: #e6f4ea;
    color: #137333;
}

.action-type.launch-failure, .event-type.launch-failure {
    background: #fce8e6;
    color: #c5221f;
}

/* ASG Event Type Badges */
.action-type.asg-enabled, .event-type.asg-enabled {
    background: #e6f4ea;
    color: #137333;
}

.action-type.asg-disabled, .event-type.asg-disabled {
    background: #fce8e6;
    color: #c5221f;
}

.action-type.config-change, .event-type.config-change {
    background: #e8f0fe;
    color: #1565c0;
}

.action-type.bulk-operation, .event-type.bulk-operation {
    background: #f3e5f5;
    color: #6a1b9a;
}

.action-type.asg-run, .event-type.asg-run {
    background: #fff8e1;
    color: #f57f17;
}

.action-type.risp-rollback, .event-type.risp-rollback {
    background: #fff3e0;
    color: #e65100;
}

/* Account Event Type Badges */
.action-type.account-registered, .event-type.account-registered {
    background: #e6f4ea;
    color: #137333;
}

.action-type.account-updated, .event-type.account-updated {
    background: #e8f0fe;
    color: #1565c0;
}

/* Account event reason column - ensure full text display */
.account-event-reason {
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    min-width: 200px;
}

/* Cost Impact Styling */
.cost-impact {
    font-weight: 600;
}

.cost-impact.positive {
    color: #34a853;  /* Cost reduction - green */
}

.cost-impact.negative {
    color: #ea4335;  /* Cost increase - red */
}

.cost-impact.neutral {
    color: #666;
}

/* ASG Event Details */
.asg-event-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.config-label {
    font-weight: 600;
    color: #666;
    font-size: 0.85rem;
}

.config-value {
    font-family: monospace;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.85rem;
}

.config-value.old {
    background: #fce8e6;
    color: #c5221f;
    text-decoration: line-through;
}

.config-value.new {
    background: #e6f4ea;
    color: #137333;
    font-weight: 600;
}

/* Note: .timestamp and .instance-id base styles are in utilities/helpers.css */


/* ===================================================================
   Login & Signup Styles
   ================================================================ */

/* Login modal tab navigation */
.login-tabs {
    display: flex;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #e0e0e0;
}

.login-tab-btn {
    flex: 1;
    padding: 0.75rem;
    background: #f8f9fa !important;
    border: none;
    border-bottom: 3px solid transparent;
    color: #333 !important;
    font-size: 0.9rem;
    cursor: pointer;
    margin-bottom: -2px;
    font-weight: 500;
}

.login-tab-btn:hover {
    background: #f5f5f5;
    color: #1a73e8;
}

.login-tab-btn.active {
    color: #1a73e8;
    border-bottom-color: #1a73e8;
    font-weight: 600;
}

.login-tab-content {
    display: none;
}

.login-tab-content.active {
    display: block;
}

/* Forgot password link */
.forgot-password-link {
    display: block;
    text-align: right;
    font-size: 0.85rem;
    color: #1a73e8;
    text-decoration: none;
    margin-top: -0.5rem;
    margin-bottom: 1rem;
}

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

/* Signup form footer */
.signup-footer {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.875rem;
    color: #5f6368;
}

.signup-footer a {
    color: #1a73e8;
    text-decoration: none;
    font-weight: 500;
}

.signup-footer a:hover {
    text-decoration: underline;
}

/* Signup header with permissions info */
.signup-header {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: #e8f0fe;
    border-left: 4px solid #1a73e8;
    border-radius: 4px;
}

.signup-header p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

.signup-header p:first-child {
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.signup-permissions-info {
    color: #1967d2;
    font-size: 0.875rem !important;
}

/* Login modal main buttons (full width) */
/* Exclude dialog-close-btn from these styles */
#login-modal .login-tab-content > button,
#login-modal .login-tab-content button[type="submit"] {
    width: 100%;
    padding: 0.75rem;
    background: #1a73e8;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

#login-modal .login-tab-content > button:hover,
#login-modal .login-tab-content button[type="submit"]:hover {
    background: #1557b0;
}

/* ===================================================================
   Password Management Styles
   ================================================================ */

/* Password strength requirements */
.password-requirements {
    margin: 0.75rem 0;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.requirements-title {
    font-size: 0.85rem;
    color: #5f6368;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.requirements-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.25rem 1rem;
}

.requirements-list li {
    font-size: 0.8rem;
    padding-left: 1.25rem;
    position: relative;
    transition: color 0.2s ease;
}

.requirements-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.requirement-unmet {
    color: #80868b;
}

.requirement-unmet::before {
    border: 2px solid #dadce0;
    background: white;
}

.requirement-met {
    color: #1e8e3e;
}

.requirement-met::before {
    border: 2px solid #1e8e3e;
    background: #1e8e3e;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
    background-size: 10px;
    background-repeat: no-repeat;
    background-position: center;
}

/* Password match indicator */
.password-match-status {
    font-size: 0.8rem;
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
    min-height: 1.2rem;
    transition: color 0.2s ease;
}

.match-success {
    color: #1e8e3e;
}

.match-error {
    color: #d93025;
}

/* Password input with toggle button */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    flex: 1;
    padding-right: 40px !important;
}

.password-toggle-btn,
.modal-content .password-toggle-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none !important;
    border: none;
    padding: 4px !important;
    cursor: pointer;
    color: #5f6368 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: color 0.2s ease, background 0.2s ease;
    width: auto !important;
    height: auto;
}

.password-toggle-btn:hover,
.modal-content .password-toggle-btn:hover {
    color: #1a73e8 !important;
    background: rgba(26, 115, 232, 0.1) !important;
}

.password-toggle-btn svg {
    width: 20px;
    height: 20px;
}

.password-toggle-btn svg.hidden {
    display: none;
}

/* Password strength hint */
.password-hint {
    font-size: 0.75rem;
    margin-top: 0.25rem;
    margin-bottom: 0.75rem;
    color: #5f6368;
    line-height: 1.4;
}

.password-hint.valid {
    color: #0f9d58;
}

.password-hint.invalid {
    color: #ea4335;
}

/* Password reset request modal */
#password-reset-request-modal .modal-content {
    text-align: left;
}

#password-reset-request-modal h2 {
    text-align: center;
}

/* Disabled submit button in password reset */
#submit-reset-btn:disabled {
    background: #dadce0;
    color: #80868b;
    cursor: not-allowed;
}

#submit-reset-btn:disabled:hover {
    background: #dadce0;
}

/* ===================================================================
   Email Verification Banner Styles
   ================================================================ */

.verification-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
    animation: slideDown 0.3s ease-out;
}

.verification-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.verification-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.verification-message {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.verification-message strong {
    font-weight: 600;
    font-size: 0.9375rem;
}

.verification-message span {
    font-size: 0.875rem;
    opacity: 0.95;
}

.verification-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.verification-link-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.verification-link-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.verification-link-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.verification-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background 0.2s;
    line-height: 1;
}

.verification-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Mobile responsive for verification banner */
@media (max-width: 768px) {
    .verification-banner-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .verification-actions {
        width: 100%;
        justify-content: space-between;
    }

    .verification-link-btn {
        flex: 1;
    }
}

/* API Keys Management Modal */
/* Note: #api-keys-modal is now a native <dialog> element.
   Positioning is handled by dialogs.css base styles. */

#api-keys-modal .modal-content {
    text-align: left;
}

#api-keys-modal h2 {
    text-align: center;
    margin-bottom: 0.5rem;
}

#api-keys-modal h3 {
    font-size: 1rem;
    margin: 1rem 0 0.75rem;
    color: #333;
}

.api-keys-create-section {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.api-key-form {
    margin-top: 0.5rem;
}

.api-key-form .form-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.api-key-form label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.85rem;
    color: #555;
}

.api-key-form input[type="text"],
.api-key-form input[type="date"] {
    width: auto;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.api-key-form input[type="text"] {
    min-width: 180px;
}

.api-key-form button[type="submit"] {
    width: auto;
    padding: 0.5rem 1rem;
    white-space: nowrap;
}

/* New key display */
.new-key-display {
    background: #e8f5e9;
    border: 1px solid #4caf50;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.new-key-warning {
    color: #2e7d32;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.new-key-value {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.new-key-value code {
    flex: 1;
    background: white;
    padding: 0.75rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.85rem;
    word-break: break-all;
    border: 1px solid #c8e6c9;
}

.new-key-value button {
    width: auto !important;
}

/* API Keys list */
.api-keys-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.api-key-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.api-key-item:last-child {
    border-bottom: none;
}

.api-key-item.revoked {
    background: #fafafa;
    opacity: 0.7;
}

.api-key-info {
    flex: 1;
    min-width: 0;
}

.api-key-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
}

.api-key-prefix {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.api-key-prefix code {
    font-family: monospace;
    background: #f5f5f5;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.85rem;
    color: #666;
}

.api-key-meta {
    font-size: 0.75rem;
    color: #888;
}

.api-key-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
    margin-left: 1rem;
}

/* Badges for API keys */
.badge {
    display: inline-block;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-inactive {
    background: #f5f5f5;
    color: #999;
}

.badge-expired {
    background: #fce8e6;
    color: #c5221f;
}

/* Small buttons for API key actions */







/* Empty state for API keys */
.apikeys-empty-state {
    text-align: center;
    padding: 2rem;
    color: #888;
}

.apikeys-empty-state p {
    margin: 0;
}

/* Responsive API keys modal */
@media (max-width: 600px) {
    .api-key-form .form-row {
        flex-direction: column;
        align-items: stretch;
    }

    .api-key-form input[type="text"] {
        min-width: unset;
        width: 100%;
    }

    .api-key-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .api-key-actions {
        margin-left: 0;
        width: 100%;
    }

    .api-key-actions button {
        flex: 1;
    }
}

/* ============================================================================
   Permission Grid Styles for API Keys
   ============================================================================ */

.permissions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 6px;
    max-height: 300px;
    overflow-y: auto;
}

.permission-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background 0.2s;
}

.permission-checkbox:hover {
    background: var(--bg-hover);
}

.permission-checkbox input[type="checkbox"] {
    cursor: pointer;
}

.badge-permission {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: var(--accent-color);
    color: white;
    border-radius: 4px;
    font-size: 0.85rem;
    margin-right: 0.25rem;
}

.api-key-permissions,
.api-key-accounts {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.api-key-permissions {
    margin-bottom: 0.5rem;
}

.api-key-accounts code {
    background: var(--bg-secondary);
    padding: 0.125rem 0.25rem;
    border-radius: 3px;
    font-size: 0.85rem;
}

/* Form section styling for API key creation */
.form-section-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}


/* Billing Page Styles */
.billing-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.billing-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.billing-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.billing-card-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e8eaed;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.billing-card-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #202124;
}

.billing-card-body {
    padding: 1.5rem;
}

/* Trial Status Badges */
.trial-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.375rem 0.875rem;
    border-radius: 16px;
    font-size: 0.875rem;
    font-weight: 500;
}

.trial-active .billing-card-header {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.trial-expired .billing-card-header {
    background: rgba(234, 67, 53, 0.1);
}

.trial-message {
    color: #5f6368;
    line-height: 1.6;
    margin: 0;
}

/* Subscription Status Badges */
.status-active {
    background: #e6f4ea;
    color: #0d652d;
}

.status-warning {
    background: #fef7e0;
    color: #b06000;
}

.status-error {
    background: #fce8e6;
    color: #c5221f;
}

.status-info {
    background: #e8f0fe;
    color: #174ea6;
}

.status-default {
    background: #f1f3f4;
    color: #5f6368;
}

/* Stripe Card Element */
.stripe-card-element {
    background: white;
    border: 1px solid #dadce0;
    border-radius: 4px;
    padding: 12px;
    margin: 1rem 0;
    transition: border-color 0.2s;
}

.stripe-card-element:focus-within {
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.1);
}

.payment-error {
    color: #ea4335;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    min-height: 20px;
}

/* Pricing Card */
.pricing-card {
    grid-column: 1 / -1;
}

.pricing-details {
    text-align: center;
}

.pricing-amount {
    font-size: 3rem;
    font-weight: 700;
    color: #202124;
    margin: 1rem 0;
}

.pricing-period {
    font-size: 1.5rem;
    font-weight: 400;
    color: #5f6368;
}

.pricing-description {
    color: #5f6368;
    font-size: 1.125rem;
    margin: 0.5rem 0 2rem;
}

.pricing-features {
    list-style: none;
    padding: 0;
    max-width: 400px;
    margin: 0 auto;
    text-align: left;
}

.pricing-features li {
    padding: 0.75rem 0;
    border-bottom: 1px solid #e8eaed;
    color: #5f6368;
}

.pricing-features li:last-child {
    border-bottom: none;
}

/* Billing Error */
.billing-error {
    background: #fce8e6;
    border: 1px solid #ea4335;
    border-radius: 8px;
    padding: 1.5rem;
    color: #c5221f;
    text-align: center;
}

.billing-error p {
    margin: 0.5rem 0;
}

/* Modal Actions */
.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.modal-small {
    max-width: 500px;
}

/* Billing Buttons */
.billing-card .btn {
    margin-top: 1rem;
}











/* Enhanced Form Validation */
.field-help-text {
    display: block;
    font-size: 0.875rem;
    color: #5f6368;
    margin-top: 0.25rem;
    line-height: 1.4;
}

input.error,
select.error,
textarea.error {
    border-color: #ea4335 !important;
    background-color: #fef7f7 !important;
}

input:focus.error,
select:focus.error,
textarea:focus.error {
    border-color: #ea4335 !important;
    box-shadow: 0 0 0 2px rgba(234, 67, 53, 0.1) !important;
}

/* Mobile responsive for billing */
@media (max-width: 768px) {
    .billing-container {
        grid-template-columns: 1fr;
        padding: 1rem;
        gap: 1rem;
    }

    .pricing-amount {
        font-size: 2.5rem;
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-actions button {
        width: 100%;
    }
}

/* Delete confirmation */
.delete-btn {
    background: #ea4335 !important;
}

.delete-btn:hover {
    background: #c5221f !important;
}

.assume-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.assume-btn:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3f8f 100%) !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}


/* RI/SP Coverage Tab Styles */
#risp-coverage-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.risp-header-actions {
    display: flex;
    gap: 0.5rem;
}

.risp-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.risp-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.25rem;
    border: 1px solid #e0e0e0;
}

.risp-card.summary-card {
    text-align: center;
}

.risp-card h3,
.risp-card h4 {
    color: #666;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.risp-card .value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
}

.risp-card .value.good {
    color: #34a853;
}

.risp-card .value.warning {
    color: #f9a825;
}

.risp-card .value.bad {
    color: #ea4335;
}

.risp-card .subtext {
    font-size: 0.8rem;
    color: #888;
    margin-top: 0.25rem;
}

.risp-section {
    margin-bottom: 2rem;
    padding: 1rem;
    background: #fff3e0;
    border-radius: 8px;
    border: 1px solid #ffcc80;
}

.risp-section h3 {
    color: #e65100;
    margin-bottom: 0.5rem;
}

.risp-hint {
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
    margin-bottom: 1rem;
}

.risp-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.risp-list {
    max-height: 300px;
    overflow-y: auto;
}

.empty-list {
    color: #888;
    font-style: italic;
    text-align: center;
    padding: 1rem;
}

/* Underutilized items */
.underutilized-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: white;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    border: 1px solid #e0e0e0;
}

.underutilized-info {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.underutilized-util {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.util-value {
    font-weight: 600;
}

.util-value.good {
    color: #34a853;
}

.util-value.warning {
    color: #f9a825;
}

.util-value.bad {
    color: #ea4335;
}

.unused-capacity {
    font-size: 0.8rem;
    color: #888;
}

/* Badges */
.family-badge {
    background: #1a73e8;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: monospace;
}

.type-badge {
    background: #e8f0fe;
    color: #1a73e8;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.region-badge,
.az-badge {
    background: #f5f5f5;
    color: #666;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: monospace;
}

.scope-badge,
.plan-badge {
    background: #e6f4ea;
    color: #137333;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

/* Coverage/Utilization items */
.coverage-item,
.utilization-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.coverage-item:last-child,
.utilization-item:last-child {
    border-bottom: none;
}

.coverage-info,
.utilization-info {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.type-name {
    font-family: monospace;
    font-weight: 500;
    color: #333;
}

.coverage-percent {
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.coverage-percent.high {
    background: #e6f4ea;
    color: #137333;
}

.coverage-percent.medium {
    background: #fff3e0;
    color: #e65100;
}

.coverage-percent.low {
    background: #fce8e6;
    color: #c5221f;
}

.utilization-details {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.2rem;
}

.util-percent {
    font-weight: 600;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
}

.util-percent.good {
    background: #e6f4ea;
    color: #137333;
}

.util-percent.warning {
    background: #fff3e0;
    color: #e65100;
}

.util-percent.bad {
    background: #fce8e6;
    color: #c5221f;
}

.unused-hours,
.unused-commit {
    font-size: 0.75rem;
    color: #888;
}

@media (max-width: 768px) {
    .risp-summary-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .risp-details-grid {
        grid-template-columns: 1fr;
    }

    .underutilized-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .underutilized-util {
        align-items: flex-start;
    }
}

/* RI/SP Collection button styles */
.risp-collection-action {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px dashed #e0e0e0;
}

.risp-collection-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.risp-collect-btn {
    padding: 0.6rem 1.2rem;
    background: #1a73e8;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.risp-collect-btn:hover:not(:disabled) {
    background: #1557b0;
}

.risp-collect-btn:disabled {
    background: #94c2fa;
    cursor: wait;
}



/* Charts and Analytics Styles */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-card {
    min-height: 300px;
    display: flex;
    flex-direction: column;
}

.chart-card canvas {
    flex: 1;
    max-height: 300px;
}

#launches-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 2rem;
    margin-bottom: 1.5rem;
}

#launches-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

#failure-reasons-list,
#recommended-types-list {
    max-height: 300px;
    overflow-y: auto;
}

.failure-reason-item,
.recommended-type-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    border-bottom: 1px solid #eee;
}

.failure-reason-item:last-child,
.recommended-type-item:last-child {
    border-bottom: none;
}

.failure-reason-text {
    flex: 1;
    font-size: 0.875rem;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.failure-count {
    font-weight: 600;
    color: #ea4335;
}

.recommended-type-name {
    font-family: monospace;
    font-weight: 600;
}

.success-rate-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.success-rate-high {
    background: #e6f4ea;
    color: #137333;
}

.success-rate-medium {
    background: #fff3e0;
    color: #e65100;
}

.success-rate-low {
    background: #fce8e6;
    color: #c5221f;
}

@media (max-width: 768px) {
    #launches-summary {
        grid-template-columns: repeat(2, 1fr);
    }

    #launches-details {
        grid-template-columns: 1fr;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }
}

/* Savings History Section */
.savings-history-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.savings-history-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.savings-history-section .section-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #333;
}

.savings-history-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.savings-history-controls select {
    padding: 0.4rem 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    background: #fff;
}

.savings-stats-row {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-radius: 6px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-label {
    font-size: 0.75rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
}

.stat-value.savings {
    color: #34a853;
}

.savings-history-section .chart-container {
    height: 250px;
    width: 100%;
    position: relative;
    display: block;
}

.savings-history-section .chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

.empty-hint {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-style: italic;
}

@media (max-width: 768px) {
    .savings-stats-row {
        flex-direction: column;
        gap: 1rem;
    }

    .savings-history-section .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}


/* ============================================================================
   PROGRESS TRACKER
   ============================================================================ */

.progress-tracker {
    width: 100%;
    padding: 1rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #1a73e8 0%, #4285f4 100%);
    transition: width 0.3s ease;
    border-radius: 4px;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.progress-step {
    flex: 1;
    text-align: center;
    position: relative;
}

.step-indicator {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #5f6368;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.progress-step.complete .step-indicator {
    background: #34a853;
    color: white;
}

.progress-step.active .step-indicator {
    background: #1a73e8;
    color: white;
}

.progress-step.error .step-indicator {
    background: #ea4335;
    color: white;
}

.step-label {
    font-size: 0.875rem;
    color: #5f6368;
}

.progress-step.active .step-label {
    color: #1a73e8;
    font-weight: 600;
}

/* ============================================================================
   Expandable Text
   ========================================================================= */

.expandable-text {
    position: relative;
}

.expandable-content {
    transition: max-height 0.3s ease;
}

.expandable-toggle {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: none;
    border: 1px solid #1a73e8;
    color: #1a73e8;
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.expandable-toggle:hover {
    background: #1a73e8;
    color: white;
}

.expandable-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

/* Expanded state */
.expandable-text.expanded .expandable-content {
    max-height: none;
}

/* ============================================================================
   CONFIRMATION DIALOGS & DANGEROUS ACTIONS (Phase 3)
   ============================================================================ */

/* Confirmation Dialog */
.modal-confirmation {
    max-width: 500px;
}

.confirmation-title {
    margin-bottom: 1rem;
    color: #202124;
}

.confirmation-title.danger {
    color: #ea4335;
}

.confirmation-message {
    margin-bottom: 1rem;
    color: #5f6368;
    line-height: 1.5;
}

.confirmation-details {
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background: #fff3cd;
    border-left: 4px solid #ff9800;
    border-radius: 4px;
    color: #856404;
    font-size: 0.9rem;
}

.confirmation-input-group {
    margin-bottom: 1.5rem;
}

.confirmation-input-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #5f6368;
    font-size: 0.9rem;
}

.confirmation-input-group strong {
    color: #ea4335;
    font-weight: 600;
}

.confirmation-input-group input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-size: 1rem;
}

.confirmation-input-group input:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

/* Dangerous Button Styling */




/* ============================================================================
   SKELETON SCREENS
   ============================================================================ */

/* Base skeleton element */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 0%, #e0e0e0 20%, #f0f0f0 40%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    border-radius: 4px;
}

/* Skeleton text line */
.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-text.skeleton-text-lg {
    height: 1.5rem;
}

.skeleton-text.skeleton-text-sm {
    height: 0.75rem;
}

/* Skeleton card */
.skeleton-card {
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    margin-bottom: 1rem;
}

/* Skeleton avatar/icon */
.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

/* Skeleton button */
.skeleton-btn {
    height: 36px;
    width: 100px;
    border-radius: 4px;
}

/* Utility Classes */

/* Generic hidden utility class */
.hidden {
    display: none !important;
}

/* Screen reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Truncate text utility */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.truncate-2-lines {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.truncate-3-lines {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.truncate-4-lines {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Spacing utilities */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }
.mt-4 { margin-top: var(--spacing-xl); }

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

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

/* Text alignment */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Display utilities */
.d-none { display: none; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

/* Flexbox utilities */
.flex-row { flex-direction: row; }
.flex-column { flex-direction: column; }
.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.align-start { align-items: flex-start; }
.align-center { align-items: center; }
.align-end { align-items: flex-end; }
.gap-1 { gap: var(--spacing-sm); }
.gap-2 { gap: var(--spacing-md); }
.gap-3 { gap: var(--spacing-lg); }

/* Common text elements */
.timestamp {
    font-size: 0.875rem;
    color: #888;
    font-style: italic;
}

.instance-id {
    font-family: monospace;
    font-size: 0.875rem;
    background: #f5f5f5;
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 12px;
    text-transform: uppercase;
}

.status-badge.active {
    background: #e6f4ea;
    color: #137333;
}

.status-badge.inactive {
    background: #fce8e6;
    color: #c5221f;
}

.info-banner code {
    background: #f5f5f5;
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.9em;
}

.settings-description {
    margin-bottom: 1.5rem;
    color: #666;
    line-height: 1.5;
}

.help-text {
    display: block;
    font-size: 0.825rem;
    color: #6b7280;
    margin-top: 0.375rem;
    margin-bottom: 0;
    line-height: 1.5;
    font-style: normal;
}

.warning-text {
    color: #ea4335;
    font-weight: 500;
    margin: 0.75rem 0;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Animations and Transitions */

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Slide down animation */
@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Slide up animation */
@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Dialog slide in animation */
@keyframes dialogSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Spin animation for loading spinners */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Skeleton pulse animation */
@keyframes skeleton-pulse {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Shake animation for errors */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

/* Bounce animation */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Transition classes */
.transition-fast {
    transition: all var(--transition-fast);
}

.transition-base {
    transition: all var(--transition-base);
}

.transition-slow {
    transition: all var(--transition-slow);
}

/* =================================================================
   AutoSpotting Cost Dashboard - Modular CSS
   =================================================================

   This is the main CSS entry point that imports all modular CSS files.

   Import order matters:
   1. Base (variables, reset, typography)
   2. Layout (grid, navigation)
   3. Components (buttons, forms, cards, etc.)
   4. Features (page-specific styles)
   5. Utilities (helpers, animations)
*/

/* Base Styles - Variables, reset, typography */

/* Layout - Grid, navigation, structure */

/* Components - Reusable UI components */

/* Features - Page/feature-specific styles */

/* Utilities - Helper classes and animations */

