/**
 * Cockpit Desktop - Styles
 * CI-themed desktop environment
 */

:root {
    /* CI palette */
    --blue-dark: #133951;
    --blue-standard: #4D91C6;
    --blue-light: #D3E4F1;
    --blue-xlight: #F1F8FB;
    --blue-darker: #0D2433;
    --blue-bright: #5CA0D9;
    --gray-dark: #B8BDBB;
    --gray-standard: #D6DBD9;
    --gray-light: #F1F4F3;
    --gray-darker: #7A7F7D;

    --blue-main: var(--blue-standard);

    /* Modern shadows - layered for depth */
    --shadow-soft: 0 2px 8px rgba(19, 57, 81, 0.04), 0 4px 16px rgba(19, 57, 81, 0.06);
    --shadow-elev: 0 4px 12px rgba(19, 57, 81, 0.08), 0 8px 24px rgba(19, 57, 81, 0.12);
    --shadow-focus: 0 8px 20px rgba(77, 145, 198, 0.15), 0 12px 40px rgba(77, 145, 198, 0.25);
    --shadow-intense: 0 16px 32px rgba(19, 57, 81, 0.2), 0 24px 48px rgba(19, 57, 81, 0.3);

    /* Border radius */
    --radius: 16px;
    --radius-sm: 8px;
    --radius-lg: 20px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    overflow: hidden;
    height: 100vh;
    background: linear-gradient(135deg, var(--blue-light) 0%, var(--blue-xlight) 100%);
}

/* Desktop Area */
.desktop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 60px;
    background:
        radial-gradient(circle at 20% 50%, rgba(92, 160, 217, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(77, 145, 198, 0.15) 0%, transparent 50%),
        linear-gradient(135deg, var(--blue-light) 0%, var(--blue-xlight) 100%);
    background-size: cover;
    background-position: center;
    animation: subtleShift 20s ease-in-out infinite alternate;
}

@keyframes subtleShift {
    0%, 100% {
        background-position: 0% 0%, 100% 100%, center;
    }
    50% {
        background-position: 100% 100%, 0% 0%, center;
    }
}

/* Desktop Icons */
.desktop-icon {
    position: absolute;
    width: 110px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    user-select: none;
    border-radius: var(--radius);
    transition: all var(--transition-base);
    backdrop-filter: blur(0px);
}

.desktop-icon:hover {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    transform: translateY(-4px) scale(1.05);
    box-shadow: var(--shadow-soft);
}

.desktop-icon:active {
    transform: translateY(-2px) scale(1.02);
}

.desktop-icon .icon-image {
    font-size: 52px;
    margin-bottom: 8px;
    filter: drop-shadow(0 2px 4px rgba(19, 57, 81, 0.2));
    transition: all var(--transition-base);
}

.desktop-icon .icon-image img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.desktop-icon:hover .icon-image {
    filter: drop-shadow(0 4px 8px rgba(19, 57, 81, 0.3));
    transform: scale(1.1);
}

.desktop-icon .icon-label {
    color: var(--blue-darker);
    font-size: 13px;
    font-weight: 600;
    word-wrap: break-word;
    letter-spacing: 0.3px;
}

/* Desktop Sections */
.desktop-section {
    position: absolute;
    user-select: none;
    pointer-events: none;
}

.section-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--blue-dark);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    border-radius: 4px;
    display: inline-block;
    box-shadow: 0 1px 3px rgba(19, 57, 81, 0.1);
}

/* Window Container */
.window-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 60px;
    pointer-events: none;
}

/* Window Styles */
.window {
    position: absolute;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-elev);
    border: 1px solid rgba(77, 145, 198, 0.3);
    display: flex;
    flex-direction: column;
    pointer-events: all;
    opacity: 0;
    transform: scale(0.95) translateY(20px);
    transition: opacity var(--transition-slow), transform var(--transition-slow), box-shadow var(--transition-slow), border-color var(--transition-slow);
    animation: windowFadeIn var(--transition-bounce) forwards;
}

@keyframes windowFadeIn {
    0% {
        opacity: 0;
        transform: scale(0.9) translateY(30px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.window.minimized {
    opacity: 0;
    transform: scale(0.8) translateY(100vh);
    pointer-events: none;
    transition: opacity var(--transition-base), transform var(--transition-base);
}

/* No restored class needed - just remove minimized */

.window.maximized {
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: calc(100vh - 50px) !important;
    border-radius: 0;
    transition: left var(--transition-base), top var(--transition-base), width var(--transition-base), height var(--transition-base), border-radius var(--transition-base);
}

.window.active {
    box-shadow: var(--shadow-focus);
    border-color: rgba(92, 160, 217, 0.6);
    z-index: 1000;
}

/* Window Header */
.window-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: linear-gradient(180deg, var(--blue-standard) 0%, rgba(77, 145, 198, 0.95) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    cursor: move;
    user-select: none;
    position: relative;
}

.window-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.window.maximized .window-header {
    border-radius: 0;
}

.window-title {
    font-size: 15px;
    font-weight: 600;
    color: white;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(19, 57, 81, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
}

.window-title-icon {
    font-size: 16px;
}

.window-title-icon img,
.window-title img.window-title-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    display: block;
}

.window-controls {
    display: flex;
    gap: 8px;
}

/* Modern circular window controls (macOS-inspired) */
.window-control {
    width: 26px;
    height: 26px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

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

.window-control:hover::before {
    width: 100%;
    height: 100%;
}

.window-control:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.window-control:active {
    transform: scale(0.95);
}

.window-control.minimize {
    background: rgba(255, 255, 255, 0.25);
}

.window-control.minimize:hover {
    background: rgba(251, 191, 36, 0.9);
}

.window-control.maximize {
    background: rgba(255, 255, 255, 0.25);
}

.window-control.maximize:hover {
    background: rgba(34, 197, 94, 0.9);
}

.window-control.close {
    background: rgba(255, 255, 255, 0.25);
}

.window-control.close:hover {
    background: #ef4444;
    transform: scale(1.15);
}

/* Window Content */
.window-content {
    flex: 1;
    padding: 8px;
    overflow: auto;
    background: linear-gradient(180deg, rgba(241, 244, 243, 0.95) 0%, rgba(255, 255, 255, 0.9) 100%);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    color: var(--blue-darker);
    line-height: 1.6;
}

.window.maximized .window-content {
    border-radius: 0;
}

/* Enhanced scrollbar */
.window-content::-webkit-scrollbar {
    width: 10px;
}

.window-content::-webkit-scrollbar-track {
    background: rgba(214, 219, 217, 0.3);
    border-radius: 10px;
    margin: 4px;
}

.window-content::-webkit-scrollbar-thumb {
    background: var(--blue-standard);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.window-content::-webkit-scrollbar-thumb:hover {
    background: var(--blue-bright);
    background-clip: padding-box;
}

/* Window Resize Handle */
.window-resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 24px;
    height: 24px;
    cursor: nwse-resize;
    z-index: 10;
    transition: all var(--transition-fast);
}

.window-resize-handle::after {
    content: '';
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 0 14px 14px;
    border-color: transparent transparent rgba(77, 145, 198, 0.4) transparent;
    opacity: 0.6;
    transition: all var(--transition-fast);
}

.window-resize-handle:hover::after {
    opacity: 1;
    border-color: transparent transparent var(--blue-standard) transparent;
    transform: scale(1.1);
}

.window.maximized .window-resize-handle {
    display: none;
}

/* Taskbar */
.taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(19, 57, 81, 0.85);
    backdrop-filter: blur(30px) saturate(150%);
    -webkit-backdrop-filter: blur(30px) saturate(150%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    box-shadow: 0 -4px 20px rgba(13, 36, 51, 0.4), 0 -1px 0 rgba(255, 255, 255, 0.1);
    z-index: 10000;
    border-top: 1px solid rgba(77, 145, 198, 0.2);
}

.taskbar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

/* Taskbar Items */
.taskbar-items {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px 0;
    scrollbar-width: none;
}

.taskbar-items::-webkit-scrollbar {
    display: none;
}

.taskbar-item {
    padding: 12px 24px;
    background: rgba(77, 145, 198, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition-base);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.3px;
}

.taskbar-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left var(--transition-slow);
}

.taskbar-item:hover::before {
    left: 100%;
}

.taskbar-item:hover {
    background: rgba(77, 145, 198, 0.3);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(77, 145, 198, 0.3);
}

.taskbar-item:active {
    transform: translateY(-1px);
}

.taskbar-item.active {
    background: linear-gradient(135deg, var(--blue-standard), var(--blue-bright));
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 16px rgba(92, 160, 217, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.taskbar-item.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 40%;
    height: 3px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 3px 3px 0 0;
}

.taskbar-item.minimized {
    opacity: 0.6;
}

.taskbar-item.minimized:hover {
    opacity: 1;
    transform: translateY(-2px);
}


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

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* App Styles */

/* Loading State */
.app-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 20px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--gray-light);
    border-top-color: var(--blue-standard);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.app-loading p {
    color: var(--blue-darker);
    font-size: 14px;
}

/* Error State */
.app-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 16px;
    text-align: center;
}

.error-icon {
    font-size: 64px;
}

.app-error h2 {
    color: var(--blue-darker);
    margin: 0;
}

.app-error p {
    color: var(--gray-darker);
    margin: 0;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--blue-standard), var(--blue-bright));
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-soft);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-elev);
}

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

.btn-icon {
    font-size: 18px;
    font-weight: bold;
}

/* ===================================
   REUSABLE COMPONENTS
   ===================================

   This section contains generic, reusable components that can be used
   across different apps and features in the application.

   USAGE EXAMPLES:

   1. Card Grid Layout:
      <div class="card-grid">
        <div class="card card--clickable">...</div>
        <div class="card card--clickable">...</div>
      </div>

   2. Card with Avatar and Actions:
      <div class="card card--clickable">
        <div class="card-header">
          <div class="card-avatar">AB</div>
          <div class="card-actions">
            <button class="card-action-btn">...</button>
          </div>
        </div>
        <div class="card-body">
          <h3 class="card-title">Title</h3>
          <div class="info-list">
            <div class="info-row">
              <span class="info-icon"><svg>...</svg></span>
              <span>Info text</span>
            </div>
          </div>
        </div>
      </div>

   3. App Container with Header:
      <div class="app-container">
        <div class="app-header">
          <h2>Title</h2>
          <button class="btn-primary">Action</button>
        </div>
        <div class="card-grid">...</div>
      </div>

   VARIANTS:
   - .card-grid--small (220px min card width)
   - .card-grid--large (360px min card width)
   - .card--clickable (adds hover effects)

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

/* ===================================
   REUSABLE COMPONENTS - App Layout
   =================================== */

/* Generic App Container */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 20px;
    padding: 20px;
}

/* Generic App Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--gray-light);
}

.app-header h2 {
    margin: 0;
    color: var(--blue-darker);
    font-size: 24px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.item-count {
    background: var(--blue-light);
    color: var(--blue-darker);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.status-filter,
.customer-filter {
    padding: 10px 14px;
    border: 2px solid var(--gray-standard);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    background: white;
    color: var(--blue-darker);
    cursor: pointer;
    transition: all var(--transition-fast);
    min-width: 200px;
}

.status-filter {
    min-width: 160px;
}

.status-filter:hover,
.customer-filter:hover {
    border-color: var(--blue-standard);
}

.status-filter:focus,
.customer-filter:focus {
    outline: none;
    border-color: var(--blue-standard);
    box-shadow: 0 0 0 3px rgba(77, 145, 198, 0.1);
}

/* ===================================
   REUSABLE COMPONENTS - Card Grid
   =================================== */

/* Generic Card Grid Container */
.card-grid {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 4px;
    align-content: start;
}

/* Variant: Smaller cards (220px min width) */
.card-grid--small {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

/* Variant: Larger cards (360px min width) */
.card-grid--large {
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
}

/* ===================================
   REUSABLE COMPONENTS - Cards
   =================================== */

/* Generic Card */
.card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: 0 1px 3px rgba(19, 57, 81, 0.08), 0 2px 6px rgba(19, 57, 81, 0.06);
    border: 1px solid var(--gray-light);
    transition: all var(--transition-base);
}

/* Clickable Card */
.card--clickable {
    cursor: pointer;
}

.card--clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(19, 57, 81, 0.1), 0 6px 16px rgba(19, 57, 81, 0.08);
    border-color: var(--blue-standard);
}

/* Notification System */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 30000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.notification {
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    padding: 14px 18px;
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(19, 57, 81, 0.15), 0 2px 6px rgba(19, 57, 81, 0.1);
    min-width: 300px;
    max-width: 400px;
    opacity: 0;
    transform: translateX(400px);
    transition: all var(--transition-base);
    pointer-events: auto;
    border-left: 4px solid;
}

.notification--show {
    opacity: 1;
    transform: translateX(0);
}

.notification--hide {
    opacity: 0;
    transform: translateX(400px);
}

.notification--success {
    border-left-color: #10b981;
}

.notification--error {
    border-left-color: #ef4444;
}

.notification--info {
    border-left-color: var(--blue-standard);
}

.notification-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification--success .notification-icon {
    color: #10b981;
}

.notification--error .notification-icon {
    color: #ef4444;
}

.notification--info .notification-icon {
    color: var(--blue-standard);
}

.notification-icon svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
}

.notification-message {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--blue-darker);
    line-height: 1.5;
}

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

/* Card Body */
.card-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Card Title */
.card-title {
    margin: 0;
    color: var(--blue-darker);
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
}

/* Card Avatar */
.card-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue-standard), var(--blue-bright));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
}

/* Card Actions Container */
.card-actions {
    display: flex;
    gap: 6px;
}

/* ===================================
   CUSTOMERS APP - Specific Styles
   =================================== */

/* Customers App uses generic app-container */
.customers-app {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 8px;
    padding: 0;
}

/* Customer Grid uses generic card-grid */
.customers-grid {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 4px;
    align-content: start;
}

/* Projects App Grid - Smaller cards */
.grid-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    padding: 4px;
    align-content: start;
}

/* Customer Card - extends generic card */
.customer-card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: 0 1px 3px rgba(19, 57, 81, 0.08), 0 2px 6px rgba(19, 57, 81, 0.06);
    border: 1px solid var(--gray-light);
    transition: all var(--transition-base);
    cursor: pointer;
}

.customer-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(19, 57, 81, 0.1), 0 6px 16px rgba(19, 57, 81, 0.08);
    border-color: var(--blue-standard);
}

/* Customer-specific: use generic card-header */
.customer-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

/* Customer-specific: use generic card-avatar */
.customer-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue-standard), var(--blue-bright));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
}

/* Customer-specific: use generic card-actions */
.customer-card-actions {
    display: flex;
    gap: 6px;
}

/* ===================================
   REUSABLE COMPONENTS - Card Action Buttons
   =================================== */

.card-action-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    position: relative;
}

.card-action-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-sm);
    background: var(--blue-light);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.card-action-btn:hover::before {
    opacity: 1;
}

.card-action-btn svg {
    width: 16px;
    height: 16px;
    position: relative;
    z-index: 1;
    transition: all var(--transition-fast);
    stroke: var(--blue-standard);
}

.card-action-btn:hover svg {
    stroke: var(--blue-bright);
}

/* Customer-specific: use generic card-body */
.customer-card-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Customer-specific: use generic card-title */
.customer-name {
    margin: 0;
    color: var(--blue-darker);
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
}

/* ===================================
   REUSABLE COMPONENTS - Info Display
   =================================== */

/* Info List Container */
.info-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Customer-specific info (uses generic info-list) */
.customer-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Info Row */
.info-row {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--gray-darker);
    font-size: 13px;
    line-height: 1.4;
}

.info-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.info-icon svg {
    width: 16px;
    height: 16px;
    stroke: var(--blue-standard);
    fill: none;
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 16px;
    text-align: center;
}

.empty-icon {
    font-size: 72px;
    opacity: 0.5;
}

.empty-state h3 {
    margin: 0;
    color: var(--blue-darker);
    font-size: 20px;
}

.empty-state p {
    margin: 0;
    color: var(--gray-darker);
}

/* Add Customer Dialog */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(13, 36, 51, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20000;
    animation: dialogFadeIn var(--transition-base) forwards;
}

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

.dialog-overlay.dialog-closing {
    animation: dialogFadeOut var(--transition-base) forwards;
}

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

.dialog-container {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-intense);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: dialogSlideIn var(--transition-bounce) forwards;
    overflow: hidden;
}

@keyframes dialogSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(40px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    background: white;
    flex-shrink: 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.dialog-header h2 {
    margin: 0;
    color: var(--blue-darker);
    font-size: 22px;
}

.dialog-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--gray-light);
    border-radius: 50%;
    font-size: 24px;
    color: var(--gray-darker);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.dialog-close:hover {
    background: #ef4444;
    color: white;
    transform: scale(1.1);
}

.dialog-progress {
    padding: 24px;
    border-bottom: 1px solid var(--gray-light);
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
}

.progress-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 25%;
    right: 25%;
    height: 2px;
    background: var(--gray-light);
    z-index: 0;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
    position: relative;
    z-index: 1;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--gray-light);
    color: var(--gray-darker);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    transition: all var(--transition-base);
}

.progress-step.active .step-number {
    background: linear-gradient(135deg, var(--blue-standard), var(--blue-bright));
    border-color: var(--blue-standard);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(77, 145, 198, 0.4);
}

.progress-step.completed .step-number {
    background: var(--blue-standard);
    border-color: var(--blue-standard);
    color: white;
}

.step-label {
    font-size: 12px;
    color: var(--gray-darker);
    font-weight: 500;
    text-align: center;
}

.progress-step.active .step-label {
    color: var(--blue-standard);
    font-weight: 600;
}

.dialog-content {
    overflow-y: auto;
    padding: 32px 24px;
    max-height: calc(90vh - 160px);
}

.form-step + .form-step {
    margin-top: 28px;
    border-top: 1px solid var(--gray-light);
    padding-top: 28px;
}

.form-step {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-step h3 {
    margin: 0;
    color: var(--blue-darker);
    font-size: 20px;
    text-align: center;
}

.step-description {
    text-align: center;
    color: var(--gray-darker);
    margin: 0;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--blue-darker);
}

.form-input {
    padding: 12px 16px;
    border: 2px solid var(--gray-light);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: inherit;
    transition: all var(--transition-fast);
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: var(--blue-standard);
    box-shadow: 0 0 0 3px rgba(77, 145, 198, 0.1);
}

.form-input::placeholder {
    color: var(--gray-dark);
}

.dialog-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.settings-token-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.settings-token-input {
    flex: 1;
    font-family: monospace;
    font-size: 12px;
    letter-spacing: 0.02em;
}

.settings-token-reveal {
    flex-shrink: 0;
    min-width: 56px;
}

.settings-token-actions {
    margin-top: 4px;
}

.btn-danger-outline {
    border-color: #c0392b !important;
    color: #c0392b !important;
}

.dialog-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 24px;
    border-top: 2px solid var(--gray-light);
    background: white;
    flex-shrink: 0;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.btn-secondary {
    background: white;
    color: var(--blue-standard);
    border: 2px solid var(--blue-standard);
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-secondary:hover {
    background: var(--blue-light);
    transform: translateY(-2px);
}

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

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Confirmation Dialog */
.confirm-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(13, 36, 51, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 25000;
    animation: dialogFadeIn var(--transition-base) forwards;
}

.confirm-dialog-container {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-intense);
    width: 90%;
    max-width: 450px;
    display: flex;
    flex-direction: column;
    animation: dialogSlideIn var(--transition-bounce) forwards;
}

.confirm-dialog-header {
    padding: 24px 24px 16px 24px;
    border-bottom: 2px solid var(--gray-light);
}

.confirm-dialog-header h3 {
    margin: 0;
    color: var(--blue-darker);
    font-size: 20px;
    font-weight: 600;
}

.confirm-dialog-content {
    padding: 24px;
    color: var(--gray-darker);
    font-size: 15px;
    line-height: 1.6;
}

.confirm-dialog-content strong {
    color: var(--blue-darker);
    font-weight: 600;
}

.confirm-dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 2px solid var(--gray-light);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-soft);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-2px);
    box-shadow: var(--shadow-elev);
}

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

/* Customer Detail App */
.customer-detail-app {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Tab Bar */
.tab-bar {
    display: flex;
    gap: 4px;
    padding: 16px 16px 0 16px;
    border-bottom: 2px solid var(--gray-light);
    background: rgba(255, 255, 255, 0.5);
}

.tab-btn {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--gray-darker);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.tab-btn:hover {
    color: var(--blue-standard);
    background: rgba(77, 145, 198, 0.1);
}

.tab-btn.active {
    color: var(--blue-standard);
    border-bottom-color: var(--blue-standard);
}

/* Tab Content */
.tab-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.empty-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--gray-darker);
    font-size: 15px;
}

/* General Tab */
.general-tab {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.detail-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.detail-section h3 {
    margin: 0;
    color: var(--blue-darker);
    font-size: 18px;
    font-weight: 600;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--gray-light);
}

.detail-fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.detail-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.detail-field-full {
    grid-column: 1 / -1;
}

.detail-field-full textarea.field-input {
    width: 100%;
    min-height: 80px;
    resize: vertical;
}

.detail-field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--blue-darker);
}

.field-content {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
}

.field-value {
    flex: 1;
    padding: 10px 4px;
    color: var(--blue-darker);
    font-size: 14px;
    line-height: 1.5;
}

.field-input {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid var(--blue-standard);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    background: white;
    color: var(--blue-darker);
    transition: all var(--transition-fast);
}

.field-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(77, 145, 198, 0.1);
}

textarea.field-input {
    resize: vertical;
    min-height: 80px;
}

.field-content:has(textarea) {
    align-items: flex-start;
}

.field-actions {
    display: flex;
    gap: 4px;
}

.field-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    position: relative;
}

.field-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-sm);
    background: var(--blue-light);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.field-btn:hover::before {
    opacity: 1;
}

.field-btn svg {
    width: 16px;
    height: 16px;
    position: relative;
    z-index: 1;
    transition: all var(--transition-fast);
    stroke: var(--blue-standard);
}

.field-btn:hover svg {
    stroke: var(--blue-bright);
}

.save-btn svg {
    stroke: #22c55e;
}

.save-btn:hover svg {
    stroke: #16a34a;
}

.cancel-btn svg {
    stroke: var(--gray-darker);
}

.cancel-btn:hover svg {
    stroke: #ef4444;
}

.detail-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Projects Tab */
.projects-tab {
    height: 100%;
    display: flex;
    flex-direction: column;
}

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

.projects-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--blue-darker);
}

.projects-grid {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    align-content: start;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-darker);
}

.empty-state p {
    font-size: 15px;
}

/* Project Card */
.project-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    padding: 14px;
    transition: all var(--transition-base);
    border: 2px solid transparent;
    cursor: pointer;
}

.project-card:hover {
    box-shadow: var(--shadow-elev);
    border-color: var(--blue-light);
}

.project-card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.project-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue-standard), var(--blue-bright));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    color: white;
    text-transform: uppercase;
    letter-spacing: -0.5px;
    flex-shrink: 0;
}

.project-card-actions {
    display: flex;
    gap: 4px;
}

.project-card-content {
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.project-card-content:hover {
    transform: translateY(-2px);
}

.project-card-title {
    margin-bottom: 8px;
}

.project-card-title h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--blue-darker);
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.project-card-subtitle {
    font-size: 12px;
    color: var(--gray-darker);
    font-weight: 500;
}

.project-card-status {
    margin-bottom: 10px;
}

.project-status {
    font-size: 11px;
    font-weight: 700;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    display: inline-block;
}

.project-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.project-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.project-label {
    color: var(--gray-darker);
    font-weight: 500;
    font-size: 12px;
}

.project-value {
    color: var(--blue-darker);
    font-weight: 600;
    text-align: right;
    font-size: 13px;
}

/* Pricing Type Selector */
.pricing-type-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 8px;
}

.pricing-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 20px;
    background: white;
    border: 2px solid var(--gray-standard);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition-base);
}

.pricing-option:hover {
    border-color: var(--blue-standard);
    background: var(--blue-xlight);
}

.pricing-option.selected {
    border-color: var(--blue-standard);
    background: var(--blue-light);
    box-shadow: var(--shadow-soft);
}

.pricing-option-icon {
    margin-bottom: 12px;
    color: var(--blue-standard);
}

.pricing-option-icon svg {
    width: 32px;
    height: 32px;
}

.pricing-option-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--blue-darker);
    text-align: center;
}

.input-with-currency {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-currency input {
    flex: 1;
    padding-right: 60px;
}

.currency-symbol {
    position: absolute;
    right: 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-darker);
    pointer-events: none;
}

/* Time Tracking Styles */
.time-tracking-tab {
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100%;
}

.time-tracking-tab .tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--gray-light);
}

.time-tracking-tab .tab-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--blue-dark);
    margin: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.export-dropdown {
    position: relative;
}

.export-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    font-size: 14px;
}

.export-dropdown-btn .chevron {
    margin-left: 4px;
    transition: transform var(--transition-fast);
}

.export-dropdown-btn:hover .chevron {
    transform: translateY(2px);
}

.export-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    background: white;
    border: 1px solid var(--gray-light);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-elev);
    min-width: 180px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
}

.export-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.export-option {
    width: 100%;
    padding: 10px 14px;
    border: none;
    background: none;
    text-align: left;
    font-size: 14px;
    color: var(--blue-dark);
    cursor: pointer;
    transition: background-color var(--transition-fast);
    display: flex;
    align-items: center;
}

.export-option:first-child {
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.export-option:last-child {
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.export-option:hover:not(.disabled) {
    background: var(--blue-xlight);
}

.export-option.disabled {
    color: var(--gray-mid);
    cursor: not-allowed;
    opacity: 0.6;
}

.month-filter {
    padding: 8px 12px;
    border: 1px solid var(--gray-light);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--blue-dark);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    min-width: 180px;
}

.month-filter:hover {
    border-color: var(--blue-light);
}

.month-filter:focus {
    outline: none;
    border-color: var(--blue-standard);
    box-shadow: 0 0 0 3px var(--blue-xlight);
}

.time-entries-list {
    flex: 1;
    overflow-y: auto;
}

.time-entries-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.time-entries-table thead {
    background: var(--blue-xlight);
}

.time-entries-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--blue-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--blue-light);
}

.time-entries-table tbody tr {
    border-bottom: 1px solid var(--gray-light);
    transition: background-color var(--transition-fast);
}

.time-entries-table tbody tr:last-child {
    border-bottom: none;
}

.time-entries-table tbody tr:hover {
    background: var(--blue-xlight);
}

.time-entries-table td {
    padding: 14px 16px;
    font-size: 13px;
    color: var(--gray-darker);
    vertical-align: middle;
}

.time-entries-table .description-cell {
    max-width: 450px;
    min-width: 250px;
    color: var(--blue-dark);
    font-weight: 500;
    line-height: 1.5;
}

.time-entries-table .actions-cell {
    text-align: right;
    white-space: nowrap;
}

.table-action-btn {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: var(--gray-darker);
    border-radius: 4px;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.table-action-btn:hover {
    background: var(--blue-light);
    color: var(--blue-standard);
}

.table-action-btn.delete-time-entry-btn:hover {
    background: #fee;
    color: #dc2626;
}

/* Time entry inline editing */
.time-entry-row.editing {
    background: #fffbeb !important;
}

.time-entry-input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--blue-light);
    border-radius: 4px;
    font-size: 13px;
    color: var(--gray-darker);
    background: white;
    transition: all var(--transition-fast);
}

.time-entry-input:focus {
    outline: none;
    border-color: var(--blue-standard);
    box-shadow: 0 0 0 3px rgba(66, 139, 202, 0.1);
}

.time-entry-input[type="time"] {
    min-width: 100px;
}

.table-action-btn.save-time-entry-btn:hover {
    background: #d1fae5;
    color: #065f46;
}

.table-action-btn.cancel-time-entry-edit-btn:hover {
    background: #fee;
    color: #dc2626;
}

.badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: inline-block;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-secondary {
    background: var(--gray-light);
    color: var(--gray-darker);
}

/* Time Input Group for Time Entry Dialog */
.time-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.time-select {
    flex: 1;
    min-width: 0;
}

.time-separator {
    font-size: 18px;
    font-weight: 600;
    color: var(--blue-dark);
    padding: 0 4px;
}

/* Time Duration Display in Add Entry Dialog */
.time-duration-display {
    margin-top: 20px;
    padding: 16px;
    background: var(--blue-xlight);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 4px solid var(--blue-standard);
}

.duration-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--blue-dark);
}

.duration-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--blue-standard);
}

/* ===================================
   Insights Tab
   =================================== */

.insights-tab {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 24px;
    height: 100%;
    overflow-y: auto;
}

.insights-filters {
    display: flex;
    gap: 16px;
    align-items: flex-end;
}

.insights-filters .filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.insights-filters .filter-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--blue-dark);
}

.insights-filters .filter-select {
    padding: 8px 12px;
    border: 1px solid var(--gray-light);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--gray-darker);
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
    min-width: 200px;
}

.insights-filters .filter-select:hover {
    border-color: var(--blue-light);
}

.insights-filters .filter-select:focus {
    outline: none;
    border-color: var(--blue-standard);
    box-shadow: 0 0 0 3px var(--blue-xlight);
}

.insights-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.insights-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--gray-light);
    transition: all var(--transition-normal);
}

.insights-card:hover {
    box-shadow: var(--shadow-hover);
    border-color: var(--blue-light);
}

.insights-card h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--blue-dark);
    padding-bottom: 12px;
    border-bottom: 2px solid var(--blue-xlight);
}

.insights-card-wide {
    grid-column: 1 / -1;
}

.insights-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.insight-metric {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    background: var(--blue-xlight);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--blue-standard);
}

.insight-metric .metric-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--blue-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.insight-metric .metric-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--blue-standard);
}

.insights-card .chart-container {
    width: 100%;
    height: 300px;
    position: relative;
}

/* ===================================
   Invoices App
   =================================== */

.invoices-app {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0;
    gap: 8px;
    overflow: hidden;
}

/* Filters */
.invoices-filters {
    background: white;
    border-radius: var(--radius-sm);
    padding: 8px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--gray-light);
}

.filter-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 180px;
}

.filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-darker);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid var(--gray-light);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--blue-dark);
    background: white;
    cursor: pointer;
    transition: all var(--transition-base);
}

.filter-select:hover {
    border-color: var(--blue-light);
}

.filter-select:focus {
    outline: none;
    border-color: var(--blue-standard);
    box-shadow: 0 0 0 3px rgba(66, 139, 202, 0.1);
}

/* Table Container */
.invoices-table-container {
    flex: 1;
    overflow-y: auto;
    background: white;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--gray-light);
}

/* Table */
.invoices-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.invoices-table thead {
    position: sticky;
    top: 0;
    background: var(--blue-xlight);
    z-index: 10;
}

.invoices-table thead th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 700;
    color: var(--blue-dark);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--blue-light);
}

.invoices-table thead th.actions-col {
    width: 80px;
    text-align: center;
}

.invoices-table tbody tr {
    border-bottom: 1px solid var(--gray-light);
    transition: background-color var(--transition-base);
}

.invoices-table tbody tr:hover {
    background-color: var(--blue-xlight);
}

.invoices-table tbody td {
    padding: 14px 16px;
    color: var(--gray-darker);
    vertical-align: middle;
}

.invoices-table tbody td.invoice-name {
    font-weight: 700;
    color: var(--blue-dark);
    font-family: 'Courier New', monospace;
}

.invoices-table tbody td.invoice-amount {
    font-weight: 700;
    color: var(--blue-standard);
    font-variant-numeric: tabular-nums;
}

.invoices-table tbody td.actions-col {
    text-align: center;
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
}

.btn-icon-danger {
    background: transparent;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-base);
    opacity: 0.6;
}

.btn-icon-danger:hover {
    background: #fee2e2;
    opacity: 1;
    transform: scale(1.1);
}

/* Empty State in Table */
.invoices-table-container .empty-state {
    padding: 60px 20px;
}

/* Invoice Status System */
.invoice-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
    user-select: none;
}

.invoice-status:hover {
    opacity: 0.8;
    transform: translateY(-1px);
}

/* Status-specific colors */
.status-created {
    background: #e3f2fd;
    color: #1976d2;
}

.status-sent {
    background: #fff3e0;
    color: #f57c00;
}

.status-completed {
    background: #e8f5e9;
    color: #388e3c;
}

.status-overdue {
    background: #ffebee;
    color: #d32f2f;
}

.status-conflict {
    background: #fce4ec;
    color: #c2185b;
}

.status-canceled {
    background: #f5f5f5;
    color: #616161;
}

/* Status selector overlay */
.status-selector-overlay {
    position: absolute;
    z-index: 10000;
}

.status-selector-menu {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 4px;
    min-width: 150px;
    border: 1px solid #e0e0e0;
}

.status-option {
    padding: 8px 16px;
    cursor: pointer;
    border-radius: 4px;
    margin: 2px 0;
    transition: background 0.2s;
    font-size: 13px;
}

.status-option:hover {
    background: rgba(0, 0, 0, 0.05);
}

.status-option.active {
    background: rgba(66, 139, 202, 0.1);
    font-weight: 600;
}

/* Cashflow Forecast App Styles */
.cashflow-forecast-container {
    display: flex;
    height: 100%;
    overflow: hidden;
}

/* Main content wrapper */
.cashflow-main-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    gap: 12px;
}

/* Top Filter Bar */
.cashflow-filter-bar {
    background: linear-gradient(to bottom, #ffffff 0%, #f5f7f9 100%);
    border: 1px solid #d0d7de;
    border-radius: 8px;
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    padding: 8px 12px;
    flex-shrink: 0;
}

.filter-section {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    width: 100%;
    gap: 16px;
}

/* Toolbar Groups */
.toolbar-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.toolbar-group.center-group {
    justify-content: center;
}

.toolbar-group.actions-group {
    gap: 6px;
    justify-content: flex-end;
}

/* Segmented Button Groups */
.btn-group-segmented {
    display: inline-flex;
    background: rgba(77, 145, 198, 0.08);
    border-radius: 8px;
    padding: 3px;
    gap: 0;
}

.btn-group-segmented .btn-icon {
    margin: 0;
    border-radius: 6px;
    background: transparent;
    border: none;
    min-width: 38px;
}

.btn-group-segmented .btn-icon:hover {
    background: rgba(77, 145, 198, 0.15);
}

.btn-group-segmented .btn-icon.active {
    background: linear-gradient(135deg, var(--blue-standard), var(--blue-bright));
    color: white;
    box-shadow: 0 2px 8px rgba(77, 145, 198, 0.3);
}

.btn-group-segmented .btn-icon.active svg {
    stroke: white;
}

/* Icon Buttons */
.btn-icon {
    width: 30px;
    height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(77, 145, 198, 0.08);
    border: 1px solid rgba(77, 145, 198, 0.15);
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-base);
    color: var(--blue-dark);
}

.btn-icon:hover {
    background: rgba(77, 145, 198, 0.15);
    border-color: rgba(77, 145, 198, 0.25);
    transform: translateY(-1px);
}

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

.btn-icon svg {
    stroke: var(--blue-standard); /* Dark blue for better visibility */
    stroke-width: 2.5; /* Slightly thicker for emphasis */
}

/* Action Buttons (Primary actions) */
.btn-icon-action {
    width: 40px;
    height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--blue-standard), var(--blue-bright));
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--transition-base);
    color: white;
    box-shadow: 0 2px 8px rgba(77, 145, 198, 0.3);
}

.btn-icon-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(77, 145, 198, 0.4);
}

.btn-icon-action:active {
    transform: translateY(-1px);
}

.btn-icon-action svg {
    stroke: white;
}

/* Icon Buttons with Labels */
.btn-icon-labeled {
    min-width: auto;
    height: 30px;
    padding: 0 10px;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: rgba(77, 145, 198, 0.08);
    border: 1px solid rgba(77, 145, 198, 0.15);
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-base);
    color: var(--blue-dark);
    font-size: 13px;
    font-weight: 500;
}

.btn-icon-labeled:hover {
    background: rgba(77, 145, 198, 0.15);
    border-color: rgba(77, 145, 198, 0.25);
    transform: translateY(-1px);
}

.btn-icon-labeled:active {
    transform: translateY(0);
}

.btn-icon-labeled svg {
    stroke: currentColor;
    flex-shrink: 0;
}

.btn-icon-labeled span {
    white-space: nowrap;
    line-height: 1;
}

.btn-icon-labeled.active {
    background: linear-gradient(135deg, var(--blue-standard), var(--blue-bright));
    color: white;
    border-color: var(--blue-bright);
}

.btn-icon-labeled.active svg {
    stroke: white;
}

/* Labeled buttons in segmented groups */
.btn-group-segmented .btn-icon-labeled {
    margin: 0;
    border-radius: 6px;
    background: transparent;
    border: none;
    min-width: auto;
    padding: 6px 12px;
    height: 32px;
}

.btn-group-segmented .btn-icon-labeled:hover {
    background: rgba(77, 145, 198, 0.15);
}

.btn-group-segmented .btn-icon-labeled.active {
    background: linear-gradient(135deg, var(--blue-standard), var(--blue-bright));
    color: white;
    box-shadow: 0 2px 8px rgba(77, 145, 198, 0.3);
}

.btn-group-segmented .btn-icon-labeled.active svg {
    stroke: white;
}

/* Action button with label (primary style) */
.btn-icon-labeled.btn-action {
    background: linear-gradient(135deg, var(--blue-standard), var(--blue-bright));
    border: none;
    color: white;
    box-shadow: 0 2px 8px rgba(77, 145, 198, 0.3);
    padding: 0 14px;
    height: 36px;
}

.btn-icon-labeled.btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(77, 145, 198, 0.4);
}

.btn-icon-labeled.btn-action:active {
    transform: translateY(-1px);
}

.btn-icon-labeled.btn-action svg {
    stroke: white;
}

/* Export Dropdown */
.export-dropdown {
    position: relative;
}

/* Content Area */
.cashflow-content {
    flex: 1;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

#cashflow-table-container {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

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

.categories-dialog {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
    width: 600px;
    max-width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.categories-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
}

.categories-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--blue-dark);
}

.categories-header .close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.categories-header .close-btn:hover {
    background: #f0f0f0;
    color: #333;
}

/* Tabs */
.categories-tabs {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
    padding: 0 24px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    color: #666;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--blue-standard);
}

.tab-btn.active {
    color: var(--blue-standard);
    border-bottom-color: var(--blue-standard);
}

/* Categories Content */
.categories-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.categories-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.categories-table thead th {
    text-align: left;
    padding: 12px;
    border-bottom: 2px solid #e0e0e0;
    font-weight: 600;
    color: var(--blue-dark);
    font-size: 13px;
}

.categories-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.categories-table tbody tr:hover {
    background: #f8f9fa;
}

.categories-table tbody td {
    padding: 12px;
}

.categories-table .category-name {
    font-size: 14px;
    color: #333;
}

.categories-table .category-name-input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--blue-standard);
    border-radius: 4px;
    font-size: 14px;
    outline: none;
}

.categories-table .actions-col {
    width: 120px;
    text-align: center;
}

.categories-table .card-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 2px;
}

.add-category-btn {
    align-self: flex-start;
}

/* Add Cashflow Item Dialog Styles */
.type-selection,
.recurrence-selection {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
}

.type-option,
.recurrence-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

.type-option:hover,
.recurrence-option:hover {
    border-color: #428bca;
    background: #f0f7ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(66, 139, 202, 0.1);
}

.type-option.selected,
.recurrence-option.selected {
    border-color: #428bca;
    background: #e6f3ff;
    box-shadow: 0 0 0 3px rgba(66, 139, 202, 0.1);
}

.type-option svg,
.recurrence-option svg {
    margin-bottom: 10px;
    color: #428bca;
}

.type-option span,
.recurrence-option span {
    font-size: 14px;
}

.add-item-btn {
    padding: 8px 12px !important;
    min-width: auto !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
}

.add-item-btn svg {
    display: block;
}

.cashflow-filter-bar .filter-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Interval selector */
.interval-selector {
    display: flex;
    gap: 0;
    background: #f5f5f5;
    border-radius: 4px;
    padding: 2px;
}

.interval-btn {
    padding: 6px 16px;
    border: none;
    background: transparent;
    color: #666;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    border-radius: 3px;
    transition: all 0.2s;
}

.interval-btn:hover {
    background: #e0e0e0;
    color: #333;
}

.interval-btn.active {
    background: #428bca;
    color: white;
}

/* Button icon style */
.btn-icon {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: #f5f5f5;
    border-color: #bbb;
}

.btn-icon svg {
    display: block;
}

/* Cashflow table styles */
.cashflow-table-wrapper {
    flex: 1;
    min-height: 0;
    overflow: auto;
    display: flex;
    flex-direction: column;
}

.cashflow-table-scroll {
    flex: 1;
    position: relative;
}

/* Type header row */
.type-header-row {
    background: #e9ecef;
}

.type-header-row:hover {
    background: #e9ecef !important;
}

.type-header-row td {
    position: sticky;
    top: 35px;
    z-index: 50;
    background: #e9ecef;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-top: -5px;
}

.type-header {
    padding: 7px 10px;
    font-size: 16px;
    font-weight: 700;
    color: #2c3e50;
    text-align: left;
    background: #e9ecef;
    border-top: 2px solid #dee2e6;
    border-bottom: 2px solid #dee2e6;
}

.cashflow-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.cashflow-table thead {
    position: sticky;
    top: -1px;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.cashflow-table thead tr {
    background: var(--blue-standard);
}

.cashflow-table th {
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
    color: white;
    border-bottom: 2px solid var(--blue-dark);
    white-space: nowrap;
    background: var(--blue-standard);
    position: sticky;
    top: -1px;
}

.cashflow-table th.item-name-col {
    min-width: 200px;
    position: sticky;
    left: 0;
    top: -1px;
    background: var(--blue-standard);
    z-index: 101;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
}

.cashflow-table th.period-col {
    text-align: right;
    min-width: 95px;
}

.cashflow-table th.period-col.highlight-col {
    background: var(--blue-xlight);
    color: var(--blue-dark);
}

.cashflow-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.1s ease;
}

.cashflow-table tbody tr:hover {
    background: var(--blue-xlight) !important;
}

.cashflow-table tbody tr:hover td {
    background: var(--blue-xlight) !important;
}

.cashflow-table tbody td.highlight-col {
    background: var(--blue-xlight);
}

/* Category rows - bold and prominent */
.category-row {
    background: #fafbfc;
    cursor: pointer;
    user-select: none;
}

.category-row:hover {
    background: var(--blue-xlight) !important;
}

.category-row:hover .category-name {
    background: var(--blue-xlight) !important;
}

.category-row .category-name {
    padding: 8px 10px;
    font-weight: 600;
    color: #2c3e50;
    position: sticky;
    left: 0;
    background: #fafbfc;
    border-right: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10;
}

.category-row .collapse-icon {
    flex-shrink: 0;
    transition: transform 0.2s;
}

.category-row.collapsed .collapse-icon {
    transform: rotate(-90deg);
}

.category-row .category-amount {
    padding: 8px 10px;
    text-align: right;
    font-weight: 600;
    color: #2c3e50;
}

/* Item rows - indented and lighter */
.item-row {
    transition: opacity 0.2s;
}

.item-row.hidden {
    display: none;
}

.item-row .item-name {
    padding: 6px 10px 6px 35px;
    color: #495057;
    position: sticky;
    left: 0;
    background: white;
    border-right: 1px solid #f0f0f0;
    z-index: 9;
}

.item-row:hover .item-name {
    background: var(--blue-xlight) !important;
}

.item-row .item-amount {
    padding: 6px 10px;
    text-align: right;
    color: #6c757d;
}

/* Subtotal rows */
.subtotal-row {
    background: #f8f9fa;
    font-weight: 600;
    border-top: 2px solid #dee2e6;
}

.subtotal-row:hover {
    background: #f8f9fa !important;
}

.subtotal-label {
    padding: 8px 10px;
    color: #2c3e50;
    position: sticky;
    left: 0;
    background: #f8f9fa;
    border-right: 1px solid #dee2e6;
    z-index: 10;
}

.subtotal-amount {
    padding: 8px 10px;
    text-align: right;
    color: #2c3e50;
    font-weight: 600;
}

/* Total separator */
.total-separator-row {
    height: 20px;
    background: transparent;
    border: none;
}

.total-separator-row:hover {
    background: transparent !important;
}

.total-separator-row td {
    border-top: 3px solid #495057;
    padding: 0;
}

/* Total rows */
.total-row {
    font-weight: 700;
    font-size: 14px;
}

.total-row:hover {
    background: #f8f9fa;
}

.total-label {
    padding: 10px 10px;
    color: #2c3e50;
    position: sticky;
    left: 0;
    background: white;
    border-right: 1px solid #dee2e6;
    z-index: 10;
}

.total-row:hover .total-label {
    background: var(--blue-xlight) !important;
}

.total-amount {
    padding: 10px 10px;
    text-align: right;
    font-weight: 700;
}

/* Positive/Negative coloring */
.total-amount.positive {
    color: #28a745;
}

.total-amount.negative {
    color: #dc3545;
}

/* Cashflow and Cash Available rows - smaller text and reduced height */
.cashflow-row,
.cash-available-row {
    font-size: 14px;
    position: sticky;
    background: white;
    z-index: 60;
}

.cashflow-row {
    bottom: 28px;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
    border-top: 2px solid #dee2e6;
}

.cash-available-row {
    bottom: 0;
    border-top: 2px solid #dee2e6;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
}

.cashflow-row td,
.cash-available-row td {
    background: white !important;
}

.cashflow-row .total-label,
.cash-available-row .total-label {
    padding: 3px 10px;
    background: white !important;
    font-size: 14px;
}

.cashflow-row .total-amount,
.cash-available-row .total-amount {
    padding: 3px 10px;
    font-size: 13px;
    font-weight: 500;
    background: white !important;
}

/* Empty state for cashflow table */
.cashflow-content .empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 400px;
    color: #999;
}

/* Editable cells styling */
.editable-cell {
    cursor: pointer;
    position: relative;
    transition: background-color 0.15s ease;
}

.editable-cell:hover {
    background: var(--blue-xlight) !important;
}

.editable-cell:hover::after {
    content: '✎';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    color: var(--blue-standard);
    opacity: 0.9;
    font-weight: bold;
    z-index: 10;
}

/* Loading state */
.cashflow-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 400px;
    gap: 20px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--blue-standard);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.cashflow-loading p {
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

/* Small spinner for buttons */
.spinner-small {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

/* Edit Cashflow Item Dialog */
.edit-cf-item-container {
    max-width: 500px;
}

.amount-input-large {
    font-size: 32px !important;
    font-weight: 600 !important;
    text-align: center;
    padding: 20px !important;
    letter-spacing: 1px;
}

.btn-danger-outline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    background: white;
    border: 2px solid #ef4444;
    color: #ef4444;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-danger-outline:hover {
    background: #ef4444;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-danger-outline svg {
    width: 18px;
    height: 18px;
}

/* Import Time Entries Dialog */
.import-time-entries-container {
    max-width: 800px;
}

.import-textarea {
    width: 100%;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    padding: 12px;
    border: 2px solid var(--gray-standard);
    border-radius: var(--radius-sm);
    resize: vertical;
    min-height: 300px;
}

.import-textarea:focus {
    outline: none;
    border-color: var(--blue-standard);
    box-shadow: 0 0 0 3px rgba(77, 145, 198, 0.1);
}

.preview-section {
    margin-top: 24px;
    padding: 16px;
    background: var(--gray-xlight);
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-light);
}

.preview-section h4 {
    margin: 0 0 12px 0;
    color: var(--blue-darker);
    font-size: 16px;
}

.preview-content {
    background: white;
    padding: 16px;
    border-radius: var(--radius-sm);
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.preview-table thead {
    background: var(--gray-xlight);
}

.preview-table th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--blue-darker);
    border-bottom: 2px solid var(--gray-light);
}

.preview-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--gray-light);
}

.preview-table tbody tr:hover {
    background: var(--gray-xlight);
}

.preview-table tbody tr:last-child td {
    border-bottom: none;
}

.error-section {
    margin-top: 16px;
    padding: 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius-sm);
}

.error-message {
    color: #dc2626;
    font-size: 14px;
    line-height: 1.6;
}

.error-message div {
    margin-bottom: 8px;
}

.error-message div:last-child {
    margin-bottom: 0;
}

/* ========================================
   Chart View Styles
   ======================================== */

.chart-view-wrapper {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin: 20px;
    flex: 1;
    min-height: 0;
    overflow: auto;
    display: flex;
    flex-direction: column;
}

.chart-view-container {
    padding: 20px;
}

/* KPI Cards */
.kpi-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.kpi-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.kpi-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.kpi-label {
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.kpi-value {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.2;
}

.kpi-value.positive {
    color: #10b981;
}

.kpi-value.negative {
    color: #ef4444;
}

/* Chart Sections */
.chart-section {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.chart-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f3f4f6;
}

.chart-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
}

.chart-container canvas {
    max-height: 400px;
}

/* View Toggle Buttons */
.view-toggle {
    display: flex;
    gap: 8px;
    background: #f3f4f6;
    padding: 4px;
    border-radius: 8px;
}

.view-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-btn svg {
    width: 16px;
    height: 16px;
}

.view-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--blue-standard);
}

.view-btn.active {
    background: white;
    color: var(--blue-standard);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Time Range Selector */
.time-range-selector {
    display: flex;
    gap: 8px;
    background: #f3f4f6;
    padding: 4px;
    border-radius: 8px;
}

.time-range-btn {
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 50px;
}

.time-range-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--blue-standard);
}

.time-range-btn.active {
    background: white;
    color: var(--blue-standard);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Responsive adjustments for chart view */
@media (max-width: 1024px) {
    .kpi-cards {
        grid-template-columns: 1fr;
    }

    .chart-container {
        height: 300px;
    }

    .chart-container canvas {
        max-height: 300px;
    }
}

/* ========================================
   Select Cashflow Entry Dialog
   ======================================== */

.select-cf-entry-container {
    max-width: 600px;
}

.entry-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 24px 0;
    max-height: 400px;
    overflow-y: auto;
    padding: 4px;
}

.entry-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.entry-item:hover {
    background: #f3f4f6;
    border-color: var(--blue-standard);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.entry-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.entry-date {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
}

.entry-amount {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.entry-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: #f3f4f6;
    border-radius: 8px;
    margin-top: 8px;
    font-weight: 600;
}

.total-amount {
    font-size: 18px;
    color: var(--blue-standard);
}

.info-message {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    margin-top: 20px;
}

.info-message svg {
    flex-shrink: 0;
    color: var(--blue-standard);
    margin-top: 2px;
}

.info-message span {
    font-size: 14px;
    color: #1e40af;
    line-height: 1.5;
}

/* ===================================
   EXPORT DROPDOWN
   =================================== */

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

.export-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.export-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-elev);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-base);
    z-index: 1000;
    overflow: hidden;
}

.export-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.export-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: white;
    color: var(--blue-darker);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: left;
}

.export-option:hover {
    background: var(--blue-xlight);
    color: var(--blue-standard);
}

.export-option svg {
    flex-shrink: 0;
    color: var(--blue-standard);
}

.export-option:not(:last-child) {
    border-bottom: 1px solid var(--gray-light);
}

/* Customer Detail - Reports Tab */
.reports-tab {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(100% - 50px);
}

.reports-filters {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    background: white;
    padding: 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-darker);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-select {
    padding: 10px 12px;
    border: 1px solid var(--gray-light);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--blue-darker);
    background: white;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-select:hover {
    border-color: var(--blue-standard);
}

.filter-select:focus {
    outline: none;
    border-color: var(--blue-standard);
    box-shadow: 0 0 0 3px var(--blue-xlight);
}

.reports-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

.report-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    padding: 20px;
    transition: all var(--transition-base);
}

.report-card:hover {
    box-shadow: var(--shadow-elev);
}

.report-card h3 {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--blue-darker);
}

/* KPI Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.metric {
    background: linear-gradient(135deg, var(--blue-xlight) 0%, white 100%);
    padding: 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--blue-light);
    transition: all var(--transition-fast);
}

.metric:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
}

.metric-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-darker);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.metric-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--blue-standard);
    line-height: 1.2;
}

/* Chart containers in cards */
.chart-container {
    position: relative;
    height: 280px;
    width: 100%;
}

.chart-card-wide {
    grid-column: span 2;
}

@media (max-width: 900px) {
    .chart-card-wide {
        grid-column: span 1;
    }

    .reports-cards {
        grid-template-columns: 1fr;
    }

    .reports-filters {
        flex-direction: column;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }
}

/* Filter Dropdown Styles */
.filter-dropdown {
    position: relative;
}

.filter-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.filter-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.filter-dropdown-item {
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 14px;
    color: var(--gray-darker);
}

.filter-dropdown-item:hover {
    background: rgba(77, 145, 198, 0.1);
}

.filter-dropdown-item.active {
    background: linear-gradient(135deg, var(--blue-standard), var(--blue-bright));
    color: white;
    font-weight: 600;
}

.filter-dropdown-item:first-child {
    border-radius: 7px 7px 0 0;
}

.filter-dropdown-item:last-child {
    border-radius: 0 0 7px 7px;
}

/* Checkbox filter items */
.filter-dropdown-item.checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
}

.filter-dropdown-item.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
}

.filter-dropdown-item.checkbox-item span {
    flex: 1;
    user-select: none;
}

.filter-dropdown-item.checkbox-item:hover {
    background: rgba(77, 145, 198, 0.1);
}

/* Filter dropdown actions (select/deselect all) */
.filter-dropdown-actions {
    display: flex;
    gap: 8px;
    padding: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    background: #f8f9fa;
}

.filter-action-btn {
    flex: 1;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    color: var(--blue-standard);
    background: white;
    border: 1px solid rgba(77, 145, 198, 0.3);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-action-btn:hover {
    background: var(--blue-standard);
    color: white;
    border-color: var(--blue-standard);
}

/* Dropdown chevron icon */
.dropdown-chevron {
    margin-left: 4px;
    opacity: 0.6;
    transition: transform 0.2s ease;
}

.btn-icon-labeled.active .dropdown-chevron {
    stroke: white;
    opacity: 1;
}

/* Split Button Styles */
.split-button-wrapper {
    position: relative;
    display: inline-flex;
    border-radius: 6px;
    overflow: visible; /* Changed from hidden to allow dropdown to show */
}

.split-button-wrapper.active {
    background: linear-gradient(135deg, var(--blue-standard), var(--blue-bright));
}

.split-button-main {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-right: 1px solid rgba(0, 0, 0, 0.1);
}

.split-button-wrapper.active .split-button-main {
    background: transparent;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.split-button-dropdown {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    padding: 8px 6px !important;
    min-width: unset !important;
}

.split-button-wrapper.active .split-button-dropdown {
    background: transparent;
}

.split-button-dropdown .dropdown-chevron {
    margin: 0;
}

.split-button-wrapper .filter-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 220px;
    z-index: 1001; /* Ensure it's above other elements */
}

/* Expenses App Specific Styles */
.expenses-app {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
}

.expense-search-input {
    height: 32px;
    padding: 0 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    font-size: 13px;
    color: #374151;
    width: 240px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.expense-search-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.expense-search-input::placeholder {
    color: #9ca3af;
}

.expenses-summary-bar {
    background: #f8f9fa;
    padding: 20px 24px;
    position: sticky;
    bottom: 0;
    z-index: 10;
}

.summary-cards {
    display: flex;
    gap: 16px;
    align-items: stretch;
}

.summary-card {
    flex: 1;
    background: white;
    padding: 10px 16px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.2s ease;
}

.summary-card:hover {
    box-shadow: 0 4px 12px rgba(77, 145, 198, 0.15);
    transform: translateY(-2px);
}

.summary-card-label {
    font-size: 13px;
    color: var(--blue-standard);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-card-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--blue-standard);
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
}

.expenses-table-container {
    flex: 1;
    overflow: auto;
    background: white;
    margin-top: 16px; /* Add margin between toolbar and content */
}

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

.expenses-table thead {
    position: sticky;
    top: 0;
    background: white; /* Solid white background instead of transparent gray */
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); /* Add subtle shadow for depth */
}

.expenses-table thead::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(0, 0, 0, 0.1);
}

.expenses-table th {
    padding: 7px 12px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-darker);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: none; /* Remove border as we're using ::after on thead */
    background: white; /* Ensure solid background on each th */
    position: relative;
}

.expenses-table td {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 14px;
    color: var(--gray-darker);
}

.expenses-table tbody tr:hover {
    background: rgba(77, 145, 198, 0.05);
}

.amount-cell {
    text-align: right;
    font-weight: 600;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
}

.centered {
    text-align: center;
}

.expense-description {
    font-weight: 600;
    color: var(--gray-darker);
}

.expense-vendor {
    font-size: 12px;
    color: var(--gray-standard);
    margin-top: 2px;
}

.category-badge {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(77, 145, 198, 0.15);
    color: var(--blue-standard);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.billable-badge {
    display: inline-block;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, var(--blue-standard), var(--blue-bright));
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 20px;
    font-size: 12px;
}

.actions-cell {
    text-align: right;
    white-space: nowrap;
}

.btn-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
    color: var(--gray-standard);
}

.btn-icon:hover {
    background: rgba(77, 145, 198, 0.1);
    color: var(--blue-standard);
}

.btn-icon.btn-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--gray-standard);
}

.empty-icon {
    margin-bottom: 24px;
    opacity: 0.3;
}

/* Receipt Overlay Styles */
.receipt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.receipt-overlay.show {
    opacity: 1;
}

.receipt-overlay-content {
    background: white;
    border-radius: 12px;
    width: 90vw;
    max-width: 1200px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

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

.receipt-overlay-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    background: var(--gray-lighter);
}

.receipt-overlay-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--blue-standard);
}

.receipt-overlay-close {
    width: 40px;
    height: 40px;
    border: none;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: var(--gray-standard);
}

.receipt-overlay-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.receipt-overlay-close svg {
    stroke: currentColor;
}

.receipt-overlay-body {
    flex: 1;
    padding: 24px;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
}

.receipt-overlay-body img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}

.receipt-overlay-body embed {
    border: none;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.empty-icon svg {
    stroke: var(--blue-standard);
}

.empty-state h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--gray-darker);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    color: var(--gray-standard);
    margin-bottom: 24px;
}

/* Add Expense Dialog Styles */
.receipt-dropzone {
    border: 3px dashed rgba(77, 145, 198, 0.3);
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(77, 145, 198, 0.02);
}

.receipt-dropzone:hover {
    border-color: var(--blue-standard);
    background: rgba(77, 145, 198, 0.08);
}

.receipt-dropzone.dragover {
    border-color: var(--blue-bright);
    background: rgba(77, 145, 198, 0.15);
    transform: scale(1.02);
}

.dropzone-content {
    pointer-events: none;
}

.dropzone-icon {
    margin-bottom: 24px;
    opacity: 0.4;
}

.dropzone-icon svg {
    stroke: var(--blue-standard);
}

.receipt-dropzone h3 {
    font-size: 22px;
    font-weight: 600;
    color: var(--gray-darker);
    margin-bottom: 8px;
}

.receipt-dropzone p {
    font-size: 16px;
    color: var(--gray-standard);
    margin-bottom: 24px;
}

.dropzone-formats {
    font-size: 13px;
    color: var(--gray-standard);
    padding: 12px 24px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 6px;
    display: inline-block;
}

/* Processing State */
.processing-state {
    text-align: center;
    padding: 60px 40px;
}

.processing-state h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--gray-darker);
    margin: 24px 0 8px 0;
}

.processing-state p {
    font-size: 14px;
    color: var(--gray-standard);
}

/* Review Stage - Split View */
.dialog-container-wide {
    max-width: 1800px;
    width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.expense-review-content {
    display: flex;
    gap: 0;
    flex: 1;
    min-height: 0;
    padding: 0 !important;
    overflow: hidden;
}

.receipt-preview-panel {
    flex: 0 0 58%;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(0, 0, 0, 0.12);
    padding: 32px;
    background: #fafafa;
    overflow: hidden;
}

.receipt-preview-panel h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--blue-standard);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.receipt-preview {
    flex: 1;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.receipt-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.receipt-preview embed {
    width: 100%;
    height: 100%;
}

.expense-form-panel {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
    background: white;
}

.expense-form-panel .form-group {
    margin-bottom: 24px;
}

.expense-form-panel .form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
}

.expense-form-panel .form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.expense-form-panel label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--blue-standard);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.expense-form-panel .form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 6px;
    font-size: 14px;
    color: var(--gray-darker);
    transition: all 0.2s ease;
    background: white;
}

.expense-form-panel .form-input:focus {
    outline: none;
    border-color: var(--blue-standard);
    box-shadow: 0 0 0 3px rgba(77, 145, 198, 0.1);
}

.expense-form-panel textarea.form-input {
    resize: vertical;
    font-family: inherit;
}

.checkbox-group {
    display: flex;
    align-items: center;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
    text-transform: none;
    letter-spacing: normal;
    font-weight: 500;
}

.checkbox-group input[type="checkbox"] {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Multi-Receipt Upload Styles */
.receipt-dropzone.has-files {
    padding: 30px;
    border-style: solid;
    border-width: 2px;
    background: white;
}

.uploaded-files-preview {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.uploaded-files-preview h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--blue-standard);
    margin: 0;
}

.file-thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
    justify-content: center;
}

.file-thumbnail {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: rgba(77, 145, 198, 0.05);
    border: 1px solid rgba(77, 145, 198, 0.2);
    border-radius: 8px;
    min-width: 120px;
    transition: all 0.2s ease;
}

.file-thumbnail:hover {
    background: rgba(77, 145, 198, 0.1);
    border-color: var(--blue-standard);
}

.file-thumbnail svg {
    stroke: var(--blue-standard);
    opacity: 0.7;
}

.file-name {
    font-size: 12px;
    color: var(--gray-darker);
    text-align: center;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.remove-file {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--red-standard);
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.remove-file:hover {
    background: var(--red-dark);
    transform: scale(1.1);
}

.remove-file svg {
    stroke: white;
    opacity: 1;
}

/* Processing Progress */
.progress-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--blue-standard), var(--blue-bright));
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--blue-standard);
    margin-bottom: 32px;
}

.current-processing-receipt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin: 32px 0;
}

.receipt-preview-small {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(77, 145, 198, 0.05);
    border-radius: 8px;
}

.receipt-preview-small svg {
    stroke: var(--blue-standard);
    opacity: 0.5;
}

.receipt-filename {
    font-size: 13px;
    color: var(--gray-standard);
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.receipts-status-list {
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 24px;
}

.receipt-status-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.receipt-status-item.processed {
    background: rgba(92, 184, 92, 0.05);
    border-color: rgba(92, 184, 92, 0.3);
}

.receipt-status-item.processing {
    background: rgba(77, 145, 198, 0.05);
    border-color: var(--blue-standard);
}

.receipt-status-item.waiting {
    opacity: 0.6;
}

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

.status-icon.success {
    stroke: var(--green-standard);
}

.status-icon.processing {
    stroke: var(--blue-standard);
    animation: pulse 1.5s ease-in-out infinite;
}

.status-icon.waiting {
    stroke: var(--gray-standard);
}

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

.receipt-name {
    font-size: 13px;
    color: var(--gray-darker);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Carousel Footer */
.carousel-footer {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px 32px;
    background: white;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

.carousel-progress {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.progress-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
}

.progress-dot:hover {
    background: rgba(77, 145, 198, 0.5);
    transform: scale(1.2);
}

.progress-dot.active {
    background: var(--blue-standard);
    transform: scale(1.3);
}

.progress-dot.invalid {
    background: var(--red-standard);
    opacity: 0.5;
}

.carousel-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.carousel-navigation button {
    display: flex;
    align-items: center;
    gap: 8px;
}

.carousel-navigation button svg {
    flex-shrink: 0;
}

.btn-text-danger {
    background: none;
    border: none;
    color: var(--red-standard);
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-text-danger:hover {
    color: var(--red-dark);
    background: rgba(217, 83, 79, 0.05);
    border-radius: 4px;
}

.btn-text-danger svg {
    stroke: currentColor;
}

.btn-save-all {
    font-weight: 600;
}

/* ==================== Expense Report Wizard Styles ==================== */

.expense-report-wizard {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Wizard Progress Bar */
.wizard-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding: 0 40px;
    position: relative;
}

.wizard-progress::before {
    content: '';
    position: absolute;
    top: 22px;
    left: 100px;
    right: 100px;
    height: 3px;
    background: var(--gray-light);
    z-index: 0;
    border-radius: 3px;
}

.wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 1;
    flex: 1;
}

.step-number {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--gray-standard);
    color: var(--gray-darker);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.wizard-step.active .step-number {
    background: var(--blue-standard);
    border-color: var(--blue-standard);
    color: white;
    box-shadow: 0 0 0 4px rgba(77, 145, 198, 0.2), 0 4px 8px rgba(77, 145, 198, 0.3);
    transform: scale(1.1);
}

.wizard-step.completed .step-number {
    background: #27ae60;
    border-color: #27ae60;
    color: white;
    box-shadow: 0 2px 4px rgba(39, 174, 96, 0.3);
}

.wizard-step.completed .step-number::before {
    content: '✓';
    font-size: 20px;
    font-weight: 900;
}

.step-label {
    font-size: 13px;
    color: var(--gray-darker);
    font-weight: 600;
    text-align: center;
}

.wizard-step.active .step-label {
    color: var(--blue-darker);
    font-weight: 700;
}

/* Wizard Content Area */
.wizard-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.wizard-step-content {
    max-width: 700px;
    margin: 0 auto;
}

.wizard-step-content h2 {
    font-size: 22px;
    color: var(--blue-darker);
    margin-bottom: 8px;
    font-weight: 700;
}

.wizard-step-content > p {
    color: #5a6674;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
}

/* Timeframe Options */
.timeframe-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.timeframe-option {
    position: relative;
}

.timeframe-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.timeframe-option label {
    display: flex;
    flex-direction: column;
    padding: 18px 24px;
    border: 2px solid var(--gray-standard);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.timeframe-option label:hover {
    border-color: var(--blue-standard);
    background: rgba(77, 145, 198, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(77, 145, 198, 0.15);
}

.timeframe-option input[type="radio"]:checked + label {
    border-color: var(--blue-standard);
    background: rgba(77, 145, 198, 0.08);
    box-shadow: 0 0 0 4px rgba(77, 145, 198, 0.15), 0 4px 8px rgba(77, 145, 198, 0.2);
}

.timeframe-label {
    font-size: 17px;
    font-weight: 700;
    color: var(--blue-darker);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.timeframe-badge {
    display: inline-block;
    padding: 4px 10px;
    background: #27ae60;
    color: white;
    border-radius: 14px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    flex-shrink: 0;
}

.timeframe-dates {
    font-size: 14px;
    color: #5a6674;
    font-weight: 600;
}

/* Selection Lists */
.selection-header {
    padding: 14px 18px;
    background: var(--blue-xlight);
    border: 2px solid var(--blue-light);
    border-radius: 8px;
    margin-bottom: 12px;
}

.selection-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
    padding: 4px;
}

.selection-item {
    padding: 14px 18px;
    border: 2px solid var(--gray-standard);
    border-radius: 8px;
    background: white;
    transition: all 0.2s ease;
}

.selection-item:hover {
    background: rgba(77, 145, 198, 0.05);
    border-color: var(--blue-standard);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--blue-standard);
}

.checkbox-label span {
    font-size: 15px;
    color: var(--blue-darker);
    font-weight: 600;
}

/* Options List */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
}

.option-item {
    padding: 18px 20px;
    border: 2px solid var(--gray-standard);
    border-radius: 10px;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.option-description {
    margin: 8px 0 0 32px;
    font-size: 14px;
    color: #5a6674;
    font-weight: 500;
}

/* Report Summary */
.report-summary {
    padding: 24px;
    background: var(--blue-xlight);
    border: 2px solid var(--blue-light);
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(77, 145, 198, 0.1);
}

.report-summary h3 {
    font-size: 18px;
    color: var(--blue-darker);
    margin-bottom: 16px;
    font-weight: 700;
}

.report-summary ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.report-summary li {
    font-size: 15px;
    color: #5a6674;
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 2px solid rgba(77, 145, 198, 0.15);
    font-weight: 500;
}

.report-summary li:last-child {
    border-bottom: none;
}

.report-summary strong {
    color: var(--blue-darker);
    font-weight: 700;
}

/* Wizard Actions */
.dialog-footer.wizard-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wizard-actions button {
    min-width: 140px;
    font-size: 15px;
    padding: 12px 24px;
    font-weight: 700;
}

.btn-success {
    background: #27ae60;
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 8px rgba(39, 174, 96, 0.25);
}

.btn-success:hover:not(:disabled) {
    background: #229954;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(39, 174, 96, 0.35);
}

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


/* Currency Autocomplete Dropdown */
.currency-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 250px;
    overflow-y: auto;
    background: white;
    border: 1px solid var(--gray-standard);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-elev);
    z-index: 1000;
    margin-top: 4px;
}

.currency-option {
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background var(--transition-fast);
}

.currency-option:hover {
    background: var(--blue-xlight);
}

.currency-code {
    font-weight: 600;
    color: var(--blue-dark);
    min-width: 45px;
    font-size: 14px;
}

.currency-name {
    color: var(--gray-darker);
    font-size: 13px;
}

/* Exchange Rate Info */
.exchange-rate-info {
    background: var(--blue-xlight);
    border: 1px solid var(--blue-light);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-top: 12px;
    margin-bottom: 16px;
}

.exchange-rate-info .info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}

.exchange-rate-info .info-row + .info-row {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--blue-light);
}

.exchange-rate-info .info-label {
    font-size: 13px;
    color: var(--gray-darker);
    font-weight: 500;
}

.exchange-rate-info .info-value {
    font-size: 14px;
    color: var(--blue-dark);
    font-weight: 600;
}

/* Quarterly Report Styles */
.quarterly-report-content {
    padding: 20px 0;
}

.quarterly-report-content .info-box {
    background: var(--blue-xlight);
    border: 1px solid var(--blue-light);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    margin-bottom: 24px;
}

.quarterly-report-content .info-box p {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: var(--blue-dark);
}

.quarterly-report-content .info-box ul {
    margin: 8px 0 0 0;
    padding-left: 20px;
    list-style-type: disc;
}

.quarterly-report-content .info-box li {
    margin: 6px 0;
    font-size: 13px;
    color: var(--gray-darker);
}

.quarterly-report-content .quarter-info {
    background: white;
    border: 1px solid var(--gray-standard);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-top: 16px;
}

.quarterly-report-content .quarter-info p {
    margin: 0;
    font-size: 14px;
    color: var(--blue-dark);
}

.quarterly-report-content .quarter-info strong {
    color: var(--blue-dark);
}

.quarterly-report-content .quarter-info span {
    color: var(--gray-darker);
    font-weight: 500;
}

/* Loading spinner for buttons */
.loading-spinner-small {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

.btn-spinner {
    display: none;
    align-items: center;
    justify-content: center;
}

/* =============================================================
   CRM App
   ============================================================= */

.crm-app {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.crm-tab-bar {
    display: flex;
    gap: 4px;
    padding: 6px 10px 0;
    border-bottom: 1px solid var(--gray-light);
    background: var(--blue-xlight);
    flex-shrink: 0;
}

.crm-tab {
    padding: 6px 20px;
    border: none;
    background: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-darker);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    transition: color var(--transition-fast), border-color var(--transition-fast);
}

.crm-tab.active {
    color: var(--blue-dark);
    border-bottom-color: var(--blue-standard);
}

.crm-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* --- Leads layout --- */

.crm-leads {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.crm-leads.has-detail {
    flex-direction: row;
}

.crm-list-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.crm-detail-panel {
    width: 340px;
    flex-shrink: 0;
    border-left: 1px solid var(--gray-light);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* --- Toolbar --- */

.crm-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--gray-light);
    background: white;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.crm-toolbar-right {
    margin-left: auto;
    display: flex;
    gap: 6px;
    align-items: center;
}

.crm-search {
    height: 30px;
    padding: 0 10px;
    border: 1px solid var(--gray-light);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--blue-dark);
    width: 240px;
    transition: border-color var(--transition-fast);
}

.crm-search:focus {
    outline: none;
    border-color: var(--blue-standard);
}

.crm-filter-select {
    height: 30px;
    padding: 0 8px;
    border: 1px solid var(--gray-light);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--blue-dark);
    background: white;
    cursor: pointer;
}

.crm-total {
    font-size: 12px;
    color: var(--gray-darker);
}

/* --- Table --- */

.crm-table-wrap {
    flex: 1;
    overflow: auto;
}

.crm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.crm-table th {
    padding: 6px 10px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    color: var(--gray-darker);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--gray-light);
    position: sticky;
    top: 0;
    background: white;
    white-space: nowrap;
}

.crm-table td {
    padding: 6px 10px;
    border-bottom: 1px solid var(--gray-light);
    color: var(--blue-dark);
    vertical-align: middle;
}

.crm-contact-row {
    cursor: pointer;
    transition: background var(--transition-fast);
}

.crm-contact-row:hover {
    background: var(--blue-xlight);
}

.crm-contact-row.selected {
    background: var(--blue-light);
}

.crm-campaign-row {
    cursor: pointer;
    transition: background var(--transition-fast);
}

.crm-campaign-row:hover {
    background: var(--blue-xlight);
}

.crm-name-cell {
    display: flex;
    align-items: center;
    gap: 6px;
}

.crm-contact-name {
    font-weight: 600;
}

.crm-campaign-name {
    font-weight: 600;
}

.crm-li-link {
    font-size: 11px;
    color: var(--blue-standard);
    text-decoration: none;
}

.crm-li-link:hover { text-decoration: underline; }

/* --- Stage badges --- */

.crm-stage-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.crm-stage-new        { background: #f1f5f9; color: #64748b; }
.crm-stage-contacted  { background: #dbeafe; color: #1d4ed8; }
.crm-stage-in_discussion { background: #fef3c7; color: #b45309; }
.crm-stage-proposal   { background: #ede9fe; color: #6d28d9; }
.crm-stage-won        { background: #d1fae5; color: #059669; }
.crm-stage-lost       { background: #fee2e2; color: #dc2626; }
.crm-stage-archived   { background: #f1f5f9; color: #94a3b8; }

/* --- Follow-up badge --- */

.crm-followup {
    font-size: 10px;
    background: #e0f2fe;
    color: #0369a1;
    padding: 1px 5px;
    border-radius: 6px;
    white-space: nowrap;
}

.crm-followup.overdue {
    background: #fee2e2;
    color: #dc2626;
}

/* --- Campaign status badges --- */

.crm-campaign-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.crm-cstatus-draft  { background: #f1f5f9; color: #64748b; }
.crm-cstatus-active { background: #d1fae5; color: #059669; }
.crm-cstatus-closed { background: #f1f5f9; color: #94a3b8; }

/* --- Pagination --- */

.crm-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 8px;
    border-top: 1px solid var(--gray-light);
    font-size: 13px;
    color: var(--gray-darker);
    flex-shrink: 0;
}

.crm-page-btn {
    padding: 4px 12px;
    border: 1px solid var(--gray-light);
    border-radius: var(--radius-sm);
    background: white;
    cursor: pointer;
    font-size: 12px;
    color: var(--blue-dark);
    transition: background var(--transition-fast);
}

.crm-page-btn:hover:not(:disabled) { background: var(--blue-xlight); }
.crm-page-btn:disabled { opacity: 0.4; cursor: default; }

/* --- Empty states --- */

.crm-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--gray-darker);
    font-size: 14px;
}

.crm-empty-sm {
    padding: 12px;
    text-align: center;
    color: var(--gray-darker);
    font-size: 12px;
}

/* --- Detail panel --- */

.crm-detail-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--gray-light);
    background: var(--blue-xlight);
    flex-shrink: 0;
}

.crm-detail-name {
    font-weight: 700;
    font-size: 14px;
    color: var(--blue-dark);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.crm-detail-close {
    margin-left: auto;
    font-size: 18px;
    line-height: 1;
    padding: 2px 6px;
    flex-shrink: 0;
}

.crm-close-detail {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--gray-darker);
    padding: 0 4px;
    line-height: 1;
}

.crm-detail-content {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.crm-detail-fields {
    padding: 8px 10px;
    border-bottom: 1px solid var(--gray-light);
}

.crm-detail-row {
    display: flex;
    gap: 6px;
    align-items: flex-start;
    padding: 3px 0;
    font-size: 13px;
}

.crm-detail-row label {
    font-size: 11px;
    font-weight: 700;
    color: var(--gray-darker);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    width: 72px;
    flex-shrink: 0;
    padding-top: 2px;
}

.crm-detail-row span, .crm-detail-row a {
    color: var(--blue-dark);
    word-break: break-word;
}

.crm-detail-row a { color: var(--blue-standard); text-decoration: none; }
.crm-detail-row a:hover { text-decoration: underline; }

.crm-inline-select, .crm-inline-input {
    height: 26px;
    padding: 0 6px;
    border: 1px solid var(--gray-light);
    border-radius: 4px;
    font-size: 12px;
    color: var(--blue-dark);
    background: white;
    flex: 1;
}

.crm-inline-textarea {
    width: 100%;
    padding: 4px 6px;
    border: 1px solid var(--gray-light);
    border-radius: 4px;
    font-size: 12px;
    color: var(--blue-dark);
    resize: vertical;
    font-family: inherit;
}

.crm-detail-notes {
    flex-direction: column;
    align-items: stretch;
}

.crm-detail-notes label { width: auto; }

.crm-detail-actions {
    display: flex;
    gap: 6px;
    padding-top: 8px;
}

.btn-danger {
    background: #fee2e2 !important;
    color: #dc2626 !important;
}

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

/* --- Add to Campaign --- */

.crm-add-to-campaign {
    padding: 6px 0 0;
}

.crm-campaign-picker {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.crm-campaign-picker .crm-inline-select {
    flex: 1;
    min-width: 0;
}

/* --- Interactions --- */

.crm-interactions {
    display: flex;
    flex-direction: column;
    padding: 8px 10px;
}

.crm-interactions-header {
    font-size: 11px;
    font-weight: 700;
    color: var(--gray-darker);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 6px;
}

.crm-add-interaction {
    display: flex;
    gap: 4px;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.crm-int-note {
    flex: 1;
    min-width: 80px;
}

.crm-interaction-list {
    overflow-y: auto;
    max-height: 200px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.crm-interaction-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    background: var(--blue-xlight);
    border-radius: 4px;
    font-size: 12px;
}

.crm-int-type {
    font-weight: 700;
    font-size: 10px;
    text-transform: uppercase;
    padding: 1px 5px;
    border-radius: 4px;
    flex-shrink: 0;
}

.crm-int-message  { background: #dbeafe; color: #1d4ed8; }
.crm-int-call     { background: #d1fae5; color: #059669; }
.crm-int-email    { background: #fef3c7; color: #b45309; }
.crm-int-meeting  { background: #ede9fe; color: #6d28d9; }
.crm-int-note     { background: #f1f5f9; color: #64748b; }

.crm-int-date {
    color: var(--gray-darker);
    flex-shrink: 0;
    font-size: 11px;
}

.crm-int-note-text {
    flex: 1;
    color: var(--blue-dark);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.crm-int-delete {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-darker);
    font-size: 14px;
    padding: 0 2px;
    flex-shrink: 0;
    opacity: 0.5;
}

.crm-int-delete:hover { opacity: 1; color: #dc2626; }

/* --- Campaign detail --- */

.crm-campaign-detail {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.crm-campaign-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.crm-campaign-info {
    padding: 8px 12px;
    border-bottom: 1px solid var(--gray-light);
    flex-shrink: 0;
}

.crm-campaign-template {
    padding: 4px 0;
}

.crm-campaign-template label {
    font-size: 11px;
    font-weight: 700;
    color: var(--gray-darker);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    display: block;
    margin-bottom: 4px;
}

.crm-campaign-template pre {
    background: var(--blue-xlight);
    padding: 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
    max-height: 80px;
    overflow-y: auto;
    color: var(--blue-dark);
    font-family: inherit;
}

.crm-campaign-stats {
    display: flex;
    gap: 12px;
    padding: 6px 0 2px;
    flex-wrap: wrap;
}

.crm-stat {
    font-size: 12px;
    color: var(--gray-darker);
}

.crm-stat strong {
    color: var(--blue-dark);
    font-weight: 700;
}

.crm-campaign-contacts {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* --- Dialogs --- */

.crm-dialog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20000;
}

.crm-dialog {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-intense);
    width: 420px;
    max-width: 92vw;
    display: flex;
    flex-direction: column;
}

.crm-dialog-header {
    padding: 14px 18px;
    font-weight: 700;
    font-size: 15px;
    color: var(--blue-dark);
    border-bottom: 1px solid var(--gray-light);
}

.crm-dialog-body {
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 60vh;
    overflow-y: auto;
}

.crm-dialog-body label {
    font-size: 11px;
    font-weight: 700;
    color: var(--gray-darker);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-top: 4px;
}

.crm-dialog-input {
    padding: 6px 10px;
    border: 1px solid var(--gray-light);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--blue-dark);
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
}

.crm-dialog-footer {
    padding: 10px 18px;
    border-top: 1px solid var(--gray-light);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ── Auth / Login ────────────────────────────────────────────────────────── */

#auth-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

.auth-card {
    background: #fff;
    border-radius: 12px;
    padding: 36px 40px;
    width: 360px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.4);
}

.auth-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.auth-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.auth-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--blue-dark);
    margin: 0;
}

.auth-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
    margin-bottom: 16px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.auth-field label {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-medium);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.auth-field input {
    padding: 8px 12px;
    border: 1px solid var(--gray-light);
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s;
}

.auth-field input:focus {
    border-color: var(--blue-standard);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.auth-btn {
    margin-top: 4px;
    padding: 10px;
    background: var(--blue-standard);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.auth-btn:hover:not(:disabled) {
    background: var(--blue-dark);
}

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

/* ── Campaign Cards ──────────────────────────────────────────────────────── */

.crm-campaigns-list {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.crm-campaign-cards {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.campaign-card {
    background: #fff;
    border: 1px solid var(--gray-light);
    border-radius: 8px;
    padding: 12px 14px;
    cursor: pointer;
    transition: box-shadow 0.15s, border-color 0.15s;
}

.campaign-card:hover {
    border-color: var(--blue-standard);
    box-shadow: 0 2px 8px rgba(59,130,246,0.12);
}

.campaign-card-header {
    margin-bottom: 4px;
}

.campaign-card-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--blue-dark);
}

.campaign-card-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--gray-medium);
    margin-bottom: 10px;
}

.campaign-card-type {
    background: var(--blue-xlight);
    color: var(--blue-dark);
    padding: 1px 7px;
    border-radius: 10px;
    font-weight: 500;
}

.campaign-progress-bar {
    height: 5px;
    background: var(--gray-light);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}

.campaign-progress-fill {
    height: 100%;
    background: var(--blue-standard);
    border-radius: 3px;
    transition: width 0.3s;
}

.campaign-progress-stats {
    display: flex;
    gap: 14px;
    font-size: 11px;
    color: var(--gray-medium);
}

/* ── Campaign Status Toggle ──────────────────────────────────────────────── */

.crm-campaign-toggle {
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    padding: 8px 12px;
    border-top: 1px solid var(--gray-light);
    gap: 0;
}

.crm-toggle-btn {
    padding: 6px 24px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid var(--gray-light);
    background: #fff;
    color: var(--gray-medium);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.crm-toggle-btn:first-child {
    border-radius: 6px 0 0 6px;
    border-right: none;
}

.crm-toggle-btn:last-child {
    border-radius: 0 6px 6px 0;
}

.crm-toggle-btn.active {
    background: var(--blue-dark);
    color: #fff;
    border-color: var(--blue-dark);
}

.crm-toggle-btn:not(.active):hover {
    background: var(--blue-xlight);
    color: var(--blue-dark);
}

/* ── Campaign Detail Tabs ────────────────────────────────────────────────── */

.crm-campaign-detail {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.camp-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--gray-light);
    flex-shrink: 0;
    padding: 0 12px;
}

.camp-tab {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    border: none;
    background: none;
    color: var(--gray-medium);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.15s, border-color 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.camp-tab.active {
    color: var(--blue-dark);
    border-bottom-color: var(--blue-standard);
}

.camp-tab:not(.active):hover {
    color: var(--blue-dark);
}

.camp-tab-count {
    font-size: 11px;
    background: var(--gray-light);
    color: var(--gray-medium);
    border-radius: 10px;
    padding: 1px 6px;
    font-weight: 600;
}

.camp-tab.active .camp-tab-count {
    background: var(--blue-xlight);
    color: var(--blue-dark);
}

.camp-tab-body {
    flex: 1;
    overflow: hidden;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* ── Description Tab ─────────────────────────────────────────────────────── */

.camp-desc-tab {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    padding: 10px 12px 0;
    gap: 8px;
}

/* Name row + inline type/status/batch */
.camp-meta-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

.camp-field-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.camp-field-row label {
    width: 44px;
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-medium);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.camp-inline-fields {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.camp-input {
    padding: 5px 8px;
    border: 1px solid var(--gray-light);
    border-radius: 5px;
    font-size: 13px;
    outline: none;
    background: #fff;
}

.camp-input-name { flex: 1; }

.camp-input:focus {
    border-color: var(--blue-standard);
    box-shadow: 0 0 0 2px rgba(59,130,246,0.12);
}

.camp-input-batch {
    width: 56px;
}

.camp-hint {
    font-size: 11px;
    color: var(--gray-medium);
    white-space: nowrap;
}

/* Agent Description — fills remaining space */

.camp-agent-desc {
    flex: 1;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--gray-light);
    border-radius: 8px;
    overflow: hidden;
    min-height: 0;
}

/* ── Markdown Toolbar ────────────────────────────────────────────────────── */

.camp-md-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 8px;
    background: #f8fafc;
    border-bottom: 1px solid var(--gray-light);
    flex-shrink: 0;
    gap: 8px;
}

.camp-fmt-btns {
    display: flex;
    align-items: center;
    gap: 2px;
}

.camp-fmt-btn {
    padding: 3px 7px;
    font-size: 12px;
    border: none;
    background: none;
    border-radius: 4px;
    cursor: pointer;
    color: var(--blue-dark);
    transition: background 0.12s;
    line-height: 1.4;
}

.camp-fmt-btn:hover {
    background: var(--blue-xlight);
}

.camp-fmt-i    { font-style: italic; }
.camp-fmt-s    { text-decoration: line-through; }
.camp-fmt-bold { font-weight: 700; }
.camp-fmt-mono { font-family: monospace; font-size: 11px; }

.camp-fmt-sep {
    width: 1px;
    height: 16px;
    background: var(--gray-light);
    margin: 0 4px;
}

/* View toggle — Markdown / Preview pill */

.camp-view-toggle {
    display: flex;
    border: 1px solid var(--gray-light);
    border-radius: 5px;
    overflow: hidden;
}

.camp-view-btn {
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 500;
    border: none;
    background: #fff;
    color: var(--gray-medium);
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
}

.camp-view-btn.active {
    background: var(--blue-dark);
    color: #fff;
}

.camp-view-btn:not(.active):hover {
    background: var(--blue-xlight);
    color: var(--blue-dark);
}

.camp-agent-textarea {
    flex: 1;
    padding: 12px;
    font-size: 13px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    line-height: 1.6;
    border: none;
    outline: none;
    resize: none;
    box-sizing: border-box;
    color: var(--blue-dark);
    overflow-y: auto;
}

.camp-md-preview,
.camp-wysiwyg {
    flex: 1;
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.7;
    color: var(--blue-dark);
    overflow-y: auto;
}

.camp-wysiwyg {
    outline: none;
    cursor: text;
}

.camp-wysiwyg:empty::before {
    content: 'Start typing your agent instructions here…';
    color: var(--gray-medium);
    pointer-events: none;
}

/* Tables inside WYSIWYG */
.camp-wysiwyg table,
.camp-md-preview table {
    border-collapse: collapse;
    margin: 8px 0;
    width: 100%;
}

.camp-wysiwyg th,
.camp-wysiwyg td,
.camp-md-preview th,
.camp-md-preview td {
    border: 1px solid var(--gray-light);
    padding: 4px 8px;
    font-size: 12px;
}

.camp-md-preview h1, .camp-md-preview h2, .camp-md-preview h3 {
    margin: 0.8em 0 0.4em;
    font-weight: 600;
    color: var(--blue-dark);
}

.camp-md-preview h1 { font-size: 16px; }
.camp-md-preview h2 { font-size: 14px; }
.camp-md-preview h3 { font-size: 13px; }

.camp-md-preview p  { margin: 0 0 0.6em; }
.camp-md-preview ul,
.camp-md-preview ol { margin: 0 0 0.6em 1.2em; }
.camp-md-preview li { margin-bottom: 2px; }

.camp-md-preview code {
    background: var(--gray-light);
    padding: 1px 5px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 12px;
}

.camp-md-preview blockquote {
    border-left: 3px solid var(--blue-standard);
    margin: 0.6em 0;
    padding: 4px 10px;
    color: var(--gray-medium);
    font-style: italic;
}

.camp-empty-hint {
    color: var(--gray-medium);
    font-style: italic;
    font-size: 12px;
}

.camp-actions {
    display: flex;
    justify-content: flex-end;
    padding: 8px 0 10px;
    flex-shrink: 0;
    border-top: 1px solid var(--gray-light);
    margin-top: 2px;
}

/* ── Leads Tab ───────────────────────────────────────────────────────────── */

.camp-leads-tab {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.camp-leads-tab .crm-table-wrap {
    flex: 1;
    overflow-y: auto;
}

.camp-agent-note {
    font-size: 11px;
    color: var(--gray-medium);
    font-style: italic;
}

.crm-cc-remove {
    padding: 2px 6px !important;
    font-size: 11px !important;
    line-height: 1 !important;
    opacity: 0.6;
}

.crm-cc-remove:hover {
    opacity: 1;
}

.camp-visited {
    font-size: 11px;
    color: var(--gray-medium);
    white-space: nowrap;
}

/* ── Bulk Import Panel ───────────────────────────────────────────────────── */

.camp-bulk-panel {
    background: var(--bg-secondary, #f8f9fa);
    border: 1px solid var(--gray-light);
    border-radius: 8px;
    margin: 0 0 10px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.camp-bulk-filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 12px;
}

.camp-bulk-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.camp-bulk-row label {
    min-width: 110px;
    color: var(--gray-darker);
    font-size: 11px;
}

.camp-bulk-row .crm-inline-input,
.camp-bulk-row .crm-inline-select {
    flex: 1;
    min-width: 0;
    font-size: 12px;
}

.camp-bulk-row input[type="checkbox"] {
    margin: 0;
}

.camp-bulk-preview {
    font-size: 12px;
    color: var(--gray-darker);
    padding: 4px 0;
    border-top: 1px solid var(--gray-light);
}

.camp-bulk-count {
    font-weight: 700;
    color: var(--accent-color, #2563eb);
}

.camp-bulk-sample {
    color: var(--gray-medium);
    font-style: italic;
}

.camp-bulk-actions {
    display: flex;
    gap: 6px;
}

/* ── Sessions Tab ────────────────────────────────────────────────────────── */

.camp-sessions-list {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    height: 100%;
}

.camp-session {
    border: 1px solid var(--gray-light);
    border-radius: 8px;
    padding: 10px 12px;
}

.camp-session-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.camp-session-date {
    font-size: 13px;
    font-weight: 600;
    color: var(--blue-dark);
}

.camp-session-status {
    font-size: 11px;
    color: var(--gray-medium);
}

.camp-session-stats {
    display: flex;
    gap: 14px;
    font-size: 12px;
    color: var(--gray-medium);
    margin-bottom: 4px;
}

.camp-session-summary {
    font-size: 12px;
    color: var(--blue-dark);
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--gray-light);
    line-height: 1.5;
}

/* ── Settings Tab ────────────────────────────────────────────────────────── */

.camp-settings-tab {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 20px 24px;
    overflow-y: auto;
    height: 100%;
}

.camp-settings-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.camp-settings-status-section {
    border-top: 1px solid var(--gray-light);
    padding-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.camp-settings-status-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-darker);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.camp-status-toggle {
    display: flex;
    gap: 0;
    border: 1px solid var(--gray-light);
    border-radius: 8px;
    overflow: hidden;
    align-self: flex-start;
}

.camp-status-btn {
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 500;
    border: none;
    background: white;
    color: var(--gray-darker);
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
    border-right: 1px solid var(--gray-light);
}

.camp-status-btn:last-child {
    border-right: none;
}

.camp-status-btn:hover:not(.active) {
    background: var(--gray-light);
}

.camp-status-btn.active {
    background: var(--blue-standard);
    color: white;
    font-weight: 600;
}

.camp-settings-token-section {
    border-top: 1px solid var(--gray-light);
    padding-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.camp-token-warning {
    font-size: 12px;
    color: #c0392b;
    margin: 0;
}
