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

    :root {
      --bg: #F2F2F5;
      --surface: #FFFFFF;
      /* Sidebar: deep blue-black with slight indigo character */
      --sidebar-bg: #0E0F1A;
      --sidebar-hover: rgba(255,255,255,0.07);
      --sidebar-active: rgba(255,255,255,0.10);
      /* Warm gold — brand accent for active states & moments of character */
      --accent: #C8A75A;
      --accent-light: #FBF5E6;

      --blue: #0A5FBF;
      --blue-light: #E5F0FF;
      --green: #1B7734;
      --green-light: #E3F7EA;
      --orange: #8A5A00;
      --orange-light: #FEF3C7;
      --red: #C81E1E;
      --red-light: #FEE2E2;
      --purple: #8B5CF6;
      --purple-light: #EDE9FE;

      --text-primary: #111118;
      --text-secondary: #5F6370;
      --text-tertiary: #63677A;
      --text-on-dark: #FFFFFF;
      --text-on-dark-secondary: rgba(255,255,255,0.48);

      --border: rgba(0,0,0,0.07);
      --border-medium: rgba(0,0,0,0.11);
      --shadow-sm: 0 1px 2px rgba(0,0,0,0.05), 0 1px 3px rgba(0,0,0,0.06);
      --shadow-md: 0 4px 14px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
      --shadow-lg: 0 12px 32px rgba(0,0,0,0.10), 0 4px 8px rgba(0,0,0,0.05);

      --radius-sm: 8px;
      --radius-md: 10px;
      --radius-lg: 14px;
      --radius-xl: 18px;

      --sidebar-width: 228px;
      --header-height: 54px;

      --font-display: 'Iowan Old Style', 'Palatino Linotype', 'Book Antiqua', Georgia, serif;
      --font-system: -apple-system, 'SF Pro Display', BlinkMacSystemFont, 'Segoe UI', sans-serif;

      --transition: all 0.16s cubic-bezier(0.4, 0, 0.2, 1);
      --transition-spring: all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    html, body {
      height: 100%;
      font-family: var(--font-system);
      background: var(--bg);
      color: var(--text-primary);
      font-size: 14px;
      -webkit-font-smoothing: antialiased;
    }

    /* ── LAYOUT ── */
    .app { display: flex; height: 100vh; overflow: hidden; }

    /* ── SIDEBAR ── */
    .sidebar {
      width: var(--sidebar-width);
      background: var(--sidebar-bg);
      display: flex;
      flex-direction: column;
      flex-shrink: 0;
      position: relative;
      z-index: 10;
    }

    .sidebar-logo {
      padding: 20px 16px 16px;
      border-bottom: 1px solid rgba(255,255,255,0.06);
    }

    .logo-mark { display: flex; align-items: center; gap: 10px; }

    .logo-icon {
      width: 30px; height: 30px;
      background: linear-gradient(135deg, var(--accent) 0%, #E8C97B 100%);
      border-radius: 8px;
      display: flex; align-items: center; justify-content: center;
      flex-shrink: 0;
      box-shadow: 0 2px 8px rgba(200,167,90,0.40);
    }

    .logo-icon svg { width: 16px; height: 16px; fill: #0E0F1A; }

    .logo-text {
      font-family: var(--font-display);
      font-size: 18px; font-weight: 600;
      color: var(--text-on-dark);
      letter-spacing: 0.1px;
      line-height: 1;
    }

    .logo-subtitle {
      font-size: 9.5px;
      color: var(--text-on-dark-secondary);
      letter-spacing: 1px;
      text-transform: uppercase;
      margin-top: 2px;
    }

    .sidebar-nav {
      flex: 1;
      padding: 10px 8px;
      overflow-y: auto;
    }

    .nav-section-label {
      font-size: 9.5px; font-weight: 700;
      letter-spacing: 1px;
      text-transform: uppercase;
      color: rgba(255,255,255,0.52);
      padding: 12px 10px 3px;
    }

    .nav-item {
      display: flex; align-items: center; gap: 9px;
      padding: 8px 10px;
      border-radius: var(--radius-sm);
      cursor: pointer;
      transition: var(--transition);
      margin-bottom: 1px;
      position: relative;
      user-select: none;
      /* button reset */
      background: none; border: none; width: 100%; text-align: left; font: inherit; color: inherit;
    }

    .nav-item:hover { background: var(--sidebar-hover); }
    .nav-item.active { background: rgba(200,167,90,0.12); }

    .nav-item.active::before {
      content: '';
      position: absolute; left: 0; top: 50%;
      transform: translateY(-50%);
      width: 2.5px; height: 14px;
      background: var(--accent);
      border-radius: 0 2px 2px 0;
    }

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

    .nav-icon svg {
      width: 14px; height: 14px;
      stroke: rgba(255,255,255,0.38);
      fill: none; stroke-width: 1.6;
      stroke-linecap: round; stroke-linejoin: round;
      transition: var(--transition);
    }

    .nav-item.active .nav-icon svg { stroke: var(--accent); }
    .nav-item:hover .nav-icon svg { stroke: rgba(255,255,255,0.75); }

    .nav-label {
      font-size: 12.5px; font-weight: 400;
      color: rgba(255,255,255,0.48);
      transition: var(--transition);
      flex: 1;
    }

    .nav-item.active .nav-label { color: var(--accent); font-weight: 500; }
    .nav-item:hover .nav-label { color: rgba(255,255,255,0.82); }

    .nav-badge {
      background: var(--blue); color: white;
      font-size: 9.5px; font-weight: 700;
      padding: 2px 6px;
      border-radius: 8px;
      min-width: 16px; text-align: center;
    }

    .sidebar-footer {
      padding: 12px 8px;
      border-top: 1px solid rgba(255,255,255,0.06);
    }

    .studio-info {
      display: flex; align-items: center; gap: 9px;
      padding: 7px 10px;
      border-radius: var(--radius-sm);
    }

    .studio-avatar {
      width: 30px; height: 30px;
      border-radius: 7px;
      background: linear-gradient(135deg, var(--accent), #E8C97B);
      display: flex; align-items: center; justify-content: center;
      font-size: 11px; font-weight: 700; color: #0E0F1A;
      flex-shrink: 0;
    }

    .studio-name { font-size: 11.5px; font-weight: 500; color: var(--text-on-dark); }
    .studio-role { font-size: 10.5px; color: var(--text-on-dark-secondary); }

    /* ── MAIN ── */
    .main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

    /* ── TOPBAR ── */
    .topbar {
      height: var(--header-height);
      background: rgba(242,242,245,0.92);
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      border-bottom: 1px solid var(--border);
      display: flex; align-items: center;
      padding: 0 20px; gap: 11px;
      flex-shrink: 0; position: relative; z-index: 5;
    }

    /* Skip link — visible only while focused */
    .skip-link {
      position: absolute; left: 8px; top: -60px;
      z-index: 200;
      background: var(--surface); color: var(--text-primary);
      padding: 9px 14px; border-radius: var(--radius-sm);
      box-shadow: var(--shadow-md);
      font-size: 13px; font-weight: 600; text-decoration: none;
      transition: top 0.12s ease;
    }

    .skip-link:focus { top: 8px; }

    .topbar-title {
      font-size: 15px; font-weight: 600;
      color: var(--text-primary); flex: 1;
      font-family: var(--font-display);
      letter-spacing: -0.1px;
    }

    .search-wrap {
      display: flex; align-items: center;
      background: white;
      border: 1px solid var(--border-medium);
      border-radius: 10px;
      padding: 7px 12px; gap: 7px;
      width: 210px;
      transition: var(--transition);
      box-shadow: var(--shadow-sm);
      position: relative;
    }

    .search-wrap:focus-within {
      border-color: var(--blue);
      box-shadow: 0 0 0 3px rgba(0,122,255,0.1);
    }

    .search-wrap svg {
      width: 13px; height: 13px;
      stroke: var(--text-tertiary); flex-shrink: 0;
    }

    .search-input {
      border: none; outline: none;
      background: transparent;
      font-size: 13px; color: var(--text-primary);
      font-family: var(--font-system);
      width: 100%;
    }

    .search-input::placeholder { color: var(--text-tertiary); }

    .search-results {
      position: absolute;
      top: calc(100% + 8px);
      left: 0;
      right: 0;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 14px;
      box-shadow: var(--shadow-md);
      overflow: hidden;
      display: none;
      z-index: 20;
    }

    .search-results.open { display: block; }

    .search-result-item {
      display: flex; align-items: center; gap: 11px;
      padding: 11px 12px;
      cursor: pointer;
      transition: var(--transition);
      border-bottom: 1px solid var(--border);
      background: none; border-left: none; border-right: none; border-top: none;
      font: inherit; color: inherit; text-align: left; width: 100%;
    }

    .search-result-item:last-child { border-bottom: none; }
    .search-result-item:hover,
    .search-result-item.active { background: #EDF3FB; }

    .search-result-info { flex: 1; min-width: 0; }

    .search-result-name {
      font-size: 12.5px; font-weight: 600;
      color: var(--text-primary);
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }

    .search-result-meta {
      font-size: 11px; color: var(--text-secondary);
      margin-top: 2px;
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }

    .search-result-empty {
      padding: 14px 12px;
      font-size: 12px;
      color: var(--text-secondary);
    }

    /* ── BUTTONS ── */
    .btn {
      display: inline-flex; align-items: center; gap: 6px;
      padding: 8px 16px;
      border-radius: 10px;
      font-size: 13px; font-weight: 500;
      font-family: var(--font-system);
      cursor: pointer; border: none;
      transition: var(--transition);
      white-space: nowrap;
    }

    .btn svg {
      width: 13px; height: 13px;
      stroke: currentColor; fill: none;
      stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
    }

    .btn-primary { background: var(--blue); color: white; }
    .btn-primary:hover {
      background: #0066DD;
      transform: translateY(-1px);
      box-shadow: 0 4px 14px rgba(0,122,255,0.28);
    }
    .btn-primary:active { transform: translateY(0); }

    .btn-secondary {
      background: white; color: var(--text-primary);
      border: 1px solid var(--border-medium);
      box-shadow: var(--shadow-sm);
    }
    .btn-secondary:hover { border-color: var(--blue); color: var(--blue); }

    .btn-ghost { background: transparent; color: var(--text-secondary); }
    .btn-ghost:hover { background: var(--bg); color: var(--text-primary); }

    .btn-danger { background: var(--red-light); color: var(--red); border: none; }
    .btn-danger:hover { background: var(--red); color: white; }
    .btn-sm { padding: 5px 10px; font-size: 11.5px; }

    /* ── CONTENT ── */
    .content { flex: 1; overflow-y: auto; padding: 20px; }

    .content::-webkit-scrollbar { width: 5px; }
    .content::-webkit-scrollbar-track { background: transparent; }
    .content::-webkit-scrollbar-thumb { background: var(--border-medium); border-radius: 3px; }

    /* ── VIEWS ── */
    .view { display: none; animation: fadeSlideIn 0.22s ease; }
    .view.active { display: block; }

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

    /* ── DASHBOARD ── */
    .stats-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 12px;
      margin-bottom: 18px;
    }

    .stat-card {
      background: var(--surface);
      border-radius: var(--radius-lg);
      padding: 16px 18px;
      border: 1px solid var(--border);
      box-shadow: var(--shadow-sm);
      transition: var(--transition);
      display: flex; flex-direction: column;
    }

    .stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

    .stat-icon {
      width: 32px; height: 32px;
      border-radius: 8px;
      display: flex; align-items: center; justify-content: center;
      margin-bottom: 11px;
    }

    .stat-icon svg {
      width: 15px; height: 15px;
      stroke: currentColor; fill: none;
      stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
    }

    .stat-icon.blue { background: var(--blue-light); color: var(--blue); }
    .stat-icon.green { background: var(--green-light); color: var(--green); }
    .stat-icon.orange { background: var(--orange-light); color: var(--orange); }
    .stat-icon.purple { background: var(--purple-light); color: var(--purple); }

    .stat-value {
      font-size: 26px; font-weight: 700;
      color: var(--text-primary);
      line-height: 1; margin-bottom: 3px;
      font-variant-numeric: tabular-nums;
      font-family: var(--font-display);
    }

    .stat-label { font-size: 11.5px; color: var(--text-secondary); font-weight: 500; }

    .stat-change {
      font-size: 10.5px; font-weight: 500;
      margin-top: 6px;
      display: flex; align-items: center; gap: 3px;
    }

    .stat-change.up { color: var(--green); }
    .stat-change.neutral { color: var(--text-tertiary); }

    .dashboard-grid {
      display: grid;
      grid-template-columns: 1fr 320px;
      gap: 16px;
    }

    /* ── CARDS ── */
    .card {
      background: var(--surface);
      border-radius: var(--radius-lg);
      border: 1px solid var(--border);
      box-shadow: var(--shadow-sm);
      overflow: hidden;
    }

    .card-header {
      display: flex; align-items: center;
      justify-content: space-between;
      padding: 13px 16px 11px;
      border-bottom: 1px solid var(--border);
    }

    .card-title {
      font-size: 12.5px; font-weight: 600;
      color: var(--text-primary);
      text-transform: uppercase; letter-spacing: 0.5px;
      font-family: var(--font-system);
    }

    .card-action {
      font-size: 11.5px; color: var(--blue);
      cursor: pointer; font-weight: 500;
    }
    .card-action:hover { text-decoration: underline; }

    /* ── APPOINTMENT ITEMS ── */
    .appt-item {
      display: flex; align-items: center; gap: 11px;
      padding: 11px 16px;
      border-bottom: 1px solid var(--border);
      transition: var(--transition);
      cursor: pointer;
    }

    .appt-item:last-child { border-bottom: none; }
    .appt-item:hover { background: var(--bg); }

    .appt-avatar {
      width: 34px; height: 34px;
      border-radius: 9px;
      display: flex; align-items: center; justify-content: center;
      font-size: 12px; font-weight: 700; color: white;
      flex-shrink: 0;
    }

    /* Keyboard-reachable row opener — a real button that looks like the row body */
    .appt-open {
      display: flex; align-items: center; gap: 11px;
      flex: 1; min-width: 0;
      background: none; border: none; padding: 0;
      font: inherit; color: inherit; text-align: left;
      cursor: pointer;
      border-radius: var(--radius-sm);
    }

    .appt-info { display: block; flex: 1; min-width: 0; }

    .appt-name, .appt-detail { display: block; }

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

    .appt-detail {
      font-size: 11px; color: var(--text-tertiary);
      margin-top: 1px;
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }

    .appt-right {
      display: flex; flex-direction: column;
      align-items: flex-end; gap: 4px; flex-shrink: 0;
    }

    .appt-time { font-size: 11px; color: var(--text-tertiary); font-variant-numeric: tabular-nums; }

    .appt-price {
      font-size: 12px; font-weight: 700;
      color: var(--text-primary);
      font-variant-numeric: tabular-nums;
    }

    .appt-actions-inline {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 5px;
      margin-top: 2px;
      flex-wrap: wrap;
    }

    /* ── STATUS BADGES (unified primitive) ── */
    .badge {
      display: inline-flex; align-items: center; gap: 3px;
      padding: 2px 7px;
      border-radius: 5px;
      font-size: 10px; font-weight: 600;
      letter-spacing: 0.2px;
      white-space: nowrap;
    }

    .badge::before {
      content: ''; width: 4.5px; height: 4.5px;
      border-radius: 50%; background: currentColor;
      flex-shrink: 0;
    }

    .badge-scheduled  { background: var(--blue-light);   color: #0066CC; }
    .badge-inprogress { background: #FEF3C7; color: #B45309; }
    .badge-completed  { background: var(--green-light);  color: #15803D; }
    .badge-cancelled  { background: #F1F1F4; color: var(--text-tertiary); }

    /* ── FILTER BAR ── */
    .filter-bar { display: flex; align-items: center; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }

    .filter-chip {
      padding: 4px 12px;
      border-radius: 6px; font-size: 11.5px; font-weight: 500;
      cursor: pointer; transition: var(--transition);
      border: 1px solid var(--border-medium);
      color: var(--text-secondary); background: var(--surface);
      box-shadow: var(--shadow-sm);
      /* button reset */
      font-family: inherit; line-height: inherit;
    }

    .filter-chip:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-light); }
    .filter-chip.active { background: var(--text-primary); color: white; border-color: var(--text-primary); }

    /* ── CUSTOMERS GRID ── */
    .customers-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
      gap: 12px;
    }

    .customer-card {
      background: var(--surface);
      border-radius: var(--radius-lg);
      padding: 15px;
      border: 1px solid var(--border);
      box-shadow: var(--shadow-sm);
      cursor: pointer;
      transition: var(--transition);
      position: relative;
    }

    .customer-card:hover {
      box-shadow: var(--shadow-md);
      transform: translateY(-1px);
      border-color: rgba(10,132,255,0.18);
    }

    .customer-card:active { transform: translateY(0); }

    .customer-card-header { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 11px; }

    .customer-avatar-lg {
      width: 40px; height: 40px;
      border-radius: 11px;
      display: flex; align-items: center; justify-content: center;
      font-size: 15px; font-weight: 700; color: white;
      flex-shrink: 0;
    }

    .customer-card-info { flex: 1; min-width: 0; }
    .customer-card-name { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; line-height: 1.2; }
    .customer-card-phone { font-size: 11.5px; color: var(--text-secondary); }

    /* Operasyonel sinyal — next appt + risk chips */
    .customer-card-signals {
      display: flex; align-items: center; gap: 5px;
      flex-wrap: wrap; margin-bottom: 10px;
      min-height: 20px;
    }

    .signal-chip {
      display: inline-flex; align-items: center; gap: 3px;
      padding: 2px 7px; border-radius: 5px;
      font-size: 10.5px; font-weight: 600;
      white-space: nowrap;
    }

    .signal-chip svg {
      width: 9px; height: 9px;
      stroke: currentColor; fill: none;
      stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
    }

    .customer-card-stats {
      display: flex; background: var(--bg);
      border-radius: 8px; overflow: hidden;
    }

    .customer-stat { flex: 1; padding: 7px 6px; text-align: center; position: relative; }

    .customer-stat + .customer-stat::before {
      content: ''; position: absolute;
      left: 0; top: 20%; height: 60%;
      width: 1px; background: var(--border);
    }

    .customer-stat-value { font-size: 14px; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; }
    .customer-stat-label { font-size: 9.5px; color: var(--text-tertiary); margin-top: 1px; text-transform: uppercase; letter-spacing: 0.3px; }

    .customer-card-footer {
      display: flex; align-items: center;
      justify-content: space-between;
      margin-top: 10px; padding-top: 9px;
      border-top: 1px solid var(--border);
      gap: 7px;
    }

    .customer-last-visit { font-size: 10.5px; color: var(--text-tertiary); }

    /* alert-badge = unified risk tag (used in detail + cards) */
    .alert-badge {
      display: inline-flex; align-items: center; gap: 3px;
      padding: 2px 7px;
      border-radius: 5px;
      background: var(--red-light);
      color: var(--red);
      font-size: 10px; font-weight: 600;
      max-width: 100%;
    }

    .alert-badge::before {
      content: '';
      width: 5px; height: 5px;
      border-radius: 50%;
      background: currentColor;
      flex-shrink: 0;
    }

    /* ── EMPTY STATE ── */
    .empty-state { text-align: center; padding: 56px 20px; color: var(--text-secondary); }

    .empty-state-icon {
      width: 52px; height: 52px;
      background: var(--bg); border-radius: 15px;
      display: flex; align-items: center; justify-content: center;
      margin: 0 auto 14px;
    }

    .empty-state-icon svg {
      width: 26px; height: 26px;
      stroke: var(--text-tertiary); fill: none;
      stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
    }

    .empty-state h3 { font-size: 14.5px; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
    .empty-state p { font-size: 13px; margin-bottom: 18px; }

    /* ── CUSTOMER DETAIL ── */
    .detail-header {
      display: flex; align-items: center;
      background: var(--surface);
      border-radius: var(--radius-lg);
      padding: 20px;
      border: 1px solid var(--border);
      margin-bottom: 16px;
      box-shadow: var(--shadow-sm);
      flex-wrap: wrap; gap: 14px;
    }

    .detail-avatar {
      width: 58px; height: 58px;
      border-radius: 15px;
      display: flex; align-items: center; justify-content: center;
      font-size: 22px; font-weight: 700; color: white;
      flex-shrink: 0;
    }

    .detail-name {
      font-size: 18px; font-weight: 700; color: var(--text-primary);
      margin-bottom: 4px; font-family: var(--font-display);
    }

    .detail-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

    .detail-meta-item {
      display: flex; align-items: center; gap: 4px;
      font-size: 12px; color: var(--text-secondary);
    }

    .detail-meta-item svg {
      width: 11px; height: 11px;
      stroke: var(--text-tertiary); fill: none;
      stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
    }

    .detail-actions { margin-left: auto; display: flex; gap: 7px; flex-wrap: wrap; }
    .detail-alert {
      margin-top: 10px;
      display: inline-flex; align-items: center; gap: 6px;
      padding: 6px 10px;
      border-radius: 8px;
      background: var(--red-light);
      color: var(--red);
      font-size: 11.5px; font-weight: 600;
    }

    .detail-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-bottom: 16px; }

    /* ── TIMELINE ── */
    .timeline { padding: 0; }

    .timeline-item {
      display: flex; gap: 12px;
      padding: 13px 16px;
      border-bottom: 1px solid var(--border);
      transition: var(--transition);
    }

    .timeline-item:last-child { border-bottom: none; }
    .timeline-item:hover { background: var(--bg); }

    .timeline-date-col { width: 42px; flex-shrink: 0; text-align: center; }
    .timeline-day { font-size: 18px; font-weight: 700; color: var(--text-primary); line-height: 1; font-variant-numeric: tabular-nums; font-family: var(--font-display); }
    .timeline-month { font-size: 9px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-tertiary); margin-top: 2px; }

    .timeline-divider { width: 1px; background: var(--border); flex-shrink: 0; margin: 2px 0; }

    .timeline-content { flex: 1; }

    .timeline-title {
      font-size: 13px; font-weight: 600;
      color: var(--text-primary); margin-bottom: 4px;
      display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
    }

    .timeline-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 4px; }

    .tag {
      padding: 1px 6px; border-radius: 4px;
      font-size: 10.5px; font-weight: 500;
      background: var(--bg); color: var(--text-secondary);
      border: 1px solid var(--border);
    }

    .timeline-price { font-size: 13.5px; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; }

    .timeline-actions {
      display: flex;
      gap: 5px;
      margin-left: auto;
      align-items: flex-start;
      justify-content: flex-end;
      flex-wrap: wrap;
      flex-shrink: 0;
    }

    /* ── MODAL ── */
    .modal-overlay {
      position: fixed; inset: 0;
      background: rgba(0,0,0,0.38);
      backdrop-filter: blur(5px);
      -webkit-backdrop-filter: blur(5px);
      z-index: 100;
      display: none; align-items: center; justify-content: center;
      opacity: 0;
      transition: opacity 0.18s ease;
    }

    .modal-overlay.open { display: flex; opacity: 1; }

    .modal {
      background: var(--surface);
      border-radius: var(--radius-xl);
      width: 515px;
      max-width: calc(100vw - 32px);
      max-height: calc(100vh - 64px);
      overflow-y: auto;
      box-shadow: 0 24px 64px rgba(0,0,0,0.18);
      transform: translateY(18px) scale(0.97);
      transition: transform 0.26s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    .modal-overlay.open .modal { transform: translateY(0) scale(1); }

    .modal::-webkit-scrollbar { width: 4px; }
    .modal::-webkit-scrollbar-thumb { background: var(--border-medium); border-radius: 2px; }

    .modal-header {
      display: flex; align-items: center;
      justify-content: space-between;
      padding: 20px 22px 16px;
      border-bottom: 1px solid var(--border);
      position: sticky; top: 0;
      background: var(--surface); z-index: 1;
    }

    .modal-title { font-size: 16px; font-weight: 600; color: var(--text-primary); }

    .modal-close {
      width: 28px; height: 28px; border-radius: 50%;
      background: var(--bg); border: none;
      cursor: pointer;
      display: flex; align-items: center; justify-content: center;
      transition: var(--transition); flex-shrink: 0;
    }

    .modal-close:hover { background: var(--border-medium); }

    .modal-close svg {
      width: 11px; height: 11px;
      stroke: var(--text-secondary); fill: none;
      stroke-width: 2.5; stroke-linecap: round;
    }

    .modal-body { padding: 22px; }

    .modal-footer {
      padding: 14px 22px;
      border-top: 1px solid var(--border);
      display: flex; justify-content: flex-end; gap: 9px;
      background: var(--surface);
    }

    /* ── FORMS ── */
    .form-group { margin-bottom: 16px; }

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

    .form-label {
      display: block; font-size: 12px; font-weight: 500;
      color: var(--text-secondary); margin-bottom: 5px;
      letter-spacing: 0.1px;
    }

    .form-control {
      width: 100%; padding: 9px 12px;
      border: 1.5px solid var(--border-medium);
      border-radius: var(--radius-sm);
      font-size: 13.5px; font-family: var(--font-system);
      color: var(--text-primary); background: var(--surface);
      outline: none; transition: var(--transition);
      appearance: none;
    }

    .form-control:hover { border-color: rgba(0,122,255,0.28); }

    .form-control:focus {
      border-color: var(--blue);
      box-shadow: 0 0 0 3px rgba(0,122,255,0.1);
    }

    .form-control::placeholder { color: var(--text-tertiary); }

    textarea.form-control { resize: vertical; min-height: 76px; }

    select.form-control {
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2386868B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: right 11px center;
      padding-right: 32px;
    }

    .status-select {
      min-width: 138px;
      padding-top: 6px;
      padding-bottom: 6px;
      font-size: 11.5px;
      box-shadow: none;
      background-color: white;
    }

    /* ── AVATAR COLORS ── */
    .av-blue    { background: linear-gradient(135deg, #007AFF, #5AC8FA); }
    .av-green   { background: linear-gradient(135deg, #34C759, #30D158); }
    .av-orange  { background: linear-gradient(135deg, #FF9F0A, #FF6B6B); }
    .av-purple  { background: linear-gradient(135deg, #AF52DE, #BF5AF2); }
    .av-pink    { background: linear-gradient(135deg, #FF2D55, #FF6CAE); }
    .av-teal    { background: linear-gradient(135deg, #5AC8FA, #32ADE6); }
    .av-indigo  { background: linear-gradient(135deg, #5856D6, #7D7AFF); }
    .av-red     { background: linear-gradient(135deg, #FF3B30, #FF6961); }

    /* ── TOAST ── */
    .toast-container {
      position: fixed; bottom: 22px; right: 22px;
      z-index: 200;
      display: flex; flex-direction: column; gap: 8px;
    }

    .toast {
      display: flex; align-items: center; gap: 10px;
      background: #1C1C1E; color: white;
      padding: 11px 15px;
      border-radius: 12px;
      font-size: 13px;
      box-shadow: 0 8px 28px rgba(0,0,0,0.14);
      animation: toastIn 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
      max-width: 300px;
    }

    .toast.removing { animation: toastOut 0.18s ease forwards; }

    .toast-icon {
      width: 18px; height: 18px; border-radius: 50%;
      display: flex; align-items: center; justify-content: center;
      flex-shrink: 0;
    }

    .toast-icon.success { background: var(--green); }
    .toast-icon.info    { background: var(--blue); }
    .toast-icon.error   { background: var(--red); }

    .toast-icon svg {
      width: 10px; height: 10px;
      stroke: white; fill: none;
      stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
    }

    @keyframes toastIn {
      from { opacity: 0; transform: translateX(16px) scale(0.95); }
      to   { opacity: 1; transform: translateX(0) scale(1); }
    }
    @keyframes toastOut {
      from { opacity: 1; }
      to   { opacity: 0; transform: translateX(14px); }
    }

    /* ── NOTES BOX ── */
    .notes-box {
      background: var(--bg);
      border-radius: var(--radius-md);
      padding: 13px 15px;
      font-size: 13px;
      color: var(--text-secondary);
      line-height: 1.65;
    }

    /* ── FORM VALIDATION ── */
    .field-error {
      border-color: var(--red) !important;
      box-shadow: 0 0 0 3px rgba(255,59,48,0.12) !important;
    }

    .form-error {
      font-size: 11.5px;
      color: var(--red);
      font-weight: 500;
      margin-top: 5px;
      display: flex;
      align-items: center;
      gap: 4px;
    }

    .form-error::before {
      content: '';
      display: inline-block;
      width: 12px; height: 12px;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FF3B30' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='8' x2='12' y2='12'/%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'/%3E%3C/svg%3E");
      background-size: contain;
      background-repeat: no-repeat;
      flex-shrink: 0;
    }

    /* ── APPOINTMENT TIME GROUPS ── */
    .appt-group-header {
      display: flex; align-items: center; gap: 7px;
      padding: 7px 16px 5px;
      background: var(--bg);
      border-bottom: 1px solid var(--border);
    }

    .appt-group-label {
      font-size: 10px; font-weight: 700;
      text-transform: uppercase; letter-spacing: 0.8px;
      color: var(--text-tertiary);
    }

    .appt-group-count {
      font-size: 9.5px; background: var(--border-medium);
      color: var(--text-tertiary); padding: 1px 6px;
      border-radius: 8px; font-weight: 700;
    }

    /* ── UNDO TOAST BUTTON ── */
    .toast-undo-btn {
      background: transparent;
      border: 1px solid rgba(255,255,255,0.3);
      color: white; font-size: 11.5px; font-weight: 600;
      padding: 3px 9px; border-radius: 6px;
      cursor: pointer; margin-left: 4px;
      font-family: var(--font-system);
      white-space: nowrap; flex-shrink: 0;
      transition: background 0.15s;
    }

    .toast-undo-btn:hover { background: rgba(255,255,255,0.18); }

    /* ── EXPORT/IMPORT BUTTONS ── */
    .data-actions {
      display: flex; gap: 6px; padding: 8px 8px 0;
    }

    .data-btn {
      flex: 1; display: flex; align-items: center;
      justify-content: center; gap: 5px;
      padding: 7px 8px; border-radius: 7px;
      font-size: 11px; font-weight: 500; cursor: pointer;
      border: 1px solid rgba(255,255,255,0.11);
      color: var(--text-on-dark-secondary);
      background: transparent;
      font-family: var(--font-system);
      transition: var(--transition);
    }

    .data-btn:hover {
      background: var(--sidebar-hover);
      color: var(--text-on-dark);
      border-color: rgba(255,255,255,0.2);
    }

    .data-btn svg {
      width: 11px; height: 11px;
      stroke: currentColor; fill: none;
      stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
    }

    /* ── ARCHIVED STATES ── */
    .archived-banner {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 5px 11px;
      background: var(--orange-light);
      color: var(--orange);
      border-radius: 8px;
      font-size: 12px;
      font-weight: 500;
    }

    /* ── DEMO BANNER ── */
    #demo-banner {
      display: flex; align-items: center; gap: 10px;
      padding: 7px 24px; flex-shrink: 0;
      background: var(--orange-light); color: var(--orange);
      font-size: 12.5px; font-weight: 500;
      border-bottom: 1px solid rgba(255,159,10,0.2);
    }
    #demo-banner button {
      margin-left: auto;
      padding: 4px 11px; border-radius: 6px;
      background: var(--orange); color: white;
      border: none; font-size: 12px; font-weight: 500; cursor: pointer;
      font-family: inherit;
    }
    #demo-banner button:hover { opacity: 0.88; }

    /* ── DEV MODE WIDGET ── */
    #dev-mode-widget {
      position: fixed;
      right: 18px;
      bottom: 18px;
      z-index: 1200;
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 8px 12px;
      background: var(--sidebar-bg);
      border: 1px dashed rgba(255,255,255,0.25);
      border-radius: var(--radius-md);
      box-shadow: var(--shadow-lg);
      font-family: inherit;
    }
    #dev-mode-widget .dev-widget-label {
      color: var(--text-on-dark-secondary);
      font-size: 11px;
      font-weight: 600;
      letter-spacing: 0.06em;
      text-transform: uppercase;
    }
    #dev-mode-widget button {
      padding: 6px 12px;
      border-radius: 6px;
      border: none;
      background: var(--accent);
      color: #1C1C1E;
      font-size: 12.5px;
      font-weight: 600;
      cursor: pointer;
      font-family: inherit;
    }
    #dev-mode-widget button:hover { opacity: 0.88; }

    .mobile-bottom-nav { display: none; }

    /* ── RESPONSIVE ── */
    @media (max-width: 960px) {
      .stats-grid { grid-template-columns: repeat(2,1fr); }
      .dashboard-grid { grid-template-columns: 1fr; }
    }

    @media (max-width: 760px) {
      html, body { height: auto; min-height: 100%; }

      .app {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        overflow: visible;
      }

      .mobile-bottom-nav {
        position: fixed;
        z-index: 50;
        right: 0;
        bottom: 0;
        left: 0;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        min-height: 64px;
        padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
        border-top: 1px solid rgba(255,255,255,.12);
        background: rgba(14, 15, 26, .96);
        backdrop-filter: blur(12px);
      }

      .mobile-bottom-item {
        display: grid;
        place-items: center;
        gap: 2px;
        min-height: 44px;
        border: 0;
        border-radius: 8px;
        background: transparent;
        color: rgba(255,255,255,.62);
        font: inherit;
        font-size: 10px;
        cursor: pointer;
      }

      .mobile-bottom-item span:first-child { font-size: 19px; line-height: 1; }
      .mobile-bottom-item.active { color: #E8C97B; background: rgba(200,167,90,.14); }
      .main { padding-bottom: 76px; }

      .sidebar { width: 100%; }
      .sidebar-logo { padding: 16px; }

      .sidebar-nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        padding: 12px;
      }

      .nav-section-label { display: none; }
      .nav-item { margin-bottom: 0; min-height: 42px; }

      .sidebar-footer {
        padding: 0 12px 14px;
        border-top: none;
      }

      .studio-info {
        border: 1px solid rgba(255,255,255,0.08);
        background: rgba(255,255,255,0.03);
      }

      .topbar {
        height: auto;
        padding: 16px;
        flex-wrap: wrap;
      }

      .topbar-title { width: 100%; }

      .search-wrap {
        width: 100%;
        flex: 1 1 100%;
        order: 3;
      }

      .topbar > .btn {
        width: 100%;
        justify-content: center;
      }

      .content { padding: 16px; }
      .stats-grid,
      .detail-stats,
      .form-row,
      .customers-grid { grid-template-columns: 1fr; }

      .filter-bar {
        align-items: stretch;
        gap: 8px;
      }

      .filter-bar .btn {
        width: 100%;
        margin-left: 0 !important;
        justify-content: center;
      }

      .detail-header { padding: 20px; }

      .detail-actions {
        width: 100%;
        margin-left: 0;
        flex-wrap: wrap;
      }

      .detail-actions .btn {
        flex: 1 1 100%;
        justify-content: center;
      }

      .timeline-item {
        flex-wrap: wrap;
        padding: 16px;
      }

      .timeline-date-col {
        width: auto;
        display: flex;
        align-items: baseline;
        gap: 8px;
      }

      .timeline-divider { display: none; }

      .timeline-actions {
        width: 100%;
        margin-left: 0;
        justify-content: flex-start;
      }

      .appt-right {
        width: 100%;
        align-items: flex-start;
      }

      .appt-item {
        flex-wrap: wrap;
      }

      .appt-open {
        flex: 1 1 100%;
        min-width: 0;
      }

      .appt-actions-inline {
        justify-content: flex-start;
      }

      .status-select {
        min-width: 100%;
      }

      .modal {
        width: calc(100vw - 20px);
        max-height: calc(100vh - 24px);
      }

      .modal-header,
      .modal-body,
      .modal-footer {
        padding-left: 16px;
        padding-right: 16px;
      }
    }

/* ── utility classes used by JS render ── */

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

.card--today { margin-bottom: 20px; }

.list-empty-hint { padding: 18px 20px; text-align: center; color: var(--text-tertiary); font-size: 12.5px; }

.empty-state--fullcol { grid-column: 1 / -1; }
.empty-state--padded { padding: 36px 20px; }

.btn--ml-auto { margin-left: auto; }
.btn--danger { color: var(--red); }

.appt-time--bold { font-weight: 600; color: var(--text-primary); }

.stat-value--price { font-size: 22px; }

.detail-nav { margin-bottom: 16px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.btn-back { padding: 6px 10px; gap: 5px; }
.btn-back svg { width: 13px; height: 13px; }

.detail-header-body { flex: 1; min-width: 0; }

.card-body { padding: 14px 20px; }
.card--notes { margin-bottom: 18px; }

.customer-stat-value--sm { font-size: 11px; }

.timeline-notes { font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; line-height: 1.5; }
.timeline-pricing { display: flex; align-items: center; gap: 10px; }
.timeline-deposit { font-size: 11.5px; color: var(--text-secondary); }

.signal-chip--inprog { background: #FEF3C7; color: #B45309; }
.signal-chip--next   { background: var(--blue-light); color: #0066CC; }
.signal-chip--risk   { background: var(--red-light); color: var(--red); }
.signal-chip--debt   { background: var(--orange-light); color: #B45309; }
.signal-chip--vip    { background: var(--accent-light); color: #8A6A1E; }

.customer-card--archived { opacity: 0.65; }

@keyframes highlightPulse {
  0% { background: rgba(0, 122, 255, 0.25); }
  100% { background: transparent; }
}

.timeline-item.highlight-pulse {
  animation: highlightPulse 2s ease-out;
  border-left: 3px solid var(--primary, #007aff) !important;
}

/* ── NOW / NEXT STRIP ── */
.now-strip {
  display: flex; align-items: stretch; gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
  overflow: hidden;
}

.now-block {
  flex: 1; min-width: 0;
  padding: 13px 16px;
  display: flex; flex-direction: column; gap: 6px;
}

.now-label {
  font-size: 12px; font-weight: 600;
  color: var(--text-tertiary);
}

.now-divider {
  width: 1px; background: var(--border);
  flex-shrink: 0;
}

.now-row {
  display: flex; align-items: center; gap: 10px;
  min-width: 0;
}

.now-avatar {
  width: 30px; height: 30px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: white;
  flex-shrink: 0;
}

.now-info { min-width: 0; }

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

.now-detail {
  font-size: 11px; color: var(--text-secondary);
  margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.now-empty {
  font-size: 12px; color: var(--text-tertiary);
}

/* ── ACTION REQUIRED CARD ── */
.card--actions { margin-bottom: 18px; }

.action-list { display: flex; flex-direction: column; }

.action-section { border-bottom: 1px solid var(--border); }
.action-section:last-child { border-bottom: none; }
.action-section[style*="display: none"] { display: none !important; }

.action-section-title {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.5px; text-transform: uppercase;
  color: var(--text-tertiary);
  padding: 9px 16px 0;
}

.action-clear {
  padding: 14px 16px;
  font-size: 12px;
  color: var(--green);
  background: var(--green-light);
  display: flex; align-items: center; gap: 6px;
}

.action-clear[hidden] { display: none; }

/* ── COMPACT COUNTERS ── */
.stats-grid--compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 0;
}

/* ── DATA MANAGEMENT VIEW ── */
.data-view-hint {
  font-size: 12.5px; color: var(--text-secondary);
  margin-bottom: 14px; line-height: 1.5;
}

.data-view-actions {
  display: flex; flex-wrap: wrap; gap: 10px;
}

/* ── CUSTOMER SUGGEST (appointment modal) ── */
.form-group--suggest { position: relative; }

.customer-suggest {
  display: none;
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  z-index: 50;
  background: var(--surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 220px;
  overflow-y: auto;
}

.customer-suggest.open { display: block; }

.customer-suggest-item {
  display: flex; align-items: center; gap: 9px;
  width: 100%; text-align: left;
  padding: 9px 12px;
  background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: 13px; color: var(--text-primary);
}

.customer-suggest-item:hover,
.customer-suggest-item.active { background: var(--bg); }

.customer-suggest-avatar {
  width: 26px; height: 26px;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: white;
  flex-shrink: 0;
}

.customer-suggest-name {
  flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-weight: 500;
}

.customer-suggest-phone {
  font-size: 11px; color: var(--text-tertiary);
  white-space: nowrap;
}

.customer-suggest-empty {
  padding: 12px; font-size: 12px; color: var(--text-tertiary);
  text-align: center;
}

/* ── AGENDA INLINE ACTIONS ── */
.btn-success { background: var(--green); color: white; }
.btn-success:hover { background: #2AA248; transform: translateY(-1px); }

.agenda-actions {
  display: flex; align-items: center; gap: 5px;
  flex-shrink: 0;
}

    /* ── FOCUS VISIBILITY (2.4.7) ── */
    a:focus-visible,
    button:focus-visible,
    input:focus-visible,
    select:focus-visible,
    textarea:focus-visible,
    [tabindex]:focus-visible {
      outline: 2px solid var(--blue);
      outline-offset: 2px;
    }

    .status-select:focus-visible {
      outline: 2px solid var(--blue);
      outline-offset: 1px;
    }

    .form-warning {
      margin-top: 14px;
      padding: 10px 12px;
      border-radius: var(--radius-sm);
      background: var(--orange-light);
      color: var(--orange);
      font-size: 12.5px; font-weight: 500;
      line-height: 1.45;
    }

    .readiness-fieldset {
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 10px 12px 12px;
      margin: 14px 0 0;
    }
    .readiness-fieldset legend { padding: 0 4px; }
    .check-row {
      display: flex; align-items: center; gap: 8px;
      margin-top: 8px; font-size: 12.5px; color: var(--text-secondary);
    }
    .check-row input { width: 16px; height: 16px; accent-color: var(--blue); }
    .readiness-badge {
      display: inline-flex; align-items: center;
      border-radius: 999px; padding: 3px 7px;
      background: var(--orange-light); color: var(--orange);
      font-size: 10.5px; font-weight: 600; white-space: nowrap;
    }
    .readiness-badge--ready { background: var(--green-light); color: var(--green); }

    .modal--narrow { width: 430px; }

    .onboarding-text {
      font-size: 13.5px;
      line-height: 1.55;
      color: var(--text-secondary);
    }

    /* ── TARGET SIZE (2.5.8) — every control is at least 24×24 ── */
    .btn,
    .btn-sm,
    .card-action,
    .filter-chip,
    .modal-close,
    .status-select,
    .toast-undo-btn,
    #demo-banner button,
    .nav-item {
      min-height: 24px;
      min-width: 24px;
    }

    .modal-close { width: 28px; height: 28px; }
    .search-input { min-height: 24px; }
    .card-action { padding: 4px 6px; }
    .toast-undo-btn { padding: 4px 8px; }
    #demo-banner button { padding: 5px 12px; }

    .signal-chip--archived {
      background: var(--border-medium);
      color: var(--text-primary);
      font-weight: 600;
    }

    .shortcut-list { list-style: none; display: grid; gap: 8px; }

    .shortcut-list li {
      display: flex; align-items: center; gap: 8px;
      font-size: 12.5px; color: var(--text-secondary);
    }

    .shortcut-list kbd {
      font-family: var(--font-system);
      font-size: 11px; font-weight: 600;
      color: var(--text-primary);
      background: var(--bg);
      border: 1px solid var(--border-medium);
      border-radius: 5px;
      padding: 2px 6px;
      min-width: 22px; text-align: center;
    }

    /* ── REDUCED MOTION (2.3.3) ── */
    @media (prefers-reduced-motion: reduce) {
      *, *::before, *::after {
        animation-duration: 0s !important;
        animation-delay: 0s !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0s !important;
        transition-delay: 0s !important;
        scroll-behavior: auto !important;
      }
    }
/* API mode authentication gate */
.api-auth-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(28, 28, 30, .72);
  backdrop-filter: blur(8px);
}

.api-auth-card {
  width: min(100%, 420px);
  display: grid;
  gap: 10px;
  padding: 32px;
  border-radius: 20px;
  background: var(--surface, #fff);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .25);
}

.api-auth-card h2 { margin: 8px 0 0; }
.api-auth-copy { margin: 0 0 12px; color: var(--text-secondary, #6b6b70); }
.api-auth-card .btn { min-height: 44px; margin-top: 12px; }
.api-auth-error { color: #b42318; font-size: .9rem; }
.api-auth-toggle { border: 0; background: transparent; color: var(--accent, #007aff); cursor: pointer; padding: 8px; }

@media (max-width: 768px) {
  .btn, .nav-item, .filter-chip, .card-action, .icon-btn,
  .modal-close, .toast-undo-btn, .status-select {
    min-height: 44px;
  }
}

/* Calendar */
.calendar-toolbar { align-items: center; }
.calendar-range-label { font-weight: 650; color: var(--text, #1c1c1e); }
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--border, #e5e5ea);
  border-radius: 14px;
  background: var(--border, #e5e5ea);
}
.calendar-weekday { padding: 12px 10px; background: var(--surface, #fff); color: var(--text-secondary, #6b6b70); font-size: .78rem; font-weight: 700; text-transform: uppercase; }
.calendar-day { min-height: 128px; padding: 8px; background: var(--surface, #fff); }
.calendar-day--outside { background: color-mix(in srgb, var(--surface, #fff) 86%, var(--border, #e5e5ea)); }
.calendar-day--today { box-shadow: inset 0 0 0 2px var(--accent, #007aff); }
.calendar-day-number { margin-bottom: 6px; font-weight: 700; }
.calendar-day--today .calendar-day-number { color: #866b20; }
.calendar-day-empty { min-height: 18px; }
.calendar-event { display: flex; width: 100%; gap: 5px; margin: 4px 0; padding: 6px; border: 0; border-left: 3px solid var(--accent, #007aff); border-radius: 6px; background: #f2f2f7; color: #1c1c1e; text-align: left; cursor: pointer; font: inherit; }
.calendar-event:hover, .calendar-event:focus-visible { outline: 2px solid var(--accent, #007aff); outline-offset: 1px; }
.calendar-event-time { flex: 0 0 auto; font-size: .72rem; font-weight: 700; }
.calendar-event-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .76rem; }
.calendar-event--completed { border-left-color: #34c759; }
.calendar-event--cancelled, .calendar-event--no_show { border-left-color: #ff3b30; opacity: .7; }
.calendar-event--inprogress { border-left-color: #ff9500; }

.operations-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.operation-form { display: grid; gap: 8px; margin-bottom: 20px; }
.operations-list { display: grid; gap: 8px; }
.operation-loading { padding: 18px 0; color: var(--text-secondary, #5f6370); }
.operation-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border, #e5e5ea); }
.operation-row > div { min-width: 0; }
.operation-meta { display: block; margin-top: 3px; color: var(--text-secondary, #5f6370); font-size: .82rem; }
.operation-status { width: auto; min-width: 150px; }
.schedule-table { display: grid; gap: 8px; margin: 8px 0; }
.schedule-row { display: grid; grid-template-columns: minmax(130px, 1fr) 110px 110px; align-items: center; gap: 8px; }
.schedule-row label { display: flex; align-items: center; gap: 8px; font-size: .88rem; }
.activity-form { display: grid; grid-template-columns: 150px 1fr auto; gap: 8px; align-items: start; margin-bottom: 16px; }
.activity-form textarea { min-width: 0; }
.activity-list { display: grid; gap: 8px; }
.activity-item { padding: 10px 12px; border: 1px solid var(--border, #e5e5ea); border-radius: 8px; }
.activity-item-meta { margin-bottom: 4px; color: var(--text-secondary, #5f6370); font-size: .78rem; }

@media (max-width: 768px) {
  .calendar-day { min-height: 96px; padding: 5px; }
  .calendar-weekday { padding: 8px 4px; font-size: .68rem; text-align: center; }
  .calendar-event { display: block; padding: 5px 4px; }
  .calendar-event-time, .calendar-event-title { display: block; font-size: .68rem; }
  .operations-grid { grid-template-columns: 1fr; }
  .schedule-row { grid-template-columns: minmax(100px, 1fr) 1fr 1fr; }
  .operation-row { align-items: flex-start; flex-direction: column; }
  .operation-status { width: 100%; }
  .activity-form { grid-template-columns: 1fr; }
}
