*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    body { font-family: 'Inter', sans-serif; background: #f0f2f5; min-height: 100dvh; }

    /* HEADER */
    header {
      background: #fff;
      border-bottom: 1px solid #e9ecef;
      padding: 0 20px;
      height: 56px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      position: sticky; top: 0; z-index: 10;
    }
    .header-logo { font-size: 20px; font-weight: 700; color: #1971c2; }
    .header-right { display: flex; align-items: center; gap: 12px; }
    .org-badge { font-size: 12px; background: #e7f5ff; color: #1971c2; padding: 4px 10px; border-radius: 20px; font-weight: 600; }
    .btn-logout { font-size: 13px; color: #868e96; background: none; border: none; cursor: pointer; font-family: inherit; }
    .btn-logout:hover { color: #c92a2a; }

    /* MAIN */
    main { padding: 24px 20px; max-width: 720px; margin: 0 auto; }
    h1 { font-size: 22px; font-weight: 700; color: #212529; margin-bottom: 4px; }
    .subtitle { font-size: 14px; color: #868e96; margin-bottom: 24px; }

    /* STATS ROW */
    .stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 24px; }
    .stat-card, .stat-box { background: #fff; border-radius: 12px; padding: 16px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
    .stat-num { font-size: 28px; font-weight: 700; color: #1971c2; }
    .stat-label { font-size: 12px; color: #868e96; margin-top: 2px; }

    /* FILTERS */
    .filter-row { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
    .filter-row input, .filter-row select {
      padding: 8px 12px;
      border: 1.5px solid #dee2e6;
      border-radius: 8px;
      font-size: 13px;
      font-family: inherit;
      outline: none;
      background: #fff;
    }
    .filter-row input:focus, .filter-row select:focus { border-color: #1971c2; }
    .filter-row input[type="date"] { flex: 1; min-width: 130px; }

    /* JOB LIST */
    .job-list { display: flex; flex-direction: column; gap: 10px; }
    .job-card {
      background: #fff;
      border-radius: 12px;
      padding: 16px;
      box-shadow: 0 1px 4px rgba(0,0,0,0.06);
      cursor: pointer;
      transition: box-shadow 0.15s;
    }
    .job-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
    .job-card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
    .job-title { font-size: 15px; font-weight: 600; color: #212529; }
    .job-date { font-size: 12px; color: #868e96; }
    .job-meta { font-size: 13px; color: #495057; }
    .job-meta span { margin-right: 12px; }
    .job-tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 4px; margin-left: 6px; }
    .tag-ok { background: #ebfbee; color: #2f9e44; }
    .tag-warn { background: #fff3bf; color: #e67700; }

    /* MODAL */
    .modal-overlay {
      position: fixed; inset: 0;
      background: rgba(0,0,0,0.4);
      align-items: center; justify-content: center;
      padding: 20px;
      z-index: 100;
      display: none;
    }
    .modal-overlay.open { display: flex; }
    .modal {
      background: #fff;
      border-radius: 16px;
      padding: 28px 24px;
      width: 100%; max-width: 820px;
      max-height: 90dvh;
      overflow-y: auto;
    }
    .modal-inner {
      display: flex;
      gap: 20px;
      align-items: flex-start;
    }
    .modal-details { flex: 1; min-width: 0; }
    .modal-canvas-wrap {
      flex: 0 0 320px;
      position: relative;
    }
    #modal-canvas {
      border-radius: 10px;
      background: #f0f4ff;
      display: block;
      width: 100%;
      touch-action: none;
      cursor: grab;
    }
    #modal-canvas:active { cursor: grabbing; }
    @media (max-width: 640px) {
      .modal-inner { flex-direction: column; }
      .modal-canvas-wrap { flex: unset; width: 100%; }
    }
    .modal-title { font-size: 18px; font-weight: 700; margin-bottom: 16px; color: #212529; }
    .detail-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #f1f3f5; font-size: 14px; }
    .detail-row:last-child { border-bottom: none; }
    .detail-label { color: #868e96; }
    .detail-val { font-weight: 600; color: #212529; }
    .modal-notes { background: #f8f9fa; border-radius: 8px; padding: 12px; font-size: 13px; color: #495057; margin-top: 12px; }
    .detail-section-title { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #adb5bd; margin: 16px 0 4px; }
    .detail-section-title:first-child { margin-top: 0; }
    .btn-close { width: 100%; padding: 12px; margin-top: 8px; background: #f1f3f5; border: none; border-radius: 8px; font-size: 14px; font-weight: 600; font-family: inherit; cursor: pointer; }
    .btn-delete { width: 100%; padding: 12px; margin-top: 16px; background: #fff5f5; border: 1.5px solid #ffc9c9; border-radius: 8px; font-size: 14px; font-weight: 600; font-family: inherit; cursor: pointer; color: #c92a2a; }
    .btn-delete:hover { background: #ffe3e3; }

    .empty-state { text-align: center; padding: 48px 20px; color: #868e96; font-size: 14px; }
    .loading { text-align: center; padding: 40px; color: #868e96; }

    /* MOBILE */
    @media (max-width: 600px) {
      main { padding: 16px 12px; }
      h1 { font-size: 18px; }
      .stats-row { grid-template-columns: repeat(3, 1fr); gap: 8px; }
      .stat-card { padding: 12px 8px; }
      .stat-num { font-size: 22px; }
      .stat-label { font-size: 11px; }
      .filter-row { flex-direction: column; gap: 8px; }
      .filter-row input, .filter-row select { width: 100%; }
      .job-card-top { flex-direction: column; gap: 4px; }
      .job-date { font-size: 11px; }
      .modal { padding: 20px 16px; border-radius: 12px; }
      .modal-title { font-size: 16px; }
      #join-code-section { flex-direction: column; align-items: flex-start; gap: 8px; }
      #join-code-section button { width: 100%; }
      .header-logo { font-size: 17px; }
      .org-badge { font-size: 11px; padding: 3px 8px; }
    }
    @media (max-width: 380px) {
      .stats-row { grid-template-columns: 1fr; }
    }

/* ═══════════════════════════════════════════
   MOBILE DASHBOARD STYLES
   ═══════════════════════════════════════════ */

/* Account dropdown */
.account-menu-wrap { position: relative; }
.account-btn {
  background: none; border: none; font-size: 13px; color: #495057;
  cursor: pointer; font-family: inherit; padding: 6px 10px; border-radius: 8px;
  display: flex; align-items: center; gap: 6px;
}
.account-btn:hover { background: #f1f3f5; }
.account-dropdown {
  position: absolute; right: 0; top: calc(100% + 6px);
  background: #fff; border: 1px solid #e9ecef; border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12); min-width: 180px;
  display: none; z-index: 100; overflow: hidden;
}
.account-dropdown.open { display: block; }
.account-dropdown-item {
  padding: 12px 16px; font-size: 14px; color: #c92a2a; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
}
.account-dropdown-item:hover { background: #fff5f5; }

/* Filter chips */
.filter-bar {
  display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 12px;
}
.filter-chip {
  background: #fff; border: 1px solid #e9ecef; border-radius: 20px;
  padding: 6px 14px; font-size: 13px; color: #495057; cursor: pointer;
  font-family: inherit; font-weight: 500; transition: all 0.15s;
}
.filter-chip:hover { border-color: #1971c2; color: #1971c2; }
.filter-chip.active { background: #e7f5ff; border-color: #1971c2; color: #1971c2; }

/* Filter bottom sheet */
.filter-sheet-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  display: none; align-items: flex-end; justify-content: center;
  z-index: 200; opacity: 0; transition: opacity 0.2s;
}
.filter-sheet-overlay.open { display: flex; opacity: 1; }
.filter-sheet {
  background: #fff; border-radius: 20px 20px 0 0;
  width: 100%; max-width: 500px; max-height: 70vh;
  padding: 0 20px 24px; transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
}
.filter-sheet-overlay.open .filter-sheet { transform: translateY(0); }
.filter-sheet-handle {
  display: flex; justify-content: center; padding: 12px 0 8px;
  cursor: pointer;
}
.filter-sheet-handle .drag-bar {
  width: 40px; height: 4px; background: #ced4da; border-radius: 2px;
}
.filter-sheet-title {
  font-size: 18px; font-weight: 700; color: #212529; margin-bottom: 16px;
}
.filter-sheet-body { display: flex; flex-direction: column; gap: 8px; }
.filter-sheet .btn-primary {
  width: 100%;
  background: #1971c2;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  margin-top: 8px;
}
.filter-sheet .btn-primary:active { background: #1565a8; }
.filter-radio-option {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 10px; cursor: pointer;
  transition: background 0.15s; border: 2px solid transparent;
}
.filter-radio-option:hover { background: #f8f9fa; }
.filter-radio-option.selected { border-color: #1971c2; background: #e7f5ff; }
.filter-radio-option input[type="radio"] {
  width: 20px; height: 20px; accent-color: #1971c2; flex-shrink: 0;
}
.filter-radio-option label {
  font-size: 15px; color: #212529; cursor: pointer; flex: 1;
}

/* Mobile modal (bottom sheet style) */
.mobile-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  display: none; align-items: flex-end; justify-content: center;
  z-index: 150; opacity: 0; transition: opacity 0.2s;
}
.mobile-modal-overlay.open { display: flex; opacity: 1; }
.mobile-modal {
  background: #fff; border-radius: 20px 20px 0 0;
  width: 100%; max-width: 500px; max-height: 85vh;
  display: flex; flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.mobile-modal-overlay.open .mobile-modal { transform: translateY(0); }
.mobile-modal-overlay.dismissed .mobile-modal { transform: translateY(calc(100% - 60px)); }
.mobile-modal-handle {
  display: flex; justify-content: center; padding: 8px 0 4px;
  cursor: grab; flex-shrink: 0;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.mobile-modal-handle:active { cursor: grabbing; }
.drag-bar {
  width: 40px; height: 4px; background: #ced4da; border-radius: 2px;
}
.mobile-modal-handle .drag-bar {
  width: 40px; height: 4px; background: #ced4da; border-radius: 2px;
}
.mobile-modal-title {
  font-size: 18px; font-weight: 700; color: #212529;
  padding: 8px 20px 4px; flex-shrink: 0;
}
.mobile-modal-tabs {
  display: flex; gap: 0; border-bottom: 1px solid #e9ecef;
  padding: 0 20px; flex-shrink: 0;
}
.mobile-tab {
  flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
  padding: 10px 0; font-size: 14px; font-weight: 600; color: #868e96;
  cursor: pointer; font-family: inherit; transition: all 0.15s;
}
.mobile-tab.active {
  color: #1971c2; border-bottom-color: #1971c2;
}
.mobile-modal-body {
  flex: 1; overflow-y: auto; padding: 16px 20px 24px;
  -webkit-overflow-scrolling: touch;
}
.mobile-tab-content { display: none; }
.mobile-tab-content.active { display: block; }

/* Mobile-specific: hide desktop modal, show mobile */
@media (max-width: 640px) {
  .modal-overlay { display: none !important; }
  .modal { display: none !important; }
  main { padding: 16px; }
  h1 { font-size: 20px; }
  .stats-row { gap: 8px; }
  .stat-box { padding: 12px 8px; }
  .stat-num { font-size: 22px; }
  .filter-bar { gap: 6px; }
  .filter-chip { padding: 5px 10px; font-size: 12px; }
  .job-card { padding: 14px; }
  .job-title { font-size: 14px; }
  .job-meta { font-size: 12px; }
  .header-right { gap: 8px; }
  .org-badge { display: none; }
  .account-btn { padding: 4px 8px; font-size: 12px; }
}

/* Desktop: hide mobile modal */
@media (min-width: 641px) {
  .mobile-modal-overlay { display: none !important; }
  .mobile-modal { display: none !important; }
  .filter-sheet-overlay { display: none !important; }
}

/* Desktop/mobile filter visibility */
.desktop-filter { display: inline-block; }
.mobile-filter { display: none; }

@media (max-width: 640px) {
  .desktop-filter { display: none !important; }
  .mobile-filter { display: inline-block !important; }
}

.job-group { margin-bottom: 16px; }
.job-group-header {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: #e7f5ff; border-radius: 10px;
  margin-bottom: 10px; cursor: pointer; user-select: none;
  transition: background 0.15s;
}
.job-group-header:hover { background: #d0ebff; }
.job-group-header.collapsed .group-chevron { transform: rotate(-90deg); }
.group-chevron {
  transition: transform 0.2s; font-size: 12px; color: #1971c2;
}
.group-title { font-size: 14px; font-weight: 600; color: #1971c2; flex: 1; }
.group-count { font-size: 12px; color: #868e96; background: #fff; padding: 2px 8px; border-radius: 10px; }
.job-group-jobs { display: flex; flex-direction: column; gap: 10px; }
.job-group-jobs.collapsed { display: none; }
