/* Clockopus Design System - CSS Variables & Global Styles */

:root {
    /* Primary Colors - "Deep Ocean" */
    --clk-primary: #1e3a5f;
    --clk-primary-hover: #152a47;
    --clk-primary-light: #4a90d9;
    --clk-primary-subtle: #e8f1fa;

    /* Accent Colors - "Swiss Precision" */
    --clk-accent: #e85a4f;
    --clk-accent-hover: #d14840;

    /* Semantic Colors */
    --clk-success: #2d7d46;
    --clk-success-bg: #d4edda;
    --clk-warning: #e5a117;
    --clk-warning-hover: #d19315;
    --clk-warning-bg: #fef3cd;
    --clk-error: #c53030;
    --clk-error-bg: #fed7d7;

    /* Neutral Colors - "Paper & Ink" */
    --clk-bg: #fafbfc;
    --clk-surface: #ffffff;
    --clk-border-light: #e1e5ea;
    --clk-border: #c4cdd5;
    --clk-text: #1a2028;
    --clk-text-secondary: #5c6975;
    --clk-text-muted: #8a96a3;
    --clk-disabled: #d1d7dc;

    /* Status Colors (Time Entry) */
    --clk-status-draft: #fef3cd;
    --clk-status-draft-text: #856404;
    --clk-status-committed: #cce5ff;
    --clk-status-committed-text: #004085;
    --clk-status-booked: #d4edda;
    --clk-status-booked-text: #155724;

    /* Typography */
    --clk-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --clk-font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;

    --clk-text-xs: 0.6875rem;    /* 11px */
    --clk-text-sm: 0.8125rem;    /* 13px */
    --clk-text-base: 0.9375rem;  /* 15px */
    --clk-text-md: 1.0625rem;    /* 17px */
    --clk-text-lg: 1.25rem;      /* 20px */
    --clk-text-xl: 1.625rem;     /* 26px */

    /* Spacing (8px base grid) */
    --clk-space-xs: 0.25rem;  /* 4px */
    --clk-space-sm: 0.5rem;   /* 8px */
    --clk-space-md: 1rem;     /* 16px */
    --clk-space-lg: 1.5rem;   /* 24px */
    --clk-space-xl: 2rem;     /* 32px */
    --clk-space-2xl: 3rem;    /* 48px */

    /* Border Radius */
    --clk-radius-sm: 4px;
    --clk-radius: 6px;
    --clk-radius-md: 8px;
    --clk-radius-lg: 12px;
    --clk-radius-full: 9999px;

    /* Shadows */
    --clk-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --clk-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    --clk-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --clk-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);

    /* Focus Ring */
    --clk-focus-ring: 0 0 0 3px rgba(74, 144, 217, 0.4);

    /* Transitions */
    --clk-transition-fast: 0.1s ease;
    --clk-transition-normal: 0.15s ease;
    --clk-transition-slow: 0.3s ease;

    /* Brand Colors (OAuth) */
    --clk-brand-google: #4285F4;
    --clk-brand-microsoft: #00a4ef;

    /* Role Badge Colors */
    --clk-role-admin-bg: #dbeafe;
    --clk-role-admin-text: #1e40af;
    --clk-role-pm-bg: #e9d5ff;
    --clk-role-pm-text: #6b21a8;

    /* Segment Tag Colors */
    --clk-segment-project-bg: #e8f5e9;
    --clk-segment-project-text: #2e7d32;
    --clk-segment-subproject-bg: #fff3e0;
    --clk-segment-subproject-text: #e65100;
    --clk-segment-duration-bg: #e3f2fd;
    --clk-segment-duration-text: #1565c0;

    /* Gradient Tints */
    --clk-success-tint: #f0fdf4;
    --clk-error-tint: #fef2f2;
    --clk-error-light: #fee2e2;

    /* Layout */
    --clk-sidebar-width: 240px;
    --clk-header-height: 64px;
}

/* Base Styles */
html {
    font-size: 16px;
}

body {
    font-family: var(--clk-font-sans);
    font-size: var(--clk-text-base);
    color: var(--clk-text);
    background-color: var(--clk-bg);
    min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--clk-text);
}

h1 { font-size: var(--clk-text-xl); }
h2 { font-size: var(--clk-text-lg); }
h3 { font-size: var(--clk-text-md); }
h4 { font-size: var(--clk-text-base); }

/* Links */
a {
    color: var(--clk-primary-light);
    transition: color var(--clk-transition-fast);
}

a:hover {
    color: var(--clk-primary);
}

/* Focus Styles */
*:focus-visible {
    outline: none;
    box-shadow: var(--clk-focus-ring);
}

/* Loading Screen */
.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    gap: var(--clk-space-md);
    color: var(--clk-text-secondary);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--clk-border-light);
    border-top-color: var(--clk-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Error UI */
#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--clk-space-md);
    background-color: var(--clk-error-bg);
    color: var(--clk-error);
    text-align: center;
    z-index: 9999;
}

#blazor-error-ui .reload {
    color: var(--clk-error);
    text-decoration: underline;
    font-weight: 500;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--clk-space-xs);
    padding: var(--clk-space-sm) var(--clk-space-md);
    font-family: var(--clk-font-sans);
    font-size: var(--clk-text-base);
    font-weight: 500;
    line-height: 1;
    border: none;
    border-radius: var(--clk-radius);
    cursor: pointer;
    transition: all var(--clk-transition-fast);
    white-space: nowrap;
}

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

.btn--primary {
    background: var(--clk-primary);
    color: white;
}

.btn--primary:hover:not(:disabled) {
    background: var(--clk-primary-hover);
}

.btn--accent {
    background: var(--clk-accent);
    color: white;
}

.btn--accent:hover:not(:disabled) {
    background: var(--clk-accent-hover);
}

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

.btn--ghost:hover:not(:disabled) {
    background: var(--clk-primary-subtle);
    border-color: var(--clk-primary-light);
}

.btn--secondary {
    background: var(--clk-primary);
    color: white;
}

.btn--secondary:hover:not(:disabled) {
    background: var(--clk-primary-hover);
}

.btn--danger {
    background: var(--clk-error);
    color: white;
}

.btn--danger:hover:not(:disabled) {
    opacity: 0.9;
}

.btn--sm {
    padding: var(--clk-space-xs) var(--clk-space-sm);
    font-size: var(--clk-text-sm);
}

.btn--lg {
    padding: var(--clk-space-md) var(--clk-space-lg);
    font-size: var(--clk-text-md);
}

/* Input Styles */
.input {
    width: 100%;
    padding: var(--clk-space-sm) var(--clk-space-md);
    font-size: var(--clk-text-base);
    background: var(--clk-surface);
    border: 1px solid var(--clk-border-light);
    border-radius: var(--clk-radius);
    color: var(--clk-text);
    transition: border-color var(--clk-transition-fast), box-shadow var(--clk-transition-fast);
}

.input:hover {
    border-color: var(--clk-border);
}

.input:focus {
    outline: none;
    border-color: var(--clk-primary-light);
    box-shadow: var(--clk-focus-ring);
}

.input::placeholder {
    color: var(--clk-text-muted);
}

.input:disabled {
    background: var(--clk-bg);
    color: var(--clk-disabled);
    cursor: not-allowed;
}

.input[readonly] {
    background: var(--clk-bg);
    color: var(--clk-text-secondary);
    cursor: default;
}

.input--error {
    border-color: var(--clk-error);
}

.input--error:focus {
    box-shadow: 0 0 0 3px rgba(197, 48, 48, 0.2);
}

/* Card Styles */
.card {
    background: var(--clk-surface);
    border: 1px solid var(--clk-border-light);
    border-radius: var(--clk-radius-md);
    box-shadow: var(--clk-shadow-sm);
}

.card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--clk-space-md);
    border-bottom: 1px solid var(--clk-border-light);
}

.card__title {
    font-size: var(--clk-text-md);
    font-weight: 600;
}

.card__body {
    padding: var(--clk-space-md);
}

.card__footer {
    padding: var(--clk-space-md);
    border-top: 1px solid var(--clk-border-light);
    background: var(--clk-bg);
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--clk-space-xs) var(--clk-space-sm);
    font-size: var(--clk-text-xs);
    font-weight: 500;
    border-radius: var(--clk-radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge--draft {
    background: var(--clk-status-draft);
    color: var(--clk-status-draft-text);
}

.badge--committed {
    background: var(--clk-status-committed);
    color: var(--clk-status-committed-text);
}

.badge--booked {
    background: var(--clk-status-booked);
    color: var(--clk-status-booked-text);
}

.badge--service {
    background: var(--clk-primary-subtle);
    color: var(--clk-primary);
    border: 1px solid var(--clk-border-light);
    font-size: var(--clk-text-xs);
    padding: 2px 8px;
    border-radius: var(--clk-radius-full);
    margin-left: var(--clk-space-sm);
}

.badge--active {
    background: var(--clk-status-booked);
    color: var(--clk-status-booked-text);
}

.badge--expired {
    background: var(--clk-status-draft);
    color: var(--clk-status-draft-text);
}

.badge--revoked {
    background: var(--clk-disabled);
    color: var(--clk-text-secondary);
}

/* Utility Classes */
.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;
}

.text-muted {
    color: var(--clk-text-muted);
}

.text-secondary {
    color: var(--clk-text-secondary);
}

.text-error {
    color: var(--clk-error);
}

.text-success {
    color: var(--clk-success);
}

.font-mono {
    font-family: var(--clk-font-mono);
}

/* Responsive Breakpoints */
@media (max-width: 640px) {
    :root {
        --clk-sidebar-width: 100%;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Form Validation Styles */
.validation-message {
    font-size: var(--clk-text-sm);
    color: var(--clk-error);
    margin-top: var(--clk-space-xs);
}

.validation-summary-errors {
    background: var(--clk-error-bg);
    border: 1px solid var(--clk-error);
    border-radius: var(--clk-radius);
    padding: var(--clk-space-md);
    margin-bottom: var(--clk-space-md);
}

.validation-summary-errors ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.validation-summary-errors li {
    color: var(--clk-error);
    font-size: var(--clk-text-sm);
    padding: var(--clk-space-xs) 0;
}

.validation-summary-errors li::before {
    content: "\2022";
    margin-right: var(--clk-space-xs);
}

/* Input with validation state */
.input.modified.invalid,
.input.invalid {
    border-color: var(--clk-error);
}

.input.modified.valid,
.input.valid {
    border-color: var(--clk-success);
}

/* Error Message Component */
.error-message {
    display: flex;
    align-items: flex-start;
    gap: var(--clk-space-sm);
    padding: var(--clk-space-md);
    background: var(--clk-error-bg);
    border: 1px solid var(--clk-error);
    border-radius: var(--clk-radius);
    color: var(--clk-error);
    font-size: var(--clk-text-sm);
}

.error-message__icon {
    flex-shrink: 0;
}

.error-message__content {
    flex: 1;
}

.error-message__dismiss {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--clk-error);
    cursor: pointer;
    padding: var(--clk-space-xs);
    opacity: 0.7;
}

.error-message__dismiss:hover {
    opacity: 1;
}

/* Success Message Component */
.success-message {
    display: flex;
    align-items: flex-start;
    gap: var(--clk-space-sm);
    padding: var(--clk-space-md);
    background: var(--clk-success-bg);
    border: 1px solid var(--clk-success);
    border-radius: var(--clk-radius);
    color: var(--clk-success);
    font-size: var(--clk-text-sm);
}

/* Unauthorized Page */
.unauthorized-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--clk-space-lg);
    background: var(--clk-bg);
}

.unauthorized-content {
    text-align: center;
    max-width: 400px;
}

.unauthorized-content svg {
    color: var(--clk-warning);
    margin-bottom: var(--clk-space-md);
}

.unauthorized-content h1 {
    font-size: var(--clk-text-xl);
    margin-bottom: var(--clk-space-sm);
}

.unauthorized-content p {
    color: var(--clk-text-secondary);
    margin-bottom: var(--clk-space-lg);
}

.legal-card--narrow {
    max-width: 480px;
    text-align: center;
}

/* Not Found Page */
.not-found {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--clk-space-lg);
    background: var(--clk-bg);
    text-align: center;
}

.not-found h1 {
    font-size: 6rem;
    color: var(--clk-primary-subtle);
    margin: 0;
    line-height: 1;
}

.not-found p {
    color: var(--clk-text-secondary);
    margin: var(--clk-space-md) 0 var(--clk-space-lg);
}

/* Form Group */
.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--clk-space-xs);
    margin-bottom: var(--clk-space-sm);
}

.form-group label {
    font-size: var(--clk-text-sm);
    font-weight: 500;
    color: var(--clk-text-secondary);
}

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

/* Checkbox Styles */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--clk-space-xs);
    cursor: pointer;
    font-size: var(--clk-text-sm);
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--clk-primary);
}

/* Alert Components */
.alert {
    padding: var(--clk-space-md);
    border-radius: var(--clk-radius);
    margin-bottom: var(--clk-space-md);
}

.alert--info {
    background: var(--clk-primary-subtle);
    border: 1px solid var(--clk-primary-light);
    color: var(--clk-primary);
}

.alert--warning {
    background: var(--clk-warning-bg);
    border: 1px solid var(--clk-warning);
    color: var(--clk-status-draft-text);
}

.alert--error {
    background: var(--clk-error-bg);
    border: 1px solid var(--clk-error);
    color: var(--clk-error);
}

.alert--success {
    background: var(--clk-success-bg);
    border: 1px solid var(--clk-success);
    color: var(--clk-success);
}

/* Tooltip */
.tooltip {
    position: relative;
}

.tooltip__content {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: var(--clk-space-xs) var(--clk-space-sm);
    background: var(--clk-text);
    color: var(--clk-surface);
    font-size: var(--clk-text-xs);
    border-radius: var(--clk-radius-sm);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--clk-transition-fast), visibility var(--clk-transition-fast);
    z-index: 100;
}

.tooltip:hover .tooltip__content {
    opacity: 1;
    visibility: visible;
}

/* Button Spinner */
.btn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

/* ==========================================
   LOADING INDICATOR
   ========================================== */

.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--clk-space-md);
    padding: var(--clk-space-lg);
}

.loading-indicator--overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    z-index: 1000;
}

.loading-spinner--sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

.loading-spinner--md {
    width: 40px;
    height: 40px;
}

.loading-spinner--lg {
    width: 60px;
    height: 60px;
    border-width: 4px;
}

.loading-message {
    color: var(--clk-text-secondary);
    font-size: var(--clk-text-sm);
}

/* ==========================================
   PASSWORD STRENGTH INDICATOR
   ========================================== */

.password-strength {
    display: flex;
    align-items: center;
    gap: var(--clk-space-sm);
}

.password-strength__bar {
    flex: 1;
    height: 4px;
    background: var(--clk-border-light);
    border-radius: var(--clk-radius-full);
    overflow: hidden;
}

.password-strength__fill {
    height: 100%;
    border-radius: var(--clk-radius-full);
    transition: width var(--clk-transition-normal), background var(--clk-transition-normal);
}

.password-strength__label {
    font-size: var(--clk-text-xs);
    font-weight: 500;
    min-width: 70px;
    text-align: right;
}

.strength--weak {
    background: var(--clk-error);
    color: var(--clk-error);
}

.strength--fair {
    background: var(--clk-warning);
    color: var(--clk-warning);
}

.strength--good {
    background: var(--clk-success);
    color: var(--clk-success);
}

.strength--strong {
    background: var(--clk-success);
    color: var(--clk-success);
}

/* ==========================================
   MODAL OVERLAY (shared by confirm dialog & session expired)
   ========================================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

/* ==========================================
   CONFIRM DIALOG
   ========================================== */

.confirm-dialog {
    background: var(--clk-surface);
    border-radius: var(--clk-radius-lg);
    box-shadow: var(--clk-shadow-lg);
    padding: var(--clk-space-lg);
    max-width: 420px;
    width: 90%;
    text-align: center;
    animation: dialogScaleIn 0.2s ease;
}

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

.confirm-dialog__icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--clk-space-md);
}

.confirm-dialog__icon--default {
    background: var(--clk-primary-subtle);
    color: var(--clk-primary);
}

.confirm-dialog__icon--warning {
    background: var(--clk-warning-bg);
    color: var(--clk-warning);
}

.confirm-dialog__icon--danger {
    background: var(--clk-error-bg);
    color: var(--clk-error);
}

.confirm-dialog__title {
    font-size: var(--clk-text-lg);
    font-weight: 600;
    color: var(--clk-text);
    margin: 0 0 var(--clk-space-sm);
}

.confirm-dialog__message {
    font-size: var(--clk-text-base);
    color: var(--clk-text-secondary);
    margin: 0 0 var(--clk-space-lg);
    line-height: 1.5;
}

.confirm-dialog__extra {
    text-align: left;
    max-height: 240px;
    overflow-y: auto;
    margin: 0 0 var(--clk-space-lg);
    padding: var(--clk-space-md);
    background: var(--clk-bg);
    border: 1px solid var(--clk-border-light);
    border-radius: var(--clk-radius-md);
}

.deletion-impact {
    list-style: none;
    margin: 0;
    padding: 0;
}

.deletion-impact__project {
    margin-bottom: var(--clk-space-sm);
}

.deletion-impact__project:last-child {
    margin-bottom: 0;
}

.deletion-impact__project-name {
    font-weight: 600;
    font-size: var(--clk-text-sm);
    color: var(--clk-text);
}

.deletion-impact__subprojects {
    list-style: none;
    margin: var(--clk-space-xs) 0 0;
    padding-left: var(--clk-space-md);
    border-left: 2px solid var(--clk-border-light);
}

.deletion-impact__subproject {
    font-size: var(--clk-text-sm);
    color: var(--clk-text-secondary);
    padding: 2px 0;
}

/* Time entry edit modal */
.entry-edit-modal {
    background: var(--clk-surface);
    border-radius: var(--clk-radius-lg);
    box-shadow: var(--clk-shadow-lg);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.entry-edit-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--clk-space-lg);
    border-bottom: 1px solid var(--clk-border-light);
}

.entry-edit-modal__title {
    font-size: var(--clk-text-lg);
    font-weight: 600;
    color: var(--clk-text);
    margin: 0;
}

.entry-edit-modal__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--clk-text-secondary);
    border-radius: var(--clk-radius);
    cursor: pointer;
    transition: background var(--clk-transition-fast), color var(--clk-transition-fast);
}

.entry-edit-modal__close:hover {
    background: var(--clk-bg);
    color: var(--clk-text);
}

.entry-edit-modal__body {
    padding: var(--clk-space-lg);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--clk-space-md);
}

.entry-edit-modal__textarea {
    min-height: 80px;
    /* Height is managed by clockopusApp.autoGrowTextarea (grows with content). */
    resize: none;
    overflow: hidden;
    font-family: var(--clk-font-sans);
}

.entry-edit-modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--clk-space-sm);
    padding: var(--clk-space-lg);
    border-top: 1px solid var(--clk-border-light);
}

/* ===== Calendar time grid ===== */
.time-grid { display: flex; flex-direction: column; height: 100%; overflow: auto; background: var(--clk-surface); }

/* Sticky weekday header (week view only) */
.time-grid__header {
    display: flex; position: sticky; top: 0; z-index: 3;
    background: var(--clk-surface);
    border-bottom: 1px solid var(--clk-border);
    box-shadow: 0 1px 0 var(--clk-border-light);
}
.time-grid__header-gutter { width: 56px; flex-shrink: 0; }
.time-grid__header-day {
    flex: 1; min-width: 90px;
    display: flex; align-items: baseline; justify-content: center; gap: 6px;
    padding: 8px 6px; white-space: nowrap;
    border-left: 1px solid var(--clk-border-light);
}
.time-grid__header-dow {
    font-size: var(--clk-text-xs); font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.05em; color: var(--clk-text-secondary);
}
.time-grid__header-date {
    font-size: var(--clk-text-md); font-weight: 700; color: var(--clk-text);
    font-family: var(--clk-font-mono); line-height: 1;
}
.time-grid__header-total {
    font-size: 10px; font-family: var(--clk-font-mono); color: var(--clk-text-muted);
}
.time-grid__header-day--today { background: var(--clk-primary-subtle); }

/* Week view footer: per-day totals (aligned under the columns) + week total.
   Mirrors the grid geometry: 56px gutter + flex day cells (min-width 90px). */
.week-summary {
    display: flex;
    border-top: 1px solid var(--clk-border);
    background: var(--clk-surface);
}
.week-summary__gutter {
    width: 56px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: var(--clk-text-sm); font-weight: 600; color: var(--clk-text-secondary);
}
.week-summary__day {
    flex: 1; min-width: 90px;
    display: flex; align-items: center; justify-content: center;
    padding: 8px 6px;
    border-left: 1px solid var(--clk-border-light);
    font-family: var(--clk-font-mono); font-size: var(--clk-text-sm);
    font-weight: 600; color: var(--clk-text);
}
.week-summary__day--today { background: var(--clk-primary-subtle); color: var(--clk-primary); }
.week-summary__total {
    display: flex; align-items: center; justify-content: flex-end;
    gap: var(--clk-space-sm);
    padding: 8px 12px;
    border-top: 1px solid var(--clk-border-light);
    background: var(--clk-bg);
    font-size: var(--clk-text-sm); color: var(--clk-text-secondary);
}
.week-summary__total strong {
    color: var(--clk-text); font-family: var(--clk-font-mono); font-size: var(--clk-text-md);
}
.time-grid__header-day--today .time-grid__header-dow,
.time-grid__header-day--today .time-grid__header-date { color: var(--clk-primary); }

/* flex:0 0 auto keeps the body at its natural hour-grid height so the drag JS's
   clientHeight->minutes mapping stays correct even when the viewport is taller.
   padding-top gives the first hour label (e.g. 08:00) room so it isn't clipped. */
.time-grid__body { display: flex; flex: 0 0 auto; padding-top: 10px; }
.time-grid__axis { width: 56px; flex-shrink: 0; }
.time-grid__axis-hour { height: 48px; position: relative; }
.time-grid__axis-hour span {
    position: absolute; top: -7px; right: 6px;
    font-size: var(--clk-text-xs); color: var(--clk-text-muted); font-family: var(--clk-font-mono);
}
.time-grid__cols { display: flex; flex: 1; min-width: 0; position: relative; }
.time-grid__col {
    flex: 1; min-width: 90px; position: relative;
    border-left: 1px solid var(--clk-border-light);
}
.time-grid__col--today { background: color-mix(in srgb, var(--clk-primary-subtle) 50%, transparent); }
.time-grid__line { height: 48px; border-top: 1px solid var(--clk-border-light); }
.time-grid__entry {
    position: absolute; left: 0; width: 100%;
    border-radius: var(--clk-radius-sm);
    background: color-mix(in srgb, var(--block-color) 16%, white);
    border-left: 3px solid var(--block-color);
    padding: 2px 6px; overflow: hidden; cursor: pointer;
    font-size: var(--clk-text-xs); box-shadow: var(--clk-shadow-sm);
    transition: box-shadow var(--clk-transition-fast), filter var(--clk-transition-fast);
}
.time-grid__entry:hover { box-shadow: var(--clk-shadow-md); filter: brightness(0.98); z-index: 4; }
.time-grid__entry-body { cursor: move; }
.time-grid__entry-title { display: block; font-weight: 500; color: var(--clk-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.time-grid__entry-cust { font-weight: 700; font-family: var(--clk-font-mono); color: var(--block-color); }
.time-grid__entry-sub { display: block; font-family: var(--clk-font-mono); color: var(--clk-text-secondary); }
.time-grid__entry--readonly { opacity: 0.7; }
.time-grid__entry--readonly .time-grid__entry-body { cursor: pointer; }
/* Estimated (duration-only) entries: soft tinted card with a dashed accent, parked in
   a right-hand lane and marked with ≈ — intentionally distinct from precise time blocks. */
.time-grid__entry--estimated {
    right: 2px; left: auto; width: 44%;
    background: color-mix(in srgb, var(--block-color) 9%, white);
    border: 1px dashed color-mix(in srgb, var(--block-color) 50%, var(--clk-border));
    border-left: 3px dashed var(--block-color);
    box-shadow: none; cursor: pointer;
}
.time-grid__entry--estimated .time-grid__entry-title { font-style: italic; }
.time-grid__entry--estimated .time-grid__entry-sub::before { content: "≈ "; }
.time-grid__grip { position: absolute; left: 0; right: 0; height: 6px; cursor: row-resize; z-index: 1; }
.time-grid__grip--top { top: 0; }
.time-grid__grip--bottom { bottom: 0; }
.time-grid__selection {
    position: absolute; left: 2px; right: 2px;
    background: var(--clk-primary-subtle); border: 1px solid var(--clk-primary-light);
    border-radius: var(--clk-radius-sm); pointer-events: none;
}
.time-grid__now {
    position: absolute; left: 0; right: 0; height: 0;
    border-top: 2px solid var(--clk-accent); pointer-events: none; z-index: 2;
}
.time-grid__now::before {
    content: ""; position: absolute; left: -3px; top: -4px;
    width: 7px; height: 7px; border-radius: 50%; background: var(--clk-accent);
}

/* Quick popover */
.entry-quick-popover {
    background: var(--clk-surface); border-radius: var(--clk-radius-lg);
    box-shadow: var(--clk-shadow-lg); width: 100%; max-width: 420px; overflow: hidden;
}
.entry-quick-popover__header {
    display: flex; align-items: center; justify-content: space-between;
    padding: var(--clk-space-md) var(--clk-space-lg); border-bottom: 1px solid var(--clk-border-light);
}
.entry-quick-popover__header h3 { margin: 0; font-size: var(--clk-text-md); }
.entry-quick-popover__range { font-family: var(--clk-font-mono); color: var(--clk-text-secondary); }
.entry-quick-popover__body { padding: var(--clk-space-lg); display: flex; flex-direction: column; gap: var(--clk-space-md); }
.entry-quick-popover__footer {
    display: flex; justify-content: flex-end; gap: var(--clk-space-sm);
    padding: var(--clk-space-md) var(--clk-space-lg); border-top: 1px solid var(--clk-border-light);
}
.cpp { display: flex; flex-direction: column; gap: var(--clk-space-sm); }
.cpp .input { width: 100%; }

/* ===== Data Import/Export center ===== */
.data-exchange {
    max-width: 1100px;
    margin: 0 auto;
    padding: var(--clk-space-xl) var(--clk-space-lg);
}
.data-exchange__title {
    font-size: var(--clk-text-xl);
    font-weight: 700;
    color: var(--clk-text);
    margin: 0 0 var(--clk-space-xs);
}
.data-exchange__subtitle {
    color: var(--clk-text-secondary);
    margin: 0 0 var(--clk-space-lg);
}
.data-exchange__tabs {
    display: inline-flex;
    gap: 2px;
    background: var(--clk-bg);
    border: 1px solid var(--clk-border-light);
    border-radius: var(--clk-radius-md);
    padding: 3px;
    margin-bottom: var(--clk-space-lg);
}
.data-exchange__tab {
    padding: var(--clk-space-sm) var(--clk-space-lg);
    background: transparent;
    border: none;
    border-radius: var(--clk-radius);
    font: inherit;
    font-weight: 500;
    color: var(--clk-text-secondary);
    cursor: pointer;
    transition: background var(--clk-transition-fast), color var(--clk-transition-fast);
}
.data-exchange__tab--active {
    background: var(--clk-surface);
    color: var(--clk-primary);
    box-shadow: var(--clk-shadow-sm);
}
.data-exchange__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--clk-space-lg);
}
.data-card {
    background: var(--clk-surface);
    border: 1px solid var(--clk-border-light);
    border-radius: var(--clk-radius-lg);
    box-shadow: var(--clk-shadow-sm);
    display: flex;
    flex-direction: column;
}
.data-card__header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: var(--clk-space-md) var(--clk-space-lg);
    border-bottom: 1px solid var(--clk-border-light);
}
.data-card__title { margin: 0; font-size: var(--clk-text-md); font-weight: 600; color: var(--clk-text); }
.data-card__hint { font-size: var(--clk-text-xs); color: var(--clk-text-muted); font-family: var(--clk-font-mono); }
.data-card__body {
    padding: var(--clk-space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--clk-space-md);
}
.data-card__result {
    border-top: 1px solid var(--clk-border-light);
    padding-top: var(--clk-space-md);
    font-size: var(--clk-text-sm);
    color: var(--clk-text-secondary);
}
.data-card__errors {
    margin: var(--clk-space-sm) 0 0;
    padding-left: var(--clk-space-lg);
    color: var(--clk-error);
    font-size: var(--clk-text-xs);
    max-height: 160px;
    overflow-y: auto;
}

/* ===== Massenerfassung (bulk entry) ===== */
.bulk-entry {
    max-width: 1320px;
    margin: 0 auto;
    padding: var(--clk-space-xl) var(--clk-space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--clk-space-lg);
}

.bulk-entry__title {
    font-size: var(--clk-text-xl);
    font-weight: 700;
    color: var(--clk-text);
    margin: 0 0 var(--clk-space-xs);
}

.bulk-entry__subtitle {
    color: var(--clk-text-secondary);
    font-size: var(--clk-text-base);
    line-height: 1.5;
    max-width: 78ch;
    margin: 0;
}

.bulk-entry code {
    font-family: var(--clk-font-mono);
    font-size: 0.92em;
    background: var(--clk-bg);
    border: 1px solid var(--clk-border-light);
    border-radius: var(--clk-radius-sm);
    padding: 1px 5px;
    color: var(--clk-text-secondary);
    white-space: nowrap;
}

.be-card {
    background: var(--clk-surface);
    border: 1px solid var(--clk-border-light);
    border-radius: var(--clk-radius-lg);
    box-shadow: var(--clk-shadow-sm);
}

/* Compose card */
.be-compose {
    padding: var(--clk-space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--clk-space-md);
}

.be-compose__date {
    max-width: 220px;
    margin: 0;
}

.be-compose__text {
    width: 100%;
    min-height: 150px;
    resize: vertical;
    font-family: var(--clk-font-mono);
    font-size: var(--clk-text-sm);
    line-height: 1.6;
}

.be-compose__hint {
    display: block;
    margin-top: var(--clk-space-xs);
    font-size: var(--clk-text-xs);
    color: var(--clk-text-muted);
    line-height: 1.5;
}

.be-compose__actions {
    display: flex;
    gap: var(--clk-space-sm);
}

/* Preview card */
.be-preview {
    overflow: hidden;
}

.be-preview__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--clk-space-md);
    flex-wrap: wrap;
    padding: var(--clk-space-md) var(--clk-space-lg);
    background: var(--clk-bg);
    border-bottom: 1px solid var(--clk-border-light);
}

.be-preview__stats {
    display: flex;
    gap: var(--clk-space-lg);
    flex-wrap: wrap;
}

.be-preview__actions {
    display: flex;
    gap: var(--clk-space-sm);
}

.be-stat {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: var(--clk-text-sm);
    font-weight: 600;
    color: var(--clk-text-secondary);
}

.be-stat__dot {
    width: 9px;
    height: 9px;
    border-radius: var(--clk-radius-full);
    background: var(--clk-text-muted);
}

.be-stat--ok .be-stat__dot { background: var(--clk-primary-light); }
.be-stat--warn .be-stat__dot { background: var(--clk-warning); }
.be-stat--saved .be-stat__dot { background: var(--clk-success); }

/* "Apply to all" template bar */
.be-template {
    display: flex;
    align-items: center;
    gap: var(--clk-space-md);
    flex-wrap: wrap;
    padding: var(--clk-space-md) var(--clk-space-lg);
    background: var(--clk-primary-subtle);
    border-bottom: 1px solid var(--clk-border-light);
}

.be-template__label {
    font-size: var(--clk-text-sm);
    font-weight: 600;
    color: var(--clk-primary);
    white-space: nowrap;
}

.be-template__fields {
    display: flex;
    gap: var(--clk-space-sm);
    flex-wrap: wrap;
    align-items: center;
}

.be-template__fields select.input {
    min-width: 160px;
    padding: 6px 8px;
    font-size: var(--clk-text-sm);
}

.be-template__time {
    width: 130px;
    padding: 6px 8px;
    font-size: var(--clk-text-sm);
    font-family: var(--clk-font-mono);
}

/* Editable grid */
.be-grid-wrap {
    overflow: auto;
    max-height: 62vh;
}

.be-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--clk-text-sm);
}

.be-grid col.be-col-num { width: 48px; }
.be-grid col.be-col-time { width: 100px; }
.be-grid col.be-col-status { width: 160px; }
.be-grid col.be-col-cust,
.be-grid col.be-col-proj { width: 17%; }
.be-grid col.be-col-sub { width: 15%; }

.be-grid thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    text-align: left;
    padding: var(--clk-space-sm) var(--clk-space-md);
    background: var(--clk-surface);
    border-bottom: 2px solid var(--clk-border-light);
    color: var(--clk-text-secondary);
    font-size: var(--clk-text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.be-grid tbody td {
    padding: 8px var(--clk-space-md);
    border-bottom: 1px solid var(--clk-border-light);
    vertical-align: middle;
}

.be-grid tbody tr {
    transition: background var(--clk-transition-fast);
}

.be-grid tbody tr:hover {
    background: var(--clk-primary-subtle);
}

.be-grid tbody tr.is-ok { box-shadow: inset 3px 0 0 var(--clk-primary-light); }
.be-grid tbody tr.is-saved { box-shadow: inset 3px 0 0 var(--clk-success); background: rgba(45, 125, 70, 0.04); }
.be-grid tbody tr.is-error { box-shadow: inset 3px 0 0 var(--clk-border); }

.be-grid__num {
    color: var(--clk-text-muted);
    font-family: var(--clk-font-mono);
    text-align: right;
}

.be-grid .input {
    width: 100%;
    padding: 6px 8px;
    font-size: var(--clk-text-sm);
}

.be-grid__time .input {
    font-family: var(--clk-font-mono);
    text-align: center;
}

.be-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--clk-radius-full);
    font-size: var(--clk-text-xs);
    font-weight: 600;
    line-height: 1.4;
}

.be-status--ok { background: var(--clk-status-committed); color: var(--clk-status-committed-text); }
.be-status--saved { background: var(--clk-status-booked); color: var(--clk-status-booked-text); }
.be-status--warn { background: var(--clk-status-draft); color: var(--clk-status-draft-text); }

.be-empty {
    padding: var(--clk-space-xl);
    color: var(--clk-text-muted);
    text-align: center;
    margin: 0;
}

@media (max-width: 1023px) {
    .bulk-entry {
        padding: var(--clk-space-lg) var(--clk-space-md);
    }
    .be-grid {
        min-width: 860px;
    }
}

.confirm-dialog__actions {
    display: flex;
    flex-direction: column-reverse;
    gap: var(--clk-space-sm);
    justify-content: center;
}

.confirm-dialog__actions .btn {
    width: 100%;
}

@media (min-width: 480px) {
    .confirm-dialog {
        padding: var(--clk-space-xl);
    }

    .confirm-dialog__actions {
        flex-direction: row;
    }

    .confirm-dialog__actions .btn {
        width: auto;
        min-width: 100px;
    }
}

/* ==========================================
   TOAST NOTIFICATIONS
   ========================================== */

.toast-container {
    position: fixed;
    top: var(--clk-space-sm);
    right: var(--clk-space-sm);
    left: var(--clk-space-sm);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: var(--clk-space-sm);
    max-width: none;
    pointer-events: none;
}

@media (min-width: 480px) {
    .toast-container {
        top: var(--clk-space-lg);
        right: var(--clk-space-lg);
        left: auto;
        max-width: 400px;
        width: 100%;
    }
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: var(--clk-space-sm);
    padding: var(--clk-space-md);
    background: var(--clk-surface);
    border-radius: var(--clk-radius-md);
    box-shadow: var(--clk-shadow-lg);
    border-left: 4px solid;
    pointer-events: auto;
    animation: slideIn 0.2s ease;
}

.toast--success {
    border-left-color: var(--clk-success);
}

.toast--success .toast__icon {
    color: var(--clk-success);
}

.toast--error {
    border-left-color: var(--clk-error);
}

.toast--error .toast__icon {
    color: var(--clk-error);
}

.toast--warning {
    border-left-color: var(--clk-warning);
}

.toast--warning .toast__icon {
    color: var(--clk-warning);
}

.toast--info {
    border-left-color: var(--clk-primary-light);
}

.toast--info .toast__icon {
    color: var(--clk-primary-light);
}

.toast__icon {
    flex-shrink: 0;
    margin-top: 2px;
}

.toast__content {
    flex: 1;
    min-width: 0;
}

.toast__title {
    font-weight: 600;
    font-size: var(--clk-text-base);
    color: var(--clk-text);
    margin-bottom: var(--clk-space-xs);
}

.toast__message {
    font-size: var(--clk-text-sm);
    color: var(--clk-text-secondary);
    word-break: break-word;
}

.toast__close {
    flex-shrink: 0;
    padding: var(--clk-space-xs);
    background: none;
    border: none;
    color: var(--clk-text-muted);
    cursor: pointer;
    border-radius: var(--clk-radius-sm);
    transition: all var(--clk-transition-fast);
}

.toast__close:hover {
    background: var(--clk-bg);
    color: var(--clk-text);
}

/* ==========================================
   SESSION EXPIRED MODAL
   ========================================== */

.session-expired-modal {
    background: var(--clk-surface);
    border-radius: var(--clk-radius-lg);
    box-shadow: var(--clk-shadow-lg);
    padding: var(--clk-space-xl);
    max-width: 400px;
    width: 90%;
    text-align: center;
    animation: slideUp 0.2s ease;
}

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

.modal__icon {
    color: var(--clk-warning);
    margin-bottom: var(--clk-space-md);
}

.session-expired-modal h2 {
    font-size: var(--clk-text-lg);
    margin-bottom: var(--clk-space-sm);
}

.session-expired-modal p {
    color: var(--clk-text-secondary);
    margin-bottom: var(--clk-space-lg);
    line-height: 1.6;
}

.session-expired-modal .btn {
    width: 100%;
}

/* ==========================================
   AUTH PAGES (Login, Register, Forgot Password, OAuth Callback)
   ========================================== */

/* --- Shared OAuth Buttons --- */

.oauth-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--clk-space-sm);
    margin-bottom: var(--clk-space-md);
}

.btn--oauth {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--clk-space-sm);
    padding: var(--clk-space-sm) var(--clk-space-md);
    background: var(--clk-surface);
    border: 1px solid var(--clk-border);
    border-radius: var(--clk-radius);
    font-weight: 500;
    transition: all var(--clk-transition-fast);
}

.btn--oauth:hover:not(:disabled) {
    background: var(--clk-bg);
}

.btn--google:hover:not(:disabled) {
    border-color: var(--clk-brand-google);
}

.btn--microsoft:hover:not(:disabled) {
    border-color: var(--clk-brand-microsoft);
}

.oauth-icon {
    flex-shrink: 0;
}

/* --- Shared Divider --- */

.divider {
    display: flex;
    align-items: center;
    gap: var(--clk-space-md);
    margin: var(--clk-space-lg) 0;
    color: var(--clk-text-muted);
    font-size: var(--clk-text-sm);
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--clk-border-light);
}

/* --- Auth Form Overrides --- */
/* Auth forms use flex gap, so remove form-group margin-bottom */

.login-form .form-group,
.register-form .form-group,
.forgot-password-form .form-group {
    margin-bottom: 0;
}

/* --- Login Page (split layout) --- */

.login-split {
    display: flex;
    min-height: 100vh;
}

/* Brand panel (desktop only) — Deep Ocean gradient + subtle dotted texture */
.login-brand {
    display: none;
    position: relative;
    flex: 1 1 46%;
    align-items: center;
    justify-content: center;
    padding: var(--clk-space-2xl);
    color: #fff;
    overflow: hidden;
    background:
        radial-gradient(120% 80% at 18% 12%, rgba(74, 144, 217, 0.38), transparent 60%),
        linear-gradient(160deg, var(--clk-primary) 0%, var(--clk-primary-hover) 55%, #0c1b2e 100%);
}

.login-brand::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
    background-size: 22px 22px;
    pointer-events: none;
}

.login-brand__inner {
    position: relative;
    max-width: 380px;
}

.login-brand__logo {
    filter: drop-shadow(0 8px 22px rgba(0, 0, 0, 0.35));
}

.login-brand__wordmark {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: var(--clk-space-md) 0 var(--clk-space-sm);
}

.login-brand__tagline {
    font-size: var(--clk-text-md);
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
}

/* Form side */
.login-main {
    flex: 1 1 54%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--clk-space-lg);
    background:
        radial-gradient(100% 60% at 50% 0%, var(--clk-primary-subtle), transparent 70%),
        var(--clk-bg);
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--clk-surface);
    border: 1px solid var(--clk-border-light);
    border-radius: var(--clk-radius-lg);
    box-shadow: var(--clk-shadow-lg);
    padding: var(--clk-space-xl);
}

.login-header {
    text-align: center;
    margin-bottom: var(--clk-space-lg);
}

.login-header__logo {
    margin-bottom: var(--clk-space-sm);
    filter: drop-shadow(0 4px 10px rgba(30, 58, 95, 0.18));
}

.login-header h1 {
    font-size: var(--clk-text-xl);
    color: var(--clk-text);
    margin-bottom: var(--clk-space-xs);
}

@media (min-width: 900px) {
    .login-brand {
        display: flex;
    }
    /* big brand panel already shows the logo; hide the small one in the form header */
    .login-header__logo {
        display: none;
    }
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: var(--clk-space-md);
}

.forgot-link {
    font-size: var(--clk-text-sm);
    color: var(--clk-primary-light);
}

.login-button {
    width: 100%;
    margin-top: var(--clk-space-sm);
}

.login-footer {
    text-align: center;
    margin-top: var(--clk-space-lg);
    padding-top: var(--clk-space-lg);
    border-top: 1px solid var(--clk-border-light);
    font-size: var(--clk-text-sm);
    color: var(--clk-text-secondary);
}

.login-footer a {
    color: var(--clk-primary-light);
    font-weight: 500;
}

.login-version {
    margin-top: var(--clk-space-sm);
    font-family: var(--clk-font-mono);
    font-size: var(--clk-text-xs);
    color: var(--clk-text-muted);
}

/* --- Register Page --- */

.register-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--clk-space-lg);
    background: var(--clk-bg);
}

.register-card {
    width: 100%;
    max-width: 480px;
    background: var(--clk-surface);
    border: 1px solid var(--clk-border-light);
    border-radius: var(--clk-radius-lg);
    box-shadow: var(--clk-shadow-lg);
    padding: var(--clk-space-xl);
}

.register-header {
    text-align: center;
    margin-bottom: var(--clk-space-lg);
}

.register-logo {
    font-size: 3rem;
    display: block;
    margin-bottom: var(--clk-space-sm);
}

/* Icon image centred inside .register-header (replaces inline style="display:block;margin:0 auto …") */
.register-header__icon {
    display: block;
    margin: 0 auto var(--clk-space-sm);
}

/* Centred navigation link paragraph used below success/error banners on onboarding pages */
.register-link-row {
    text-align: center;
    margin-top: var(--clk-space-md);
}

.register-header h1 {
    font-size: var(--clk-text-xl);
    color: var(--clk-primary);
    margin-bottom: var(--clk-space-xs);
}

.register-form {
    display: flex;
    flex-direction: column;
    gap: var(--clk-space-md);
}

/* Form Row — mobile-first: stacked, side-by-side on >=480px */
.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--clk-space-md);
}

@media (min-width: 480px) {
    .form-row {
        /* minmax(0, …) lets the tracks shrink below the content's intrinsic min-width;
           without it a native <input type=date> (calendar indicator) overflows the cell. */
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
}

/* Register checkbox overrides */
.register-form .checkbox-label {
    align-items: flex-start;
    gap: var(--clk-space-sm);
    line-height: 1.5;
}

.register-form .checkbox-label input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
}

.register-form .checkbox-label a {
    color: var(--clk-primary-light);
}

.password-requirements {
    margin-top: var(--clk-space-xs);
}

.register-button {
    width: 100%;
    margin-top: var(--clk-space-sm);
}

.register-footer {
    text-align: center;
    margin-top: var(--clk-space-lg);
    padding-top: var(--clk-space-lg);
    border-top: 1px solid var(--clk-border-light);
    font-size: var(--clk-text-sm);
    color: var(--clk-text-secondary);
}

.register-footer a {
    color: var(--clk-primary-light);
    font-weight: 500;
}

/* --- Forgot Password Page --- */

.forgot-password-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--clk-space-lg);
    background: var(--clk-bg);
}

.forgot-password-card {
    width: 100%;
    max-width: 420px;
    background: var(--clk-surface);
    border: 1px solid var(--clk-border-light);
    border-radius: var(--clk-radius-lg);
    box-shadow: var(--clk-shadow-lg);
    padding: var(--clk-space-xl);
}

.forgot-password-header {
    text-align: center;
    margin-bottom: var(--clk-space-lg);
}

.forgot-password-logo {
    font-size: 3rem;
    display: block;
    margin-bottom: var(--clk-space-sm);
}

.forgot-password-header h1 {
    font-size: var(--clk-text-lg);
    color: var(--clk-text);
    margin-bottom: var(--clk-space-sm);
}

.forgot-password-header p {
    font-size: var(--clk-text-sm);
    line-height: 1.6;
}

.forgot-password-form {
    display: flex;
    flex-direction: column;
    gap: var(--clk-space-md);
}

.submit-button {
    width: 100%;
    margin-top: var(--clk-space-sm);
}

/* Forgot Password success state (distinct from alert-style .success-message) */
.forgot-password-success {
    text-align: center;
    padding: var(--clk-space-lg) 0;
}

.forgot-password-success svg {
    color: var(--clk-success);
    margin-bottom: var(--clk-space-md);
}

.forgot-password-success h2 {
    font-size: var(--clk-text-md);
    margin-bottom: var(--clk-space-sm);
}

.forgot-password-success p {
    font-size: var(--clk-text-sm);
    color: var(--clk-text-secondary);
    margin-bottom: var(--clk-space-lg);
    line-height: 1.6;
}

.forgot-password-footer {
    text-align: center;
    margin-top: var(--clk-space-lg);
    padding-top: var(--clk-space-lg);
    border-top: 1px solid var(--clk-border-light);
}

.forgot-password-footer a {
    display: inline-flex;
    align-items: center;
    gap: var(--clk-space-xs);
    font-size: var(--clk-text-sm);
    color: var(--clk-text-secondary);
    transition: color var(--clk-transition-fast);
}

.forgot-password-footer a:hover {
    color: var(--clk-primary);
}

/* --- OAuth Callback Page --- */

.oauth-callback {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--clk-space-lg);
    background: var(--clk-bg);
}

.oauth-callback__processing,
.oauth-callback__success,
.oauth-callback__error {
    text-align: center;
    padding: var(--clk-space-xl);
    background: var(--clk-surface);
    border: 1px solid var(--clk-border-light);
    border-radius: var(--clk-radius-lg);
    box-shadow: var(--clk-shadow-lg);
    max-width: 400px;
    width: 100%;
}

.oauth-callback__icon {
    margin-bottom: var(--clk-space-md);
}

.oauth-callback__icon--error {
    color: var(--clk-error);
}

.oauth-callback__icon--success {
    color: var(--clk-success);
}

.oauth-callback__processing h2,
.oauth-callback__success h2,
.oauth-callback__error h2 {
    font-size: var(--clk-text-lg);
    color: var(--clk-text);
    margin-bottom: var(--clk-space-sm);
}

.oauth-callback__processing p,
.oauth-callback__success p,
.oauth-callback__error p {
    font-size: var(--clk-text-base);
    color: var(--clk-text-secondary);
    margin-bottom: var(--clk-space-md);
}

.oauth-callback__spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--clk-border-light);
    border-top-color: var(--clk-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--clk-space-md);
}

/* ==========================================
   PAGE LAYOUT
   ========================================== */

.page-header {
    display: flex;
    flex-direction: column;
    gap: var(--clk-space-xs);
}

.page-header h1 {
    margin: 0;
    font-size: var(--clk-text-xl);
    font-weight: 700;
    color: var(--clk-text);
}

.page-subtitle {
    margin: 0;
    font-size: var(--clk-text-base);
    color: var(--clk-text-secondary);
}

.page-content {
    background: var(--clk-surface);
    border-radius: var(--clk-radius-lg);
    padding: var(--clk-space-lg);
    box-shadow: var(--clk-shadow-sm);
}

/* ==========================================
   SLIDE PANEL
   ========================================== */

.slide-panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: flex;
    justify-content: flex-end;
    animation: fadeIn 0.2s ease;
}

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

.slide-panel {
    width: 100%;
    max-width: 500px;
    height: 100%;
    background: var(--clk-surface);
    box-shadow: var(--clk-shadow-lg);
    animation: slideIn 0.3s ease;
    overflow-y: auto;
}

.slide-panel--wide {
    max-width: 700px;
}

.slide-panel--medium {
    max-width: 560px;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

/* ==========================================
   SLIDE PANEL FORM (Unified for all forms)
   ========================================== */

.slide-panel-form {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.slide-panel-form__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--clk-space-md) var(--clk-space-lg);
    border-bottom: 1px solid var(--clk-border-light);
}

.slide-panel-form__header h2 {
    margin: 0;
    font-size: var(--clk-text-lg);
    font-weight: 600;
    color: var(--clk-text);
}

.slide-panel-form__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: var(--clk-space-md) var(--clk-space-lg);
    overflow-y: auto;
}

.slide-panel-form__actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--clk-space-sm);
    margin-top: auto;
    padding-top: var(--clk-space-md);
    border-top: 1px solid var(--clk-border-light);
}

/* Destructive action sits on the far left of the panel footer. */
.slide-panel-form__actions .edit-entry__delete {
    margin-right: auto;
}

/* Icon Button (used in slide panels) */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: var(--clk-radius);
    color: var(--clk-text-secondary);
    cursor: pointer;
    transition: all var(--clk-transition-fast);
}

.btn-icon:hover {
    background: var(--clk-bg);
    color: var(--clk-text);
}

.btn-icon:focus-visible {
    outline: none;
    box-shadow: var(--clk-focus-ring);
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--clk-space-sm) var(--clk-space-md);
}

/* Inside a grid/row the parent gap already separates fields — the form-group's
   own margin-bottom would double the vertical spacing and cause extra scrolling. */
.form-grid .form-group,
.form-row .form-group {
    margin-bottom: 0;
    min-width: 0;
}

/* Native date/time inputs must be allowed to shrink to their grid/flex cell. */
.form-row .input {
    min-width: 0;
    width: 100%;
}

.form-group--full {
    grid-column: 1 / -1;
}

.form-hint {
    font-size: var(--clk-text-xs);
    color: var(--clk-text-muted);
}

.form-section-divider {
    border: none;
    border-top: 1px solid var(--clk-border-light);
    margin: var(--clk-space-md) 0 var(--clk-space-sm);
}

.form-section-title {
    font-size: var(--clk-text-sm);
    font-weight: 600;
    color: var(--clk-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 var(--clk-space-sm);
}

/* Color Input */
.color-input-wrapper {
    display: flex;
    gap: var(--clk-space-sm);
}

.color-picker {
    width: 44px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--clk-border-light);
    border-radius: var(--clk-radius);
    cursor: pointer;
    overflow: hidden;
}

.color-picker::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.color-picker::-webkit-color-swatch {
    border-radius: var(--clk-radius-sm);
    border: none;
}

.color-text-input {
    flex: 1;
    font-family: var(--clk-font-mono);
}

/* Rate Input */
.rate-input-wrapper {
    display: flex;
    gap: var(--clk-space-sm);
}

.rate-input {
    flex: 1;
}

.currency-select {
    width: 80px;
}

/* Toggle */
.toggle-row {
    display: flex;
    gap: var(--clk-space-xl);
}

.toggle-label {
    display: inline-flex;
    align-items: center;
    gap: var(--clk-space-sm);
    cursor: pointer;
    user-select: none;
}

.toggle-checkbox {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--clk-border);
    border-radius: var(--clk-radius-full);
    transition: background var(--clk-transition-fast);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: var(--clk-surface);
    border-radius: 50%;
    transition: transform var(--clk-transition-fast);
}

.toggle-checkbox:checked + .toggle-switch {
    background: var(--clk-primary);
}

.toggle-checkbox:checked + .toggle-switch::after {
    transform: translateX(20px);
}

.toggle-checkbox:focus-visible + .toggle-switch {
    box-shadow: var(--clk-focus-ring);
}

/* Subprojects/Related Items Section */
.related-items-section {
    border: 1px solid var(--clk-border-light);
    border-radius: var(--clk-radius-md);
    padding: var(--clk-space-md);
}

.related-items-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--clk-space-md);
}

.related-items-header label {
    font-weight: 600;
    color: var(--clk-text);
}

.related-item-add-form {
    display: flex;
    gap: var(--clk-space-sm);
    margin-bottom: var(--clk-space-md);
    padding: var(--clk-space-md);
    background: var(--clk-bg);
    border-radius: var(--clk-radius);
}

.related-item-add-form .input {
    flex: 1;
}

.related-items-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.related-item {
    display: flex;
    align-items: center;
    gap: var(--clk-space-md);
    padding: var(--clk-space-sm) var(--clk-space-md);
    border-bottom: 1px solid var(--clk-border-light);
}

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

.related-item.inactive {
    opacity: 0.6;
}

.related-item-name {
    flex: 1;
    font-weight: 500;
}

.related-item-code {
    font-family: var(--clk-font-mono);
    font-size: var(--clk-text-sm);
    color: var(--clk-text-secondary);
}

.status-badge {
    display: inline-flex;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 500;
    border-radius: var(--clk-radius-full);
}

.status-badge--active {
    background: var(--clk-status-booked);
    color: var(--clk-status-booked-text);
}

.status-badge--inactive {
    background: var(--clk-bg);
    color: var(--clk-text-muted);
    border: 1px solid var(--clk-border-light);
}

.related-items-empty {
    text-align: center;
    color: var(--clk-text-muted);
    font-size: var(--clk-text-sm);
    margin: 0;
    padding: var(--clk-space-md);
}

/* Per-row actions + inline edit (subproject management) */
.related-item__actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
    margin-left: auto;
}

.btn-icon--sm {
    width: 28px;
    height: 28px;
}

.related-item__edit-name {
    flex: 1;
    min-width: 0;
}

.related-item__edit-code {
    width: 96px;
    flex-shrink: 0;
    font-family: var(--clk-font-mono);
}

/* Responsive for slide panel forms */
@media (max-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .toggle-row {
        flex-direction: column;
        gap: var(--clk-space-md);
    }

    .related-item-add-form {
        flex-wrap: wrap;
    }

    .related-item-add-form .input {
        min-width: 100%;
    }

    .slide-panel-form__actions {
        flex-direction: column-reverse;
    }

    .slide-panel-form__actions .btn {
        width: 100%;
    }
}

/* ==========================================
   IMPORT PANEL (Global styles for all imports)
   ========================================== */

.import-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: var(--clk-space-lg);
}

.import-panel__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--clk-space-lg);
}

.import-panel__header h2 {
    margin: 0;
    font-size: var(--clk-text-lg);
    font-weight: 600;
    color: var(--clk-text);
}

.import-panel__content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--clk-space-lg);
}

.import-panel__footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--clk-space-sm);
    padding-top: var(--clk-space-lg);
    border-top: 1px solid var(--clk-border-light);
    margin-top: var(--clk-space-lg);
}

/* Import Tabs */
.import-tabs {
    display: flex;
    gap: var(--clk-space-xs);
    padding: var(--clk-space-xs);
    background: var(--clk-bg);
    border-radius: var(--clk-radius-md);
    margin-bottom: var(--clk-space-lg);
}

.import-tab {
    flex: 1;
    padding: var(--clk-space-sm) var(--clk-space-md);
    border: none;
    background: transparent;
    color: var(--clk-text-secondary);
    font-size: var(--clk-text-sm);
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--clk-radius-sm);
    transition: all 0.15s ease;
}

.import-tab:hover {
    background: var(--clk-surface);
    color: var(--clk-text);
}

.import-tab--active {
    background: var(--clk-surface);
    color: var(--clk-primary);
    box-shadow: var(--clk-shadow-sm);
}

/* Import Info Box */
.import-info {
    background: var(--clk-primary-subtle);
    padding: var(--clk-space-md);
    border-radius: var(--clk-radius-md);
}

.import-info h3 {
    margin: 0 0 var(--clk-space-sm) 0;
    font-size: var(--clk-text-base);
    font-weight: 600;
}

.import-info p {
    margin: 0 0 var(--clk-space-sm) 0;
    color: var(--clk-text-secondary);
    font-size: var(--clk-text-sm);
}

.import-info code {
    display: block;
    background: var(--clk-surface);
    padding: var(--clk-space-sm);
    border-radius: var(--clk-radius-sm);
    font-family: var(--clk-font-mono);
    font-size: var(--clk-text-sm);
    overflow-x: auto;
}

.import-info__note {
    font-style: italic;
    margin-top: var(--clk-space-sm) !important;
}

.import-info__details {
    margin-top: var(--clk-space-md);
    padding-top: var(--clk-space-sm);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.import-info__details p {
    margin-bottom: var(--clk-space-xs) !important;
}

.import-info__details ul {
    margin: 0;
    padding-left: var(--clk-space-lg);
    font-size: var(--clk-text-sm);
}

.import-info__details li {
    margin-bottom: var(--clk-space-xs);
    color: var(--clk-text-secondary);
}

.import-info__details li strong {
    color: var(--clk-text);
}

/* File Upload */
.import-input {
    position: relative;
}

.file-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--clk-space-sm);
    padding: var(--clk-space-xl);
    border: 2px dashed var(--clk-border);
    border-radius: var(--clk-radius-md);
    cursor: pointer;
    transition: all var(--clk-transition-fast);
    color: var(--clk-text-secondary);
}

.file-label:hover {
    border-color: var(--clk-primary);
    background: var(--clk-primary-subtle);
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* Separator Options */
.import-separator {
    padding: var(--clk-space-sm) 0;
}

.separator-label {
    display: block;
    font-size: var(--clk-text-sm);
    font-weight: 600;
    margin-bottom: var(--clk-space-sm);
}

.separator-options {
    display: flex;
    flex-wrap: wrap;
    gap: var(--clk-space-md);
}

.radio-label {
    display: flex;
    align-items: center;
    gap: var(--clk-space-xs);
    cursor: pointer;
    font-size: var(--clk-text-sm);
}

.radio-label input[type="radio"] {
    width: 16px;
    height: 16px;
}

/* Import Options */
.import-options {
    padding: var(--clk-space-sm) 0;
}

/* Preview */
.import-preview {
    background: var(--clk-bg);
    border: 1px solid var(--clk-border-light);
    border-radius: var(--clk-radius-md);
    padding: var(--clk-space-md);
}

.import-preview h3 {
    margin: 0 0 var(--clk-space-sm) 0;
    font-size: var(--clk-text-sm);
    font-weight: 600;
    color: var(--clk-text-secondary);
}

.import-preview pre {
    margin: 0;
    font-family: var(--clk-font-mono);
    font-size: var(--clk-text-sm);
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 150px;
    overflow-y: auto;
}

/* Import Result */
.import-result {
    padding: var(--clk-space-md);
    border-radius: var(--clk-radius-md);
}

.import-result--success {
    background: var(--clk-status-booked);
    border: 1px solid var(--clk-success);
}

.import-result--warnings {
    background: var(--clk-status-draft);
    border: 1px solid var(--clk-warning);
}

.import-result h3 {
    margin: 0 0 var(--clk-space-md) 0;
    font-size: var(--clk-text-base);
    font-weight: 600;
}

.import-result__stats {
    display: flex;
    gap: var(--clk-space-lg);
    margin-bottom: var(--clk-space-md);
}

.stat {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: var(--clk-text-xl);
    font-weight: 700;
}

.stat-label {
    font-size: var(--clk-text-sm);
    color: var(--clk-text-secondary);
}

.stat--success .stat-value {
    color: var(--clk-success);
}

.stat--warning .stat-value {
    color: var(--clk-warning);
}

/* Import Errors */
.import-errors {
    margin-top: var(--clk-space-md);
    padding-top: var(--clk-space-md);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.import-errors h4 {
    margin: 0 0 var(--clk-space-sm) 0;
    font-size: var(--clk-text-sm);
    font-weight: 600;
    color: var(--clk-error);
}

.import-errors ul {
    margin: 0;
    padding-left: var(--clk-space-lg);
    font-size: var(--clk-text-sm);
}

.import-errors li {
    margin-bottom: var(--clk-space-xs);
}

/* Small Spinner */
.spinner-small {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

/* ==========================================
   LAYOUT & NAVIGATION
   ========================================== */

/* Main Layout Styles */

.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--clk-sidebar-width);
    height: 100vh;
    background: var(--clk-surface);
    border-right: 1px solid var(--clk-border-light);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: width 0.2s ease, transform var(--clk-transition-normal);
}

.sidebar__header {
    display: flex;
    flex-direction: column;
}

.sidebar__header-top {
    padding: var(--clk-space-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--clk-space-sm);
    min-height: 52px;
}

.sidebar__logo {
    display: flex;
    align-items: center;
    gap: var(--clk-space-sm);
    text-decoration: none;
    color: var(--clk-text);
    min-width: 0;
    overflow: hidden;
}

.sidebar__logo-icon {
    flex-shrink: 0;
}

.sidebar__logo-text {
    font-size: var(--clk-text-lg);
    font-weight: 700;
    color: var(--clk-primary);
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.15s ease;
}

/* Collapse toggle button */
.sidebar__toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--clk-text-muted);
    padding: 6px;
    border-radius: var(--clk-radius-sm);
    transition: color var(--clk-transition-fast), background var(--clk-transition-fast);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar__toggle:hover {
    color: var(--clk-primary);
    background: var(--clk-primary-subtle);
}

.sidebar__toggle:focus-visible {
    outline: none;
    box-shadow: var(--clk-focus-ring);
}

/* Workspace area */
/* Account row: profile card + logout icon share one line */
.sidebar__account {
    display: flex;
    align-items: center;
    gap: var(--clk-space-xs);
}

.sidebar__account .sidebar__workspace {
    flex: 1;
    min-width: 0;
}

.sidebar__workspace {
    display: flex;
    align-items: center;
    gap: var(--clk-space-sm);
    padding: var(--clk-space-sm);
    margin: 0;
}

.sidebar__workspace-avatar {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: var(--clk-radius-md);
    background: var(--clk-primary);
    color: white;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.02em;
    user-select: none;
}

.sidebar__workspace-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 1px;
}

.sidebar__workspace-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--clk-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar__workspace-role {
    font-size: 11px;
    color: var(--clk-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

a.sidebar__workspace {
    text-decoration: none;
    border-radius: var(--clk-radius);
    transition: background var(--clk-transition-fast);
}

a.sidebar__workspace:hover {
    background: var(--clk-primary-subtle);
}

.sidebar__workspace-avatar--img {
    object-fit: cover;
    padding: 0;
    background: none;
}

/* ===== Profile page ===== */
.profile-account {
    display: flex;
    flex-direction: column;
    gap: var(--clk-space-lg);
}

.profile-avatar {
    display: flex;
    align-items: center;
    gap: var(--clk-space-md);
}

.profile-avatar__img,
.profile-avatar__initials {
    width: 96px;
    height: 96px;
    border-radius: var(--clk-radius-full);
    flex-shrink: 0;
}

.profile-avatar__img {
    object-fit: cover;
    border: 1px solid var(--clk-border-light);
}

.profile-avatar__initials {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--clk-primary);
    color: white;
    font-size: var(--clk-text-lg);
    font-weight: 700;
    user-select: none;
}

.profile-avatar__actions {
    display: flex;
    flex-direction: column;
    gap: var(--clk-space-sm);
}

.profile-avatar__input {
    display: none;
}

.profile-account__fields {
    flex: 1;
}

.profile-day-toggles {
    display: flex;
    flex-wrap: wrap;
    gap: var(--clk-space-sm);
}

.profile-day-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: var(--clk-space-xs) var(--clk-space-sm);
    border: 1px solid var(--clk-border-light);
    border-radius: var(--clk-radius);
    cursor: pointer;
    font-size: var(--clk-text-sm);
    user-select: none;
}

.profile-day-toggle input {
    accent-color: var(--clk-primary);
    cursor: pointer;
}

@media (min-width: 641px) {
    .profile-account {
        flex-direction: row;
        align-items: flex-start;
    }
    .profile-avatar {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

/* ===== About page ===== */
.about-page {
    display: flex;
    justify-content: center;
    padding: var(--clk-space-2xl) var(--clk-space-lg);
}

.about-card {
    position: relative;
    width: 100%;
    max-width: 620px;
    background: var(--clk-surface);
    border: 1px solid var(--clk-border-light);
    border-radius: var(--clk-radius-lg);
    box-shadow: var(--clk-shadow-md);
    padding: var(--clk-space-2xl) var(--clk-space-xl);
    overflow: hidden;
}

/* thin Deep-Ocean accent along the top edge */
.about-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--clk-primary), var(--clk-primary-light), var(--clk-accent));
}

.about-hero {
    text-align: center;
    margin-bottom: var(--clk-space-lg);
}

.about-hero__logo {
    display: inline-block;
    filter: drop-shadow(0 4px 10px rgba(30, 58, 95, 0.18));
}

.about-hero__name {
    font-size: var(--clk-text-xl);
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--clk-text);
    margin: var(--clk-space-sm) 0 var(--clk-space-xs);
}

.about-hero__tagline {
    color: var(--clk-text-secondary);
    font-size: var(--clk-text-base);
    margin: 0 auto var(--clk-space-md);
    max-width: 42ch;
    line-height: 1.5;
}

.about-hero__version {
    display: inline-block;
    padding: 3px 12px;
    border-radius: var(--clk-radius-full);
    background: var(--clk-primary-subtle);
    color: var(--clk-primary);
    font-family: var(--clk-font-mono);
    font-size: var(--clk-text-xs);
    font-weight: 600;
}

.about-lead {
    color: var(--clk-text-secondary);
    font-size: var(--clk-text-sm);
    line-height: 1.6;
    text-align: center;
    margin: 0 0 var(--clk-space-lg);
}

.about-lead__line {
    display: block;
    color: var(--clk-text);
    font-weight: 600;
    font-size: var(--clk-text-base);
    margin-bottom: var(--clk-space-xs);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--clk-space-sm);
    margin-bottom: var(--clk-space-lg);
}

.about-tile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--clk-space-md);
    padding: var(--clk-space-sm) var(--clk-space-md);
    background: var(--clk-bg);
    border: 1px solid var(--clk-border-light);
    border-radius: var(--clk-radius-md);
}

.about-tile__label {
    font-size: var(--clk-text-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--clk-text-muted);
}

.about-tile__value,
.about-tile__value a {
    font-size: var(--clk-text-sm);
    font-weight: 600;
    color: var(--clk-primary-light);
    text-decoration: none;
}

.about-tile__value a:hover {
    text-decoration: underline;
}

.about-foot {
    padding-top: var(--clk-space-md);
    border-top: 1px solid var(--clk-border-light);
    text-align: center;
    font-size: var(--clk-text-sm);
    color: var(--clk-text-muted);
}

.about-foot a {
    color: var(--clk-text-secondary);
    text-decoration: none;
}

.about-foot a:hover {
    color: var(--clk-primary);
}

/* staggered load reveal */
.about-card > * {
    animation: about-rise 0.45s ease both;
}
.about-card > .about-hero { animation-delay: 0.02s; }
.about-card > .about-lead { animation-delay: 0.08s; }
.about-card > .about-grid { animation-delay: 0.14s; }
.about-card > .about-tech { animation-delay: 0.20s; }
.about-card > .about-foot { animation-delay: 0.26s; }

@keyframes about-rise {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 560px) {
    .about-grid { grid-template-columns: repeat(2, 1fr); }
    .about-tile { flex-direction: column; align-items: flex-start; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
    .about-card > * { animation: none; }
}

/* Sidebar footer with copyright */
.sidebar__footer {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--clk-space-sm);
    border-top: 1px solid var(--clk-border-light);
    margin-top: auto;
}

/* meta group (About + copyright), visually separated from the actions above */
.sidebar__meta {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin-top: 2px;
    padding-top: var(--clk-space-sm);
    border-top: 1px solid var(--clk-border-light);
}

.sidebar__about {
    display: block;
    padding: 4px 8px;
    font-size: var(--clk-text-xs);
    color: var(--clk-text-secondary);
    text-decoration: none;
    border-radius: var(--clk-radius);
    transition: background var(--clk-transition-fast), color var(--clk-transition-fast);
    white-space: nowrap;
    overflow: hidden;
}

.sidebar__about:hover {
    background: var(--clk-primary-subtle);
    color: var(--clk-primary);
}

.sidebar__about-version {
    color: var(--clk-text-muted);
    font-family: var(--clk-font-mono);
    font-size: 10px;
}

.sidebar--collapsed .sidebar__about {
    display: none;
}

.sidebar--collapsed .sidebar__meta {
    border-top: none;
    padding-top: 0;
    align-items: center;
}

.sidebar__copyright {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    font-size: var(--clk-text-xs);
    color: var(--clk-text-muted);
    text-decoration: none;
    transition: color var(--clk-transition-fast);
    white-space: nowrap;
    overflow: hidden;
}

.sidebar__copyright:hover {
    color: var(--clk-primary-light);
}

.sidebar__copyright-symbol {
    flex-shrink: 0;
}

.sidebar__copyright-text {
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.15s ease;
}

.sidebar__logout {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: var(--clk-radius);
    color: var(--clk-text-muted);
    cursor: pointer;
    transition: background var(--clk-transition-fast), color var(--clk-transition-fast);
}

.sidebar__logout:hover {
    background: var(--clk-accent-subtle, var(--clk-primary-subtle));
    color: var(--clk-accent);
}

.sidebar__logout-icon {
    flex-shrink: 0;
}

/* --- Collapsed sidebar (desktop only) --- */

.sidebar--collapsed {
    width: 64px;
}

.sidebar--collapsed .sidebar__header-top {
    padding: var(--clk-space-sm);
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.sidebar--collapsed .sidebar__logo {
    justify-content: center;
}

.sidebar--collapsed .sidebar__logo-text {
    display: none;
}

.sidebar--collapsed .sidebar__workspace {
    justify-content: center;
    padding: 4px 8px;
    margin: 0 4px 4px;
}

.sidebar--collapsed .sidebar__workspace-avatar {
    width: 28px;
    height: 28px;
    min-width: 28px;
    font-size: 10px;
}

.sidebar--collapsed .sidebar__workspace-info {
    display: none;
}

.sidebar--collapsed .sidebar__footer {
    padding: var(--clk-space-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* No room for a row at 64px — stack avatar over the logout icon */
.sidebar--collapsed .sidebar__account {
    flex-direction: column;
    gap: 4px;
}

.sidebar--collapsed .sidebar__copyright {
    justify-content: center;
}

.sidebar--collapsed .sidebar__copyright-text {
    display: none;
}

/* Main wrapper */
.main-wrapper {
    flex: 1;
    margin-left: var(--clk-sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.2s ease;
}

.app-layout--collapsed .main-wrapper {
    margin-left: 64px;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    height: var(--clk-header-height);
    background: var(--clk-surface);
    border-bottom: 1px solid var(--clk-border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--clk-space-lg);
    z-index: 50;
}

.header__left {
    display: flex;
    align-items: center;
    gap: var(--clk-space-md);
}

.header__menu-toggle {
    display: none;
    padding: var(--clk-space-sm);
    color: var(--clk-text-secondary);
}

.header__right {
    display: flex;
    align-items: center;
    gap: var(--clk-space-md);
}

/* User menu */
.user-menu {
    display: flex;
    align-items: center;
    gap: var(--clk-space-md);
}

.user-menu__name {
    font-size: var(--clk-text-sm);
    color: var(--clk-text-secondary);
}

/* Main content */
.main-content {
    flex: 1;
    padding: var(--clk-space-lg);
    background: var(--clk-bg);
}

/* Layout responsive - Mobile */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: var(--clk-sidebar-width);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    /* On mobile, never show collapsed state */
    .sidebar--collapsed {
        width: var(--clk-sidebar-width);
    }

    .sidebar--collapsed .sidebar__header-top {
        flex-direction: row;
        padding: var(--clk-space-md);
        align-items: center;
        gap: var(--clk-space-sm);
    }

    .sidebar--collapsed .sidebar__logo-text {
        display: inline;
    }

    .sidebar--collapsed .sidebar__account {
        flex-direction: row;
        gap: var(--clk-space-xs);
    }

    .sidebar--collapsed .sidebar__workspace {
        justify-content: flex-start;
        padding: 8px 16px;
        margin: 0 0 8px;
    }

    .sidebar--collapsed .sidebar__workspace-avatar {
        width: 32px;
        height: 32px;
        min-width: 32px;
        font-size: 11px;
    }

    .sidebar--collapsed .sidebar__workspace-info {
        display: flex;
    }

    .sidebar--collapsed .sidebar__footer {
        padding: var(--clk-space-sm) var(--clk-space-md);
        display: block;
    }

    .sidebar--collapsed .sidebar__copyright {
        justify-content: flex-start;
    }

    .sidebar--collapsed .sidebar__copyright-text {
        display: inline;
    }

    .main-wrapper {
        margin-left: 0;
    }

    .app-layout--collapsed .main-wrapper {
        margin-left: 0;
    }

    .header__menu-toggle {
        display: flex;
    }
}

/* Layout reduced motion */
@media (prefers-reduced-motion: reduce) {
    .sidebar,
    .main-wrapper {
        transition: none;
    }
}

/* --- Navigation Menu --- */

.nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: var(--clk-space-xs) 0;
}

.nav__list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Section Headers */
.nav__section-header {
    padding: var(--clk-space-lg) var(--clk-space-md) var(--clk-space-xs) var(--clk-space-md);
    margin: 0 var(--clk-space-sm);
}

.nav__section-header:first-child {
    padding-top: var(--clk-space-sm);
}

.nav__section-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--clk-text-muted);
    user-select: none;
}

/* Nav Items */
.nav__item {
    margin: 0 var(--clk-space-sm);
}

/* Nav Links */
.nav__link {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    color: var(--clk-text-secondary);
    text-decoration: none;
    border-radius: var(--clk-radius);
    transition: background var(--clk-transition-fast), color var(--clk-transition-fast), box-shadow var(--clk-transition-fast);
    font-size: var(--clk-text-sm);
    font-weight: 500;
    position: relative;
    overflow: visible;
}

.nav__link--sub {
    padding-left: 32px;
    font-size: var(--clk-text-xs);
}

.nav__link--sub .nav__icon {
    width: 16px;
    height: 16px;
}

.nav--collapsed .nav__link--sub {
    padding-left: 12px;
}

.nav__link:hover {
    background: var(--clk-primary-subtle);
    color: var(--clk-primary);
}

.nav__link.active {
    background: var(--clk-primary);
    color: white;
    box-shadow: 0 1px 3px rgba(30, 58, 95, 0.3);
}

.nav__link.active:hover {
    background: var(--clk-primary-hover);
}

/* Icons - inline with text */
.nav__icon {
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    flex-shrink: 0;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    display: inline-block;
    vertical-align: middle;
}

/* Nav label */
.nav__label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Keyboard Focus */
.nav__link:focus-visible {
    outline: none;
    box-shadow: var(--clk-focus-ring);
}

/* --- Nav collapsed state --- */

.nav--collapsed .nav__section-header {
    display: none;
}

.nav--collapsed .nav__item {
    margin: 0 var(--clk-space-xs);
}

.nav--collapsed .nav__link {
    justify-content: center;
    padding: 10px;
    gap: 0;
}

.nav--collapsed .nav__label {
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--clk-text);
    color: white;
    padding: 5px 10px;
    border-radius: var(--clk-radius-sm);
    font-size: var(--clk-text-xs);
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    z-index: 200;
    box-shadow: var(--clk-shadow-md);
}

/* Tooltip arrow */
.nav--collapsed .nav__label::before {
    content: '';
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-right-color: var(--clk-text);
}

.nav--collapsed .nav__link:hover .nav__label {
    opacity: 1;
}

/* Active link tooltip should still be white-on-dark */
.nav--collapsed .nav__link.active .nav__label {
    background: var(--clk-primary);
}

.nav--collapsed .nav__link.active .nav__label::before {
    border-right-color: var(--clk-primary);
}

/* --- Nav responsive - Mobile --- */

@media (max-width: 768px) {
    .nav__section-header {
        margin: 0 var(--clk-space-xs);
    }

    .nav__item {
        margin: 0 var(--clk-space-xs);
    }

    .nav__link {
        padding: var(--clk-space-sm);
    }

    /* On mobile, never show collapsed nav styles */
    .nav--collapsed .nav__section-header {
        display: list-item;
    }

    .nav--collapsed .nav__item {
        margin: 0 var(--clk-space-xs);
    }

    .nav--collapsed .nav__link {
        justify-content: flex-start;
        padding: var(--clk-space-sm);
        gap: 12px;
    }

    .nav--collapsed .nav__label {
        position: static;
        transform: none;
        background: transparent;
        color: inherit;
        padding: 0;
        opacity: 1;
        pointer-events: auto;
        box-shadow: none;
        font-size: var(--clk-text-sm);
    }

    .nav--collapsed .nav__label::before {
        display: none;
    }
}

/* Nav reduced motion */
@media (prefers-reduced-motion: reduce) {
    .nav__link,
    .nav__label {
        transition: none;
    }
}

/* ==========================================
   LEGAL PAGES (Privacy, Terms)
   ========================================== */

.legal-page {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: var(--clk-space-xl) var(--clk-space-lg);
    background: var(--clk-bg);
}

.legal-card {
    width: 100%;
    max-width: 780px;
    background: var(--clk-surface);
    border: 1px solid var(--clk-border-light);
    border-radius: var(--clk-radius-lg);
    box-shadow: var(--clk-shadow-lg);
    padding: var(--clk-space-xl);
}

.legal-header {
    text-align: center;
    margin-bottom: var(--clk-space-xl);
    padding-bottom: var(--clk-space-lg);
    border-bottom: 1px solid var(--clk-border-light);
}

.legal-header__logo {
    font-size: 3rem;
    display: block;
    margin-bottom: var(--clk-space-sm);
}

.legal-header h1 {
    font-size: var(--clk-text-xl);
    color: var(--clk-primary);
    margin-bottom: var(--clk-space-xs);
}

.legal-header p {
    font-size: var(--clk-text-sm);
    color: var(--clk-text-muted);
}

.legal-content h2 {
    font-size: var(--clk-text-lg);
    color: var(--clk-primary);
    margin-top: var(--clk-space-xl);
    margin-bottom: var(--clk-space-sm);
    padding-bottom: var(--clk-space-xs);
    border-bottom: 1px solid var(--clk-border-light);
}

.legal-content h3 {
    font-size: var(--clk-text-md);
    color: var(--clk-text);
    margin-top: var(--clk-space-lg);
    margin-bottom: var(--clk-space-xs);
}

.legal-content p {
    font-size: var(--clk-text-base);
    color: var(--clk-text-secondary);
    line-height: 1.7;
    margin-bottom: var(--clk-space-md);
}

.legal-content ul {
    margin: var(--clk-space-sm) 0 var(--clk-space-md) var(--clk-space-lg);
    color: var(--clk-text-secondary);
    line-height: 1.7;
}

.legal-content ul li {
    margin-bottom: var(--clk-space-xs);
}

.legal-content a {
    color: var(--clk-primary-light);
}

.legal-content a:hover {
    text-decoration: underline;
}

.legal-divider {
    margin: var(--clk-space-2xl) 0;
    border: none;
    border-top: 2px solid var(--clk-border-light);
    position: relative;
}

.legal-divider::after {
    content: "English Version";
    position: absolute;
    top: -0.7em;
    left: 50%;
    transform: translateX(-50%);
    background: var(--clk-surface);
    padding: 0 var(--clk-space-md);
    font-size: var(--clk-text-sm);
    color: var(--clk-text-muted);
    font-weight: 500;
}

.legal-footer {
    text-align: center;
    margin-top: var(--clk-space-xl);
    padding-top: var(--clk-space-lg);
    border-top: 1px solid var(--clk-border-light);
    font-size: var(--clk-text-sm);
    color: var(--clk-text-secondary);
}

.legal-footer a {
    color: var(--clk-primary-light);
    font-weight: 500;
}

@media (max-width: 639px) {
    .legal-card {
        padding: var(--clk-space-lg);
    }
}

/* ==========================================
   KIOSK PAGE
   ========================================== */

.kiosk-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--clk-bg);
}

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

.kiosk-logo {
    display: flex;
    align-items: center;
    gap: var(--clk-space-sm);
}

.kiosk-title {
    font-size: var(--clk-text-lg);
    font-weight: 600;
}

.kiosk-subtitle {
    font-size: var(--clk-text-sm);
    opacity: 0.8;
}

.kiosk-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kiosk-footer {
    padding: var(--clk-space-md);
    text-align: center;
    background: var(--clk-surface);
    border-top: 1px solid var(--clk-border-light);
}

.kiosk-exit {
    display: inline-flex;
    align-items: center;
    gap: var(--clk-space-xs);
    color: var(--clk-text-secondary);
    text-decoration: none;
    font-size: var(--clk-text-sm);
    padding: var(--clk-space-sm) var(--clk-space-md);
    border-radius: var(--clk-radius);
    transition: all 0.15s;
}

.kiosk-exit:hover {
    background: var(--clk-bg);
    color: var(--clk-text);
}

/* ==========================================
   CUSTOMERS & PROJECTS PAGE LAYOUT
   ========================================== */

/* Mobile-first: base is mobile padding */
.page-customers,
.page-projects {
    display: flex;
    flex-direction: column;
    gap: var(--clk-space-lg);
    padding: var(--clk-space-md);
    max-width: 1400px;
    margin: 0 auto;
}

@media (min-width: 769px) {
    .page-customers,
    .page-projects {
        padding: var(--clk-space-lg);
    }
}

/* ==========================================
   SETTINGS PAGE
   ========================================== */

/* Mobile-first base styles */
.settings-page {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--clk-space-md);
}

.settings-page__header {
    margin-bottom: var(--clk-space-lg);
    padding-bottom: var(--clk-space-md);
    border-bottom: 1px solid var(--clk-border-light);
}

.settings-page__title {
    font-size: var(--clk-text-xl);
    font-weight: 700;
    color: var(--clk-text);
    margin: 0 0 var(--clk-space-xs);
}

.settings-page__subtitle {
    font-size: var(--clk-text-base);
    color: var(--clk-text-secondary);
    margin: 0;
}

/* Loading State */
.settings-page__loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--clk-space-md);
    padding: var(--clk-space-2xl);
    color: var(--clk-text-secondary);
}

.settings-page__spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--clk-border-light);
    border-top-color: var(--clk-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Error State */
.settings-page__error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--clk-space-md);
    padding: var(--clk-space-2xl);
    color: var(--clk-text-secondary);
    text-align: center;
}

.settings-page__error svg {
    color: var(--clk-error);
}

/* Section */
.settings-page__section {
    background: var(--clk-surface);
    border: 1px solid var(--clk-border-light);
    border-radius: var(--clk-radius-lg);
    box-shadow: var(--clk-shadow-sm);
    margin-bottom: var(--clk-space-lg);
    overflow: hidden;
}

.settings-page__section-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--clk-space-sm);
    padding: var(--clk-space-md) var(--clk-space-lg);
    background: var(--clk-bg);
    border-bottom: 1px solid var(--clk-border-light);
}

.settings-page__section-title {
    display: flex;
    align-items: center;
    gap: var(--clk-space-sm);
    font-size: var(--clk-text-md);
    font-weight: 600;
    color: var(--clk-text);
    margin: 0;
}

.settings-page__section-title svg {
    color: var(--clk-primary);
}

.settings-page__section-badge {
    font-size: var(--clk-text-xs);
    font-weight: 500;
    padding: var(--clk-space-xs) var(--clk-space-sm);
    border-radius: var(--clk-radius-full);
    background: var(--clk-border-light);
    color: var(--clk-text-secondary);
}

.settings-page__section-badge--active {
    background: var(--clk-success);
    color: white;
}

.settings-page__section-content {
    padding: var(--clk-space-lg);
}

/* Info Box */
.settings-page__info-box {
    display: flex;
    align-items: flex-start;
    gap: var(--clk-space-sm);
    padding: var(--clk-space-md);
    background: var(--clk-primary-subtle);
    border-radius: var(--clk-radius);
    margin-bottom: var(--clk-space-lg);
}

.settings-page__info-box svg {
    flex-shrink: 0;
    color: var(--clk-primary);
    margin-top: 2px;
}

.settings-page__info-box p {
    margin: 0;
    font-size: var(--clk-text-sm);
    color: var(--clk-text-secondary);
    line-height: 1.5;
}

/* Form Grid -- mobile-first: single column */
.settings-page__form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--clk-space-md);
}

.settings-page__form-stack {
    display: flex;
    flex-direction: column;
    gap: var(--clk-space-md);
}

/* Form Group */
.settings-page__form-group {
    display: flex;
    flex-direction: column;
    gap: var(--clk-space-xs);
}

.settings-page__form-group--inline {
    flex-direction: column;
    align-items: flex-start;
}

.settings-page__label {
    font-size: var(--clk-text-sm);
    font-weight: 500;
    color: var(--clk-text);
}

.settings-page__input,
.settings-page__select {
    width: 100%;
    padding: var(--clk-space-sm) var(--clk-space-md);
    font-size: var(--clk-text-base);
    font-family: inherit;
    color: var(--clk-text);
    background: var(--clk-surface);
    border: 1px solid var(--clk-border-light);
    border-radius: var(--clk-radius);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.settings-page__input:hover,
.settings-page__select:hover {
    border-color: var(--clk-border);
}

.settings-page__input:focus,
.settings-page__select:focus {
    outline: none;
    border-color: var(--clk-primary-light);
    box-shadow: var(--clk-focus-ring);
}

/* Mobile-first: narrow input is full width */
.settings-page__input--narrow {
    width: 100%;
}

.settings-page__input-with-suffix {
    display: flex;
    align-items: center;
    gap: var(--clk-space-sm);
}

.settings-page__suffix {
    font-size: var(--clk-text-sm);
    color: var(--clk-text-secondary);
    white-space: nowrap;
}

.settings-page__input-group {
    display: flex;
    align-items: stretch;
}

.settings-page__input-group .settings-page__input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    flex: 1;
}

.settings-page__input-button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 var(--clk-space-md);
    background: var(--clk-bg);
    border: 1px solid var(--clk-border-light);
    border-left: none;
    border-radius: 0 var(--clk-radius) var(--clk-radius) 0;
    color: var(--clk-text-secondary);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.settings-page__input-button:hover {
    background: var(--clk-border-light);
    color: var(--clk-text);
}

.settings-page__hint {
    font-size: var(--clk-text-xs);
    color: var(--clk-text-muted);
    line-height: 1.4;
}

/* Checkbox */
.settings-page__checkbox {
    display: flex;
    align-items: flex-start;
    gap: var(--clk-space-sm);
    cursor: pointer;
    padding: var(--clk-space-sm);
    margin: calc(-1 * var(--clk-space-sm));
    border-radius: var(--clk-radius);
    transition: background 0.15s;
}

.settings-page__checkbox:hover {
    background: var(--clk-bg);
}

.settings-page__checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--clk-primary);
    cursor: pointer;
}

.settings-page__checkbox-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.settings-page__checkbox-label strong {
    font-size: var(--clk-text-base);
    font-weight: 500;
    color: var(--clk-text);
}

.settings-page__checkbox-hint {
    font-size: var(--clk-text-sm);
    color: var(--clk-text-secondary);
    line-height: 1.4;
}

/* Actions */
.settings-page__actions {
    display: flex;
    justify-content: flex-end;
    margin-top: var(--clk-space-lg);
    padding-top: var(--clk-space-lg);
    border-top: 1px solid var(--clk-border-light);
}

/* Settings Button spinner */
.btn__spinner {
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: var(--clk-space-xs);
}

/* Desktop overrides for Settings */
@media (min-width: 641px) {
    .settings-page {
        padding: var(--clk-space-lg);
    }

    .settings-page__section-header {
        flex-direction: row;
        align-items: center;
        gap: var(--clk-space-md);
        justify-content: space-between;
    }

    .settings-page__form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: var(--clk-space-lg);
        row-gap: var(--clk-space-md);
    }

    .settings-page__form-group--inline {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: var(--clk-space-md);
    }

    .settings-page__input--narrow {
        width: 100px;
    }
}


/* ==========================================
   DATA LIST COMPONENTS (Shared)
   ========================================== */

/* --- Search --- */

.search-icon {
    position: absolute;
    left: var(--clk-space-sm);
    top: 50%;
    transform: translateY(-50%);
    color: var(--clk-text-muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: var(--clk-space-sm) var(--clk-space-sm) var(--clk-space-sm) 40px;
    border: 1px solid var(--clk-border-light);
    border-radius: var(--clk-radius);
    font-size: var(--clk-text-base);
    background: var(--clk-surface);
    transition: border-color var(--clk-transition-fast), box-shadow var(--clk-transition-fast);
}

.search-input:focus {
    outline: none;
    border-color: var(--clk-primary-light);
    box-shadow: var(--clk-focus-ring);
}

/* --- Filter Controls --- */

.filter-toggle {
    display: flex;
    align-items: center;
    gap: var(--clk-space-xs);
    font-size: var(--clk-text-sm);
    color: var(--clk-text-secondary);
    cursor: pointer;
}

.filter-toggle input {
    cursor: pointer;
}

.filter-select {
    padding: var(--clk-space-sm) var(--clk-space-md);
    border: 1px solid var(--clk-border-light);
    border-radius: var(--clk-radius);
    font-size: var(--clk-text-sm);
    background: var(--clk-surface);
    min-width: 150px;
    cursor: pointer;
}

.filter-select:focus {
    outline: none;
    border-color: var(--clk-primary-light);
    box-shadow: var(--clk-focus-ring);
}

.header-buttons {
    display: flex;
    gap: var(--clk-space-sm);
    margin-left: auto;
}

/* --- Spinner (32px, used in list loading states) --- */

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--clk-border-light);
    border-top-color: var(--clk-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* --- Color Dot (base definition) --- */

.color-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: var(--clk-space-sm);
    flex-shrink: 0;
}

/* --- Actions Column --- */

.actions-column {
    width: 100px;
    text-align: right;
}

.action-buttons {
    display: flex;
    gap: var(--clk-space-xs);
    justify-content: flex-end;
}

.btn-icon--danger:hover {
    background: var(--clk-error-light);
    color: var(--clk-error);
}

/* --- Pagination --- */

.pagination-info {
    font-size: var(--clk-text-sm);
    color: var(--clk-text-secondary);
}

/* --- Status Badge Small (ProjectList) --- */

.status-badge--small {
    padding: 2px 6px;
    font-size: 10px;
}

/* --- Shared Loading / Error / Empty States --- */

.customer-list__loading,
.project-list__loading,
.user-list__loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--clk-space-md);
    padding: var(--clk-space-2xl);
    color: var(--clk-text-secondary);
}

.customer-list__error,
.project-list__error,
.user-list__error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--clk-space-md);
    padding: var(--clk-space-2xl);
    color: var(--clk-error);
    text-align: center;
}

.customer-list__empty,
.project-list__empty,
.user-list__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--clk-space-md);
    padding: var(--clk-space-2xl);
    color: var(--clk-text-secondary);
    text-align: center;
}

.customer-list__empty svg,
.project-list__empty svg,
.user-list__empty svg {
    color: var(--clk-text-muted);
}

.customer-list__empty p,
.project-list__empty p,
.user-list__empty p {
    margin: 0;
    font-size: var(--clk-text-md);
}

.customer-list__empty-hint,
.project-list__empty-hint,
.user-list__empty-hint {
    font-size: var(--clk-text-sm);
    color: var(--clk-text-muted);
}

/* --- Shared Pagination --- */

.customer-list__pagination,
.project-list__pagination,
.user-list__pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--clk-space-md);
    padding-top: var(--clk-space-md);
    border-top: 1px solid var(--clk-border-light);
}

/* ==========================================
   CUSTOMER LIST
   ========================================== */

.customer-list {
    display: flex;
    flex-direction: column;
    gap: var(--clk-space-lg);
}

.customer-list__header {
    display: flex;
    align-items: center;
    gap: var(--clk-space-md);
    flex-wrap: wrap;
}

.customer-list__search {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 400px;
}

.customer-list__filters {
    display: flex;
    align-items: center;
    gap: var(--clk-space-md);
}

.customer-list__table-wrapper {
    overflow-x: auto;
}

/* ==========================================
   DATA TABLES (shared: customers, projects, users)
   One source of truth so list tables stay consistent.
   Per-table column widths live in the responsive nth-child rules below.
   ========================================== */

.customer-table,
.project-table,
.user-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--clk-text-sm);
}

.customer-table th,
.project-table th,
.user-table th {
    padding: var(--clk-space-sm) var(--clk-space-md);
    text-align: left;
    font-weight: 600;
    color: var(--clk-text-secondary);
    background: var(--clk-bg);
    border-bottom: 2px solid var(--clk-border-light);
    white-space: nowrap;
}

.customer-table td,
.project-table td,
.user-table td {
    padding: var(--clk-space-sm) var(--clk-space-md);
    border-bottom: 1px solid var(--clk-border-light);
    vertical-align: middle;
}

.customer-table tbody tr:hover,
.project-table tbody tr:hover,
.user-table tbody tr:hover {
    background: var(--clk-primary-subtle);
}

.customer-table tbody tr.inactive,
.project-table tbody tr.inactive,
.user-table tbody tr.inactive {
    opacity: 0.6;
}

.customer-table tbody tr.customer-row,
.project-table tbody tr.project-row,
.user-table tbody tr.user-row {
    cursor: pointer;
}

/* Name cells must stay real table cells (NOT display:flex, which drops the cell
   out of the row model and misaligns dividers). Inline layout goes on an inner
   wrapper (e.g. .project-name-wrapper). */
.customer-name,
.project-name,
.user-name {
    font-weight: 500;
}

.customer-code {
    font-family: var(--clk-font-mono);
    color: var(--clk-text-secondary);
}

/* Total tracked hours column (customers + projects lists) */
.hours-cell {
    font-family: var(--clk-font-mono);
    font-size: var(--clk-text-sm);
    color: var(--clk-text-secondary);
    white-space: nowrap;
}

/* Clickable project-count -> jump to that customer's projects */
.projects-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    margin: -2px -6px;
    background: transparent;
    border: none;
    border-radius: var(--clk-radius-sm);
    color: var(--clk-primary-light);
    font-size: inherit;
    font-family: inherit;
    cursor: pointer;
    transition: background var(--clk-transition-fast), color var(--clk-transition-fast);
}

.projects-link:hover {
    background: var(--clk-primary-subtle);
    color: var(--clk-primary);
    text-decoration: underline;
}

.projects-link svg {
    opacity: 0.6;
}

/* ==========================================
   PROJECT LIST
   ========================================== */

.project-list {
    display: flex;
    flex-direction: column;
    gap: var(--clk-space-lg);
}

.project-list__header {
    display: flex;
    align-items: center;
    gap: var(--clk-space-md);
    flex-wrap: wrap;
}

.project-list__search {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 400px;
}

.project-list__filters {
    display: flex;
    align-items: center;
    gap: var(--clk-space-md);
}

.project-list__table-wrapper {
    overflow-x: auto;
}

.project-name-wrapper {
    display: flex;
    align-items: center;
    gap: var(--clk-space-xs);
    font-weight: 500;
}

.billable-badge {
    display: inline-flex;
    padding: 2px 4px;
    font-size: 9px;
    font-weight: 600;
    background: var(--clk-success);
    color: white;
    border-radius: var(--clk-radius-sm);
}

.project-customer {
    color: var(--clk-text-secondary);
}

.project-code {
    font-family: var(--clk-font-mono);
    color: var(--clk-text-secondary);
}

/* --- Subprojects Toggle --- */

.subprojects-toggle {
    display: inline-flex;
    align-items: center;
    gap: var(--clk-space-xs);
    padding: var(--clk-space-xs) var(--clk-space-sm);
    background: transparent;
    border: 1px solid var(--clk-border-light);
    border-radius: var(--clk-radius);
    font-size: var(--clk-text-sm);
    color: var(--clk-text-secondary);
    cursor: pointer;
    transition: all var(--clk-transition-fast);
}

.subprojects-toggle:hover {
    background: var(--clk-bg);
    border-color: var(--clk-border);
}

.subprojects-toggle svg {
    transition: transform var(--clk-transition-fast);
}

.subprojects-toggle svg.expanded {
    transform: rotate(90deg);
}

/* --- Subproject Row --- */

.subproject-row {
    background: var(--clk-bg);
}

.subproject-row:hover {
    background: var(--clk-primary-subtle) !important;
}

.subproject-name {
    display: flex;
    align-items: center;
    gap: var(--clk-space-sm);
    padding-left: var(--clk-space-xl) !important;
}

.subproject-indent {
    width: 20px;
    height: 1px;
    background: var(--clk-border-light);
}

.subproject-code {
    font-family: var(--clk-font-mono);
    font-size: var(--clk-text-xs);
    color: var(--clk-text-muted);
}

/* ==========================================
   USER LIST
   ========================================== */

.user-list {
    display: flex;
    flex-direction: column;
    gap: var(--clk-space-lg);
}

.user-list__header {
    display: flex;
    align-items: center;
    gap: var(--clk-space-md);
    flex-wrap: wrap;
}

.user-list__search {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 400px;
}

.user-list__filters {
    display: flex;
    align-items: center;
    gap: var(--clk-space-md);
}

.user-list__table-wrapper {
    overflow-x: auto;
}

.user-email {
    color: var(--clk-text-secondary);
}

.user-date {
    color: var(--clk-text-muted);
    white-space: nowrap;
}

/* --- Role Badges --- */

.role-badge {
    display: inline-flex;
    padding: var(--clk-space-xs) var(--clk-space-sm);
    font-size: var(--clk-text-xs);
    font-weight: 500;
    border-radius: var(--clk-radius-full);
}

.role-badge--admin {
    background: var(--clk-role-admin-bg);
    color: var(--clk-role-admin-text);
}

.role-badge--projektleiter {
    background: var(--clk-role-pm-bg);
    color: var(--clk-role-pm-text);
}

.role-badge--mitarbeiter {
    background: var(--clk-bg);
    color: var(--clk-text-secondary);
    border: 1px solid var(--clk-border-light);
}

/* ==========================================
   WEBSITE LOOKUP DIALOG
   ========================================== */

.lookup-dialog {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--clk-surface);
}

.lookup-dialog__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--clk-space-md) var(--clk-space-lg);
    border-bottom: 1px solid var(--clk-border-light);
}

.lookup-dialog__header h2 {
    font-size: var(--clk-text-lg);
    font-weight: 600;
    color: var(--clk-text);
    margin: 0;
}

.lookup-dialog__content {
    flex: 1;
    padding: var(--clk-space-lg);
    overflow-y: auto;
}

.lookup-dialog__footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--clk-space-sm);
    padding: var(--clk-space-md) var(--clk-space-lg);
    border-top: 1px solid var(--clk-border-light);
    background: var(--clk-bg);
}

/* Intro Section */

.lookup-dialog__intro {
    text-align: center;
    padding: var(--clk-space-lg) 0;
}

.lookup-dialog__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    margin: 0 auto var(--clk-space-md);
    background: var(--clk-primary-subtle);
    border-radius: 50%;
    color: var(--clk-primary);
}

.lookup-dialog__intro h3 {
    font-size: var(--clk-text-md);
    font-weight: 600;
    color: var(--clk-text);
    margin: 0 0 var(--clk-space-sm);
}

.lookup-dialog__intro p {
    font-size: var(--clk-text-sm);
    color: var(--clk-text-secondary);
    line-height: 1.5;
    max-width: 400px;
    margin: 0 auto;
}

/* Form */

.lookup-dialog__form {
    margin-top: var(--clk-space-lg);
}

.lookup-dialog__label {
    display: block;
    font-size: var(--clk-text-sm);
    font-weight: 500;
    color: var(--clk-text);
    margin-bottom: var(--clk-space-xs);
}

.lookup-dialog__input-group {
    display: flex;
    align-items: stretch;
}

.lookup-dialog__prefix {
    display: flex;
    align-items: center;
    padding: 0 var(--clk-space-md);
    font-size: var(--clk-text-sm);
    color: var(--clk-text-secondary);
    background: var(--clk-bg);
    border: 1px solid var(--clk-border-light);
    border-right: none;
    border-radius: var(--clk-radius) 0 0 var(--clk-radius);
}

.lookup-dialog__input {
    flex: 1;
    padding: var(--clk-space-sm) var(--clk-space-md);
    font-size: var(--clk-text-base);
    font-family: inherit;
    color: var(--clk-text);
    background: var(--clk-surface);
    border: 1px solid var(--clk-border-light);
    border-radius: 0 var(--clk-radius) var(--clk-radius) 0;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.lookup-dialog__input:hover {
    border-color: var(--clk-border);
}

.lookup-dialog__input:focus {
    outline: none;
    border-color: var(--clk-primary-light);
    box-shadow: var(--clk-focus-ring);
}

.lookup-dialog__hint {
    display: block;
    font-size: var(--clk-text-xs);
    color: var(--clk-text-muted);
    margin-top: var(--clk-space-xs);
}

/* Info Banner */

.lookup-dialog__info {
    display: flex;
    align-items: flex-start;
    gap: var(--clk-space-md);
    padding: var(--clk-space-md);
    margin-bottom: var(--clk-space-md);
    background: var(--clk-primary-subtle);
    border-radius: var(--clk-radius-md);
    border: 1px solid var(--clk-primary-light);
}

.lookup-dialog__info svg {
    flex-shrink: 0;
    color: var(--clk-primary);
    margin-top: 2px;
}

.lookup-dialog__info strong {
    display: block;
    font-size: var(--clk-text-sm);
    font-weight: 600;
    color: var(--clk-primary);
    margin-bottom: var(--clk-space-xs);
}

.lookup-dialog__info p {
    font-size: var(--clk-text-sm);
    color: var(--clk-text-secondary);
    margin: 0;
    line-height: 1.4;
}

/* Error */

.lookup-dialog__error {
    display: flex;
    align-items: flex-start;
    gap: var(--clk-space-sm);
    padding: var(--clk-space-md);
    margin-top: var(--clk-space-md);
    background: rgba(197, 48, 48, 0.1);
    border-radius: var(--clk-radius);
    color: var(--clk-error);
    font-size: var(--clk-text-sm);
}

.lookup-dialog__error svg {
    flex-shrink: 0;
    margin-top: 2px;
}

/* Loading */

.lookup-dialog__loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--clk-space-2xl);
    text-align: center;
}

.lookup-dialog__spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--clk-border-light);
    border-top-color: var(--clk-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: var(--clk-space-lg);
}

.lookup-dialog__loading p {
    font-size: var(--clk-text-md);
    font-weight: 500;
    color: var(--clk-text);
    margin: 0 0 var(--clk-space-xs);
}

.lookup-dialog__loading-hint {
    font-size: var(--clk-text-sm);
    color: var(--clk-text-muted);
}

/* Preview */

.lookup-dialog__preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--clk-space-lg);
}

.lookup-dialog__preview-header h3 {
    font-size: var(--clk-text-md);
    font-weight: 600;
    color: var(--clk-text);
    margin: 0;
}

.lookup-dialog__confidence {
    display: flex;
    align-items: center;
    gap: var(--clk-space-sm);
}

.lookup-dialog__confidence-label {
    font-size: var(--clk-text-xs);
    color: var(--clk-text-secondary);
}

.lookup-dialog__confidence-bar {
    width: 60px;
    height: 6px;
    background: var(--clk-border-light);
    border-radius: var(--clk-radius-full);
    overflow: hidden;
}

.lookup-dialog__confidence-fill {
    height: 100%;
    background: var(--clk-success);
    border-radius: var(--clk-radius-full);
    transition: width 0.3s ease;
}

.lookup-dialog__confidence-value {
    font-size: var(--clk-text-xs);
    font-weight: 500;
    color: var(--clk-text-secondary);
    min-width: 32px;
}

/* Data Grid */

.lookup-dialog__data {
    display: flex;
    flex-direction: column;
    gap: var(--clk-space-sm);
    background: var(--clk-bg);
    border-radius: var(--clk-radius-md);
    padding: var(--clk-space-md);
}

.lookup-dialog__data-row {
    display: flex;
    padding: var(--clk-space-sm) 0;
    border-bottom: 1px solid var(--clk-border-light);
}

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

.lookup-dialog__data-label {
    flex: 0 0 100px;
    font-size: var(--clk-text-sm);
    font-weight: 500;
    color: var(--clk-text-secondary);
}

.lookup-dialog__data-value {
    flex: 1;
    font-size: var(--clk-text-sm);
    color: var(--clk-text);
    line-height: 1.5;
}

.lookup-dialog__data-value--empty {
    color: var(--clk-text-muted);
    font-style: italic;
}

/* Source URL */

.lookup-dialog__source {
    display: flex;
    align-items: center;
    gap: var(--clk-space-xs);
    margin-top: var(--clk-space-md);
    padding: var(--clk-space-sm) var(--clk-space-md);
    background: var(--clk-bg);
    border-radius: var(--clk-radius);
    color: var(--clk-text-muted);
    font-size: var(--clk-text-xs);
}

.lookup-dialog__source svg {
    flex-shrink: 0;
}

/* ==========================================
   DATA LIST RESPONSIVE (Mobile-First)
   ========================================== */

/* Base (mobile): list headers stack vertically, search fills width */

.customer-list__header,
.project-list__header,
.user-list__header {
    flex-direction: column;
    align-items: stretch;
}

.customer-list__search,
.project-list__search,
.user-list__search {
    max-width: none;
}

.customer-list__filters,
.project-list__filters,
.user-list__filters {
    justify-content: space-between;
}

/* Base (mobile): hide non-essential table columns */

/* CustomerList: hide 3rd + 4th columns on mobile */
.customer-table th:nth-child(3),
.customer-table td:nth-child(3),
.customer-table th:nth-child(4),
.customer-table td:nth-child(4) {
    display: none;
}

/* ProjectList: hide 3rd, 4th, 5th columns on mobile */
.project-table th:nth-child(3),
.project-table td:nth-child(3),
.project-table th:nth-child(4),
.project-table td:nth-child(4),
.project-table th:nth-child(5),
.project-table td:nth-child(5) {
    display: none;
}

/* UserList: hide 3rd, 4th, 6th columns on mobile */
.user-table th:nth-child(3),
.user-table td:nth-child(3),
.user-table th:nth-child(4),
.user-table td:nth-child(4),
.user-table th:nth-child(6),
.user-table td:nth-child(6) {
    display: none;
}

/* WebsiteLookupDialog: mobile base */
.lookup-dialog__content {
    padding: var(--clk-space-md);
}

.lookup-dialog__intro {
    padding: var(--clk-space-md) 0;
}

.lookup-dialog__icon {
    width: 64px;
    height: 64px;
}

.lookup-dialog__icon svg {
    width: 32px;
    height: 32px;
}

.lookup-dialog__data-row {
    flex-direction: column;
    gap: var(--clk-space-xs);
}

.lookup-dialog__data-label {
    flex: none;
}

.lookup-dialog__confidence {
    flex-wrap: wrap;
}

/* ProjectList filters: wrap on mobile */
.project-list__filters {
    flex-wrap: wrap;
}

/* Small tablet (481px+): show CustomerList 3rd col, UserList 3rd col */
@media (min-width: 481px) {
    .customer-table th:nth-child(3),
    .customer-table td:nth-child(3) {
        display: table-cell;
    }

    .user-table th:nth-child(3),
    .user-table td:nth-child(3) {
        display: table-cell;
    }
}

/* Tablet (641px+): show ProjectList 3rd + 4th col, WebsiteLookupDialog desktop layout */
@media (min-width: 641px) {
    .project-table th:nth-child(3),
    .project-table td:nth-child(3),
    .project-table th:nth-child(4),
    .project-table td:nth-child(4) {
        display: table-cell;
    }

    /* WebsiteLookupDialog: desktop overrides */
    .lookup-dialog__content {
        padding: var(--clk-space-lg);
    }

    .lookup-dialog__intro {
        padding: var(--clk-space-lg) 0;
    }

    .lookup-dialog__icon {
        width: 80px;
        height: 80px;
    }

    .lookup-dialog__icon svg {
        width: auto;
        height: auto;
    }

    .lookup-dialog__data-row {
        flex-direction: row;
        gap: 0;
    }

    .lookup-dialog__data-label {
        flex: 0 0 100px;
    }

    .lookup-dialog__confidence {
        flex-wrap: nowrap;
    }
}

/* Desktop (769px+): full header layout, show remaining columns */
@media (min-width: 769px) {
    .customer-list__header,
    .project-list__header,
    .user-list__header {
        flex-direction: row;
        align-items: center;
    }

    .customer-list__search,
    .project-list__search,
    .user-list__search {
        max-width: 400px;
    }

    /* CustomerList: show 4th column */
    .customer-table th:nth-child(4),
    .customer-table td:nth-child(4) {
        display: table-cell;
    }

    /* ProjectList: show 5th column */
    .project-table th:nth-child(5),
    .project-table td:nth-child(5) {
        display: table-cell;
    }

    /* UserList: show 4th + 6th columns */
    .user-table th:nth-child(4),
    .user-table td:nth-child(4),
    .user-table th:nth-child(6),
    .user-table td:nth-child(6) {
        display: table-cell;
    }
}

/* ==========================================
   TIME ENTRY PAGE
   ========================================== */

/* --- Time Entry Page --- */

.time-entry-page {
    display: flex;
    flex-direction: column;
    gap: var(--clk-space-lg);
    padding: var(--clk-space-md);
    height: 100%;
    overflow: hidden;
}

.time-entry-page__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.time-entry-page__view-toggle {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 2px;
    background: var(--clk-bg);
    border: 1px solid var(--clk-border-light);
    border-radius: var(--clk-radius);
}

.view-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: var(--clk-radius-sm);
    cursor: pointer;
    color: var(--clk-text-muted);
    transition: all var(--clk-transition-fast);
}

.view-toggle-btn:hover {
    background: var(--clk-surface);
    color: var(--clk-text-secondary);
}

.view-toggle-btn:focus-visible {
    outline: none;
    box-shadow: var(--clk-focus-ring);
}

.view-toggle-btn--active {
    background: var(--clk-surface);
    color: var(--clk-primary);
    box-shadow: var(--clk-shadow-sm);
}

.time-entry-page__title {
    font-size: var(--clk-text-xl);
    font-weight: 700;
    color: var(--clk-text);
    margin: 0;
}

.time-entry-page__content {
    display: grid;
    grid-template-rows: 1fr;
    gap: var(--clk-space-lg);
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.time-entry-page__form-section {
    min-height: auto;
}

.time-entry-page__form-section--compact {
    min-height: auto;
    padding: var(--clk-space-lg);
    background: var(--clk-surface);
    border-radius: var(--clk-radius-lg);
    box-shadow: var(--clk-shadow);
}

.time-entry-page__list-section {
    display: none;
    min-height: 0;
    overflow: hidden;
}

/* Today's entries section */
.time-entry-list {
    background: var(--clk-surface);
    border-radius: var(--clk-radius-lg);
    box-shadow: var(--clk-shadow);
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.time-entry-list__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--clk-space-md) var(--clk-space-lg);
    border-bottom: 1px solid var(--clk-border-light);
    background: var(--clk-bg);
}

.time-entry-list__title {
    font-size: var(--clk-text-md);
    font-weight: 600;
    color: var(--clk-text);
    margin: 0;
}

.time-entry-list__total {
    display: flex;
    align-items: center;
    gap: var(--clk-space-sm);
    font-size: var(--clk-text-sm);
    color: var(--clk-text-secondary);
}

.time-entry-list__total-value {
    font-weight: 600;
    font-family: var(--clk-font-mono);
    color: var(--clk-text);
}

.time-entry-list__content {
    flex: 1;
    overflow-y: auto;
}

.time-entry-list__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--clk-space-2xl);
    color: var(--clk-text-muted);
    text-align: center;
    gap: var(--clk-space-sm);
}

.time-entry-list__empty-icon {
    font-size: 2.5rem;
    opacity: 0.5;
}

.time-entry-list__empty-hint {
    font-size: var(--clk-text-xs);
}

.time-entry-list__actions-col {
    width: 100px;
}

.time-entry-list__table {
    width: 100%;
    border-collapse: collapse;
}

.time-entry-list__table th {
    padding: var(--clk-space-sm) var(--clk-space-md);
    font-size: var(--clk-text-sm);
    font-weight: 600;
    text-align: left;
    color: var(--clk-text-secondary);
    background: var(--clk-bg);
    border-bottom: 1px solid var(--clk-border-light);
    position: sticky;
    top: 0;
}

.time-entry-list__table td {
    padding: var(--clk-space-sm) var(--clk-space-md);
    font-size: var(--clk-text-sm);
    border-bottom: 1px solid var(--clk-border-light);
    vertical-align: middle;
}

.time-entry-list__table tr:hover {
    background: var(--clk-primary-subtle);
}

.time-entry-list__row--clickable {
    cursor: pointer;
}

.time-entry-list__table tr:last-child td {
    border-bottom: none;
}

.time-entry-list__project {
    display: flex;
    align-items: center;
    gap: var(--clk-space-sm);
}

.time-entry-list__project-color {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.time-entry-list__project-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.time-entry-list__project-name {
    font-weight: 500;
    color: var(--clk-text);
}

.time-entry-list__customer-name {
    font-size: var(--clk-text-xs);
    color: var(--clk-text-muted);
}

.time-entry-list__subproject {
    font-size: var(--clk-text-xs);
    color: var(--clk-text-muted);
    padding: 2px 6px;
    background: var(--clk-bg);
    border-radius: var(--clk-radius-sm);
}

.time-entry-list__duration {
    font-family: var(--clk-font-mono);
    font-weight: 500;
    color: var(--clk-text);
}

.time-entry-list__time {
    font-family: var(--clk-font-mono);
    color: var(--clk-text-secondary);
    white-space: nowrap;
}

.time-entry-list__description {
    display: block;
    max-width: 520px;
    /* Preserve manual line breaks from the description; still wrap long lines. */
    white-space: pre-line;
    overflow-wrap: anywhere;
    color: var(--clk-text-secondary);
}

.time-entry-list__status {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: var(--clk-text-xs);
    font-weight: 500;
    border-radius: var(--clk-radius-full);
}

.time-entry-list__status--draft {
    background: var(--clk-status-draft);
    color: var(--clk-status-draft-text);
}

.time-entry-list__status--committed {
    background: var(--clk-status-committed);
    color: var(--clk-status-committed-text);
}

.time-entry-list__status--booked {
    background: var(--clk-status-booked);
    color: var(--clk-status-booked-text);
}

.time-entry-list__actions {
    display: flex;
    align-items: center;
    gap: var(--clk-space-xs);
}

.time-entry-list__action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    border-radius: var(--clk-radius);
    cursor: pointer;
    color: var(--clk-text-muted);
    transition: all var(--clk-transition-fast);
}

.time-entry-list__action-btn:hover {
    background: var(--clk-bg);
    color: var(--clk-text);
}

.time-entry-list__action-btn:focus-visible {
    outline: none;
    box-shadow: var(--clk-focus-ring);
}

.time-entry-list__action-btn--danger:hover {
    background: rgba(197, 48, 48, 0.1);
    color: var(--clk-error);
}

.time-entry-list__action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading state */
.time-entry-list__loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--clk-space-xl);
}

.time-entry-list__spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--clk-border-light);
    border-top-color: var(--clk-primary);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

/* Calendar mode */
.time-entry-page--calendar {
    gap: var(--clk-space-md);
}

.time-entry-page__calendar-content {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* User Switch Banner */
.user-switch__trigger {
    display: inline-flex;
    align-items: center;
    gap: var(--clk-space-sm);
    padding: var(--clk-space-xs) 0;
    background: none;
    border: none;
    color: var(--clk-primary-light);
    font-size: var(--clk-text-sm);
    cursor: pointer;
    transition: color var(--clk-transition-fast);
}

.user-switch__trigger:hover {
    color: var(--clk-primary);
}

.user-switch--selecting {
    display: flex;
    align-items: center;
    gap: var(--clk-space-sm);
    padding: var(--clk-space-xs) 0;
}

.user-switch__label {
    font-size: var(--clk-text-sm);
    font-weight: 500;
    color: var(--clk-text-secondary);
    white-space: nowrap;
}

.user-switch__autocomplete {
    position: relative;
    flex: 1;
    max-width: 320px;
}

.user-switch__input {
    width: 100%;
    padding: var(--clk-space-xs) var(--clk-space-sm);
    font-size: var(--clk-text-sm);
    border: 1px solid var(--clk-border);
    border-radius: var(--clk-radius);
    background: var(--clk-surface);
    color: var(--clk-text);
}

.user-switch__input:focus {
    outline: none;
    border-color: var(--clk-primary-light);
    box-shadow: var(--clk-focus-ring);
}

.user-switch__dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 200px;
    overflow-y: auto;
    background: var(--clk-surface);
    border: 1px solid var(--clk-border);
    border-top: none;
    border-radius: 0 0 var(--clk-radius) var(--clk-radius);
    box-shadow: var(--clk-shadow-md);
    list-style: none;
    margin: 0;
    padding: 0;
    z-index: 100;
}

.user-switch__dropdown-item {
    display: flex;
    flex-direction: column;
    padding: var(--clk-space-xs) var(--clk-space-sm);
    cursor: pointer;
    transition: background var(--clk-transition-fast);
}

.user-switch__dropdown-item:hover,
.user-switch__dropdown-item--highlighted {
    background: var(--clk-primary-subtle);
}

.user-switch__dropdown-name {
    font-size: var(--clk-text-sm);
    font-weight: 500;
    color: var(--clk-text);
}

.user-switch__dropdown-email {
    font-size: var(--clk-text-xs);
    color: var(--clk-text-muted);
}

.user-switch__cancel {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: none;
    border: none;
    border-radius: var(--clk-radius);
    color: var(--clk-text-muted);
    cursor: pointer;
}

.user-switch__cancel:hover {
    background: var(--clk-bg);
    color: var(--clk-text);
}

.user-switch--active {
    display: flex;
    align-items: center;
    gap: var(--clk-space-sm);
    padding: var(--clk-space-sm) var(--clk-space-md);
    background: var(--clk-status-draft);
    border: 1px solid #e0c97a;
    border-radius: var(--clk-radius);
    margin: var(--clk-space-xs) 0;
}

.user-switch__warning-icon {
    color: var(--clk-warning);
    flex-shrink: 0;
}

.user-switch__active-text {
    flex: 1;
    font-size: var(--clk-text-sm);
    color: var(--clk-status-draft-text);
}

.user-switch__reset {
    background: none;
    border: 1px solid var(--clk-status-draft-text);
    border-radius: var(--clk-radius);
    padding: var(--clk-space-xs) var(--clk-space-sm);
    font-size: var(--clk-text-xs);
    color: var(--clk-status-draft-text);
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--clk-transition-fast);
}

.user-switch__reset:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* Admin hint on time entries */
.time-entry-list__admin-hint {
    display: block;
    font-size: var(--clk-text-xs);
    color: var(--clk-text-muted);
    margin-top: 2px;
}

/* User Switch responsive */
@media (max-width: 639px) {
    .user-switch--active {
        flex-wrap: wrap;
    }

    .user-switch__reset {
        width: 100%;
        text-align: center;
    }

    .user-switch__autocomplete {
        max-width: none;
    }
}

/* Time Entry Page Responsive (mobile-first) */
@media (min-width: 769px) {
    .time-entry-page {
        padding: var(--clk-space-lg);
    }

    .time-entry-page__form-section {
        min-height: auto;
    }
}

@media (min-width: 1025px) {
    .time-entry-page__content {
        grid-template-rows: auto 1fr;
    }

    .time-entry-page__list-section {
        display: block;
    }
}

/* --- Column View (Finder-style) --- */

.column-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--clk-surface);
    border-radius: var(--clk-radius-lg);
    box-shadow: var(--clk-shadow);
    overflow: hidden;
}

.column-view__header {
    display: flex;
    flex-direction: column;
    gap: var(--clk-space-sm);
    padding: var(--clk-space-md) var(--clk-space-lg);
    border-bottom: 1px solid var(--clk-border-light);
    background: var(--clk-bg);
}

.column-view__title {
    font-size: var(--clk-text-lg);
    font-weight: 600;
    color: var(--clk-text);
    margin: 0;
}

.column-view__date {
    display: flex;
    align-items: center;
    gap: var(--clk-space-sm);
}

.column-view__date-btn--today {
    margin-left: var(--clk-space-sm);
}

.column-view__item-name--muted {
    color: var(--clk-text-muted);
}

.column-view__date-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid var(--clk-border-light);
    border-radius: var(--clk-radius);
    cursor: pointer;
    color: var(--clk-text-secondary);
    transition: all var(--clk-transition-fast);
}

.column-view__date-btn:hover {
    background: var(--clk-primary-subtle);
    border-color: var(--clk-primary-light);
    color: var(--clk-primary);
}

.column-view__date-btn:focus-visible {
    outline: none;
    box-shadow: var(--clk-focus-ring);
}

.column-view__date-display {
    font-size: var(--clk-text-base);
    font-weight: 500;
    color: var(--clk-text);
    min-width: 140px;
    text-align: center;
}

/* Clickable date label with a native date picker overlaid transparently. */
.column-view__date-picker {
    position: relative;
    display: inline-flex;
    align-items: center;
    border-radius: var(--clk-radius);
    cursor: pointer;
}
.column-view__date-picker:hover {
    background: var(--clk-primary-subtle);
}
.column-view__date-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: none;
    opacity: 0;
    cursor: pointer;
}
/* Make the whole overlay clickable (not just the calendar glyph). */
.column-view__date-input::-webkit-calendar-picker-indicator {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.column-view__columns {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    gap: 1px;
    background: var(--clk-border-light);
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.column-view__column {
    display: flex;
    flex-direction: column;
    background: var(--clk-surface);
    min-height: 0;
    max-height: 200px;
    overflow: hidden;
}

.column-view__column-header {
    padding: var(--clk-space-sm) var(--clk-space-md);
    border-bottom: 1px solid var(--clk-border-light);
    background: var(--clk-bg);
}

.column-view__column-label {
    font-size: var(--clk-text-sm);
    font-weight: 600;
    color: var(--clk-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

.column-view__column-optional {
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: var(--clk-text-muted);
}

.column-view__column-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--clk-space-sm);
}

.column-view__column-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.column-view__column-item {
    display: flex;
    align-items: center;
    gap: var(--clk-space-sm);
    padding: var(--clk-space-sm) var(--clk-space-md);
    border-radius: var(--clk-radius);
    cursor: pointer;
    transition: background var(--clk-transition-fast);
}

.column-view__column-item:hover {
    background: var(--clk-primary-subtle);
}

.column-view__column-item--selected {
    background: var(--clk-primary);
    color: white;
}

.column-view__column-item--selected:hover {
    background: var(--clk-primary-hover);
}

.column-view__column-item--highlighted {
    background: var(--clk-primary-subtle);
}

.column-view__item-color {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.column-view__item-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.column-view__item-code {
    font-size: var(--clk-text-xs);
    color: var(--clk-text-muted);
    flex-shrink: 0;
}

.column-view__column-item--selected .column-view__item-code {
    color: rgba(255, 255, 255, 0.7);
}

/* Input columns */
.column-view__input-wrapper {
    padding: var(--clk-space-md);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.column-view__input {
    width: 100%;
    padding: var(--clk-space-sm) var(--clk-space-md);
    font-size: var(--clk-text-base);
    font-family: var(--clk-font-mono);
    border: 1px solid var(--clk-border-light);
    border-radius: var(--clk-radius);
    background: var(--clk-surface);
    color: var(--clk-text);
    transition: border-color var(--clk-transition-fast), box-shadow var(--clk-transition-fast);
}

.column-view__input:hover {
    border-color: var(--clk-border);
}

.column-view__input:focus {
    outline: none;
    border-color: var(--clk-primary-light);
    box-shadow: var(--clk-focus-ring);
}

.column-view__input::placeholder {
    color: var(--clk-text-muted);
}

.column-view__input-hint {
    margin-top: var(--clk-space-xs);
    font-size: var(--clk-text-xs);
    color: var(--clk-text-muted);
}

.column-view__textarea {
    width: 100%;
    height: 100%;
    min-height: 80px;
    padding: var(--clk-space-sm) var(--clk-space-md);
    font-size: var(--clk-text-base);
    font-family: var(--clk-font-sans);
    border: 1px solid var(--clk-border-light);
    border-radius: var(--clk-radius);
    background: var(--clk-surface);
    color: var(--clk-text);
    resize: none;
    transition: border-color var(--clk-transition-fast), box-shadow var(--clk-transition-fast);
}

.column-view__textarea:hover {
    border-color: var(--clk-border);
}

.column-view__textarea:focus {
    outline: none;
    border-color: var(--clk-primary-light);
    box-shadow: var(--clk-focus-ring);
}

.column-view__textarea::placeholder {
    color: var(--clk-text-muted);
}

/* Footer with actions */
.column-view__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--clk-space-md) var(--clk-space-lg);
    border-top: 1px solid var(--clk-border-light);
    background: var(--clk-bg);
}

.column-view__summary {
    display: flex;
    align-items: center;
    gap: var(--clk-space-lg);
}

.column-view__summary-item {
    display: flex;
    align-items: center;
    gap: var(--clk-space-xs);
    font-size: var(--clk-text-sm);
    color: var(--clk-text-secondary);
}

.column-view__summary-value {
    font-weight: 600;
    color: var(--clk-text);
    font-family: var(--clk-font-mono);
}

.column-view__actions {
    display: flex;
    align-items: center;
    gap: var(--clk-space-md);
}

.column-view__hint {
    font-size: var(--clk-text-xs);
    color: var(--clk-text-muted);
}

.column-view__hint kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    padding: 2px 6px;
    font-family: var(--clk-font-mono);
    font-size: var(--clk-text-xs);
    font-weight: 500;
    color: var(--clk-text-secondary);
    background: var(--clk-surface);
    border: 1px solid var(--clk-border);
    border-radius: var(--clk-radius-sm);
}

/* Empty state */
.column-view__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--clk-space-xl);
    color: var(--clk-text-muted);
    text-align: center;
    gap: var(--clk-space-sm);
}

.column-view__empty-icon {
    font-size: 2rem;
    opacity: 0.5;
}

/* Search input in column */
.column-view__search {
    position: relative;
    padding: var(--clk-space-sm);
    border-bottom: 1px solid var(--clk-border-light);
}

.column-view__search-input {
    width: 100%;
    padding: var(--clk-space-xs) var(--clk-space-sm);
    padding-left: 32px;
    font-size: var(--clk-text-sm);
    border: 1px solid var(--clk-border-light);
    border-radius: var(--clk-radius);
    background: var(--clk-surface);
    color: var(--clk-text);
    transition: border-color var(--clk-transition-fast), box-shadow var(--clk-transition-fast);
}

.column-view__search-input:focus {
    outline: none;
    border-color: var(--clk-primary-light);
    box-shadow: var(--clk-focus-ring);
}

.column-view__search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--clk-text-muted);
    pointer-events: none;
}

/* Favorite Button */
.column-view__favorite-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    border-radius: var(--clk-radius);
    cursor: pointer;
    color: var(--clk-text-muted);
    opacity: 0;
    transition: all var(--clk-transition-fast);
    flex-shrink: 0;
}

.column-view__column-item:hover .column-view__favorite-btn {
    opacity: 1;
}

.column-view__favorite-btn:hover {
    color: var(--clk-warning);
    background: rgba(229, 161, 23, 0.1);
}

.column-view__favorite-btn:focus-visible {
    outline: none;
    box-shadow: var(--clk-focus-ring);
    opacity: 1;
}

.column-view__favorite-btn--active {
    opacity: 1;
    color: var(--clk-warning);
}

.column-view__favorite-btn--active:hover {
    color: var(--clk-warning-hover);
}

.column-view__column-item--selected .column-view__favorite-btn {
    color: rgba(255, 255, 255, 0.6);
}

.column-view__column-item--selected .column-view__favorite-btn:hover {
    color: var(--clk-warning);
    background: rgba(229, 161, 23, 0.2);
}

.column-view__column-item--selected .column-view__favorite-btn--active {
    color: var(--clk-warning);
}

/* Column View Responsive (mobile-first) */
@media (min-width: 769px) {
    .column-view__header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .column-view__columns {
        grid-template-columns: 1fr 1fr 140px 1fr;
        grid-template-rows: none;
    }

    .column-view__column {
        /* Keep the picker compact: long lists scroll internally instead of
           stretching the form and pushing the entries list below the fold. */
        max-height: 300px;
    }

    /* Hide subproject column on tablet */
    .column-view__column--subproject {
        display: none;
    }
}

@media (min-width: 1025px) {
    .column-view__columns {
        grid-template-columns: 1fr 1fr 1fr 140px 1fr;
    }

    /* Show subproject column on desktop */
    .column-view__column--subproject {
        display: flex;
    }
}


/* --- Inline Entry Form --- */

.inline-entry {
    display: flex;
    flex-direction: column;
    gap: var(--clk-space-sm);
}

.inline-entry__input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--clk-space-sm);
}

.inline-entry__input {
    flex: 1;
    padding: var(--clk-space-md) var(--clk-space-lg);
    font-size: var(--clk-text-base);
    font-family: var(--clk-font-sans);
    border: 2px solid var(--clk-border-light);
    border-radius: var(--clk-radius-lg);
    background: var(--clk-surface);
    color: var(--clk-text);
    transition: border-color var(--clk-transition-fast), box-shadow var(--clk-transition-fast);
}

.inline-entry__input:hover {
    border-color: var(--clk-border);
}

.inline-entry__input:focus {
    outline: none;
    border-color: var(--clk-primary);
    box-shadow: var(--clk-focus-ring);
}

.inline-entry__input::placeholder {
    color: var(--clk-text-muted);
}

.inline-entry__submit {
    flex-shrink: 0;
}

/* Parsed segments display */
.inline-entry__segments {
    display: flex;
    align-items: center;
    gap: var(--clk-space-xs);
    flex-wrap: wrap;
    min-height: 28px;
}

.inline-entry__segment {
    display: inline-flex;
    align-items: center;
    gap: var(--clk-space-xs);
    padding: 4px 10px;
    font-size: var(--clk-text-sm);
    border-radius: var(--clk-radius);
    background: var(--clk-primary-subtle);
    color: var(--clk-primary);
}

.inline-entry__segment--customer {
    background: var(--clk-primary-subtle);
    color: var(--clk-primary);
}

.inline-entry__segment--project {
    background: var(--clk-segment-project-bg);
    color: var(--clk-segment-project-text);
}

.inline-entry__segment--subproject {
    background: var(--clk-segment-subproject-bg);
    color: var(--clk-segment-subproject-text);
}

.inline-entry__segment--duration {
    background: var(--clk-segment-duration-bg);
    color: var(--clk-segment-duration-text);
    font-family: var(--clk-font-mono);
}

.inline-entry__segment--description {
    background: var(--clk-bg);
    color: var(--clk-text-secondary);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inline-entry__segment-color {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.inline-entry__segment-separator {
    color: var(--clk-text-muted);
    font-size: var(--clk-text-xs);
}

.inline-entry__hint {
    font-size: var(--clk-text-xs);
    color: var(--clk-text-muted);
}

.inline-entry__hint kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    padding: 2px 5px;
    font-family: var(--clk-font-mono);
    font-size: 10px;
    font-weight: 500;
    color: var(--clk-text-secondary);
    background: var(--clk-surface);
    border: 1px solid var(--clk-border);
    border-radius: 3px;
}

/* Autocomplete dropdown */
.inline-entry__dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 60px;
    max-height: 300px;
    overflow-y: auto;
    background: var(--clk-surface);
    border: 1px solid var(--clk-border);
    border-top: none;
    border-radius: 0 0 var(--clk-radius-lg) var(--clk-radius-lg);
    box-shadow: var(--clk-shadow-lg);
    z-index: 100;
}

.inline-entry__dropdown-section {
    padding: var(--clk-space-xs) var(--clk-space-sm);
    font-size: var(--clk-text-xs);
    font-weight: 600;
    color: var(--clk-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--clk-bg);
    border-bottom: 1px solid var(--clk-border-light);
}

.inline-entry__dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--clk-space-sm);
    padding: var(--clk-space-sm) var(--clk-space-md);
    cursor: pointer;
    transition: background var(--clk-transition-fast);
}

.inline-entry__dropdown-item:hover,
.inline-entry__dropdown-item--highlighted {
    background: var(--clk-primary-subtle);
}

.inline-entry__dropdown-item-color {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.inline-entry__dropdown-item-content {
    flex: 1;
    min-width: 0;
}

.inline-entry__dropdown-item-name {
    font-weight: 500;
    color: var(--clk-text);
}

.inline-entry__dropdown-item-meta {
    font-size: var(--clk-text-xs);
    color: var(--clk-text-muted);
}

.inline-entry__dropdown-item-code {
    flex-shrink: 0;
    font-size: var(--clk-text-xs);
    color: var(--clk-text-muted);
    font-family: var(--clk-font-mono);
}

/* Recent entries section */
.inline-entry__recent {
    display: flex;
    align-items: center;
    gap: var(--clk-space-sm);
    padding: var(--clk-space-sm) 0;
    overflow-x: auto;
}

.inline-entry__recent-label {
    font-size: var(--clk-text-xs);
    color: var(--clk-text-muted);
    flex-shrink: 0;
}

.inline-entry__recent-item {
    display: inline-flex;
    align-items: center;
    gap: var(--clk-space-xs);
    padding: 4px 10px;
    font-size: var(--clk-text-sm);
    background: var(--clk-bg);
    border: 1px solid var(--clk-border-light);
    border-radius: var(--clk-radius-full);
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--clk-transition-fast);
}

.inline-entry__recent-item:hover {
    background: var(--clk-primary-subtle);
    border-color: var(--clk-primary-light);
}

.inline-entry__recent-item-color {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

/* Error state */
.inline-entry--error .inline-entry__input {
    border-color: var(--clk-error);
}

.inline-entry__error {
    font-size: var(--clk-text-sm);
    color: var(--clk-error);
}

/* Success animation */
@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.inline-entry--success .inline-entry__input {
    animation: successPulse 0.3s ease;
    border-color: var(--clk-success);
}

/* --- Calendar View --- */

.calendar-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--clk-surface);
    border-radius: var(--clk-radius-lg);
    box-shadow: var(--clk-shadow);
    overflow: hidden;
}

.calendar-view__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--clk-space-sm);
    padding: var(--clk-space-md) var(--clk-space-lg);
    border-bottom: 1px solid var(--clk-border-light);
    background: var(--clk-bg);
}

.calendar-view__nav {
    display: flex;
    align-items: center;
    gap: var(--clk-space-xs);
    flex: 1;
}

.calendar-view__nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--clk-space-xs) var(--clk-space-sm);
    min-width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid var(--clk-border-light);
    border-radius: var(--clk-radius);
    cursor: pointer;
    color: var(--clk-text-secondary);
    font-size: var(--clk-text-sm);
    font-weight: 500;
    transition: all var(--clk-transition-fast);
}

.calendar-view__nav-btn:hover {
    background: var(--clk-surface);
    border-color: var(--clk-border);
    color: var(--clk-text);
}

.calendar-view__nav-btn:focus-visible {
    outline: none;
    box-shadow: var(--clk-focus-ring);
}

.calendar-view__title {
    font-size: var(--clk-text-md);
    font-weight: 600;
    color: var(--clk-text);
    margin: 0;
    text-transform: capitalize;
    text-align: center;
}

/* Clickable calendar title with a native date picker overlaid transparently. */
.calendar-view__title-picker {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    order: -1;
    width: 100%;
    padding: var(--clk-space-xs) var(--clk-space-sm);
    border-radius: var(--clk-radius);
    cursor: pointer;
}
.calendar-view__title-picker:hover {
    background: var(--clk-primary-subtle);
}
.calendar-view__date-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: none;
    opacity: 0;
    cursor: pointer;
}
.calendar-view__date-input::-webkit-calendar-picker-indicator {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.calendar-view__view-toggle {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 2px;
    background: var(--clk-bg);
    border: 1px solid var(--clk-border-light);
    border-radius: var(--clk-radius);
    flex: 1;
    justify-content: flex-end;
}

.calendar-view__view-btn {
    padding: var(--clk-space-xs) var(--clk-space-md);
    background: transparent;
    border: none;
    border-radius: var(--clk-radius-sm);
    cursor: pointer;
    color: var(--clk-text-secondary);
    font-size: var(--clk-text-sm);
    font-weight: 500;
    transition: all var(--clk-transition-fast);
}

.calendar-view__view-btn:hover {
    color: var(--clk-text);
}

.calendar-view__view-btn--active {
    background: var(--clk-surface);
    color: var(--clk-primary);
    box-shadow: var(--clk-shadow-sm);
}

.calendar-view__view-btn:focus-visible {
    outline: none;
    box-shadow: var(--clk-focus-ring);
}

.calendar-view__content {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Loading state */
.calendar-view__loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: var(--clk-space-md);
    color: var(--clk-text-muted);
}

.calendar-view__spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--clk-border-light);
    border-top-color: var(--clk-primary);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

/* Modal styles */
.calendar-view__modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.15s ease;
}

.calendar-view__modal {
    background: var(--clk-surface);
    border-radius: var(--clk-radius-lg);
    box-shadow: var(--clk-shadow-lg);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: visible;
    animation: slideIn 0.2s ease;
}

.calendar-view__modal--detail {
    max-width: 400px;
}

.calendar-view__modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--clk-space-md) var(--clk-space-lg);
    border-bottom: 1px solid var(--clk-border-light);
}

.calendar-view__modal-header h3 {
    margin: 0;
    font-size: var(--clk-text-md);
    font-weight: 600;
    color: var(--clk-text);
}

.calendar-view__modal-header-info {
    display: flex;
    align-items: center;
    gap: var(--clk-space-sm);
}

.calendar-view__entry-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.calendar-view__modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: var(--clk-radius);
    cursor: pointer;
    color: var(--clk-text-muted);
    transition: all var(--clk-transition-fast);
}

.calendar-view__modal-close:hover {
    background: var(--clk-bg);
    color: var(--clk-text);
}

.calendar-view__modal-body {
    padding: var(--clk-space-lg);
    min-height: 320px;
    overflow: visible;
}

.calendar-view__modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--clk-space-sm);
    padding: var(--clk-space-md) var(--clk-space-lg);
    border-top: 1px solid var(--clk-border-light);
    background: var(--clk-bg);
}

/* Detail modal rows */
.calendar-view__detail-row {
    display: flex;
    align-items: flex-start;
    gap: var(--clk-space-md);
    padding: var(--clk-space-sm) 0;
}

.calendar-view__detail-row:not(:last-child) {
    border-bottom: 1px solid var(--clk-border-light);
}

.calendar-view__detail-label {
    width: 100px;
    flex-shrink: 0;
    font-size: var(--clk-text-sm);
    color: var(--clk-text-muted);
}

.calendar-view__detail-value {
    flex: 1;
    font-size: var(--clk-text-sm);
    color: var(--clk-text);
}

.calendar-view__detail-value--mono {
    font-family: var(--clk-font-mono);
    font-weight: 500;
}

.calendar-view__detail-status {
    display: inline-flex;
    padding: 2px 8px;
    font-size: var(--clk-text-xs);
    font-weight: 500;
    border-radius: var(--clk-radius-full);
}

.calendar-view__detail-status--draft {
    background: var(--clk-status-draft);
    color: var(--clk-status-draft-text);
}

.calendar-view__detail-status--committed {
    background: var(--clk-status-committed);
    color: var(--clk-status-committed-text);
}

.calendar-view__detail-status--booked {
    background: var(--clk-status-booked);
    color: var(--clk-status-booked-text);
}

/* Calendar View Responsive — desktop override (mobile-first) */
@media (min-width: 769px) {
    .calendar-view__header {
        flex-wrap: nowrap;
        gap: 0;
    }

    .calendar-view__title-picker {
        order: 0;
        width: auto;
    }

    .calendar-view__title {
        text-align: left;
        font-size: var(--clk-text-lg);
    }

    .calendar-view__nav,
    .calendar-view__view-toggle {
        flex: 0 0 auto;
    }

    .calendar-view__view-toggle {
        justify-content: initial;
    }
}

/* --- Favorites List --- */

.favorites-list {
    background: var(--clk-surface);
    border-radius: var(--clk-radius-lg);
    box-shadow: var(--clk-shadow);
    overflow: hidden;
}

.favorites-list__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--clk-space-sm) var(--clk-space-md);
    border-bottom: 1px solid var(--clk-border-light);
    background: var(--clk-bg);
}

.favorites-list__title {
    display: flex;
    align-items: center;
    gap: var(--clk-space-xs);
    font-size: var(--clk-text-sm);
    font-weight: 600;
    color: var(--clk-text);
    margin: 0;
}

.favorites-list__title svg {
    color: var(--clk-warning);
}

.favorites-list__hint {
    font-size: var(--clk-text-xs);
    color: var(--clk-text-muted);
    font-family: var(--clk-font-mono);
}

.favorites-list__content {
    max-height: 280px;
    overflow-y: auto;
}

.favorites-list__loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--clk-space-lg);
}

.favorites-list__spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--clk-border-light);
    border-top-color: var(--clk-primary);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

.favorites-list__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--clk-space-lg);
    text-align: center;
}

.favorites-list__empty-text {
    font-size: var(--clk-text-sm);
    color: var(--clk-text-muted);
}

.favorites-list__empty-hint {
    font-size: var(--clk-text-xs);
    color: var(--clk-text-muted);
    margin-top: var(--clk-space-xs);
}

.favorites-list__items {
    list-style: none;
    margin: 0;
    padding: 0;
}

.favorites-list__item {
    display: flex;
    align-items: center;
    gap: var(--clk-space-sm);
    padding: var(--clk-space-sm) var(--clk-space-md);
    cursor: pointer;
    transition: background var(--clk-transition-fast);
    border-bottom: 1px solid var(--clk-border-light);
}

.favorites-list__item:last-child {
    border-bottom: none;
}

.favorites-list__item:hover {
    background: var(--clk-primary-subtle);
}

.favorites-list__shortcut {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: var(--clk-text-xs);
    font-family: var(--clk-font-mono);
    font-weight: 600;
    color: var(--clk-text-muted);
    background: var(--clk-bg);
    border: 1px solid var(--clk-border-light);
    border-radius: var(--clk-radius-sm);
    flex-shrink: 0;
}

.favorites-list__color {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.favorites-list__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.favorites-list__project {
    font-size: var(--clk-text-sm);
    font-weight: 500;
    color: var(--clk-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.favorites-list__customer {
    font-size: var(--clk-text-xs);
    color: var(--clk-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.favorites-list__subproject {
    font-size: var(--clk-text-xs);
    color: var(--clk-text-secondary);
    padding: 1px 4px;
    background: var(--clk-bg);
    border-radius: var(--clk-radius-sm);
    width: fit-content;
}

.favorites-list__remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    border-radius: var(--clk-radius);
    cursor: pointer;
    color: var(--clk-text-muted);
    opacity: 0;
    transition: all var(--clk-transition-fast);
    flex-shrink: 0;
}

.favorites-list__item:hover .favorites-list__remove {
    opacity: 1;
}

.favorites-list__remove:hover {
    background: rgba(197, 48, 48, 0.1);
    color: var(--clk-error);
}

.favorites-list__remove:focus-visible {
    outline: none;
    box-shadow: var(--clk-focus-ring);
    opacity: 1;
}

/* --- Recent Entries List --- */

.recent-entries {
    background: var(--clk-surface);
    border-radius: var(--clk-radius-lg);
    box-shadow: var(--clk-shadow);
    overflow: hidden;
}

.recent-entries__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--clk-space-sm) var(--clk-space-md);
    border-bottom: 1px solid var(--clk-border-light);
    background: var(--clk-bg);
}

.recent-entries__title {
    display: flex;
    align-items: center;
    gap: var(--clk-space-xs);
    font-size: var(--clk-text-sm);
    font-weight: 600;
    color: var(--clk-text);
    margin: 0;
}

.recent-entries__title svg {
    color: var(--clk-text-secondary);
}

.recent-entries__content {
    max-height: 280px;
    overflow-y: auto;
}

.recent-entries__loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--clk-space-lg);
}

.recent-entries__spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--clk-border-light);
    border-top-color: var(--clk-primary);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

.recent-entries__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--clk-space-lg);
    text-align: center;
}

.recent-entries__empty-text {
    font-size: var(--clk-text-sm);
    color: var(--clk-text-muted);
}

.recent-entries__items {
    list-style: none;
    margin: 0;
    padding: 0;
}

.recent-entries__item {
    display: flex;
    align-items: center;
    gap: var(--clk-space-sm);
    padding: var(--clk-space-sm) var(--clk-space-md);
    cursor: pointer;
    transition: background var(--clk-transition-fast);
    border-bottom: 1px solid var(--clk-border-light);
}

.recent-entries__item:last-child {
    border-bottom: none;
}

.recent-entries__item:hover {
    background: var(--clk-primary-subtle);
}

.recent-entries__color {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.recent-entries__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.recent-entries__project {
    font-size: var(--clk-text-sm);
    font-weight: 500;
    color: var(--clk-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-entries__customer {
    font-size: var(--clk-text-xs);
    color: var(--clk-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-entries__subproject {
    font-size: var(--clk-text-xs);
    color: var(--clk-text-secondary);
    padding: 1px 4px;
    background: var(--clk-bg);
    border-radius: var(--clk-radius-sm);
    width: fit-content;
}

.recent-entries__meta {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.recent-entries__count {
    font-size: var(--clk-text-xs);
    font-family: var(--clk-font-mono);
    color: var(--clk-text-muted);
    padding: 2px 6px;
    background: var(--clk-bg);
    border-radius: var(--clk-radius-sm);
}

/* ==========================================
   CALENDAR VIEW STYLES (Day, Week, Month)
   ========================================== */

/* --- Day View --- */

.day-view {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.day-view__header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--clk-space-sm);
    padding: var(--clk-space-md) var(--clk-space-lg);
    border-bottom: 1px solid var(--clk-border-light);
    background: var(--clk-bg);
}

.day-view__date {
    display: flex;
    flex-direction: column;
}

.day-view__day-name {
    font-size: var(--clk-text-lg);
    font-weight: 600;
    color: var(--clk-text);
    text-transform: capitalize;
}

.day-view__date-full {
    font-size: var(--clk-text-sm);
    color: var(--clk-text-secondary);
}

.day-view__summary {
    display: flex;
    align-items: center;
    gap: var(--clk-space-sm);
}

.day-view__summary-label {
    font-size: var(--clk-text-sm);
    color: var(--clk-text-secondary);
}

.day-view__summary-value {
    font-size: var(--clk-text-lg);
    font-weight: 600;
    font-family: var(--clk-font-mono);
    color: var(--clk-text);
}

.day-view__summary-count {
    font-size: var(--clk-text-sm);
    color: var(--clk-text-muted);
}

.day-view__content {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.day-view__time-column {
    flex-shrink: 0;
    width: 45px;
    border-right: 1px solid var(--clk-border-light);
    background: var(--clk-bg);
}

.day-view__time-slot {
    height: 48px;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding-right: var(--clk-space-sm);
    padding-top: 2px;
}

.day-view__time-label {
    font-size: var(--clk-text-xs);
    font-family: var(--clk-font-mono);
    color: var(--clk-text-muted);
}

.day-view__grid {
    flex: 1;
    position: relative;
}

.day-view__hour-slot {
    height: 48px;
    border-bottom: 1px solid var(--clk-border-light);
    cursor: pointer;
    transition: background var(--clk-transition-fast);
}

.day-view__hour-slot:hover {
    background: var(--clk-primary-subtle);
}

.day-view__entries-overlay {
    position: absolute;
    top: 0;
    left: var(--clk-space-sm);
    right: var(--clk-space-sm);
    bottom: 0;
    pointer-events: none;
}

.day-view__entry {
    position: absolute;
    left: 0;
    right: 0;
    min-height: 30px;
    background: var(--entry-color, var(--clk-primary));
    border-radius: var(--clk-radius);
    padding: var(--clk-space-xs);
    overflow: hidden;
    cursor: pointer;
    pointer-events: auto;
    transition: transform var(--clk-transition-fast), box-shadow var(--clk-transition-fast);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.day-view__entry:hover {
    transform: translateX(2px);
    box-shadow: var(--clk-shadow-md);
}

.day-view__entry-header {
    display: flex;
    align-items: center;
    gap: var(--clk-space-xs);
}

.day-view__entry-color {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.day-view__entry-project {
    font-size: var(--clk-text-xs);
    font-weight: 600;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.day-view__entry-customer {
    font-size: var(--clk-text-xs);
    color: rgba(255, 255, 255, 0.8);
}

.day-view__entry-duration {
    font-size: var(--clk-text-xs);
    font-family: var(--clk-font-mono);
    color: rgba(255, 255, 255, 0.9);
}

.day-view__entry-description {
    font-size: var(--clk-text-xs);
    color: rgba(255, 255, 255, 0.7);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.day-view__entry-status {
    position: absolute;
    top: var(--clk-space-xs);
    right: var(--clk-space-xs);
    font-size: 9px;
    font-weight: 500;
    padding: 1px 4px;
    border-radius: var(--clk-radius-sm);
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.day-view__entry-status--draft {
    background: rgba(255, 193, 7, 0.3);
}

.day-view__entry-status--committed {
    background: rgba(40, 167, 69, 0.3);
}

.day-view__entry-status--booked {
    background: rgba(0, 123, 255, 0.3);
}

/* Now indicator */
.day-view__now-indicator {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--clk-error);
    z-index: 10;
}

.day-view__now-indicator::before {
    content: '';
    position: absolute;
    left: -4px;
    top: -4px;
    width: 10px;
    height: 10px;
    background: var(--clk-error);
    border-radius: 50%;
}

/* Empty state */
.day-view__empty {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--clk-space-md);
    text-align: center;
}

.day-view__empty-icon {
    color: var(--clk-text-muted);
    opacity: 0.5;
}

.day-view__empty-text {
    font-size: var(--clk-text-sm);
    color: var(--clk-text-muted);
}

.day-view__add-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--clk-space-xs);
    padding: var(--clk-space-sm) var(--clk-space-md);
    background: var(--clk-primary);
    color: white;
    border: none;
    border-radius: var(--clk-radius);
    font-size: var(--clk-text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: background var(--clk-transition-fast);
}

.day-view__add-btn:hover {
    background: var(--clk-primary-hover);
}

.day-view__add-btn:focus-visible {
    outline: none;
    box-shadow: var(--clk-focus-ring);
}

@media (min-width: 769px) {
    .day-view__header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .day-view__time-column {
        width: 60px;
    }

    .day-view__time-slot {
        height: 60px;
    }

    .day-view__hour-slot {
        height: 60px;
    }

    .day-view__entry {
        padding: var(--clk-space-sm);
    }

    .day-view__entry-project {
        font-size: var(--clk-text-sm);
    }
}

/* --- Week View --- */

.week-view {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.week-view__header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-bottom: 1px solid var(--clk-border-light);
    background: var(--clk-bg);
}

.week-view__day-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--clk-space-xs);
    text-align: center;
}

.week-view__day-header--today {
    background: var(--clk-primary-subtle);
}

.week-view__day-name {
    font-size: 10px;
    color: var(--clk-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.week-view__day-number {
    font-size: var(--clk-text-sm);
    font-weight: 600;
    color: var(--clk-text);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.week-view__day-number--today {
    background: var(--clk-primary);
    color: white;
}

.week-view__grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.week-view__day {
    display: flex;
    flex-direction: column;
    padding: var(--clk-space-xs);
    border-right: 1px solid var(--clk-border-light);
    min-height: 120px;
    cursor: pointer;
    transition: background var(--clk-transition-fast);
    position: relative;
}

.week-view__day:last-child {
    border-right: none;
}

.week-view__day:hover {
    background: var(--clk-primary-subtle);
}

.week-view__day--today {
    background: rgba(74, 144, 217, 0.05);
}

.week-view__entries {
    display: flex;
    flex-direction: column;
    gap: var(--clk-space-xs);
    flex: 1;
}

.week-view__entry {
    display: flex;
    flex-direction: column;
    padding: 2px 4px;
    background: var(--entry-color, var(--clk-primary));
    border-radius: var(--clk-radius-sm);
    cursor: pointer;
    transition: transform var(--clk-transition-fast), box-shadow var(--clk-transition-fast);
    overflow: hidden;
}

.week-view__entry:hover {
    transform: translateY(-1px);
    box-shadow: var(--clk-shadow-sm);
}

.week-view__entry-project {
    font-size: 10px;
    font-weight: 500;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.week-view__entry-duration {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.8);
    font-family: var(--clk-font-mono);
    display: none;
}

.week-view__more {
    font-size: var(--clk-text-xs);
    color: var(--clk-text-muted);
    text-align: center;
    padding: var(--clk-space-xs);
}

.week-view__empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.week-view__add-hint {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--clk-border-light);
    color: var(--clk-text-muted);
    font-size: var(--clk-text-lg);
    opacity: 0;
    transition: opacity var(--clk-transition-fast);
}

.week-view__day:hover .week-view__add-hint {
    opacity: 1;
}

.week-view__day-total {
    position: absolute;
    bottom: var(--clk-space-xs);
    right: var(--clk-space-xs);
    font-size: var(--clk-text-xs);
    font-family: var(--clk-font-mono);
    color: var(--clk-text-secondary);
    background: var(--clk-bg);
    padding: 2px 6px;
    border-radius: var(--clk-radius-sm);
}

.week-view__summary {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--clk-space-sm);
    padding: var(--clk-space-sm) var(--clk-space-lg);
    border-top: 1px solid var(--clk-border-light);
    background: var(--clk-bg);
}

.week-view__summary-label {
    font-size: var(--clk-text-sm);
    color: var(--clk-text-secondary);
}

.week-view__summary-value {
    font-size: var(--clk-text-md);
    font-weight: 600;
    font-family: var(--clk-font-mono);
    color: var(--clk-text);
}

@media (min-width: 769px) {
    .week-view__day-header {
        padding: var(--clk-space-sm) var(--clk-space-xs);
    }

    .week-view__day-name {
        font-size: var(--clk-text-xs);
    }

    .week-view__day-number {
        font-size: var(--clk-text-md);
        width: 32px;
        height: 32px;
    }

    .week-view__day {
        min-height: 200px;
    }

    .week-view__entry {
        padding: var(--clk-space-xs) var(--clk-space-sm);
    }

    .week-view__entry-project {
        font-size: var(--clk-text-xs);
    }

    .week-view__entry-duration {
        display: block;
    }
}

/* --- Month View --- */

.month-view {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.month-view__header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-bottom: 1px solid var(--clk-border-light);
    background: var(--clk-bg);
}

.month-view__day-header {
    padding: var(--clk-space-sm);
    text-align: center;
    font-size: var(--clk-text-xs);
    font-weight: 600;
    color: var(--clk-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.month-view__grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.month-view__day {
    display: flex;
    flex-direction: column;
    padding: 2px;
    border-right: 1px solid var(--clk-border-light);
    border-bottom: 1px solid var(--clk-border-light);
    min-height: 60px;
    cursor: pointer;
    transition: background var(--clk-transition-fast);
    position: relative;
}

.month-view__day:nth-child(7n) {
    border-right: none;
}

.month-view__day:hover {
    background: var(--clk-primary-subtle);
}

.month-view__day--other-month {
    background: var(--clk-bg);
    opacity: 0.5;
}

.month-view__day--today {
    background: rgba(74, 144, 217, 0.05);
}

.month-view__day-number {
    font-size: var(--clk-text-xs);
    font-weight: 500;
    color: var(--clk-text-secondary);
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-bottom: var(--clk-space-xs);
}

.month-view__day-number--today {
    background: var(--clk-primary);
    color: white;
    font-weight: 600;
}

.month-view__entries {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.month-view__entry {
    display: flex;
    align-items: center;
    padding: 1px 2px;
    background: var(--entry-color, var(--clk-primary));
    border-radius: 2px;
    cursor: pointer;
    overflow: hidden;
    transition: transform var(--clk-transition-fast);
}

.month-view__entry:hover {
    transform: translateX(2px);
}

.month-view__entry-text {
    font-size: 9px;
    font-weight: 500;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.month-view__more {
    font-size: 10px;
    color: var(--clk-text-muted);
    text-align: center;
    padding: 2px;
}

.month-view__total {
    position: absolute;
    bottom: var(--clk-space-xs);
    right: var(--clk-space-xs);
    font-size: 10px;
    font-family: var(--clk-font-mono);
    color: var(--clk-text-muted);
    background: var(--clk-bg);
    padding: 1px 4px;
    border-radius: 2px;
    display: none;
}

.month-view__summary {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: var(--clk-space-md);
    padding: var(--clk-space-sm) var(--clk-space-lg);
    border-top: 1px solid var(--clk-border-light);
    background: var(--clk-bg);
}

.month-view__summary-item {
    display: flex;
    align-items: center;
    gap: var(--clk-space-sm);
}

.month-view__summary-label {
    font-size: var(--clk-text-sm);
    color: var(--clk-text-secondary);
}

.month-view__summary-value {
    font-size: var(--clk-text-md);
    font-weight: 600;
    font-family: var(--clk-font-mono);
    color: var(--clk-text);
}

@media (min-width: 769px) {
    .month-view__day {
        min-height: 100px;
        padding: var(--clk-space-xs);
    }

    .month-view__day-number {
        font-size: var(--clk-text-sm);
        width: 24px;
        height: 24px;
    }

    .month-view__entry {
        padding: 2px 4px;
    }

    .month-view__entry-text {
        font-size: 10px;
    }

    .month-view__total {
        display: block;
    }

    .month-view__summary {
        flex-wrap: nowrap;
        gap: var(--clk-space-lg);
    }
}

/* ------------------------------------------
   CLOCK/BADGE COMPONENTS
   ------------------------------------------ */

/* Clock Widget */
.clock-widget {
    background: var(--clk-surface);
    border: 1px solid var(--clk-border-light);
    border-radius: var(--clk-radius-lg);
    padding: var(--clk-space-md);
    box-shadow: var(--clk-shadow-sm);
}

.clock-widget--active {
    border-color: var(--clk-success);
    background: linear-gradient(to bottom right, var(--clk-surface), var(--clk-success-tint));
}

.clock-widget__header {
    display: flex;
    align-items: center;
    gap: var(--clk-space-md);
    margin-bottom: var(--clk-space-md);
}

.clock-widget__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--clk-radius-md);
    background: var(--clk-bg);
    color: var(--clk-text-secondary);
}

.clock-widget--active .clock-widget__icon {
    background: var(--clk-success);
    color: white;
}

.clock-widget__status {
    flex: 1;
}

.clock-widget__label {
    display: block;
    font-size: var(--clk-text-sm);
    color: var(--clk-text-secondary);
}

.clock-widget__time {
    display: block;
    font-size: var(--clk-text-lg);
    font-weight: 600;
    color: var(--clk-text);
}

.clock-widget__details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--clk-space-sm) 0;
    margin-bottom: var(--clk-space-md);
    border-top: 1px solid var(--clk-border-light);
    border-bottom: 1px solid var(--clk-border-light);
}

.clock-widget__project {
    font-size: var(--clk-text-sm);
    color: var(--clk-text-secondary);
}

.clock-widget__customer {
    font-weight: 500;
    color: var(--clk-text);
}

.clock-widget__separator {
    margin: 0 var(--clk-space-xs);
    opacity: 0.5;
}

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

.clock-widget__duration-value {
    font-family: var(--clk-font-mono);
    font-size: var(--clk-text-lg);
    font-weight: 600;
    color: var(--clk-success);
}

.clock-widget__actions {
    display: flex;
    gap: var(--clk-space-sm);
}

.clock-widget__btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--clk-space-xs);
    padding: var(--clk-space-sm) var(--clk-space-md);
}

/* Clock Out Modal */
.clock-out-modal {
    max-width: 400px;
}

.clock-out-modal__summary {
    margin-bottom: var(--clk-space-md);
    color: var(--clk-text-secondary);
}

.clock-out-modal__summary strong {
    color: var(--clk-success);
}

.form-field--checkbox {
    flex-direction: row;
    align-items: center;
    gap: var(--clk-space-sm);
}

.form-field--checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--clk-primary);
}

.form-field--checkbox label {
    margin: 0;
    cursor: pointer;
}

/* Badge Scanner */
.badge-scanner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: var(--clk-space-xl);
    background: var(--clk-bg);
    text-align: center;
}

.badge-scanner__display {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 250px;
    height: 250px;
    margin-bottom: var(--clk-space-xl);
    border-radius: 50%;
    background: var(--clk-surface);
    box-shadow: var(--clk-shadow-lg);
    transition: all 0.3s ease;
}

.badge-scanner--ready .badge-scanner__display {
    border: 4px solid var(--clk-border);
}

.badge-scanner--processing .badge-scanner__display {
    border: 4px solid var(--clk-primary-light);
    animation: pulse 1.5s ease-in-out infinite;
}

.badge-scanner--success .badge-scanner__display {
    border: 4px solid var(--clk-success);
    background: linear-gradient(135deg, var(--clk-success-tint), var(--clk-surface));
}

.badge-scanner--error .badge-scanner__display {
    border: 4px solid var(--clk-error);
    background: linear-gradient(135deg, var(--clk-error-tint), var(--clk-surface));
}

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

.badge-scanner__ready {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--clk-space-md);
}

.badge-scanner__nfc-icon {
    color: var(--clk-text-muted);
    animation: nfc-wave 2s ease-in-out infinite;
}

.badge-scanner__nfc-icon--active {
    color: var(--clk-primary-light);
}

@keyframes nfc-wave {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

.badge-scanner__prompt {
    font-size: var(--clk-text-lg);
    color: var(--clk-text-secondary);
}

.badge-scanner__processing {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--clk-space-md);
}

.badge-scanner__spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--clk-border-light);
    border-top-color: var(--clk-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.badge-scanner__processing-text {
    font-size: var(--clk-text-md);
    color: var(--clk-text-secondary);
}

.badge-scanner__result {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--clk-space-sm);
    padding: var(--clk-space-md);
}

.badge-scanner__result-icon {
    margin-bottom: var(--clk-space-sm);
}

.badge-scanner__result--in .badge-scanner__result-icon {
    color: var(--clk-success);
}

.badge-scanner__result--out .badge-scanner__result-icon {
    color: var(--clk-accent);
}

.badge-scanner__result-message {
    font-size: var(--clk-text-md);
    font-weight: 500;
    color: var(--clk-text);
    max-width: 220px;
}

.badge-scanner__result-duration {
    font-family: var(--clk-font-mono);
    font-size: var(--clk-text-lg);
    font-weight: 600;
    color: var(--clk-success);
}

.badge-scanner__error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--clk-space-sm);
    padding: var(--clk-space-md);
}

.badge-scanner__error-icon {
    color: var(--clk-error);
    margin-bottom: var(--clk-space-sm);
}

.badge-scanner__error-message {
    font-size: var(--clk-text-md);
    color: var(--clk-error);
    max-width: 220px;
}

.badge-scanner__manual {
    width: 100%;
    max-width: 400px;
    margin-bottom: var(--clk-space-xl);
}

.badge-scanner__input-group {
    display: flex;
    gap: var(--clk-space-sm);
}

.badge-scanner__input {
    flex: 1;
    padding: var(--clk-space-md);
    font-size: var(--clk-text-lg);
    font-family: var(--clk-font-mono);
    text-transform: uppercase;
    text-align: center;
    border: 2px solid var(--clk-border);
    border-radius: var(--clk-radius-md);
    background: var(--clk-surface);
    transition: border-color 0.15s;
}

.badge-scanner__input:focus {
    outline: none;
    border-color: var(--clk-primary);
    box-shadow: var(--clk-focus-ring);
}

.badge-scanner__hint {
    margin-top: var(--clk-space-sm);
    font-size: var(--clk-text-sm);
    color: var(--clk-text-muted);
}

.badge-scanner__time {
    font-family: var(--clk-font-mono);
    font-size: 2rem;
    font-weight: 300;
    color: var(--clk-text-secondary);
    letter-spacing: 0.1em;
}

/* Badge Scanner Responsive (mobile-first: base=mobile, min-width:481px=desktop) */
@media (min-width: 481px) {
    .badge-scanner__display {
        width: 300px;
        height: 300px;
    }

    .badge-scanner__time {
        font-size: 3rem;
    }
}

/* ------------------------------------------
   REPORTS PAGE
   ------------------------------------------ */

.reports-page {
    display: flex;
    flex-direction: column;
    gap: var(--clk-space-lg);
    padding: var(--clk-space-md);
    max-width: 1400px;
    margin: 0 auto;
}

/* Page Header */
.reports-page__header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: var(--clk-space-md);
}

.reports-page__title-section {
    display: flex;
    flex-direction: column;
    gap: var(--clk-space-xs);
}

.reports-page__title {
    font-size: var(--clk-text-xl);
    font-weight: 700;
    color: var(--clk-text);
    margin: 0;
}

.reports-page__subtitle {
    margin: 0;
    font-size: var(--clk-text-base);
    color: var(--clk-text-secondary);
}

.reports-page__actions {
    display: flex;
    gap: var(--clk-space-sm);
    width: 100%;
    justify-content: flex-start;
}

/* Filters Section */
.reports-page__filters {
    background: var(--clk-surface);
    border: 1px solid var(--clk-border-light);
    border-radius: var(--clk-radius-lg);
    padding: var(--clk-space-lg);
    box-shadow: var(--clk-shadow-sm);
}

.reports-page__filter-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--clk-space-md);
}

.reports-page__filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--clk-space-xs);
    width: 100%;
    min-width: 140px;
}

.reports-page__label {
    font-size: var(--clk-text-sm);
    font-weight: 600;
    color: var(--clk-text-secondary);
}

.reports-page__input,
.reports-page__select {
    padding: var(--clk-space-sm) var(--clk-space-md);
    font-size: var(--clk-text-base);
    border: 1px solid var(--clk-border-light);
    border-radius: var(--clk-radius);
    background: var(--clk-surface);
    color: var(--clk-text);
    transition: border-color var(--clk-transition-fast), box-shadow var(--clk-transition-fast);
    min-height: 40px;
}

.reports-page__input:focus,
.reports-page__select:focus {
    outline: none;
    border-color: var(--clk-primary-light);
    box-shadow: var(--clk-focus-ring);
}

.reports-page__filter-actions {
    display: flex;
    gap: var(--clk-space-sm);
    margin-left: 0;
    margin-top: var(--clk-space-sm);
}

/* Date Presets */
.reports-page__presets {
    display: flex;
    flex-wrap: wrap;
    gap: var(--clk-space-sm);
    margin-top: var(--clk-space-md);
    padding-top: var(--clk-space-md);
    border-top: 1px solid var(--clk-border-light);
    justify-content: center;
}

.reports-page__preset {
    padding: var(--clk-space-xs) var(--clk-space-md);
    font-size: var(--clk-text-sm);
    font-weight: 500;
    color: var(--clk-text-secondary);
    background: var(--clk-bg);
    border: 1px solid var(--clk-border-light);
    border-radius: var(--clk-radius-full);
    cursor: pointer;
    transition: all var(--clk-transition-fast);
}

.reports-page__preset:hover {
    background: var(--clk-primary-subtle);
    border-color: var(--clk-primary-light);
    color: var(--clk-primary);
}

.reports-page__preset:focus-visible {
    outline: none;
    box-shadow: var(--clk-focus-ring);
}

/* Month / year steppers */
.reports-page__stepper {
    display: inline-flex;
    align-items: center;
    background: var(--clk-bg);
    border: 1px solid var(--clk-border-light);
    border-radius: var(--clk-radius-full);
    overflow: hidden;
}

.reports-page__stepper-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    color: var(--clk-text-secondary);
    cursor: pointer;
    transition: all var(--clk-transition-fast);
}

.reports-page__stepper-btn:hover {
    background: var(--clk-primary-subtle);
    color: var(--clk-primary);
}

.reports-page__stepper-value {
    min-width: 110px;
    height: 30px;
    padding: 0 var(--clk-space-sm);
    font-size: var(--clk-text-sm);
    font-weight: 500;
    color: var(--clk-text);
    background: transparent;
    border: none;
    border-left: 1px solid var(--clk-border-light);
    border-right: 1px solid var(--clk-border-light);
    cursor: pointer;
    white-space: nowrap;
    text-align: center;
    transition: all var(--clk-transition-fast);
}

.reports-page__stepper-value:hover {
    background: var(--clk-primary-subtle);
    color: var(--clk-primary);
}

.reports-page__stepper-btn:focus-visible,
.reports-page__stepper-value:focus-visible {
    outline: none;
    box-shadow: var(--clk-focus-ring);
}

/* Loading State */
.reports-page__loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--clk-space-2xl);
    color: var(--clk-text-secondary);
    gap: var(--clk-space-md);
    background: var(--clk-surface);
    border-radius: var(--clk-radius-lg);
    border: 1px solid var(--clk-border-light);
}

.reports-page__spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--clk-border-light);
    border-top-color: var(--clk-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Summary Cards - mobile-first: 1 column */
.reports-page__summary {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--clk-space-md);
}

.reports-page__card {
    background: var(--clk-surface);
    border: 1px solid var(--clk-border-light);
    border-radius: var(--clk-radius-lg);
    padding: var(--clk-space-lg);
    text-align: center;
    transition: transform var(--clk-transition-fast), box-shadow var(--clk-transition-fast);
}

.reports-page__card:hover {
    transform: translateY(-2px);
    box-shadow: var(--clk-shadow-md);
}

.reports-page__card--primary {
    background: linear-gradient(135deg, var(--clk-primary) 0%, var(--clk-primary-hover) 100%);
    border-color: var(--clk-primary);
    color: white;
}

.reports-page__card--primary .reports-page__card-label {
    color: rgba(255, 255, 255, 0.85);
}

.reports-page__card-value {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--clk-font-mono);
    line-height: 1.2;
    margin-bottom: var(--clk-space-xs);
}

.reports-page__card-label {
    font-size: var(--clk-text-sm);
    font-weight: 500;
    color: var(--clk-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Tabs - mobile-first: column layout */
.reports-page__tabs {
    display: flex;
    flex-direction: column;
    gap: var(--clk-space-xs);
    background: var(--clk-surface);
    padding: var(--clk-space-sm);
    border-radius: var(--clk-radius-lg);
    border: 1px solid var(--clk-border-light);
}

.reports-page__tab {
    flex: 1;
    padding: var(--clk-space-sm) var(--clk-space-lg);
    font-size: var(--clk-text-base);
    font-weight: 500;
    color: var(--clk-text-secondary);
    background: transparent;
    border: none;
    border-radius: var(--clk-radius);
    cursor: pointer;
    transition: all var(--clk-transition-fast);
}

.reports-page__tab:hover {
    background: var(--clk-bg);
    color: var(--clk-text);
}

.reports-page__tab--active {
    background: var(--clk-primary);
    color: white;
}

.reports-page__tab--active:hover {
    background: var(--clk-primary-hover);
    color: white;
}

.reports-page__tab:focus-visible {
    outline: none;
    box-shadow: var(--clk-focus-ring);
}

/* Content Area */
.reports-page__content {
    background: var(--clk-surface);
    border: 1px solid var(--clk-border-light);
    border-radius: var(--clk-radius-lg);
    overflow: hidden;
}

/* Table Container */
.reports-page__table-container {
    overflow-x: auto;
}

/* Report Table - mobile-first: smaller font and padding */
.reports-page__table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--clk-text-sm);
}

.reports-page__table th {
    padding: var(--clk-space-sm);
    text-align: left;
    font-size: var(--clk-text-sm);
    font-weight: 600;
    color: var(--clk-text-secondary);
    background: var(--clk-bg);
    border-bottom: 2px solid var(--clk-border-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.reports-page__table td {
    padding: var(--clk-space-sm);
    font-size: var(--clk-text-base);
    color: var(--clk-text);
    border-bottom: 1px solid var(--clk-border-light);
    vertical-align: middle;
}

.reports-page__table tbody tr {
    transition: background var(--clk-transition-fast);
}

.reports-page__table tbody tr:hover {
    background: var(--clk-primary-subtle);
}

.reports-page__table tbody tr:last-child td {
    border-bottom: none;
}

.reports-page__table tfoot {
    background: var(--clk-bg);
}

.reports-page__table tfoot th {
    font-weight: 700;
    color: var(--clk-text);
    border-top: 2px solid var(--clk-border);
    border-bottom: none;
}

/* Text Alignment Utility */
.text-right {
    text-align: right !important;
}

/* Customer/Project Row Styles */
.reports-page__row--customer {
    background: var(--clk-bg);
}

.reports-page__row--customer td {
    font-weight: 600;
}

.reports-page__row--project td {
    padding-left: var(--clk-space-md);
}

.reports-page__row--weekend {
    background: rgba(0, 0, 0, 0.02);
}

.reports-page__row--weekend td {
    color: var(--clk-text-muted);
}

/* Customer Name */
.reports-page__customer-name {
    display: flex;
    align-items: center;
    gap: var(--clk-space-sm);
    font-weight: 600;
}

/* Project Name */
.reports-page__project-name {
    display: flex;
    align-items: center;
    gap: var(--clk-space-sm);
}

.reports-page__project-code {
    font-size: var(--clk-text-xs);
    font-family: var(--clk-font-mono);
    color: var(--clk-text-muted);
    background: var(--clk-bg);
    padding: 2px 6px;
    border-radius: var(--clk-radius-sm);
}

/* Color Dot */
.reports-page__color-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Percentage Bar */
.reports-page__percentage {
    display: flex;
    align-items: center;
    gap: var(--clk-space-sm);
    min-width: 120px;
}

.reports-page__percentage-bar {
    height: 8px;
    background: var(--clk-primary);
    border-radius: var(--clk-radius-full);
    transition: width var(--clk-transition-normal);
}

.reports-page__percentage span {
    font-size: var(--clk-text-sm);
    font-weight: 500;
    color: var(--clk-text-secondary);
    min-width: 45px;
    text-align: right;
}

/* Empty State */
.reports-page__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--clk-space-2xl);
    color: var(--clk-text-secondary);
    gap: var(--clk-space-md);
    text-align: center;
}

.reports-page__empty svg {
    color: var(--clk-text-muted);
    opacity: 0.5;
}

.reports-page__empty p {
    margin: 0;
    font-size: var(--clk-text-base);
}

.reports-page__empty--initial {
    background: var(--clk-surface);
    border: 1px solid var(--clk-border-light);
    border-radius: var(--clk-radius-lg);
    padding: var(--clk-space-2xl) var(--clk-space-xl);
    gap: var(--clk-space-lg);
}

.reports-page__empty-icon {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--clk-primary-subtle);
    border-radius: 50%;
}

.reports-page__empty-icon svg {
    color: var(--clk-primary);
    opacity: 0.8;
}

.reports-page__empty-text {
    display: flex;
    flex-direction: column;
    gap: var(--clk-space-sm);
}

.reports-page__empty-text h3 {
    margin: 0;
    font-size: var(--clk-text-lg);
    font-weight: 600;
    color: var(--clk-text);
}

.reports-page__empty-text p {
    margin: 0;
    color: var(--clk-text-secondary);
    max-width: 400px;
}

/* Reports Responsive - mobile-first breakpoints */
@media (min-width: 481px) {
    .reports-page__summary {
        grid-template-columns: repeat(2, 1fr);
    }

    .reports-page__presets {
        justify-content: flex-start;
    }
}

@media (min-width: 769px) {
    .reports-page {
        padding: var(--clk-space-lg);
    }

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

    .reports-page__actions {
        width: auto;
        justify-content: flex-end;
    }

    .reports-page__filter-row {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-end;
    }

    .reports-page__filter-group {
        width: auto;
    }

    .reports-page__filter-actions {
        margin-left: auto;
        margin-top: 0;
    }

    .reports-page__summary {
        grid-template-columns: repeat(3, 1fr);
    }

    .reports-page__card-value {
        font-size: 2rem;
    }

    .reports-page__tabs {
        flex-direction: row;
    }

    .reports-page__table {
        font-size: var(--clk-text-base);
    }

    .reports-page__table th,
    .reports-page__table td {
        padding: var(--clk-space-md);
    }

    .reports-page__row--project td {
        padding-left: var(--clk-space-xl);
    }
}

@media (min-width: 1201px) {
    .reports-page__summary {
        grid-template-columns: repeat(5, 1fr);
    }
}


/* ==========================================
   CHECKBOX DROPDOWN
   ========================================== */
.checkbox-dropdown {
    position: relative;
    width: 100%;
}

.checkbox-dropdown__trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--clk-space-sm);
    width: 100%;
    padding: var(--clk-space-sm) var(--clk-space-md);
    font-size: var(--clk-text-base);
    font-family: inherit;
    text-align: left;
    background: var(--clk-surface);
    border: 1px solid var(--clk-border-light);
    border-radius: var(--clk-radius);
    color: var(--clk-text);
    min-height: 40px;
    cursor: pointer;
    transition: border-color var(--clk-transition-fast), box-shadow var(--clk-transition-fast);
}

.checkbox-dropdown__trigger:hover {
    border-color: var(--clk-border);
}

.checkbox-dropdown__trigger:focus-visible {
    outline: none;
    border-color: var(--clk-primary-light);
    box-shadow: var(--clk-focus-ring);
}

.checkbox-dropdown__trigger:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.checkbox-dropdown__trigger-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.checkbox-dropdown__trigger-icon {
    flex-shrink: 0;
    transition: transform var(--clk-transition-fast);
}

.checkbox-dropdown--open .checkbox-dropdown__trigger-icon {
    transform: rotate(180deg);
}

.checkbox-dropdown__menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 280px;
    overflow-y: auto;
    background: var(--clk-surface);
    border: 1px solid var(--clk-border);
    border-top: none;
    border-radius: 0 0 var(--clk-radius) var(--clk-radius);
    box-shadow: var(--clk-shadow-lg);
    list-style: none;
    margin: 0;
    padding: 0;
    z-index: 100;
}

.checkbox-dropdown__toggle {
    display: flex;
    align-items: center;
    gap: var(--clk-space-sm);
    padding: var(--clk-space-sm) var(--clk-space-md);
    border-bottom: 1px solid var(--clk-border-light);
    cursor: pointer;
    font-weight: 500;
    font-size: var(--clk-text-sm);
    color: var(--clk-primary-light);
    transition: background var(--clk-transition-fast);
}

.checkbox-dropdown__toggle:hover,
.checkbox-dropdown__toggle--highlighted {
    background: var(--clk-primary-subtle);
}

.checkbox-dropdown__item {
    display: flex;
    align-items: center;
    gap: var(--clk-space-sm);
    padding: var(--clk-space-sm) var(--clk-space-md);
    cursor: pointer;
    font-size: var(--clk-text-sm);
    transition: background var(--clk-transition-fast);
}

.checkbox-dropdown__item:hover,
.checkbox-dropdown__item--highlighted {
    background: var(--clk-primary-subtle);
}

.checkbox-dropdown__checkbox {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    accent-color: var(--clk-primary);
    pointer-events: none;
}

.checkbox-dropdown__label {
    flex: 1;
    user-select: none;
}


/* ==========================================
   PRINT STYLES
   ========================================== */
@media print {
    /* Reset for print */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    body {
        background: white !important;
        color: black !important;
        font-size: 10pt !important;
        line-height: 1.4 !important;
    }

    /* Hide non-printable elements */
    .no-print,
    .sidebar,
    .nav-menu,
    .toast-container,
    .modal-backdrop,
    button:not(.print-show),
    .btn:not(.print-show),
    .filter-actions,
    .export-actions,
    .report-tabs,
    .date-presets,
    nav,
    header:not(.print-header) {
        display: none !important;
    }

    /* Page setup */
    @page {
        size: A4;
        margin: 15mm 10mm;
    }

    @page :first {
        margin-top: 10mm;
    }

    /* Print header */
    .print-header {
        display: block !important;
        text-align: center;
        padding-bottom: 10pt;
        margin-bottom: 15pt;
        border-bottom: 1px solid #ccc;
    }

    .print-header h1 {
        font-size: 16pt !important;
        margin: 0 0 5pt 0 !important;
    }

    .print-header .print-subtitle {
        font-size: 10pt;
        color: #666;
    }

    /* Main content for print */
    .main-content,
    .content-area,
    .reports-page {
        padding: 0 !important;
        margin: 0 !important;
        max-width: none !important;
    }

    /* Cards for print */
    .card,
    .summary-card,
    .report-content {
        border: 1px solid #ddd !important;
        box-shadow: none !important;
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .summary-card.highlight {
        background: #f5f5f5 !important;
        color: black !important;
    }

    .summary-card.highlight h3,
    .summary-card.highlight .summary-value,
    .summary-card.highlight .summary-subtext {
        color: black !important;
    }

    /* Tables for print */
    table {
        width: 100% !important;
        border-collapse: collapse !important;
    }

    th, td {
        border: 1px solid #ddd !important;
        padding: 6pt 8pt !important;
        text-align: left !important;
    }

    th {
        background: #f5f5f5 !important;
        font-weight: 600 !important;
    }

    tr {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    /* Page breaks */
    h1, h2, h3 {
        page-break-after: avoid;
        break-after: avoid;
    }

    .page-break {
        page-break-before: always;
        break-before: always;
    }

    .avoid-break {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    /* Links in print */
    a {
        color: black !important;
        text-decoration: none !important;
    }

    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 8pt;
        color: #666;
    }

    /* Print-specific elements */
    .print-only {
        display: block !important;
    }

    /* Summary cards in print - grid layout */
    .summary-cards {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 10pt !important;
        margin-bottom: 15pt !important;
    }

    .summary-card {
        flex: 1 1 150px !important;
        min-width: 120px !important;
        padding: 8pt !important;
    }

    /* Status colors for print */
    .status-dot.draft { background: #ffc107 !important; }
    .status-dot.committed { background: #17a2b8 !important; }
    .status-dot.booked { background: #28a745 !important; }

    .badge--draft {
        background: #fff3cd !important;
        color: #856404 !important;
        border: 1px solid #ffc107 !important;
    }
    .badge--committed {
        background: #cce5ff !important;
        color: #004085 !important;
        border: 1px solid #007bff !important;
    }
    .badge--booked {
        background: #d4edda !important;
        color: #155724 !important;
        border: 1px solid #28a745 !important;
    }

    /* Percentage bars for print */
    .percentage-bar-track {
        background: #e0e0e0 !important;
        border: 1px solid #ccc !important;
    }

    .percentage-bar-fill {
        background: #333 !important;
    }

    /* Color dots for print */
    .color-dot {
        border: 1px solid #999 !important;
    }

    /* Footer for print */
    .print-footer {
        display: block !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        text-align: center;
        font-size: 8pt;
        color: #999;
        padding-top: 5pt;
        border-top: 1px solid #ddd;
    }

    /* Report date range display */
    .report-date-range {
        display: block !important;
        text-align: center;
        font-size: 11pt;
        color: #666;
        margin-bottom: 15pt;
    }

    /* Reports Print Overrides */
    .reports-page {
        padding: 0;
        max-width: none;
    }

    .reports-page__header .reports-page__actions,
    .reports-page__filters,
    .reports-page__tabs {
        display: none !important;
    }

    .reports-page__summary {
        grid-template-columns: repeat(5, 1fr);
        margin-bottom: var(--clk-space-md);
    }

    .reports-page__card {
        border: 1px solid #ccc;
        box-shadow: none;
        padding: var(--clk-space-sm);
    }

    .reports-page__card--primary {
        background: #f0f0f0 !important;
        color: black !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .reports-page__card--primary .reports-page__card-label {
        color: #666 !important;
    }

    .reports-page__content {
        border: none;
    }

    .reports-page__table {
        page-break-inside: auto;
    }

    .reports-page__table tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }

    .reports-page__table tbody tr:hover {
        background: transparent;
    }

    .reports-page__percentage-bar {
        background: #666 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .reports-page__color-dot {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }


}

/* Screen-only elements (hide in print) */
@media screen {
    .print-only,
    .print-header,
    .print-footer {
        display: none !important;
    }
}

/* ============================================
   MOBILE & RESPONSIVE STYLES
   ============================================ */

/* Touch-friendly minimum sizes */
@media (pointer: coarse) {
    /* Larger touch targets for buttons and links */
    .btn,
    button,
    a.nav-item,
    .clickable {
        min-height: 44px;
        min-width: 44px;
    }

    /* Larger form controls */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="date"],
    select,
    textarea {
        min-height: 44px;
        font-size: 16px; /* Prevents iOS zoom on focus */
    }

    /* Larger checkboxes and radios */
    input[type="checkbox"],
    input[type="radio"] {
        min-width: 24px;
        min-height: 24px;
    }
}

/* Small screens (mobile phones) */
@media (max-width: 639px) {
    :root {
        --clk-sidebar-width: 0px;
        --clk-header-height: 56px;
    }

    /* Mobile overlay when sidebar is open */
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .sidebar-overlay.show {
        display: block;
    }

    /* Mobile header adjustments */
    .header {
        padding: 0 var(--clk-space-sm);
    }

    /* Main content full width */
    .main-content {
        margin-left: 0 !important;
        padding: var(--clk-space-sm);
    }

    /* Mobile bottom navigation */
    .mobile-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--clk-surface);
        border-top: 1px solid var(--clk-border-light);
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
        z-index: 100;
        padding: var(--clk-space-xs) 0;
        padding-bottom: env(safe-area-inset-bottom, var(--clk-space-xs));
    }

    .mobile-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: var(--clk-space-xs);
        color: var(--clk-text-secondary);
        text-decoration: none;
        font-size: var(--clk-text-xs);
        gap: 2px;
        transition: color 0.15s ease;
    }

    .mobile-nav-item:hover,
    .mobile-nav-item.active {
        color: var(--clk-primary);
    }

    .mobile-nav-item svg {
        width: 24px;
        height: 24px;
    }

    /* Add bottom padding for mobile nav */
    body {
        padding-bottom: 70px;
    }

    /* Stack column view vertically on mobile */
    .column-view {
        flex-direction: column;
    }

    .column-view__column {
        width: 100% !important;
        max-height: 200px;
    }

    /* Adjust tables for mobile */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Card adjustments */
    .card {
        border-radius: var(--clk-radius);
    }

    /* Modal full-screen on mobile */
    .modal-content {
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        margin: 0;
    }

    /* Slide panel full width on mobile */
    .slide-panel {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Hide desktop-only elements */
    .desktop-only {
        display: none !important;
    }

    /* Calendar adjustments */
    .calendar-view {
        font-size: var(--clk-text-sm);
    }

    .calendar-day {
        min-height: 60px;
    }

    /* Form layout */
    .form-row {
        flex-direction: column;
        gap: var(--clk-space-sm);
    }

    .form-group {
        width: 100%;
    }
}

/* Medium screens (tablets) */
@media (min-width: 640px) and (max-width: 1023px) {
    :root {
        --clk-sidebar-width: 200px;
    }

    /* Tablet column view */
    .column-view {
        flex-wrap: wrap;
    }

    .column-view__column {
        min-width: 200px;
    }

    /* Hide mobile nav on tablets */
    .mobile-nav {
        display: none;
    }

    /* Hide mobile-only elements */
    .mobile-only {
        display: none !important;
    }
}

/* Large screens (desktops) */
@media (min-width: 1024px) {
    /* Hide mobile elements */
    .mobile-nav,
    .mobile-only {
        display: none !important;
    }

    .sidebar-overlay {
        display: none !important;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --clk-border-light: #000;
        --clk-border: #000;
        --clk-text-secondary: #000;
        --clk-text-muted: #333;
    }

    .btn,
    input,
    select,
    textarea {
        border-width: 2px;
    }
}

/* Offline indicator styles */
body.offline::after {
    content: 'Offline';
    position: fixed;
    top: var(--clk-header-height);
    left: 50%;
    transform: translateX(-50%);
    background: var(--clk-warning);
    color: #000;
    padding: var(--clk-space-xs) var(--clk-space-md);
    border-radius: 0 0 var(--clk-radius) var(--clk-radius);
    font-size: var(--clk-text-sm);
    font-weight: 500;
    z-index: 9999;
    box-shadow: var(--clk-shadow-md);
}

/* Safe area padding for notched devices */
@supports (padding: env(safe-area-inset-bottom)) {
    .mobile-nav {
        padding-bottom: calc(var(--clk-space-xs) + env(safe-area-inset-bottom));
    }

    body {
        padding-bottom: calc(70px + env(safe-area-inset-bottom));
    }
}

/* ------------------------------------------
   API KEYS PAGE
   ------------------------------------------ */

.page-api-keys {
    display: flex;
    flex-direction: column;
    gap: var(--clk-space-lg);
    padding: var(--clk-space-md);
}

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

.empty-state {
    padding: var(--clk-space-2xl) var(--clk-space-lg);
    text-align: center;
    color: var(--clk-text-secondary);
}

/* One-time key reveal modal */
.modal--reveal {
    background: var(--clk-surface);
    border-radius: var(--clk-radius-lg);
    box-shadow: var(--clk-shadow-lg);
    padding: var(--clk-space-lg);
    max-width: 560px;
    width: 90%;
    animation: dialogScaleIn 0.2s ease;
}

.modal--reveal h2 {
    margin: 0 0 var(--clk-space-md);
    font-size: var(--clk-text-lg);
    font-weight: 600;
    color: var(--clk-text);
}

.modal__footer {
    display: flex;
    justify-content: flex-end;
    margin-top: var(--clk-space-lg);
}

.reveal-warning {
    color: var(--clk-warning);
    font-size: var(--clk-text-sm);
}

.reveal-key {
    display: flex;
    gap: var(--clk-space-sm);
    align-items: center;
    margin-top: var(--clk-space-md);
}

.reveal-key .input {
    font-family: var(--clk-font-mono);
}

/* ================================================================
   Clockopus Admin console
   All selectors prefixed with .admin-* to avoid collision with the
   shared design-system rules above.
   Tokens: reuses --clk-* variables defined in :root above.
   ================================================================ */

/* Shell */
.admin-shell {
    display: flex;
    flex-direction: row;
    min-height: 100vh;
    background: var(--clk-bg);
}

/* Left sidebar navigation */
.admin-nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--clk-space-xs);
    width: 230px;
    flex-shrink: 0;
    padding: var(--clk-space-md);
    background: var(--clk-surface);
    border-right: 1px solid var(--clk-border-light);
    box-shadow: var(--clk-shadow-sm);
}

.admin-nav__brand {
    font-size: var(--clk-text-md);
    font-weight: 700;
    color: var(--clk-primary);
    white-space: nowrap;
    padding: var(--clk-space-sm) var(--clk-space-sm) var(--clk-space-md);
}

.admin-nav__brand span {
    font-weight: 500;
    color: var(--clk-text-secondary);
    margin-left: 2px;
}

.admin-nav__links {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.admin-nav__links a {
    display: flex;
    align-items: center;
    padding: var(--clk-space-sm) var(--clk-space-md);
    border-radius: var(--clk-radius);
    font-size: var(--clk-text-sm);
    font-weight: 500;
    color: var(--clk-text-secondary);
    text-decoration: none;
    transition: background var(--clk-transition-fast), color var(--clk-transition-fast);
}

.admin-nav__links a:hover {
    background: var(--clk-primary-subtle);
    color: var(--clk-primary);
}

.admin-nav__links a.active {
    background: var(--clk-primary);
    color: white;
}

/* User block pinned to the bottom of the sidebar */
.admin-nav__user {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--clk-space-sm);
    padding-top: var(--clk-space-md);
    border-top: 1px solid var(--clk-border-light);
}

.admin-nav__email {
    font-size: var(--clk-text-sm);
    color: var(--clk-text-muted);
    padding: 0 var(--clk-space-sm);
    word-break: break-all;
}

/* Main content area */
.admin-main {
    flex: 1;
    min-width: 0;
    padding: var(--clk-space-lg);
    box-sizing: border-box;
}

/* On phones the sidebar collapses back to a top bar */
@media (max-width: 640px) {
    .admin-shell {
        flex-direction: column;
    }

    .admin-nav {
        width: auto;
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
        border-right: none;
        border-bottom: 1px solid var(--clk-border-light);
    }

    .admin-nav__brand {
        padding: var(--clk-space-sm);
    }

    .admin-nav__links {
        flex-direction: row;
        flex-wrap: wrap;
        flex: 1;
    }

    .admin-nav__user {
        margin-top: 0;
        flex-direction: row;
        align-items: center;
        border-top: none;
        padding-top: 0;
    }
}

/* Anonymous login card + access-denied (rendered without the nav bar) */
.admin-login {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--clk-space-lg) 0;
}

.admin-login__card {
    width: 100%;
    max-width: 420px;
    background: var(--clk-surface);
    border: 1px solid var(--clk-border-light);
    border-radius: var(--clk-radius-lg);
    box-shadow: var(--clk-shadow-md);
    padding: var(--clk-space-2xl);
    text-align: center;
}

.admin-login__brand {
    font-size: var(--clk-text-lg);
    font-weight: 700;
    color: var(--clk-primary);
    margin-bottom: var(--clk-space-lg);
}

.admin-login__brand span {
    font-weight: 500;
    color: var(--clk-text-secondary);
    margin-left: 2px;
}

.admin-login__title {
    font-size: var(--clk-text-xl);
    font-weight: 700;
    color: var(--clk-text);
    margin: 0 0 var(--clk-space-sm);
}

.admin-login__lead {
    color: var(--clk-text-secondary);
    font-size: var(--clk-text-sm);
    line-height: 1.5;
    margin: 0 0 var(--clk-space-xl);
}

.admin-login__btn {
    width: 100%;
    justify-content: center;
}

/* Toolbar (above a table or list) */
.admin-toolbar {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--clk-space-sm);
    margin-bottom: var(--clk-space-md);
    flex-wrap: wrap;
}

/* Data table */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--clk-surface);
    border-radius: var(--clk-radius-md);
    box-shadow: var(--clk-shadow-sm);
    overflow: hidden;
}

.admin-table th {
    padding: var(--clk-space-sm) var(--clk-space-md);
    font-size: var(--clk-text-sm);
    font-weight: 600;
    text-align: left;
    color: var(--clk-text-secondary);
    background: var(--clk-bg);
    border-bottom: 2px solid var(--clk-border-light);
}

.admin-table td {
    padding: var(--clk-space-sm) var(--clk-space-md);
    font-size: var(--clk-text-sm);
    color: var(--clk-text);
    border-bottom: 1px solid var(--clk-border-light);
    vertical-align: middle;
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

.admin-table tbody tr:hover td {
    background: var(--clk-primary-subtle);
}

.admin-row {
    cursor: pointer;
}

/* Pagination */
.admin-pager {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: var(--clk-space-sm);
    margin-top: var(--clk-space-md);
    font-size: var(--clk-text-sm);
    color: var(--clk-text-secondary);
}

/* Empty state */
.admin-empty {
    padding: var(--clk-space-2xl) var(--clk-space-lg);
    text-align: center;
    color: var(--clk-text-muted);
    font-size: var(--clk-text-sm);
}

/* Detail view (dl-based key/value grid) */
.admin-detail {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: var(--clk-space-sm) var(--clk-space-lg);
    margin: 0;
}

.admin-detail dt {
    font-size: var(--clk-text-sm);
    font-weight: 600;
    color: var(--clk-text-secondary);
    white-space: nowrap;
}

.admin-detail dd {
    font-size: var(--clk-text-sm);
    color: var(--clk-text);
    margin: 0;
    word-break: break-word;
}

/* ---- Tenant-status badge variants ---- */
/* .badge base class is already defined above; these are additive modifiers */

.badge--pending {
    background: var(--clk-warning-bg);
    color: var(--clk-status-draft-text);  /* amber text, same token family */
}

.badge--suspended {
    background: var(--clk-error-bg);
    color: var(--clk-error);
}

.badge--deleted {
    background: var(--clk-disabled);
    color: var(--clk-text-secondary);
}

/* .badge--active already defined above (green / booked palette) */

/* Lifecycle action buttons bar */
.admin-actions {
    display: flex;
    gap: var(--clk-space-sm);
    flex-wrap: wrap;
    align-items: center;
    margin: var(--clk-space-md) 0;
}

.admin-danger {
    display: flex;
    gap: var(--clk-space-sm);
    align-items: center;
    margin-left: auto;
}

/* ============================================================================
   ABYSSAL COMMAND DECK — Clockopus.Admin theme
   A dark, deep-ocean operator console. Bioluminescent teal as the dominant
   accent, coral as the critical counter-accent, monospace for technical data.
   Everything is scoped under .admin-shell so it overrides the inherited light
   design system without touching the customer-facing app. Tokens first.
   ========================================================================== */

.admin-shell {
    /* palette */
    --adm-abyss:   #060e16;
    --adm-ink:     #0b1622;
    --adm-ink-2:   #11202e;
    --adm-ink-3:   #16293a;
    --adm-line:    rgba(125, 180, 210, 0.10);
    --adm-line-2:  rgba(125, 180, 210, 0.20);
    --adm-text:    #d6e6f0;
    --adm-text-2:  #8aa2b4;
    --adm-text-3:  #5d7488;
    --adm-cyan:    #34e3d0;
    --adm-cyan-2:  #7af2e6;
    --adm-cyan-soft: rgba(52, 227, 208, 0.12);
    --adm-glow:    rgba(52, 227, 208, 0.42);
    --adm-coral:   #ff6f61;
    --adm-coral-soft: rgba(255, 111, 97, 0.14);
    --adm-amber:   #f5b73c;
    --adm-amber-soft: rgba(245, 183, 60, 0.14);
    --adm-green:   #34dca0;
    --adm-green-soft: rgba(52, 220, 160, 0.14);
    /* type */
    --adm-display: 'Bricolage Grotesque', 'Hanken Grotesk', system-ui, sans-serif;
    --adm-ui:      'Hanken Grotesk', system-ui, -apple-system, sans-serif;
    --adm-mono:    'JetBrains Mono', 'Fira Code', Consolas, monospace;

    position: relative;
    color: var(--adm-text);
    font-family: var(--adm-ui);
    -webkit-font-smoothing: antialiased;
    background-color: var(--adm-abyss);
    background-image:
        radial-gradient(900px 600px at 12% -8%, rgba(52, 227, 208, 0.07), transparent 60%),
        radial-gradient(820px 560px at 108% 112%, rgba(255, 111, 97, 0.045), transparent 60%),
        linear-gradient(180deg, #07111b 0%, #060d15 100%),
        repeating-linear-gradient(0deg, rgba(125, 180, 210, 0.022) 0 1px, transparent 1px 30px),
        repeating-linear-gradient(90deg, rgba(125, 180, 210, 0.022) 0 1px, transparent 1px 30px);
    background-attachment: fixed;
}

/* kill the white flash before .admin-shell paints */
html, body { background: #060e16; }
.admin-shell ::selection { background: var(--adm-cyan); color: #06121a; }

/* ---- Sidebar ------------------------------------------------------------- */
.admin-shell .admin-nav {
    background:
        linear-gradient(180deg, rgba(20, 38, 54, 0.55), rgba(9, 20, 30, 0.85)),
        var(--adm-ink);
    border-right: 1px solid var(--adm-line);
    box-shadow: 1px 0 0 rgba(52, 227, 208, 0.06), 18px 0 40px -30px rgba(0, 0, 0, 0.9);
    padding: var(--clk-space-lg) var(--clk-space-md) var(--clk-space-md);
    gap: var(--clk-space-md);
}

.admin-shell .admin-nav__head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 var(--clk-space-sm);
    animation: adm-rise 0.5s both;
}

.admin-shell .adm-mark {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    color: var(--adm-cyan);
    filter: drop-shadow(0 0 7px var(--adm-glow));
    animation: adm-breathe 5s ease-in-out infinite;
}

.admin-shell .admin-nav__wordmark,
.admin-shell .admin-nav__brand {
    font-family: var(--adm-display);
    font-size: 1.18rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--adm-text);
    white-space: nowrap;
}
.admin-shell .admin-nav__wordmark span,
.admin-shell .admin-nav__brand span {
    color: var(--adm-cyan);
    font-weight: 600;
    margin-left: 3px;
}

.admin-shell .admin-nav__kicker {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: -4px var(--clk-space-sm) 2px;
    font-family: var(--adm-mono);
    font-size: 0.625rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--adm-text-3);
    animation: adm-rise 0.5s both 0.05s;
}
.admin-shell .admin-nav__kicker::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--adm-green);
    box-shadow: 0 0 8px var(--adm-green);
    animation: adm-blip 2.6s ease-out infinite;
}

.admin-shell .admin-nav__links { gap: 3px; }
.admin-shell .admin-nav__links li { animation: adm-rise 0.45s both; }
.admin-shell .admin-nav__links li:nth-child(1) { animation-delay: 0.08s; }
.admin-shell .admin-nav__links li:nth-child(2) { animation-delay: 0.13s; }
.admin-shell .admin-nav__links li:nth-child(3) { animation-delay: 0.18s; }
.admin-shell .admin-nav__links li:nth-child(4) { animation-delay: 0.23s; }

.admin-shell .admin-nav__links a {
    position: relative;
    gap: 11px;
    padding: 9px 12px;
    border-radius: 9px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--adm-text-2);
    transition: color 0.16s ease, background 0.16s ease;
}
.admin-shell .admin-nav__links a svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    opacity: 0.8;
    transition: filter 0.16s ease, opacity 0.16s ease;
}
.admin-shell .admin-nav__links a:hover {
    background: var(--adm-ink-2);
    color: var(--adm-text);
}
.admin-shell .admin-nav__links a:hover svg { opacity: 1; }
.admin-shell .admin-nav__links a.active {
    background: linear-gradient(90deg, var(--adm-cyan-soft), transparent 85%);
    color: var(--adm-cyan-2);
}
.admin-shell .admin-nav__links a.active svg {
    opacity: 1;
    filter: drop-shadow(0 0 6px var(--adm-glow));
}
.admin-shell .admin-nav__links a.active::before {
    content: "";
    position: absolute;
    left: calc(-1 * var(--clk-space-md));
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    border-radius: 0 3px 3px 0;
    background: var(--adm-cyan);
    box-shadow: 0 0 12px var(--adm-glow);
}

/* user / account block pinned to the bottom */
.admin-shell .admin-nav__user {
    border-top: 1px solid var(--adm-line);
    padding-top: var(--clk-space-md);
    gap: 10px;
    flex-direction: row;
    align-items: center;
}
.admin-shell .admin-nav__avatar {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--adm-ink-3);
    border: 1px solid var(--adm-cyan);
    box-shadow: 0 0 12px -2px var(--adm-glow), inset 0 0 10px -6px var(--adm-cyan);
    color: var(--adm-cyan-2);
    font-family: var(--adm-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.admin-shell .admin-nav__userinfo {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
    line-height: 1.25;
}
.admin-shell .admin-nav__email {
    font-family: var(--adm-mono);
    font-size: 0.7rem;
    color: var(--adm-text-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0;
}
.admin-shell .admin-nav__role {
    font-family: var(--adm-mono);
    font-size: 0.58rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--adm-cyan);
}
.admin-shell .admin-nav__signout {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 8px;
    color: var(--adm-text-3);
    border: 1px solid transparent;
    transition: color 0.16s, border-color 0.16s, background 0.16s;
}
.admin-shell .admin-nav__signout svg { width: 16px; height: 16px; }
.admin-shell .admin-nav__signout:hover {
    color: var(--adm-coral);
    border-color: var(--adm-coral-soft);
    background: var(--adm-coral-soft);
}

/* ---- Main + headings ----------------------------------------------------- */
.admin-shell .admin-main {
    animation: adm-rise 0.55s both 0.12s;
}
.admin-shell .admin-main h1 {
    font-family: var(--adm-display);
    font-size: 1.85rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: #eaf4fa;
    margin: 0 0 var(--clk-space-lg);
}
.admin-shell .admin-main h1::after {
    content: "";
    display: block;
    width: 46px;
    height: 3px;
    margin-top: 11px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--adm-cyan), transparent);
    box-shadow: 0 0 14px var(--adm-glow);
}
.admin-shell .admin-main h2 {
    font-family: var(--adm-display);
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.015em;
    color: #dcebf2;
    margin: var(--clk-space-xl) 0 var(--clk-space-md);
}

/* ---- Toolbar + inputs ---------------------------------------------------- */
.admin-shell .input,
.admin-shell .admin-toolbar select {
    background: var(--adm-ink-3);
    border: 1px solid var(--adm-line-2);
    color: var(--adm-text);
    border-radius: 9px;
    font-family: var(--adm-ui);
    font-size: 0.85rem;
    transition: border-color 0.16s, box-shadow 0.16s, background 0.16s;
}
.admin-shell .input::placeholder { color: var(--adm-text-3); }
.admin-shell .input:focus,
.admin-shell .admin-toolbar select:focus {
    outline: none;
    border-color: var(--adm-cyan);
    box-shadow: 0 0 0 3px var(--adm-cyan-soft), 0 0 18px -6px var(--adm-glow);
    background: var(--adm-ink-2);
}
.admin-shell .admin-toolbar select option { background: var(--adm-ink); color: var(--adm-text); }
.admin-shell .admin-toolbar { margin-bottom: var(--clk-space-lg); }

/* ---- Data table ---------------------------------------------------------- */
.admin-shell .admin-table {
    background: linear-gradient(180deg, rgba(17, 32, 46, 0.6), rgba(11, 22, 34, 0.6));
    border: 1px solid var(--adm-line);
    border-radius: 14px;
    box-shadow: 0 20px 50px -34px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(125, 180, 210, 0.05);
    overflow: hidden;
}
.admin-shell .admin-table th {
    background: rgba(7, 15, 23, 0.6);
    color: var(--adm-text-3);
    font-family: var(--adm-mono);
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 13px var(--clk-space-md);
    border-bottom: 1px solid var(--adm-line-2);
}
.admin-shell .admin-table td {
    color: var(--adm-text);
    font-size: 0.84rem;
    padding: 12px var(--clk-space-md);
    border-bottom: 1px solid var(--adm-line);
}
.admin-shell .admin-table tbody tr { position: relative; transition: background 0.14s ease; }
.admin-shell .admin-table tbody tr:hover td { background: rgba(52, 227, 208, 0.05); }
.admin-shell .admin-row:hover td:first-child { box-shadow: inset 3px 0 0 var(--adm-cyan); }
.admin-shell .admin-row { transition: background 0.14s; }

/* monospace the technical columns (subdomains, ids, dates, counts) */
.admin-shell .admin-table--tenants td:nth-child(2),
.admin-shell .admin-table--tenants td:nth-child(5),
.admin-shell .admin-table--tenants td:nth-child(6),
.admin-shell .admin-table--requests td:nth-child(3),
.admin-shell .admin-table--requests td:nth-child(5),
.admin-shell .admin-table--audit td:nth-child(1),
.admin-shell .admin-table--audit td:nth-child(5) {
    font-family: var(--adm-mono);
    font-size: 0.76rem;
    color: var(--adm-text-2);
    font-variant-numeric: tabular-nums;
}
.admin-shell .admin-table--audit td:nth-child(6) { font-family: var(--adm-mono); font-size: 0.74rem; }

/* ---- Status badges (glowing pills) -------------------------------------- */
.admin-shell .badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 3px 11px 3px 9px;
    border-radius: 999px;
    font-family: var(--adm-mono);
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border: 1px solid transparent;
    background: var(--adm-ink-3);
    color: var(--adm-text-2);
}
.admin-shell .badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
}
.admin-shell .badge--active {
    color: var(--adm-green);
    background: var(--adm-green-soft);
    border-color: rgba(52, 220, 160, 0.3);
}
.admin-shell .badge--pending {
    color: var(--adm-amber);
    background: var(--adm-amber-soft);
    border-color: rgba(245, 183, 60, 0.3);
}
.admin-shell .badge--suspended {
    color: var(--adm-coral);
    background: var(--adm-coral-soft);
    border-color: rgba(255, 111, 97, 0.3);
}
.admin-shell .badge--deleted {
    color: var(--adm-text-3);
    background: rgba(125, 180, 210, 0.06);
    border-color: var(--adm-line-2);
}

/* ---- Buttons ------------------------------------------------------------- */
.admin-shell .btn {
    font-family: var(--adm-ui);
    font-weight: 600;
    border-radius: 9px;
    transition: transform 0.12s ease, box-shadow 0.16s ease, background 0.16s ease, color 0.16s, border-color 0.16s;
}
.admin-shell .btn:active { transform: translateY(1px); }
.admin-shell .btn--primary {
    background: linear-gradient(180deg, var(--adm-cyan-2), var(--adm-cyan));
    color: #06141a;
    border: none;
    box-shadow: 0 0 0 1px rgba(52, 227, 208, 0.5), 0 8px 22px -12px var(--adm-glow);
}
.admin-shell .btn--primary:hover:not(:disabled) {
    box-shadow: 0 0 0 1px var(--adm-cyan), 0 10px 26px -10px var(--adm-glow), 0 0 22px -6px var(--adm-glow);
}
.admin-shell .btn--ghost {
    background: rgba(125, 180, 210, 0.04);
    color: var(--adm-text-2);
    border: 1px solid var(--adm-line-2);
}
.admin-shell .btn--ghost:hover:not(:disabled) {
    color: var(--adm-cyan-2);
    border-color: var(--adm-cyan);
    background: var(--adm-cyan-soft);
    box-shadow: 0 0 18px -8px var(--adm-glow);
}
.admin-shell .btn--danger {
    background: linear-gradient(180deg, #ff8377, var(--adm-coral));
    color: #1a0907;
    border: none;
    box-shadow: 0 8px 22px -12px rgba(255, 111, 97, 0.5);
}
.admin-shell .btn--danger:hover:not(:disabled) {
    box-shadow: 0 0 0 1px var(--adm-coral), 0 0 22px -6px rgba(255, 111, 97, 0.5);
}
.admin-shell .btn:disabled { opacity: 0.45; }

/* ---- Detail (key/value) + actions + alerts ------------------------------ */
.admin-shell .admin-detail {
    background: rgba(11, 22, 34, 0.6);
    border: 1px solid var(--adm-line);
    border-radius: 14px;
    padding: var(--clk-space-lg) var(--clk-space-xl);
    gap: var(--clk-space-md) var(--clk-space-2xl);
}
.admin-shell .admin-detail dt {
    font-family: var(--adm-mono);
    font-size: 0.6rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--adm-text-3);
    align-self: center;
}
.admin-shell .admin-detail dd { color: var(--adm-text); font-size: 0.9rem; }

.admin-shell .admin-actions { margin: var(--clk-space-lg) 0; }
.admin-shell .admin-danger {
    background: var(--adm-coral-soft);
    border: 1px solid rgba(255, 111, 97, 0.25);
    border-radius: 11px;
    padding: 10px 12px;
}
.admin-shell .admin-danger span { font-size: 0.82rem; color: var(--adm-text-2); }

.admin-shell .alert {
    border-radius: 11px;
    border: 1px solid var(--adm-line-2);
    padding: 11px var(--clk-space-md);
    font-size: 0.85rem;
    margin: var(--clk-space-md) 0;
}
.admin-shell .alert--success {
    background: var(--adm-green-soft);
    border-color: rgba(52, 220, 160, 0.3);
    color: var(--adm-green);
}
.admin-shell .alert--error {
    background: var(--adm-coral-soft);
    border-color: rgba(255, 111, 97, 0.3);
    color: var(--adm-coral);
}

/* ---- Forms (create tenant) ---------------------------------------------- */
.admin-shell .form-group { margin-bottom: var(--clk-space-md); }
.admin-shell .form-group label {
    display: block;
    margin-bottom: 6px;
    font-family: var(--adm-mono);
    font-size: 0.6rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--adm-text-3);
}
.admin-shell form .input { width: 100%; }
.admin-shell .form-row { display: flex; gap: var(--clk-space-md); }
.admin-shell .form-row .form-group { flex: 1; }
.admin-shell .validation-message { color: var(--adm-coral); font-size: 0.75rem; }

/* ---- Pager + empty ------------------------------------------------------- */
.admin-shell .admin-pager {
    color: var(--adm-text-3);
    font-family: var(--adm-mono);
    font-size: 0.74rem;
    margin-top: var(--clk-space-lg);
}
.admin-shell .admin-empty {
    background: rgba(11, 22, 34, 0.5);
    border: 1px dashed var(--adm-line-2);
    border-radius: 14px;
    color: var(--adm-text-3);
    font-family: var(--adm-mono);
    font-size: 0.8rem;
    letter-spacing: 0.04em;
}

/* ---- Login / access-denied hero ----------------------------------------- */
.admin-shell .admin-login {
    min-height: 100vh;
    background:
        radial-gradient(60% 60% at 50% 38%, rgba(52, 227, 208, 0.08), transparent 70%),
        repeating-radial-gradient(circle at 50% 38%, transparent 0 38px, rgba(52, 227, 208, 0.03) 38px 39px);
}
.admin-shell .admin-login__card {
    position: relative;
    max-width: 440px;
    background:
        linear-gradient(180deg, rgba(20, 38, 54, 0.75), rgba(9, 19, 29, 0.92));
    border: 1px solid var(--adm-line-2);
    border-radius: 20px;
    padding: var(--clk-space-2xl) var(--clk-space-2xl) var(--clk-space-xl);
    box-shadow: 0 40px 90px -40px #000, inset 0 1px 0 rgba(125, 180, 210, 0.08), 0 0 60px -30px var(--adm-glow);
    overflow: hidden;
}
.admin-shell .admin-login__card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--adm-cyan), transparent);
    opacity: 0.7;
}
.admin-shell .admin-login__mark {
    display: grid;
    place-items: center;
    margin: 0 auto var(--clk-space-lg);
    width: 64px;
    height: 64px;
}
.admin-shell .admin-login__mark .adm-mark {
    width: 56px;
    height: 56px;
    color: var(--adm-cyan);
    filter: drop-shadow(0 0 16px var(--adm-glow));
    animation: adm-breathe 4.5s ease-in-out infinite;
}
.admin-shell .admin-login__brand {
    font-family: var(--adm-display);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--adm-text);
    margin-bottom: 4px;
}
.admin-shell .admin-login__brand span { color: var(--adm-cyan); }
.admin-shell .admin-login__kicker {
    font-family: var(--adm-mono);
    font-size: 0.62rem;
    letter-spacing: 0.34em;
    text-transform: uppercase;
    color: var(--adm-text-3);
    margin-bottom: var(--clk-space-xl);
}
.admin-shell .admin-login__title {
    font-family: var(--adm-display);
    font-size: 1.15rem;
    font-weight: 600;
    color: #eaf4fa;
    margin: 0 0 var(--clk-space-sm);
}
.admin-shell .admin-login__lead { color: var(--adm-text-2); }
.admin-shell .admin-login__btn {
    margin-top: var(--clk-space-sm);
    height: 46px;
    font-size: 0.92rem;
    gap: 9px;
}
.admin-shell .admin-login__foot {
    margin-top: var(--clk-space-lg);
    padding-top: var(--clk-space-md);
    border-top: 1px solid var(--adm-line);
    font-family: var(--adm-mono);
    font-size: 0.58rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--adm-text-3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.admin-shell .admin-login__foot::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--adm-green);
    box-shadow: 0 0 8px var(--adm-green);
    animation: adm-blip 2.6s ease-out infinite;
}

/* ---- Custom scrollbar ---------------------------------------------------- */
.admin-shell *::-webkit-scrollbar { width: 11px; height: 11px; }
.admin-shell *::-webkit-scrollbar-track { background: transparent; }
.admin-shell *::-webkit-scrollbar-thumb {
    background: var(--adm-ink-3);
    border: 3px solid transparent;
    background-clip: padding-box;
    border-radius: 999px;
}
.admin-shell *::-webkit-scrollbar-thumb:hover { background: rgba(52, 227, 208, 0.4); background-clip: padding-box; }

/* ---- Motion -------------------------------------------------------------- */
@keyframes adm-rise {
    from { opacity: 0; transform: translateY(9px); }
    to   { opacity: 1; transform: none; }
}
@keyframes adm-breathe {
    0%, 100% { filter: drop-shadow(0 0 6px var(--adm-glow)); }
    50%      { filter: drop-shadow(0 0 13px var(--adm-glow)); }
}
@keyframes adm-blip {
    0%   { box-shadow: 0 0 0 0 var(--adm-glow); }
    70%  { box-shadow: 0 0 0 7px rgba(52, 227, 208, 0); }
    100% { box-shadow: 0 0 0 0 rgba(52, 227, 208, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .admin-shell *,
    .admin-shell *::before,
    .admin-shell *::after {
        animation: none !important;
    }
}

/* keep the mobile top-bar variant coherent in the dark theme */
@media (max-width: 640px) {
    .admin-shell .admin-nav { border-right: none; border-bottom: 1px solid var(--adm-line); }
    .admin-shell .admin-nav__user { border-top: none; }
    .admin-shell .admin-nav__links a.active::before { display: none; }
}
