/**
 * Modern Telecom Service (MTS) Employee App - Brand Theme
 * Mobile-first design system with MTS brand colors
 */

:root {
    /* MTS Brand Colors - Burnt Orange Theme */
    --mts-orange-1: #CC5500;     /* Primary burnt orange */
    --mts-orange-2: #D2691E;     /* Secondary chocolate orange */
    --mts-orange-hover: #A0522D; /* Hover state - sienna */

    /* Gray Scale - Darker tones */
    --mts-gray-900: #1a1a1a;     /* Almost black */
    --mts-gray-800: #2d2d2d;     /* Charcoal */
    --mts-gray-700: #4a4a4a;     /* Dark gray */
    --mts-gray-500: #6b7280;     /* Medium gray */
    --mts-gray-300: #d1d5db;     /* Light gray borders */
    --mts-gray-100: #f5f5f5;     /* Light backgrounds */
    --mts-white: #ffffff;        /* Pure white */

    /* Semantic Colors */
    --mts-success: #10b981;      /* Green for success */
    --mts-warning: #f59e0b;      /* Amber for warnings */
    --mts-error: #ef4444;        /* Red for errors */
    --mts-info: #3b82f6;         /* Blue for info */

    /* Spacing Scale (mobile-first) */
    --spacing-xs: 0.25rem;       /* 4px */
    --spacing-sm: 0.5rem;        /* 8px */
    --spacing-md: 1rem;          /* 16px */
    --spacing-lg: 1.5rem;        /* 24px */
    --spacing-xl: 2rem;          /* 32px */
    --spacing-2xl: 3rem;         /* 48px */

    /* Project Card Spacing Scale (unified across views) */
    --card-space-xs: 0.375rem;   /* 6px */
    --card-space-sm: 0.625rem;   /* 10px */
    --card-space-md: 0.875rem;   /* 14px */
    --card-space-lg: 1.25rem;    /* 20px */

    /* Project Card Metrics */
    --card-gap: var(--card-space-md);
    --card-padding-y: 0.75rem;   /* 12px */
    --card-padding-x: 1.125rem;  /* 18px */
    --card-margin-bottom: var(--card-space-sm);

    /* Typography */
    --font-size-xs: 0.75rem;     /* 12px */
    --font-size-sm: 0.875rem;    /* 14px */
    --font-size-base: 1rem;      /* 16px */
    --font-size-lg: 1.125rem;    /* 18px */
    --font-size-xl: 1.25rem;     /* 20px */
    --font-size-2xl: 1.5rem;     /* 24px */
    --font-size-3xl: 2rem;       /* 32px */

    /* Border Radius */
    --radius-sm: 0.25rem;        /* 4px */
    --radius-md: 0.5rem;         /* 8px */
    --radius-lg: 1rem;           /* 16px */
    --radius-full: 9999px;       /* Pill shape */

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

    /* Z-index Scale */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 10500;
    --z-modal: 10510;
    --z-popover: 1060;
    --z-tooltip: 1070;

    /* Mobile Bottom Nav */
    --bottom-nav-height: 60px;
}

/* ===============================================
   Base Reset & Mobile-First Defaults
   =============================================== */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: var(--font-size-base);
    color: var(--mts-gray-900);
    background-color: var(--mts-gray-100);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===============================================
   Layout Components
   =============================================== */

/* ===== Sidebar ===== */
.mts-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 240px;
    background: #1a1a2e;
    color: #a0aec0;
    display: flex;
    flex-direction: column;
    z-index: var(--z-fixed, 1030);
    transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1) !important;
    overflow: hidden !important;
    overflow-x: hidden !important;
}

/* --- Collapsed Sidebar --- */
.mts-sidebar.collapsed {
    width: 64px !important;
    overflow: hidden !important;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
    scrollbar-width: none !important;
}

.mts-sidebar.collapsed::-webkit-scrollbar {
    display: none;
}

/* Hover-expand disabled — collapsed stays collapsed until toggled again.
   Kept as a comment so diffs make it clear this was an intentional removal. */

/* Toggle button */
.mts-sidebar-toggle {
    /* Toggle is a normal flex child inside the sidebar header so it
       sits next to the brand (expanded) or below the tile (collapsed)
       instead of floating on top of the logo. */
    position: static;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: #f3f4f6;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease;
    padding: 0;
    opacity: 1;
    flex-shrink: 0;
}

.mts-sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #e2e8f0;
}

.mts-sidebar-toggle svg {
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.mts-sidebar.collapsed .mts-sidebar-toggle svg {
    transform: rotate(180deg);
}

/* When collapsed (and not hovered), hide text labels */
.mts-sidebar.collapsed .mts-sidebar-item span,
.mts-sidebar.collapsed .sidebar-user-info,
.mts-sidebar.collapsed .sidebar-user-chevron,
.mts-sidebar.collapsed .sidebar-logout-btn span {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

/* Lock logo to fixed height so header never changes size */
.mts-sidebar .mts-sidebar-logo {
    height: 51px !important;
    width: auto !important;
    max-width: none !important;
    object-fit: contain;
    transition: opacity 0.2s ease;
}

/* Hide logo when collapsed but preserve its space */
.mts-sidebar.collapsed .mts-sidebar-logo {
    opacity: 0;
    visibility: hidden;
}

/* Smooth text fade on expand/collapse */
.mts-sidebar-item span,
.sidebar-user-info,
.sidebar-user-chevron,
.sidebar-logout-btn span {
    transition: opacity 0.3s ease 0.15s, width 0.01s;
}

.mts-sidebar.collapsed .mts-sidebar-item span,
.mts-sidebar.collapsed .sidebar-user-info,
.mts-sidebar.collapsed .sidebar-user-chevron,
.mts-sidebar.collapsed .sidebar-logout-btn span {
    transition: opacity 0.2s ease, width 0.01s 0.2s;
}

/* Center icons when collapsed — keep same vertical padding so items don't shift on hover */
.mts-sidebar.collapsed .mts-sidebar-item {
    justify-content: center;
    gap: 0;
}

.mts-sidebar.collapsed .mts-sidebar-nav {
    overflow: hidden !important;
    scrollbar-width: none;
    padding: var(--spacing-md) 0 !important;
}

.mts-sidebar.collapsed .mts-sidebar-nav::-webkit-scrollbar {
    display: none;
}


/* Collapsed footer adjustments */
.mts-sidebar.collapsed .mts-sidebar-footer {
    overflow: hidden !important;
    padding: 12px 4px !important;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.mts-sidebar.collapsed .sidebar-user-profile {
    justify-content: center !important;
    gap: 0 !important;
    padding: 8px 0 !important;
}

.mts-sidebar.collapsed .sidebar-logout-btn {
    justify-content: center !important;
    gap: 0 !important;
    padding: 6px !important;
    border: none !important;
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

.mts-sidebar.collapsed .sidebar-user-avatar {
    margin: 0 auto;
}

/* Tooltip on collapsed icons */
.mts-sidebar.collapsed .mts-sidebar-item {
    position: relative;
}

.mts-sidebar.collapsed .mts-sidebar-item::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: #2d2d44;
    color: #e2e8f0;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.mts-sidebar.collapsed .mts-sidebar-item:hover::after {
    opacity: 1;
}

.mts-sidebar-header {
    padding: 20px 20px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.mts-sidebar-logo {
    height: 48px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
}

.mts-sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mts-sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 400;
    color: #a0a0b0;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    user-select: none;
    margin: 0 0 1px;
}

.mts-sidebar-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #e2e8f0;
}

.mts-sidebar-item.active {
    background: var(--color-primary, #FF7F50);
    color: var(--color-primary-contrast, #fff);
    font-weight: 500;
}

.mts-sidebar-item.active .sidebar-icon {
    stroke: var(--color-primary-contrast, #fff);
}

.sidebar-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke: currentColor;
}

/* Sidebar Footer */
.mts-sidebar-footer {
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.sidebar-user-profile:hover {
    background: rgba(255, 255, 255, 0.06);
}

.sidebar-user-chevron {
    flex-shrink: 0;
    opacity: 0.4;
    transition: opacity 0.15s ease;
}

.sidebar-user-profile:hover .sidebar-user-chevron {
    opacity: 0.7;
}

.sidebar-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: #e2e8f0;
    flex-shrink: 0;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 13px;
    font-weight: 600;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 11px;
    color: #718096;
}

.sidebar-logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    color: #718096;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sidebar-logout-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #a0aec0;
    border-color: rgba(255, 255, 255, 0.15);
}

/* ===== App Shell (offset for sidebar) ===== */
.mts-app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-bottom: var(--bottom-nav-height);
    margin-left: 240px;
    transition: margin-left 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.mts-sidebar.collapsed ~ .mts-app-shell {
    margin-left: 64px;
}

.mts-header {
    background: var(--surface, #fff);
    color: var(--text, #111827);
    padding: 12px var(--spacing-lg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    border-bottom: 1px solid var(--border, #e5e7eb);
}

.mts-header-title {
    font-size: var(--font-size-lg);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--text, #111827);
}

.mts-logo {
    height: 28px;
    width: auto;
}

.mts-main {
    flex: 1;
    padding: var(--spacing-lg) var(--spacing-xl);
    max-width: none;
    margin: 0;
    width: 100%;
    background: #f7f8fa;
}

.mts-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: var(--mts-white);
    border-top: 2px solid var(--mts-gray-300);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: var(--z-fixed);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.mts-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    color: var(--mts-gray-500);
    text-decoration: none;
    font-size: var(--font-size-xs);
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    background: transparent;
}

.mts-nav-item:hover {
    color: var(--mts-orange-1);
    background: var(--mts-gray-100);
}

.mts-nav-item.active {
    color: var(--mts-orange-1);
    font-weight: 700;
}

.mts-nav-icon {
    font-size: var(--font-size-2xl);
    margin-bottom: var(--spacing-xs);
}

/* ===============================================
   Buttons
   =============================================== */

.mts-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: var(--font-size-base);
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
}

.mts-btn-primary {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
}

.mts-btn-primary:hover {
    background: var(--btn-primary-bg-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.mts-btn-primary:active {
    background: var(--btn-primary-bg-active);
}

.mts-btn-primary:focus-visible {
    outline: 2px solid var(--focus-ring-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.mts-btn-secondary {
    background: var(--mts-gray-100);
    color: var(--mts-gray-900);
    border: 1px solid var(--mts-gray-300);
}

.mts-btn-secondary:hover {
    background: var(--mts-gray-300);
}

.mts-btn-success {
    background: var(--mts-success);
    color: var(--mts-white);
}

.mts-btn-success:hover {
    background: #059669;
}

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

.mts-btn-danger:hover {
    background: #dc2626;
}

.mts-btn-full {
    width: 100%;
}

.mts-btn-large {
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: var(--font-size-lg);
}

.mts-btn-small {
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: var(--font-size-sm);
}

/* Pay Period Filter Buttons */
.pay-period-btn {
    border-radius: var(--radius-full);
    transition: all 0.2s ease;
}

.pay-period-btn.active {
    background: var(--mts-primary);
    color: white;
    border-color: var(--mts-primary);
}

.pay-period-btn:hover:not(.active) {
    background: var(--mts-gray-100);
}

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

/* Tab Notification Badge */
.tab-notification-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
    animation: badgePulse 2s ease-in-out infinite;
}

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

/* ===============================================
   Forms
   =============================================== */

.mts-form-group {
    margin-bottom: var(--spacing-lg);
}

.mts-label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--mts-gray-700);
    margin-bottom: var(--spacing-sm);
}

.mts-input,
.mts-select,
.mts-textarea {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--font-size-base);
    color: var(--mts-gray-900);
    background: var(--mts-white);
    border: 1px solid var(--mts-gray-300);
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.mts-input:focus,
.mts-select:focus,
.mts-textarea:focus {
    outline: none;
    border-color: var(--mts-orange-1);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.mts-textarea {
    resize: vertical;
    min-height: 100px;
}

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

.mts-error-message {
    color: var(--mts-error);
    font-size: var(--font-size-sm);
    margin-top: var(--spacing-xs);
}

/* ===============================================
   Cards
   =============================================== */

.mts-card {
    background: var(--mts-white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--spacing-md);
}

.mts-card-header {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--mts-gray-900);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--mts-gray-100);
}

.mts-card-body {
    color: var(--mts-gray-700);
}

.mts-card-footer {
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--mts-gray-100);
}

/* ===============================================
   Badges & Tags
   =============================================== */

.mts-badge {
    display: inline-flex;
    align-items: center;
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: var(--font-size-xs);
    font-weight: 600;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.mts-badge-primary {
    background: var(--mts-orange-1);
    color: var(--mts-white);
}

.mts-badge-success {
    background: var(--mts-success);
    color: var(--mts-white);
}

.mts-badge-warning {
    background: var(--chip-primary-bg);
    color: var(--chip-primary-text);
    border: 1px solid var(--chip-primary-border);
}

.mts-badge-error {
    background: var(--mts-error);
    color: var(--mts-white);
}

.mts-badge-gray {
    background: var(--mts-gray-300);
    color: var(--mts-gray-900);
}

.mts-badge-info {
    background: var(--mts-info);
    color: var(--mts-white);
}

/* ===============================================
   Lists
   =============================================== */

.mts-list {
    list-style: none;
    background: var(--mts-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.mts-list-item {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--mts-gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.2s;
}

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

.mts-list-item:hover {
    background: var(--mts-gray-100);
}

.mts-list-item-clickable {
    cursor: pointer;
}

/* ===============================================
   Alerts & Messages
   =============================================== */

.mts-alert {
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: start;
    gap: var(--spacing-sm);
}

.mts-alert-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid var(--mts-success);
}

.mts-alert-warning {
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid var(--mts-warning);
}

.mts-alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--mts-error);
}

.mts-alert-info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid var(--mts-info);
}

/* ===============================================
   Modals
   =============================================== */

.mts-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: var(--z-modal-backdrop);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
}

.mts-modal > .modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
}

.mts-modal > .modal-backdrop.clickable {
    cursor: pointer;
}

.mts-modal > .modal-dialog {
    position: relative;
    background: var(--mts-white);
    border-radius: var(--radius-lg);
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
}

.mts-modal > .modal-dialog.modal-small {
    width: 400px;
    max-width: 90vw;
}

.mts-modal > .modal-dialog.modal-medium {
    width: 600px;
    max-width: 90vw;
}

.mts-modal > .modal-dialog.modal-large {
    width: 900px;
    max-width: 90vw;
}

.mts-modal > .modal-dialog.modal-full {
    width: 95vw;
    height: 95vh;
    max-width: none;
    max-height: none;
}

.mts-modal {
    position: relative;
    background: var(--mts-white);
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    z-index: var(--z-modal);
}

/* Full-screen overlay mode (used by Modal.js component) */
body > .mts-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    border-radius: 0;
    max-width: none;
    width: auto;
    max-height: none;
    overflow: visible;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

body > .mts-modal.show {
    opacity: 1;
}

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

.mts-modal-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--mts-gray-900);
}

.mts-modal-close {
    background: none;
    border: none;
    font-size: var(--font-size-2xl);
    color: var(--mts-gray-500);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.mts-modal-close:hover {
    background: var(--mts-gray-100);
    color: var(--mts-gray-900);
}

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

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

/* ===============================================
   Utility Classes
   =============================================== */

/* Display */
.mts-hidden { display: none; }
.mts-block { display: block; }
.mts-flex { display: flex; }
.mts-inline-flex { display: inline-flex; }
.mts-grid { display: grid; }
.mts-grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.mts-grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.mts-grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.mts-grid-cols-6 { grid-template-columns: repeat(6, 1fr); }

/* Flex */
.mts-flex-col { flex-direction: column; }
.mts-flex-row { flex-direction: row; }
.mts-items-center { align-items: center; }
.mts-items-start { align-items: flex-start; }
.mts-items-end { align-items: flex-end; }
.mts-justify-center { justify-content: center; }
.mts-justify-between { justify-content: space-between; }
.mts-justify-end { justify-content: flex-end; }
.mts-flex-1 { flex: 1; }
.mts-gap-xs { gap: var(--spacing-xs); }
.mts-gap-sm { gap: var(--spacing-sm); }
.mts-gap-md { gap: var(--spacing-md); }
.mts-gap-lg { gap: var(--spacing-lg); }

/* Spacing */
.mts-m-0 { margin: 0; }
.mts-mt-xs { margin-top: var(--spacing-xs); }
.mts-mt-sm { margin-top: var(--spacing-sm); }
.mts-mt-md { margin-top: var(--spacing-md); }
.mts-mt-lg { margin-top: var(--spacing-lg); }
.mts-mb-xs { margin-bottom: var(--spacing-xs); }
.mts-mb-sm { margin-bottom: var(--spacing-sm); }
.mts-mb-md { margin-bottom: var(--spacing-md); }
.mts-mb-lg { margin-bottom: var(--spacing-lg); }

.mts-p-0 { padding: 0; }
.mts-p-sm { padding: var(--spacing-sm); }
.mts-p-md { padding: var(--spacing-md); }
.mts-p-lg { padding: var(--spacing-lg); }

/* Text */
.mts-text-xs { font-size: var(--font-size-xs); }
.mts-text-sm { font-size: var(--font-size-sm); }
.mts-text-base { font-size: var(--font-size-base); }
.mts-text-lg { font-size: var(--font-size-lg); }
.mts-text-xl { font-size: var(--font-size-xl); }
.mts-text-2xl { font-size: var(--font-size-2xl); }
.mts-text-3xl { font-size: var(--font-size-3xl); }

.mts-text-center { text-align: center; }
.mts-text-left { text-align: left; }
.mts-text-right { text-align: right; }

.mts-font-bold { font-weight: 700; }
.mts-font-semibold { font-weight: 600; }
.mts-font-medium { font-weight: 500; }
.mts-font-normal { font-weight: 400; }

/* Colors */
.mts-text-primary { color: var(--mts-orange-1); }
.mts-text-gray { color: var(--mts-gray-500); }
.mts-text-dark { color: var(--mts-gray-900); }
.mts-text-success { color: var(--mts-success); }
.mts-text-error { color: var(--mts-error); }
.mts-text-warning { color: var(--mts-warning); }

.mts-bg-white { background: var(--mts-white); }
.mts-bg-gray { background: var(--mts-gray-100); }
.mts-bg-primary { background: var(--mts-orange-1); }

/* Width */
.mts-w-full { width: 100%; }
.mts-w-auto { width: auto; }

/* Loading Spinner */
.mts-spinner {
    border: 3px solid var(--mts-gray-300);
    border-top-color: var(--mts-orange-1);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: mts-spin 0.8s linear infinite;
}

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

.spinning {
    animation: mts-spin 0.8s linear infinite;
}

/* ===============================================
   Mobile Capture Styles
   =============================================== */

/* Slide Button States */
.slide-btn {
    position: relative;
    transition: all 0.2s ease;
}

.slide-btn.active {
    background: linear-gradient(135deg, #f5af19 0%, #f12711 100%) !important;
    color: white !important;
    border: none !important;
    transform: scale(1.05);
}

.slide-btn.uploaded {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%) !important;
    color: white !important;
    border: none !important;
}

.slide-btn.uploading {
    animation: pulse 1.5s ease-in-out infinite;
    background: linear-gradient(135deg, var(--mts-orange-1), var(--mts-orange-2)) !important;
    color: white !important;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

/* Slide Badge */
.slide-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--mts-error);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    min-width: 18px;
    text-align: center;
}

/* Toast Notifications */
.mts-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius-lg);
    font-size: var(--font-size-sm);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 99999;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    max-width: 90%;
    text-align: center;
}

.mts-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.mts-toast.mts-toast-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.mts-toast.mts-toast-error {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
}

.mts-toast.mts-toast-warning {
    background: linear-gradient(135deg, #f5af19 0%, #f12711 100%);
}

.mts-toast.mts-toast-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Toggle Slider Animation */
.mts-toggle-switch input[type="checkbox"]:checked + .toggle-slider {
    transform: translateX(24px);
    background: #4cd137;
}

.mts-toggle-switch input[type="checkbox"]:checked ~ * {
    background: #4cd137;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* ===============================================
   Mobile-First Responsive Design
   =============================================== */

/* CSS Variables for Safe Areas (iOS notch, home indicator) */
:root {
    --safe-area-inset-top: env(safe-area-inset-top, 0px);
    --safe-area-inset-right: env(safe-area-inset-right, 0px);
    --safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-inset-left: env(safe-area-inset-left, 0px);
    --mobile-action-bar-height: 72px;
}

/* Global Mobile Fixes */
* {
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

/* Touch Targets - Minimum 44x44px on mobile */
@media (max-width: 640px) {
    button, a, input[type="checkbox"], input[type="radio"], select {
        min-height: 44px;
        min-width: 44px;
    }

    .mts-btn {
        min-height: 44px;
        padding: 12px 20px;
    }

    .mts-btn-small {
        min-height: 40px;
        padding: 10px 16px;
    }
}

/* Responsive Grid System */
@media (max-width: 640px) {
    .mts-grid-cols-2,
    .mts-grid-cols-3,
    .mts-grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Force single column for complex layouts */
    .mts-mobile-stack {
        grid-template-columns: 1fr !important;
        display: flex;
        flex-direction: column;
    }
}

/* Prevent Horizontal Scroll */
.mts-container,
.mts-card,
.mts-main {
    max-width: 100%;
    overflow-x: hidden;
}

/* Mobile-Friendly Cards */
@media (max-width: 640px) {
    .mts-card {
        margin: var(--spacing-sm);
        padding: var(--spacing-md);
    }

    .mts-card-compact {
        padding: var(--spacing-sm);
    }
}

/* Sticky Bottom Action Bar */
.mts-sticky-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--mts-white);
    border-top: 1px solid var(--mts-gray-200);
    padding: var(--spacing-md);
    padding-bottom: calc(var(--spacing-md) + var(--safe-area-inset-bottom));
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    z-index: 900;
    display: none; /* Hidden by default, shown on mobile */
}

@media (max-width: 640px) {
    .mts-sticky-actions {
        display: flex;
        gap: var(--spacing-sm);
        align-items: center;
        justify-content: center;
    }

    /* Add bottom padding to content when sticky actions are present */
    .mts-main.has-sticky-actions {
        padding-bottom: calc(var(--mobile-action-bar-height) + var(--safe-area-inset-bottom));
    }
}

/* Mobile Modal Improvements */
@media (max-width: 640px) {
    body > .mts-modal {
        padding: var(--spacing-sm);
    }

    .mts-modal {
        max-width: 95vw !important;
        max-height: 90vh;
    }

    .mts-modal > .modal-dialog {
        max-width: 95vw !important;
        max-height: 90vh;
    }

    .mts-modal-body,
    .mts-modal > .modal-dialog > .modal-body {
        max-height: calc(90vh - 120px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Responsive Tables */
.mts-table-responsive {
    display: block;
    width: 100%;
    overflow: visible;
}

@media (max-width: 1200px) {
    .user-table th,
    .user-table td {
        padding: 6px 10px;
        font-size: 12px;
    }

    .user-table td {
        max-width: 120px;
    }
}

    /* Card-based table view for mobile */
    .mts-table-cards {
        display: none;
    }

    .mts-table-cards.active {
        display: block;
    }

    .mts-table-card {
        background: var(--mts-white);
        border: 1px solid var(--mts-gray-200);
        border-radius: var(--radius-lg);
        padding: var(--spacing-md);
        margin-bottom: var(--spacing-sm);
    }

    .mts-table-card-row {
        display: flex;
        justify-content: space-between;
        padding: var(--spacing-xs) 0;
        border-bottom: 1px solid var(--mts-gray-100);
    }

    .mts-table-card-row:last-child {
        border-bottom: none;
    }

    .mts-table-card-label {
        font-weight: 600;
        color: var(--mts-gray-600);
        font-size: var(--font-size-sm);
    }

    .mts-table-card-value {
        color: var(--mts-gray-900);
        font-size: var(--font-size-sm);
        text-align: right;
    }
}

/* ===============================================
   Time Management
   =============================================== */

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

.time-stat-card {
    background: var(--color-gray-800);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius-md);
    text-align: center;
}

.time-stat-card .stat-value {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--color-orange);
    margin-bottom: var(--spacing-xs);
}

.time-stat-card .stat-label {
    font-size: var(--font-size-sm);
    color: var(--color-gray-400);
}

.active-timers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--spacing-md);
}

.active-timer-card {
    background: var(--color-gray-800);
    padding: var(--spacing-md);
    border-radius: var(--border-radius-md);
    border-left: 4px solid var(--color-success);
}

.timer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.timer-project {
    font-size: var(--font-size-sm);
    color: var(--color-orange);
    margin-bottom: var(--spacing-xs);
}

.timer-elapsed {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--color-success);
    font-family: monospace;
}

.timer-started {
    font-size: var(--font-size-xs);
    color: var(--color-gray-500);
    margin-top: var(--spacing-xs);
}

.time-filters,
.export-controls,
.report-controls {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
    flex-wrap: wrap;
}

.time-entry-table {
    width: 100%;
    border-collapse: collapse;
}

.time-entry-table th,
.time-entry-table td {
    padding: var(--spacing-sm);
    text-align: left;
    border-bottom: 1px solid var(--color-gray-700);
}

.time-entry-table th {
    background: var(--color-gray-800);
    color: var(--color-gray-300);
    font-weight: 600;
    font-size: var(--font-size-sm);
}

.time-entry-table td {
    color: var(--color-gray-200);
}

.time-entry-table tbody tr:hover {
    background: var(--color-gray-800);
}

/* ===============================================
   Modern Time Entries Card Layout
   =============================================== */

.time-entries-modern-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-md);
}

@media (max-width: 768px) {
    .time-entries-modern-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
}

.time-entry-card {
    background: var(--mts-white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    border: 2px solid var(--mts-gray-300);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.time-entry-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    border-color: var(--mts-orange-1);
}

.time-entry-card.has-pending-adjustment-card {
    border-color: var(--mts-warning);
    border-width: 3px;
    background: linear-gradient(to bottom, #fffbeb 0%, var(--mts-white) 50px);
}

.time-entry-card.time-entry-active {
    border-color: var(--mts-success);
    border-width: 3px;
}

.time-entry-card.time-entry-active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--mts-success), #10b981, var(--mts-success));
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

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

.time-entry-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--mts-gray-100);
}

.time-entry-employee {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex: 1;
}

.time-entry-employee svg {
    flex-shrink: 0;
    color: var(--mts-orange-1);
}

.time-entry-name {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--mts-gray-900);
}

.time-entry-project {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: var(--font-size-sm);
    color: var(--mts-gray-600);
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--mts-gray-100);
    border-radius: var(--radius-md);
}

.time-entry-project svg {
    flex-shrink: 0;
    color: var(--mts-gray-500);
}

.time-entry-alert {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    background: #fef3c7;
    border-left: 3px solid var(--mts-warning);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: #92400e;
    margin-bottom: var(--spacing-md);
}

.time-entry-alert svg {
    flex-shrink: 0;
}

.time-entry-time-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr;
    gap: var(--spacing-sm);
    align-items: center;
    margin-bottom: var(--spacing-lg);
}

@media (max-width: 640px) {
    .time-entry-time-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .time-entry-arrow {
        display: none;
    }
}

.time-entry-time-block {
    text-align: center;
    padding: var(--spacing-md);
    background: var(--mts-gray-100);
    border-radius: var(--radius-md);
    border: 2px solid transparent;
}

.time-entry-time-block:hover {
    background: var(--mts-gray-200);
}

.time-block-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    font-size: var(--font-size-xs);
    color: var(--mts-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
}

.time-block-label svg {
    flex-shrink: 0;
}

.time-block-value {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--mts-gray-900);
    font-family: monospace;
    margin-bottom: var(--spacing-xs);
}

.time-block-date {
    font-size: var(--font-size-xs);
    color: var(--mts-gray-500);
    font-weight: 600;
}

.time-block-hours {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--mts-success);
    font-family: monospace;
}

.time-block-location {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-sm);
    font-size: var(--font-size-xs);
    color: var(--mts-gray-500);
    padding: var(--spacing-xs);
    background: rgba(0, 0, 0, 0.03);
    border-radius: var(--radius-sm);
}

.time-block-location svg {
    flex-shrink: 0;
}

.time-entry-total {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-color: var(--mts-success);
}

.time-entry-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mts-gray-400);
    font-size: var(--font-size-xl);
    font-weight: 700;
}

.time-entry-active-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-lg);
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: var(--radius-md);
    border: 2px solid var(--mts-warning);
}

.time-entry-active-badge svg {
    color: var(--mts-warning);
    animation: pulse 2s ease-in-out infinite;
}

.time-entry-active-badge span {
    font-weight: 700;
    color: #92400e;
    font-size: var(--font-size-sm);
    letter-spacing: 1px;
}

.time-entry-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    padding-top: var(--spacing-md);
    border-top: 2px solid var(--mts-gray-100);
}

.time-action-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--font-size-sm);
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 2px solid;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--mts-white);
    white-space: nowrap;
}

.time-action-btn svg {
    flex-shrink: 0;
}

.time-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.time-action-view {
    border-color: var(--mts-info);
    color: var(--mts-info);
}

.time-action-view:hover {
    background: var(--mts-info);
    color: var(--mts-white);
}

.time-action-approve {
    border-color: var(--mts-success);
    color: var(--mts-success);
}

.time-action-approve:hover {
    background: var(--mts-success);
    color: var(--mts-white);
}

.time-action-reject {
    border-color: var(--mts-error);
    color: var(--mts-error);
}

.time-action-reject:hover {
    background: var(--mts-error);
    color: var(--mts-white);
}

.time-action-adjustment {
    border-color: var(--mts-warning);
    color: #92400e;
    background: #fef3c7;
}

.time-action-adjustment:hover {
    background: var(--mts-warning);
    color: var(--mts-white);
}

.time-action-edit {
    border-color: var(--mts-gray-400);
    color: var(--mts-gray-700);
}

.time-action-edit:hover {
    background: var(--mts-gray-700);
    color: var(--mts-white);
    border-color: var(--mts-gray-700);
}

@media (max-width: 640px) {
    .time-action-btn {
        flex: 1 1 calc(50% - var(--spacing-xs));
        justify-content: center;
        min-width: 120px;
    }
}

.time-entry-details {
    color: var(--color-gray-200);
}

.time-entry-details h3 {
    color: var(--color-white);
    margin-bottom: var(--spacing-md);
}

.detail-section {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--color-gray-700);
}

.detail-section h4 {
    color: var(--color-white);
    font-size: var(--font-size-lg);
    margin-bottom: var(--spacing-sm);
}

.edit-history {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.edit-entry {
    background: var(--color-gray-800);
    padding: var(--spacing-sm);
    border-radius: var(--border-radius-sm);
    font-size: var(--font-size-sm);
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: var(--spacing-sm);
}

.report-table th,
.report-table td {
    padding: var(--spacing-sm);
    text-align: left;
    border-bottom: 1px solid var(--color-gray-700);
}

.report-table th {
    background: var(--color-gray-800);
    color: var(--color-gray-300);
    font-weight: 600;
}

.report-table td {
    color: var(--color-gray-200);
}

.mts-checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    color: var(--color-gray-200);
    cursor: pointer;
}

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

/* ===============================================
   Modern Time Entry Details
   =============================================== */

.time-entry-details-modern {
    max-height: 80vh;
    overflow-y: auto;
}

.detail-card {
    background: var(--mts-white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    border: 1px solid var(--mts-gray-300);
}

.detail-card-header {
    background: linear-gradient(135deg, var(--mts-orange-1), var(--mts-orange-2));
    border: none;
    color: var(--mts-white);
}

.detail-card-success {
    border-left: 4px solid var(--mts-success);
    background: #f0fdf4;
}

.detail-card-error {
    border-left: 4px solid var(--mts-error);
    background: #fef2f2;
}

.detail-header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--spacing-md);
}

.detail-employee-name {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: var(--font-size-xl);
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
}

.detail-employee-name svg {
    flex-shrink: 0;
}

.detail-project {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: var(--font-size-base);
    opacity: 0.9;
}

.detail-status-badge {
    flex-shrink: 0;
}

.detail-card-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--mts-gray-900);
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--mts-gray-100);
}

.time-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr;
    gap: var(--spacing-md);
    align-items: center;
}

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

    .time-separator {
        display: none;
    }
}

.time-block {
    text-align: center;
    padding: var(--spacing-md);
    background: var(--mts-gray-100);
    border-radius: var(--radius-md);
}

.time-block-in {
    background: #dbeafe;
    border-left: 3px solid var(--mts-info);
}

.time-block-out {
    background: #fef3c7;
    border-left: 3px solid var(--mts-warning);
}

.time-block-total {
    background: #d1fae5;
    border-left: 3px solid var(--mts-success);
}

.time-block-active {
    background: #fef3c7;
    border-left: 3px solid var(--mts-warning);
}

.time-label {
    font-size: var(--font-size-xs);
    color: var(--mts-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

.time-value {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--mts-gray-900);
    font-family: monospace;
    margin-bottom: var(--spacing-xs);
}

.time-date {
    font-size: var(--font-size-sm);
    color: var(--mts-gray-500);
}

.time-total {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--mts-success);
    font-family: monospace;
}

.time-location {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-sm);
    font-size: var(--font-size-xs);
    color: var(--mts-gray-500);
}

.time-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mts-gray-300);
}

.active-timer-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    background: var(--mts-warning);
    color: var(--mts-white);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: var(--font-size-sm);
    margin-bottom: var(--spacing-md);
}

.detail-field {
    margin-bottom: var(--spacing-md);
}

.detail-field:last-child {
    margin-bottom: 0;
}

.detail-field-label {
    font-weight: 600;
    color: var(--mts-gray-700);
    font-size: var(--font-size-sm);
    margin-bottom: var(--spacing-xs);
}

.detail-field-value {
    color: var(--mts-gray-900);
    font-size: var(--font-size-base);
    line-height: 1.6;
}

.detail-field-warning {
    padding: var(--spacing-md);
    background: #fef3c7;
    border-left: 3px solid var(--mts-warning);
    border-radius: var(--radius-sm);
}

.approval-info {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.approval-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--spacing-md);
}

.approval-label {
    font-weight: 600;
    color: var(--mts-gray-700);
    flex-shrink: 0;
}

.approval-value {
    color: var(--mts-gray-900);
    text-align: right;
}

.edit-timeline {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.edit-timeline-item {
    display: flex;
    gap: var(--spacing-md);
    position: relative;
}

.edit-timeline-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 8px;
    top: 24px;
    bottom: -16px;
    width: 2px;
    background: var(--mts-gray-200);
}

.edit-timeline-marker {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--mts-orange-1);
    border: 3px solid var(--mts-white);
    box-shadow: 0 0 0 2px var(--mts-gray-200);
    margin-top: 4px;
}

.edit-timeline-content {
    flex: 1;
}

.edit-timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xs);
}

.edit-timeline-time {
    font-size: var(--font-size-xs);
    color: var(--mts-gray-500);
}

.edit-timeline-change {
    font-size: var(--font-size-sm);
    color: var(--mts-gray-700);
    margin-bottom: var(--spacing-xs);
}

.edit-field {
    color: var(--mts-orange-1);
    font-weight: 600;
}

.edit-timeline-values {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: var(--font-size-sm);
    margin-bottom: var(--spacing-xs);
}

.edit-old-value {
    color: var(--mts-error);
    text-decoration: line-through;
}

.edit-new-value {
    color: var(--mts-success);
    font-weight: 600;
}

.edit-timeline-reason {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: var(--font-size-xs);
    color: var(--mts-gray-500);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--mts-gray-100);
    border-radius: var(--radius-sm);
    margin-top: var(--spacing-xs);
}

.detail-actions {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 2px solid var(--mts-gray-100);
    flex-wrap: wrap;
}

.detail-actions .mts-btn {
    flex: 1;
    min-width: 140px;
}

/* ===============================================
   Modern Edit Time Entry Form
   =============================================== */

.edit-time-form-modern {
    /* Let modal handle scrolling - no inner scroll */
}

.edit-form-header {
    background: linear-gradient(135deg, var(--mts-orange-1), var(--mts-orange-2));
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    margin: calc(var(--spacing-lg) * -1) calc(var(--spacing-lg) * -1) 0;
    color: var(--mts-white);
}

.edit-form-employee {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: var(--font-size-xl);
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
}

.edit-form-project {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: var(--font-size-base);
    opacity: 0.9;
}

.edit-form-section {
    margin-top: var(--spacing-xl);
    padding: var(--spacing-lg);
    background: var(--mts-white);
    border: 1px solid var(--mts-gray-300);
    border-radius: var(--radius-lg);
}

.edit-form-section-important {
    background: #fffbeb;
    border-color: var(--mts-warning);
}

.edit-form-section-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--mts-gray-900);
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--mts-gray-100);
}

.required-indicator {
    margin-left: auto;
    font-size: var(--font-size-xs);
    font-weight: 700;
    color: var(--mts-error);
    background: #fee2e2;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

.edit-time-inputs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
}

@media (max-width: 640px) {
    .edit-time-inputs-grid {
        grid-template-columns: 1fr;
    }
}

.edit-form-group {
    margin-bottom: var(--spacing-md);
}

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

.edit-form-group label {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-weight: 600;
    color: var(--mts-gray-700);
    font-size: var(--font-size-sm);
    margin-bottom: var(--spacing-sm);
}

.edit-form-input {
    width: 100%;
    padding: var(--spacing-md);
    font-size: var(--font-size-base);
    color: var(--mts-gray-900);
    background: var(--mts-white);
    border: 2px solid var(--mts-gray-300);
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.edit-form-input:focus {
    outline: none;
    border-color: var(--mts-orange-1);
    box-shadow: 0 0 0 3px rgba(204, 85, 0, 0.1);
}

.edit-form-input-required {
    border-color: var(--mts-warning);
}

.edit-form-input-required:focus {
    border-color: var(--mts-orange-1);
}

.edit-form-textarea {
    width: 100%;
    padding: var(--spacing-md);
    font-size: var(--font-size-base);
    color: var(--mts-gray-900);
    background: var(--mts-white);
    border: 2px solid var(--mts-gray-300);
    border-radius: var(--radius-md);
    resize: vertical;
    font-family: inherit;
    line-height: 1.6;
    transition: all 0.2s;
}

.edit-form-textarea:focus {
    outline: none;
    border-color: var(--mts-orange-1);
    box-shadow: 0 0 0 3px rgba(204, 85, 0, 0.1);
}

.edit-form-help {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: var(--font-size-xs);
    color: var(--mts-gray-500);
    margin-top: var(--spacing-xs);
}

.edit-form-counter {
    font-size: var(--font-size-xs);
    color: var(--mts-gray-500);
    text-align: right;
    margin-top: var(--spacing-xs);
}

.edit-form-calculated {
    margin-top: var(--spacing-md);
    padding: var(--spacing-md);
    background: #dbeafe;
    border-left: 3px solid var(--mts-info);
    border-radius: var(--radius-sm);
}

.calculated-hours {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xs);
}

.calculated-label {
    font-weight: 600;
    color: var(--mts-gray-700);
}

.calculated-value {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--mts-info);
    font-family: monospace;
}

.calculated-note {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: var(--font-size-xs);
    color: var(--mts-gray-600);
}

.edit-form-active-note {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    background: #fef3c7;
    border-left: 3px solid var(--mts-warning);
    border-radius: var(--radius-sm);
    color: var(--mts-gray-700);
    font-size: var(--font-size-sm);
}

.edit-form-actions {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 2px solid var(--mts-gray-100);
}

.edit-form-actions .mts-btn {
    flex: 1;
}

@media (max-width: 640px) {
    .edit-form-actions {
        flex-direction: column-reverse;
    }

    .edit-form-actions .mts-btn {
        width: 100%;
    }
}

/* Tabs Component */
.mts-tabs {
    display: flex;
    gap: var(--spacing-sm);
    border-bottom: 2px solid var(--mts-gray-200);
    margin-bottom: var(--spacing-lg);
}

.mts-tab {
    padding: var(--spacing-md) var(--spacing-lg);
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--mts-gray-600);
    font-weight: 500;
    font-size: var(--font-size-base);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    margin-bottom: -2px;
}

.mts-tab:hover {
    color: var(--mts-orange-1);
    background: var(--mts-gray-50);
}

.mts-tab.active {
    color: var(--mts-orange-1);
    border-bottom-color: var(--mts-orange-1);
    font-weight: 600;
}

/* Mobile Tabs */
@media (max-width: 640px) {
    .mts-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .mts-tabs::-webkit-scrollbar {
        display: none;
    }

    .mts-tab {
        white-space: nowrap;
        flex-shrink: 0;
    }
}

/* Mobile Gallery Grid - 2 columns on mobile, 4 on desktop */
@media (max-width: 640px) {
    .mts-gallery-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: var(--spacing-xs);
    }
}

/* Desktop gets 4 columns by default from the grid class */

/* Lightbox for Gallery */
.mts-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.mts-lightbox.active {
    display: flex;
}

.mts-lightbox-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--safe-area-inset-top) var(--safe-area-inset-right) var(--safe-area-inset-bottom) var(--safe-area-inset-left);
}

.mts-lightbox-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.mts-lightbox-controls {
    position: absolute;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    display: flex;
    gap: var(--spacing-sm);
    z-index: 10001;
}

.mts-lightbox-btn {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: none;
    color: white;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.mts-lightbox-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.mts-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: none;
    color: white;
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 24px;
    z-index: 10001; /* Ensure nav buttons are above lightbox image */
}

.mts-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.3);
}

.mts-lightbox-nav.prev {
    left: var(--spacing-lg);
}

.mts-lightbox-nav.next {
    right: var(--spacing-lg);
}

.mts-lightbox-close {
    position: absolute;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: none;
    color: white;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    z-index: 10001;
}

.mts-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.mts-lightbox-info {
    position: absolute;
    bottom: var(--spacing-lg);
    left: 50%;
    transform: translateX(-50%);
    color: white;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    z-index: 10001;
    padding: var(--spacing-md);
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    font-size: var(--font-size-sm);
}

/* Bottom Navigation Safe Area */
.mts-bottom-nav {
    padding-bottom: var(--safe-area-inset-bottom);
}

/* Ensure bottom nav doesn't overlap toasts */
.mts-toast {
    bottom: calc(100px + var(--safe-area-inset-bottom));
}

/* Mobile Utility Classes */
@media (max-width: 640px) {
    .mts-mobile-hide {
        display: none !important;
    }

    .mts-mobile-wrap {
        flex-wrap: wrap !important;
    }

    /* Photo Manager rail collapse */
    .mts-mobile-rail-collapse {
        grid-template-columns: 1fr !important;
    }

    .mts-mobile-sidebar {
        max-height: 300px;
        margin-bottom: var(--spacing-md);
    }
}

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

/* Mobile: hide sidebar, show bottom nav, no margin */
@media (max-width: 767px) {
    .mts-sidebar {
        transform: translateX(-100%);
    }

    .mts-app-shell,
    .mts-sidebar.collapsed ~ .mts-app-shell {
        margin-left: 0;
    }

    .mts-main {
        padding: var(--spacing-md);
    }

    .mts-header .mts-logo {
        display: block; /* Show header logo on mobile since sidebar is hidden */
    }
}

@media (min-width: 640px) {
    .mts-main {
        padding: var(--spacing-lg);
    }
}

@media (min-width: 768px) {
    .mts-header-title {
        font-size: var(--font-size-lg);
    }

    .mts-bottom-nav {
        display: none; /* Hide bottom nav on tablet+ */
    }

    .mts-app-shell {
        padding-bottom: 0;
    }

    /* Hide header logo on desktop (sidebar has it) */
    .mts-header .mts-logo {
        display: none;
    }
}

@media (min-width: 1024px) {
    .mts-main {
        padding: var(--spacing-xl);
    }
}


/* Highlight time entries with pending adjustments */
.has-pending-adjustment {
    background: #fef3c7 !important;
    border-left: 4px solid var(--mts-warning);
}

.has-pending-adjustment:hover {
    background: #fde68a !important;
}

.detail-card-warning {
    border-left: 4px solid var(--mts-warning);
    background: #fffbeb;
}

.adjustment-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.adjustment-item {
    padding: var(--spacing-md);
    background: var(--mts-white);
    border: 1px solid var(--mts-gray-300);
    border-radius: var(--radius-md);
}

.adjustment-pending {
    border-left: 4px solid var(--mts-warning);
    background: #fffbeb;
}

.adjustment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.adjustment-date {
    font-size: var(--font-size-xs);
    color: var(--mts-gray-500);
}

.adjustment-details {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-md);
}

.adjustment-field {
    font-size: var(--font-size-sm);
    color: var(--mts-gray-700);
}

.adjustment-actions {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

/* ===============================================
   Time Adjustment Modal
   =============================================== */

.time-adjustment-modal {
    padding: 0;
}

.adjustment-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-lg);
    background: linear-gradient(135deg, var(--mts-warning), #f59e0b);
    color: var(--mts-white);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    margin: calc(var(--spacing-lg) * -1) calc(var(--spacing-lg) * -1) 0;
}

.adjustment-modal-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: var(--font-size-xl);
    font-weight: 700;
}

.adjustment-modal-section {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--mts-gray-200);
}

.adjustment-modal-section:last-of-type {
    border-bottom: none;
}

.adjustment-section-highlight {
    background: #fffbeb;
    border-left: 4px solid var(--mts-warning);
}

.adjustment-section-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--mts-gray-900);
    margin-bottom: var(--spacing-md);
}

.adjustment-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
}

.adjustment-info-item {
    padding: var(--spacing-md);
    background: var(--mts-gray-100);
    border-radius: var(--radius-md);
}

.adjustment-info-label {
    font-size: var(--font-size-xs);
    color: var(--mts-gray-500);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

.adjustment-info-value {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--mts-gray-900);
}

.adjustment-time-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--spacing-md);
    align-items: center;
    margin-bottom: var(--spacing-md);
}

@media (max-width: 640px) {
    .adjustment-time-grid {
        grid-template-columns: 1fr;
    }
}

.adjustment-time-block {
    text-align: center;
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    border: 2px solid transparent;
}

.adjustment-time-current {
    background: #dbeafe;
    border-color: var(--mts-info);
}

.adjustment-time-requested {
    background: #fef3c7;
    border-color: var(--mts-warning);
}

.adjustment-time-total {
    background: #d1fae5;
    border-color: var(--mts-success);
}

.adjustment-time-label {
    font-size: var(--font-size-xs);
    color: var(--mts-gray-500);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

.adjustment-time-value {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--mts-gray-900);
    font-family: monospace;
    margin-bottom: var(--spacing-xs);
}

.adjustment-time-date {
    font-size: var(--font-size-sm);
    color: var(--mts-gray-500);
}

.adjustment-time-hours {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--mts-success);
    font-family: monospace;
}

.adjustment-time-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mts-gray-400);
    font-size: var(--font-size-xl);
    font-weight: 700;
}

@media (max-width: 640px) {
    .adjustment-time-separator {
        display: none;
    }
}

.adjustment-active-note {
    text-align: center;
    padding: var(--spacing-md);
    background: #fef3c7;
    border-radius: var(--radius-md);
    color: var(--mts-gray-700);
    font-weight: 600;
}

.adjustment-request-type {
    margin-bottom: var(--spacing-md);
    font-size: var(--font-size-base);
}

.adjustment-reason-box {
    padding: var(--spacing-md);
    background: var(--mts-white);
    border: 2px solid var(--mts-gray-300);
    border-radius: var(--radius-md);
    margin-top: var(--spacing-md);
}

.adjustment-reason-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-weight: 600;
    color: var(--mts-gray-700);
    font-size: var(--font-size-sm);
    margin-bottom: var(--spacing-sm);
}

.adjustment-reason-text {
    color: var(--mts-gray-900);
    line-height: 1.6;
}

.adjustment-submitted-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-md);
    font-size: var(--font-size-xs);
    color: var(--mts-gray-500);
}

.adjustment-modal-actions {
    display: flex;
    gap: var(--spacing-sm);
    padding: var(--spacing-lg);
    background: var(--mts-gray-100);
    margin: 0 calc(var(--spacing-lg) * -1) calc(var(--spacing-lg) * -1);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

@media (max-width: 640px) {
    .adjustment-modal-actions {
        flex-direction: column;
    }
}

.adjustment-modal-actions .mts-btn {
    flex: 1;
}

/* Deny Form */
.adjustment-deny-form {
    padding: var(--spacing-lg);
    background: #fef2f2;
    border: 2px solid var(--mts-error);
    border-radius: var(--radius-md);
    margin-top: var(--spacing-lg);
}

.adjustment-deny-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--mts-error);
    margin-bottom: var(--spacing-md);
}

.adjustment-deny-form .form-group {
    margin-bottom: var(--spacing-md);
}

.adjustment-deny-form label {
    display: block;
    font-weight: 600;
    color: var(--mts-gray-700);
    margin-bottom: var(--spacing-sm);
}

.adjustment-deny-form .form-control {
    width: 100%;
    padding: var(--spacing-md);
    font-size: var(--font-size-base);
    color: var(--mts-gray-900);
    background: var(--mts-white);
    border: 2px solid var(--mts-gray-300);
    border-radius: var(--radius-md);
    font-family: inherit;
    resize: vertical;
}

.adjustment-deny-form .form-control:focus {
    outline: none;
    border-color: var(--mts-error);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.adjustment-deny-form .form-help {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-xs);
    font-size: var(--font-size-xs);
    color: var(--mts-gray-500);
}

.deny-form-actions {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

@media (max-width: 640px) {
    .deny-form-actions {
        flex-direction: column-reverse;
    }
}

.deny-form-actions .mts-btn {
    flex: 1;
}

/* ===============================================
   Modern Project Cards
   =============================================== */

#projects-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-md);
}

@media (max-width: 768px) {
    #projects-list {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
}

.modern-project-card {
    background: var(--mts-white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    border: 2px solid var(--mts-gray-300);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: visible;
}

.modern-project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modern-project-card:hover {
    box-shadow: 0 0 0 1px var(--card-accent-strong), 0 8px 24px rgba(0,0,0,0.08);
    transform: translateY(-4px);
    border-color: var(--card-accent-strong);
}

.modern-project-card:hover::before {
    opacity: 1;
}

.modern-project-card:focus-visible {
    outline: 2px solid var(--focus-ring-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.project-card-header {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--mts-gray-100);
}

.project-card-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-icon-bg);
    border-radius: var(--radius-md);
    color: var(--card-icon-fg);
    box-shadow: 0 4px 12px var(--card-accent);
}

.project-card-icon svg {
    stroke: currentColor;
}

.project-card-title-group {
    flex: 1;
    min-width: 0;
}

.project-card-number {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--mts-gray-900);
    margin: 0 0 var(--spacing-xs) 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-card-name {
    font-size: var(--font-size-sm);
    color: var(--mts-gray-600);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-card-location {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    background: var(--mts-gray-100);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
}

.project-card-location svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--mts-gray-500);
}

.project-card-location-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    min-width: 0;
}

.location-address {
    font-size: var(--font-size-sm);
    color: var(--mts-gray-900);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.location-market {
    font-size: var(--font-size-xs);
    color: var(--mts-gray-600);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.location-market::before {
    content: '•';
    color: var(--mts-gray-400);
}

.project-card-stats {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: var(--spacing-md);
    align-items: center;
    padding: var(--spacing-md);
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
}

.project-stat-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.project-stat-item svg {
    flex-shrink: 0;
    color: var(--card-accent-strong);
}

.stat-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-label {
    font-size: var(--font-size-xs);
    color: var(--mts-gray-500);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--mts-gray-900);
    font-family: monospace;
}

.project-stat-divider {
    width: 2px;
    height: 40px;
    background: var(--mts-gray-300);
}

.project-card-hover-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm);
    background: var(--mts-white);
    border: 2px solid var(--mts-gray-300);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--mts-gray-600);
    transition: all 0.3s ease;
}

.modern-project-card:hover .project-card-hover-indicator {
    background: var(--gradient-primary);
    border-color: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    transform: translateX(4px);
}

.project-card-hover-indicator svg {
    transition: transform 0.3s ease;
}

.modern-project-card:hover .project-card-hover-indicator svg {
    transform: translateX(4px);
}

/* Mobile responsive adjustments for project cards */
@media (max-width: 640px) {
    .modern-project-card {
        padding: var(--spacing-md);
    }

    .project-card-icon {
        width: 40px;
        height: 40px;
    }

    .project-card-icon svg {
        width: 20px;
        height: 20px;
    }

    .project-card-stats {
        padding: var(--spacing-sm);
    }

    .stat-label {
        font-size: 10px;
    }

    .stat-value {
        font-size: var(--font-size-lg);
    }

    .project-stat-divider {
        height: 30px;
    }
}

/* ===============================================
   View Toggle Buttons
   =============================================== */

.view-toggle-group {
    display: flex;
    gap: var(--spacing-xs);
    background: var(--mts-white);
    padding: 4px;
    border-radius: var(--radius-md);
    border: 2px solid var(--mts-gray-300);
}

.view-toggle-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--mts-gray-600);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-toggle-btn:hover {
    background: var(--mts-gray-100);
    color: var(--mts-gray-900);
}

.view-toggle-btn.active {
    background: var(--gradient-primary);
    color: var(--btn-primary-text);
    box-shadow: 0 2px 8px var(--card-accent);
}

.view-toggle-btn:focus-visible {
    outline: 2px solid var(--focus-ring-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.view-toggle-btn svg {
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .view-toggle-btn span {
        display: none;
    }

    .view-toggle-btn {
        padding: var(--spacing-sm);
    }
}

/* ===============================================
   KANBAN VIEW - Trello-Style Drag & Drop Board
   Purpose: Visual project pipeline with drag-drop status changes
   =============================================== */

/* Main container - full width, fixed viewport height */
.projects-view-list {
    width: 100%;
    height: calc(100vh - 240px);
    max-height: calc(100vh - 240px);
    background: var(--surface-raised);
    padding: 0;
    overflow: hidden;
    /* Reset grid layout from #projects-list */
    display: block !important;
    grid-template-columns: none !important;
}

/* Kanban board wrapper */
.kanban-board {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* Ensure drag events work */
.kanban-board * {
    pointer-events: auto;
}

/* Horizontal scrolling rail - the key to Trello-style layout */
.kanban-rail {
    display: flex;
    flex-wrap: nowrap;
    gap: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 16px 20px 16px 20px;
    height: calc(100% - 10px);
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--color-primary) var(--surface);
}

.kanban-rail::-webkit-scrollbar {
    height: 10px;
}

.kanban-rail::-webkit-scrollbar-track {
    background: var(--surface);
    border-radius: 5px;
}

.kanban-rail::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: 5px;
    border: 2px solid var(--surface);
}

.kanban-rail::-webkit-scrollbar-thumb:hover {
    background: var(--btn-primary-bg-hover);
}

/* Column widths - responsive */
:root {
    --kanban-col-width: 320px;
}

@media (max-width: 768px) {
    :root {
        --kanban-col-width: 85vw;
    }
}

@media (min-width: 769px) and (max-width: 1280px) {
    :root {
        --kanban-col-width: 300px;
    }
}

@media (min-width: 1281px) and (max-width: 1600px) {
    :root {
        --kanban-col-width: 320px;
    }
}

@media (min-width: 1601px) {
    :root {
        --kanban-col-width: 340px;
    }
}

/* Kanban Column */
.kanban-col {
    flex: 0 0 var(--kanban-col-width);
    min-width: var(--kanban-col-width);
    max-width: var(--kanban-col-width);
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all 0.2s ease;
}

.kanban-col.drag-over {
    background: var(--surface-primary-tint);
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary);
}

.kanban-col.drag-over .kanban-column-body {
    background: color-mix(in srgb, var(--color-primary) 8%, var(--surface-raised));
}

/* Ghost "Add Column" button */
.kanban-col.add-col {
    border: 2px dashed var(--border);
    background: transparent;
    color: var(--text-muted);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    min-height: 200px;
    height: auto;
    max-height: 200px;
}

.kanban-col.add-col:hover {
    background: var(--surface-primary-tint);
    border-color: var(--color-primary);
    color: var(--link);
}

/* Column Header */
.kanban-column-header {
    padding: 14px 16px;
    background: var(--surface-raised);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: grab;
    flex-shrink: 0;
}

.kanban-column-header:active {
    cursor: grabbing;
}

.kanban-column-title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

/* Status indicator dot - color set via inline style from dynamic statuses */
.kanban-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    /* Fallback color if no inline style */
    background: #6b7280;
}

.kanban-status-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kanban-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    background: var(--surface);
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
}

/* Attention badge - shows stale projects */
.kanban-attention-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--status-danger);
    color: white;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    animation: pulse-attention 2s infinite;
}

@keyframes pulse-attention {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.kanban-column-actions {
    display: flex;
    gap: 4px;
    position: relative;
}

.kanban-column-menu-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s;
}

.kanban-column-menu-btn:hover {
    background: var(--surface);
    color: var(--link);
}

/* Column Body - Scrollable Cards Container */
.kanban-column-body {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0; /* Important: allows flex child to shrink and scroll */
    background: var(--surface-raised);
    /* Ensure drag-drop works */
    position: relative;
    z-index: 1;
}

.kanban-column-body::-webkit-scrollbar {
    width: 6px;
}

.kanban-column-body::-webkit-scrollbar-track {
    background: transparent;
}

.kanban-column-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.kanban-column-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Empty Column State */
.kanban-column-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
    text-align: center;
    min-height: 200px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    margin: 4px;
}

.kanban-column-empty-icon {
    margin-bottom: 12px;
    opacity: 0.4;
    color: var(--text-muted);
}

.kanban-empty-text {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

.kanban-empty-hint {
    font-size: 12px;
    opacity: 0.7;
}

/* ===============================================
   KANBAN CARDS - Enhanced Trello-style
   =============================================== */

.kanban-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    position: relative;
}

.kanban-card:hover {
    background: var(--surface);
    border-color: var(--card-accent);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.kanban-card:active {
    cursor: grabbing;
}

.kanban-card.dragging {
    opacity: 0.4;
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Drag clone that follows cursor */
.kanban-drag-clone {
    background: var(--surface);
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-md);
    padding: 12px 14px;
}

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

/* Card urgency styling based on time in status */
.kanban-card-fresh {
    border-left: 3px solid var(--status-success);
}

.kanban-card-normal {
    border-left: 3px solid var(--status-info);
}

.kanban-card-aging {
    border-left: 3px solid var(--status-warning);
}

.kanban-card-stale {
    border-left: 3px solid #f97316;
    background: color-mix(in srgb, var(--surface) 97%, #f97316);
}

.kanban-card-critical {
    border-left: 3px solid var(--status-danger);
    background: color-mix(in srgb, var(--surface) 95%, var(--status-danger));
}

/* Card Header */
.kanban-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.kanban-site-number {
    font-size: 13px;
    font-weight: 700;
    color: var(--link);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: -0.01em;
}

.kanban-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* Time badge showing time in status */
.kanban-time-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.kanban-time-fresh {
    background: var(--status-success-bg);
    color: var(--status-success-text);
}

.kanban-time-normal {
    background: var(--status-info-bg);
    color: var(--status-info-text);
}

.kanban-time-aging {
    background: var(--status-warning-bg);
    color: var(--status-warning-text);
}

.kanban-time-stale {
    background: #fff7ed;
    color: #c2410c;
}

.kanban-time-critical {
    background: var(--status-danger-bg);
    color: var(--status-danger-text);
    animation: pulse-attention 2s infinite;
}

/* Site Name */
.kanban-site-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 4px;
    line-height: 1.35;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Customer Name */
.kanban-customer-name {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kanban-customer-name::before {
    content: "▸ ";
    opacity: 0.5;
}

/* Location */
.kanban-card-location {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.kanban-card-location svg {
    flex-shrink: 0;
    opacity: 0.6;
}

/* Photo Stats */
.kanban-card-stats {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.kanban-stat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
}

.kanban-stat svg {
    width: 12px;
    height: 12px;
    opacity: 0.8;
}

.kanban-stat-pre {
    background: var(--status-info-bg);
    color: var(--status-info-text);
}

.kanban-stat-post {
    background: var(--status-success-bg);
    color: var(--status-success-text);
}

.kanban-stat-zero {
    background: var(--surface-raised);
    color: var(--text-muted);
    opacity: 0.7;
}

/* Attention Indicators */
.kanban-card-indicators {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.kanban-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: var(--radius-sm);
    cursor: help;
}

.kanban-indicator svg {
    width: 12px;
    height: 12px;
}

.kanban-indicator-warning {
    background: var(--status-warning-bg);
    color: var(--status-warning-text);
}

.kanban-indicator-info {
    background: var(--status-info-bg);
    color: var(--status-info-text);
}

.kanban-indicator-finance {
    background: var(--status-success-bg);
    color: var(--status-success-text);
}

/* Finance Info */
.kanban-card-finance {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.kanban-finance-item {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Add Column Button Content */
.kanban-add-column-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
}

.kanban-add-column-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border-radius: var(--radius-full);
    color: var(--link);
    border: 1px solid var(--border);
}

.kanban-col.add-col:hover .kanban-add-column-icon {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.kanban-add-column-text {
    font-size: 13px;
    font-weight: 500;
}

/* Column Reordering */
.kanban-col.dragging-column {
    opacity: 0.4;
}

.kanban-col.drag-over-column {
    border-left: 4px solid var(--color-primary);
}

/* ===============================================
   KANBAN NAVIGATION ARROWS
   =============================================== */

.kanban-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--surface);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15), 0 0 0 1px var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text);
}

.kanban-nav-arrow:hover {
    background: var(--color-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.kanban-nav-arrow:active {
    transform: translateY(-50%) scale(0.95);
}

.kanban-nav-prev {
    left: 8px;
}

.kanban-nav-next {
    right: 8px;
}

.kanban-nav-arrow svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .kanban-nav-arrow {
        width: 36px;
        height: 36px;
    }

    .kanban-nav-arrow svg {
        width: 18px;
        height: 18px;
    }
}

/* ===============================================
   KANBAN MODALS
   =============================================== */

.kanban-column-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.kanban-column-modal.show {
    opacity: 1;
}

.kanban-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.kanban-modal-dialog {
    position: relative;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 400px;
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.kanban-column-modal.show .kanban-modal-dialog {
    transform: scale(1);
}

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

.kanban-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.kanban-modal-close {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.15s;
    border-radius: var(--radius-sm);
}

.kanban-modal-close:hover {
    color: var(--text);
    background: var(--surface-raised);
}

.kanban-modal-body {
    padding: 24px;
}

.kanban-modal-info {
    margin-bottom: 20px;
    padding: 12px 16px;
    background: var(--surface-raised);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--color-primary);
}

.kanban-modal-info strong {
    color: var(--text);
    font-size: 15px;
}

.kanban-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.kanban-modal-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s;
    background: var(--surface);
}

.kanban-modal-btn svg {
    flex-shrink: 0;
}

.kanban-modal-btn-primary {
    color: var(--btn-primary-text);
    background: var(--btn-primary-bg);
    border-color: var(--btn-primary-border);
}

.kanban-modal-btn-primary:hover {
    background: var(--btn-primary-bg-hover);
}

.kanban-modal-btn-primary svg {
    color: var(--btn-primary-text);
}

.kanban-modal-btn-danger {
    color: var(--status-danger);
    border-color: var(--status-danger);
}

.kanban-modal-btn-danger:hover {
    background: var(--status-danger);
    color: white;
}

.kanban-modal-btn-danger svg {
    color: currentColor;
}

/* Modal color picker section */
.kanban-modal-section {
    margin-bottom: 20px;
}

.kanban-modal-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.kanban-modal-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.kanban-modal-color-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
}

.kanban-color-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.kanban-color-swatch {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kanban-color-swatch:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.kanban-color-swatch.active {
    border-color: var(--text);
    box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text);
}

.kanban-color-custom {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    border: 2px dashed var(--border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all 0.15s;
    position: relative;
    overflow: hidden;
}

.kanban-color-custom:hover {
    border-color: var(--text-muted);
    color: var(--text);
}

.kanban-color-custom input[type="color"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* Responsive Kanban */
@media (max-width: 768px) {
    .projects-view-list {
        height: calc(100vh - 200px);
        max-height: calc(100vh - 200px);
    }

    .kanban-rail {
        padding: 12px;
        gap: 12px;
    }

    .kanban-card {
        padding: 10px 12px;
    }

    .kanban-column-header {
        padding: 12px;
    }

    .kanban-column-body {
        padding: 10px;
        gap: 8px;
    }
}

/* ===============================================
   COMPACT VIEW - Grid-Based Card Layout
   Purpose: Scannable tile grid for quick overview
   =============================================== */

.projects-view-compact {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.project-compact-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 180px;
}

.project-compact-item:hover {
    background: var(--surface-primary-tint-hover);
    border-color: var(--card-accent-strong);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.project-compact-item:active {
    transform: translateY(0);
}

.project-compact-item:focus-visible {
    outline: 2px solid var(--focus-ring-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 3px var(--focus-ring);
}

/* Header: Site Number + Name */
.compact-header {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.compact-site-number {
    font-size: 15px;
    font-weight: 600;
    color: var(--link);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.compact-site-name {
    font-size: 13px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.4;
}

/* Middle: PRE/POST Badges */
.compact-stats-row {
    display: flex;
    gap: 8px;
    padding: 0 1rem 12px 1rem;
}

.compact-stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid;
}

.compact-stat-badge svg {
    width: 12px;
    height: 12px;
}

.compact-stat-badge-pre {
    background: var(--status-info-bg);
    color: var(--status-info-text);
    border-color: var(--status-info);
}

.compact-stat-badge-post {
    background: var(--status-success-bg);
    color: var(--status-success-text);
    border-color: var(--status-success);
}

/* Footer: Status + View Details Link */
.compact-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 1rem;
    background: var(--surface-raised);
    border-top: 1px solid var(--border-light);
}

.compact-footer .mts-badge {
    font-size: 11px;
    padding: 4px 10px;
}

.compact-view-link {
    font-size: 12px;
    color: var(--link);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

.compact-view-link:hover {
    text-decoration: underline;
}

.compact-view-link svg {
    width: 14px;
    height: 14px;
}

/* Responsive Grid */
@media (max-width: 1024px) {
    .projects-view-compact {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }
}

@media (max-width: 768px) {
    .projects-view-compact {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 0.75rem;
    }
}

@media (max-width: 640px) {
    .projects-view-compact {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .compact-site-number {
        font-size: 14px;
    }

    .compact-site-name {
        font-size: 12px;
    }
}

/* ===============================================
   TABLE VIEW - Modern Spreadsheet Layout
   Purpose: Full-width Excel-like grid with sticky header
   =============================================== */

.projects-view-table {
    width: 100%;
    max-width: none;
    padding: 0;
    background: transparent;
    display: block;
    /* Span full width of grid parent */
    grid-column: 1 / -1;
}

.projects-table-full {
    width: 100%;
    min-width: 1600px; /* Wider to accommodate more columns */
    border-collapse: collapse;
    background: var(--surface);
    table-layout: fixed;
}

/* Sticky Header with Shadow */
.projects-table-full thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--surface-raised);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.projects-table-full th {
    padding: 14px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    white-space: nowrap;
    background: var(--surface-raised);
    border-bottom: 2px solid var(--border);
}

/* Column Alignment */
.projects-table-full th.col-center {
    text-align: center;
}

.projects-table-full th.col-right {
    text-align: right;
}

/* Row Styling */
.projects-table-full tbody tr {
    background: var(--surface);
    border-bottom: 1px solid var(--border-light);
    transition: background 0.15s ease;
    cursor: pointer;
    height: 48px;
}

.projects-table-full tbody tr:hover {
    background: var(--surface-primary-tint-hover);
}

.projects-table-full tbody tr:focus-visible {
    outline: 2px solid var(--focus-ring-color);
    outline-offset: -2px;
    box-shadow: inset 0 0 0 2px var(--focus-ring);
}

/* Optional: Striped Rows */
.projects-table-full tbody tr:nth-child(even) {
    background: var(--surface-raised);
}

.projects-table-full tbody tr:nth-child(even):hover {
    background: var(--surface-primary-tint-hover);
}

/* Cell Padding and Styling */
.projects-table-full td {
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text);
    border-bottom: 1px solid var(--border-light);
}

/* Column Separators (subtle) */
.projects-table-full td {
    border-right: 1px solid var(--border-light);
}

.projects-table-full th {
    border-right: 1px solid var(--border);
}

.projects-table-full td:last-child,
.projects-table-full th:last-child {
    border-right: none;
}

/* Site Number (First Column) - Brand Link */
.projects-table-full td.col-site-number {
    font-weight: 600;
    color: var(--link);
}

.projects-table-full td.col-site-number:hover {
    text-decoration: underline;
}

/* Center Alignment */
.projects-table-full td.col-center {
    text-align: center;
}

/* Right Alignment (Financial Columns) */
.projects-table-full td.col-right {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* PRE/POST Badges */
.table-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    border: 1px solid;
}

.table-badge-pre {
    background: var(--status-info-bg);
    color: var(--status-info-text);
    border-color: var(--status-info);
}

.table-badge-post {
    background: var(--status-success-bg);
    color: var(--status-success-text);
    border-color: var(--status-success);
}

/* Financial Cells */
.projects-table-full td.col-finance {
    font-weight: 500;
    color: var(--text);
}

.projects-table-full td.col-balance-due {
    font-weight: 600;
    color: var(--status-warning);
}

/* Status Column */
.projects-table-full td.col-status .mts-badge {
    font-size: 11px;
    padding: 4px 10px;
}

/* Truncate long text columns */
.projects-table-full td.col-truncate {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.projects-table-full td.col-address {
    max-width: 220px;
}

/* Date columns */
.projects-table-full td.col-date {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.projects-table-full td.col-updated {
    font-weight: 500;
}

/* Sticky first column */
.projects-table-full th.col-sticky,
.projects-table-full td.col-sticky {
    position: sticky;
    left: 0;
    z-index: 5;
    background: inherit;
}

.projects-table-full th.col-sticky {
    background: var(--surface-raised);
    z-index: 15;
}

.projects-table-full tbody tr:nth-child(even) td.col-sticky {
    background: var(--surface-raised);
}

.projects-table-full tbody tr:nth-child(odd) td.col-sticky {
    background: var(--surface);
}

.projects-table-full tbody tr:hover td.col-sticky {
    background: var(--surface-primary-tint-hover);
}

/* Column widths for better distribution */
.projects-table-full th:nth-child(1) { width: 140px; } /* Site Number */
.projects-table-full th:nth-child(2) { width: 160px; } /* Site Name */
.projects-table-full th:nth-child(3) { width: 150px; } /* Customer */
.projects-table-full th:nth-child(4) { width: 200px; } /* Address */
.projects-table-full th:nth-child(5) { width: 100px; } /* Market */
.projects-table-full th:nth-child(6) { width: 100px; } /* Region */
.projects-table-full th:nth-child(7) { width: 100px; } /* Tower Type */
.projects-table-full th:nth-child(8) { width: 120px; } /* Tech */
.projects-table-full th:nth-child(9) { width: 60px; }  /* PRE */
.projects-table-full th:nth-child(10) { width: 60px; } /* POST */
.projects-table-full th:nth-child(11) { width: 100px; } /* Estimate */
.projects-table-full th:nth-child(12) { width: 100px; } /* Invoice */
.projects-table-full th:nth-child(13) { width: 100px; } /* Balance */
.projects-table-full th:nth-child(14) { width: 100px; } /* Status */
.projects-table-full th:nth-child(15) { width: 110px; } /* Created */
.projects-table-full th:nth-child(16) { width: 90px; }  /* Updated */

/* Table Toolbar */
.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    margin-bottom: 0;
    width: 100%;
    box-sizing: border-box;
}

.table-toolbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.table-result-count {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.table-clear-filters {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    color: var(--status-danger);
    background: var(--status-danger-bg);
    border: 1px solid var(--status-danger);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s;
}

.table-clear-filters:hover {
    background: var(--status-danger);
    color: white;
}

.table-scroll-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Filterable Table Header */
.th-filterable {
    position: relative;
}

.th-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.th-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    flex: 1;
}

.th-label:hover {
    color: var(--text);
}

.th-sort-icon {
    opacity: 0.8;
}

.th-filter-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.15s;
    flex-shrink: 0;
}

.th-filter-btn:hover {
    background: var(--surface);
    color: var(--text);
}

.th-filter-icon {
    transition: all 0.15s;
}

.th-filter-icon.active {
    color: var(--color-primary);
}

/* Filter Dropdown */
.table-filter-dropdown {
    position: fixed;
    z-index: 10001;
    width: 260px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.filter-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: var(--surface-raised);
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.filter-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.15s;
}

.filter-close-btn:hover {
    background: var(--surface);
    color: var(--text);
}

.filter-dropdown-body {
    padding: 8px 0;
    max-height: 300px;
    overflow-y: auto;
}

.filter-search-box,
.filter-text-box {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-light);
}

.filter-search-input,
.filter-text-input {
    width: 100%;
    padding: 8px 10px;
    font-size: 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text);
    outline: none;
    transition: border-color 0.15s;
}

.filter-search-input:focus,
.filter-text-input:focus {
    border-color: var(--color-primary);
}

.filter-options-list {
    max-height: 220px;
    overflow-y: auto;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
    transition: background 0.1s;
}

.filter-option:hover {
    background: var(--surface-raised);
}

.filter-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--color-primary);
    cursor: pointer;
}

.filter-option span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.filter-select-all {
    font-weight: 500;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 4px;
    padding-bottom: 10px;
}

.filter-dropdown-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 10px 12px;
    background: var(--surface-raised);
    border-top: 1px solid var(--border);
}

.filter-btn {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 500;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s;
}

.filter-btn-clear {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.filter-btn-clear:hover {
    background: var(--surface);
    color: var(--text);
}

.filter-btn-apply {
    background: var(--color-primary);
    border: 1px solid var(--color-primary);
    color: white;
}

.filter-btn-apply:hover {
    background: var(--color-primary-hover);
}

/* Responsive: Allow horizontal scroll */
@media (max-width: 1024px) {
    .projects-view-table {
        overflow-x: scroll;
        -webkit-overflow-scrolling: touch;
    }

    .projects-table-full {
        min-width: 1000px;
    }
}

@media (max-width: 768px) {
    .projects-table-full th,
    .projects-table-full td {
        padding: 10px 12px;
        font-size: 12px;
    }

    .projects-table-full th {
        font-size: 10px;
    }
}

/* ===== MODAL OVERLAY STYLES ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
    overflow-y: auto;
}

.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    position: relative;
}

.modal-content.modal-large {
    max-width: 800px;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--mts-gray-300);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--mts-gray-900);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--mts-gray-500);
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--mts-gray-900);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--mts-gray-300);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* ====================================
   Features Management Styles
   ==================================== */

/* Hidden view utility */
.view-container.hidden {
    display: none !important;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Feature grid layout */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem;
}

/* Feature card */
.feature-card {
    background: white;
    border: 1px solid var(--mts-gray-300);
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.feature-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border-color: var(--mts-accent);
}

.feature-card.disabled {
    opacity: 0.6;
    background: var(--mts-gray-100);
}

/* Feature card header */
.feature-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.feature-card-title {
    flex: 1;
}

.feature-card-title h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--mts-text-primary);
    margin: 0 0 0.5rem 0;
}

/* Feature description */
.feature-card .desc {
    color: var(--mts-text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0;
}

/* Feature metadata */
.feature-card .meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.8125rem;
    color: var(--mts-text-secondary);
}

.feature-card .meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.feature-card .meta-item strong {
    font-weight: 600;
    color: var(--mts-text-primary);
}

/* Feature tags and badges */
.feature-card .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.feature-tag, .scope-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
}

.feature-tag.experimental {
    background: #fef3c7;
    color: #92400e;
}

.feature-tag.locked {
    background: var(--mts-gray-200);
    color: var(--mts-text-secondary);
}

.scope-badge.tenant {
    background: #dbeafe;
    color: #1e40af;
}

.scope-badge.saas {
    background: #f3e8ff;
    color: #6b21a8;
}

/* Dependency hints */
.feature-card .depends {
    font-size: 0.875rem;
    color: var(--mts-text-secondary);
    font-style: italic;
}

/* Feature actions */
.feature-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

/* Toggle switch */
.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--mts-gray-300);
    transition: 0.3s;
    border-radius: 24px;
}

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

input:checked + .slider {
    background-color: var(--mts-accent);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--mts-accent);
}

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

input:disabled + .slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.switch.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* Features Page Layout */
.features-page {
    padding: 1.5rem;
}

.features-page .page-header {
    margin-bottom: 2rem;
}

.features-page .page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--mts-text-primary);
    margin: 0 0 0.5rem 0;
}

.features-page .page-header p {
    color: var(--mts-text-secondary);
    margin: 0;
}

.features-categories {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.feature-category {
    background: var(--mts-gray-50);
    border-radius: 12px;
    padding: 1.5rem;
}

.category-header {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--mts-orange-1);
    margin: 0 0 1rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--mts-orange-1);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

/* Feature card inner styles */
.feature-card .feature-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.feature-card .feature-title {
    flex: 1;
}

.feature-card .feature-title h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--mts-text-primary);
    margin: 0;
}

.feature-card .feature-badges {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.feature-card .feature-badges .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.feature-card .feature-badges .badge.experimental {
    background: var(--mts-yellow-100);
    color: var(--mts-yellow-800);
}

.feature-card .feature-badges .badge.locked {
    background: var(--mts-blue-100);
    color: var(--mts-blue-800);
}

.feature-card .feature-description {
    font-size: 0.875rem;
    color: var(--mts-text-secondary);
    line-height: 1.5;
}

.feature-card .feature-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--mts-text-secondary);
}

.feature-card .feature-meta .meta-item strong {
    color: var(--mts-text-primary);
}

/* Feature card status styles */
.feature-card.enabled {
    border-color: var(--mts-green-200);
    background: white;
}

.feature-card.disabled {
    border-color: var(--mts-gray-300);
    background: var(--mts-gray-50);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .feature-grid,
    .features-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .feature-card {
        padding: 1rem;
    }

    .features-page {
        padding: 1rem;
    }

    .feature-category {
        padding: 1rem;
    }
}

/* ==================== Project Notes ==================== */

.project-notes-container {
    max-width: 800px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notes-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.notes-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--mts-gray-900);
    margin: 0;
}

.notes-count {
    font-size: 0.8rem;
    color: var(--mts-gray-500, #6b7280);
}

.notes-filters {
    display: flex;
    gap: 6px;
}

.notes-filter-btn {
    padding: 4px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    background: #fff;
    font-size: 0.8rem;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s;
}

.notes-filter-btn:hover {
    border-color: var(--mts-orange-1, #CC5500);
    color: var(--mts-orange-1, #CC5500);
}

.notes-filter-btn.active {
    background: var(--mts-orange-1, #CC5500);
    border-color: var(--mts-orange-1, #CC5500);
    color: #fff;
}

.notes-pinned-section {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 8px;
}

.notes-pinned-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #9ca3af;
    margin-bottom: 4px;
}

.notes-feed {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 600px;
    overflow-y: auto;
}

.notes-empty {
    text-align: center;
    padding: 40px 20px;
    color: #9ca3af;
    font-size: 0.9rem;
}

.note-item {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
}

.note-reply {
    margin-left: 42px;
    padding-left: 12px;
    border-left: 2px solid #e5e7eb;
}

.notes-replies {
    margin-bottom: 4px;
}

.note-avatar {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
}

.note-content {
    flex: 1;
    min-width: 0;
}

.note-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

.note-author {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--mts-gray-900);
}

.note-time {
    font-size: 0.7rem;
    color: #9ca3af;
}

.note-pin-badge {
    font-size: 0.7rem;
}

.note-body {
    font-size: 0.9rem;
    color: #374151;
    line-height: 1.5;
    word-break: break-word;
}

.note-system {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-left: 3px solid #d1d5db;
    margin: 4px 0;
    background: #f9fafb;
    border-radius: 0 6px 6px 0;
}

.note-system-icon {
    font-size: 0.8rem;
}

.note-system-actor {
    font-weight: 600;
    color: var(--mts-gray-900);
    font-style: normal;
}

.note-system-body {
    font-size: 0.8rem;
    color: #6b7280;
    font-style: italic;
    flex: 1;
}

.note-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.note-reaction-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    background: #fff;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s;
}

.note-reaction-pill:hover {
    border-color: var(--mts-orange-1, #CC5500);
}

.note-reaction-pill.reacted {
    background: rgba(204, 85, 0, 0.1);
    border-color: var(--mts-orange-1, #CC5500);
}

.reaction-count {
    font-size: 0.7rem;
    color: #6b7280;
    font-weight: 500;
}

.note-actions {
    display: flex;
    gap: 2px;
    margin-top: 4px;
    opacity: 0;
    transition: opacity 0.15s;
}

.note-item:hover .note-actions,
.note-actions:focus-within {
    opacity: 1;
}

.note-action-btn {
    padding: 2px 6px;
    border: none;
    background: none;
    font-size: 0.75rem;
    color: #9ca3af;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s;
}

.note-action-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

.note-action-danger:hover {
    color: #ef4444;
    background: #fef2f2;
}

/* Compose Bar */
.compose-bar {
    border-top: 1px solid #e5e7eb;
    padding-top: 12px;
    margin-top: 8px;
}

.compose-reply-indicator {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    background: #f3f4f6;
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 0.8rem;
    color: #6b7280;
    font-style: italic;
}

.compose-cancel-reply {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1rem;
    color: #9ca3af;
    padding: 0 4px;
}

.compose-cancel-reply:hover {
    color: #374151;
}

.compose-input-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.compose-input {
    flex: 1;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
    min-height: 40px;
    max-height: 120px;
    transition: border-color 0.15s;
}

.compose-input:focus {
    outline: none;
    border-color: var(--mts-orange-1, #CC5500);
    box-shadow: 0 0 0 2px rgba(204, 85, 0, 0.1);
}

.compose-contenteditable {
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.compose-contenteditable:empty::before {
    content: attr(data-placeholder);
    color: #9ca3af;
    pointer-events: none;
}

.compose-contenteditable ul {
    margin: 4px 0;
    padding-left: 20px;
}

.compose-contenteditable li {
    margin: 2px 0;
}

.compose-send-btn {
    padding: 8px 16px;
    background: var(--mts-orange-1, #CC5500);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

.compose-send-btn:hover {
    background: var(--mts-orange-2, #A0522D);
}

/* ==================== Overview Tab ==================== */

.overview-container {
    padding: 0;
}

/* Financial Summary Cards */
.overview-financial-cards {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

@media (max-width: 1200px) {
    .overview-financial-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .overview-financial-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

.overview-card {
    background: white;
    border-radius: 10px;
    padding: 14px 16px;
    border: 1px solid #e5e7eb;
    border-left: 4px solid #9ca3af;
    transition: box-shadow 0.15s;
}

.overview-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.overview-card-green { border-left-color: #10b981; }
.overview-card-blue { border-left-color: #3b82f6; }
.overview-card-orange { border-left-color: #f59e0b; }
.overview-card-purple { border-left-color: #8b5cf6; }
.overview-card-teal { border-left-color: #14b8a6; }

.overview-card-label {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.overview-card-value {
    font-size: 22px;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
}

.overview-card-sub {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
}

/* Progress Bars */
.overview-progress-section {
    margin-bottom: 20px;
    display: flex;
    gap: 20px;
}

.overview-progress-row {
    flex: 1;
}

.overview-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.overview-progress-pct {
    color: #6b7280;
    font-weight: 600;
}

.overview-progress-track {
    height: 8px;
    background: #f3f4f6;
    border-radius: 4px;
    overflow: hidden;
}

.overview-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.overview-progress-green { background: #10b981; }
.overview-progress-blue { background: #3b82f6; }
.overview-progress-red { background: #ef4444; }

/* Two-Column Layout */
.overview-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

@media (max-width: 900px) {
    .overview-columns {
        grid-template-columns: 1fr;
    }

    .overview-progress-section {
        flex-direction: column;
        gap: 12px;
    }
}

.overview-section {
    background: white;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    padding: 16px 20px;
    margin-bottom: 16px;
}

.overview-section-title {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #f3f4f6;
}

/* Project Details Grid */
.overview-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 20px;
}

@media (max-width: 600px) {
    .overview-details-grid {
        grid-template-columns: 1fr;
    }
}

.overview-detail-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.overview-detail-label {
    font-size: 11px;
    font-weight: 500;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.overview-detail-value {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

/* Quick Actions */
.overview-quick-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

@media (max-width: 600px) {
    .overview-quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }
}

.overview-action-btn {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}

.overview-action-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* Notes Section in Overview */
.overview-notes-section {
    padding: 0;
    overflow: hidden;
}

.overview-notes-section .project-notes-container {
    border: none;
    border-radius: 0;
}

.overview-notes-section .notes-header {
    padding: 16px 20px 0;
}

.overview-notes-section .notes-filters {
    padding: 0 20px;
}

.overview-notes-section .notes-feed {
    max-height: 500px;
    overflow-y: auto;
    padding: 0 20px;
}

.overview-notes-section .compose-bar {
    border-top: 1px solid #f3f4f6;
    padding: 12px 20px;
}

/* ==================== Mention Typeahead ==================== */

.compose-input-wrapper {
    position: relative;
}

.mention-typeahead {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    max-height: 240px;
    overflow-y: auto;
    background: var(--mts-white, #fff);
    border: 1px solid var(--mts-gray-300, #d1d5db);
    border-radius: var(--radius-md, 8px);
    box-shadow: var(--shadow-lg, 0 10px 15px -3px rgba(0,0,0,0.1));
    z-index: var(--z-dropdown, 1000);
    margin-bottom: 4px;
}

.mention-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.1s;
}

.mention-item:hover,
.mention-item-selected {
    background: var(--mts-gray-100, #f5f5f5);
}

.mention-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    flex-shrink: 0;
}

.mention-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.mention-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--mts-gray-900, #1a1a1a);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mention-username {
    font-size: 0.75rem;
    color: var(--mts-gray-500, #6b7280);
}

/* ==================== Compose Formatting Toolbar ==================== */

.compose-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 0 6px;
}

.compose-toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 8px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    background: #f9fafb;
    color: #374151;
    font-size: 0.78rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    line-height: 1.3;
}

.compose-toolbar-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.compose-toolbar-btn:active {
    background: #e5e7eb;
}

.compose-toolbar-btn-active {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1d4ed8;
}

.compose-toolbar-btn-active:hover {
    background: #bfdbfe;
    border-color: #60a5fa;
}

.compose-toolbar-sep {
    width: 1px;
    height: 16px;
    background: #e5e7eb;
    margin: 0 4px;
}

/* ==================== Note Attachment Previews (Compose) ==================== */

.note-attachment-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 8px;
}

.note-attachment-preview {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.note-attachment-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.note-attachment-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.note-attachment-remove:hover {
    background: rgba(220, 38, 38, 0.85);
}

/* ==================== Note Attachments (Display) ==================== */

.note-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 6px 0 4px;
}

.note-attachment-thumb {
    display: block;
    width: 80px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.note-attachment-thumb:hover {
    border-color: var(--mts-orange-1, #CC5500);
    box-shadow: 0 0 0 2px rgba(204, 85, 0, 0.15);
}

.note-attachment-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ==================== Note Bullet Lists ==================== */

.note-bullet-list {
    margin: 4px 0;
    padding-left: 18px;
    list-style: disc;
}

.note-bullet-list li {
    margin: 2px 0;
    line-height: 1.5;
}

/* ==================== Project Map View ==================== */

.projects-view-map {
    /* Reset grid layout from #projects-list */
    display: block !important;
    grid-template-columns: none !important;
    width: 100%;
    height: calc(100vh - 240px);
    min-height: 500px;
}

.project-map-layout {
    display: flex;
    height: calc(100vh - 260px);
    min-height: 500px;
    gap: 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    background: var(--surface, #fff);
}

.project-map-container {
    flex: 1;
    min-height: 100%;
    height: 100%;
    z-index: 1;
}

/* Leaflet adds .leaflet-container to the same div we call L.map() on */
.project-map-container.leaflet-container {
    height: 100% !important;
    width: 100% !important;
}

#project-map-leaflet {
    height: 100%;
    width: 100%;
}

/* Sidebar */
.project-map-sidebar {
    width: 280px;
    min-width: 280px;
    background: var(--surface, #fff);
    border-left: 1px solid var(--border, #e5e7eb);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.project-map-sidebar-inner {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.map-sidebar-section {
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border-light, #f3f4f6);
}

.map-sidebar-section:last-child {
    border-bottom: none;
}

.map-sidebar-heading {
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted, #6b7280);
    margin-bottom: var(--spacing-xs);
}

/* Map Stats */
.map-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--font-size-sm);
}

.map-stat-label {
    color: var(--text-muted, #6b7280);
}

.map-stat-value {
    font-weight: 600;
    color: var(--text, #111827);
}

.map-stat-hint {
    font-size: var(--font-size-xs);
    color: var(--status-warning, #f59e0b);
    margin-top: 2px;
}

/* Sidebar Search */
.map-sidebar-search {
    padding-bottom: var(--spacing-sm);
}

.map-search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    background: var(--surface-raised, #f9fafb);
    color: var(--text, #111827);
    outline: none;
    transition: border-color 0.15s ease;
}

.map-search-input:focus {
    border-color: var(--color-primary, #FF7F50);
    box-shadow: 0 0 0 2px var(--focus-ring, rgba(255,127,80,0.2));
}

.map-search-input::placeholder {
    color: var(--text-muted, #6b7280);
}

/* Sidebar Stats (compact) */
.map-sidebar-stats {
    padding-bottom: 6px;
}

/* Collapsible filter section */
.map-sidebar-details {
    border-bottom: 1px solid var(--border-light, #f3f4f6);
    padding-bottom: var(--spacing-sm);
}

.map-sidebar-details summary {
    cursor: pointer;
    user-select: none;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 4px;
}

.map-sidebar-details summary::-webkit-details-marker {
    display: none;
}

.map-sidebar-details summary::before {
    content: '▸';
    font-size: 10px;
    transition: transform 0.15s ease;
    color: var(--text-muted, #6b7280);
}

.map-sidebar-details[open] summary::before {
    transform: rotate(90deg);
}

.map-sidebar-toggle-heading {
    margin-bottom: 0;
}

.map-filter-panel {
    padding-top: var(--spacing-xs);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.map-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.map-filter-group-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted, #6b7280);
}

/* Project List */
.map-project-list-section {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-bottom: none;
    padding-bottom: 0;
}

.map-project-list-section .map-sidebar-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.map-selection-count {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-primary, #FF7F50);
    text-transform: none;
    letter-spacing: 0;
}

.map-project-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-height: 100px;
    max-height: 300px;
}

.map-project-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.1s ease;
    border: 1px solid transparent;
}

.map-project-item:hover {
    background: var(--surface-raised, #f9fafb);
}

.map-project-item.selected {
    background: var(--surface-primary-tint, rgba(255,127,80,0.05));
    border-color: var(--card-accent, rgba(255,127,80,0.24));
}

.map-project-item.no-coords {
    opacity: 0.5;
}

.map-project-item-select {
    flex-shrink: 0;
}

.map-project-item-select input[type="checkbox"] {
    accent-color: var(--checkbox-brand, var(--color-primary, #FF7F50));
    width: 14px;
    height: 14px;
    cursor: pointer;
}

.map-project-item-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.map-project-item-info {
    flex: 1;
    min-width: 0;
}

.map-project-item-site {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--text, #111827);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.map-project-item-addr {
    font-size: 10px;
    color: var(--text-muted, #6b7280);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.map-project-item-status {
    font-size: 10px;
    color: var(--text-muted, #6b7280);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Route bar (sticky bottom of sidebar) */
.map-route-bar {
    display: flex;
    gap: 6px;
    align-items: center;
}

.map-route-bar .map-route-btn {
    flex: 1;
}

.map-select-all-btn,
.map-select-none-btn {
    padding: 8px 10px;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: var(--radius-md);
    background: var(--surface, #fff);
    color: var(--text-muted, #6b7280);
    font-size: var(--font-size-xs);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.map-select-all-btn:hover {
    border-color: var(--color-primary, #FF7F50);
    color: var(--color-primary, #FF7F50);
}

.map-select-none-btn:hover {
    border-color: var(--status-danger, #ef4444);
    color: var(--status-danger, #ef4444);
}

/* Status Legend */
.map-legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
}

.map-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--font-size-xs);
    color: var(--text, #111827);
}

.map-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.8), 0 1px 2px rgba(0,0,0,0.15);
}

.map-legend-name {
    white-space: nowrap;
}

/* Filter Chips */
.map-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.map-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border, #e5e7eb);
    background: var(--surface, #fff);
    color: var(--text-muted, #6b7280);
    font-size: var(--font-size-xs);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.map-filter-chip:hover {
    border-color: var(--color-primary, #FF7F50);
    color: var(--color-primary, #FF7F50);
}

.map-filter-chip.active {
    background: var(--chip-primary-bg, #FFB399);
    color: var(--chip-primary-text, #000);
    border-color: var(--chip-primary-border, rgba(255, 127, 80, 0.3));
    font-weight: 600;
}

.chip-count {
    font-size: 10px;
    opacity: 0.7;
}

/* Photo filter toggles */
.map-filter-toggles {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.map-toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--font-size-sm);
    color: var(--text, #111827);
    cursor: pointer;
}

.map-toggle-label input[type="checkbox"] {
    accent-color: var(--checkbox-brand, var(--color-primary, #FF7F50));
    width: 16px;
    height: 16px;
}

/* Clear filters button */
.map-clear-filters-btn {
    background: none;
    border: none;
    color: var(--color-primary, #FF7F50);
    font-size: var(--font-size-xs);
    cursor: pointer;
    padding: 4px 0;
    text-decoration: underline;
}

.map-clear-filters-btn:hover {
    opacity: 0.8;
}

/* Route Planner */
.map-route-section {
    border-bottom: none;
}

.map-route-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 16px;
    background: var(--btn-primary-bg, var(--color-primary, #FF7F50));
    color: var(--btn-primary-text, #fff);
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.map-route-btn:hover {
    background: var(--btn-primary-bg-hover);
}

.map-route-results {
    margin-top: var(--spacing-sm);
}

.map-route-stats {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
}

.route-stat {
    font-size: var(--font-size-sm);
    color: var(--text-muted, #6b7280);
}

.route-stat-num {
    font-weight: 700;
    color: var(--color-primary, #FF7F50);
    font-size: var(--font-size-base);
}

.map-route-stops {
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: var(--spacing-sm);
}

.route-stop-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    background: var(--surface-raised, #f9fafb);
}

.route-stop-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    min-width: 22px;
    border-radius: 50%;
    background: var(--color-primary, #FF7F50);
    color: var(--color-primary-contrast, #fff);
    font-size: 11px;
    font-weight: 700;
}

.route-stop-info {
    flex: 1;
    min-width: 0;
}

.route-stop-site {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text, #111827);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.route-stop-addr {
    font-size: var(--font-size-xs);
    color: var(--text-muted, #6b7280);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.map-route-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.map-route-gmaps-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px 12px;
    background: var(--btn-primary-bg, var(--color-primary, #FF7F50));
    color: var(--btn-primary-text, #fff);
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--font-size-xs);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.map-route-gmaps-btn:hover {
    background: var(--btn-primary-bg-hover);
}

.map-route-clear-btn {
    width: 100%;
    padding: 6px 12px;
    background: none;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: var(--radius-md);
    color: var(--text-muted, #6b7280);
    font-size: var(--font-size-xs);
    cursor: pointer;
    transition: all 0.15s ease;
}

.map-route-clear-btn:hover {
    border-color: var(--status-danger, #ef4444);
    color: var(--status-danger, #ef4444);
}

/* Geocode button */
.map-geocode-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px 12px;
    background: var(--surface-raised, #f9fafb);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: var(--radius-md);
    color: var(--text, #111827);
    font-size: var(--font-size-xs);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.map-geocode-btn:hover:not(:disabled) {
    border-color: var(--color-primary, #FF7F50);
    color: var(--color-primary, #FF7F50);
}

.map-geocode-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.map-geocode-progress {
    font-size: var(--font-size-xs);
    color: var(--text-muted, #6b7280);
    margin-top: 6px;
    padding: 6px 8px;
    background: var(--surface-raised, #f9fafb);
    border-radius: var(--radius-sm);
}

/* Map Markers */
.project-map-marker {
    background: none !important;
    border: none !important;
    overflow: visible !important;
}

.map-marker-pin {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 28px;
}

.map-marker-label {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 3px;
    line-height: 1.3;
    pointer-events: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-cluster-wrapper {
    background: none !important;
    border: none !important;
}

.project-route-stop {
    background: none !important;
    border: none !important;
}

/* Map Popup */
.project-map-popup-wrapper .leaflet-popup-content-wrapper {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 0;
    overflow: hidden;
}

.project-map-popup-wrapper .leaflet-popup-content {
    margin: 0;
    min-width: 220px;
}

.project-map-popup-wrapper .leaflet-popup-tip {
    box-shadow: var(--shadow-sm);
}

.project-map-popup {
    padding: 14px 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.project-map-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.project-map-popup-site {
    font-weight: 700;
    font-size: var(--font-size-sm);
    color: var(--text, #111827);
}

.project-map-popup-name {
    font-size: var(--font-size-xs);
    color: var(--text-muted, #6b7280);
    margin-bottom: 4px;
}

.project-map-popup-address {
    font-size: var(--font-size-xs);
    color: var(--text-muted, #6b7280);
    margin-bottom: 2px;
}

.project-map-popup-market {
    font-size: var(--font-size-xs);
    color: var(--text-muted, #6b7280);
    font-style: italic;
    margin-bottom: 8px;
}

.project-map-popup-photos {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.project-map-popup-photos .photo-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.project-map-popup-photos .photo-badge.pre {
    background: var(--status-info-bg, #dbeafe);
    color: var(--status-info-text, #1e40af);
}

.project-map-popup-photos .photo-badge.post {
    background: var(--status-success-bg, #d1fae5);
    color: var(--status-success-text, #065f46);
}

.project-map-popup-btn {
    width: 100%;
    padding: 8px;
    background: var(--btn-primary-bg, var(--color-primary, #FF7F50));
    color: var(--btn-primary-text, #fff);
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--font-size-xs);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.project-map-popup-btn:hover {
    background: var(--btn-primary-bg-hover);
}

/* Mobile sidebar toggle */
.map-sidebar-toggle {
    display: none;
    position: absolute;
    top: 8px;
    right: -40px;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e5e7eb);
    box-shadow: var(--shadow-md);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    color: var(--text-muted, #6b7280);
}

/* ===== Map Responsive ===== */
@media (max-width: 768px) {
    .project-map-layout {
        flex-direction: column;
        height: auto;
    }

    .project-map-container {
        min-height: 400px;
        height: 50vh;
    }

    .project-map-sidebar {
        width: 100%;
        min-width: unset;
        max-height: 0;
        border-left: none;
        border-top: 1px solid var(--border, #e5e7eb);
        transition: max-height 0.3s ease;
    }

    .project-map-sidebar.open {
        max-height: 600px;
    }

    .map-sidebar-toggle {
        display: flex;
        position: fixed;
        bottom: 80px;
        right: 16px;
        top: auto;
        width: 44px;
        height: 44px;
        border-radius: 50%;
        box-shadow: var(--shadow-lg);
        background: var(--color-primary, #FF7F50);
        color: white;
        border: none;
        z-index: 1000;
    }

    .projects-view-map {
        height: auto;
        min-height: auto;
    }
}

@media (max-width: 480px) {
    .project-map-container {
        min-height: 300px;
        height: 40vh;
    }
}

/* ============================================================================
   Document Upload Modal — Per-file metadata card system
   ============================================================================ */

/* Drop zone */
.mts-docupload-dropzone {
    border: 2px dashed var(--mts-gray-300);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    background: var(--mts-gray-100);
    cursor: pointer;
    transition: all 0.2s ease;
}
.mts-docupload-dropzone:hover,
.mts-docupload-dropzone.drag-over {
    border-color: var(--mts-orange-1);
    background: rgba(204, 85, 0, 0.05);
}
.mts-docupload-dropzone-icon {
    font-size: 48px;
    margin-bottom: 0.5rem;
}
.mts-docupload-dropzone-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--mts-gray-900);
    margin-bottom: 0.25rem;
}
.mts-docupload-dropzone-subtitle {
    font-size: 0.875rem;
    color: var(--mts-gray-500);
}
.mts-docupload-dropzone-hint {
    font-size: 0.75rem;
    color: var(--mts-gray-500);
    margin-top: 0.5rem;
}
/* Collapsed drop zone when files are present */
.mts-docupload-dropzone.collapsed {
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}
.mts-docupload-dropzone.collapsed .mts-docupload-dropzone-icon,
.mts-docupload-dropzone.collapsed .mts-docupload-dropzone-title,
.mts-docupload-dropzone.collapsed .mts-docupload-dropzone-hint {
    display: none;
}
.mts-docupload-dropzone.collapsed .mts-docupload-dropzone-subtitle {
    font-size: 0.8125rem;
}

/* Quick action buttons row */
.mts-docupload-actions {
    display: flex;
    gap: 0.5rem;
    margin: 0.75rem 0;
}
.mts-docupload-actions .mts-btn {
    flex: 1;
}

/* Batch header */
.mts-docupload-batch-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--mts-gray-300);
}
.mts-docupload-batch-count {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--mts-gray-700);
}
.mts-docupload-batch-apply {
    position: relative;
}
.mts-docupload-batch-apply-btn {
    font-size: 0.8125rem;
    color: var(--mts-orange-1);
    background: none;
    border: 1px solid var(--mts-orange-1);
    border-radius: 14px;
    padding: 0.25rem 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
}
.mts-docupload-batch-apply-btn:hover {
    background: var(--mts-orange-1);
    color: white;
}
.mts-docupload-batch-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: white;
    border: 1px solid var(--mts-gray-300);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
    min-width: 180px;
    display: none;
}
.mts-docupload-batch-dropdown.open {
    display: block;
}
.mts-docupload-batch-dropdown-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--mts-gray-700);
}
.mts-docupload-batch-dropdown-item:hover {
    background: var(--mts-gray-100);
    color: var(--mts-orange-1);
}
.mts-docupload-batch-dropdown-item:first-child {
    border-radius: 8px 8px 0 0;
}
.mts-docupload-batch-dropdown-item:last-child {
    border-radius: 0 0 8px 8px;
}

/* Cards container */
.mts-docupload-cards {
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.25rem 0;
}

/* Individual card */
.mts-docupload-card {
    background: white;
    border: 1px solid var(--mts-gray-300);
    border-radius: 8px;
    padding: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: border-color 0.15s ease;
}
.mts-docupload-card:hover {
    border-color: var(--mts-orange-1);
}

/* Card header row: icon + name + remove */
.mts-docupload-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.mts-docupload-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}
.mts-docupload-card-icon.pdf  { background: #ef4444; }
.mts-docupload-card-icon.doc  { background: #3b82f6; }
.mts-docupload-card-icon.img  { background: #10b981; }
.mts-docupload-card-icon.file { background: var(--mts-gray-500); }

.mts-docupload-card-info {
    flex: 1;
    min-width: 0;
}
.mts-docupload-card-name-input {
    display: block;
    width: 100%;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 0.2rem 0.35rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--mts-gray-900);
    background: transparent;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.mts-docupload-card-name-input:hover {
    background: var(--mts-gray-100);
}
.mts-docupload-card-name-input:focus {
    outline: none;
    border-color: var(--mts-orange-1);
    background: white;
    box-shadow: 0 0 0 2px rgba(204, 85, 0, 0.15);
}
.mts-docupload-card-size {
    font-size: 0.75rem;
    color: var(--mts-gray-500);
    padding-left: 0.35rem;
}
.mts-docupload-card-remove {
    background: none;
    border: none;
    color: var(--mts-gray-500);
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0.25rem;
    line-height: 1;
    border-radius: 4px;
    transition: color 0.15s ease, background 0.15s ease;
    flex-shrink: 0;
}
.mts-docupload-card-remove:hover {
    color: var(--mts-error);
    background: rgba(239, 68, 68, 0.1);
}

/* Type chips */
.mts-docupload-type-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-bottom: 0.5rem;
}
.mts-docupload-chip {
    height: 28px;
    padding: 0 0.625rem;
    border-radius: 14px;
    border: 1px solid var(--mts-gray-300);
    background: white;
    color: var(--mts-gray-700);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}
.mts-docupload-chip:hover {
    border-color: var(--mts-orange-1);
    color: var(--mts-orange-1);
}
.mts-docupload-chip.selected {
    background: var(--mts-orange-1);
    border-color: var(--mts-orange-1);
    color: white;
}

/* Custom type input */
.mts-docupload-custom-input {
    width: 100%;
    border: 1px solid var(--mts-gray-300);
    border-radius: 6px;
    padding: 0.375rem 0.5rem;
    font-size: 0.8125rem;
    color: var(--mts-gray-900);
    margin-bottom: 0.5rem;
    transition: border-color 0.15s ease;
}
.mts-docupload-custom-input:focus {
    outline: none;
    border-color: var(--mts-orange-1);
    box-shadow: 0 0 0 2px rgba(204, 85, 0, 0.15);
}

/* Expiration toggle row */
.mts-docupload-expiry-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0.375rem;
}
.mts-docupload-expiry-label {
    font-size: 0.8125rem;
    color: var(--mts-gray-700);
    flex-shrink: 0;
}
.mts-docupload-toggle {
    position: relative;
    width: 36px;
    height: 20px;
    flex-shrink: 0;
}
.mts-docupload-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}
.mts-docupload-toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--mts-gray-300);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s ease;
}
.mts-docupload-toggle-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 2px;
    top: 2px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s ease;
}
.mts-docupload-toggle input:checked + .mts-docupload-toggle-slider {
    background: var(--mts-orange-1);
}
.mts-docupload-toggle input:checked + .mts-docupload-toggle-slider::before {
    transform: translateX(16px);
}
.mts-docupload-expiry-date {
    border: 1px solid var(--mts-gray-300);
    border-radius: 6px;
    padding: 0.25rem 0.5rem;
    font-size: 0.8125rem;
    color: var(--mts-gray-900);
    flex: 1;
    min-width: 0;
}
.mts-docupload-expiry-date:focus {
    outline: none;
    border-color: var(--mts-orange-1);
    box-shadow: 0 0 0 2px rgba(204, 85, 0, 0.15);
}
.mts-docupload-expiry-hint {
    font-size: 0.6875rem;
    color: var(--mts-gray-500);
    flex-shrink: 0;
}

/* Notes textarea */
.mts-docupload-notes {
    width: 100%;
    border: 1px solid var(--mts-gray-300);
    border-radius: 6px;
    padding: 0.5rem;
    font-size: 0.8125rem;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
    transition: border-color 0.15s ease;
    margin-top: 0.75rem;
}
.mts-docupload-notes:focus {
    outline: none;
    border-color: var(--mts-orange-1);
    box-shadow: 0 0 0 2px rgba(204, 85, 0, 0.15);
}

/* Footer */
.mts-docupload-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--mts-gray-300);
}
.mts-docupload-summary {
    font-size: 0.8125rem;
    color: var(--mts-gray-500);
}
.mts-docupload-footer-buttons {
    display: flex;
    gap: 0.5rem;
}

/* Upload progress bar */
.mts-docupload-progress {
    height: 4px;
    background: var(--mts-gray-300);
    border-radius: 2px;
    margin-top: 0.75rem;
    overflow: hidden;
    display: none;
}
.mts-docupload-progress.active {
    display: block;
}
.mts-docupload-progress-bar {
    height: 100%;
    background: var(--mts-orange-1);
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s ease;
}

/* Modal subtitle */
.mts-docupload-subtitle {
    font-size: 0.8125rem;
    color: var(--mts-gray-500);
    margin-top: 0.125rem;
}

/* Per-file notes input in upload card */
.mts-docupload-card-notes {
    width: 100%;
    height: 32px;
    padding: 0 10px;
    font-size: 0.8125rem;
    color: var(--mts-gray-900);
    background: var(--mts-white);
    border: 1px solid var(--mts-gray-300);
    border-radius: 6px;
    margin-top: 0.5rem;
    box-sizing: border-box;
    font-family: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.mts-docupload-card-notes:focus {
    outline: none;
    border-color: var(--mts-orange-1);
    box-shadow: 0 0 0 2px rgba(204, 85, 0, 0.15);
}
.mts-docupload-card-notes::placeholder {
    color: var(--mts-gray-500);
    font-style: italic;
}

/* ── Document List: Type Icon Badges ── */
.mts-doc-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}
.mts-doc-icon--pdf  { background: rgba(239, 68, 68, 0.12); color: #ef4444; }
.mts-doc-icon--doc  { background: rgba(59, 130, 246, 0.12); color: #3b82f6; }
.mts-doc-icon--xls  { background: rgba(16, 185, 129, 0.12); color: #10b981; }
.mts-doc-icon--ppt  { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }
.mts-doc-icon--img  { background: rgba(16, 185, 129, 0.12); color: #10b981; }
.mts-doc-icon--other { background: var(--mts-gray-100); color: var(--mts-gray-500); }

/* ── Document List: Document Type Badge ── */
.mts-doc-type-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--mts-orange-1);
    background: rgba(204, 85, 0, 0.1);
    border-radius: 10px;
    white-space: nowrap;
}

/* ── Document List: Expiration Badge ── */
.mts-doc-expiry-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 500;
    color: var(--mts-gray-700);
    background: var(--mts-gray-100);
    border-radius: 10px;
    white-space: nowrap;
}
.mts-doc-expiry-badge--soon {
    color: #b45309;
    background: rgba(245, 158, 11, 0.15);
}
.mts-doc-expiry-badge--expired {
    color: #dc2626;
    background: rgba(239, 68, 68, 0.1);
}

/* ── Document List Row ── */
.mts-doc-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 10px 14px;
    margin-bottom: 6px;
    background: var(--mts-white);
    border: 1px solid var(--mts-gray-300);
    border-radius: var(--radius-md);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.mts-doc-row:hover {
    border-color: var(--mts-gray-500);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.mts-doc-row-info {
    flex: 1;
    min-width: 0;
}
.mts-doc-row-title {
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--mts-gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}
.mts-doc-row-meta {
    font-size: var(--font-size-xs);
    color: var(--mts-gray-500);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.mts-doc-row-sep {
    color: var(--mts-gray-300);
}

/* ── Document Action Buttons ── */
.mts-doc-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.mts-doc-action {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: 6px;
    color: var(--mts-gray-500);
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
    text-decoration: none;
}
.mts-doc-action:hover {
    color: var(--mts-orange-1);
    background: rgba(204, 85, 0, 0.08);
}
.mts-doc-action--delete {
    color: var(--mts-gray-500);
}
.mts-doc-action--delete:hover {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.08);
}

/* ── Document Expiration Alert Banner ── */
.mts-doc-alert-banner {
    background: #fef3cd;
    border: 1px solid #ffc107;
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 12px;
}
.mts-doc-alert-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: #856404;
    margin-bottom: 8px;
}
.mts-doc-alert-header svg { color: #b45309; flex-shrink: 0; }
.mts-doc-alert-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    margin-top: 4px;
    border-radius: 6px;
    background: rgba(255, 193, 7, 0.15);
    font-size: var(--font-size-xs);
}
.mts-doc-alert-item--expired {
    background: rgba(220, 38, 38, 0.08);
}
.mts-doc-alert-item--soon {
    background: rgba(245, 158, 11, 0.12);
}
.mts-doc-alert-item-text {
    flex: 1;
    color: #4a4a4a;
    min-width: 0;
}
.mts-doc-alert-item-text strong {
    color: var(--mts-gray-900);
}
.mts-doc-alert-item-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}
.mts-doc-alert-btn {
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid #b45309;
    border-radius: 4px;
    background: transparent;
    color: #b45309;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.mts-doc-alert-btn:hover {
    background: #b45309;
    color: #fff;
}
.mts-doc-alert-btn--dismiss {
    border-color: var(--mts-gray-300);
    color: var(--mts-gray-500);
}
.mts-doc-alert-btn--dismiss:hover {
    background: var(--mts-gray-500);
    color: #fff;
}

/* ── Document Sort Bar ── */
.mts-doc-sort-bar {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--mts-gray-300);
}
.mts-doc-sort-label {
    font-size: 11px;
    color: var(--mts-gray-500);
    font-weight: 500;
    margin-right: 4px;
}
.mts-doc-sort-btn {
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid var(--mts-gray-300);
    border-radius: 12px;
    background: transparent;
    color: var(--mts-gray-500);
    cursor: pointer;
    transition: all 0.15s ease;
}
.mts-doc-sort-btn:hover {
    border-color: var(--mts-orange-1);
    color: var(--mts-orange-1);
}
.mts-doc-sort-btn.active {
    background: var(--mts-orange-1);
    border-color: var(--mts-orange-1);
    color: #fff;
}

/* ── Document Group (type grouping) ── */
.mts-doc-group {
    margin-bottom: 12px;
}
.mts-doc-group-header {
    font-size: 12px;
    font-weight: 600;
    color: var(--mts-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 4px 0 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.mts-doc-group-count {
    display: inline-block;
    background: var(--mts-gray-100);
    color: var(--mts-gray-500);
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 8px;
}

/* ── Project Tab Badge (expiration alerts) ── */
.project-tab-badge {
    display: none;
}
.project-tab-badge.has-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 6px;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    background: #dc2626;
    border-radius: 9px;
    line-height: 1;
}

/* ── Grid Card: Document Expiry Badge ── */
.mts-grid-card-doc-expiry {
    display: none;
}
.mts-doc-expiry-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 600;
    border-radius: 10px;
    white-space: nowrap;
    line-height: 1;
}
.mts-doc-expiry-card-badge--expired {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.1);
}
.mts-doc-expiry-card-badge--soon {
    color: #b45309;
    background: rgba(245, 158, 11, 0.12);
}

/* Editable expiry badge cursor */
.mts-doc-expiry-badge--editable {
    cursor: pointer;
    transition: background 0.15s ease;
}
.mts-doc-expiry-badge--editable:hover {
    filter: brightness(0.9);
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 480px) {
    .mts-docupload-cards {
        max-height: 300px;
    }
    .mts-docupload-type-chips {
        gap: 0.25rem;
    }
    .mts-docupload-chip {
        font-size: 0.6875rem;
        padding: 0 0.5rem;
        height: 26px;
    }
    .mts-doc-row {
        flex-wrap: wrap;
    }
    .mts-doc-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: 6px;
        padding-top: 6px;
        border-top: 1px solid var(--mts-gray-300);
    }
}

/* ===============================================
   Grid Redesign - Status Groups, Cards, Chips
   =============================================== */

/* Override #projects-list grid when in grouped grid view */
.projects-view-grid#projects-list,
.projects-view-grid {
    display: block !important;
}

/* === Status Filter Chips === */
.mts-status-chips-bar {
    display: flex;
    flex-direction: row;
    gap: 8px;
    overflow-x: auto;
    padding: 0 0 12px 0;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.mts-status-chips-bar::-webkit-scrollbar {
    display: none;
}
.mts-status-chip {
    display: inline-flex;
    align-items: center;
    height: 32px;
    padding: 0 12px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    user-select: none;
    background: var(--mts-white);
    color: var(--mts-gray-500);
    border: 1px solid var(--mts-gray-300);
}
.mts-status-chip:hover {
    opacity: 0.85;
}
.mts-status-chip.active {
    /* active colors set via inline style for per-status color */
}

/* === Status Group Lanes === */
.mts-grid-group-header {
    display: flex;
    align-items: center;
    width: 100%;
    height: 40px;
    background: var(--mts-gray-100);
    cursor: pointer;
    margin-bottom: 8px;
    user-select: none;
    border-radius: 6px;
}
.mts-grid-group-accent {
    width: 4px;
    height: 100%;
    flex-shrink: 0;
    border-radius: 6px 0 0 6px;
}
.mts-grid-group-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--mts-gray-900);
    margin-left: 12px;
    flex: 1;
}
.mts-grid-group-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    min-width: 24px;
    padding: 0 10px;
    background: var(--mts-gray-300);
    color: var(--mts-gray-700);
    font-size: 12px;
    font-weight: 700;
    border-radius: 12px;
    margin-right: 8px;
}
.mts-grid-group-chevron {
    width: 16px;
    height: 16px;
    color: var(--mts-gray-500);
    transition: transform 0.2s ease;
    margin-right: 12px;
    flex-shrink: 0;
}
.mts-grid-group-chevron.collapsed {
    transform: rotate(-90deg);
}

/* === Grid Layout (within each group) === */
.mts-grid-group-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    padding: 0 0 16px 0;
}
@media (max-width: 599px) {
    .mts-grid-group-cards {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}
@media (min-width: 600px) and (max-width: 1024px) {
    .mts-grid-group-cards {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

/* === Card Container === */
.mts-grid-card {
    background: var(--mts-white);
    border: 1px solid var(--mts-gray-300);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    transition: transform 0.1s ease, box-shadow 0.2s ease;
    box-shadow: var(--shadow-md);
}
.mts-grid-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}
.mts-grid-card:active {
    transform: scale(0.98);
}
.mts-grid-card-compact {
    max-height: 100px;
}

/* Status-specific card borders */
.mts-grid-card[data-status="Active"] {
    border-color: rgba(59, 130, 246, 0.3);
}
.mts-grid-card[data-status="CX"] {
    border-color: rgba(249, 115, 22, 0.3);
}
.mts-grid-card[data-status="Submitted"] {
    border-color: rgba(245, 158, 11, 0.3);
}

/* === Card Accent Stripe === */
.mts-grid-card-stripe {
    height: 4px;
    width: 100%;
}

/* === Card Thumbnail === */
.mts-grid-card-thumb {
    width: 100%;
    height: 80px;
    overflow: hidden;
    background: var(--mts-gray-100);
    transition: height 0.25s ease;
}
.mts-grid-card:hover .mts-grid-card-thumb {
    height: 180px;
}
.mts-grid-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.25s ease;
}
.mts-grid-card:hover .mts-grid-card-thumb img {
    transform: scale(1.05);
}

/* === Card Inner Padding Wrapper === */
.mts-grid-card-inner {
    padding: 16px 16px 12px 16px;
}

/* === Zone 1: Identity === */
.mts-grid-card-identity {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}
.mts-grid-card-site-number {
    font-size: 20px;
    font-weight: 700;
    color: var(--mts-gray-900);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 70%;
    line-height: 1.3;
}
.mts-grid-card-site-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--mts-orange-1);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mts-grid-card-badges {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

/* === Zone 2: Context === */
.mts-grid-card-context {
    margin-bottom: 12px;
}
.mts-grid-card-context-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}
.mts-grid-card-context-row:last-child {
    margin-bottom: 0;
}
.mts-grid-card-context-icon {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    color: var(--mts-gray-500);
}
.mts-grid-card-context-text {
    font-size: 14px;
    font-weight: 400;
    color: var(--mts-gray-700);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mts-grid-card-context-text.market {
    color: var(--mts-gray-500);
}

/* === Divider === */
.mts-grid-card-divider {
    height: 1px;
    background: var(--mts-gray-300);
    margin: 0;
}

/* === Zone 3: Progress === */
.mts-grid-card-progress {
    padding: 12px 0 0 0;
}
.mts-progress-track {
    height: 6px;
    border-radius: 3px;
    background: var(--mts-gray-100);
    overflow: hidden;
}
.mts-progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}
.mts-progress-empty .mts-progress-fill {
    background: var(--mts-gray-500);
}
.mts-progress-blue .mts-progress-fill {
    background: #3b82f6;
}
.mts-progress-amber .mts-progress-fill {
    background: #f59e0b;
}
.mts-progress-orange .mts-progress-fill {
    background: #CC5500;
}
.mts-progress-green .mts-progress-fill {
    background: #10b981;
}
.mts-grid-card-photo-stats {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
}
.mts-grid-card-stat-group {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.mts-grid-card-stat-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--mts-gray-500);
    text-transform: uppercase;
}
.mts-grid-card-stat-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--mts-gray-900);
}
.mts-grid-card-stat-value.processed-active {
    color: #10b981;
}
.mts-grid-card-no-photos {
    font-size: 13px;
    font-weight: 400;
    font-style: italic;
    color: var(--mts-gray-500);
    padding-top: 12px;
}
.mts-grid-card-no-photos.needs-attention {
    color: #f59e0b;
}

/* === Zone 4: Financials === */
.mts-grid-card-financials {
    display: flex;
    justify-content: space-between;
    padding: 12px 0 4px 0;
}
.mts-grid-card-fin-stat {
    text-align: center;
    flex: 1;
}
.mts-grid-card-fin-label {
    font-size: 11px;
    color: var(--mts-gray-500);
    display: block;
}
.mts-grid-card-fin-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--mts-gray-900);
    display: block;
}
.mts-grid-card-fin-value.due-positive {
    color: #ef4444;
    font-weight: 800;
}
.mts-grid-card-fin-value.due-clear {
    color: #10b981;
}
.mts-grid-card-no-finance {
    font-size: 13px;
    font-weight: 400;
    font-style: italic;
    color: var(--mts-gray-500);
    text-align: center;
    padding: 12px 0 4px 0;
}

/* === Attention States === */
.mts-grid-card-stale-dot {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f59e0b;
    z-index: 1;
    animation: mts-pulse 2s infinite;
}
@keyframes mts-pulse {
    0% { opacity: 0.4; }
    50% { opacity: 1; }
    100% { opacity: 0.4; }
}
.mts-grid-card-ready-check {
    color: #10b981;
    margin-left: 4px;
    display: inline-flex;
    vertical-align: middle;
}

/* Alert triangle for balance due */
.mts-grid-card-alert-icon {
    display: inline-flex;
    vertical-align: middle;
    margin-right: 2px;
    color: #ef4444;
}

/* === Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
    .mts-grid-card-stale-dot {
        animation: none;
        opacity: 1;
    }
    .mts-grid-card {
        transition: none;
    }
    .mts-grid-group-chevron {
        transition: none;
    }
}

/* === Empty filter state within grid === */
.mts-grid-empty-filter {
    text-align: center;
    padding: 32px 16px;
    color: var(--mts-gray-500);
    font-size: 14px;
}
.mts-grid-empty-filter button {
    margin-top: 12px;
}

/* ===== ACTIVITY LOG REDESIGN ===== */

.al-page {
    max-width: 100%;
}

.al-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--mts-white);
    border-bottom: 1px solid var(--mts-gray-300);
    padding: 20px 24px;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.al-title {
    font-size: var(--font-size-2xl, 1.5rem);
    font-weight: 600;
    color: var(--mts-gray-900);
    margin: 0;
}

.al-subtitle {
    font-size: var(--font-size-sm, 0.875rem);
    color: var(--mts-gray-500);
    margin: 4px 0 0 0;
}

/* Summary Bar */
.al-summary-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 16px;
}

.al-stat-card {
    background: var(--mts-white);
    border: 1px solid var(--mts-gray-300);
    border-radius: var(--radius-md, 8px);
    padding: 16px;
    box-shadow: var(--shadow-sm, 0 1px 2px rgba(0,0,0,0.05));
    position: relative;
}

.al-stat-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: var(--radius-md, 8px) 0 0 var(--radius-md, 8px);
}

.al-stat-card[data-accent="info"]::before    { background: var(--mts-info); }
.al-stat-card[data-accent="error"]::before   { background: var(--mts-error); }
.al-stat-card[data-accent="success"]::before { background: var(--mts-success); }
.al-stat-card[data-accent="warning"]::before { background: var(--mts-warning); }

.al-stat-icon {
    width: 20px;
    height: 20px;
    margin-bottom: 8px;
}

.al-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--mts-gray-900);
    line-height: 1;
}

.al-stat-label {
    font-size: 12px;
    color: var(--mts-gray-500);
    margin-top: 4px;
}

/* Filter Toolbar */
.al-filter-toolbar {
    background: var(--mts-white);
    border: 1px solid var(--mts-gray-300);
    border-radius: var(--radius-md, 8px);
    padding: 12px 16px;
    box-shadow: var(--shadow-sm, 0 1px 2px rgba(0,0,0,0.05));
    margin-top: 16px;
}

/* Category Chips */
.al-chips-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    mask-image: linear-gradient(to right, black 95%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black 95%, transparent 100%);
}

.al-chips-row::-webkit-scrollbar { display: none; }

.al-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    border-radius: var(--radius-full, 9999px);
    font-size: 13px;
    font-weight: 500;
    color: var(--mts-gray-700);
    background: var(--mts-gray-100);
    border: 1.5px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: all 150ms ease;
    user-select: none;
}

.al-chip:hover {
    background: var(--mts-gray-300);
}

.al-chip-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.al-chip.active {
    border-color: var(--al-chip-color);
    color: var(--al-chip-color);
    background: color-mix(in srgb, var(--al-chip-color) 10%, transparent);
}

/* Detail Filters Row */
.al-detail-filters {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 10px;
    flex-wrap: wrap;
}

.al-detail-filters input,
.al-detail-filters select {
    height: 36px;
    font-size: var(--font-size-sm, 0.875rem);
    color: var(--mts-gray-900);
    background: var(--mts-white);
    border: 1px solid var(--mts-gray-300);
    border-radius: var(--radius-sm, 4px);
    padding: 0 10px;
}

.al-detail-filters input:focus,
.al-detail-filters select:focus {
    outline: none;
    border-color: var(--mts-orange-1);
    box-shadow: 0 0 0 3px rgba(204, 85, 0, 0.1);
}

.al-filter-user   { flex: 1; min-width: 140px; }
.al-filter-status  { width: 100px; }
.al-filter-date    { width: 130px; }
.al-filter-search  { flex: 2; min-width: 200px; }

/* View Controls Row */
.al-view-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.al-group-toggle {
    display: inline-flex;
    border: 1px solid var(--mts-gray-300);
    border-radius: var(--radius-sm, 4px);
    overflow: hidden;
}

.al-group-toggle button {
    padding: 4px 12px;
    font-size: 13px;
    border: none;
    background: var(--mts-white);
    color: var(--mts-gray-700);
    cursor: pointer;
}

.al-group-toggle button.active {
    background: var(--mts-orange-1);
    color: var(--mts-white);
}

.al-result-count {
    font-size: 13px;
    color: var(--mts-gray-500);
}

/* Log List */
.al-log-list {
    margin-top: 16px;
}

/* Date / Category Group Headers */
.al-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 32px;
    background: var(--mts-gray-100);
    border-bottom: 1px solid var(--mts-gray-300);
    padding: 0 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--mts-gray-700);
    position: sticky;
    top: 0;
    z-index: 10;
}

.al-group-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.al-group-count {
    font-size: 12px;
    font-weight: 400;
    color: var(--mts-gray-500);
}

/* Log Entry Card */
.al-card {
    background: var(--mts-white);
    border: 1px solid var(--mts-gray-300);
    border-radius: var(--radius-md, 8px);
    padding: 14px 16px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: background 150ms ease;
    border-left: 4px solid transparent;
}

.al-card:hover {
    background: var(--mts-gray-100);
}

.al-border-error {
    border-left-color: var(--mts-error);
    background: rgba(239, 68, 68, 0.03);
}
.al-border-error .al-card-sentence {
    color: #b91c1c;
}
.al-border-error .al-raw-badge {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.al-border-warning {
    border-left-color: var(--mts-warning);
    background: rgba(245, 158, 11, 0.03);
}

/* Card Three-Column Layout */
.al-card-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.al-card-category {
    width: 36px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    padding-top: 2px;
}

.al-category-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.al-category-icon {
    color: var(--mts-gray-500);
}

.al-card-body {
    flex: 1;
    min-width: 0;
}

.al-card-sentence {
    font-size: var(--font-size-sm, 0.875rem);
    color: var(--mts-gray-900);
    line-height: 1.4;
}

.al-card-raw {
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.al-raw-badge {
    font-size: 11px;
    font-family: monospace;
    background: var(--mts-gray-100);
    color: var(--mts-gray-500);
    padding: 1px 6px;
    border-radius: var(--radius-sm, 4px);
}

.al-resource-type {
    font-size: 12px;
    color: var(--mts-gray-500);
}

.al-card-timestamp {
    min-width: 120px;
    text-align: right;
    flex-shrink: 0;
}

.al-relative-time {
    font-size: 13px;
    color: var(--mts-gray-500);
}

.al-status-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    margin-top: 4px;
}

.al-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.al-status-dot.success { background: var(--mts-success); }
.al-status-dot.failure { background: var(--mts-error); }

.al-status-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--mts-error);
}

.al-failure-text { color: var(--mts-error); }
.al-delete-text  { color: var(--mts-error); }

/* Expanded Details */
.al-card-details {
    border-top: 1px solid var(--mts-gray-300);
    background: var(--mts-gray-100);
    border-radius: 0 0 var(--radius-md, 8px) var(--radius-md, 8px);
    margin: 12px -16px -14px -16px;
    padding: 0 16px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 200ms ease-out, padding 200ms ease-out;
}

.al-card-details.expanded {
    max-height: 500px;
    padding: 12px 16px;
}

.al-details-grid {
    display: grid;
    grid-template-columns: 140px 1fr;
    row-gap: 6px;
}

.al-detail-key {
    font-size: 13px;
    color: var(--mts-gray-500);
    text-align: right;
    padding-right: 12px;
}

.al-detail-value {
    font-size: 13px;
    color: var(--mts-gray-900);
}

.al-detail-value.mono {
    font-family: monospace;
}

.al-detail-old {
    text-decoration: line-through;
    color: var(--mts-gray-500);
}

.al-detail-arrow {
    margin: 0 6px;
    color: var(--mts-gray-500);
}

.al-detail-new {
    font-weight: 600;
}

/* Skeleton Loading */
@keyframes al-shimmer {
    0%   { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

.al-skeleton {
    background: linear-gradient(90deg, var(--mts-gray-100) 25%, var(--mts-gray-300) 50%, var(--mts-gray-100) 75%);
    background-size: 200px 100%;
    animation: al-shimmer 1.5s infinite;
    border-radius: var(--radius-sm, 4px);
}

.al-skeleton-card {
    height: 60px;
    margin-bottom: 6px;
    border-radius: var(--radius-md, 8px);
}

.al-skeleton-stat {
    height: 88px;
    border-radius: var(--radius-md, 8px);
}

/* Empty State */
.al-empty-state {
    text-align: center;
    padding: 48px 24px;
}

.al-empty-icon {
    width: 48px;
    height: 48px;
    color: var(--mts-gray-300);
    margin: 0 auto 16px;
}

.al-empty-text {
    font-size: 16px;
    color: var(--mts-gray-500);
}

.al-empty-subtext {
    font-size: 13px;
    color: var(--mts-gray-500);
    margin-top: 4px;
}

/* End Marker */
.al-end-marker {
    text-align: center;
    font-size: 12px;
    color: var(--mts-gray-500);
    padding: 24px 0;
}

/* Infinite Scroll Spinner */
.al-load-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--mts-gray-300);
    border-top-color: var(--mts-orange-1);
    border-radius: 50%;
    animation: al-spin 0.6s linear infinite;
    margin: 16px auto;
}

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

/* New Events Pill */
.al-new-events-pill {
    position: sticky;
    top: 40px;
    z-index: 11;
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}

.al-new-events-pill button {
    background: var(--mts-orange-1);
    color: var(--mts-white);
    border: none;
    border-radius: var(--radius-full, 9999px);
    padding: 6px 16px;
    font-size: 13px;
    cursor: pointer;
    box-shadow: var(--shadow-md, 0 4px 6px rgba(0,0,0,0.1));
}

/* Click-to-filter underline hints */
.al-clickable {
    cursor: pointer;
}
.al-clickable:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 1024px) {
    .al-summary-bar {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .al-detail-filters {
        flex-direction: column;
    }
    .al-detail-filters input,
    .al-detail-filters select {
        width: 100%;
    }
    .al-filter-user,
    .al-filter-status,
    .al-filter-date,
    .al-filter-search {
        width: 100%;
        min-width: unset;
        flex: unset;
    }
    .al-card-timestamp {
        min-width: unset;
    }
    .al-card-row {
        flex-wrap: wrap;
    }
    .al-card-timestamp {
        width: 100%;
        text-align: left;
        margin-top: 8px;
    }
}

@media (max-width: 480px) {
    .al-summary-bar {
        grid-template-columns: 1fr;
    }
    .al-card-category {
        display: none;
    }
    .al-details-grid {
        grid-template-columns: 1fr;
    }
    .al-detail-key {
        text-align: left;
        padding-right: 0;
        margin-top: 8px;
        font-weight: 600;
    }
    .al-page-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
}

/* ===============================================
   Finance Tab Entry Animations
   =============================================== */

/* Card fade-in + slide-up base state */
.finance-animate-in {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Active state — visible */
.finance-animate-in.animate-in-active {
    opacity: 1;
    transform: translateY(0);
}

/* Progress bar grow animation */
.finance-progress-fill.animate-bar {
    transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .finance-animate-in {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .finance-animate-in.animate-in-active {
        transition: none;
    }
    .finance-progress-fill.animate-bar {
        transition: none !important;
    }
}
