/* =========================================================================
   KOart Operational Platform — Core UI & Responsive Mobile Architecture
   ========================================================================= */
    :root {
      --red: #db0031;
      --red-bright: #ff1e4b;
      --red-dark: #b00027;
      --red-glow: rgba(219, 0, 49, 0.32);
      --red-glow-subtle: rgba(219, 0, 49, 0.1);
      --red-border: rgba(219, 0, 49, 0.35);

      --whatsapp-green: #25d366;
      --whatsapp-dark: #128c7e;

      --gold: #f59e0b;
      --blue: #3b82f6;
      --emerald: #10b981;
      --coral: #f43f5e;
      --purple: #8b5cf6;

      --font-display: 'Bricolage Grotesque', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
      --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
      --font-mono: 'Space Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;

      --radius-xs: 4px;
      --radius-sm: 8px;
      --radius-md: 12px;
      --radius-lg: 16px;
      --radius-full: 9999px;
    }

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

    body.theme-dark {
      --bg-page: #0b0f19;
      --bg-nav: rgba(15, 23, 42, 0.92);
      --bg-surface: #111827;
      --bg-card: #162032;
      --bg-card-hover: #1c283f;
      --text-main: #f8fafc;
      --text-muted: #94a3b8;
      --text-dim: #64748b;
      --border-color: rgba(255, 255, 255, 0.09);
      --border-subtle: rgba(255, 255, 255, 0.05);
      --table-header-bg: #0d1424;
      --table-row-even: rgba(255, 255, 255, 0.018);
      --code-bg: #090e17;
      --card-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
      --card-inner-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
      --input-bg: #162032;
      --input-border: rgba(255, 255, 255, 0.12);
      --input-border-focus: #db0031;
      --btn-secondary-bg: rgba(255, 255, 255, 0.06);
      --btn-secondary-border: rgba(255, 255, 255, 0.12);
      --btn-secondary-color: #e2e8f0;
      --btn-secondary-hover: rgba(255, 255, 255, 0.1);
    }

    body.theme-light {
      --bg-page: #f8fafc;
      --bg-nav: rgba(255, 255, 255, 0.94);
      --bg-surface: #ffffff;
      --bg-card: #f1f5f9;
      --bg-card-hover: #e2e8f0;
      --text-main: #0f172a;
      --text-muted: #475569;
      --text-dim: #64748b;
      --border-color: #e2e8f0;
      --border-subtle: #f1f5f9;
      --table-header-bg: #f8fafc;
      --table-row-even: rgba(15, 23, 42, 0.015);
      --code-bg: #f1f5f9;
      --card-shadow: 0 4px 16px -1px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.05);
      --card-inner-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
      --input-bg: #ffffff;
      --input-border: #cbd5e1;
      --input-border-focus: #db0031;
      --btn-secondary-bg: #ffffff;
      --btn-secondary-border: #cbd5e1;
      --btn-secondary-color: #334155;
      --btn-secondary-hover: #f8fafc;
    }

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

    body {
      font-family: var(--font-sans);
      background-color: var(--bg-page);
      color: var(--text-main);
      line-height: 1.5;
      min-height: 100vh;
      display: flex;
      flex-direction: column;
      transition: background-color 0.25s ease, color 0.25s ease;
    }

    /* TOP NAVIGATION */
    header.platform-header {
      position: sticky;
      top: 0;
      z-index: 90;
      background: var(--bg-nav);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
      border-bottom: 1px solid var(--border-color);
      height: 68px;
      width: 100%;
    }

    .nav-container {
      max-width: 1440px;
      width: 100%;
      margin: 0 auto;
      height: 100%;
      padding: 0 1.5rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.75rem;
    }

    .brand-group {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      text-decoration: none;
      color: var(--text-main);
    }

    .brand-logo-img {
      height: 34px;
      width: 34px;
      object-fit: contain;
    }

    .brand-title {
      font-family: var(--font-display);
      font-size: 1.4rem;
      font-weight: 800;
      letter-spacing: -0.04em;
      line-height: 1;
    }

    .brand-title span {
      color: var(--red);
    }

    /* Company Switcher Pill */
    .company-switcher-wrap {
      position: relative;
      display: inline-block;
    }

    .btn-company-switcher {
      background: var(--bg-surface);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-full);
      padding: 6px 12px;
      font-family: var(--font-sans);
      font-size: 12px;
      font-weight: 700;
      color: var(--text-main);
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 7px;
      white-space: nowrap;
      flex-shrink: 0;
      transition: all 0.2s ease;
      box-shadow: var(--card-inner-shadow);
    }

    .btn-company-switcher:hover {
      border-color: var(--red-border);
    }

    .company-badge-tier {
      font-family: var(--font-mono);
      font-size: 8.5px;
      font-weight: 800;
      text-transform: uppercase;
      background: var(--red-glow-subtle);
      color: var(--red);
      padding: 1px 6px;
      border-radius: var(--radius-full);
      border: 1px solid var(--red-border);
      letter-spacing: 0.04em;
    }

    .company-dropdown-menu {
      position: absolute;
      top: 115%;
      left: 0;
      width: 290px;
      background: var(--bg-surface);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-md);
      box-shadow: var(--card-shadow);
      padding: 6px;
      display: none;
      z-index: 100;
    }

    .company-dropdown-menu.active {
      display: block;
    }

    .company-item {
      padding: 8px 10px;
      border-radius: var(--radius-sm);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-size: 12px;
      transition: background 0.15s ease;
    }

    .company-item:hover {
      background: var(--bg-card-hover);
    }

    .company-item.active {
      background: var(--red-glow-subtle);
      border-left: 3px solid var(--red);
      font-weight: 700;
    }

    /* Top Nav Tabs */
    .nav-tabs-pill {
      display: flex;
      align-items: center;
      background: var(--bg-card);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-full);
      padding: 3px;
      gap: 3px;
    }

    .nav-tab-btn {
      background: transparent;
      border: none;
      color: var(--text-muted);
      font-family: var(--font-sans);
      font-size: 12px;
      font-weight: 700;
      padding: 6px 12px;
      border-radius: var(--radius-full);
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      white-space: nowrap;
      flex-shrink: 0;
      transition: all 0.18s ease;
    }

    .nav-tab-btn:hover {
      color: var(--text-main);
      background: rgba(255, 255, 255, 0.05);
    }

    body.theme-light .nav-tab-btn:hover {
      background: rgba(15, 23, 42, 0.05);
    }

    .nav-tab-btn.active {
      background: var(--red);
      color: #ffffff;
      box-shadow: 0 2px 10px var(--red-glow);
    }

    /* Actions Right */
    .nav-actions-right {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-shrink: 0;
    }

    .btn-action-primary {
      background: linear-gradient(135deg, #ff1e4b, #db0031);
      color: #ffffff;
      font-family: var(--font-sans);
      font-size: 12px;
      font-weight: 700;
      padding: 7px 14px;
      border-radius: var(--radius-full);
      border: none;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      white-space: nowrap;
      flex-shrink: 0;
      box-shadow: 0 4px 14px var(--red-glow);
      transition: all 0.2s ease;
    }

    .btn-action-primary:hover {
      transform: translateY(-1px);
      box-shadow: 0 6px 18px var(--red-glow);
      filter: brightness(1.05);
    }

    .btn-theme-toggle {
      background: var(--bg-card);
      border: 1px solid var(--border-color);
      color: var(--text-muted);
      border-radius: var(--radius-full);
      padding: 6px 11px;
      font-family: var(--font-sans);
      font-size: 12px;
      font-weight: 700;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 5px;
      white-space: nowrap;
      flex-shrink: 0;
      transition: all 0.2s ease;
      box-shadow: var(--card-inner-shadow);
    }

    .btn-theme-toggle:hover {
      border-color: var(--red-border);
      color: var(--text-main);
      background: var(--bg-card-hover);
    }

    .btn-icon-circle {
      width: 36px;
      height: 36px;
      border-radius: 50%;
      background: var(--bg-surface);
      border: 1px solid var(--border-color);
      color: var(--text-main);
      display: grid;
      place-items: center;
      cursor: pointer;
      font-size: 14px;
      transition: all 0.15s ease;
    }

    .btn-icon-circle:hover {
      border-color: var(--red);
    }

    /* MAIN WRAPPER */
    main.platform-container {
      max-width: 1440px;
      margin: 0 auto;
      padding: 1.5rem;
      flex: 1;
      width: 100%;
    }

    /* TAB CONTENT WRAPPERS */
    .tab-view {
      display: none;
    }

    .tab-view.active {
      display: block;
      animation: fadeIn 0.2s ease-out;
    }

    @keyframes fadeIn {
      from {
        opacity: 0;
        transform: translateY(4px);
      }

      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    /* KPI METRICS ROW */
    .kpi-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 1rem;
      margin-bottom: 1.5rem;
    }

    @media (max-width: 900px) {
      .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
      }
    }

    .kpi-card {
      background: var(--bg-surface);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-md);
      padding: 1.15rem 1.35rem;
      box-shadow: var(--card-inner-shadow), var(--card-shadow);
      position: relative;
      overflow: hidden;
    }

    .kpi-card::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 3px;
      background: var(--border-color);
    }

    .kpi-card.highlight::before {
      background: linear-gradient(90deg, #ff1e4b, #db0031);
    }

    .kpi-label {
      font-family: var(--font-mono);
      font-size: 9.5px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.1em;
      color: var(--text-muted);
      margin-bottom: 6px;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .kpi-value {
      font-family: var(--font-display);
      font-size: 1.85rem;
      font-weight: 800;
      letter-spacing: -0.03em;
      line-height: 1.1;
      color: var(--text-main);
      margin-bottom: 4px;
    }

    .kpi-value.red {
      color: var(--red);
    }

    .kpi-value.green {
      color: var(--emerald);
    }

    .kpi-sub {
      font-size: 11px;
      color: var(--text-dim);
    }

    /* OVERDUE ALERT BANNER */
    .overdue-alert-banner {
      background: linear-gradient(90deg, rgba(219, 0, 49, 0.15), rgba(219, 0, 49, 0.05));
      border: 1px solid var(--red-border);
      border-left: 4.5px solid var(--red);
      border-radius: var(--radius-sm);
      padding: 12px 18px;
      margin-bottom: 1.5rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 1rem;
      flex-wrap: wrap;
    }

    .overdue-alert-banner strong {
      color: var(--red);
      font-size: 13.5px;
    }

    /* CARD CONTAINERS & PANELS */
    .panel-card {
      background: var(--bg-surface);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-md);
      box-shadow: var(--card-inner-shadow), var(--card-shadow);
      padding: 1.35rem 1.5rem;
      margin-bottom: 1.5rem;
    }

    .panel-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 1.15rem;
      padding-bottom: 10px;
      border-bottom: 1px solid var(--border-subtle);
    }

    .panel-title {
      font-family: var(--font-display);
      font-size: 1.25rem;
      font-weight: 800;
      letter-spacing: -0.025em;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .panel-title span.accent {
      color: var(--red);
    }

    /* DATA TABLES */
    .table-responsive {
      width: 100%;
      overflow-x: auto;
    }

    table.data-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 12.5px;
      text-align: left;
    }

    table.data-table th {
      background: var(--table-header-bg);
      color: var(--text-muted);
      font-family: var(--font-mono);
      font-size: 10px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.07em;
      padding: 12px 14px;
      border-bottom: 2px solid var(--border-color);
    }

    body.theme-dark table.data-table th {
      border-bottom-color: rgba(219, 0, 49, 0.6);
      background: var(--table-header-bg);
      color: var(--text-muted);
    }

    body.theme-light table.data-table th {
      background: #f8fafc;
      color: #475569;
      border-bottom: 2px solid #e2e8f0;
    }

    table.data-table td {
      padding: 12px 14px;
      border-bottom: 1px solid var(--border-color);
      color: var(--text-main);
      vertical-align: middle;
    }

    table.data-table tr:nth-child(even) td {
      background: var(--table-row-even);
    }

    table.data-table tr:hover td {
      background: rgba(219, 0, 49, 0.035);
    }

    /* CHIPS & BADGES */
    .chip {
      font-family: var(--font-mono);
      font-size: 10px;
      font-weight: 700;
      padding: 3px 9px;
      border-radius: var(--radius-full);
      display: inline-flex;
      align-items: center;
      gap: 5px;
      border: 1px solid transparent;
      letter-spacing: 0.02em;
      white-space: nowrap;
    }

    /* Dark Mode Chips */
    body.theme-dark .chip-green {
      background: rgba(16, 185, 129, 0.16);
      color: #34d399;
      border-color: rgba(16, 185, 129, 0.35);
    }

    body.theme-dark .chip-blue {
      background: rgba(59, 130, 246, 0.16);
      color: #60a5fa;
      border-color: rgba(59, 130, 246, 0.35);
    }

    body.theme-dark .chip-amber {
      background: rgba(245, 158, 11, 0.16);
      color: #fbbf24;
      border-color: rgba(245, 158, 11, 0.35);
    }

    body.theme-dark .chip-red {
      background: rgba(225, 29, 72, 0.16);
      color: #fb7185;
      border-color: rgba(225, 29, 72, 0.35);
    }

    body.theme-dark .chip-muted {
      background: rgba(148, 163, 184, 0.12);
      color: #cbd5e1;
      border-color: rgba(148, 163, 184, 0.22);
    }

    /* Light Mode Chips */
    body.theme-light .chip-green {
      background: #ecfdf5;
      color: #047857;
      border-color: #a7f3d0;
    }

    body.theme-light .chip-blue {
      background: #eff6ff;
      color: #1d4ed8;
      border-color: #bfdbfe;
    }

    body.theme-light .chip-amber {
      background: #fffbeb;
      color: #b45309;
      border-color: #fde68a;
    }

    body.theme-light .chip-red {
      background: #fff1f2;
      color: #be123c;
      border-color: #fecdd3;
    }

    body.theme-light .chip-muted {
      background: #f1f5f9;
      color: #475569;
      border-color: #cbd5e1;
    }

    /* STATUS INTERACTIVE SELECTOR */
    .status-select-wrap {
      display: inline-flex;
      flex-direction: column;
      align-items: flex-start;
      gap: 3px;
    }

    .status-dropdown {
      font-family: var(--font-mono);
      font-size: 10px;
      font-weight: 800;
      padding: 3px 8px;
      border-radius: var(--radius-xs);
      cursor: pointer;
      outline: none;
      transition: all 0.2s ease;
      text-transform: uppercase;
      letter-spacing: 0.03em;
      border: 1px solid transparent;
      appearance: none;
      -webkit-appearance: none;
      -moz-appearance: none;
      background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2210%22%20height%3D%226%22%20viewBox%3D%220%200%2010%206%22%3E%3Cpath%20fill%3D%22%239e9ea7%22%20d%3D%22M0%200l5%206%205-6z%22%2F%3E%3C%2Fsvg%3E");
      background-repeat: no-repeat;
      background-position: right 6px center;
      padding-right: 18px;
    }

    .status-dropdown:hover {
      filter: brightness(1.15);
      border-color: rgba(255, 255, 255, 0.25);
    }

    .status-dropdown option {
      background: #111218;
      color: #fcfbf9;
      font-family: var(--font-sans);
      font-size: 12px;
      font-weight: 600;
      text-transform: none;
      padding: 6px;
    }

    body.theme-light .status-dropdown option {
      background: #ffffff;
      color: #111827;
    }

    .btn-status-quick {
      border-color: rgba(59, 130, 246, 0.4);
      color: #93c5fd;
    }

    .btn-status-quick:hover {
      border-color: #3b82f6 !important;
      color: #3b82f6 !important;
      background: rgba(59, 130, 246, 0.1);
    }

    /* STATUS MODAL QUICK CARDS */
    .status-options-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 8px;
      margin: 12px 0;
    }

    .status-option-card {
      background: var(--bg-card);
      border: 1.5px solid var(--border-color);
      border-radius: var(--radius-sm);
      padding: 10px;
      cursor: pointer;
      transition: all 0.2s ease;
      text-align: center;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 4px;
    }

    .status-option-card:hover {
      border-color: rgba(255, 255, 255, 0.25);
      background: var(--bg-card-hover);
    }

    .status-option-card.active {
      border-color: var(--red);
      background: rgba(219, 0, 49, 0.08);
      box-shadow: 0 0 14px var(--red-glow-subtle);
    }

    .status-option-card .status-card-icon {
      font-size: 18px;
    }

    .status-option-card .status-card-title {
      font-family: var(--font-mono);
      font-size: 10.5px;
      font-weight: 800;
      text-transform: uppercase;
      color: var(--text-main);
    }

    .status-option-card .status-card-desc {
      font-size: 9.5px;
      color: var(--text-dim);
      line-height: 1.25;
    }

    /* BUTTONS */
    .btn-sm {
      font-family: var(--font-sans);
      font-size: 11.5px;
      font-weight: 700;
      padding: 5px 10px;
      border-radius: var(--radius-full);
      border: 1px solid var(--border-color);
      background: var(--bg-card);
      color: var(--text-main);
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 4px;
      transition: all 0.15s ease;
      text-decoration: none;
    }

    .btn-sm:hover {
      border-color: var(--red);
      color: var(--red);
    }

    .btn-wa {
      background: rgba(37, 211, 102, 0.12);
      border-color: rgba(37, 211, 102, 0.4);
      color: #25d366;
    }

    .btn-wa:hover {
      background: #25d366;
      color: #0b141a;
      border-color: #25d366;
    }

    /* INTERACTIVE JOB CODE PILL & JOURNEY BUTTON */
    .job-code-pill {
      background: transparent;
      border: 1px solid transparent;
      font-family: var(--font-mono);
      font-weight: 800;
      color: var(--red);
      cursor: pointer;
      padding: 2px 6px;
      border-radius: var(--radius-xs);
      transition: all 0.15s ease;
      display: inline-flex;
      align-items: center;
      gap: 3px;
    }

    .job-code-pill:hover {
      background: var(--red-glow-subtle);
      border-color: var(--red-border);
      color: var(--red-bright);
      transform: translateY(-1px);
    }

    .btn-timeline-quick {
      background: rgba(139, 92, 246, 0.12);
      border-color: rgba(139, 92, 246, 0.35);
      color: #c4b5fd;
    }

    .btn-timeline-quick:hover {
      border-color: #8b5cf6 !important;
      color: #ffffff !important;
      background: #8b5cf6 !important;
    }

    /* RECURRENT & PREVIOUS TASK ASSISTANT DRAWER */
    .recurrent-panel {
      background: rgba(219, 0, 49, 0.04);
      border: 1px solid rgba(219, 0, 49, 0.22);
      border-radius: var(--radius-sm);
      padding: 12px 14px;
      margin-bottom: 1rem;
      transition: all 0.2s ease;
    }

    .recurrent-panel-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 8px;
    }

    .recurrent-panel-title {
      font-size: 11px;
      font-weight: 700;
      color: var(--red);
      display: flex;
      align-items: center;
      gap: 6px;
      letter-spacing: 0.02em;
    }

    .recurrent-task-chip {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      background: var(--bg-surface);
      border: 1px solid rgba(255, 255, 255, 0.1);
      color: var(--text-main);
      padding: 5px 10px;
      border-radius: 6px;
      font-size: 11.5px;
      cursor: pointer;
      transition: all 0.15s ease;
      user-select: none;
    }

    .recurrent-task-chip:hover {
      background: rgba(219, 0, 49, 0.14);
      border-color: var(--red);
      color: #ffffff;
      transform: translateY(-1px);
    }

    .recurrent-task-chip .chip-freq {
      background: rgba(219, 0, 49, 0.22);
      color: var(--red-bright);
      font-size: 9.5px;
      font-weight: 800;
      padding: 1px 5px;
      border-radius: 4px;
    }

    .recurrent-task-chip .chip-val {
      font-family: var(--font-mono);
      font-size: 10px;
      color: var(--text-dim);
    }

    .recurrent-badge-autofill {
      display: none;
      align-items: center;
      gap: 6px;
      margin-top: 8px;
      padding: 6px 10px;
      background: rgba(16, 185, 129, 0.1);
      border: 1px solid rgba(16, 185, 129, 0.3);
      border-radius: 4px;
      font-size: 11px;
      color: #34d399;
      font-weight: 600;
    }

    /* OPERATIONAL TIMELINE & JOURNEY DRAWER */
    .timeline-container {
      position: relative;
      padding-left: 28px;
      margin: 1.25rem 0;
    }

    .timeline-container::before {
      content: '';
      position: absolute;
      top: 10px;
      bottom: 10px;
      left: 10px;
      width: 2px;
      background: var(--border-color);
    }

    .timeline-node {
      position: relative;
      margin-bottom: 1rem;
    }

    .timeline-node:last-child {
      margin-bottom: 0;
    }

    .timeline-node-icon {
      position: absolute;
      left: -28px;
      top: 2px;
      width: 22px;
      height: 22px;
      border-radius: 50%;
      background: var(--bg-surface);
      border: 2px solid var(--border-color);
      display: grid;
      place-items: center;
      font-size: 11px;
      z-index: 2;
    }

    .timeline-node.highlight .timeline-node-icon {
      border-color: var(--red);
      box-shadow: 0 0 10px var(--red-glow);
    }

    .timeline-node-card {
      background: var(--bg-card);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-sm);
      padding: 9px 12px;
      transition: all 0.15s ease;
    }

    .timeline-node-card:hover {
      border-color: var(--border-subtle);
      background: var(--bg-card-hover);
    }

    .timeline-node-top {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 4px;
      font-family: var(--font-mono);
      font-size: 10px;
      color: var(--text-dim);
    }

    .timeline-node-title {
      font-size: 12.5px;
      font-weight: 700;
      color: var(--text-main);
    }

    .timeline-node-note {
      font-size: 11.5px;
      color: var(--text-muted);
      margin-top: 4px;
      line-height: 1.4;
    }

    .timeline-payload-box {
      margin-top: 6px;
      background: rgba(0, 0, 0, 0.25);
      border: 1px dashed var(--border-color);
      border-radius: var(--radius-xs);
      padding: 6px 8px;
      font-size: 11px;
      font-family: var(--font-mono);
      color: var(--text-dim);
      white-space: pre-wrap;
      word-break: break-word;
      max-height: 80px;
      overflow-y: auto;
    }

    /* CALENDAR GRID VIEW */
    .calendar-controls {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 1rem;
    }

    .calendar-grid {
      display: grid;
      grid-template-columns: repeat(7, 1fr);
      gap: 6px;
    }

    .calendar-day-header {
      font-family: var(--font-mono);
      font-size: 10px;
      font-weight: 700;
      text-transform: uppercase;
      text-align: center;
      padding: 8px 4px;
      color: var(--text-muted);
    }

    .calendar-cell {
      background: var(--bg-card);
      border: 1px solid var(--border-subtle);
      border-radius: var(--radius-sm);
      min-height: 115px;
      padding: 6px 8px;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      transition: all 0.15s ease;
    }

    .calendar-cell:hover {
      border-color: var(--border-color);
      background: var(--bg-card-hover);
    }

    .calendar-cell-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 4px;
    }

    .calendar-date-num {
      font-family: var(--font-mono);
      font-size: 11px;
      font-weight: 700;
    }

    .calendar-val-badge {
      font-family: var(--font-mono);
      font-size: 8.5px;
      font-weight: 800;
      background: rgba(37, 211, 102, 0.12);
      color: #25d366;
      border: 1px solid rgba(37, 211, 102, 0.3);
      padding: 1px 4px;
      border-radius: 3px;
    }

    .calendar-tasks-wrap {
      display: flex;
      flex-direction: column;
      gap: 3px;
      overflow-y: auto;
      max-height: 80px;
    }

    .calendar-task-chip {
      font-size: 9.5px;
      padding: 2px 5px;
      border-radius: 3px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      cursor: pointer;
      display: block;
      font-weight: 600;
    }

    /* SLIDE-OVER DRAWER & MODALS */
    .modal-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.7);
      backdrop-filter: blur(8px);
      z-index: 200;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 1rem;
    }

    .modal-overlay.active {
      display: flex;
    }

    .modal-box {
      background: var(--bg-surface);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-lg);
      box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--border-color);
      width: 100%;
      max-width: 580px;
      max-height: 90vh;
      overflow-y: auto;
      padding: 1.75rem 2rem;
      position: relative;
    }

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

    .modal-title {
      font-family: var(--font-display);
      font-size: 1.25rem;
      font-weight: 800;
    }

    .btn-close-modal {
      background: transparent;
      border: none;
      color: var(--text-muted);
      cursor: pointer;
      font-size: 18px;
    }

    /* FORM ELEMENTS */
    .form-group {
      margin-bottom: 1rem;
    }

    .form-label {
      font-family: var(--font-mono);
      font-size: 10px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: var(--text-muted);
      margin-bottom: 5px;
      display: block;
    }

    .form-control {
      width: 100%;
      background: var(--input-bg);
      border: 1px solid var(--input-border);
      border-radius: var(--radius-sm);
      padding: 9px 12px;
      font-family: var(--font-sans);
      font-size: 13px;
      color: var(--text-main);
      outline: none;
      transition: all 0.15s ease;
      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    }

    .form-control:focus {
      border-color: var(--input-border-focus);
      box-shadow: 0 0 0 3px rgba(219, 0, 49, 0.18);
    }

    select.form-control option {
      background: var(--bg-surface);
      color: var(--text-main);
      padding: 6px;
    }

    .form-row {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 0.75rem;
    }

    /* SWITCH TOGGLE */
    .switch-wrap {
      display: flex;
      align-items: center;
      justify-content: space-between;
      background: var(--bg-card);
      border: 1px solid var(--border-color);
      padding: 8px 12px;
      border-radius: var(--radius-sm);
    }

    .switch-info {
      font-size: 12px;
    }

    .switch-info strong {
      display: block;
      color: var(--text-main);
    }

    .switch-info span {
      font-size: 10.5px;
      color: var(--text-dim);
    }

    /* WhatsApp Mobile Card Specimen */
    .wa-preview-box {
      background: #0b141a;
      color: #e9edef;
      border-radius: var(--radius-md);
      border: 1.5px solid #202c33;
      overflow: hidden;
      margin: 1rem 0;
      box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    }

    .wa-preview-bar {
      background: #1f2c34;
      padding: 7px 12px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-size: 11px;
      font-weight: 700;
      color: #25d366;
      border-bottom: 1px solid #2a3942;
    }

    .wa-preview-content {
      padding: 10px 12px;
      font-size: 11.5px;
      line-height: 1.45;
    }

    .wa-preview-content pre {
      white-space: pre-wrap;
      font-family: var(--font-sans);
    }

    /* =========================================================================
       USER PROFILE WRAP & DROPDOWN (NAVBAR)
       ========================================================================= */
    .user-profile-wrap {
      position: relative;
    }

    .btn-user-profile {
      background: var(--bg-surface);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-full);
      padding: 4px 10px 4px 6px;
      font-family: var(--font-sans);
      font-size: 12px;
      font-weight: 700;
      color: var(--text-main);
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 7px;
      transition: all 0.2s ease;
      box-shadow: var(--card-inner-shadow);
    }

    .btn-user-profile:hover {
      border-color: var(--red-border);
      background: var(--bg-card);
    }

    .user-avatar-badge {
      width: 24px;
      height: 24px;
      border-radius: var(--radius-full);
      background: linear-gradient(135deg, var(--red), var(--red-dark));
      color: #fff;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 11px;
      font-weight: 800;
    }

    .user-profile-info-nav {
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      line-height: 1.15;
    }

    .nav-user-name {
      font-size: 12px;
      font-weight: 700;
      color: var(--text-main);
      max-width: 120px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .nav-user-tier-pill {
      font-family: var(--font-mono);
      font-size: 8px;
      font-weight: 800;
      text-transform: uppercase;
      color: var(--red);
      letter-spacing: 0.03em;
    }

    .user-dropdown-menu {
      position: absolute;
      top: 125%;
      right: 0;
      width: 290px;
      background: var(--bg-surface);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-md);
      box-shadow: var(--card-shadow);
      padding: 8px;
      display: none;
      z-index: 150;
    }

    .user-dropdown-menu.active {
      display: block;
    }

    .user-dropdown-header {
      padding: 8px 10px 10px;
      border-bottom: 1px solid var(--border-color);
      margin-bottom: 6px;
    }

    .user-dropdown-fullname {
      font-family: var(--font-display);
      font-size: 14px;
      font-weight: 700;
      color: var(--text-main);
    }

    .user-dropdown-email {
      font-family: var(--font-mono);
      font-size: 10.5px;
      color: var(--text-dim);
      margin-top: 2px;
    }

    .user-dropdown-tier {
      display: inline-block;
      margin-top: 6px;
      font-family: var(--font-mono);
      font-size: 9px;
      font-weight: 800;
      padding: 2px 7px;
      border-radius: var(--radius-full);
      background: var(--red-glow-subtle);
      color: var(--red);
      border: 1px solid var(--red-border);
      text-transform: uppercase;
    }

    .user-dropdown-actions {
      display: flex;
      flex-direction: column;
      gap: 3px;
    }

    .user-dropdown-item {
      width: 100%;
      display: flex;
      align-items: center;
      gap: 9px;
      padding: 8px 10px;
      border-radius: var(--radius-sm);
      border: none;
      background: transparent;
      color: var(--text-main);
      font-family: var(--font-sans);
      font-size: 12px;
      cursor: pointer;
      text-align: left;
      transition: background 0.15s ease;
    }

    .user-dropdown-item:hover {
      background: var(--bg-card-hover);
    }

    .user-dropdown-item.danger {
      color: var(--red);
    }

    .user-dropdown-item.danger:hover {
      background: var(--red-glow-subtle);
    }

    /* =========================================================================
       AUTHENTICATION PORTAL OVERLAY & DUAL-TIER SELECTION
       ========================================================================= */
    .auth-portal-overlay {
      z-index: 300;
    }

    .auth-card {
      background: var(--bg-surface);
      border: 1px solid var(--border-color);
      border-top: 3px solid var(--red);
      border-radius: var(--radius-lg);
      box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--border-color);
      width: 100%;
      max-width: 520px;
      max-height: 92vh;
      overflow-y: auto;
      padding: 2.2rem 2.4rem;
      position: relative;
    }

    .auth-card-header {
      text-align: center;
      margin-bottom: 1.5rem;
    }

    .auth-title {
      font-family: var(--font-display);
      font-size: 1.35rem;
      font-weight: 800;
      letter-spacing: -0.02em;
      color: var(--text-main);
      margin-top: 6px;
    }

    .auth-subtitle {
      font-family: var(--font-sans);
      font-size: 12px;
      color: var(--text-muted);
      margin-top: 4px;
    }

    .auth-segmented-tabs {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 6px;
      background: var(--bg-card);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-full);
      padding: 4px;
      margin-top: 1.25rem;
    }

    .auth-tab-btn {
      background: transparent;
      border: none;
      border-radius: var(--radius-full);
      padding: 8px 14px;
      font-family: var(--font-sans);
      font-size: 12.5px;
      font-weight: 700;
      color: var(--text-muted);
      cursor: pointer;
      transition: all 0.2s ease;
    }

    .auth-tab-btn.active {
      background: var(--bg-surface);
      color: var(--text-main);
      border: 1px solid var(--border-color);
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    }

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

    .auth-tab-content.active {
      display: block;
      animation: fadeInAuth 0.25s ease forwards;
    }

    @keyframes fadeInAuth {
      from {
        opacity: 0;
        transform: translateY(6px);
      }

      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    /* DUAL TIER SELECTION CARDS */
    .tier-cards-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
      margin-top: 6px;
    }

    .tier-card {
      background: var(--bg-card);
      border: 1.5px solid var(--border-color);
      border-radius: var(--radius-md);
      padding: 12px;
      cursor: pointer;
      transition: all 0.2s ease;
      position: relative;
      display: flex;
      flex-direction: column;
    }

    .tier-card:hover {
      border-color: rgba(255, 255, 255, 0.25);
      background: var(--bg-card-hover);
    }

    .tier-card.active {
      border-color: var(--red);
      background: rgba(219, 0, 49, 0.06);
      box-shadow: 0 0 16px var(--red-glow-subtle);
    }

    .tier-card-badge {
      position: absolute;
      top: 8px;
      right: 8px;
      font-family: var(--font-mono);
      font-size: 7.5px;
      font-weight: 800;
      text-transform: uppercase;
      background: var(--border-subtle);
      color: var(--text-dim);
      padding: 1px 5px;
      border-radius: var(--radius-full);
      border: 1px solid var(--border-subtle);
    }

    .tier-card.active .tier-card-badge {
      background: var(--red-glow-subtle);
      color: var(--red);
      border-color: var(--red-border);
    }

    .tier-card-badge.gold {
      color: var(--gold);
    }

    .tier-card-icon {
      font-size: 22px;
      margin-bottom: 6px;
    }

    .tier-card-title {
      font-family: var(--font-display);
      font-size: 13px;
      font-weight: 800;
      color: var(--text-main);
      margin-bottom: 4px;
    }

    .tier-card-desc {
      font-size: 10.5px;
      color: var(--text-muted);
      line-height: 1.35;
      margin-bottom: 8px;
      flex: 1;
    }

    .tier-card-limit {
      font-family: var(--font-mono);
      font-size: 9px;
      font-weight: 700;
      color: var(--text-dim);
      border-top: 1px solid var(--border-color);
      padding-top: 6px;
    }

    .tier-card.active .tier-card-limit {
      color: var(--red);
    }

    .demo-auth-pill-wrap {
      margin-top: 1.25rem;
      padding-top: 1rem;
      border-top: 1px solid var(--border-color);
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 6px;
    }

    .btn-demo-pill {
      background: var(--bg-card);
      border: 1px solid var(--border-color);
      color: var(--text-main);
      font-family: var(--font-sans);
      font-size: 11.5px;
      font-weight: 600;
      padding: 7px 14px;
      border-radius: var(--radius-full);
      cursor: pointer;
      transition: all 0.2s ease;
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }

    .btn-demo-pill:hover {
      background: var(--bg-card-hover);
      border-color: var(--red);
      color: var(--red);
      transform: translateY(-1px);
    }

    .auth-card-footer {
      margin-top: 1.25rem;
      padding-top: 10px;
      border-top: 1px solid var(--border-color);
      text-align: center;
      font-family: var(--font-mono);
      font-size: 9.5px;
      color: var(--text-dim);
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .btn-close-auth {
      background: transparent;
      border: none;
      color: var(--text-muted);
      font-family: var(--font-sans);
      font-size: 11px;
      cursor: pointer;
      text-decoration: underline;
    }

    /* ONBOARDING GUIDED BANNER */
    .onboard-guide-banner {
      background: var(--bg-card);
      border: 1px solid var(--border-color);
      border-left: 3px solid var(--red);
      border-radius: var(--radius-sm);
      padding: 10px 12px;
      margin-bottom: 1.25rem;
    }

    .onboard-step-badge {
      font-family: var(--font-mono);
      font-size: 9px;
      font-weight: 800;
      color: var(--red);
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }


    /* =========================================================================
       RESPONSIVE MOBILE & TABLET SUITE (EXECUTIVE MOBILE-FIRST ARCHITECTURE)
       ========================================================================= */

    /* Universal Responsive Utilities */
    .tab-label-short {
      display: none;
    }

    .btn-job-short {
      display: none;
    }

    /* STANDARD LAPTOPS & DESKTOPS (<= 1560px, e.g. 1366x768 & 1440x900) */
    @media screen and (max-width: 1560px) {
      .nav-container {
        padding: 0 1.25rem;
        gap: 0.5rem;
      }

      main.platform-container {
        padding: 1.25rem;
      }

      .company-badge-tier {
        display: none;
      }

      #theme-toggle-text {
        display: none;
      }

      .tab-label-full {
        display: none;
      }

      .tab-label-short {
        display: inline;
      }

      .btn-job-full {
        display: none;
      }

      .btn-job-short {
        display: inline;
      }

      .nav-tab-btn {
        padding: 5px 10px;
        font-size: 11.5px;
      }
    }

    /* TABLET & SMALL LAPTOPS (<= 1024px) */
    @media screen and (max-width: 1024px) {
      header.platform-header {
        height: auto;
        padding: 8px 0 6px 0;
      }

      .nav-container {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-areas:
          "brand actions"
          "tabs tabs";
        row-gap: 8px;
        column-gap: 12px;
        padding: 0 1rem;
        height: auto;
      }

      .nav-brand-wrap {
        grid-area: brand;
        min-width: 0;
        gap: 10px !important;
      }

      .nav-actions-right {
        grid-area: actions;
        justify-content: flex-end;
        gap: 8px;
      }

      .nav-tabs-pill {
        grid-area: tabs;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        display: flex;
        flex-wrap: nowrap;
        padding: 4px;
        gap: 4px;
        border-radius: var(--radius-sm);
        background: var(--bg-card);
      }

      .nav-tabs-pill::-webkit-scrollbar {
        display: none;
      }

      .nav-tab-btn {
        flex-shrink: 0;
        white-space: nowrap;
        padding: 7px 13px;
        font-size: 12px;
      }

      main.platform-container {
        padding: 1.25rem 1rem;
      }

      .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
      }
    }

    /* STANDARD SMARTPHONES & PHABLETS (<= 768px) */
    @media screen and (max-width: 768px) {

      html,
      body {
        overflow-x: hidden;
      }

      .tab-label-full {
        display: none;
      }

      .tab-label-short {
        display: inline;
      }

      .btn-job-full {
        display: none;
      }

      .btn-job-short {
        display: inline;
      }

      .nav-brand-wrap {
        gap: 8px !important;
      }

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

      .brand-logo-img {
        height: 28px;
        width: 28px;
      }

      .btn-company-switcher {
        max-width: 140px;
        padding: 4px 10px;
        font-size: 11px;
      }

      #active-company-name {
        max-width: 75px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      .nav-user-tier-pill {
        display: none;
      }

      .btn-action-primary {
        padding: 6px 12px;
        font-size: 11.5px;
      }

      main.platform-container {
        padding: 0.85rem 0.65rem;
      }

      /* Alert Overdue Banner */
      .alert-banner {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 10px 12px;
      }

      .alert-banner button {
        width: 100%;
        text-align: center;
        justify-content: center;
      }

      /* KPI Cards 2x2 Matrix on Phones */
      .kpi-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
        margin-bottom: 1rem !important;
      }

      .kpi-card {
        padding: 10px 12px !important;
      }

      .kpi-label {
        font-size: 10px !important;
      }

      .kpi-label span {
        display: none !important;
      }

      .kpi-value {
        font-size: 17px !important;
        margin: 4px 0 2px !important;
      }

      .kpi-sub {
        font-size: 9px !important;
      }

      /* Panels */
      .panel-card,
      .report-console-card {
        padding: 1rem 0.75rem !important;
        border-radius: var(--radius-md) !important;
        margin-bottom: 1rem !important;
      }

      .panel-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        margin-bottom: 1rem;
      }

      .panel-title {
        font-size: 1.15rem;
      }

      /* Jobs Board Filter Bar */
      #view-jobs .panel-header>div:last-child {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        width: 100%;
      }

      #view-jobs #filter-job-employee {
        grid-column: 1 / -1;
        width: 100% !important;
        height: 38px;
      }

      #view-jobs #filter-job-status {
        width: 100% !important;
        height: 38px;
      }

      #view-jobs #filter-job-priority {
        width: 100% !important;
        height: 38px;
      }

      #view-jobs .panel-header button.btn-action-primary {
        grid-column: 1 / -1;
        width: 100% !important;
        justify-content: center;
        height: 38px;
      }

      /* Responsive Touch Tables */
      .table-responsive {
        margin: 0 -0.75rem;
        padding: 0 0.75rem;
        width: calc(100% + 1.5rem);
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
      }

      table.data-table th,
      table.data-table td {
        padding: 8px 10px;
        font-size: 11.5px;
      }

      /* Calendar Controls & Grid */
      .calendar-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
      }

      .calendar-controls>div:first-child {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
      }

      .calendar-controls>div:last-child {
        display: grid !important;
        grid-template-columns: 1fr auto;
        gap: 6px;
        width: 100%;
      }

      .calendar-controls #calendar-staff-filter {
        width: 100% !important;
        height: 34px;
      }

      .calendar-grid {
        gap: 2px !important;
      }

      .calendar-day-header {
        font-size: 9px !important;
        padding: 4px 1px !important;
      }

      .calendar-cell {
        min-height: 58px !important;
        padding: 3px 4px !important;
        border-radius: 4px !important;
      }

      .calendar-date-num {
        font-size: 10px !important;
      }

      .calendar-val-badge {
        display: none !important;
      }

      .calendar-tasks-wrap {
        max-height: 38px !important;
        gap: 2px !important;
      }

      .calendar-task-chip {
        font-size: 8px !important;
        padding: 1px 3px !important;
        border-radius: 2px !important;
      }

      /* Executive Reports View */
      .report-console-card .panel-header>div:last-child {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        width: 100%;
      }

      .report-console-card .panel-header>div:last-child>div {
        width: 100%;
      }

      .report-console-card .panel-header>div:last-child select {
        width: 100% !important;
      }

      .report-console-card .panel-header>div:last-child button:nth-of-type(1) {
        grid-column: 1 / -1;
        width: 100% !important;
        justify-content: center;
        height: 38px;
      }

      .report-console-card .panel-header>div:last-child button:nth-of-type(2) {
        grid-column: 1 / -1;
        width: 100% !important;
        justify-content: center;
        height: 40px;
        font-size: 12.5px;
      }

      .report-console-card .panel-header>div:last-child button:nth-of-type(3) {
        grid-column: 1 / -1;
        width: 100% !important;
        justify-content: center;
        height: 34px;
      }

      .report-tab-pill {
        flex-shrink: 0;
        white-space: nowrap;
        padding: 6px 12px;
        font-size: 11px;
      }

      .report-filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 10px;
      }

      .report-filter-bar>div:first-child {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 4px;
      }

      .report-filter-bar>div:first-child::-webkit-scrollbar {
        display: none;
      }

      .report-filter-bar>div:last-child {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        width: 100%;
      }

      .report-filter-bar>div:last-child>div:nth-child(1),
      .report-filter-bar>div:last-child>div:nth-child(2) {
        width: 100%;
      }

      .report-filter-bar>div:last-child input[type="date"] {
        width: 100% !important;
      }

      .report-filter-bar>div:last-child>div:nth-child(3) {
        grid-column: 1 / -1;
        width: 100%;
      }

      .report-filter-bar>div:last-child #report-filter-staff {
        width: 100% !important;
      }

      .report-filter-bar>div:last-child button {
        height: 34px;
      }

      /* On-Screen Document Pages */
      .doc-page-sheet {
        padding: 1.15rem 0.85rem !important;
        border-radius: var(--radius-sm) !important;
        margin: 0 auto 1.25rem !important;
        width: 100% !important;
        max-width: 100% !important;
        min-height: auto !important;
        box-shadow: none !important;
      }

      .doc-page-sheet.layout-landscape {
        max-width: 100% !important;
      }

      .pdf-cover-page {
        padding: 1.5rem 1rem !important;
        margin-bottom: 1.25rem !important;
        box-shadow: none !important;
      }

      .cover-hero-title {
        font-size: 1.5rem !important;
      }

      .cover-meta-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
      }

      .cover-toc-grid {
        grid-template-columns: 1fr !important;
        gap: 6px !important;
      }

      .doc-signoff-grid {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
      }

      /* NATIVE SLIDE-UP BOTTOM SHEET FOR ALL MODALS ON MOBILE */
      .modal-overlay {
        align-items: flex-end !important;
        padding: 0 !important;
      }

      .modal-box,
      .auth-card {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 88vh !important;
        border-radius: 20px 20px 0 0 !important;
        border-bottom: none !important;
        padding: 1.5rem 1.15rem 2rem 1.15rem !important;
        animation: slideUpBottom 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
      }

      .modal-box::after,
      .auth-card::after {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 36px;
        height: 4px;
        background: var(--border-color);
        border-radius: 4px;
      }

      @keyframes slideUpBottom {
        from {
          transform: translateY(100%);
        }

        to {
          transform: translateY(0);
        }
      }

      .form-row {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
      }

      .status-options-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 6px !important;
      }

      .tier-cards-grid {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
      }

      .modal-box form>div:last-child {
        flex-direction: column-reverse;
        gap: 8px;
      }

      .modal-box form>div:last-child button {
        width: 100% !important;
        justify-content: center;
        height: 40px;
      }
    }

    /* COMPACT SMARTPHONES (<= 480px) */
    @media screen and (max-width: 480px) {
      .brand-title {
        font-size: 1.15rem;
      }

      .btn-company-switcher {
        max-width: 110px;
        font-size: 10px;
        padding: 3px 8px;
        gap: 4px;
      }

      #active-company-name {
        max-width: 55px;
      }

      #active-tier-badge {
        font-size: 7.5px;
        padding: 1px 4px;
      }

      .btn-theme-toggle {
        padding: 6px 8px;
      }

      #theme-toggle-text {
        display: none;
      }

      .btn-job-short {
        display: none;
      }

      .user-profile-info-nav {
        display: none;
      }

      .btn-user-profile {
        padding: 3px;
        gap: 2px;
      }

      .user-dropdown-menu,
      .company-dropdown-menu {
        width: calc(100vw - 16px);
        max-width: 290px;
      }

      .kpi-value {
        font-size: 15px !important;
      }

      .kpi-card {
        padding: 8px 10px !important;
      }

      .auth-title {
        font-size: 1.15rem;
      }

      .btn-demo-pill {
        width: 100%;
        text-align: center;
        font-size: 11px;
      }
    }

    /* =========================================================================
       ALL-IN-ONE MULTI-COMPANY NOTIFICATION RADAR & ALERT BAR
       ========================================================================= */
    .btn-notif-bell {
      position: relative;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      background: var(--bg-card);
      border: 1px solid var(--border-color);
      color: var(--text-main);
      padding: 6px 11px;
      border-radius: 999px;
      font-size: 12px;
      font-weight: 700;
      white-space: nowrap;
      flex-shrink: 0;
      cursor: pointer;
      transition: all 0.2s ease;
    }

    .btn-notif-bell:hover {
      border-color: var(--red);
      background: rgba(219, 0, 49, 0.08);
    }

    .btn-notif-bell.has-urgent {
      border-color: rgba(239, 68, 68, 0.55);
      background: rgba(239, 68, 68, 0.1);
      box-shadow: 0 0 12px rgba(239, 68, 68, 0.2);
    }

    .notif-badge-count {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 18px;
      height: 18px;
      padding: 0 5px;
      border-radius: 999px;
      background: var(--red);
      color: #fff;
      font-family: var(--font-mono);
      font-size: 10px;
      font-weight: 800;
      line-height: 1;
    }

    .notif-badge-count.calm {
      background: #2563eb;
    }

    .notif-filter-tabs {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
      margin-bottom: 10px;
    }

    .notif-tab-pill {
      padding: 5px 10px;
      border-radius: 6px;
      border: 1px solid var(--border-color);
      background: var(--bg-surface);
      color: var(--text-muted);
      font-size: 11px;
      font-weight: 700;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 5px;
      transition: all 0.15s ease;
    }

    .notif-tab-pill:hover {
      border-color: var(--text-dim);
      color: var(--text-main);
    }

    .notif-tab-pill.active {
      background: var(--red);
      border-color: var(--red);
      color: #fff;
    }

    .notif-card-list {
      display: flex;
      flex-direction: column;
      gap: 8px;
      max-height: 56vh;
      overflow-y: auto;
      padding-right: 4px;
    }

    .notif-item-card {
      background: var(--bg-surface);
      border: 1px solid var(--border-color);
      border-left: 3px solid var(--border-color);
      border-radius: 8px;
      padding: 11px 13px;
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 12px;
      transition: all 0.15s ease;
    }

    .notif-item-card:hover {
      border-color: rgba(219, 0, 49, 0.35);
      background: var(--bg-card);
    }

    .notif-item-card.cat-overdue {
      border-left-color: #ef4444;
      background: rgba(239, 68, 68, 0.04);
    }

    .notif-item-card.cat-due_today {
      border-left-color: #f59e0b;
      background: rgba(245, 158, 11, 0.04);
    }

    .notif-item-card.cat-upcoming_week {
      border-left-color: #3b82f6;
    }

    .notif-item-card.cat-scheduled_future {
      border-left-color: #8b5cf6;
    }

    .notif-comp-tag {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 2px 7px;
      border-radius: 4px;
      background: rgba(219, 0, 49, 0.12);
      border: 1px solid rgba(219, 0, 49, 0.3);
      color: var(--text-main);
      font-size: 10px;
      font-weight: 700;
      font-family: var(--font-mono);
    }

    @media screen and (max-width: 640px) {
      .notif-label-text {
        display: none;
      }
      .notif-item-card {
        flex-direction: column;
      }
    }

    /* =========================================================================
       REPORT & BUDGET MONTH PRESET FILTER PILLS (DARK THEME POLISH)
       ========================================================================= */
    .rep-preset-pill {
      padding: 6px 12px;
      border-radius: var(--radius-full);
      border: 1px solid var(--border-color);
      background: var(--bg-surface);
      color: var(--text-muted);
      font-family: var(--font-sans);
      font-size: 11.5px;
      font-weight: 700;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 5px;
      transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
      outline: none;
      white-space: nowrap;
      appearance: none;
      -webkit-appearance: none;
    }

    .rep-preset-pill:hover {
      border-color: var(--red-border, rgba(219, 0, 49, 0.45));
      background: var(--bg-card);
      color: var(--text-main);
      transform: translateY(-1px);
    }

    .rep-preset-pill.active {
      background: linear-gradient(135deg, rgba(219, 0, 49, 0.24), rgba(219, 0, 49, 0.12));
      border-color: var(--red) !important;
      color: #ff4d6d !important;
      box-shadow: 0 0 12px rgba(219, 0, 49, 0.22);
    }
