
    .admin-page {
      background:
        radial-gradient(circle at 8% 6%, rgba(20, 184, 166, 0.18), transparent 28%),
        radial-gradient(circle at 92% 10%, rgba(124, 58, 237, 0.15), transparent 30%),
        linear-gradient(180deg, #f8fbff 0%, #eef6ff 48%, #f7f3ff 100%);
    }

    .admin-login-hero {
      position: relative;
      overflow: hidden;
      max-width: 520px;
      margin: 48px auto;
      padding: 34px;
      color: #ffffff;
      background:
        radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.36), transparent 24%),
        radial-gradient(circle at 86% 12%, rgba(253, 224, 71, 0.48), transparent 24%),
        linear-gradient(135deg, #0f766e 0%, #2563eb 46%, #7c3aed 100%);
      border: 0;
      box-shadow: 0 24px 58px rgba(37, 99, 235, 0.24);
    }

    .admin-login-hero:after {
      content: "";
      position: absolute;
      right: -70px;
      bottom: -86px;
      width: 240px;
      height: 240px;
      border-radius: 50%;
      background: rgba(255, 255, 255, 0.14);
      border: 34px solid rgba(255, 255, 255, 0.12);
    }

    .admin-login-hero > * {
      position: relative;
      z-index: 1;
    }

    .admin-login-hero h1 {
      margin-top: 0;
      color: #ffffff;
      font-size: 32px;
      line-height: 1.25;
      text-shadow: 0 2px 18px rgba(15, 23, 42, 0.22);
    }

    .admin-login-hero .muted,
    .admin-login-hero label {
      color: #eff6ff;
      font-weight: 700;
    }

    .admin-login-form {
      margin-top: 20px;
      padding: 14px;
      border-radius: 22px;
      background: rgba(255, 255, 255, 0.18);
      border: 1px solid rgba(255, 255, 255, 0.28);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
      backdrop-filter: blur(8px);
    }

    .admin-login-form .input {
      min-height: 48px;
      border: 0;
      background: #ffffff;
      box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
    }

    .remember-login-option {
      align-items: center;
      cursor: pointer;
      display: inline-flex;
      gap: 10px;
      margin-top: 14px;
      user-select: none;
    }

    .remember-login-option input {
      accent-color: #2563eb;
      height: 18px;
      width: 18px;
    }

    .admin-login-form .btn {
      min-height: 48px;
      border-color: rgba(255, 255, 255, 0.24);
      box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
    }

    .admin-main-hero {
      position: relative;
      overflow: hidden;
      color: #ffffff;
      background:
        radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.34), transparent 24%),
        radial-gradient(circle at 86% 12%, rgba(253, 224, 71, 0.46), transparent 24%),
        linear-gradient(135deg, #0f766e 0%, #2563eb 46%, #7c3aed 100%);
      border: 0;
      box-shadow: 0 24px 58px rgba(37, 99, 235, 0.22);
    }

    .admin-main-hero:after {
      content: "";
      position: absolute;
      right: -74px;
      bottom: -90px;
      width: 250px;
      height: 250px;
      border-radius: 50%;
      background: rgba(255, 255, 255, 0.14);
      border: 36px solid rgba(255, 255, 255, 0.12);
    }

    .admin-main-hero > * {
      position: relative;
      z-index: 1;
    }

    .admin-main-hero h1,
    .admin-main-hero .muted {
      color: #ffffff;
    }

    .admin-main-hero .muted {
      color: #eff6ff;
      font-weight: 700;
    }

    .admin-page .panel:not(.admin-login-hero):not(.admin-main-hero) {
      background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(241, 248, 255, 0.97) 100%);
      border-color: rgba(96, 165, 250, 0.24);
      box-shadow: 0 18px 42px rgba(37, 99, 235, 0.08);
    }

    .admin-page .card,
    .admin-page .edit-card,
    .admin-page .status-panel {
      background:
        linear-gradient(180deg, #ffffff 0%, #f0fdfa 100%);
      border-color: rgba(20, 184, 166, 0.22);
      box-shadow: 0 12px 28px rgba(15, 118, 110, 0.08);
    }

    .admin-page .card strong,
    .admin-page .edit-card label {
      color: #0f766e;
    }

    .admin-page .subnav a,
    .admin-page .status-filters a {
      background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
      border-color: rgba(96, 165, 250, 0.28);
      color: #1d4ed8;
      box-shadow: 0 10px 22px rgba(37, 99, 235, 0.08);
    }

    .admin-main-hero .subnav a {
      background: rgba(255, 255, 255, 0.18);
      border-color: rgba(255, 255, 255, 0.28);
      color: #ffffff;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
    }

    .admin-page .admin-main-hero .admin-subnav a {
      display: grid !important;
      grid-template-columns: 38px minmax(0, 1fr) auto !important;
      justify-content: stretch !important;
      justify-items: start !important;
      text-align: left !important;
    }

    .admin-page .admin-main-hero .admin-subnav .admin-menu-icon,
    .admin-page .admin-main-hero .admin-subnav .admin-menu-label {
      justify-self: start !important;
      text-align: left !important;
    }

    .admin-page .admin-main-hero .admin-subnav .menu-badge {
      justify-self: end !important;
    }

    .admin-page .subnav a.active,
    .admin-page .status-filters a.active {
      background: linear-gradient(135deg, #14b8a6 0%, #2563eb 52%, #7c3aed 100%);
      color: #ffffff;
      border-color: transparent;
      box-shadow: 0 14px 28px rgba(37, 99, 235, 0.20);
    }

    .repair-history-panel {
      background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(245, 250, 255, 0.98) 100%) !important;
      border-color: rgba(37, 99, 235, 0.22) !important;
    }

    .repair-history-head {
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      gap: 14px;
      align-items: start;
      padding-bottom: 18px;
      border-bottom: 1px solid rgba(37, 99, 235, 0.12);
    }

    .repair-history-head h2 {
      color: #0f172a;
      font-size: 28px;
      font-weight: 900;
    }

    .repair-history-panel .history-search-input {
      width: 100%;
      min-width: 0;
      border-color: rgba(37, 99, 235, 0.28);
      box-shadow: 0 10px 22px rgba(37, 99, 235, 0.08);
    }

    .repair-history-head > form.actions {
      display: grid;
      grid-template-columns: minmax(280px, 640px) auto auto;
      gap: 10px;
      align-items: center;
      justify-content: start;
      width: 100%;
      min-width: 0;
    }

    .repair-history-filter-board {
      display: grid;
      grid-template-columns: minmax(0, 1.16fr) minmax(0, 1fr) minmax(220px, 0.54fr);
      gap: 14px;
      margin: 16px 0 18px;
    }

    .repair-history-filter-group {
      position: relative;
      padding: 14px 12px 12px;
      border-radius: 16px;
      background:
        radial-gradient(circle at 8% 0%, rgba(45, 212, 191, 0.18), transparent 36%),
        linear-gradient(180deg, #f8fcff 0%, #eef8ff 100%);
      border: 1px solid rgba(59, 130, 246, 0.30);
      box-shadow: 0 12px 26px rgba(37, 99, 235, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.86);
    }

    .repair-history-filter-all {
      display: grid;
      grid-template-rows: auto 1fr;
    }

    .repair-history-filter-all .repair-history-filters {
      align-content: center;
      align-items: center;
      justify-content: center;
      min-height: 76px;
      width: 100%;
    }

    .repair-history-filter-all .history-status-all {
      width: 100%;
      max-width: 100%;
    }

    .repair-history-filter-label {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      margin: 0 0 10px;
      padding: 6px 11px;
      border-radius: 999px;
      color: #0f2f4f;
      background: linear-gradient(135deg, #ffffff 0%, #e0f2fe 100%);
      border: 1px solid rgba(37, 99, 235, 0.28);
      box-shadow: 0 7px 16px rgba(37, 99, 235, 0.10);
      font-size: 14px;
      font-weight: 900;
      letter-spacing: 0;
    }

    .repair-history-filter-label:before {
      content: "";
      width: 7px;
      height: 7px;
      border-radius: 999px;
      background: #0f766e;
      box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.14);
    }

    .repair-history-filters {
      margin: 0;
      gap: 9px;
    }

    .admin-page .repair-history-filters .history-status-chip {
      position: relative;
      min-height: 54px;
      padding: 11px 13px 11px 16px;
      border-radius: 12px;
      overflow: hidden;
      background: linear-gradient(135deg, var(--history-bg-1, #ffffff) 0%, var(--history-bg-2, #eff6ff) 100%);
      color: #0f172a;
      border: 1px solid var(--history-border, rgba(96, 165, 250, 0.24));
      box-shadow: 0 9px 18px var(--history-shadow, rgba(37, 99, 235, 0.08));
      font-size: 15px;
      font-weight: 900;
      transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    }

    .admin-page .repair-history-filters .history-status-chip:hover {
      transform: translateY(-1px);
      box-shadow: 0 16px 28px var(--history-shadow, rgba(37, 99, 235, 0.14));
    }

    .admin-page .repair-history-filters .history-status-chip:before {
      content: "";
      position: absolute;
      left: 0;
      top: 0;
      bottom: 0;
      width: 6px;
      background: var(--history-accent, #64748b);
      box-shadow: 0 0 16px var(--history-accent, #64748b);
    }

    .admin-page .repair-history-filters .history-status-chip .menu-badge {
      min-width: 38px;
      height: 26px;
      padding: 3px 10px;
      background: var(--history-accent, #0f172a);
      color: #ffffff;
      font-size: 14px;
      font-weight: 900;
      box-shadow: 0 6px 14px var(--history-shadow, rgba(15, 23, 42, 0.16)), inset 0 0 0 1px rgba(255, 255, 255, 0.20);
    }

    .admin-page .repair-history-filters .history-status-chip.active {
      color: #ffffff;
      border-color: transparent;
      box-shadow: 0 12px 24px rgba(15, 23, 42, 0.18);
    }

    .admin-page .repair-history-filters .history-status-chip.active:before {
      background: rgba(255, 255, 255, 0.5);
    }

    .admin-page .repair-history-filters .history-status-chip.active .menu-badge {
      background: rgba(15, 23, 42, 0.72);
    }

    .history-status-pending { --history-accent: #f97316; --history-bg-1: #fff7ed; --history-bg-2: #ffedd5; --history-border: rgba(249, 115, 22, 0.30); --history-shadow: rgba(249, 115, 22, 0.14); }
    .history-status-confirmed { --history-accent: #2563eb; --history-bg-1: #eff6ff; --history-bg-2: #dbeafe; --history-border: rgba(37, 99, 235, 0.28); --history-shadow: rgba(37, 99, 235, 0.14); }
    .history-status-repair_confirmed { --history-accent: #7c3aed; --history-bg-1: #f5f3ff; --history-bg-2: #ede9fe; --history-border: rgba(124, 58, 237, 0.28); --history-shadow: rgba(124, 58, 237, 0.13); }
    .history-status-repairing { --history-accent: #e11d48; --history-bg-1: #fff1f2; --history-bg-2: #ffe4e6; --history-border: rgba(225, 29, 72, 0.28); --history-shadow: rgba(225, 29, 72, 0.13); }
    .history-status-completed { --history-accent: #059669; --history-bg-1: #ecfdf5; --history-bg-2: #d1fae5; --history-border: rgba(5, 150, 105, 0.26); --history-shadow: rgba(5, 150, 105, 0.12); }
    .history-status-payment_pending { --history-accent: #d97706; --history-bg-1: #fffbeb; --history-bg-2: #fef3c7; --history-border: rgba(217, 119, 6, 0.28); --history-shadow: rgba(217, 119, 6, 0.13); }
    .history-status-paid { --history-accent: #16a34a; --history-bg-1: #f0fdf4; --history-bg-2: #dcfce7; --history-border: rgba(22, 163, 74, 0.26); --history-shadow: rgba(22, 163, 74, 0.12); }
    .history-status-delivered { --history-accent: #334155; --history-bg-1: #f8fafc; --history-bg-2: #e2e8f0; --history-border: rgba(51, 65, 85, 0.22); --history-shadow: rgba(51, 65, 85, 0.11); }
    .history-status-cancelled { --history-accent: #dc2626; --history-bg-1: #fef2f2; --history-bg-2: #fee2e2; --history-border: rgba(220, 38, 38, 0.26); --history-shadow: rgba(220, 38, 38, 0.13); }
    .history-status-all { --history-accent: #0891b2; --history-bg-1: #ecfeff; --history-bg-2: #dbeafe; --history-border: rgba(8, 145, 178, 0.26); --history-shadow: rgba(8, 145, 178, 0.13); }

    .admin-page .repair-history-filters .history-status-pending.active { background: linear-gradient(135deg, #f97316 0%, #c2410c 100%); }
    .admin-page .repair-history-filters .history-status-confirmed.active { background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%); }
    .admin-page .repair-history-filters .history-status-repair_confirmed.active { background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%); }
    .admin-page .repair-history-filters .history-status-repairing.active { background: linear-gradient(135deg, #e11d48 0%, #9f1239 100%); }
    .admin-page .repair-history-filters .history-status-completed.active { background: linear-gradient(135deg, #10b981 0%, #047857 100%); }
    .admin-page .repair-history-filters .history-status-payment_pending.active { background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%); }
    .admin-page .repair-history-filters .history-status-paid.active { background: linear-gradient(135deg, #22c55e 0%, #15803d 100%); }
    .admin-page .repair-history-filters .history-status-delivered.active { background: linear-gradient(135deg, #475569 0%, #0f172a 100%); }
    .admin-page .repair-history-filters .history-status-cancelled.active { background: linear-gradient(135deg, #ef4444 0%, #991b1b 100%); }
    .admin-page .repair-history-filters .history-status-all.active { background: linear-gradient(135deg, #0891b2 0%, #4f46e5 100%); }

    .admin-page table {
      overflow: hidden;
      border-radius: 18px;
      border-collapse: separate;
      border-spacing: 0;
      background: #ffffff;
      box-shadow: 0 14px 34px rgba(37, 99, 235, 0.08);
    }

    .admin-page th {
      background: linear-gradient(135deg, #0f766e 0%, #2563eb 100%);
      color: #ffffff;
      border-color: rgba(255, 255, 255, 0.18);
    }

    .admin-page td {
      border-color: #dbeafe;
    }

    .admin-page tr:nth-child(even) td {
      background: #f8fbff;
    }

    .admin-page .input,
    .admin-page select.input,
    .admin-page textarea.input {
      border-color: rgba(96, 165, 250, 0.34);
      background: #ffffff;
      box-shadow: 0 8px 20px rgba(37, 99, 235, 0.06);
    }

    .admin-page .input:focus,
    .admin-page select.input:focus,
    .admin-page textarea.input:focus {
      border-color: #14b8a6;
      box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.14);
      outline: none;
    }

    .admin-page .btn {
      box-shadow: 0 10px 22px rgba(37, 99, 235, 0.14);
    }

    .admin-page .btn.light,
    .admin-page .btn.secondary {
      background: linear-gradient(135deg, #eff6ff 0%, #ecfeff 100%);
      color: #1d4ed8;
      border-color: rgba(96, 165, 250, 0.34);
    }

    .admin-page .dashboard-hero-main,
    .admin-page .edit-order-hero {
      background:
        radial-gradient(circle at top right, rgba(253, 224, 71, 0.26), transparent 32%),
        linear-gradient(135deg, #ecfeff 0%, #eff6ff 52%, #f5f3ff 100%);
      border-color: rgba(20, 184, 166, 0.22);
    }

    .admin-page .dashboard-hero {
      align-items: stretch;
    }

    .admin-page .dashboard-hero-main {
      position: relative;
      overflow: hidden;
      color: #ffffff;
      background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.86) 0%, rgba(14, 116, 144, 0.84) 42%, rgba(79, 70, 229, 0.88) 100%),
        linear-gradient(135deg, #0f766e 0%, #2563eb 58%, #7c3aed 100%) !important;
      border: 0;
      box-shadow: 0 24px 54px rgba(37, 99, 235, 0.22);
    }

    .admin-page .dashboard-hero-main h2,
    .admin-page .dashboard-hero-main .muted,
    .admin-page .dashboard-hero-main .dashboard-kicker {
      color: #ffffff;
    }

    .admin-page .dashboard-hero-main .muted {
      color: #dff7ff;
      font-weight: 800;
    }

    .admin-page .dashboard-kicker {
      display: inline-flex;
      width: fit-content;
      padding: 7px 12px;
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.14);
      border: 1px solid rgba(255, 255, 255, 0.2);
      color: #ffffff;
    }

    .admin-page .dashboard-pill,
    .admin-page .summary-line,
    .admin-page .edit-summary-chip {
      background: linear-gradient(135deg, #ecfeff 0%, #eff6ff 100%);
      border-color: rgba(20, 184, 166, 0.24);
    }

    .admin-page .dashboard-hero-main .dashboard-pill {
      background: rgba(255, 255, 255, 0.13);
      border-color: rgba(255, 255, 255, 0.22);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
    }

    .admin-page .dashboard-hero-main .dashboard-pill span,
    .admin-page .dashboard-hero-main .dashboard-pill strong {
      color: #ffffff;
    }

    .admin-page .dashboard-hero-side.panel {
      background:
        linear-gradient(180deg, #ffffff 0%, #ecfeff 100%) !important;
      border-color: rgba(8, 145, 178, 0.24) !important;
    }

    .admin-page .dashboard-ring-card {
      min-height: 100%;
      border-radius: 18px;
      background:
        radial-gradient(circle at center, rgba(34, 211, 238, 0.22), transparent 58%),
        linear-gradient(135deg, #0e7490 0%, #2563eb 56%, #4f46e5 100%);
      color: #ffffff;
      border: 1px solid rgba(255, 255, 255, 0.2);
      box-shadow: 0 18px 34px rgba(37, 99, 235, 0.22);
    }

    .admin-page .ring-label,
    .admin-page .ring-note,
    .admin-page .ring-value {
      color: #ffffff;
    }

    .admin-page .dashboard-metrics {
      align-items: stretch;
    }

    .admin-page .metric-card {
      position: relative;
      overflow: hidden;
      min-height: 136px;
      border-radius: 18px;
      border: 1px solid rgba(148, 163, 184, 0.2);
      box-shadow: 0 16px 34px rgba(15, 23, 42, 0.1);
    }

    .admin-page .metric-card:before {
      content: "";
      position: absolute;
      inset: 0 auto 0 0;
      width: 6px;
      background: var(--metric-accent, #2563eb);
    }

    .admin-page .metric-card .metric-title,
    .admin-page .metric-card .metric-value,
    .admin-page .metric-card .metric-foot {
      position: relative;
      z-index: 1;
    }

    .admin-page .metric-card .metric-title {
      color: var(--metric-title, #334155);
      font-weight: 900;
    }

    .admin-page .metric-card .metric-value {
      color: var(--metric-value, #0f172a);
      font-size: clamp(24px, 2.4vw, 34px);
      line-height: 1.12;
    }

    .admin-page .metric-card .metric-foot {
      color: var(--metric-foot, #64748b);
      font-weight: 700;
    }

    .metric-income {
      --metric-accent: #0284c7;
      --metric-title: #075985;
      --metric-value: #0c4a6e;
      background: linear-gradient(180deg, #ffffff 0%, #e0f2fe 100%) !important;
    }

    .metric-profit {
      --metric-accent: #059669;
      --metric-title: #047857;
      --metric-value: #064e3b;
      background: linear-gradient(180deg, #ffffff 0%, #dcfce7 100%) !important;
    }

    .metric-average {
      --metric-accent: #4f46e5;
      --metric-title: #4338ca;
      --metric-value: #312e81;
      background: linear-gradient(180deg, #ffffff 0%, #eef2ff 100%) !important;
    }

    .metric-cost {
      --metric-accent: #b45309;
      --metric-title: #92400e;
      --metric-value: #78350f;
      background: linear-gradient(180deg, #ffffff 0%, #fef3c7 100%) !important;
    }

    .metric-expense {
      --metric-accent: #dc2626;
      --metric-title: #b91c1c;
      --metric-value: #7f1d1d;
      background: linear-gradient(180deg, #ffffff 0%, #fee2e2 100%) !important;
    }

    .metric-stock,
    .metric-stock-value {
      --metric-accent: #0d9488;
      --metric-title: #0f766e;
      --metric-value: #134e4a;
      background: linear-gradient(180deg, #ffffff 0%, #ccfbf1 100%) !important;
    }

    .metric-alert {
      --metric-accent: #e11d48;
      --metric-title: #be123c;
      --metric-value: #881337;
      background: linear-gradient(180deg, #ffffff 0%, #ffe4e6 100%) !important;
    }

    .metric-ok {
      --metric-accent: #16a34a;
      --metric-title: #15803d;
      --metric-value: #14532d;
      background: linear-gradient(180deg, #ffffff 0%, #dcfce7 100%) !important;
    }

    .admin-page .chart-card {
      background:
        linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
      border-color: rgba(37, 99, 235, 0.18) !important;
    }

    .finance-overview-top {
      margin: 0 0 24px;
      padding: 24px;
      border-radius: 22px;
      border: 1px solid rgba(96, 165, 250, 0.22);
      background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
      box-shadow: 0 18px 42px rgba(37, 99, 235, 0.10);
    }

    .finance-overview-head {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 16px;
      margin-bottom: 16px;
    }

    .finance-overview-head h3 {
      margin: 0;
      color: #0f2744;
      font-size: 24px;
      line-height: 1.2;
    }

    .finance-overview-head p {
      margin: 6px 0 0;
      color: #61738c;
      font-weight: 700;
    }

    .finance-legend {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 12px;
      color: #486581;
      font-size: 13px;
      font-weight: 900;
    }

    .finance-legend span {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      white-space: nowrap;
    }

    .finance-legend i {
      width: 10px;
      height: 10px;
      border-radius: 999px;
      display: inline-block;
    }

    .finance-legend .legend-income { background: #2563eb; }
    .finance-legend .legend-expense { background: #ef4444; }
    .finance-legend .legend-profit { background: #14b8a6; }

    .finance-line-chart {
      overflow: hidden;
      border-radius: 18px;
      border: 1px solid rgba(148, 163, 184, 0.16);
      background:
        radial-gradient(circle, rgba(148, 163, 184, 0.24) 1px, transparent 1.5px) 0 0 / 20px 20px,
        linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    }

    .finance-line-chart svg {
      display: block;
      width: 100%;
      height: auto;
    }

    .finance-axis-label {
      fill: #64748b;
      font: 800 13px Tahoma, sans-serif;
    }

    .finance-top-stat-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 14px;
      margin-top: 16px;
    }

    .finance-top-stat {
      padding: 15px 16px;
      border-radius: 14px;
      border: 1px solid rgba(96, 165, 250, 0.20);
      background: #ffffff;
      box-shadow: 0 12px 26px rgba(37, 99, 235, 0.06);
    }

    .finance-top-stat span {
      display: block;
      color: #486581;
      font-size: 13px;
      font-weight: 900;
    }

    .finance-top-stat strong {
      display: block;
      margin-top: 8px;
      color: #0f172a;
      font-size: 22px;
      line-height: 1.1;
    }

    .finance-top-stat small {
      display: block;
      margin-top: 6px;
      color: #0f766e;
      font-weight: 900;
    }

    .finance-top-stat small.negative {
      color: #dc2626;
    }

    .finance-insight-grid {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
      gap: 16px;
      margin-top: 16px;
    }

    .finance-insight-card {
      min-width: 0;
      padding: 18px;
      border-radius: 18px;
      border: 1px solid rgba(96, 165, 250, 0.18);
      background: #ffffff;
      box-shadow: 0 12px 28px rgba(37, 99, 235, 0.06);
    }

    .finance-insight-card h4 {
      margin: 0;
      color: #0f2744;
      font-size: 20px;
      line-height: 1.2;
    }

    .finance-insight-card p {
      margin: 4px 0 14px;
      color: #64748b;
      font-size: 13px;
      font-weight: 700;
    }

    .service-insight-wrap {
      max-width: 100%;
      overflow-x: auto;
      border-radius: 14px;
      border: 1px solid rgba(148, 163, 184, 0.16);
    }

    .expense-breakdown {
      display: grid;
      gap: 12px;
    }

    .expense-breakdown-row {
      display: grid;
      grid-template-columns: 130px minmax(0, 1fr) 110px;
      align-items: center;
      gap: 12px;
      color: #1e3653;
      font-size: 13px;
      font-weight: 900;
    }

    .expense-breakdown-track {
      height: 8px;
      overflow: hidden;
      border-radius: 999px;
      background: #e5effa;
    }

    .expense-breakdown-fill {
      height: 100%;
      min-width: 3px;
      border-radius: inherit;
    }

    .expense-blue { background: #2563eb; }
    .expense-sky { background: #60a5fa; }
    .expense-teal { background: #0f766e; }
    .expense-amber { background: #facc15; }

    .service-insight-table {
      width: 100%;
      min-width: 0;
      table-layout: fixed;
      border-collapse: collapse;
      color: #203a59;
      font-size: 12px;
      font-weight: 800;
    }

    .service-insight-table th,
    .service-insight-table td {
      padding: 10px 7px;
      border-bottom: 1px solid rgba(148, 163, 184, 0.16);
      text-align: left;
      vertical-align: middle;
      overflow-wrap: anywhere;
    }

    .service-insight-table th {
      color: #486581;
      background: #f8fbff;
      font-size: 12px;
    }

    .service-insight-table td:not(:first-child),
    .service-insight-table th:not(:first-child) {
      text-align: right;
    }

    .service-insight-table th:nth-child(1),
    .service-insight-table td:nth-child(1) { width: 46px; }
    .service-insight-table th:nth-child(2),
    .service-insight-table td:nth-child(2) { width: 28%; text-align: left; }
    .service-insight-table th:nth-child(3),
    .service-insight-table td:nth-child(3),
    .service-insight-table th:nth-child(4),
    .service-insight-table td:nth-child(4) { width: 118px; white-space: nowrap; }
    .service-insight-table th:nth-child(5),
    .service-insight-table td:nth-child(5) { width: 96px; white-space: nowrap; }

    .finance-period-grid,
    .finance-split-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 14px;
      margin: 18px 0;
    }

    .finance-period-card,
    .finance-split-card {
      padding: 16px;
      border-radius: 18px;
      border: 1px solid rgba(96, 165, 250, 0.22);
      background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
      box-shadow: 0 14px 30px rgba(37, 99, 235, 0.08);
    }

    .finance-period-card h3,
    .finance-split-card h3 {
      margin: 0 0 12px;
      color: #123456;
      font-size: 18px;
      line-height: 1.25;
    }

    .finance-line {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 12px;
      padding: 9px 0;
      border-top: 1px solid rgba(148, 163, 184, 0.18);
      color: #365675;
      font-weight: 800;
    }

    .finance-line:first-of-type {
      border-top: 0;
    }

    .finance-line strong {
      color: #0f172a;
      font-size: 17px;
      white-space: nowrap;
    }

    .finance-income strong { color: #075985; }
    .finance-expense strong { color: #991b1b; }
    .finance-profit strong { color: #047857; }
    .finance-loss strong { color: #be123c; }

    .finance-month-list {
      display: grid;
      gap: 12px;
      margin-top: 16px;
    }

    .finance-month-row {
      display: grid;
      grid-template-columns: 92px minmax(0, 1fr) minmax(220px, auto);
      align-items: center;
      gap: 14px;
      padding: 14px;
      border: 1px solid rgba(96, 165, 250, 0.22);
      border-radius: 18px;
      background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
      box-shadow: 0 12px 26px rgba(37, 99, 235, 0.07);
    }

    .finance-month-label {
      color: #123456;
      font-weight: 950;
    }

    .finance-bars {
      display: grid;
      gap: 8px;
    }

    .finance-bar-line {
      display: grid;
      grid-template-columns: 70px minmax(0, 1fr);
      align-items: center;
      gap: 10px;
      color: #486581;
      font-size: 13px;
      font-weight: 900;
    }

    .finance-bar-track {
      overflow: hidden;
      height: 12px;
      border-radius: 999px;
      background: #e5effa;
    }

    .finance-bar-fill {
      height: 100%;
      min-width: 3px;
      border-radius: inherit;
    }

    .finance-bar-income { background: linear-gradient(90deg, #38bdf8, #2563eb); }
    .finance-bar-expense { background: linear-gradient(90deg, #fca5a5, #dc2626); }

    .finance-month-values {
      display: grid;
      gap: 4px;
      color: #365675;
      font-size: 13px;
      font-weight: 800;
      text-align: right;
    }

    .finance-month-values strong {
      color: #123456;
      font-size: 16px;
    }

    @media (max-width: 860px) {
      .finance-period-grid,
      .finance-split-grid {
        grid-template-columns: 1fr;
      }

      .finance-overview-head,
      .finance-insight-grid {
        grid-template-columns: 1fr;
      }

      .finance-overview-head {
        display: grid;
      }

      .finance-top-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }

      .finance-month-row {
        grid-template-columns: 1fr;
      }

      .finance-month-values {
        text-align: left;
      }
    }

    @media (max-width: 560px) {
      .finance-overview-top {
        padding: 14px;
        border-radius: 18px;
        overflow: hidden;
      }

      .finance-overview-head h3 {
        font-size: 20px;
      }

      .finance-legend {
        gap: 8px;
        font-size: 12px;
      }

      .finance-line-chart {
        overflow: hidden;
        -webkit-overflow-scrolling: touch;
        contain: paint;
      }

      .finance-line-chart svg {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
      }

      .finance-top-stat-grid,
      .finance-insight-grid {
        grid-template-columns: 1fr;
      }

      .expense-breakdown-row {
        grid-template-columns: 1fr;
      }

      .service-insight-wrap {
        overflow-x: auto;
        overflow-y: hidden;
        max-width: 100%;
        contain: paint;
      }

      .service-insight-table {
        min-width: 620px;
        max-width: none;
        table-layout: auto;
        font-size: 12px;
      }

      .service-insight-table th,
      .service-insight-table td {
        white-space: nowrap;
        overflow-wrap: normal;
      }

      .service-insight-table th:nth-child(2),
      .service-insight-table td:nth-child(2) {
        min-width: 180px;
        white-space: normal;
        overflow-wrap: break-word;
      }
    }

    .dashboard-status-row .chart-bar {
      background: linear-gradient(90deg, var(--status-color, #2563eb), var(--status-color-2, #4f46e5));
    }

    .dashboard-status-pending { --status-color: #f97316; --status-color-2: #c2410c; }
    .dashboard-status-confirmed { --status-color: #2563eb; --status-color-2: #1e40af; }
    .dashboard-status-repair_confirmed { --status-color: #8b5cf6; --status-color-2: #6d28d9; }
    .dashboard-status-repairing { --status-color: #e11d48; --status-color-2: #9f1239; }
    .dashboard-status-completed { --status-color: #10b981; --status-color-2: #047857; }
    .dashboard-status-payment_pending { --status-color: #f59e0b; --status-color-2: #b45309; }
    .dashboard-status-paid { --status-color: #22c55e; --status-color-2: #15803d; }
    .dashboard-status-delivered { --status-color: #475569; --status-color-2: #0f172a; }
    .dashboard-status-cancelled { --status-color: #ef4444; --status-color-2: #991b1b; }

    .dash-v2 {
      display: grid;
      gap: 18px;
    }

    .dash-v2-hero {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 18px;
      align-items: end;
      padding: 26px;
      border-radius: 8px;
      background:
        radial-gradient(circle at 9% 12%, rgba(255, 255, 255, 0.26), transparent 28%),
        radial-gradient(circle at 74% 20%, rgba(253, 224, 71, 0.24), transparent 26%),
        linear-gradient(135deg, #0ea5e9 0%, #14b8a6 47%, #2563eb 100%);
      color: #ffffff;
      box-shadow: 0 18px 42px rgba(14, 165, 233, 0.20);
    }

    .dash-v2-hero h2 {
      margin: 0;
      color: #ffffff;
      font-size: 30px;
      line-height: 1.18;
    }

    .dash-v2-hero p {
      margin: 8px 0 0;
      color: #f0fdfa;
      font-weight: 700;
    }

    .dash-v2-actions {
      align-items: center;
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      justify-content: flex-end;
    }

    .dash-v2-actions .btn {
      align-items: center;
      border: 0;
      border-radius: 999px;
      box-sizing: border-box;
      display: inline-flex;
      font-size: 16px;
      font-weight: 900;
      justify-content: center;
      line-height: 1.15;
      min-height: 54px;
      min-width: 112px;
      padding: 12px 18px;
      text-align: center;
      white-space: nowrap;
    }

    .dash-v2-actions .report-download-btn {
      background: linear-gradient(135deg, #38bdf8 0%, #2563eb 52%, #8b5cf6 100%) !important;
      color: #ffffff !important;
      box-shadow: 0 16px 28px rgba(37, 99, 235, 0.28);
    }

    .dash-v2-actions .btn.light {
      background: linear-gradient(135deg, #ffffff 0%, #ecfeff 48%, #cffafe 100%) !important;
      color: #0f766e !important;
      box-shadow: 0 16px 26px rgba(20, 184, 166, 0.22), inset 0 0 0 1px rgba(255, 255, 255, 0.76);
    }

    .dash-v2-actions .btn.light:nth-child(3) {
      background: linear-gradient(135deg, #ffffff 0%, #eff6ff 48%, #dbeafe 100%) !important;
      color: #1d4ed8 !important;
      box-shadow: 0 16px 26px rgba(59, 130, 246, 0.22), inset 0 0 0 1px rgba(255, 255, 255, 0.76);
    }

    .dash-v2-kpis,
    .dash-v2-periods,
    .dash-v2-split,
    .dash-v2-status-grid {
      display: grid;
      gap: 12px;
    }

    .dash-v2-kpis,
    .dash-v2-periods {
      grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .dash-v2-split {
      grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr);
      align-items: stretch;
    }

    .dash-v2-status-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dash-v2-card {
      background: #ffffff;
      border: 1px solid rgba(148, 163, 184, 0.22);
      border-radius: 8px;
      box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
      padding: 18px;
      min-width: 0;
    }

    .dash-v2-card h3 {
      margin: 0;
      color: #0f172a;
      font-size: 18px;
      line-height: 1.25;
    }

    .dash-v2-sub {
      display: block;
      margin-top: 4px;
      color: #64748b;
      font-weight: 700;
      font-size: 13px;
    }

    .dash-v2-kpi {
      background: linear-gradient(135deg, var(--dash-bg-1, #ffffff) 0%, var(--dash-bg-2, #f8fafc) 100%);
      border-color: var(--dash-border, rgba(148, 163, 184, 0.22));
      border-left: 6px solid var(--dash-accent, #2563eb);
      box-shadow: 0 16px 32px var(--dash-shadow, rgba(15, 23, 42, 0.08));
    }

    .dash-v2-kpi span,
    .dash-v2-period span,
    .dash-v2-line span {
      color: #64748b;
      font-weight: 800;
      font-size: 13px;
    }

    .dash-v2-kpi strong {
      display: block;
      margin-top: 8px;
      color: #0f172a;
      font-size: 28px;
      line-height: 1.1;
    }

    .dash-v2-kpi small,
    .dash-v2-period small {
      display: block;
      margin-top: 8px;
      color: #475569;
      font-weight: 700;
      line-height: 1.35;
    }

    .dash-v2-income { --dash-accent: #0284c7; --dash-bg-1: #ffffff; --dash-bg-2: #dff6ff; --dash-border: rgba(14, 165, 233, 0.28); --dash-shadow: rgba(14, 165, 233, 0.16); }
    .dash-v2-expense { --dash-accent: #dc2626; --dash-bg-1: #ffffff; --dash-bg-2: #ffe4e6; --dash-border: rgba(220, 38, 38, 0.28); --dash-shadow: rgba(220, 38, 38, 0.14); }
    .dash-v2-profit { --dash-accent: #059669; --dash-bg-1: #ffffff; --dash-bg-2: #bbf7d0; --dash-border: rgba(5, 150, 105, 0.28); --dash-shadow: rgba(5, 150, 105, 0.14); }
    .dash-v2-work { --dash-accent: #7c3aed; --dash-bg-1: #ffffff; --dash-bg-2: #ede9fe; --dash-border: rgba(124, 58, 237, 0.28); --dash-shadow: rgba(124, 58, 237, 0.14); }

    .dash-v2-period {
      display: grid;
      gap: 10px;
      background: linear-gradient(135deg, #ffffff 0%, #eff6ff 52%, #ecfeff 100%);
      border-color: rgba(59, 130, 246, 0.22);
    }

    .dash-v2-period h3 {
      font-size: 16px;
    }

    .dash-v2-line {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 10px;
      padding-top: 9px;
      border-top: 1px solid #e2e8f0;
    }

    .dash-v2-line strong {
      color: #0f172a;
      font-size: 15px;
      white-space: nowrap;
    }

    .dash-v2-chart-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 16px;
      margin-bottom: 16px;
    }

    .dash-v2-legend {
      display: flex;
      gap: 12px;
      flex-wrap: wrap;
      color: #475569;
      font-weight: 800;
      font-size: 13px;
    }

    .dash-v2-legend i {
      display: inline-block;
      width: 10px;
      height: 10px;
      border-radius: 999px;
      margin-right: 5px;
      vertical-align: -1px;
    }

    .dash-v2-chart {
      width: 100%;
      min-height: 260px;
      overflow: hidden;
      border-radius: 8px;
      background: #f8fafc;
      border: 1px solid #e2e8f0;
    }

    .dash-v2-chart svg {
      display: block;
      width: 100%;
      height: auto;
    }

    .dash-v2-months {
      display: grid;
      gap: 10px;
    }

    .dash-v2-month {
      display: grid;
      grid-template-columns: 72px minmax(0, 1fr) 116px;
      gap: 12px;
      align-items: center;
    }

    .dash-v2-bars {
      display: grid;
      gap: 6px;
    }

    .dash-v2-bar {
      height: 9px;
      overflow: hidden;
      border-radius: 999px;
      background: #e2e8f0;
    }

    .dash-v2-bar div {
      height: 100%;
      border-radius: inherit;
    }

    .dash-v2-bar-income div { background: #0284c7; }
    .dash-v2-bar-expense div { background: #dc2626; }

    .dash-v2-month strong {
      color: #0f172a;
      font-size: 13px;
      text-align: right;
      white-space: nowrap;
    }

    .dash-v2-table {
      width: 100%;
      box-shadow: none !important;
      border-radius: 8px !important;
    }

    .dash-v2-table th,
    .dash-v2-table td {
      white-space: nowrap;
    }

    @media (max-width: 980px) {
      .dash-v2-hero,
      .dash-v2-split {
        grid-template-columns: 1fr;
      }

      .dash-v2-actions {
        justify-content: flex-start;
      }

      .dash-v2-kpis,
      .dash-v2-periods,
      .dash-v2-status-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }
    }

    @media (max-width: 640px) {
      .dash-v2-kpis,
      .dash-v2-periods,
      .dash-v2-status-grid {
        grid-template-columns: 1fr;
      }

      .dash-v2-hero {
        padding: 20px;
      }

      .dash-v2-hero h2 {
        font-size: 24px;
      }

      .dash-v2-month {
        grid-template-columns: 1fr;
      }

      .dash-v2-month strong {
        text-align: left;
      }
    }

    .admin-page .dash-v2 {
      display: none;
    }

    .dash-pro {
      display: grid;
      gap: 16px;
    }

    .dash-pro-command,
    .dash-pro-panel,
    .dash-pro-kpi,
    .dash-pro-action {
      box-sizing: border-box;
      border: 1px solid rgba(148, 163, 184, 0.22);
      border-radius: 8px;
      background: #ffffff;
      box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
    }

    .dash-pro-command {
      display: grid;
      grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
      gap: 18px;
      align-items: stretch;
      padding: 22px;
      background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.96) 0%, rgba(12, 74, 110, 0.94) 44%, rgba(21, 128, 61, 0.92) 100%);
      color: #ffffff;
    }

    .dash-pro-command h2 {
      margin: 6px 0 8px;
      color: #ffffff;
      font-size: clamp(26px, 3vw, 38px);
      line-height: 1.12;
      letter-spacing: 0;
    }

    .dash-pro-command p {
      max-width: 780px;
      margin: 0;
      color: #dbeafe;
      font-weight: 800;
      line-height: 1.65;
    }

    .dash-pro-eyebrow,
    .dash-pro-date {
      display: inline-flex;
      align-items: center;
      width: fit-content;
      gap: 8px;
      padding: 7px 11px;
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.12);
      color: #e0f2fe;
      border: 1px solid rgba(255, 255, 255, 0.16);
      font-size: 13px;
      font-weight: 950;
    }

    .dash-pro-command-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      margin-top: 18px;
    }

    .dash-pro-command-actions .btn {
      align-items: center;
      border-radius: 999px;
      display: inline-flex;
      justify-content: center;
      min-height: 46px;
      padding: 11px 16px;
      text-align: center;
      font-weight: 950;
    }

    .dash-pro-command-actions .btn.light {
      background: rgba(255, 255, 255, 0.95) !important;
      color: #0f766e !important;
    }

    .dash-pro-health {
      display: grid;
      gap: 10px;
      align-content: stretch;
    }

    .dash-pro-health-card {
      display: grid;
      gap: 5px;
      min-height: 92px;
      padding: 15px;
      border-radius: 8px;
      background: rgba(255, 255, 255, 0.12);
      border: 1px solid rgba(255, 255, 255, 0.18);
    }

    .dash-pro-health-card span {
      color: #bfdbfe;
      font-size: 13px;
      font-weight: 950;
    }

    .dash-pro-health-card strong {
      color: #ffffff;
      font-size: clamp(18px, 1.55vw, 22px);
      line-height: 1.1;
      overflow-wrap: anywhere;
    }

    .dash-pro-health-card small {
      color: #d1fae5;
      font-weight: 800;
    }

    .dash-pro-kpi-grid {
      display: grid;
      grid-template-columns: repeat(5, minmax(0, 1fr));
      gap: 12px;
    }

    .dash-pro-kpi {
      position: relative;
      overflow: hidden;
      min-width: 0;
      min-height: 136px;
      padding: 16px;
      background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    }

    .dash-pro-kpi:before {
      content: "";
      position: absolute;
      inset: 0 auto 0 0;
      width: 5px;
      background: var(--dash-pro-accent, #2563eb);
    }

    .dash-pro-kpi span,
    .dash-pro-panel-sub,
    .dash-pro-table th {
      color: #64748b;
      font-size: 13px;
      font-weight: 900;
      overflow-wrap: anywhere;
    }

    .dash-pro-kpi strong {
      display: block;
      margin-top: 8px;
      color: #0f172a;
      font-size: clamp(22px, 1.8vw, 26px);
      line-height: 1.1;
      overflow-wrap: anywhere;
      white-space: nowrap;
    }

    .dash-pro-kpi small {
      display: block;
      margin-top: 8px;
      color: #475569;
      font-weight: 800;
      line-height: 1.35;
      overflow-wrap: anywhere;
    }

    .dash-pro-kpi.income { --dash-pro-accent: #0284c7; }
    .dash-pro-kpi.profit { --dash-pro-accent: #059669; }
    .dash-pro-kpi.margin { --dash-pro-accent: #7c3aed; }
    .dash-pro-kpi.work { --dash-pro-accent: #ea580c; }
    .dash-pro-kpi.stock { --dash-pro-accent: #be123c; }

    .dash-pro-period-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 12px;
    }

    .dash-pro-period {
      display: grid;
      gap: 12px;
      padding: 16px;
      border-radius: 8px;
      border: 1px solid rgba(96, 165, 250, 0.24);
      background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
      box-shadow: 0 14px 28px rgba(15, 23, 42, 0.07);
      min-width: 0;
    }

    .dash-pro-period h3 {
      margin: 0;
      color: #0f2744;
      font-size: 18px;
      line-height: 1.2;
    }

    .dash-pro-period-top {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      align-items: flex-start;
    }

    .dash-pro-period-top small {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 42px;
      padding: 6px 9px;
      border-radius: 999px;
      background: #eff6ff;
      color: #1d4ed8;
      font-weight: 950;
      white-space: nowrap;
    }

    .dash-pro-period-lines {
      display: grid;
      gap: 8px;
    }

    .dash-pro-period-line {
      display: grid;
      grid-template-columns: 78px minmax(0, 1fr) 116px;
      gap: 9px;
      align-items: center;
      color: #334155;
      font-size: 13px;
      font-weight: 900;
    }

    .dash-pro-period-line strong {
      color: #0f172a;
      text-align: right;
      white-space: nowrap;
    }

    .dash-pro-period-track {
      height: 8px;
      overflow: hidden;
      border-radius: 999px;
      background: #e2e8f0;
    }

    .dash-pro-period-fill {
      height: 100%;
      min-width: 3px;
      border-radius: inherit;
    }

    .dash-pro-period-fill.income { background: linear-gradient(90deg, #38bdf8, #2563eb); }
    .dash-pro-period-fill.expense { background: linear-gradient(90deg, #fca5a5, #dc2626); }
    .dash-pro-period-fill.profit { background: linear-gradient(90deg, #34d399, #059669); }

    .dash-pro-grid {
      display: grid;
      grid-template-columns: minmax(0, 1.45fr) minmax(330px, 0.65fr);
      gap: 16px;
      align-items: stretch;
    }

    .dash-pro-grid.equal {
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .dash-pro-panel {
      min-width: 0;
      padding: 18px;
    }

    .dash-pro-panel-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 14px;
      margin-bottom: 14px;
    }

    .dash-pro-panel h3 {
      margin: 0;
      color: #0f2744;
      font-size: 21px;
      line-height: 1.25;
    }

    .dash-pro-legend {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      color: #475569;
      font-size: 12px;
      font-weight: 900;
    }

    .dash-pro-legend span {
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }

    .dash-pro-legend i {
      width: 10px;
      height: 10px;
      border-radius: 999px;
      display: inline-block;
    }

    .dash-pro-chart {
      overflow: hidden;
      border-radius: 8px;
      border: 1px solid #dbeafe;
      background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    }

    .dash-pro-chart svg {
      display: block;
      width: 100%;
      height: auto;
    }

    .dash-pro-action-list,
    .dash-pro-month-list,
    .dash-pro-stock-list {
      display: grid;
      gap: 10px;
    }

    .dash-pro-action {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 12px;
      align-items: center;
      padding: 14px;
      text-decoration: none;
      color: #0f172a;
      box-shadow: none;
      transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
    }

    .dash-pro-action:hover,
    .dash-pro-action:focus-visible {
      transform: translateY(-1px);
      border-color: #60a5fa;
      box-shadow: 0 14px 26px rgba(37, 99, 235, 0.12);
    }

    .dash-pro-action span {
      display: block;
      color: #0f2744;
      font-size: 16px;
      font-weight: 950;
    }

    .dash-pro-action small {
      display: block;
      margin-top: 3px;
      color: #64748b;
      font-weight: 800;
    }

    .dash-pro-action strong {
      min-width: 64px;
      padding: 9px 12px;
      border-radius: 999px;
      background: #eff6ff;
      color: #1d4ed8;
      font-size: 18px;
      text-align: center;
    }

    .dash-pro-action.warn strong { background: #fff7ed; color: #c2410c; }
    .dash-pro-action.cash strong { background: #fef3c7; color: #b45309; }
    .dash-pro-action.danger strong { background: #ffe4e6; color: #be123c; }
    .dash-pro-action.ok strong { background: #dcfce7; color: #15803d; }

    .dash-pro-month {
      display: grid;
      grid-template-columns: 78px minmax(0, 1fr) 112px;
      gap: 12px;
      align-items: center;
      padding: 11px 0;
      border-bottom: 1px solid #e2e8f0;
    }

    .dash-pro-month:last-child {
      border-bottom: 0;
    }

    .dash-pro-month span {
      color: #0f2744;
      font-weight: 950;
    }

    .dash-pro-month-bars {
      display: grid;
      gap: 6px;
    }

    .dash-pro-bar {
      height: 9px;
      overflow: hidden;
      border-radius: 999px;
      background: #e2e8f0;
    }

    .dash-pro-bar div {
      height: 100%;
      min-width: 3px;
      border-radius: inherit;
    }

    .dash-pro-bar.income div { background: linear-gradient(90deg, #38bdf8, #2563eb); }
    .dash-pro-bar.expense div { background: linear-gradient(90deg, #fca5a5, #dc2626); }

    .dash-pro-month strong {
      color: #0f172a;
      font-size: 13px;
      text-align: right;
      white-space: nowrap;
    }

    .dash-pro-breakdown {
      display: grid;
      gap: 10px;
    }

    .dash-pro-breakdown-row {
      display: grid;
      grid-template-columns: minmax(120px, 0.9fr) minmax(0, 1.1fr) 112px;
      gap: 10px;
      align-items: center;
      font-weight: 900;
      color: #334155;
    }

    .dash-pro-breakdown-track {
      overflow: hidden;
      height: 9px;
      border-radius: 999px;
      background: #e2e8f0;
    }

    .dash-pro-breakdown-fill {
      height: 100%;
      min-width: 3px;
      border-radius: inherit;
    }

    .dash-pro-table-wrap {
      overflow-x: auto;
      border: 1px solid #e2e8f0;
      border-radius: 8px;
    }

    .dash-pro-table {
      width: 100%;
      min-width: 620px;
      border-collapse: collapse;
    }

    .dash-pro-table th,
    .dash-pro-table td {
      padding: 12px;
      border-bottom: 1px solid #e2e8f0;
      text-align: left;
      vertical-align: middle;
      white-space: nowrap;
    }

    .dash-pro-table th {
      background: #f8fbff;
    }

    .dash-pro-table td {
      color: #0f172a;
      font-weight: 800;
    }

    .dash-pro-table tr:last-child td {
      border-bottom: 0;
    }

    .dash-pro-stock-item {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      padding: 12px;
      border-radius: 8px;
      background: #fff7ed;
      border: 1px solid #fed7aa;
      color: #7c2d12;
      font-weight: 900;
    }

    .dash-pro-empty {
      padding: 14px;
      border-radius: 8px;
      background: #f0fdf4;
      border: 1px solid #bbf7d0;
      color: #166534;
      font-weight: 900;
    }

    @media (max-width: 1100px) {
      .dash-pro-kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
      }

      .dash-pro-period-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }

      .dash-pro-command,
      .dash-pro-grid,
      .dash-pro-grid.equal {
        grid-template-columns: 1fr;
      }
    }

    @media (max-width: 680px) {
      .dash-pro-command,
      .dash-pro-panel {
        padding: 14px;
      }

      .dash-pro-kpi-grid {
        grid-template-columns: 1fr;
      }

      .dash-pro-period-grid {
        grid-template-columns: 1fr;
      }

      .dash-pro-command-actions .btn {
        width: 100%;
      }

      .dash-pro-panel-head {
        display: grid;
      }

      .dash-pro-month,
      .dash-pro-period-line,
      .dash-pro-breakdown-row {
        grid-template-columns: 1fr;
      }

      .dash-pro-month strong,
      .dash-pro-period-line strong {
        text-align: left;
      }
    }

    .admin-page .dash-pro {
      display: none;
    }

    /* Dashboard UI: light responsive shell for the computer repair business overview. */
    .dash-modern {
      --dash-bg: #f3fbff;
      --dash-surface: #ffffff;
      --dash-surface-2: #eaf6ff;
      --dash-border: rgba(37, 99, 235, 0.18);
      --dash-text: #0f2f4f;
      --dash-muted: #4b6680;
      --dash-blue: #0284c7;
      --dash-green: #16a34a;
      --dash-red: #fb7185;
      --dash-amber: #f59e0b;
      display: grid;
      gap: 16px;
      padding: 18px;
      border-radius: 12px;
      background:
        radial-gradient(circle at 12% 0%, rgba(56, 189, 248, 0.22), transparent 30%),
        radial-gradient(circle at 86% 12%, rgba(34, 197, 94, 0.14), transparent 32%),
        linear-gradient(180deg, #f4fbff 0%, #eaf6ff 100%);
      color: var(--dash-text);
      box-shadow: 0 24px 54px rgba(37, 99, 235, 0.12);
    }

    .visitor-dashboard-section {
      display: grid;
      order: 999;
      gap: 16px;
      min-width: 0;
    }

    .dash-modern * {
      box-sizing: border-box;
    }

    .dash-modern-head {
      display: flex;
      align-items: flex-end;
      justify-content: space-between;
      gap: 16px;
      padding: 4px 2px 2px;
    }

    .dash-modern-head > div:first-child {
      min-width: 0;
      flex: 1 1 auto;
    }

    .dash-modern-kicker {
      color: var(--dash-blue);
      font-size: 12px;
      font-weight: 950;
      text-transform: uppercase;
    }

    .dash-modern h2,
    .dash-modern h3 {
      margin: 0;
      color: var(--dash-text);
      letter-spacing: 0;
    }

    .dash-modern h2 {
      margin-top: 5px;
      max-width: 780px;
      font-size: clamp(22px, 2.05vw, 31px);
      line-height: 1.12;
      overflow-wrap: anywhere;
    }

    .dash-modern-sub {
      max-width: 720px;
      margin: 4px 0 0;
      color: var(--dash-muted);
      font-size: 13px;
      font-weight: 750;
      line-height: 1.38;
    }

    .dash-modern-actions {
      display: flex;
      flex: 0 0 auto;
      flex-wrap: wrap;
      justify-content: flex-end;
      gap: 10px;
    }

    .dash-modern-actions .btn {
      align-items: center;
      display: inline-flex;
      justify-content: center;
      min-height: 44px;
      border-radius: 999px;
      color: #e0f2fe !important;
      border-color: rgba(56, 189, 248, 0.32) !important;
      background: rgba(15, 23, 42, 0.72) !important;
      text-align: center;
    }

    .dash-modern-category-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 12px 14px;
      border: 1px solid rgba(148, 163, 184, 0.16);
      border-radius: 12px;
      background: rgba(2, 6, 23, 0.24);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    }

    .dash-modern-category-head strong {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      color: #ffffff;
      font-size: 17px;
      font-weight: 950;
    }

    .dash-modern-category-head strong:before {
      content: "";
      width: 10px;
      height: 10px;
      border-radius: 999px;
      background: var(--category-dot, var(--dash-blue));
      box-shadow: 0 0 0 5px rgba(56, 189, 248, 0.12);
    }

    .dash-modern-category-head span {
      color: var(--dash-muted);
      font-size: 12px;
      font-weight: 850;
      line-height: 1.35;
      text-align: right;
    }

    .dash-modern-kpis {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 12px;
    }

    .dash-modern-overview-chart {
      position: relative;
      overflow: hidden;
      display: grid;
      gap: 14px;
      padding: 18px;
      border: 1px solid rgba(14, 165, 233, 0.22);
      border-radius: 16px;
      background: linear-gradient(135deg, rgba(255,255,255,0.96) 0%, rgba(239,250,255,0.94) 56%, rgba(236,253,245,0.90) 100%);
      box-shadow: 0 18px 38px rgba(14, 116, 144, 0.12);
    }

    .dash-modern-overview-chart:before {
      content: "";
      position: absolute;
      inset: -36px -80px auto auto;
      width: 240px;
      height: 240px;
      border-radius: 999px;
      background: radial-gradient(circle, rgba(56,189,248,0.20), rgba(56,189,248,0));
      pointer-events: none;
    }

    .dash-modern-overview-chart-head {
      position: relative;
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 16px;
    }

    .dash-modern-overview-chart h3 {
      margin: 0;
      color: #0b3658;
      font-size: clamp(18px, 1.6vw, 22px);
      line-height: 1.25;
    }

    .dash-modern-overview-chart p {
      margin: 4px 0 0;
      color: #48637d;
      font-size: 13px;
      font-weight: 800;
    }

    .dash-modern-overview-legend {
      display: flex;
      flex-wrap: wrap;
      justify-content: flex-end;
      gap: 8px;
      color: #0f2f4f;
      font-size: 12px;
      font-weight: 900;
    }

    .dash-modern-overview-legend span {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 7px 10px;
      border: 1px solid rgba(37, 99, 235, 0.14);
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.78);
    }

    .dash-modern-overview-legend i {
      width: 10px;
      height: 10px;
      border-radius: 999px;
      background: var(--legend-color);
    }

    .dash-modern-overview-bars {
      position: relative;
      display: grid;
      grid-template-columns: repeat(6, minmax(84px, 1fr));
      gap: 12px;
      min-height: 260px;
      padding: 14px 8px 4px;
      border-radius: 14px;
      background:
        linear-gradient(to top, rgba(37,99,235,0.09) 1px, transparent 1px) 0 0 / 100% 25%,
        rgba(255, 255, 255, 0.52);
    }

    .dash-modern-month-bar {
      display: grid;
      grid-template-rows: 1fr auto;
      gap: 10px;
      min-width: 0;
    }

    .dash-modern-bar-stage {
      display: flex;
      align-items: end;
      justify-content: center;
      gap: 7px;
      min-height: 190px;
      padding-inline: 5px;
    }

    .dash-modern-chart-bar {
      position: relative;
      width: min(32%, 30px);
      min-width: 16px;
      height: max(8px, var(--bar-height));
      border-radius: 10px 10px 4px 4px;
      transform-origin: bottom;
      animation: dashChartGrow 900ms cubic-bezier(.2,.85,.25,1) both;
      animation-delay: var(--bar-delay, 0ms);
      box-shadow: 0 10px 18px rgba(15, 47, 79, 0.12);
    }

    .dash-modern-chart-bar.income {
      background: linear-gradient(180deg, #38bdf8, #2563eb);
    }

    .dash-modern-chart-bar.expense {
      background: linear-gradient(180deg, #fb7185, #dc2626);
    }

    .dash-modern-chart-bar:after {
      content: attr(data-value);
      position: absolute;
      left: 50%;
      bottom: calc(100% + 7px);
      transform: translateX(-50%);
      opacity: 0;
      white-space: nowrap;
      color: #0f2f4f;
      font-size: 11px;
      font-weight: 950;
      transition: opacity .18s ease, transform .18s ease;
      pointer-events: none;
    }

    .dash-modern-month-bar:hover .dash-modern-chart-bar:after {
      opacity: 1;
      transform: translateX(-50%) translateY(-2px);
    }

    .dash-modern-month-meta {
      display: grid;
      gap: 4px;
      color: #0f2f4f;
      text-align: center;
      font-weight: 950;
    }

    .dash-modern-month-meta small {
      color: #047857;
      font-size: 11px;
      font-weight: 950;
    }

    .dash-modern-profit-line {
      width: 100%;
      height: 9px;
      overflow: hidden;
      border-radius: 999px;
      background: #d8e8f7;
    }

    .dash-modern-profit-line span {
      display: block;
      width: var(--profit-width);
      height: 100%;
      border-radius: inherit;
      background: linear-gradient(90deg, #86efac, #16a34a);
      animation: dashProfitSweep 950ms ease both;
      animation-delay: var(--bar-delay, 0ms);
    }

    .dash-modern-kpi,
    .dash-modern-panel {
      min-width: 0;
      border: 1px solid var(--dash-border);
      border-radius: 12px;
      background: linear-gradient(180deg, rgba(15, 31, 52, 0.96) 0%, rgba(11, 23, 40, 0.98) 100%);
      box-shadow: 0 16px 34px rgba(2, 6, 23, 0.22);
    }

    .dash-modern-kpi {
      position: relative;
      overflow: hidden;
      padding: 17px;
      min-height: 136px;
    }

    .dash-modern-kpi:before {
      content: "";
      position: absolute;
      inset: 0 auto 0 0;
      width: 5px;
      background: var(--kpi-color, var(--dash-blue));
    }

    .dash-modern-kpi span {
      display: block;
      color: var(--dash-muted);
      font-size: 13px;
      font-weight: 950;
    }

    .dash-modern-kpi strong {
      display: block;
      margin-top: 10px;
      color: #ffffff;
      font-size: clamp(24px, 2.4vw, 34px);
      line-height: 1.08;
      white-space: nowrap;
    }

    .dash-modern-kpi small {
      display: block;
      margin-top: 10px;
      color: #a8c2dd;
      font-weight: 800;
      line-height: 1.35;
    }

    .dash-modern-kpi.revenue { --kpi-color: var(--dash-blue); }
    .dash-modern-kpi.profit { --kpi-color: var(--dash-green); }
    .dash-modern-kpi.done { --kpi-color: #a78bfa; }
    .dash-modern .dash-modern-kpi.pending {
      --kpi-color: var(--dash-amber);
      background: linear-gradient(180deg, rgba(15, 31, 52, 0.96) 0%, rgba(11, 23, 40, 0.98) 100%) !important;
      border-color: var(--dash-border) !important;
      color: var(--dash-text) !important;
    }

    .dash-modern-analysis {
      display: grid;
      gap: 16px;
    }

    .dash-modern-analysis-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 12px;
    }

    .dash-modern-analysis-card {
      min-height: 112px;
      padding: 16px;
      border-radius: 14px;
      background: rgba(15, 31, 52, 0.74);
      border: 1px solid rgba(148, 163, 184, 0.18);
    }

    .dash-modern-analysis-card span {
      display: block;
      color: var(--dash-muted);
      font-size: 12px;
      font-weight: 950;
    }

    .dash-modern-analysis-card strong {
      display: block;
      margin-top: 10px;
      color: #ffffff;
      font-size: clamp(22px, 2vw, 30px);
      line-height: 1.08;
    }

    .dash-modern-analysis-card small {
      display: block;
      margin-top: 8px;
      color: #9fb8d2;
      font-size: 12px;
      font-weight: 850;
      line-height: 1.35;
    }

    .dash-modern-periods {
      display: grid;
      gap: 16px;
    }

    .finance-service-usage {
      display: grid;
      gap: 11px;
      min-width: 0;
      padding: 14px;
      border: 1px solid rgba(37, 99, 235, 0.18);
      border-radius: 14px;
      background: rgba(255, 255, 255, 0.9);
      box-shadow: 0 10px 24px rgba(37, 99, 235, 0.08);
    }

    .finance-service-usage-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
    }

    .finance-service-usage-head strong {
      color: #0f2f4f;
      font-size: 14px;
      font-weight: 950;
    }

    .finance-service-usage-head span {
      color: #48637d;
      font-size: 10px;
      font-weight: 800;
      text-align: right;
    }

    .finance-service-usage-row {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 10px;
      min-width: 0;
    }

    .finance-service-item {
      --service-accent: #2563eb;
      --service-soft: #eff6ff;
      min-width: 0;
      padding: 11px 12px;
      border: 1px solid color-mix(in srgb, var(--service-accent) 30%, white);
      border-radius: 11px;
      background: var(--service-soft);
    }

    .finance-service-item--online { --service-accent: #7c3aed; --service-soft: #f5f3ff; }
    .finance-service-item--carry_in { --service-accent: #ea580c; --service-soft: #fff7ed; }

    .finance-service-item-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
    }

    .finance-service-item-top span {
      display: flex;
      align-items: center;
      gap: 9px;
      min-width: 0;
      color: #244b6c;
      font-size: 13px;
      line-height: 1.35;
    }

    .finance-service-icon {
      display: inline-flex;
      flex: 0 0 34px;
      align-items: center;
      justify-content: center;
      width: 34px;
      height: 34px;
      border: 1px solid color-mix(in srgb, var(--service-accent) 24%, white);
      border-radius: 10px;
      color: var(--service-accent);
      background: rgba(255, 255, 255, 0.8);
      box-shadow: 0 6px 14px color-mix(in srgb, var(--service-accent) 14%, transparent);
    }

    .finance-service-icon svg {
      width: 20px;
      height: 20px;
      fill: none;
      stroke: currentColor;
      stroke-linecap: round;
      stroke-linejoin: round;
      stroke-width: 1.9;
    }

    .finance-service-item-top b {
      font-weight: 950;
    }

    .finance-service-short-label { display: none; }

    .finance-service-item-top strong {
      flex: 0 0 auto;
      color: var(--service-accent);
      font-size: 16px;
      font-variant-numeric: tabular-nums;
      font-weight: 950;
      white-space: nowrap;
    }

    .finance-service-track {
      height: 11px;
      margin-top: 9px;
      overflow: hidden;
      border-radius: 999px;
      background: rgba(148, 163, 184, 0.22);
    }

    .finance-service-track i {
      display: block;
      height: 100%;
      border-radius: inherit;
      background: linear-gradient(90deg, var(--service-accent), color-mix(in srgb, var(--service-accent) 65%, white));
      box-shadow: 0 0 10px color-mix(in srgb, var(--service-accent) 45%, transparent);
    }

    .finance-service-item small {
      display: block;
      margin-top: 6px;
      color: #48637d;
      font-size: 11px;
      font-weight: 850;
      text-align: right;
    }

    .dash-modern-period-grid {
      display: grid;
      grid-template-columns: repeat(12, minmax(0, 1fr));
      gap: 12px;
    }

    .dash-modern-period-card {
      grid-column: span 4;
      position: relative;
      min-width: 0;
      padding: 16px;
      border-radius: 14px;
      background: rgba(15, 31, 52, 0.76);
      border: 1px solid rgba(148, 163, 184, 0.18);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    }

    .dash-modern-period-card:before {
      content: "";
      position: absolute;
      inset: 0 0 auto;
      height: 5px;
      border-radius: 14px 14px 0 0;
      background: linear-gradient(90deg, #2563eb 0 34%, #ef4444 34% 67%, #16a34a 67% 100%);
    }

    .dash-modern-period-card:nth-child(n + 4) {
      grid-column: span 3;
    }

    .dash-modern-period-top {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 10px;
      margin-bottom: 14px;
    }

    .dash-modern-period-top h4 {
      margin: 0;
      color: #ffffff;
      font-size: 18px;
      font-weight: 950;
    }

    .dash-modern-period-top small {
      display: inline-flex;
      align-items: center;
      min-height: 28px;
      padding: 4px 10px;
      border-radius: 999px;
      color: #bfdbfe;
      background: rgba(59, 130, 246, 0.16);
      border: 1px solid rgba(96, 165, 250, 0.26);
      font-size: 12px;
      font-weight: 950;
      white-space: nowrap;
    }

    .dash-modern-period-line {
      display: grid;
      grid-template-columns: 62px minmax(44px, 1fr) minmax(88px, auto) 62px;
      gap: 10px;
      align-items: center;
      margin-top: 10px;
    }

    .dash-modern-period-line span {
      color: var(--dash-muted);
      font-size: 12px;
      font-weight: 950;
    }

    .dash-modern-period-line strong {
      color: #e5f0ff;
      font-size: 13px;
      font-weight: 950;
      text-align: right;
      white-space: nowrap;
    }

    .dash-modern-period-track {
      position: relative;
      height: 12px;
      overflow: hidden;
      border-radius: 999px;
      background: rgba(148, 163, 184, 0.15);
    }

    .dash-modern-period-fill {
      position: absolute;
      top: 1px;
      left: 0;
      z-index: 2;
      height: 7px;
      border-radius: inherit;
    }

    .dash-modern-period-previous {
      position: absolute;
      bottom: 1px;
      left: 0;
      z-index: 1;
      height: 3px;
      border-radius: inherit;
      background: rgba(148, 163, 184, 0.75);
    }

    .dash-modern-period-fill.income { background: linear-gradient(90deg, #38bdf8, #2563eb); }
    .dash-modern-period-fill.expense { background: linear-gradient(90deg, #fb7185, #dc2626); }
    .dash-modern-period-fill.profit { background: linear-gradient(90deg, #34d399, #16a34a); }

    .finance-period-equation {
      margin: 10px 0 2px;
      padding: 8px 10px;
      border: 1px solid rgba(34, 197, 94, .24);
      border-radius: 9px;
      background: rgba(240, 253, 244, .92);
      color: #166534;
      font-size: 12px;
      font-weight: 950;
      line-height: 1.35;
      text-align: center;
    }

    .finance-period-metric {
      margin-top: 12px;
      min-width: 0;
    }

    .finance-period-metric-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      margin-bottom: 6px;
    }

    .finance-period-metric-head > span {
      color: #0f2f4f;
      font-size: 12px;
      font-weight: 950;
    }

    .finance-period-bar-row {
      display: grid;
      grid-template-columns: 48px minmax(40px, 1fr) minmax(96px, auto);
      align-items: center;
      gap: 7px;
      min-width: 0;
      margin-top: 4px;
    }

    .finance-period-bar-row small {
      color: #48637d;
      font-size: 10px;
      font-weight: 850;
      white-space: nowrap;
    }

    .finance-period-bar-row strong {
      color: #0f2f4f;
      font-size: 11px;
      font-variant-numeric: tabular-nums;
      font-weight: 950;
      text-align: right;
      white-space: nowrap;
    }

    .finance-period-pair-track {
      height: 7px;
      min-width: 0;
      overflow: hidden;
      border-radius: 999px;
      background: #d8e8f7;
    }

    .finance-period-pair-track i {
      display: block;
      height: 100%;
      border-radius: inherit;
    }

    .finance-period-metric--income .finance-period-bar-row--current i { background: #2563eb; }
    .finance-period-metric--income .finance-period-bar-row--previous i { background: #93c5fd; }
    .finance-period-metric--expense .finance-period-bar-row--current i { background: #dc2626; }
    .finance-period-metric--expense .finance-period-bar-row--previous i { background: #fda4af; }
    .finance-period-metric--profit .finance-period-bar-row--current i { background: #16a34a; }
    .finance-period-metric--profit .finance-period-bar-row--previous i { background: #86efac; }

    .finance-average-divider {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      margin-top: 14px;
      padding-top: 11px;
      border-top: 1px solid rgba(148, 163, 184, 0.18);
    }

    .finance-average-divider span {
      display: inline-flex;
      align-items: center;
      min-height: 25px;
      padding: 4px 10px;
      border: 1px solid #bae6fd;
      border-radius: 999px;
      color: #164e63;
      background: #e0f2fe;
      font-size: 11px;
      font-weight: 950;
    }

    .finance-average-divider small {
      color: #48637d;
      font-size: 9px;
      font-weight: 800;
      text-align: right;
    }

    .finance-period-compare-label {
      margin-top: -6px;
      color: #48637d;
      font-size: 11px;
      font-weight: 800;
    }

    .finance-period-total-list {
      display: grid;
      gap: 11px;
      margin-top: 16px;
    }

    .finance-period-total-row {
      display: grid;
      position: relative;
      grid-template-columns: minmax(68px, 1fr) minmax(100px, auto) 66px;
      align-items: center;
      gap: 10px;
      min-width: 0;
      padding: 9px 10px;
      border-left: 4px solid var(--finance-row-accent);
      border-radius: 8px;
      background: var(--finance-row-bg);
      overflow: hidden;
    }

    .finance-period-row--income { --finance-row-accent: #2563eb; --finance-row-bg: #eff6ff; --finance-row-text: #1d4ed8; }
    .finance-period-row--expense { --finance-row-accent: #ef4444; --finance-row-bg: #fff1f2; --finance-row-text: #b91c1c; }
    .finance-period-row--profit { --finance-row-accent: #16a34a; --finance-row-bg: #f0fdf4; --finance-row-text: #15803d; }

    .finance-period-total-row > span,
    .finance-period-average-row > span {
      color: var(--finance-row-text, #365775);
      font-size: 12px;
      font-weight: 900;
    }

    .finance-period-total-row > strong,
    .finance-period-average-row > strong {
      color: #0f2f4f;
      font-size: 13px;
      font-variant-numeric: tabular-nums;
      font-weight: 950;
      text-align: right;
      white-space: nowrap;
    }

    .finance-period-average-list {
      display: grid;
      gap: 9px;
      margin-top: 11px;
    }

    .finance-period-average-row {
      display: grid;
      position: relative;
      grid-template-columns: 1fr auto;
      align-items: center;
      gap: 10px;
      padding: 7px 9px;
      border-radius: 7px;
      background: var(--finance-row-bg);
      overflow: hidden;
    }

    .finance-period-total-row:after,
    .finance-period-average-row:after {
      content: "";
      position: absolute;
      inset: auto auto 0 0;
      width: var(--finance-bar-width, 0%);
      height: 5px;
      border-radius: 0 999px 999px 0;
      background: linear-gradient(90deg, var(--finance-row-accent) 0 38%, #ffffff 50%, var(--finance-row-accent) 62% 100%);
      background-size: 220% 100%;
      opacity: 0.9;
      animation: finance-bar-light-run 2.2s linear infinite;
    }

    .finance-period-total-row:before,
    .finance-period-average-row:before {
      content: "";
      position: absolute;
      inset: 0 auto 0 0;
      width: var(--finance-bar-width, 0%);
      background: var(--finance-row-accent);
      opacity: 0.08;
    }

    .finance-period-average-row:after {
      height: 4px;
      opacity: 0.68;
    }

    @keyframes finance-bar-light-run {
      from { background-position: 110% 0; }
      to { background-position: -110% 0; }
    }

    .finance-period-total-row > *,
    .finance-period-average-row > * {
      position: relative;
      z-index: 1;
    }

    .finance-period-average-row strong small {
      color: #64748b;
      font-size: 10px;
      font-weight: 800;
    }

    .finance-period-days {
      margin-top: 12px;
      color: #64748b;
      font-size: 10px;
      font-weight: 800;
      text-align: right;
    }

    button.finance-period-total-row {
      width: 100%;
      border-top: 0;
      border-right: 0;
      border-bottom: 0;
      font: inherit;
      text-align: left;
      cursor: pointer;
      transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
    }

    button.finance-period-total-row:hover,
    button.finance-period-total-row:focus-visible {
      z-index: 2;
      transform: translateY(-1px);
      filter: saturate(1.08);
      box-shadow: 0 8px 18px color-mix(in srgb, var(--finance-row-accent) 18%, transparent);
      outline: 2px solid color-mix(in srgb, var(--finance-row-accent) 55%, white);
      outline-offset: 2px;
    }

    .finance-period-open-icon {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 22px;
      height: 22px;
      margin-left: 5px;
      border-radius: 999px;
      color: var(--finance-row-text);
      background: rgba(255,255,255,.78);
      font-size: 15px;
      line-height: 1;
      vertical-align: middle;
    }

    .finance-detail-dialog {
      width: min(940px, calc(100vw - 28px));
      max-height: min(860px, calc(100vh - 28px));
      box-sizing: border-box;
      padding: 0;
      overflow: hidden;
      border: 0;
      border-radius: 22px;
      color: #102a43;
      background: #f7fbff;
      box-shadow: 0 28px 80px rgba(15, 23, 42, .35);
    }

    .finance-detail-dialog::backdrop { background: rgba(15, 23, 42, .66); backdrop-filter: blur(4px); }
    .finance-detail-shell { display: flex; flex-direction: column; max-height: min(860px, calc(100vh - 28px)); }
    .finance-detail-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; padding:20px 22px; color:#fff; background:linear-gradient(135deg,#123456,#2563eb); }
    .finance-detail-head > div:first-child { flex:1 1 auto; min-width:0; }
    .finance-detail-head h3 { margin:0; color:#fff !important; font-size:22px; }
    .finance-detail-head p { margin:5px 0 0; color:#dbeafe; font-size:12px; font-weight:800; }
    .finance-detail-close { display:inline-flex; flex:0 0 38px !important; width:38px !important; min-width:38px; max-width:38px; height:38px; align-items:center; justify-content:center; padding:0; border:1px solid rgba(255,255,255,.3); border-radius:12px; color:#fff; background:rgba(255,255,255,.12); font-size:24px; line-height:1; cursor:pointer; }
    .finance-detail-body { padding:18px 22px 24px; overflow:auto; }
    .finance-detail-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
    .finance-detail-summary > div { padding:13px 14px; border:1px solid #dbeafe; border-radius:13px; background:#fff; }
    .finance-detail-summary span { display:block; color:#64748b; font-size:11px; font-weight:900; }
    .finance-detail-summary strong { display:block; margin-top:5px; font-size:20px; font-variant-numeric:tabular-nums; }
    .finance-detail-summary .income strong { color:#1d4ed8; }
    .finance-detail-summary .expense strong { color:#dc2626; }
    .finance-detail-summary .profit strong { color:#15803d; }
    .finance-detail-summary .loss strong { color:#be123c; }
    .finance-detail-formula { margin:12px 0 0; padding:10px 13px; border-radius:10px; color:#166534; background:#dcfce7; font-size:12px; font-weight:900; text-align:center; }
    .finance-detail-formula.loss { color:#9f1239; background:#ffe4e6; }
    .finance-detail-category-list { display:flex; flex-wrap:wrap; gap:8px; margin:16px 0; }
    .finance-detail-category { display:inline-flex; gap:8px; align-items:center; padding:7px 10px; border:1px solid #bfdbfe; border-radius:999px; color:#1e3a5f; background:#eff6ff; font-size:11px; font-weight:900; }
    .finance-detail-category strong { color:#0f172a; }
    .finance-detail-section-title { display:flex; justify-content:space-between; gap:10px; margin:18px 0 8px; color:#123456; font-size:14px; font-weight:950; }
    .finance-detail-list { display:grid; gap:8px; }
    .finance-detail-item { display:grid; grid-template-columns:90px minmax(0,1fr) auto; gap:12px; align-items:center; padding:11px 12px; border:1px solid #dbe7f3; border-left:5px solid var(--detail-accent,#2563eb); border-radius:12px; background:#fff; }
    .finance-detail-item.expense { --detail-accent:#ef4444; }
    .finance-related-inline { margin:-1px 0 4px 18px; border:1px solid transparent; border-radius:12px; background:transparent; overflow:hidden; transition:border-color .22s ease, background .22s ease; }
    .finance-related-inline.expanded { border-color:#fed7aa; background:#fffaf3; }
    .finance-related-toggle { display:flex; width:max-content; max-width:100%; align-items:center; justify-content:flex-start; gap:10px; padding:7px 10px; border:0; border-radius:999px; color:#9a3412; background:transparent; font:inherit; font-size:11px; font-weight:950; cursor:pointer; text-align:left; transition:color .2s ease, background .2s ease; }
    .finance-related-toggle:hover { color:#7c2d12; background:#fff7ed; }
    .finance-related-inline.expanded .finance-related-toggle { width:100%; justify-content:space-between; border-radius:0; background:#ffedd5; }
    .finance-related-toggle-label { display:flex; min-width:0; align-items:center; gap:8px; }
    .finance-related-arrow { display:inline-flex; flex:0 0 22px; width:22px; height:22px; align-items:center; justify-content:center; border-radius:50%; color:#fff; background:#f97316; font-size:17px; line-height:1; transition:transform .22s ease; }
    .finance-related-toggle[aria-expanded="true"] .finance-related-arrow { transform:rotate(90deg); }
    .finance-related-toggle-total { flex:0 0 auto; color:#b91c1c; white-space:nowrap; }
    .finance-related-slide { max-height:0; opacity:0; overflow:hidden; transition:max-height .32s ease, opacity .22s ease; }
    .finance-related-slide.open { max-height:1200px; opacity:1; }
    .finance-related-slide-inner { display:grid; gap:8px; padding:0 10px 10px; }
    .finance-related-slide .finance-detail-item { border-color:#fed7aa; background:#fff; }
    .finance-detail-related-note { padding:8px 10px; border-radius:9px; color:#7c2d12; background:#ffedd5; font-size:10px; font-weight:850; line-height:1.5; }
    .finance-detail-item time { color:#64748b; font-size:11px; font-weight:850; }
    .finance-detail-item-main { min-width:0; }
    .finance-detail-item-main b { display:block; color:#153e5c; font-size:13px; }
    .finance-detail-item-main small { display:block; margin-top:3px; color:#64748b; font-size:11px; overflow-wrap:anywhere; }
    .finance-detail-item-side { text-align:right; }
    .finance-detail-item-side strong { display:block; color:var(--detail-accent,#2563eb); font-size:14px; white-space:nowrap; }
    .finance-detail-item-side a { display:inline-block; margin-top:4px; color:#2563eb; font-size:10px; font-weight:900; text-decoration:none; }
    .finance-detail-empty { padding:28px; border:1px dashed #bfdbfe; border-radius:13px; color:#64748b; background:#fff; text-align:center; font-weight:850; }

    @media (max-width: 640px) {
      .finance-detail-dialog { width:calc(100vw - 16px); max-width:calc(100vw - 16px); max-height:calc(100dvh - 16px); margin:auto; border-radius:16px; }
      .finance-detail-shell { max-height:calc(100dvh - 16px); }
      .finance-detail-head { display:grid; grid-template-columns:minmax(0,1fr) 40px; gap:10px; padding:14px 14px 13px; }
      .finance-detail-head h3 { font-size:18px; line-height:1.35; overflow-wrap:normal; word-break:normal; }
      .finance-detail-head p { font-size:11px; line-height:1.55; overflow-wrap:anywhere; }
      .finance-detail-close { flex-basis:40px !important; width:40px !important; min-width:40px; max-width:40px; height:40px; justify-self:end; }
      .finance-detail-body { padding:13px 12px 18px; }
      .finance-detail-summary { grid-template-columns:1fr; }
      .finance-detail-summary > div { padding:10px 12px; }
      .finance-detail-summary strong { font-size:18px; }
      .finance-detail-category { max-width:100%; box-sizing:border-box; }
      .finance-detail-item { grid-template-columns:minmax(0,1fr); gap:6px; padding:10px; }
      .finance-detail-item time { grid-column:auto; }
      .finance-detail-item-side { display:flex; align-items:center; justify-content:space-between; gap:10px; text-align:left; }
      .finance-detail-item-side a { margin-top:0; text-align:right; }
      .finance-related-inline { margin-left:4px; }
      .finance-related-toggle { align-items:flex-start; }
      .finance-related-toggle-label { align-items:flex-start; }
    }

    .finance-trend-panel {
      margin-top: 14px;
    }

    .finance-trend-head {
      align-items: center;
    }

    .finance-trend-tabs {
      display: inline-flex;
      gap: 4px;
      padding: 4px;
      border-radius: 10px;
      background: #e8f3fb;
    }

    .finance-trend-tabs button {
      min-height: 34px;
      padding: 6px 13px;
      border: 0;
      border-radius: 8px;
      background: transparent;
      color: #48637d;
      cursor: pointer;
      font: inherit;
      font-size: 12px;
      font-weight: 900;
    }

    .finance-trend-tabs button.active {
      background: #ffffff;
      color: #0f2f4f;
      box-shadow: 0 4px 12px rgba(37, 99, 235, 0.14);
    }

    .finance-trend-summary {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
      margin: 4px 0 12px;
    }

    .finance-trend-stat {
      min-width: 0;
      padding: 10px 12px;
      border: 1px solid #bfdbfe;
      border-radius: 10px;
      background: linear-gradient(135deg, #eff6ff, #ffffff);
      box-shadow: 0 6px 16px rgba(37, 99, 235, 0.08);
    }

    .finance-trend-stat span {
      display: block;
      color: #48637d;
      font-size: 10px;
      font-weight: 850;
    }

    .finance-trend-stat strong {
      display: block;
      margin-top: 3px;
      color: #0f2f4f;
      font-size: 16px;
      font-variant-numeric: tabular-nums;
      font-weight: 950;
      white-space: nowrap;
    }


    .finance-trend-chart {
      height: 320px;
      min-width: 0;
      overflow: hidden;
    }

    .finance-trend-chart svg {
      display: block;
      width: 100%;
      height: 100%;
      overflow: visible;
    }

    .finance-trend-gridline {
      stroke: rgba(100, 116, 139, 0.18);
      stroke-width: 1;
    }

    .finance-trend-chart text {
      fill: #48637d;
      font-size: 11px;
      font-weight: 800;
    }

    .finance-trend-value rect {
      fill: #ffffff;
      stroke-width: 2;
      filter: drop-shadow(0 4px 6px rgba(15, 47, 79, 0.16));
    }

    .finance-trend-value text {
      font-size: 10px;
      font-variant-numeric: tabular-nums;
      font-weight: 950;
    }

    .finance-trend-series--revenue .finance-trend-value rect { stroke: #2563eb; fill: #eff6ff; }
    .finance-trend-series--revenue .finance-trend-value text { fill: #1d4ed8; }
    .finance-trend-series--expense .finance-trend-value rect { stroke: #ef4444; fill: #fff1f2; }
    .finance-trend-series--expense .finance-trend-value text { fill: #b91c1c; }
    .finance-trend-series--profit .finance-trend-value rect { stroke: #16a34a; fill: #f0fdf4; }
    .finance-trend-series--profit .finance-trend-value text { fill: #15803d; }

    .finance-trend-series {
      display: none;
    }

    .finance-trend-series.active {
      display: block;
    }

    .finance-trend-series polyline {
      fill: none;
      stroke-width: 4;
      stroke-linecap: round;
      stroke-linejoin: round;
    }

    .finance-trend-series .finance-trend-spark {
      fill: none;
      stroke: rgba(255, 255, 255, 0.96);
      stroke-width: 3;
      stroke-linecap: round;
      stroke-dasharray: 3 34;
      filter: drop-shadow(0 0 5px currentColor);
      pointer-events: none;
      animation: finance-line-light-run 1.8s linear infinite;
    }

    @keyframes finance-line-light-run {
      to { stroke-dashoffset: -74; }
    }

    @media (prefers-reduced-motion: reduce) {
      .finance-period-total-row:after,
      .finance-period-average-row:after,
      .finance-trend-series .finance-trend-spark {
        animation: none;
      }
    }

    .finance-trend-series circle {
      stroke: #ffffff;
      stroke-width: 3;
    }

    .finance-trend-series--revenue polyline { stroke: #2563eb; }
    .finance-trend-series--revenue circle { fill: #2563eb; }
    .finance-trend-series--expense polyline { stroke: #dc2626; }
    .finance-trend-series--expense circle { fill: #dc2626; }
    .finance-trend-series--profit polyline { stroke: #16a34a; }
    .finance-trend-series--profit circle { fill: #16a34a; }

    .dash-modern-analysis-split {
      display: grid;
      grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
      gap: 14px;
    }

    .dash-modern-mini-panel {
      min-width: 0;
      padding: 14px;
      border-radius: 14px;
      background: rgba(2, 6, 23, 0.18);
      border: 1px solid rgba(148, 163, 184, 0.16);
    }

    .dash-modern-mini-panel h4 {
      margin: 0 0 12px;
      color: #e5f0ff;
      font-size: 16px;
      font-weight: 950;
    }

    .dash-modern-zone-list {
      display: grid;
      gap: 10px;
    }

    .dash-modern-zone-row {
      display: grid;
      grid-template-columns: 34px minmax(0, 1fr) auto;
      gap: 10px;
      align-items: center;
      padding: 11px;
      border-radius: 12px;
      background: rgba(15, 23, 42, 0.46);
      border: 1px solid rgba(148, 163, 184, 0.14);
    }

    .dash-modern-zone-rank {
      display: grid;
      place-items: center;
      width: 30px;
      height: 30px;
      border-radius: 999px;
      color: #082f49;
      background: #7dd3fc;
      font-weight: 950;
    }

    .dash-modern-zone-name,
    .dash-modern-zone-profit {
      color: #e5f0ff;
      font-weight: 950;
    }

    .dash-modern-zone-name small,
    .dash-modern-zone-profit small {
      display: block;
      margin-top: 3px;
      color: var(--dash-muted);
      font-size: 11px;
      font-weight: 850;
    }

    .dash-modern-ops-grid {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
      gap: 14px;
      align-items: stretch;
    }

    .dash-modern-peak-bars {
      display: grid;
      gap: 11px;
    }

    .dash-modern-peak-row {
      display: grid;
      grid-template-columns: 74px minmax(0, 1fr) 58px;
      gap: 10px;
      align-items: center;
      color: #e5f0ff;
      font-weight: 950;
    }

    .dash-modern-peak-track {
      height: 13px;
      overflow: hidden;
      border-radius: 999px;
      background: rgba(148, 163, 184, 0.16);
    }

    .dash-modern-peak-fill {
      height: 100%;
      min-width: 4px;
      border-radius: inherit;
      background: linear-gradient(90deg, #f59e0b, #ef4444);
    }

    .dash-modern-map-wrap {
      display: grid;
      gap: 12px;
    }

    #dashboardCustomerMap {
      width: 100%;
      min-height: 360px;
      overflow: hidden;
      border-radius: 14px;
      border: 1px solid rgba(148, 163, 184, 0.20);
      background: rgba(15, 23, 42, 0.66);
    }

    .dash-modern-map-legend {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      color: #cbd5e1;
      font-size: 12px;
      font-weight: 900;
    }

    .dash-modern-map-legend span {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 6px 9px;
      border-radius: 999px;
      background: rgba(15, 31, 52, 0.78);
      border: 1px solid rgba(148, 163, 184, 0.16);
    }

    .dash-modern-marker {
      display: block;
      width: 18px;
      height: 18px;
      border-radius: 999px 999px 999px 4px;
      transform: rotate(-45deg);
      border: 2px solid #ffffff;
      box-shadow: 0 8px 18px rgba(2, 6, 23, 0.35);
    }

    .dash-modern-marker.pending { background: #ef4444; }
    .dash-modern-marker.traveling { background: #f59e0b; }
    .dash-modern-marker.done { background: #22c55e; }

    .dash-modern-map-real {
      min-height: 360px;
      background:
        linear-gradient(135deg, rgba(239, 246, 255, 0.96), rgba(255, 255, 255, 0.98)) !important;
    }

    .dash-modern-map-fallback {
      min-height: 360px;
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(260px, 330px);
      color: #0f2f4f;
    }

    .dash-modern-map-canvas {
      position: relative;
      min-height: 360px;
      overflow: hidden;
      border-right: 1px solid rgba(37, 99, 235, 0.14);
      background: #e8f3fb;
    }

    .dash-modern-map-frame {
      position: absolute;
      inset: 0;
      z-index: 1;
      width: 100%;
      height: 100%;
      overflow: hidden;
      background: #e8f3fb;
    }

    .dash-modern-map-tile {
      position: absolute;
      width: 256px;
      height: 256px;
      user-select: none;
      pointer-events: none;
    }

    .dash-modern-map-points {
      position: absolute;
      inset: 0;
      z-index: 6;
      pointer-events: none;
    }

    .dash-modern-map-attribution {
      position: absolute;
      left: 10px;
      bottom: 8px;
      z-index: 5;
      padding: 4px 7px;
      border-radius: 7px;
      background: rgba(255, 255, 255, 0.88);
      color: #486987;
      font-size: 11px;
      font-weight: 800;
    }

    .dash-modern-map-compass {
      position: absolute;
      top: 14px;
      right: 14px;
      z-index: 650;
      display: grid;
      justify-items: center;
      gap: 3px;
      min-width: 58px;
      padding: 8px 9px;
      border-radius: 8px;
      border: 1px solid rgba(37, 99, 235, 0.18);
      background: rgba(255, 255, 255, 0.92);
      color: #0f2f4f;
      font-size: 11px;
      font-weight: 900;
      line-height: 1.1;
      box-shadow: 0 10px 22px rgba(14, 116, 144, 0.12);
      pointer-events: none;
    }

    .dash-modern-map-compass:before {
      content: "";
      width: 0;
      height: 0;
      border-left: 8px solid transparent;
      border-right: 8px solid transparent;
      border-bottom: 20px solid #ef4444;
      filter: drop-shadow(0 4px 7px rgba(15, 23, 42, 0.20));
    }

    .dash-modern-map-compass strong {
      display: block;
      color: #0f2f4f;
      font-size: 16px;
      line-height: 1;
    }

    .dash-modern-map-compass span {
      color: #486987;
      white-space: nowrap;
    }

    .dash-modern-map-point {
      position: absolute;
      z-index: 6;
      width: 24px;
      height: 24px;
      border-radius: 999px 999px 999px 4px;
      transform: translate(-50%, -100%) rotate(-45deg);
      border: 2px solid #ffffff;
      background: var(--marker, #ef4444);
      box-shadow: 0 12px 24px rgba(15, 23, 42, 0.24);
      transition: transform 0.18s ease, box-shadow 0.18s ease;
      pointer-events: auto;
    }

    .dash-modern-map-point:hover {
      transform: translate(-50%, -100%) rotate(-45deg) scale(1.14);
      box-shadow: 0 16px 30px rgba(15, 23, 42, 0.30);
    }

    .dash-modern-map-list {
      display: grid;
      align-content: start;
      gap: 10px;
      max-height: 360px;
      overflow: auto;
      padding: 14px;
      background: rgba(255, 255, 255, 0.72);
    }

    .dash-modern-map-card {
      display: grid;
      gap: 6px;
      padding: 11px 12px;
      border-radius: 8px;
      border: 1px solid rgba(37, 99, 235, 0.16);
      background: rgba(255, 255, 255, 0.92);
      box-shadow: 0 10px 20px rgba(37, 99, 235, 0.08);
    }

    .dash-modern-map-card strong {
      color: #0f2f4f;
      font-size: 13px;
      line-height: 1.3;
    }

    .dash-modern-map-card span {
      color: #486987;
      font-size: 12px;
      font-weight: 800;
      line-height: 1.35;
    }

    .dash-modern-map-card a {
      justify-self: start;
      display: inline-flex;
      align-items: center;
      min-height: 30px;
      padding: 6px 10px;
      border-radius: 8px;
      background: #0ea5e9;
      color: #ffffff;
      font-size: 12px;
      font-weight: 900;
      text-decoration: none;
    }

    .dash-modern .dash-modern-category-head,
    .dash-modern .dash-modern-kpi,
    .dash-modern .dash-modern-panel,
    .dash-modern .dash-modern-analysis-card,
    .dash-modern .dash-modern-mini-panel,
    .dash-modern .dash-modern-period-card,
    .dash-modern .dash-modern-zone-row,
    .dash-modern .dash-modern-map-legend span {
      background: rgba(255, 255, 255, 0.90) !important;
      border-color: rgba(37, 99, 235, 0.18) !important;
      color: #0f2f4f !important;
      box-shadow: 0 14px 30px rgba(37, 99, 235, 0.10) !important;
    }

    .dash-modern .dash-modern-category-head {
      position: relative;
      overflow: hidden;
      padding: 13px 16px !important;
      border-color: rgba(14, 165, 233, 0.24) !important;
      background: linear-gradient(90deg, #ffffff 0%, #eefaff 48%, #e7f4ff 100%) !important;
      box-shadow: 0 12px 24px rgba(14, 116, 144, 0.10) !important;
    }

    .dash-modern .dash-modern-category-head:after {
      content: "";
      position: absolute;
      inset: 0 auto 0 0;
      width: 4px;
      background: var(--category-dot, var(--dash-blue));
    }

    .dash-modern .dash-modern-category-head strong {
      color: #0b3658 !important;
      font-size: 16px;
      font-weight: 950;
      text-shadow: none;
    }

    .dash-modern .dash-modern-category-head span {
      color: #244b6c !important;
      font-size: 12.5px;
      font-weight: 900;
    }

    .dash-modern .dash-modern-category-head strong:before {
      width: 12px;
      height: 12px;
      box-shadow: 0 0 0 5px rgba(14, 165, 233, 0.16);
    }

    .dash-modern .dash-modern-kpi strong,
    .dash-modern .dash-modern-period-top h4,
    .dash-modern .dash-modern-period-line strong,
    .dash-modern .dash-modern-zone-name,
    .dash-modern .dash-modern-zone-profit,
    .dash-modern .dash-modern-peak-row,
    .dash-modern .dash-modern-bar-label,
    .dash-modern .dash-modern-bar-value,
    .dash-modern .dash-modern-pie-row,
    .dash-modern .dash-modern-table td,
    .dash-modern .dash-modern-panel h3,
    .dash-modern .dash-modern-mini-panel h4,
    .dash-modern .dash-modern-analysis-card strong {
      color: #0f2f4f !important;
    }

    .dash-modern .dash-modern-kpi span,
    .dash-modern .dash-modern-kpi small,
    .dash-modern .dash-modern-panel p,
    .dash-modern .dash-modern-period-line span,
    .dash-modern .dash-modern-period-top small,
    .dash-modern .dash-modern-analysis-card span,
    .dash-modern .dash-modern-analysis-card small,
    .dash-modern .dash-modern-zone-name small,
    .dash-modern .dash-modern-zone-profit small,
    .dash-modern .dash-modern-pie-row small,
    .dash-modern .dash-modern-sub,
    .dash-modern .dash-modern-category-head span {
      color: #48637d !important;
    }

    .dash-modern .dash-modern-table th {
      color: #0f2f4f !important;
      background: #dff1ff !important;
    }

    .dash-modern .dash-modern-badge {
      min-width: 86px;
      color: #0f2f4f !important;
      background: #eef8ff !important;
      border-color: rgba(37, 99, 235, 0.28) !important;
      box-shadow: 0 6px 14px rgba(15, 47, 79, 0.08);
      font-size: 13px;
      font-weight: 950;
    }

    .dash-modern .dash-modern-badge.ok {
      color: #064e3b !important;
      background: #dcfce7 !important;
      border-color: #22c55e !important;
      box-shadow: 0 8px 18px rgba(34, 197, 94, 0.18);
    }

    .dash-modern .dash-modern-badge.warn {
      color: #78350f !important;
      background: #fef3c7 !important;
      border-color: #f59e0b !important;
    }

    .dash-modern .dash-modern-badge.danger {
      color: #7f1d1d !important;
      background: #fee2e2 !important;
      border-color: #ef4444 !important;
    }

    .dash-modern .dash-modern-table-wrap,
    .dash-modern #dashboardCustomerMap {
      border-color: rgba(37, 99, 235, 0.18) !important;
      background: rgba(255, 255, 255, 0.78) !important;
    }

    .dash-modern .dash-modern-track,
    .dash-modern .dash-modern-period-track,
    .dash-modern .dash-modern-peak-track {
      background: #d8e8f7 !important;
    }

    .dash-modern .dash-modern-pie:after {
      background: #ffffff !important;
      box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.16);
    }

    .dash-modern .dash-modern-actions .btn {
      color: #0f2f4f !important;
      background: rgba(255, 255, 255, 0.88) !important;
      border-color: rgba(37, 99, 235, 0.20) !important;
    }

    .dash-modern .dash-modern-kpi.pending {
      background: rgba(255, 255, 255, 0.90) !important;
      border-color: rgba(37, 99, 235, 0.18) !important;
      color: #0f2f4f !important;
    }

    .dash-modern-grid {
      display: grid;
      grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
      gap: 14px;
      align-items: stretch;
    }

    .dash-modern-panel {
      padding: 18px;
    }

    .dash-modern-panel-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 16px;
    }

    .dash-modern-panel h3 {
      font-size: 21px;
      line-height: 1.25;
    }

    .dash-modern-panel p {
      margin: 5px 0 0;
      color: var(--dash-muted);
      font-size: 13px;
      font-weight: 800;
      line-height: 1.45;
    }

    .visitor-insight-grid { display:grid; grid-template-columns:minmax(0,1.35fr) minmax(300px,.65fr); gap:14px; }
    .visitor-chart { align-items:end; display:grid; grid-template-columns:repeat(30,minmax(8px,1fr)); gap:4px; height:220px; padding-top:28px; }
    .visitor-chart-day { align-items:center; display:flex; flex-direction:column; height:100%; justify-content:flex-end; min-width:0; position:relative; }
    .visitor-chart-bars { align-items:end; display:flex; gap:2px; height:170px; width:100%; }
    .visitor-chart-bar { border-radius:7px 7px 2px 2px; display:block; min-height:3px; width:50%; }
    .visitor-chart-bar.views { background:linear-gradient(180deg,#38bdf8,#2563eb); }
    .visitor-chart-bar.google { background:linear-gradient(180deg,#fbbf24,#f97316); }
    .visitor-chart-day small { color:#64748b; font-size:9px; margin-top:7px; transform:rotate(-45deg); white-space:nowrap; }
    .visitor-metrics { display:grid; gap:10px; grid-template-columns:repeat(2,minmax(0,1fr)); }
    .visitor-metric { background:#eff6ff; border:1px solid #bfdbfe; border-radius:14px; padding:14px; }
    .visitor-metric strong { color:#0f2f4f; display:block; font-size:25px; margin-top:4px; }
    .visitor-source-list { display:grid; gap:10px; margin-top:14px; }
    .visitor-source-row { display:grid; gap:9px; grid-template-columns:90px minmax(0,1fr) 54px; align-items:center; font-weight:900; }
    .visitor-source-row > span {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .visitor-source-track { background:#dbeafe; border-radius:999px; height:11px; overflow:hidden; }
    .visitor-source-fill { background:linear-gradient(90deg,#14b8a6,#2563eb); border-radius:inherit; height:100%; min-width:3px; }
    .visitor-analysis-cards { display:grid; gap:12px; grid-template-columns:repeat(3,minmax(0,1fr)); margin-top:14px; }
    .visitor-analysis-card { background:linear-gradient(135deg,#eff6ff,#ecfeff); border:1px solid #bae6fd; border-radius:14px; padding:15px; }
    .visitor-analysis-card strong { color:#0f2f4f; display:block; margin-bottom:6px; }
    .visitor-analysis-card p { margin:0; }
    .visitor-page-list .visitor-source-row {
      grid-template-columns: minmax(105px, 34%) minmax(100px, 1fr) 34px;
    }
    .visitor-page-list .visitor-source-row > strong {
      justify-self: end;
      text-align: right;
    }
    @media (max-width:900px) { .visitor-insight-grid,.visitor-analysis-cards { grid-template-columns:1fr; } }
    @media (max-width:760px) {
      .visitor-chart { gap:2px; overflow:hidden; }
      .visitor-chart-day small { display:none; }
      .visitor-metrics { grid-template-columns:1fr 1fr; }
      .visitor-page-list .visitor-source-row { grid-template-columns:92px minmax(70px,1fr) 28px; }
    }

    .dash-modern-legend {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      color: #bdd7ef;
      font-size: 12px;
      font-weight: 900;
    }

    .dash-modern-legend span {
      align-items: center;
      display: inline-flex;
      gap: 6px;
    }

    .dash-modern-dot {
      width: 10px;
      height: 10px;
      border-radius: 999px;
      display: inline-block;
      background: var(--dot, var(--dash-blue));
    }

    .dash-modern-bars {
      display: grid;
      gap: 12px;
    }

    .dash-modern-bar-row {
      display: grid;
      grid-template-columns: 74px minmax(0, 1fr) 118px;
      gap: 12px;
      align-items: center;
    }

    .dash-modern-bar-label {
      color: #dbeafe;
      font-weight: 950;
    }

    .dash-modern-bar-stack {
      display: grid;
      gap: 7px;
    }

    .dash-modern-track {
      height: 12px;
      overflow: hidden;
      border-radius: 999px;
      background: rgba(148, 163, 184, 0.16);
    }

    .dash-modern-fill {
      height: 100%;
      min-width: 3px;
      border-radius: inherit;
    }

    .dash-modern-fill.income { background: linear-gradient(90deg, #38bdf8, #2563eb); }
    .dash-modern-fill.expense { background: linear-gradient(90deg, #fb7185, #dc2626); }
    .dash-modern-fill.quote { background: linear-gradient(90deg, #a78bfa, #7c3aed); }
    .dash-modern-fill.invoice { background: linear-gradient(90deg, #60a5fa, #2563eb); }
    .dash-modern-fill.receipt { background: linear-gradient(90deg, #34d399, #059669); }

    .dash-modern-document-kpis {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 12px;
      margin-bottom: 14px;
    }

    .dash-modern-document-kpi {
      min-width: 0;
      padding: 14px;
      border-radius: 12px;
      border: 1px solid rgba(37, 99, 235, 0.18);
      background: rgba(255, 255, 255, 0.88);
      box-shadow: 0 10px 22px rgba(37, 99, 235, 0.08);
    }

    .dash-modern-document-kpi span {
      display: block;
      color: #48637d;
      font-size: 12px;
      font-weight: 950;
    }

    .dash-modern-document-kpi strong {
      display: block;
      margin-top: 7px;
      color: #0f2f4f;
      font-size: clamp(20px, 1.8vw, 27px);
      line-height: 1.1;
      white-space: nowrap;
    }

    .dash-modern-document-kpi small {
      display: block;
      margin-top: 6px;
      color: #48637d;
      font-weight: 850;
      line-height: 1.35;
    }

    .finance-comparison {
      font-size: 12px;
      font-style: normal;
      font-weight: 950;
      text-align: right;
      white-space: nowrap;
    }

    .finance-comparison--positive { color: #34d399; }
    .finance-comparison--negative { color: #fb7185; }
    .finance-comparison--neutral { color: #94a3b8; }
    .dash-modern .finance-comparison--positive { color: #15803d; }
    .dash-modern .finance-comparison--negative { color: #dc2626; }
    .dash-modern .finance-comparison--neutral { color: #64748b; }

    .finance-comparison-caption {
      margin-top: 10px;
      color: #7f95af;
      font-size: 11px;
      font-weight: 800;
      text-align: right;
    }

    html:has(body.repair-edit-modal-open) {
      overflow: hidden;
    }
    body.repair-edit-modal-open {
      height: 100dvh;
      overflow: hidden !important;
      overscroll-behavior: none;
    }

    .repair-edit-modal {
      position: fixed;
      inset: 0;
      z-index: 10000;
      display: grid;
      place-items: center;
      padding: 22px;
    }

    .repair-edit-modal-backdrop {
      position: absolute;
      inset: 0;
      background: rgba(15, 23, 42, 0.68);
      backdrop-filter: blur(7px);
    }

    .repair-edit-modal-dialog {
      position: relative;
      z-index: 1;
      width: min(1180px, 100%);
      max-height: calc(100vh - 44px);
      overflow: auto;
      border-radius: 20px;
      background: #f4f9ff;
      border: 1px solid rgba(147, 197, 253, 0.72);
      box-shadow: 0 30px 80px rgba(15, 23, 42, 0.34);
      overscroll-behavior: contain;
    }

    .repair-edit-modal-bar {
      position: sticky;
      top: 0;
      z-index: 20;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      min-height: 64px;
      padding: 12px 18px;
      color: #ffffff;
      background: linear-gradient(135deg, #0f766e 0%, #2563eb 58%, #7c3aed 100%);
      box-shadow: 0 8px 22px rgba(37, 99, 235, 0.20);
    }

    .repair-edit-modal-bar strong {
      font-size: 18px;
      line-height: 1.25;
    }

    .repair-edit-modal-bar-actions {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 8px;
      margin-left: auto;
    }

    .repair-edit-modal-action {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 44px;
      padding: 9px 15px;
      border: 1px solid rgba(255, 255, 255, 0.58);
      border-radius: 12px;
      box-shadow: 0 7px 18px rgba(15, 23, 42, 0.18);
      font: inherit;
      font-size: 14px;
      font-weight: 900;
      line-height: 1.2;
      text-align: center;
      text-decoration: none;
      cursor: pointer;
      white-space: nowrap;
    }

    .repair-edit-modal-action-save {
      color: #ffffff;
      background: #0f766e;
    }

    .repair-edit-modal-action-copy {
      color: #0c4a6e;
      background: #e0f2fe;
      border-color: #7dd3fc;
    }

    .repair-edit-modal-action-save-close {
      color: #ffffff;
      background: #16a34a;
    }

    .repair-edit-modal-close {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      flex: 0 0 auto;
      min-width: 76px;
      min-height: 40px;
      padding: 8px 16px;
      border-radius: 10px;
      color: #ffffff;
      background: #dc2626;
      border: 1px solid #fecaca;
      box-shadow: 0 7px 18px rgba(127, 29, 29, 0.24);
      font-size: 15px;
      font-weight: 900;
      text-decoration: none;
    }

    .dash-modern-map-more {
      border: 1px solid rgba(37, 99, 235, 0.18);
      border-radius: 10px;
      background: rgba(239, 246, 255, 0.86);
    }

    .dash-modern-map-more summary {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      padding: 9px 11px;
      color: #1d4ed8;
      font-size: 12px;
      font-weight: 950;
      cursor: pointer;
      list-style: none;
    }

    .dash-modern-map-more summary::-webkit-details-marker { display: none; }
    .dash-modern-map-more summary:after { content: "⌄"; font-size: 16px; line-height: 1; transition: transform .18s ease; }
    .dash-modern-map-more[open] summary:after { transform: rotate(180deg); }
    .dash-modern-map-more summary span { margin-left: auto; color: #64748b; font-size: 10px; }
    .dash-modern-map-more-list { display: grid; gap: 8px; padding: 0 8px 8px; }

    .repair-edit-modal-dialog .edit-order-panel {
      margin: 0;
      border: 0;
      border-radius: 0;
      box-shadow: none;
    }

    .repair-edit-modal-dialog .edit-order-actions {
      grid-template-columns: repeat(5, minmax(0, 1fr));
      width: min(920px, 100%);
      margin-left: auto;
      margin-right: auto;
    }

    @media (max-width: 760px) {
      .repair-edit-modal {
        padding: 0;
      }

      .repair-edit-modal-dialog {
        width: 100%;
        max-height: 100vh;
        min-height: 100vh;
        border-radius: 0;
      }

      .repair-edit-modal-bar {
        min-height: 58px;
        padding: 9px 12px;
        align-items: stretch;
        flex-wrap: wrap;
        gap: 8px;
      }

      .repair-edit-modal-bar strong {
        flex: 1 1 100%;
        font-size: 16px;
      }

      .repair-edit-modal-bar-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        margin-left: 0;
      }

      .repair-edit-modal-action,
      .repair-edit-modal-close {
        width: 100%;
        min-width: 0;
        min-height: 44px;
        padding: 8px 7px;
        font-size: 13px;
        white-space: normal;
      }

      .repair-edit-modal-dialog .edit-order-actions {
        grid-template-columns: repeat(2, minmax(0, 42%));
        justify-content: center;
        width: 100%;
      }
    }

    .dash-modern-document-chart {
      position: relative;
      overflow-x: auto;
      padding: 22px 18px 14px;
      border-radius: 16px;
      border: 1px solid rgba(191, 219, 254, 0.82);
      background:
        linear-gradient(to top, rgba(15, 47, 79, 0.07) 1px, transparent 1px) 0 0 / 100% 25%,
        linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 16px 30px rgba(37, 99, 235, 0.07);
    }

    .dash-modern-document-chart-inner {
      position: relative;
      display: grid;
      grid-template-columns: repeat(6, minmax(104px, 1fr));
      gap: 18px;
      min-height: 282px;
      min-width: 720px;
      box-sizing: border-box;
    }

    .dash-modern-document-month {
      display: grid;
      grid-template-rows: 1fr auto;
      gap: 10px;
      min-width: 0;
    }

    .dash-modern-document-stage {
      display: flex;
      align-items: end;
      justify-content: center;
      gap: 10px;
      min-height: 220px;
      padding: 12px 8px 0;
      border-bottom: 1px solid rgba(15, 47, 79, 0.10);
    }

    .dash-modern-document-bar {
      position: relative;
      width: min(26%, 30px);
      min-width: 15px;
      height: max(7px, var(--bar-height));
      border-radius: 10px 10px 3px 3px;
      box-shadow: 0 12px 20px rgba(15, 47, 79, 0.10);
      transform-origin: bottom;
      animation: dashChartGrow 860ms cubic-bezier(.2,.85,.25,1) both;
      animation-delay: var(--bar-delay, 0ms);
      transition: opacity .18s ease, transform .18s ease, box-shadow .18s ease;
    }

    .dash-modern-document-bar:hover {
      transform: translateY(-2px);
      box-shadow: 0 15px 24px rgba(15, 47, 79, 0.14);
    }

    .dash-modern-document-bar.quote {
      background: linear-gradient(180deg, #ff9f43 0%, #ff6b1a 55%, #ea580c 100%);
    }

    .dash-modern-document-bar.invoice {
      background: linear-gradient(180deg, #93c5fd 0%, #3b82f6 58%, #1d4ed8 100%);
    }

    .dash-modern-document-bar.receipt {
      background: linear-gradient(180deg, #6ee7b7 0%, #10b981 58%, #047857 100%);
    }

    .dash-modern-document-bar:after {
      content: attr(data-value);
      position: absolute;
      left: 50%;
      bottom: calc(100% + 8px);
      transform: translate(-50%, 4px);
      opacity: 0;
      padding: 5px 8px;
      border-radius: 8px;
      color: #0f2f4f;
      background: rgba(255, 255, 255, 0.98);
      border: 1px solid rgba(191, 219, 254, 0.95);
      box-shadow: 0 10px 18px rgba(15, 47, 79, 0.13);
      font-size: 11px;
      font-weight: 950;
      white-space: nowrap;
      transition: opacity .18s ease, transform .18s ease;
      pointer-events: none;
      z-index: 5;
    }

    .dash-modern-document-bar:hover:after {
      opacity: 1;
      transform: translate(-50%, 0);
    }

    .dash-modern-document-month-label {
      display: grid;
      gap: 4px;
      color: #0f2f4f;
      text-align: center;
      font-weight: 950;
    }

    .dash-modern-document-month-label small {
      color: #48637d;
      font-size: 11px;
      font-weight: 850;
    }

    .dash-modern-document-legend {
      color: #0f2f4f !important;
      font-size: 13px !important;
      font-weight: 950 !important;
    }

    .dash-modern-document-toggle {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      min-height: 30px;
      padding: 5px 10px;
      border-radius: 999px;
      border: 1px solid rgba(191, 219, 254, 0.96);
      background: rgba(255, 255, 255, 0.90);
      color: #0f2f4f !important;
      cursor: pointer;
      user-select: none;
    }

    .dash-modern-document-toggle input {
      width: 15px;
      height: 15px;
      margin: 0;
      accent-color: var(--series-color);
      cursor: pointer;
    }

    .dash-modern-document-legend span {
      color: #0f2f4f !important;
    }

    .dash-modern-document-chart.hide-quote .dash-modern-document-bar.quote,
    .dash-modern-document-chart.hide-invoice .dash-modern-document-bar.invoice,
    .dash-modern-document-chart.hide-receipt .dash-modern-document-bar.receipt {
      opacity: 0;
      pointer-events: none;
    }

    .dash-modern-bar-value {
      display: grid;
      gap: 3px;
      color: #dbeafe;
      font-size: 12px;
      font-weight: 900;
      text-align: right;
      white-space: nowrap;
    }

    .dash-modern-pie-wrap {
      display: grid;
      grid-template-columns: 188px minmax(0, 1fr);
      gap: 18px;
      align-items: center;
    }

    .dash-modern-pie {
      width: 188px;
      aspect-ratio: 1;
      border-radius: 50%;
      background: conic-gradient(var(--pie-stops));
      display: grid;
      place-items: center;
      box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 18px 34px rgba(2, 6, 23, 0.28);
    }

    .dash-modern-pie:after {
      content: "";
      width: 92px;
      aspect-ratio: 1;
      border-radius: 50%;
      background: #0d1b2e;
      box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.20);
    }

    .dash-modern-pie-list {
      display: grid;
      gap: 10px;
    }

    .dash-modern-pie-row {
      display: grid;
      grid-template-columns: 14px minmax(0, 1fr) auto;
      gap: 9px;
      align-items: center;
      color: #dbeafe;
      font-weight: 900;
    }

    .dash-modern-pie-row small {
      color: var(--dash-muted);
      font-weight: 900;
    }

    .dash-modern-table-wrap {
      overflow-x: auto;
      border: 1px solid rgba(148, 163, 184, 0.18);
      border-radius: 12px;
    }

    .dash-modern-table {
      width: 100%;
      min-width: 720px;
      border-collapse: collapse;
      box-shadow: none !important;
      background: transparent !important;
    }

    .dash-modern-table th,
    .dash-modern-table td {
      padding: 13px 14px;
      border-bottom: 1px solid rgba(148, 163, 184, 0.16);
      text-align: left;
      white-space: nowrap;
    }

    .dash-modern-table th {
      color: #bfdbfe;
      background: rgba(15, 23, 42, 0.58) !important;
      font-size: 13px;
      font-weight: 950;
    }

    .dash-modern-table td {
      color: #e5f0ff;
      background: transparent !important;
      font-weight: 850;
    }

    .dash-modern-table tr:last-child td {
      border-bottom: 0;
    }

    .dash-modern-badge {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 28px;
      padding: 5px 10px;
      border-radius: 999px;
      color: #ffffff;
      background: rgba(56, 189, 248, 0.18);
      border: 1px solid rgba(56, 189, 248, 0.32);
      font-size: 12px;
      font-weight: 950;
    }

    .dash-modern-badge.warn {
      background: rgba(245, 158, 11, 0.18);
      border-color: rgba(245, 158, 11, 0.38);
      color: #fde68a;
    }

    .dash-modern-badge.danger {
      background: rgba(251, 113, 133, 0.18);
      border-color: rgba(251, 113, 133, 0.42);
      color: #fecdd3;
    }

    .dash-modern-badge.ok {
      background: rgba(34, 197, 94, 0.18);
      border-color: rgba(34, 197, 94, 0.40);
      color: #bbf7d0;
    }

    .dash-modern-empty {
      padding: 16px;
      border: 1px dashed rgba(148, 163, 184, 0.32);
      border-radius: 12px;
      color: #cbd5e1;
      font-weight: 900;
      text-align: center;
    }

    @keyframes dashChartGrow {
      from {
        transform: scaleY(0.08);
        opacity: 0.2;
      }
      to {
        transform: scaleY(1);
        opacity: 1;
      }
    }

    @keyframes dashProfitSweep {
      from {
        width: 0;
        opacity: 0.25;
      }
      to {
        width: var(--profit-width);
        opacity: 1;
      }
    }

    @media (max-width: 1040px) {
      .dash-modern-head,
      .dash-modern-grid,
      .dash-modern-ops-grid,
      .dash-modern-analysis-split {
        grid-template-columns: 1fr;
      }

      .dash-modern-head {
        display: grid;
      }

      .dash-modern-actions {
        justify-content: flex-start;
      }

      .dash-modern-category-head {
        align-items: flex-start;
        display: grid;
      }

      .dash-modern-category-head span {
        text-align: left;
      }

      .dash-modern-kpis,
      .dash-modern-document-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }

      .dash-modern-overview-bars {
        overflow-x: auto;
        grid-template-columns: repeat(6, minmax(120px, 1fr));
      }

      .dash-modern-analysis-grid,
      .dash-modern-period-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }

      .dash-modern-period-card,
      .dash-modern-period-card:nth-child(n + 4) {
        grid-column: auto;
      }
    }

    @media (max-width: 680px) {
      .dash-modern {
        padding: 12px;
        border-radius: 10px;
      }

      .dash-modern-kpis,
      .dash-modern-document-kpis,
      .dash-modern-grid,
      .dash-modern-analysis-grid,
      .dash-modern-analysis-split,
      .dash-modern-period-grid,
      .dash-modern-ops-grid,
      .dash-modern-pie-wrap {
        grid-template-columns: 1fr;
      }

      .dash-modern-period-line {
        grid-template-columns: 54px minmax(40px, 1fr) minmax(88px, auto);
        gap: 7px;
      }

      .dash-modern-period-line strong {
        text-align: right;
      }

      .dash-modern-period-line .finance-comparison {
        grid-column: 3;
        margin-top: -4px;
      }

      .finance-period-bar-row {
        grid-template-columns: 42px minmax(30px, 1fr) minmax(92px, auto);
        gap: 6px;
      }

      .finance-period-metric--average .finance-period-bar-row--previous,
      .finance-period-metric--average .finance-period-pair-track,
      .finance-period-metric--average .finance-period-bar-row small {
        display: none;
      }

      .finance-period-metric--average .finance-period-bar-row--current {
        display: block;
        margin-top: 3px;
        text-align: right;
      }

      .finance-period-metric--average .finance-period-bar-row strong {
        display: block;
        font-size: 12px;
      }

      .finance-period-total-row {
        grid-template-columns: 1fr auto;
        gap: 5px 10px;
      }

      .finance-period-total-row > span {
        grid-column: 1 / -1;
      }

      .finance-period-total-row > strong {
        text-align: left;
      }

      .finance-period-total-row .finance-comparison {
        text-align: right;
      }

      .finance-service-usage {
        padding: 11px;
      }

      .finance-service-usage-head {
        display: grid;
        gap: 3px;
      }

      .finance-service-usage-head span {
        text-align: left;
      }

      .finance-service-usage-row {
        gap: 6px;
      }

      .finance-service-item {
        padding: 8px 7px;
      }

      .finance-service-item-top {
        display: grid;
        gap: 4px;
      }

      .finance-service-full-label { display: none; }
      .finance-service-short-label { display: inline; }

      .finance-service-item-top strong {
        font-size: 12px;
      }

      .finance-service-item small {
        min-height: 24px;
        font-size: 8px;
        line-height: 1.35;
        text-align: left;
      }

      .finance-period-days span {
        display: inline;
        margin: 0;
      }

      .finance-trend-head {
        display: grid;
        gap: 12px;
      }

      .finance-trend-tabs {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
      }

      .finance-trend-tabs button {
        min-width: 0;
        padding-inline: 5px;
      }

      .finance-trend-stat strong {
        font-size: 13px;
      }

      .finance-trend-chart {
        height: 250px;
      }

      .dash-modern-actions .btn {
        width: 100%;
      }

      .dash-modern-overview-chart-head {
        display: grid;
      }

      .dash-modern-overview-legend {
        justify-content: flex-start;
      }

      .dash-modern-kpi strong {
        font-size: 25px;
      }

      .dash-modern-bar-row {
        grid-template-columns: 1fr;
      }

      .dash-modern-bar-value {
        text-align: left;
      }

      .dash-modern-pie {
        width: min(220px, 100%);
        justify-self: center;
      }

      .dash-modern-panel {
        padding: 14px;
      }

      #dashboardCustomerMap {
        min-height: 300px;
      }

      .dash-modern-map-fallback {
        grid-template-columns: 1fr;
      }

      .dash-modern-map-canvas {
        min-height: 300px;
        border-right: 0;
        border-bottom: 1px solid rgba(37, 99, 235, 0.14);
      }

      .dash-modern-map-list {
        max-height: none;
      }

      /* Keep the long dashboard compact and readable on phones. */
      .dash-modern {
        gap: 9px;
        padding: 8px;
      }

      .dash-modern-head {
        gap: 8px;
        padding: 2px 1px;
      }

      .dash-modern h2 {
        margin-top: 2px;
        font-size: 20px;
        line-height: 1.18;
      }

      .dash-modern-sub {
        margin-top: 3px;
        font-size: 11px;
        line-height: 1.35;
      }

      .dash-modern-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        width: 100%;
      }

      .dash-modern-actions .btn {
        min-height: 36px;
        padding: 7px 9px;
        font-size: 11px;
      }

      .dash-modern .dash-modern-category-head {
        gap: 4px;
        padding: 8px 10px !important;
      }

      .dash-modern .dash-modern-category-head strong {
        font-size: 13px;
      }

      .dash-modern .dash-modern-category-head span {
        font-size: 10px;
        line-height: 1.3;
      }

      .dash-modern-kpis,
      .dash-modern-document-kpis,
      .dash-modern-analysis-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
      }

      .dash-modern-kpi {
        min-height: 0;
        padding: 10px 11px;
      }

      .dash-modern-kpi span,
      .dash-modern-analysis-card span,
      .dash-modern-document-kpi span {
        font-size: 10px;
      }

      .dash-modern-kpi strong {
        margin-top: 4px;
        font-size: 19px;
      }

      .dash-modern-kpi small {
        margin-top: 4px;
        font-size: 9px;
        line-height: 1.3;
      }

      .dash-modern-overview-chart {
        gap: 8px;
        padding: 10px;
      }

      .dash-modern-overview-chart h3,
      .dash-modern-panel h3 {
        font-size: 16px;
      }

      .dash-modern-overview-chart p,
      .dash-modern-panel p {
        margin-top: 3px;
        font-size: 10px;
        line-height: 1.35;
      }

      .dash-modern-overview-legend {
        gap: 5px;
        font-size: 9px;
      }

      .dash-modern-overview-legend span {
        gap: 4px;
        padding: 4px 6px;
      }

      .dash-modern-overview-bars {
        min-height: 200px;
        gap: 8px;
        padding: 9px 5px 3px;
      }

      .dash-modern-bar-stage {
        min-height: 142px;
      }

      .dash-modern-panel {
        padding: 10px;
      }

      .dash-modern-panel-head {
        gap: 7px;
        margin-bottom: 9px;
      }

      .dash-modern-analysis,
      .dash-modern-periods {
        gap: 9px;
      }

      .dash-modern-analysis-card {
        min-height: 0;
        padding: 9px 10px;
      }

      .dash-modern-analysis-card strong {
        margin-top: 4px;
        font-size: 17px;
      }

      .dash-modern-analysis-card small {
        margin-top: 4px;
        font-size: 9px;
        line-height: 1.3;
      }

      .dash-modern-mini-panel {
        padding: 9px;
      }

      .dash-modern-mini-panel h4 {
        margin-bottom: 7px;
        font-size: 13px;
      }

      .dash-modern-zone-list,
      .dash-modern-bars,
      .dash-modern-peak-bars,
      .dash-modern-pie-list {
        gap: 6px;
      }

      .dash-modern-zone-row {
        gap: 7px;
        padding: 7px;
      }

      .dash-modern-zone-rank {
        width: 25px;
        height: 25px;
        font-size: 11px;
      }

      .dash-modern-document-kpis {
        margin-bottom: 8px;
      }

      .dash-modern-document-kpi {
        padding: 9px 10px;
      }

      .dash-modern-document-kpi strong {
        margin-top: 3px;
        font-size: 17px;
      }

      .dash-modern-document-kpi small {
        margin-top: 3px;
        font-size: 9px;
      }

      .dash-modern-table th,
      .dash-modern-table td {
        padding: 8px 9px;
        font-size: 11px;
      }

      .dash-modern-period-grid {
        gap: 8px;
      }

      .dash-modern-period-card {
        padding: 10px;
      }

      .dash-modern-period-top {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
        gap: 6px;
        margin-bottom: 8px;
      }

      .dash-modern-period-top h4 {
        font-size: 15px;
        white-space: nowrap;
      }

      .dash-modern-period-top small {
        min-height: 23px;
        padding: 3px 8px;
        font-size: 10px;
      }

      .finance-period-compare-label {
        min-width: 0;
        margin: 0;
        overflow: hidden;
        color: #48637d;
        font-size: 9px;
        text-align: left;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      .finance-period-total-list {
        gap: 6px;
        margin-top: 0;
      }

      .finance-period-total-row {
        grid-template-columns: minmax(78px, 1fr) auto auto;
        gap: 6px;
        padding: 7px 8px;
      }

      .finance-period-total-row > span {
        grid-column: auto;
        white-space: nowrap;
      }

      .finance-period-total-row > strong {
        font-size: 12px;
        text-align: right;
      }

      .finance-period-open-icon {
        width: 18px;
        height: 18px;
        margin-left: 2px;
        font-size: 12px;
      }

      .finance-comparison {
        font-size: 9px;
        white-space: nowrap;
      }

      .finance-average-divider {
        margin-top: 8px;
        padding-top: 7px;
      }

      .finance-average-divider span {
        min-height: 22px;
        padding: 3px 8px;
        font-size: 9px;
      }

      .finance-period-average-list {
        gap: 5px;
        margin-top: 7px;
      }

      .finance-period-average-row {
        padding: 6px 7px;
      }

      .finance-period-average-row > span,
      .finance-period-average-row > strong {
        font-size: 10px;
      }

      .finance-period-days {
        display: flex;
        justify-content: flex-end;
        gap: 4px;
        margin-top: 7px;
        font-size: 9px;
        white-space: nowrap;
      }

      .finance-service-usage {
        gap: 7px;
        padding: 9px;
      }

      .finance-service-icon {
        flex-basis: 28px;
        width: 28px;
        height: 28px;
      }

      .finance-service-icon svg {
        width: 17px;
        height: 17px;
      }

      .finance-service-track {
        height: 7px;
        margin-top: 6px;
      }

      .finance-service-item small {
        min-height: 0;
        margin-top: 4px;
      }

      .finance-trend-head {
        gap: 7px;
      }

      .finance-trend-chart {
        height: 190px;
      }

      .visitor-chart {
        height: 165px;
        padding-top: 16px;
      }

      .visitor-chart-bars {
        height: 125px;
      }

      .visitor-metric,
      .visitor-analysis-card {
        padding: 9px;
      }

      .visitor-analysis-cards {
        gap: 7px;
        margin-top: 8px;
      }

      #dashboardCustomerMap,
      .dash-modern-map-real,
      .dash-modern-map-fallback,
      .dash-modern-map-canvas {
        min-height: 230px;
      }

      .dash-modern-map-list {
        gap: 7px;
        padding: 9px;
      }

      .dash-modern-map-card {
        gap: 3px;
        padding: 8px 9px;
      }

      .dash-modern-map-card a {
        min-height: 26px;
        padding: 4px 8px;
        font-size: 10px;
      }

      .dash-modern-map-legend {
        gap: 5px;
        font-size: 9px;
      }

      .dash-modern-map-legend span {
        gap: 4px;
        padding: 4px 6px;
      }

      .dash-modern-pie {
        width: min(150px, 100%);
      }

      .dash-modern-pie:after {
        width: 72px;
      }
    }

    .repair-overview-panel .table-wrap {
      margin-top: 18px;
    }

    .repair-overview-grid {
      display: grid;
      grid-template-columns: repeat(5, minmax(0, 1fr));
      gap: 12px;
      margin-top: 18px;
    }

    .repair-overview-card {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding: 16px;
      border-radius: 16px;
      text-decoration: none;
      color: #ffffff;
      border: 1px solid rgba(255, 255, 255, 0.16);
      box-shadow: 0 16px 30px rgba(15, 23, 42, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.18);
      transition: transform 0.2s ease, box-shadow 0.2s ease, outline-color 0.2s ease;
      overflow: hidden;
      position: relative;
    }

    .repair-overview-card:hover,
    .repair-overview-card:focus-visible {
      transform: translateY(-2px);
      box-shadow: 0 20px 36px rgba(15, 23, 42, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.22);
    }

    .repair-overview-card.is-active {
      outline: 3px solid rgba(15, 23, 42, 0.20);
      outline-offset: 3px;
    }

    .repair-overview-card span {
      font-weight: 800;
      color: rgba(255, 255, 255, 0.92);
    }

    .repair-overview-card strong {
      font-size: 28px;
      line-height: 1;
      color: #ffffff;
      text-shadow: 0 2px 12px rgba(0, 0, 0, 0.22);
    }

    .repair-overview-copy {
      display: grid;
      gap: 2px;
      min-width: 0;
    }

    .repair-overview-card .repair-overview-step {
      color: rgba(255,255,255,.78);
      font-size: 11px;
      font-weight: 900;
      letter-spacing: .03em;
    }

    .repair-overview-card .repair-overview-label {
      color: #fff;
      font-size: 16px;
      font-weight: 950;
      line-height: 1.2;
    }

    .repair-overview-card small {
      color: rgba(255,255,255,.82);
      font-size: 11px;
      font-weight: 800;
      line-height: 1.2;
    }

    @keyframes repair-new-alert-pulse {
      0%,100% { box-shadow: 0 0 0 0 rgba(37,99,235,0); }
      50% { box-shadow: 0 0 0 4px rgba(37,99,235,.17); }
    }

    .repair-overview-card.status-pending {
      background: linear-gradient(135deg, #b45309 0%, #f97316 100%);
    }

    .repair-overview-card.status-pending.has-pending-alert,
    .admin-page .repair-active-row.pending .repair-current-status {
      animation: repair-pending-action-pulse 1.35s ease-in-out infinite;
    }

    @keyframes repair-pending-action-pulse {
      0%,100% { box-shadow: 0 0 0 0 rgba(234,88,12,0), 0 8px 18px rgba(15,23,42,.10); }
      50% { box-shadow: 0 0 0 5px rgba(249,115,22,.24), 0 10px 26px rgba(234,88,12,.28); }
    }

    .repair-overview-card.status-confirmed {
      background: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%);
    }

    .repair-overview-card.status-repair_confirmed {
      background: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 100%);
    }

    .repair-overview-card.status-repairing {
      background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    }

    .repair-overview-card.status-completed {
      background: linear-gradient(135deg, #15803d 0%, #22c55e 100%);
    }

    .repair-overview-filter-note {
      margin: 12px 0 0;
      color: #486581;
      font-weight: 800;
      line-height: 1.45;
    }

    .history-search-input {
      min-width: min(560px, 64vw);
    }

    .repair-list-status-tools {
      display: grid;
      gap: 8px;
      min-width: 180px;
      max-width: 100%;
      overflow: hidden;
    }

    .repair-list-status-head {
      display: grid;
      grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
      align-items: center;
      justify-content: start;
      gap: 4px;
      width: 100%;
      overflow: hidden;
    }

    .repair-list-status-tools .badge {
      width: fit-content;
      max-width: 100%;
      min-width: 0;
      padding: 7px 8px;
      font-size: 12px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .repair-list-edit-btn {
      display: inline-flex !important;
      align-items: center;
      justify-content: center;
      min-height: 32px !important;
      padding: 0 9px !important;
      border-radius: 999px !important;
      font-size: 12px !important;
      line-height: 1.15;
      text-align: center;
      white-space: nowrap;
      box-shadow: 0 6px 14px rgba(37, 99, 235, 0.10) !important;
    }

    .repair-list-track-copy-btn {
      box-sizing: border-box;
      color: #ffffff !important;
      background: linear-gradient(135deg, #0f766e 0%, #2563eb 58%, #6d28d9 100%) !important;
      border-color: rgba(37, 99, 235, 0.42) !important;
      box-shadow: 0 8px 18px rgba(37, 99, 235, 0.22) !important;
      cursor: pointer;
      grid-column: span 2;
      font-weight: 900;
      min-width: 0;
      width: 100%;
      white-space: normal;
      overflow-wrap: anywhere;
      word-break: break-word;
    }

    .repair-list-track-copy-btn:hover,
    .repair-list-track-copy-btn:focus-visible {
      background: linear-gradient(135deg, #115e59 0%, #1d4ed8 58%, #5b21b6 100%) !important;
      box-shadow: 0 10px 22px rgba(37, 99, 235, 0.30) !important;
      transform: translateY(-1px);
    }

    .repair-confirm-queue-form {
      margin: 0;
      display: inline-flex;
    }

    .repair-confirm-queue-btn,
    .repair-confirm-queue-done {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 32px;
      padding: 0 8px;
      border-radius: 999px;
      font-size: 12px;
      line-height: 1.15;
      font-weight: 900;
      text-align: center;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .repair-confirm-queue-btn {
      color: #0f766e !important;
      background: linear-gradient(135deg, #ecfeff 0%, #ccfbf1 100%) !important;
      border-color: rgba(20, 184, 166, 0.34) !important;
      box-shadow: 0 6px 14px rgba(20, 184, 166, 0.12) !important;
    }

    .repair-confirm-queue-done {
      color: #1d4ed8;
      background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
      border: 1px solid rgba(96, 165, 250, 0.34);
    }

    .repair-list-status-tools .quick-status-form {
      display: grid;
      grid-template-columns: minmax(140px, 1fr);
      gap: 6px;
      margin: 0;
      padding: 0;
      background: transparent;
      border: 0;
      box-shadow: none;
    }

    .repair-list-status-tools .quick-status-form .input,
    .repair-list-status-tools .btn {
      min-height: 40px;
    }

    .repair-active-table {
      table-layout: fixed;
    }

    .repair-active-table th:nth-child(1),
    .repair-active-table td:nth-child(1) {
      width: 190px;
    }

    .repair-active-table th:nth-child(3),
    .repair-active-table td:nth-child(3) {
      width: 300px;
    }

    .repair-active-row td {
      vertical-align: top;
      background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    }

    .repair-ticket-card {
      display: grid;
      gap: 7px;
      padding: 13px;
      border-radius: 16px;
      background: linear-gradient(135deg, #eff6ff 0%, #ecfeff 100%);
      border: 1px solid rgba(96, 165, 250, 0.28);
      box-shadow: inset 4px 0 0 #2563eb, 0 10px 22px rgba(37, 99, 235, 0.08);
    }

    .repair-ticket-card strong {
      color: #0f172a;
      font-size: 18px;
      line-height: 1.15;
    }

    .repair-ticket-card span {
      color: #475569;
      font-size: 13px;
      font-weight: 700;
      line-height: 1.35;
    }

    .repair-ticket-card .repair-ticket-phone {
      display: block;
      width: fit-content;
      max-width: 100%;
      color: #075680;
      font-size: 19px;
      font-weight: 800;
      font-variant-numeric: tabular-nums;
      line-height: 1.3;
      overflow-wrap: anywhere;
      text-decoration: underline;
      text-decoration-thickness: 1px;
      text-underline-offset: 3px;
    }

    .repair-ticket-tracking {
      display: flex;
      flex-wrap: wrap;
      gap: 5px;
      margin-block: 7px;
    }

    .repair-ticket-tracking > a,
    .repair-ticket-tracking > button {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 36px;
      padding: 4px 8px;
      border: 1px solid #93bce1;
      border-radius: 8px;
      background: #edf6ff;
      color: #154878;
      font: inherit;
      font-size: 12px;
      font-weight: 800;
      text-decoration: none;
      cursor: pointer;
    }

    .repair-ticket-tracking > a {
      flex: 1 0 100%;
      background: #17558e;
      border-color: #17558e;
      color: #fff;
    }

    .repair-ticket-tracking > button {
      margin-inline: auto;
    }

    .repair-ticket-tracking > :is(a, button):focus-visible {
      outline: 2px solid #2563eb;
      outline-offset: 2px;
    }

    .repair-ticket-phone:focus-visible {
      border-radius: 3px;
      outline: 2px solid #2563eb;
      outline-offset: 2px;
    }

    .repair-active-detail > strong {
      color: #0f172a;
      font-size: 18px;
    }

    .repair-active-detail {
      position: relative;
    }

    .repair-info-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
      margin-top: 10px;
    }

    .repair-info-chip {
      min-width: 0;
      padding: 10px 12px;
      border-radius: 14px;
      border: 1px solid rgba(148, 163, 184, 0.22);
      background: #ffffff;
      box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
    }

    .repair-info-chip span {
      display: block;
      margin-bottom: 4px;
      color: #475569;
      font-size: 12px;
      font-weight: 900;
    }

    .repair-info-chip strong {
      display: block;
      color: #0f172a;
      font-size: 13px;
      line-height: 1.45;
      font-weight: 800;
      overflow-wrap: anywhere;
    }

    .repair-info-chip.symptom {
      background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
      border-color: rgba(251, 146, 60, 0.28);
    }

    .repair-info-chip.address {
      background: linear-gradient(135deg, #f0f9ff 0%, #dbeafe 100%);
      border-color: rgba(59, 130, 246, 0.24);
    }

    .repair-info-chip.backup {
      border-width: 2px;
      box-shadow: 0 10px 22px rgba(15, 23, 42, 0.07);
    }

    .repair-info-chip.backup.backup-danger {
      background: linear-gradient(135deg, #fff1f2 0%, #fee2e2 100%);
      border-color: #ef4444;
    }

    .repair-info-chip.backup.backup-danger span,
    .repair-info-chip.backup.backup-danger strong {
      color: #991b1b;
    }

    .repair-info-chip.backup.backup-warning {
      background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
      border-color: #f59e0b;
    }

    .repair-info-chip.backup.backup-warning span,
    .repair-info-chip.backup.backup-warning strong {
      color: #92400e;
    }

    .repair-info-chip.backup.backup-success {
      background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
      border-color: #22c55e;
    }

    .repair-info-chip.backup.backup-success span,
    .repair-info-chip.backup.backup-success strong {
      color: #166534;
    }

    .repair-info-chip.service {
      background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
      border-color: rgba(124, 58, 237, 0.22);
    }

    .repair-info-chip.appointment {
      grid-column: 1 / -1;
      background: linear-gradient(135deg, #ecfeff 0%, #ccfbf1 100%);
      border-color: rgba(13, 148, 136, 0.42);
      box-shadow: 0 8px 20px rgba(15, 118, 110, 0.08);
    }

    .repair-info-chip.appointment span {
      color: #0f766e;
      font-size: 13px;
      font-weight: 900;
    }

    .repair-info-chip.appointment strong {
      display: inline-flex;
      align-items: center;
      width: fit-content;
      max-width: 100%;
      margin-top: 4px;
      padding: 6px 10px;
      border: 2px solid #fb7185;
      border-radius: 10px;
      background: #fff1f2;
      color: #be123c;
      box-shadow: 0 5px 14px rgba(190, 18, 60, 0.12);
      font-size: 17px;
      font-weight: 950;
      line-height: 1.3;
    }

    .appointment-display {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 6px;
      margin-top: 4px;
    }

    .appointment-display strong {
      margin-top: 0 !important;
    }

    .repair-info-chip.appointment .appointment-full-text {
      display: inline !important;
      margin: 0 !important;
      color: inherit;
      font-size: inherit !important;
      font-weight: inherit !important;
    }

    .repair-info-chip.appointment .appointment-mobile-date,
    .repair-info-chip.appointment .appointment-mobile-time {
      display: none !important;
    }

    @media (max-width: 760px) {
      .admin-page .repair-info-chip.appointment .appointment-display {
        display: block;
        width: 100%;
      }

      .admin-page .repair-info-chip.appointment .appointment-display strong {
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 100%;
        max-width: 100%;
        margin: 0 !important;
        text-align: center;
      }

      .admin-page .repair-info-chip.appointment .appointment-full-text {
        display: none !important;
      }

      .admin-page .repair-info-chip.appointment .appointment-mobile-date,
      .admin-page .repair-info-chip.appointment .appointment-mobile-time {
        display: block !important;
        width: 100%;
        margin: 0 !important;
        color: inherit;
        font-size: clamp(14px, 4.6vw, 20px) !important;
        font-weight: inherit !important;
        line-height: 1.25;
        text-align: center;
        white-space: nowrap;
      }
    }

    .appointment-relative-label,
    .appointment-display .appointment-relative-label {
      display: inline !important;
      margin: 0 0 0 5px !important;
      color: inherit;
      font-size: inherit !important;
      font-style: normal;
      font-weight: 950 !important;
      white-space: nowrap;
    }

    @keyframes repair-appointment-alert-pulse {
      0%, 100% {
        background: #fff1f2;
        border-color: #ef4444;
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.48), 0 12px 28px rgba(220, 38, 38, 0.18);
      }
      50% {
        background: #fecaca;
        border-color: #b91c1c;
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0), 0 16px 34px rgba(220, 38, 38, 0.34);
      }
    }

    .repair-info-chip.appointment.appointment-alert {
      position: relative;
      padding: 14px 16px;
      border-width: 3px;
      animation: repair-appointment-alert-pulse 1.05s ease-in-out infinite;
    }

    .repair-info-chip.appointment.appointment-alert span {
      color: #b91c1c;
      font-size: 14px;
    }

    .repair-info-chip.appointment.appointment-alert strong {
      color: #7f1d1d;
      font-size: 20px;
      line-height: 1.25;
    }

    .repair-info-chip.appointment.appointment-alert::after {
      content: "⚠ คิวยืนยันแล้ว เตรียมเริ่มงานซ่อม";
      display: block;
      margin-top: 8px;
      color: #b91c1c;
      font-size: 13px;
      font-weight: 900;
    }

    @media (prefers-reduced-motion: reduce) {
      .repair-info-chip.appointment.appointment-alert {
        animation: none;
        background: #fee2e2;
        border-color: #dc2626;
      }
    }

    .repair-alert-visual {
      display: grid;
      grid-template-columns: 46px minmax(0, 1fr);
      align-items: center;
      gap: 9px;
      width: 100%;
      max-width: 100%;
      min-width: 0;
      min-height: 86px;
      padding: 12px;
      box-sizing: border-box;
      border-radius: 18px;
      border: 2px solid;
      overflow: hidden;
      box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
    }

    .repair-alert-icon {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 46px;
      height: 46px;
      border-radius: 50%;
      color: #ffffff;
      font-size: 30px;
      font-weight: 950;
      line-height: 1;
      box-shadow: inset 0 -4px 0 rgba(15, 23, 42, 0.16), 0 10px 20px rgba(15, 23, 42, 0.18);
    }

    .repair-alert-visual span {
      display: block;
      margin-bottom: 5px;
      font-size: 12px;
      font-weight: 950;
      line-height: 1.25;
      overflow-wrap: anywhere;
    }

    .repair-alert-visual strong {
      display: block;
      font-size: 13px;
      line-height: 1.35;
      overflow-wrap: anywhere;
    }

    .repair-alert-visual.backup-danger {
      background: linear-gradient(135deg, #fff1f2 0%, #fee2e2 100%);
      border-color: #ef4444;
      color: #991b1b;
    }

    .repair-alert-visual.backup-danger .repair-alert-icon {
      background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    }

    .repair-alert-visual.backup-warning {
      background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
      border-color: #f59e0b;
      color: #92400e;
    }

    .repair-alert-visual.backup-warning .repair-alert-icon {
      background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    }

    .repair-alert-visual.backup-success {
      background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
      border-color: #22c55e;
      color: #166534;
    }

    .repair-alert-visual.backup-success .repair-alert-icon {
      background: linear-gradient(135deg, #22c55e 0%, #15803d 100%);
    }

    .repair-job-summary-toggle,
    .repair-job-summary-panel {
      width: 100%;
      max-width: 100%;
      box-sizing: border-box;
    }

    .repair-job-summary-toggle {
      display: flex;
      align-items: center;
      justify-content: center;
      min-height: 40px;
      padding: 0 12px;
      border-radius: 999px;
      color: #ffffff;
      background: linear-gradient(135deg, #0f766e 0%, #2563eb 100%);
      border: 1px solid rgba(255, 255, 255, 0.24);
      box-shadow: 0 10px 22px rgba(37, 99, 235, 0.18);
      cursor: pointer;
      font-weight: 900;
      text-align: center;
      font-family: inherit;
    }

    .repair-job-summary-toggle.is-open {
      background: linear-gradient(135deg, #0f172a 0%, #0f766e 100%);
    }

    .repair-history-print-info {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 100%;
      max-width: 100%;
      box-sizing: border-box;
      min-height: 40px;
      padding: 0 12px;
      border-radius: 999px;
      color: #ffffff;
      background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
      border: 1px solid rgba(255, 255, 255, 0.22);
      box-shadow: 0 10px 22px rgba(249, 115, 22, 0.18);
      font-size: 13.3333px;
      font-weight: 900;
      font-family: inherit;
      text-decoration: none;
      text-align: center;
    }

    .repair-job-summary-panel {
      margin-top: 12px;
    }

    .repair-active-summary-row[hidden] {
      display: none !important;
    }

    .repair-active-summary-row > td {
      width: auto !important;
      padding: 0 12px 18px 14px !important;
      border: 0 !important;
      border-left: 6px solid var(--repair-status, #2563eb) !important;
      border-right: 6px solid var(--repair-status, #2563eb) !important;
      border-bottom: 5px solid var(--repair-status, #2563eb) !important;
      border-radius: 0 0 18px 18px !important;
      background: var(--repair-status-soft, #eff6ff) !important;
      overflow: hidden;
      clip-path: inset(0 round 0 0 18px 18px);
    }

    .repair-active-summary-row .repair-job-summary-panel {
      margin-top: 0;
    }

    .repair-active-expanded-grid {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(240px, 280px);
      align-items: stretch;
      gap: 12px;
      min-width: 0;
    }

    .repair-active-expanded-grid.has-media .repair-job-summary-panel,
    .repair-active-expanded-grid.has-media .repair-job-summary-body {
      width: 100%;
      min-width: 0;
      max-width: 100%;
      overflow: hidden;
    }

    .repair-active-summary-media-slot {
      min-width: 0;
    }

    .repair-active-summary-media-slot > .repair-media-side {
      box-sizing: border-box;
      height: 100%;
      margin: 0;
    }

    .repair-active-expanded-grid.no-media {
      grid-template-columns: minmax(0, 1fr);
    }

    .repair-active-expanded-grid.no-media .repair-active-summary-media-slot {
      display: none;
    }

    .repair-active-summary-row .repair-job-summary-body {
      border: 1px solid var(--repair-status-line, #93c5fd);
      border-top: 0;
      border-radius: 0 0 18px 18px;
      background: var(--repair-status-soft, #eff6ff);
      box-shadow: 0 12px 26px color-mix(in srgb, var(--repair-status, #2563eb) 14%, transparent);
    }

    .admin-page .repair-active-row.has-open-summary > td {
      border-bottom: 0 !important;
    }

    .repair-active-spacer-row > td {
      height: 10px;
      padding: 0 !important;
      border: 0 !important;
      background: transparent !important;
    }

    .repair-job-summary-body {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 10px 18px;
      padding: 16px 18px;
      border-radius: 18px;
      background: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%);
      border: 1px solid rgba(96, 165, 250, 0.28);
      box-shadow: 0 12px 24px rgba(37, 99, 235, 0.08);
    }

    .repair-job-summary-body div {
      min-width: 0;
      max-width: 100%;
      padding-bottom: 7px;
      border-bottom: 1px dashed rgba(96, 165, 250, 0.24);
    }

    .repair-job-summary-body span {
      display: block;
      margin-bottom: 4px;
      color: #1d4ed8;
      font-size: 14px;
      font-weight: 900;
    }

    .repair-job-summary-body strong {
      display: block;
      width: 100%;
      max-width: 100%;
      color: #0f172a;
      font-size: 15px;
      line-height: 1.5;
      overflow-wrap: anywhere;
      word-break: break-word;
      white-space: normal !important;
    }

    .repair-job-summary-body > .repair-print-btn {
      grid-column: 1 / -1;
    }

    @media (max-width: 1399px) {
      .repair-job-summary-body {
        grid-template-columns: repeat(3, minmax(0, 1fr));
      }
    }

    @media (max-width: 1199px) {
      .repair-job-summary-body {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }

      .repair-active-expanded-grid {
        grid-template-columns: minmax(0, 1fr) minmax(220px, 260px);
      }
    }

    @media (max-width: 767px) {
      .repair-job-summary-body {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 13px;
      }

      .repair-active-expanded-grid {
        grid-template-columns: 1fr;
      }
    }

    .admin-page .admin-repairs-table .repair-history-expanded-detail-row > td {
      padding: 12px 12px 22px !important;
      background: #ffffff !important;
      border-top: 0 !important;
    }

    .repair-history-expanded-detail {
      display: grid;
      gap: 12px;
      width: 100%;
      min-width: 0;
    }

    .repair-history-expanded-detail .repair-detail-box,
    .repair-history-expanded-detail .repair-history-summary-panel,
    .repair-history-expanded-detail .repair-job-summary-body {
      box-sizing: border-box;
      margin: 0;
      width: 100%;
      max-width: none;
    }

    .repair-history-expanded-detail .repair-job-summary-body {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .repair-history-expanded-detail-row:not(:has(.repair-detail-box)):has(.repair-history-summary-panel[hidden]) {
      display: none;
    }

    .admin-page .admin-repairs-table .repair-history-timeline-detail-row > td {
      padding-top: 14px !important;
    }

    .repair-print-btn {
      grid-column: 1 / -1;
      min-height: 40px;
      justify-content: center;
      text-align: center;
      background: linear-gradient(135deg, #f97316 0%, #dc2626 100%) !important;
      color: #ffffff !important;
      border-color: transparent !important;
      box-shadow: 0 10px 22px rgba(249, 115, 22, 0.22) !important;
    }

    .repair-history-timeline {
      grid-column: 1 / -1;
      display: grid;
      gap: 8px;
      box-sizing: border-box;
      padding-top: 10px !important;
      border-top: 1px dashed rgba(37, 99, 235, 0.26);
      border-bottom: 0 !important;
    }

    .repair-history-timeline-detail-row td {
      padding: 0 14px 18px !important;
      background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%) !important;
      border-top: 0;
    }

    .repair-history-timeline-detail-row .repair-history-timeline {
      width: 100%;
      max-width: 100%;
      box-sizing: border-box;
      padding: 16px !important;
      border-radius: 18px;
      border: 1px solid rgba(14, 165, 233, 0.30) !important;
      background:
        linear-gradient(135deg, rgba(236, 254, 255, 0.96) 0%, rgba(239, 246, 255, 0.98) 44%, rgba(250, 245, 255, 0.96) 100%);
      box-shadow: 0 18px 34px rgba(37, 99, 235, 0.14);
    }

    .repair-history-timeline > span {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      width: fit-content;
      margin: 0;
      padding: 6px 12px;
      border-radius: 999px;
      color: #ffffff;
      background: linear-gradient(135deg, #06b6d4 0%, #2563eb 52%, #9333ea 100%);
      box-shadow: 0 10px 22px rgba(37, 99, 235, 0.20);
      font-size: 13px;
      font-weight: 950;
    }
    .repair-history-timeline > span svg,
    .repair-history-attachments-head strong svg { display:block; flex:0 0 17px; width:17px; height:17px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }

    .repair-history-timeline-row {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      align-items: stretch;
      gap: 12px;
      width: 100%;
      max-width: 100%;
      box-sizing: border-box;
      overflow: hidden;
      padding: 4px 1px 6px;
    }

    .repair-history-timeline-step {
      position: relative;
      display: grid;
      grid-template-columns: 34px minmax(0, 1fr);
      grid-template-rows: auto auto;
      column-gap: 10px;
      row-gap: 2px;
      align-items: center;
      min-width: 0;
      box-sizing: border-box;
      padding: 11px 12px;
      border-radius: 16px;
      background:
        linear-gradient(135deg, var(--timeline-bg-1, #ffffff) 0%, var(--timeline-bg-2, #eff6ff) 100%);
      border: 1px solid var(--timeline-border, rgba(37, 99, 235, 0.24));
      box-shadow: 0 12px 24px var(--timeline-shadow, rgba(37, 99, 235, 0.12));
      transition: transform 0.18s ease, box-shadow 0.18s ease;
    }

    .repair-history-timeline-step:nth-child(1) {
      --timeline-color: #06b6d4;
      --timeline-color-2: #2563eb;
      --timeline-bg-1: #ecfeff;
      --timeline-bg-2: #dbeafe;
      --timeline-border: rgba(6, 182, 212, 0.34);
      --timeline-shadow: rgba(6, 182, 212, 0.16);
    }

    .repair-history-timeline-step:nth-child(2) {
      --timeline-color: #22c55e;
      --timeline-color-2: #0d9488;
      --timeline-bg-1: #f0fdf4;
      --timeline-bg-2: #ccfbf1;
      --timeline-border: rgba(34, 197, 94, 0.32);
      --timeline-shadow: rgba(34, 197, 94, 0.15);
    }

    .repair-history-timeline-step:nth-child(3) {
      --timeline-color: #f59e0b;
      --timeline-color-2: #f97316;
      --timeline-bg-1: #fffbeb;
      --timeline-bg-2: #ffedd5;
      --timeline-border: rgba(245, 158, 11, 0.34);
      --timeline-shadow: rgba(245, 158, 11, 0.16);
    }

    .repair-history-timeline-step:nth-child(4) {
      --timeline-color: #8b5cf6;
      --timeline-color-2: #ec4899;
      --timeline-bg-1: #f5f3ff;
      --timeline-bg-2: #fce7f3;
      --timeline-border: rgba(139, 92, 246, 0.32);
      --timeline-shadow: rgba(139, 92, 246, 0.16);
    }

    .repair-history-timeline-step:nth-child(5) {
      --timeline-color: #14b8a6;
      --timeline-color-2: #16a34a;
      --timeline-bg-1: #f0fdfa;
      --timeline-bg-2: #dcfce7;
      --timeline-border: rgba(20, 184, 166, 0.32);
      --timeline-shadow: rgba(20, 184, 166, 0.15);
    }

    .repair-history-timeline-step.status-repair_quote {
      --timeline-color: #f59e0b;
      --timeline-color-2: #d97706;
      --timeline-bg-1: #fffbeb;
      --timeline-bg-2: #fef3c7;
      --timeline-border: rgba(245, 158, 11, 0.34);
      --timeline-shadow: rgba(245, 158, 11, 0.16);
    }

    .repair-history-timeline-step.status-repair_in_progress {
      --timeline-color: #0ea5e9;
      --timeline-color-2: #16a34a;
      --timeline-bg-1: #f0f9ff;
      --timeline-bg-2: #dcfce7;
      --timeline-border: rgba(14, 165, 233, 0.32);
      --timeline-shadow: rgba(14, 165, 233, 0.16);
    }

    .repair-history-timeline-step:hover {
      transform: translateY(-2px);
      box-shadow: 0 18px 30px var(--timeline-shadow, rgba(37, 99, 235, 0.18));
    }

    .repair-history-timeline-step:not(:last-child)::after {
      content: "โ";
      position: absolute;
      top: 50%;
      right: -13px;
      z-index: 2;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 18px;
      height: 18px;
      border-radius: 999px;
      color: #ffffff;
      background: linear-gradient(135deg, var(--timeline-color, #2563eb) 0%, var(--timeline-color-2, #9333ea) 100%);
      box-shadow: 0 8px 18px var(--timeline-shadow, rgba(37, 99, 235, 0.18));
      font-size: 12px;
      font-weight: 950;
      line-height: 1;
      transform: translateY(-50%);
    }

    .repair-history-timeline-step:nth-child(4n)::after {
      display: none;
    }

    .repair-history-timeline-step i {
      grid-row: 1 / 3;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 34px;
      height: 34px;
      border-radius: 999px;
      color: #ffffff;
      background: linear-gradient(135deg, var(--timeline-color, #0f766e) 0%, var(--timeline-color-2, #2563eb) 100%);
      box-shadow: 0 8px 18px var(--timeline-shadow, rgba(37, 99, 235, 0.18));
      font-style: normal;
      font-size: 14px;
      font-weight: 950;
    }

    .repair-history-timeline-step b {
      color: #0f172a;
      font-size: 14px;
      line-height: 1.2;
      font-weight: 950;
    }

    .repair-history-timeline-step strong {
      color: #334155;
      font-size: 13px;
      line-height: 1.25;
      font-weight: 900;
      white-space: normal;
      overflow-wrap: anywhere;
    }

    .repair-history-timeline-step small {
      grid-column: 2;
      display: block;
      margin-top: 6px;
      padding: 7px 9px;
      border-radius: 9px;
      color: #334155;
      background: rgba(255, 255, 255, 0.72);
      border: 1px solid rgba(148, 163, 184, 0.24);
      font-size: 12px;
      line-height: 1.45;
      overflow-wrap: anywhere;
    }

    .repair-history-timeline-step small span {
      display: block;
      margin-bottom: 2px;
      color: var(--timeline-color-2, #2563eb);
      font-weight: 900;
    }

    @media (max-width: 760px) {
      .repair-history-timeline-detail-row {
        display: grid !important;
      }

      .repair-history-timeline-detail-row[hidden] {
        display: none !important;
      }

      .repair-history-timeline-detail-row .repair-history-timeline {
        padding: 12px !important;
        border-radius: 16px;
      }

      .repair-history-timeline-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        overflow: visible;
        padding: 2px 0 0;
      }

      .repair-history-timeline-step {
        grid-template-columns: 38px minmax(0, 1fr);
        padding: 12px;
      }

      .repair-history-timeline-step:not(:last-child)::after {
        content: "โ";
        top: 50%;
        right: -13px;
        left: auto;
        bottom: auto;
        width: 18px;
        height: 18px;
        transform: translateY(-50%);
      }

      .repair-history-timeline-step:nth-child(2n)::after {
        display: none;
      }
    }

    @media (max-width: 520px) {
      .repair-history-timeline-row {
        grid-template-columns: 1fr;
      }

      .repair-history-timeline-step:not(:last-child)::after {
        content: "โ“";
        top: auto;
        right: auto;
        left: 27px;
        bottom: -14px;
        width: 24px;
        height: 24px;
        transform: none;
        display: inline-flex;
      }
    }

    .repair-media-section {
      grid-column: 1 / -1;
      padding-bottom: 0 !important;
      border-bottom: 0 !important;
    }

    .repair-media-side {
      padding: 12px !important;
      border-radius: 18px;
      background: linear-gradient(180deg, #ffffff 0%, #f0f9ff 100%);
      border: 1px solid rgba(96, 165, 250, 0.28) !important;
      box-shadow: 0 12px 24px rgba(37, 99, 235, 0.08);
    }

    .repair-media-side > span {
      display: block;
      margin-bottom: 8px;
      color: #1d4ed8;
      font-size: 13px;
      font-weight: 950;
      line-height: 1.25;
    }

    .repair-media-side > strong {
      display: block;
      color: #64748b;
      font-size: 13px;
      line-height: 1.35;
    }

    .repair-media-grid {
      display: grid;
      grid-template-columns: 1fr;
      gap: 8px;
      margin-top: 8px;
    }

    .repair-media-thumb {
      display: grid;
      gap: 6px;
      min-width: 0;
      padding: 8px;
      border: 1px solid rgba(96, 165, 250, 0.28);
      border-radius: 14px;
      background: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%);
      box-shadow: 0 8px 18px rgba(37, 99, 235, 0.08);
      cursor: pointer;
      font-family: inherit;
      text-align: left;
    }

    .repair-media-thumb img,
    .repair-video-thumb,
    .repair-document-thumb {
      width: 100%;
      aspect-ratio: 16 / 11;
      border-radius: 10px;
      object-fit: cover;
      background: #dbeafe;
    }

    .repair-media-thumb.media-load-failed img {
      object-fit: contain;
      background: #fee2e2;
      opacity: 0.42;
    }

    .repair-media-thumb.media-load-failed::after {
      content: 'ไม่พบไฟล์บนโฮส';
      display: block;
      padding: 6px 8px;
      border: 1px solid rgba(239, 68, 68, 0.25);
      border-radius: 8px;
      color: #b91c1c;
      background: #fff1f2;
      font-size: 11px;
      font-weight: 900;
      text-align: center;
    }

    .repair-video-thumb,
    .repair-document-thumb {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      color: #ffffff;
      background: linear-gradient(135deg, #0f766e 0%, #2563eb 100%);
      font-size: 13px;
      font-weight: 950;
    }

    .repair-document-thumb {
      color: #7f1d1d;
      background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    }

    .repair-media-thumb small {
      display: block;
      color: #1d4ed8;
      font-size: 11px;
      font-weight: 900;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .repair-history-attachment-row > td {
      padding-top: 0 !important;
      padding-bottom: 0 !important;
    }

    .repair-history-attachments {
      margin: 14px 0;
      padding: 14px;
      border: 1px solid rgba(96, 165, 250, 0.32);
      border-radius: 18px;
      background: linear-gradient(135deg, #f0f9ff 0%, #eef2ff 100%);
      box-shadow: 0 10px 24px rgba(37, 99, 235, 0.08);
    }

    .repair-history-attachments-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }

    .repair-history-attachments-head strong {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      color: #17385f;
      font-size: 15px;
      font-weight: 950;
    }

    .repair-history-attachments-toggle {
      min-height: 38px;
      padding: 8px 16px;
      border: 0;
      border-radius: 999px;
      color: #ffffff;
      background: linear-gradient(135deg, #0891b2 0%, #4f46e5 100%);
      box-shadow: 0 9px 20px rgba(37, 99, 235, 0.18);
      cursor: pointer;
      font-family: inherit;
      font-weight: 900;
    }

    .repair-history-attachment-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 12px;
      margin-top: 14px;
    }

    .repair-history-attachment-grid .repair-media-thumb {
      height: 100%;
    }

    @media (max-width: 900px) {
      .repair-history-attachment-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }
    }

    @media (max-width: 560px) {
      .repair-history-attachments-head {
        align-items: stretch;
        flex-direction: column;
      }

      .repair-history-attachments-toggle {
        width: 100%;
      }

      .repair-history-attachment-grid {
        grid-template-columns: 1fr;
      }
    }

    .repair-media-modal {
      position: fixed;
      inset: 0;
      z-index: 9999;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 24px;
      background: rgba(15, 23, 42, 0.86);
    }

    .repair-media-modal.is-open {
      display: flex;
    }

    .repair-media-modal-card {
      position: relative;
      display: grid;
      gap: 12px;
      width: min(96vw, 1100px);
      max-height: 92vh;
      padding: 14px;
      border-radius: 20px;
      background: #ffffff;
      box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
    }

    .repair-media-modal-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }

    .repair-media-modal-title {
      color: #0f172a;
      font-size: 16px;
      font-weight: 900;
      overflow-wrap: anywhere;
    }

    .repair-media-close {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 78px;
      min-height: 38px;
      border-radius: 999px;
      border: 0;
      color: #ffffff;
      background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
      box-shadow: 0 10px 22px rgba(220, 38, 38, 0.22);
      cursor: pointer;
      font-family: inherit;
      font-weight: 900;
    }

    .repair-media-modal-body {
      display: flex;
      align-items: center;
      justify-content: center;
      min-height: 260px;
      overflow: auto;
      background: #0f172a;
      border-radius: 14px;
    }

    .repair-media-modal-body img,
    .repair-media-modal-body video {
      display: block;
      max-width: 100%;
      max-height: 78vh;
      object-fit: contain;
    }

    .repair-media-modal-body iframe {
      display: block;
      width: 100%;
      height: min(78vh, 900px);
      border: 0;
      background: #ffffff;
    }

    .repair-media-modal-missing {
      max-width: 520px;
      margin: 24px;
      padding: 18px;
      border: 1px solid rgba(248, 113, 113, 0.32);
      border-radius: 12px;
      color: #fecaca;
      background: rgba(127, 29, 29, 0.42);
      font-size: 14px;
      font-weight: 900;
      text-align: center;
    }

    .admin-page .dashboard-hero-side.panel {
      background: linear-gradient(180deg, #0f172a 0%, #1d4ed8 55%, #312e81 100%) !important;
      color: #ffffff;
      border-color: rgba(255, 255, 255, 0.16);
      box-shadow: 0 24px 58px rgba(30, 64, 175, 0.24);
    }

    .admin-page .dashboard-ring-card {
      background:
        radial-gradient(circle at center, rgba(255, 255, 255, 0.18) 0%, rgba(20, 184, 166, 0.18) 34%, transparent 35%),
        linear-gradient(135deg, rgba(15, 23, 42, 0.62), rgba(37, 99, 235, 0.26)) !important;
    }

    .admin-page .ring-label,
    .admin-page .ring-note {
      color: #ffffff;
      font-weight: 800;
      text-shadow: 0 2px 12px rgba(15, 23, 42, 0.22);
    }

    .admin-page .ring-value {
      color: #ffffff;
      text-shadow: 0 3px 18px rgba(15, 23, 42, 0.26);
    }

    .report-panel {
      position: relative;
      overflow: hidden;
      margin-top: 22px;
      background:
        radial-gradient(circle at 8% 16%, rgba(45, 212, 191, 0.22), transparent 28%),
        radial-gradient(circle at 92% 12%, rgba(250, 204, 21, 0.26), transparent 28%),
        linear-gradient(135deg, #ffffff 0%, #eff6ff 48%, #f0fdfa 100%);
      border-color: rgba(37, 99, 235, 0.18);
    }

    .report-panel:after {
      content: "";
      position: absolute;
      right: -80px;
      bottom: -100px;
      width: 230px;
      height: 230px;
      border-radius: 50%;
      border: 34px solid rgba(37, 99, 235, 0.08);
    }

    .report-panel > * {
      position: relative;
      z-index: 1;
    }

    .report-head {
      display: flex;
      justify-content: space-between;
      gap: 18px;
      align-items: center;
      flex-wrap: wrap;
    }

    .report-kicker {
      display: inline-flex;
      padding: 6px 12px;
      border-radius: 999px;
      color: #0f766e;
      background: #ccfbf1;
      font-weight: 900;
      margin-bottom: 10px;
    }

    .report-title {
      margin: 0;
      color: #0f172a;
      font-size: 28px;
      line-height: 1.18;
    }

    .report-download-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 54px;
      padding: 14px 22px;
      border-radius: 18px;
      background: linear-gradient(135deg, #0f766e 0%, #2563eb 55%, #7c3aed 100%) !important;
      color: #ffffff !important;
      border: 0 !important;
      box-shadow: 0 18px 36px rgba(37, 99, 235, 0.28) !important;
      line-height: 1.15;
      text-align: center;
      white-space: nowrap;
    }

    .report-category-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 12px;
      margin-top: 18px;
    }

    .report-category {
      padding: 14px;
      border-radius: 18px;
      background: rgba(255, 255, 255, 0.82);
      border: 1px solid rgba(96, 165, 250, 0.24);
      box-shadow: 0 12px 24px rgba(15, 23, 42, 0.07);
    }

    .report-category span {
      display: block;
      color: #64748b;
      font-weight: 800;
      font-size: 13px;
      margin-bottom: 6px;
    }

    .report-category strong {
      display: block;
      color: #0f172a;
      font-size: 20px;
      line-height: 1.2;
    }

    .admin-page .badge.pending,
    .admin-page .pending {
      background: linear-gradient(135deg, #fff7ed 0%, #fed7aa 100%);
    }

    .repair-history-timeline-row {
      overflow: visible !important;
      position: relative !important;
    }

    .repair-history-timeline-row::before {
      background: linear-gradient(90deg, rgba(6, 182, 212, 0.22), rgba(34, 197, 94, 0.24), rgba(245, 158, 11, 0.24), rgba(139, 92, 246, 0.22));
      border-radius: 999px;
      content: "";
      height: 4px;
      left: 7%;
      pointer-events: none;
      position: absolute;
      right: 7%;
      top: 31px;
      z-index: 0;
    }

    .repair-history-timeline-step {
      align-items: start !important;
      grid-template-columns: 38px minmax(0, 1fr) !important;
      grid-template-rows: auto auto auto !important;
      min-height: 104px !important;
      padding: 11px 13px 10px 11px !important;
      position: relative !important;
      z-index: 1 !important;
    }

    .repair-history-timeline-step:not(:nth-child(4n)):not(:last-child)::after {
      background: var(--timeline-color-2, #2563eb) !important;
      border: 3px solid #ffffff !important;
      border-radius: 999px !important;
      box-shadow: 0 8px 18px var(--timeline-shadow, rgba(37, 99, 235, 0.18)) !important;
      box-sizing: border-box !important;
      color: #ffffff !important;
      content: "›" !important;
      display: inline-flex !important;
      align-items: center !important;
      justify-content: center !important;
      font-size: 22px !important;
      font-weight: 950 !important;
      height: 26px !important;
      line-height: 1 !important;
      pointer-events: none !important;
      position: absolute !important;
      right: -20px !important;
      top: 20px !important;
      transform: none !important;
      width: 26px !important;
      z-index: 3 !important;
    }

    .repair-history-timeline-step i {
      align-self: start !important;
      grid-row: 1 / 4 !important;
      height: 34px !important;
      justify-self: center !important;
      margin-top: 0 !important;
      position: relative !important;
      width: 34px !important;
      z-index: 2 !important;
    }

    .repair-history-timeline-step b,
    .repair-history-timeline-step strong,
    .repair-history-timeline-step small {
      grid-column: 2 !important;
    }

    .repair-history-timeline-step b {
      align-self: end !important;
      min-height: 28px !important;
    }

    .repair-history-timeline-step strong {
      min-height: 24px !important;
    }

    @media (max-width: 760px) {
      .repair-history-timeline-row::before {
        bottom: 22px;
        height: auto;
        left: 31px;
        right: auto;
        top: 32px;
        width: 6px;
      }

      .repair-history-timeline-step {
        min-height: 100px !important;
      }

      .repair-history-timeline-step:not(:last-child)::after {
        content: "⌄" !important;
        display: inline-flex !important;
        left: 20px !important;
        right: auto !important;
        top: auto !important;
        bottom: -18px !important;
      }
    }

    .repair-history-timeline-row {
      gap: 24px 32px !important;
    }

    .repair-history-timeline-row::before {
      background: linear-gradient(90deg, rgba(6, 182, 212, 0.30), rgba(34, 197, 94, 0.32), rgba(245, 158, 11, 0.32), rgba(139, 92, 246, 0.30)) !important;
      height: 4px !important;
      top: 27px !important;
    }

    .repair-history-timeline-step {
      min-height: 88px !important;
      padding: 10px 12px 9px 10px !important;
    }

    .repair-history-timeline-step::after {
      content: none !important;
      display: none !important;
    }

    .repair-history-timeline-step.is-linked:not(:nth-child(4n))::after,
    .repair-history-timeline-step.is-linked:nth-child(4n)::after {
      align-items: center !important;
      background: linear-gradient(135deg, var(--timeline-color, #2563eb), var(--timeline-color-2, #9333ea)) !important;
      border: 3px solid #ffffff !important;
      border-radius: 999px !important;
      box-shadow: 0 8px 18px var(--timeline-shadow, rgba(37, 99, 235, 0.18)) !important;
      box-sizing: border-box !important;
      color: #ffffff !important;
      display: inline-flex !important;
      font-weight: 950 !important;
      height: 24px !important;
      justify-content: center !important;
      line-height: 1 !important;
      pointer-events: none !important;
      position: absolute !important;
      width: 24px !important;
      z-index: 4 !important;
    }

    .repair-history-timeline-step.is-linked:not(:nth-child(4n))::after {
      content: "›" !important;
      font-size: 21px !important;
      right: -30px !important;
      top: 15px !important;
      transform: none !important;
    }

    .repair-history-timeline-step.is-linked:nth-child(4n)::after {
      bottom: -24px !important;
      content: "⌄" !important;
      font-size: 17px !important;
      left: 19px !important;
      top: auto !important;
      transform: none !important;
    }

    .repair-history-timeline-step.is-current {
      border-width: 2px !important;
      box-shadow: 0 16px 30px var(--timeline-shadow, rgba(37, 99, 235, 0.20)), inset 0 0 0 1px rgba(255,255,255,0.64) !important;
    }

    .repair-history-timeline-step i {
      height: 32px !important;
      width: 32px !important;
    }

    .repair-history-timeline-step b {
      line-height: 1.05 !important;
      min-height: 22px !important;
    }

    .repair-history-timeline-step strong {
      line-height: 1.1 !important;
      min-height: 18px !important;
    }

    .repair-history-timeline-step small {
      line-height: 1.25 !important;
      margin-top: 3px !important;
      padding: 6px 8px !important;
    }

    @media (max-width: 760px) {
      .repair-history-timeline-step {
        min-height: 86px !important;
      }

      .repair-history-timeline-step.is-linked::after {
        bottom: -24px !important;
        content: "⌄" !important;
        left: 19px !important;
        right: auto !important;
        top: auto !important;
      }
    }

    .repair-history-timeline-legend { display:flex; flex-wrap:wrap; gap:8px 14px; margin:10px 0 14px; }
    .repair-history-timeline-legend em { align-items:center; color:#486581; display:inline-flex; font-size:13px; font-style:normal; font-weight:800; gap:7px; }
    .repair-history-timeline-legend i { border-radius:999px; display:inline-block; height:10px; width:10px; }
    .repair-history-timeline-legend .legend-done i { background:#10b981; }
    .repair-history-timeline-legend .legend-current i { background:#2563eb; box-shadow:0 0 0 4px rgba(37,99,235,.14); }
    .repair-history-timeline-legend .legend-next i { background:#cbd5e1; }
    .repair-history-timeline-row { gap:14px 28px !important; grid-template-columns:repeat(4,minmax(0,1fr)) !important; }
    .repair-history-timeline-row::before { content:none !important; display:none !important; }
    .repair-history-timeline-step {
      align-content:start !important; background:#f8fafc !important; border:2px dashed #cbd5e1 !important;
      border-radius:14px !important; box-shadow:none !important; gap:3px 10px !important;
      grid-template-columns:36px minmax(0,1fr) !important; min-height:96px !important;
      opacity:.72; padding:12px !important; transform:none !important;
    }
    .repair-history-timeline-step::after,
    .repair-history-timeline-step.is-linked::after,
    .repair-history-timeline-step.is-linked:nth-child(4n)::after {
      background:#cbd5e1 !important; border:0 !important; border-radius:999px !important; box-shadow:none !important;
      content:"" !important; display:block !important; height:4px !important; left:auto !important;
      position:absolute !important; right:-30px !important; top:29px !important; width:30px !important; z-index:0 !important;
    }
    .repair-history-timeline-step:nth-child(4n)::after,
    .repair-history-timeline-step:last-child::after { content:none !important; display:none !important; }
    .repair-history-timeline-step.is-done {
      background:linear-gradient(135deg,var(--timeline-soft,#ecfdf5) 0%,#fff 100%) !important;
      border:1px solid var(--timeline-border,#6ee7b7) !important;
      box-shadow:0 8px 18px var(--timeline-shadow,rgba(16,185,129,.10)) !important; opacity:1;
    }
    .repair-history-timeline-step.is-linked::after { background:linear-gradient(90deg,var(--timeline-color,#10b981),var(--timeline-color-2,#2563eb)) !important; }
    .repair-history-timeline-step.is-current {
      background:#fff !important; border:3px solid var(--timeline-color,#2563eb) !important;
      box-shadow:0 14px 30px var(--timeline-shadow,rgba(37,99,235,.20)) !important; opacity:1; padding:10px !important;
    }
    .repair-history-timeline-step.is-current b::after {
      background:var(--timeline-color,#2563eb); border-radius:999px; color:#fff; content:"ปัจจุบัน";
      display:inline-block; font-size:11px; font-weight:900; line-height:1; margin-left:7px; padding:5px 7px; vertical-align:middle;
    }
    .repair-history-timeline-step i { font-style:normal !important; height:34px !important; width:34px !important; }
    .repair-history-timeline-step b { align-self:center !important; color:#172033 !important; line-height:1.3 !important; min-height:0 !important; }
    .repair-history-timeline-step strong { color:#33597b !important; font-size:13px !important; line-height:1.3 !important; min-height:0 !important; }
    .repair-history-timeline-step strong:empty::before { color:#94a3b8; content:"รอดำเนินการ"; font-weight:700; }
    .repair-history-timeline-step small { background:#fff !important; border-color:rgba(148,163,184,.28) !important; line-height:1.35 !important; margin-top:5px !important; padding:7px 9px !important; }
    @media (max-width:760px) {
      .repair-history-timeline-row { gap:12px !important; grid-template-columns:1fr !important; }
      .repair-history-timeline-step { min-height:82px !important; }
      .repair-history-timeline-step::after,
      .repair-history-timeline-step.is-linked::after,
      .repair-history-timeline-step:nth-child(4n)::after {
        bottom:-14px !important; display:block !important; height:14px !important; left:27px !important;
        right:auto !important; top:auto !important; width:4px !important;
      }
      .repair-history-timeline-step:last-child::after { display:none !important; }
    }

    .repair-history-timeline-row .repair-history-timeline-step:not(:nth-child(4n)):not(:last-child)::after,
    .repair-history-timeline-row .repair-history-timeline-step.is-linked:not(:nth-child(4n))::after {
      background:#cbd5e1 !important;
      border:0 !important;
      border-radius:0 !important;
      box-shadow:none !important;
      clip-path:polygon(0 34%,72% 34%,72% 0,100% 50%,72% 100%,72% 66%,0 66%) !important;
      color:transparent !important;
      content:"" !important;
      display:block !important;
      font-size:0 !important;
      height:16px !important;
      left:auto !important;
      right:-29px !important;
      top:22px !important;
      transform:none !important;
      width:28px !important;
    }

    .repair-history-timeline-row .repair-history-timeline-step.is-linked:not(:nth-child(4n))::after {
      background:linear-gradient(90deg,var(--timeline-color,#10b981),var(--timeline-color-2,#2563eb)) !important;
    }

    .repair-history-timeline-row .repair-history-timeline-step:nth-child(4n)::after,
    .repair-history-timeline-row .repair-history-timeline-step:last-child::after {
      content:none !important;
      display:none !important;
    }

    @media (max-width:760px) {
      .repair-history-timeline-row .repair-history-timeline-step:not(:last-child)::after,
      .repair-history-timeline-row .repair-history-timeline-step.is-linked:not(:nth-child(4n))::after,
      .repair-history-timeline-row .repair-history-timeline-step:nth-child(4n)::after {
        bottom:-13px !important;
        clip-path:polygon(34% 0,66% 0,66% 72%,100% 72%,50% 100%,0 72%,34% 72%) !important;
        display:block !important;
        height:14px !important;
        left:22px !important;
        right:auto !important;
        top:auto !important;
        width:14px !important;
      }

      .repair-history-timeline-row .repair-history-timeline-step:last-child::after {
        display:none !important;
      }
    }

    /* Repair timeline: one clear sequence, styled by progress state rather than step number. */
    .history-detail-drawer .repair-history-timeline { gap:12px; padding:18px !important; border-color:#bfdbfe !important; background:linear-gradient(145deg,#fff 0%,#f0f7ff 100%) !important; }
    .repair-history-timeline-progress {
      display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:5px 12px;
      padding:12px 14px; border:1px solid #bfdbfe; border-radius:13px; background:#fff;
    }
    .repair-history-timeline-progress > div { min-width:0; }
    .repair-history-timeline-progress strong { display:block; color:#123b63; font-size:15px; font-weight:950; line-height:1.35; }
    .repair-history-timeline-progress small { display:block; margin-top:2px; color:#52708d; font-size:12px; font-weight:800; line-height:1.35; overflow-wrap:anywhere; }
    .repair-history-timeline-progress > b { color:#1d4ed8; font-size:18px; font-weight:950; }
    .repair-history-timeline-progress > i { grid-column:1 / -1; display:block; height:8px; overflow:hidden; border-radius:999px; background:#dbe7f3; }
    .repair-history-timeline-progress > i > span { display:block; width:var(--repair-progress,0%); height:100%; border-radius:inherit; background:linear-gradient(90deg,#10b981 0%,#14b8a6 58%,#2563eb 100%); }
    .history-detail-drawer .repair-history-timeline-legend { margin:0; padding:0 2px; }
    .history-detail-drawer .repair-history-timeline-row {
      display:grid !important; grid-template-columns:repeat(8,minmax(0,1fr)) !important; gap:18px !important;
      align-items:stretch !important; overflow:visible !important; padding:4px 0 2px !important;
    }
    .history-detail-drawer .repair-history-timeline-step {
      position:relative !important; display:grid !important; grid-template-columns:38px minmax(0,1fr) !important;
      grid-template-rows:auto auto auto !important; align-content:start !important; align-items:center !important;
      gap:3px 9px !important; min-width:0 !important; min-height:124px !important; padding:12px 10px !important;
      border:1px solid #d8e1eb !important; border-radius:15px !important; background:#f8fafc !important;
      box-shadow:0 5px 14px rgba(71,85,105,.07) !important; opacity:1 !important; transform:none !important;
    }
    .history-detail-drawer .repair-history-timeline-step > i {
      grid-row:1 / 4 !important; align-self:start !important; position:relative !important; width:38px !important; height:38px !important;
      border:3px solid #fff !important; background:#94a3b8 !important; box-shadow:0 0 0 1px #cbd5e1 !important;
      color:#fff !important; font-size:15px !important;
    }
    .history-detail-drawer .repair-history-timeline-step > i > svg { display:block; width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
    .history-detail-drawer .repair-history-timeline-step > i > span {
      position:absolute; top:-8px; right:-8px; display:grid; place-items:center; min-width:18px; height:18px; padding:0 3px;
      border:2px solid #fff; border-radius:999px; background:#64748b; color:#fff; box-shadow:0 2px 7px rgba(15,23,42,.22);
      font-size:9px; font-weight:950; line-height:1;
    }
    .history-detail-drawer .repair-history-timeline-step > b { grid-column:2 !important; color:#26394d !important; font-size:14px !important; line-height:1.25 !important; }
    .history-detail-drawer .repair-history-timeline-step > em {
      grid-column:2 !important; display:inline-flex !important; justify-self:start; margin:1px 0 0; padding:3px 7px;
      border-radius:999px; background:#e2e8f0; color:#64748b; font-size:10px; font-style:normal; font-weight:900; line-height:1.2;
    }
    .history-detail-drawer .repair-history-timeline-step > strong.repair-timeline-datetime {
      grid-column:1 / -1 !important; display:grid !important; grid-template-columns:minmax(0,1fr) auto; align-items:stretch;
      gap:6px; width:100%; min-height:52px !important; margin-top:7px; padding:6px;
      border:1px solid #d7e5f1; border-radius:10px; background:rgba(255,255,255,.9);
      color:#173b5e !important; line-height:1.15 !important; box-sizing:border-box;
    }
    .history-detail-drawer .repair-history-timeline-step > strong.repair-timeline-datetime:empty {
      display:flex !important; align-items:center; justify-content:center; color:#94a3b8 !important;
      font-size:12px !important; font-weight:800; text-align:center;
    }
    .history-detail-drawer .repair-history-timeline-step > strong.repair-timeline-datetime:empty::before { content:"ยังไม่ถึงขั้นตอนนี้" !important; }
    .repair-timeline-datetime > span {
      display:flex; min-width:0; flex-direction:column; justify-content:center; padding:3px 5px;
      border-radius:7px; text-align:center; white-space:nowrap; overflow:hidden;
    }
    .repair-timeline-datetime > span::before {
      display:block; margin-bottom:2px; color:#71869a; font-size:9px; font-weight:850; line-height:1; letter-spacing:.01em;
    }
    .repair-timeline-datetime-date { font-size:15px; font-weight:950; }
    .repair-timeline-datetime-date::before { content:"วันที่"; }
    .repair-timeline-datetime-time {
      min-width:54px !important; background:#eaf4ff; color:#1d4ed8; font-size:18px; font-weight:950;
    }
    .repair-timeline-datetime-time::before { content:"เวลา"; color:#5278a0 !important; }
    .history-detail-drawer .repair-history-timeline-step.is-done > .repair-timeline-datetime { border-color:#bbf7d0; }
    .history-detail-drawer .repair-history-timeline-step.is-done .repair-timeline-datetime-time { background:#dcfce7; color:#047857; }
    .history-detail-drawer .repair-history-timeline-step.is-current > .repair-timeline-datetime { border-color:#bfdbfe; }
    .history-detail-drawer .repair-history-timeline-step > small { grid-column:1 / -1 !important; margin-top:7px !important; }
    .history-detail-drawer .repair-history-timeline-step.is-done {
      border-color:#86efac !important; background:linear-gradient(145deg,#ecfdf5,#fff) !important;
      box-shadow:0 7px 18px rgba(16,185,129,.10) !important;
    }
    .history-detail-drawer .repair-history-timeline-step.is-done > i { background:#10b981 !important; box-shadow:0 0 0 1px #6ee7b7 !important; }
    .history-detail-drawer .repair-history-timeline-step.is-done > i > span { background:#047857; }
    .history-detail-drawer .repair-history-timeline-step.is-done > em { background:#dcfce7; color:#15803d; }
    .history-detail-drawer .repair-history-timeline-step.is-current {
      border:2px solid #2563eb !important; background:linear-gradient(145deg,#eff6ff,#fff) !important;
      box-shadow:0 10px 24px rgba(37,99,235,.18),inset 0 0 0 1px rgba(255,255,255,.8) !important; padding:11px 9px !important;
    }
    .history-detail-drawer .repair-history-timeline-step.is-current > i { background:#2563eb !important; box-shadow:0 0 0 4px rgba(37,99,235,.14) !important; }
    .history-detail-drawer .repair-history-timeline-step.is-current > i > span { background:#1e40af; }
    .history-detail-drawer .repair-history-timeline-step.is-current > em { background:#dbeafe; color:#1d4ed8; }
    .history-detail-drawer .repair-history-timeline-step.is-current > b::after { content:none !important; display:none !important; }
    .history-detail-drawer .repair-history-timeline-row > .repair-history-timeline-step:not(:last-child)::after {
      content:"" !important; display:block !important; position:absolute !important; z-index:2 !important;
      top:28px !important; right:-18px !important; left:auto !important; bottom:auto !important;
      width:18px !important; height:14px !important; border:0 !important; border-radius:0 !important; box-shadow:none !important;
      background:#cbd5e1 !important; clip-path:polygon(0 36%,70% 36%,70% 0,100% 50%,70% 100%,70% 64%,0 64%) !important;
    }
    .history-detail-drawer .repair-history-timeline-row > .repair-history-timeline-step.is-linked:not(:last-child)::after { background:#10b981 !important; }
    @media (min-width:761px) and (max-width:1180px) {
      .history-detail-drawer .repair-history-timeline-row {
        grid-template-columns:none !important; grid-auto-flow:column !important; grid-auto-columns:minmax(175px,200px) !important;
        justify-content:start !important; overflow-x:auto !important; overflow-y:hidden !important; padding:4px 2px 12px !important;
        scrollbar-gutter:stable;
      }
    }
    @media (max-width:760px) {
      .history-detail-drawer .repair-history-timeline { padding:12px !important; }
      .repair-history-timeline-progress { padding:10px 11px; }
      .repair-history-timeline-progress strong { font-size:14px; }
      .history-detail-drawer .repair-history-timeline-row { grid-template-columns:1fr !important; gap:16px !important; overflow:visible !important; }
      .history-detail-drawer .repair-history-timeline-step { min-height:132px !important; grid-template-columns:42px minmax(0,1fr) !important; padding:11px !important; }
      .history-detail-drawer .repair-history-timeline-step > strong.repair-timeline-datetime { min-height:56px !important; }
      .repair-timeline-datetime-date { font-size:17px; }
      .repair-timeline-datetime-time { min-width:72px !important; font-size:20px; }
      .history-detail-drawer .repair-history-timeline-step > i { width:38px !important; height:38px !important; }
      .history-detail-drawer .repair-history-timeline-row > .repair-history-timeline-step:not(:last-child)::after,
      .history-detail-drawer .repair-history-timeline-row > .repair-history-timeline-step.is-linked:not(:last-child)::after {
        top:auto !important; right:auto !important; bottom:-16px !important; left:24px !important; width:14px !important; height:16px !important;
        clip-path:polygon(36% 0,64% 0,64% 70%,100% 70%,50% 100%,0 70%,36% 70%) !important;
      }
    }

    .admin-page .admin-repairs-table .compact-actions {
      align-items: stretch !important;
      display: grid !important;
      gap: 10px !important;
      grid-template-columns: repeat(2, minmax(100px, 1fr)) !important;
      justify-items: stretch !important;
      margin: 0 auto !important;
      max-width: 250px !important;
      width: 100% !important;
    }

    .admin-page .admin-repairs-table th:last-child,
    .admin-page .admin-repairs-table td:last-child {
      min-width: 250px !important;
      width: 250px !important;
    }

    .admin-page .admin-repairs-table .compact-actions form {
      display: contents !important;
      margin: 0 !important;
    }

    .admin-page .admin-repairs-table .compact-actions .btn {
      align-items: center !important;
      box-sizing: border-box !important;
      display: inline-flex !important;
      justify-content: center !important;
      line-height: 1.2 !important;
      margin: 0 !important;
      min-height: 52px !important;
      min-width: 0 !important;
      overflow-wrap: anywhere !important;
      padding: 9px 10px !important;
      text-align: center !important;
      white-space: normal !important;
      width: 100% !important;
      word-break: keep-all !important;
    }

    .admin-page .badge.confirmed,
    .admin-page .confirmed {
      background: linear-gradient(135deg, #eff6ff 0%, #93c5fd 100%);
    }

    .admin-page .badge.repair_confirmed,
    .admin-page .repair_confirmed {
      background: linear-gradient(135deg, #ecfeff 0%, #5eead4 100%);
      color: #115e59;
    }

    .admin-page .badge.repairing,
    .admin-page .repairing {
      background: linear-gradient(135deg, #f5f3ff 0%, #c4b5fd 100%);
      color: #5b21b6;
    }

    .admin-page .flash.success {
      background: linear-gradient(135deg, #dcfce7 0%, #ccfbf1 100%);
      color: #065f46;
      border-color: #5eead4;
    }

    .admin-page .flash.error {
      background: linear-gradient(135deg, #fff1f2 0%, #fee2e2 100%);
      color: #991b1b;
      border-color: #fda4af;
    }

    @media (max-width: 760px) {
      .report-head {
        align-items: stretch;
      }

      .report-download-btn {
        width: 100%;
        justify-content: center;
        text-align: center;
      }

      .report-category-grid {
        grid-template-columns: 1fr 1fr;
      }

      .report-title {
        font-size: 24px;
      }

      .repair-overview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }

      .table-wrap:has(.repair-active-table) {
        overflow: visible !important;
        contain: none !important;
      }

      .repair-active-table,
      .repair-active-table thead,
      .repair-active-table tbody,
      .repair-active-table tr,
      .repair-active-table th,
      .repair-active-table td {
        display: block;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
      }

      .repair-active-table thead {
        display: none !important;
      }

      .repair-active-table tbody {
        display: grid !important;
        gap: 14px;
        min-width: 0;
        max-width: 100%;
      }

      .repair-active-table tr {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
        padding: 12px;
        border-radius: 18px;
        background: #ffffff;
        border: 1px solid rgba(96, 165, 250, 0.20);
        box-shadow: 0 12px 28px rgba(37, 99, 235, 0.08);
        min-width: 0 !important;
        max-width: 100% !important;
        overflow: hidden;
      }

      .repair-active-table td {
        padding: 0 0 10px;
        border: 0;
        overflow: hidden;
      }

      .repair-active-table td:last-child {
        padding-bottom: 0;
      }

      .repair-active-table th:nth-child(1),
      .repair-active-table td:nth-child(1),
      .repair-active-table th:nth-child(3),
      .repair-active-table td:nth-child(3) {
        width: 100% !important;
      }

      .repair-info-grid {
        grid-template-columns: 1fr;
      }

      .repair-job-summary-body {
        grid-template-columns: 1fr;
      }

      .repair-media-grid {
        grid-template-columns: 1fr;
      }

      .repair-list-status-tools {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
        justify-items: center;
      }

      .repair-list-status-head {
        display: grid;
        grid-template-columns: 1fr;
        justify-content: stretch;
        justify-items: stretch;
        gap: 8px;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
      }

      .repair-confirm-queue-form {
        display: block;
        width: 100%;
      }

      .repair-list-status-tools .badge,
      .repair-confirm-queue-btn,
      .repair-confirm-queue-done,
      .repair-list-edit-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        max-width: 100%;
        min-height: 36px !important;
        padding: 8px 10px !important;
        font-size: 13px !important;
        line-height: 1.15;
        white-space: normal;
        overflow-wrap: anywhere;
      }

      .repair-list-status-tools .quick-status-form,
      .repair-job-summary-toggle,
      .repair-media-side,
      .repair-alert-visual {
        width: 100%;
        max-width: 100%;
        min-width: 0;
      }

      .repair-list-status-tools .quick-status-form {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        overflow: hidden;
      }

      .repair-list-status-tools .quick-status-form .input,
      .repair-list-status-tools .quick-status-form .auto-submit-status,
      .repair-job-summary-toggle {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        white-space: normal;
        overflow-wrap: anywhere;
      }

      .repair-alert-visual {
        grid-template-columns: 48px minmax(0, 1fr);
        justify-content: center;
        overflow: hidden;
      }

      .repair-alert-visual div:not(.repair-alert-icon),
      .repair-alert-visual span,
      .repair-alert-visual strong {
        text-align: center;
      }

      .repair-alert-icon {
        margin: 0 auto;
      }

      .repair-alert-visual {
        width: 100%;
        min-height: 0;
        margin-top: 10px;
      }

      .admin-page .admin-repairs-table .repair-history-attachment-row {
        display: block !important;
        order: 5;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
      }

      .admin-page .admin-repairs-table .repair-history-attachment-row[hidden] {
        display: none !important;
      }

      .admin-page .admin-repairs-table .repair-history-attachment-row > td {
        display: block !important;
        width: 100% !important;
        padding: 10px 0 0 !important;
      }

      .admin-page .admin-repairs-table .repair-history-attachment-row > td:before {
        content: "" !important;
        display: none !important;
      }

      .admin-page .admin-repairs-table .repair-history-timeline-detail-row {
        order: 6;
        padding: 0;
      }

      .admin-page .admin-repairs-table .repair-history-timeline-detail-row td {
        padding: 12px 0 0 !important;
      }

      .admin-page .admin-repairs-table .repair-history-timeline-detail-row td:before {
        content: "" !important;
        display: none !important;
      }

      .admin-page .admin-repairs-table .repair-history-expanded-detail-row {
        display: block !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        overflow: visible !important;
      }

      .admin-page .admin-repairs-table .repair-history-expanded-detail-row > td {
        display: block !important;
        padding: 10px 0 16px !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
      }

      .admin-page .admin-repairs-table .repair-history-expanded-detail-row > td:before {
        content: "" !important;
        display: none !important;
      }

      .repair-history-expanded-detail .repair-job-summary-body {
        grid-template-columns: 1fr;
      }

      .repair-history-expanded-detail-row:not(:has(.repair-detail-box)):has(.repair-history-summary-panel[hidden]) {
        display: none !important;
      }

      .history-search-input {
        min-width: 0;
      }

      .repair-history-head,
      .repair-history-filter-board {
        grid-template-columns: 1fr;
      }

      .repair-history-filter-group {
        padding: 12px 10px 10px;
      }

      .repair-history-filter-label {
        font-size: 14px;
      }

      .repair-history-head {
        gap: 12px;
        align-items: stretch;
      }

      .repair-history-head > form.actions {
        grid-template-columns: 1fr;
      }

      .admin-page .admin-repairs-table th:last-child,
      .admin-page .admin-repairs-table td:last-child {
        min-width: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
      }

      .admin-page .admin-repairs-table .compact-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
        margin: 0 !important;
        max-width: none !important;
        width: 100% !important;
      }

      .admin-page .admin-repairs-table .compact-actions .btn {
        min-height: 46px !important;
        padding: 9px 8px !important;
      }

      .admin-page .admin-repairs-table .compact-actions > .btn.danger {
        grid-column: auto;
      }

      .admin-login-hero {
        padding: 16px 14px;
        margin: 16px auto;
      }

      .admin-login-hero h1 {
        font-size: 27px;
        line-height: 1.25;
      }

      .admin-login-form .btn {
        width: 100%;
      }
    }

    @media (max-width: 560px) {
      .repair-overview-grid,
      .report-category-grid {
        grid-template-columns: 1fr;
      }

      .repair-media-modal {
        padding: 10px;
      }

    }

    @media (max-width: 360px) {
      .admin-page .admin-repairs-table .compact-actions {
        grid-template-columns: 1fr !important;
      }

      .admin-page .admin-repairs-table .compact-actions > .btn.danger {
        grid-column: auto;
      }
    }

    /* Bright UI pass for admin.php inline overrides. */
    .admin-page .admin-login-hero {
      background:
        radial-gradient(circle at 12% 0%, rgba(255, 255, 255, 0.72), transparent 34%),
        radial-gradient(circle at 92% 12%, rgba(45, 212, 191, 0.20), transparent 30%),
        linear-gradient(135deg, #e0f7ff 0%, #c7ddff 52%, #e1d4ff 100%) !important;
      color: #123456 !important;
      border: 1px solid rgba(37, 99, 235, 0.22) !important;
      border-radius: 28px !important;
      box-shadow: 0 24px 54px rgba(37, 99, 235, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.82) !important;
    }

    .admin-page .admin-login-hero h1 {
      margin-bottom: 18px !important;
      color: #0f2f4f !important;
      font-size: 34px !important;
      line-height: 1.16 !important;
      text-shadow: none !important;
    }

    .admin-page .admin-login-hero .muted,
    .admin-page .admin-login-hero label {
      color: #254a6f !important;
      text-shadow: none !important;
    }

    .admin-page .admin-login-form {
      margin-top: 0 !important;
      padding: 18px !important;
      background: rgba(255, 255, 255, 0.76) !important;
      border-color: rgba(37, 99, 235, 0.20) !important;
      border-radius: 24px !important;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.90), 0 16px 34px rgba(37, 99, 235, 0.12) !important;
    }

    .admin-page .admin-login-form .input {
      min-height: 54px !important;
      color: #0f172a !important;
      background: #ffffff !important;
      border: 1px solid rgba(37, 99, 235, 0.20) !important;
      border-radius: 16px !important;
      box-shadow: 0 10px 24px rgba(37, 99, 235, 0.10) !important;
    }

    .admin-page .remember-login-option {
      color: #123456 !important;
      font-weight: 900 !important;
      margin-top: 14px !important;
    }

    .admin-page .remember-login-option input {
      accent-color: #0f766e;
      flex: 0 0 auto;
    }

    .admin-page .admin-login-form .btn {
      min-height: 52px !important;
      padding: 12px 22px !important;
      border-radius: 999px !important;
      background: linear-gradient(135deg, #2563eb 0%, #0f766e 100%) !important;
      color: #ffffff !important;
      border-color: rgba(255, 255, 255, 0.42) !important;
      box-shadow: 0 14px 26px rgba(37, 99, 235, 0.22) !important;
    }

    .admin-page .admin-login-badge {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      margin-bottom: 12px;
      padding: 8px 12px;
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.74);
      border: 1px solid rgba(96, 165, 250, 0.26);
      color: #1d4ed8;
      font-size: 13px;
      font-weight: 900;
      box-shadow: 0 10px 22px rgba(37, 99, 235, 0.10);
    }

    .admin-page .admin-main-hero,
    .admin-page .dashboard-hero-main,
    .admin-page .dashboard-hero-side.panel {
      background:
        radial-gradient(circle at 16% 12%, rgba(255, 255, 255, 0.58), transparent 28%),
        linear-gradient(135deg, #c7f1ff 0%, #a7d8ff 48%, #d8c7ff 100%) !important;
      color: #0f2f4f !important;
      border: 1px solid rgba(96, 165, 250, 0.26) !important;
      box-shadow: 0 18px 40px rgba(37, 99, 235, 0.14) !important;
    }

    .admin-page .admin-main-hero h1,
    .admin-page .admin-main-hero .muted,
    .admin-page .dashboard-hero-main h2,
    .admin-page .dashboard-hero-main .muted,
    .admin-page .dashboard-kicker,
    .admin-page .dashboard-hero-main .dashboard-pill span,
    .admin-page .dashboard-hero-main .dashboard-pill strong,
    .admin-page .ring-label,
    .admin-page .ring-note,
    .admin-page .ring-value {
      color: #0f2f4f !important;
      text-shadow: none !important;
    }

    .admin-page .admin-main-hero .subnav a,
    .admin-page .dashboard-hero-main .dashboard-pill {
      background: rgba(255, 255, 255, 0.58) !important;
      border-color: rgba(37, 99, 235, 0.22) !important;
      color: #17385f !important;
    }

    .admin-page .admin-main-hero .subnav a.active {
      background: #ffffff !important;
      color: #0f766e !important;
    }

    .admin-page .admin-main-hero .admin-subnav a {
      display: grid !important;
      grid-template-columns: 38px minmax(0, 1fr) auto !important;
      justify-content: stretch !important;
      justify-items: start !important;
      text-align: left !important;
    }

    .admin-page .admin-main-hero .admin-subnav .admin-menu-icon,
    .admin-page .admin-main-hero .admin-subnav .admin-menu-label {
      justify-self: start !important;
      text-align: left !important;
    }

    .admin-page .admin-main-hero .admin-subnav .menu-badge {
      justify-self: end !important;
    }

    .admin-page .dashboard-ring-card {
      background:
        radial-gradient(circle at center, rgba(255,255,255,0.42) 0%, rgba(191,219,254,0.36) 42%, transparent 43%),
        linear-gradient(135deg, #e0f7ff 0%, #bfdbfe 52%, #ddd6fe 100%) !important;
      border-color: rgba(96, 165, 250, 0.28) !important;
    }

    /* Repair history: compact list presentation */
    .repair-history-panel { overflow: visible !important; padding: 24px !important; background: #fff !important; transform: none !important; }
    .repair-history-head { margin-bottom: 16px; }
    .repair-history-head h2 { color: #0f2f4f; font-size: clamp(25px, 2.2vw, 32px); }

    .repair-history-panel .sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
    .repair-history-toolbar {
      position: sticky;
      top: 0;
      z-index: 40;
      display: flex;
      flex-wrap: wrap;
      align-items: end;
      gap: 10px;
      margin: 0 0 14px;
      padding: 12px;
      border: 1px solid #dbe7f4;
      border-radius: 16px;
      background: rgba(255,255,255,.97);
      box-shadow: 0 10px 24px rgba(15,47,79,.08);
      backdrop-filter: blur(10px);
    }
    .history-toolbar-search { display: flex; flex: 1 1 100%; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 260px; }
    .history-toolbar-search .history-search-input { flex: 1 1 auto; width: auto !important; min-width: 0; max-width: none !important; margin: 0 !important; }
    .history-toolbar-search .history-search-submit { flex: 0 0 auto; min-width: 92px; }
    .history-search-help { flex: 1 1 100%; margin: 0 2px; color: #64748b; font-size: 12px; line-height: 1.45; }
    .history-filter-field { display: grid; flex: 0 1 150px; gap: 4px; min-width: 115px; }
    .history-filter-field > span { color: #64748b; font-size: 12px; font-weight: 800; }
    .history-list-controls { display: flex; align-items: end; gap: 10px; flex: 0 0 auto; }
    .history-list-controls .history-page-size-field { flex: 0 0 132px; }
    .repair-history-toolbar .input, .repair-history-toolbar .btn { height: 44px !important; min-height: 44px !important; box-sizing: border-box; padding-top: 8px !important; padding-bottom: 8px !important; }
    .repair-history-toolbar .btn { display: inline-flex; align-items: center; justify-content: center; }
    .history-cancelled-link {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      align-self: end;
      min-height: 36px;
      padding: 7px 12px;
      border: 1px solid #cbd5e1;
      border-radius: 10px;
      color: #64748b;
      background: #f8fafc;
      font-size: 12px;
      font-weight: 800;
      text-decoration: none;
      white-space: nowrap;
      opacity: .78;
    }
    .history-cancelled-link:hover,
    .history-cancelled-link:focus-visible { opacity: 1; color: #475569; border-color: #94a3b8; }
    .history-cancelled-link.is-active { color: #991b1b; border-color: #fecaca; background: #fff7f7; opacity: .9; }
    @media (max-width: 560px) {
      .history-list-controls { width: 100%; }
      .history-list-controls .history-page-size-field { flex: 1 1 auto; }
      .history-list-controls .history-cancelled-link { flex: 0 0 auto; }
    }
    .history-filter-field .input { padding-inline: 10px; }
    .history-date-range { display: flex; flex: 1 1 250px; gap: 8px; min-width: 240px; }
    .history-date-range .history-filter-field { flex: 1 1 0; min-width: 112px; }
    .history-sort-field { flex-basis: 165px; }
    .history-page-size-field { flex-basis: 112px; }
    .history-apply-filter, .history-reset-filter { padding-inline: 14px; white-space: nowrap; }
    .history-mobile-filter-toggle, .history-mobile-filter-count { display: none !important; }
    .repair-history-result-meta { display: flex; flex: 1 1 auto; align-items: center; justify-content: flex-end; gap: 12px; margin: 0 2px; color: #64748b; font-size: 14px; text-align: right; }
    .repair-history-result-meta strong { color: #0f2f4f; font-size: 16px; }
    .repair-history-table-wrap { position: relative; max-height: max(420px, calc(100vh - 260px)); overflow-x: visible; overflow-y: auto; overscroll-behavior: contain; border: 1px solid #dbe7f4; border-radius: 16px; background: #fff; }
    .history-list-table { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; }
    .history-list-table thead th { position: sticky; top: 0; z-index: 20; padding: 12px 10px; border-bottom: 1px solid #dbe7f4; background: #eef6ff; color: #17385f; font-size: 13px; white-space: nowrap; }
    .history-list-table th:nth-child(1) { width: 9%; }
    .history-list-table th:nth-child(2) { width: 11%; }
    .history-list-table th:nth-child(3) { width: 14%; }
    .history-list-table th:nth-child(4) { width: 14%; }
    .history-list-table th:nth-child(5) { width: 17%; }
    .history-list-table th:nth-child(6), .history-list-table th:nth-child(7) { width: 10%; }
    .history-list-table th:nth-child(8) { width: 7%; text-align: right; }
    .history-list-table th:nth-child(9) { width: 14%; text-align: center; }
    .history-list-table .repair-history-list-row { height: 72px; background: #fff; transition: background .16s ease, box-shadow .16s ease; }
    .history-list-table .repair-history-list-row:nth-of-type(odd) { background: #fbfdff; }
    .history-list-table .repair-history-list-row:hover { background: #f0f8ff; box-shadow: inset 4px 0 0 #60a5fa; }
    .history-list-table .repair-history-list-row > td { min-width: 0; padding: 10px; border: 0; border-bottom: 1px solid #e7eef7; color: #334155; font-size: 14px; vertical-align: middle; }
    .history-col-status .badge { display: inline-flex; max-width: 100%; padding: 6px 9px; font-size: 11px; line-height: 1.25; white-space: normal; text-align: center; }
    .history-inline-status-form { display: flex; flex-direction: column; align-items: stretch; gap: 3px; margin: 0; }
    .history-inline-status-select {
      width: 100%;
      min-width: 0;
      min-height: 38px;
      box-sizing: border-box;
      padding: 7px 26px 7px 9px;
      border: 1px solid #cbd5e1;
      border-radius: 999px;
      color: #334155;
      font: inherit;
      font-size: 11px;
      font-weight: 900;
      line-height: 1.25;
      text-align: center;
      text-align-last: center;
      cursor: pointer;
      box-shadow: 0 5px 12px rgba(15, 23, 42, .07);
      background-image: linear-gradient(90deg, var(--status-accent, #64748b) 0 7px, transparent 7px);
      transition: border-color .18s ease, background-color .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
    }
    .history-inline-status-select.is-saving { cursor: progress; opacity: .78; transform: none; box-shadow: 0 0 0 3px rgba(37, 99, 235, .13), 0 7px 16px rgba(15, 23, 42, .09); }
    .history-status-save-state {
      display: block;
      min-height: 13px;
      color: #64748b;
      font-size: 10px;
      font-weight: 800;
      line-height: 1.25;
      text-align: center;
      white-space: nowrap;
    }
    .history-status-save-state.is-saving { color: #1d4ed8; }
    .history-status-save-state.is-success { color: #15803d; }
    .history-status-save-state.is-error { color: #b91c1c; }
    .history-inline-status-select:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(15, 23, 42, .11); }
    .history-inline-status-select:focus-visible { outline: 3px solid rgba(37, 99, 235, .22); outline-offset: 2px; border-color: #2563eb; }
    .history-inline-status-select.pending { --status-accent: #f97316; border-color: #fb923c; background-color: #fff7ed; color: #9a3412; }
    .history-inline-status-select.confirmed { --status-accent: #2563eb; border-color: #60a5fa; background-color: #eff6ff; color: #1d4ed8; }
    .history-inline-status-select.repair_confirmed { --status-accent: #0d9488; border-color: #2dd4bf; background-color: #ecfeff; color: #0f766e; }
    .history-inline-status-select.repairing { --status-accent: #7c3aed; border-color: #a78bfa; background-color: #f5f3ff; color: #6d28d9; }
    .history-inline-status-select.repair_quote { --status-accent: #d97706; border-color: #fbbf24; background-color: #fffbeb; color: #92400e; }
    .history-inline-status-select.repair_in_progress { --status-accent: #0284c7; border-color: #38bdf8; background-color: #f0f9ff; color: #0369a1; }
    .history-inline-status-select.completed { --status-accent: #16a34a; border-color: #4ade80; background-color: #f0fdf4; color: #15803d; }
    .history-inline-status-select.payment_pending { --status-accent: #d97706; border-color: #fbbf24; background-color: #fffbeb; color: #92400e; }
    .history-inline-status-select.paid { --status-accent: #059669; border-color: #34d399; background-color: #ecfdf5; color: #047857; }
    .history-inline-status-select.delivered { --status-accent: #475569; border-color: #94a3b8; background-color: #f8fafc; color: #334155; }
    .history-inline-status-select.cancelled { --status-accent: #dc2626; border-color: #f87171; background-color: #fef2f2; color: #b91c1c; }
    .history-inline-status-select option { background: #fff; color: #1e293b; font-weight: 800; }
    .history-inline-status-select option[value="pending"] { color: #c2410c; }
    .history-inline-status-select option[value="confirmed"] { color: #1d4ed8; }
    .history-inline-status-select option[value="repair_confirmed"] { color: #0f766e; }
    .history-inline-status-select option[value="repairing"] { color: #6d28d9; }
    .history-inline-status-select option[value="repair_quote"] { color: #a16207; }
    .history-inline-status-select option[value="repair_in_progress"] { color: #0369a1; }
    .history-inline-status-select option[value="completed"] { color: #15803d; }
    .history-inline-status-select option[value="payment_pending"] { color: #a16207; }
    .history-inline-status-select option[value="paid"] { color: #047857; }
    .history-inline-status-select option[value="delivered"] { color: #334155; }
    .history-inline-status-select option[value="cancelled"] { color: #b91c1c; }
    .history-list-table .repair-history-list-row[class*="status-"] > td:first-child { box-shadow: inset 4px 0 0 var(--row-status-accent, #94a3b8); }
    .history-list-table .repair-history-list-row.status-pending { --row-status-accent: #f97316; }
    .history-list-table .repair-history-list-row.status-confirmed { --row-status-accent: #2563eb; }
    .history-list-table .repair-history-list-row.status-repair_confirmed { --row-status-accent: #0d9488; }
    .history-list-table .repair-history-list-row.status-repairing { --row-status-accent: #7c3aed; }
    .history-list-table .repair-history-list-row.status-repair_quote { --row-status-accent: #d97706; }
    .history-list-table .repair-history-list-row.status-repair_in_progress { --row-status-accent: #0284c7; }
    .history-list-table .repair-history-list-row.status-completed { --row-status-accent: #16a34a; }
    .history-list-table .repair-history-list-row.status-payment_pending { --row-status-accent: #d97706; }
    .history-list-table .repair-history-list-row.status-paid { --row-status-accent: #059669; }
    .history-list-table .repair-history-list-row.status-delivered { --row-status-accent: #475569; }
    .history-list-table .repair-history-list-row.status-cancelled { --row-status-accent: #dc2626; }
    .history-col-order { white-space: nowrap; }
    .history-col-order > strong { color: #0f2f4f; font-size: 15px; }
    .history-copy-mini { width: 30px; height: 30px; margin-left: 4px; padding: 0; border: 0; border-radius: 9px; background: #eef6ff; color: #2563eb; cursor: pointer; }
    .history-col-customer strong, .history-col-customer span, .history-col-customer small { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .history-col-customer strong { color: #0f172a; }
    .history-customer-open { display: block; min-width: 0; width: 100%; max-width: 100%; min-height: 42px; margin: 2px 0 3px; padding: 6px 12px; overflow: hidden; border: 1px solid #bfdbfe; border-radius: 10px; background: linear-gradient(180deg,#fff 0%,#eff6ff 100%); color: #123252; font-family: inherit; font-size: 17px; line-height: 1.3; font-weight: 900; text-align: center; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; box-shadow: 0 3px 10px rgba(37,99,235,.06); transition: border-color .16s ease, background .16s ease, color .16s ease, box-shadow .16s ease; }
    .history-customer-open:hover { border-color: #60a5fa; background: #eaf4ff; color: #0b66c3; box-shadow: 0 5px 14px rgba(37,99,235,.12); }
    .history-customer-open:focus-visible { outline: 2px solid #2563eb; outline-offset: 3px; border-radius: 3px; }
    .history-customer-phone { display: block; width: 100%; margin-top: 3px; overflow: hidden; color: #64748b; font-size: 12px; line-height: 1.35; text-align: center; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
    a.history-customer-phone:hover { color: #0b66c3; text-decoration: underline; text-underline-offset: 2px; }
    a.history-customer-phone:focus-visible { border-radius: 4px; outline: 2px solid #2563eb; outline-offset: 2px; }
    @media (max-width: 760px) {
      .history-customer-open { min-height: 44px !important; padding: 6px 12px !important; font-size: 22px !important; line-height: 1.3 !important; white-space: normal !important; overflow-wrap: anywhere !important; }
    }
    .history-col-customer span, .history-col-customer small { margin-top: 3px; color: #64748b; font-size: 12px; }
    .history-tablet-device { display: none !important; }
    .history-clamp { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; line-height: 1.45; }
    .history-col-received, .history-col-updated { color: #475569; font-size: 13px !important; }
    .history-col-total { box-sizing: border-box; overflow: hidden; text-align: center; white-space: nowrap; }
    .history-receipt-total { display: block; width: 100%; min-width: 0; color: #0f2f4f; font-size: 14px; font-variant-numeric: tabular-nums; font-weight: 900; letter-spacing: -.02em; line-height: 1.25; text-align: center; }
    .history-receipt-total.is-long { font-size: 12px; letter-spacing: -.04em; }
    .history-receipt-total.is-very-long { font-size: 8px; letter-spacing: -.07em; }
    .history-row-actions { position: relative; display: flex; align-items: center; justify-content: center; gap: 6px; }
    .history-open-button { min-width: 74px; min-height: 40px; padding: 8px 12px; border-radius: 11px; font-size: 13px; }
    .history-menu-trigger { display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border: 1px solid #bfdbfe; border-radius: 11px; background: #fff; color: #1d4ed8; font-size: 24px; line-height: 1; cursor: pointer; }
    .history-menu-trigger:hover, .history-menu-trigger:focus-visible { background: #eff6ff; border-color: #60a5fa; outline: 3px solid rgba(37,99,235,.18); outline-offset: 1px; }
    .history-action-menu { position: fixed; z-index: 240; width: 250px; max-height: min(70vh, 520px); box-sizing: border-box; overflow-y: auto; padding: 8px; border: 1px solid #dbe7f4; border-radius: 14px; background: #fff; box-shadow: 0 20px 44px rgba(15,23,42,.20); text-align: left; }
    .history-action-menu[hidden], .repair-history-expanded-detail-row[hidden], .repair-history-attachment-row[hidden], .repair-history-timeline-detail-row[hidden] { display: none !important; }
    .history-action-menu a, .history-action-menu button, .history-action-menu label { display: flex; width: 100%; min-height: 42px; box-sizing: border-box; align-items: center; padding: 9px 10px; border: 0; border-radius: 9px; background: transparent; color: #334155; font: inherit; font-size: 14px; text-align: left; text-decoration: none; cursor: pointer; }
    .history-action-menu a:hover, .history-action-menu button:hover, .history-action-menu a:focus-visible, .history-action-menu button:focus-visible { background: #eff6ff; color: #1d4ed8; outline: none; }
    .history-action-menu form { margin: 0; }
    .history-menu-divider { height: 1px; margin: 6px 4px; background: #e2e8f0; }
    .history-action-menu .history-menu-delete { color: #b91c1c; font-weight: 800; }
    .history-search-mark { padding: 0 2px; border-radius: 4px; background: #fef3c7; color: inherit; }
    .repair-history-expanded-detail-row > td, .repair-history-attachment-row > td, .repair-history-timeline-detail-row > td { padding: 12px !important; background: #f8fbff; }
    .history-empty-state { display: grid; justify-items: center; gap: 8px; padding: 42px 16px; text-align: center; }
    .history-empty-state > span { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: #eef6ff; color: #2563eb; font-size: 30px; }
    .history-empty-state strong { color: #0f2f4f; font-size: 20px; }
    .history-empty-state p { margin: 0 0 6px; color: #64748b; }
    .repair-history-pagination { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 16px; color: #64748b; font-size: 14px; }
    .history-pagination-links { display: flex; align-items: center; gap: 6px; }
    .history-page-number { display: grid; place-items: center; min-width: 40px; height: 40px; border: 1px solid #dbe7f4; border-radius: 10px; background: #fff; color: #1d4ed8; text-decoration: none; font-weight: 800; }
    .history-page-number.is-current { background: #2563eb; border-color: #2563eb; color: #fff; }
    .repair-history-pagination .is-disabled { opacity: .45; pointer-events: none; }
    .history-toast { position: fixed; z-index: 300; left: 50%; bottom: 24px; transform: translateX(-50%); padding: 11px 16px; border-radius: 999px; background: #0f766e; color: #fff; font-weight: 800; box-shadow: 0 14px 32px rgba(15,118,110,.24); }

    @media (max-width: 1199px) and (min-width: 768px) {
      .history-list-table th:nth-child(4), .history-list-table td:nth-child(4),
      .history-list-table th:nth-child(5), .history-list-table td:nth-child(5),
      .history-list-table th:nth-child(6), .history-list-table td:nth-child(6),
      .history-list-table th:nth-child(8), .history-list-table td:nth-child(8) { display: none; }
      .history-list-table th:nth-child(1) { width: 15%; }
      .history-list-table th:nth-child(2) { width: 18%; }
      .history-list-table th:nth-child(3) { width: 30%; }
      .history-list-table th:nth-child(7) { width: 17%; }
      .history-list-table th:nth-child(9) { width: 20%; }
      .history-tablet-device { display: block !important; }
      .repair-history-toolbar { top: 0; }
    }

    @media (max-width: 767px) {
      .repair-history-panel { padding: 12px !important; border-radius: 18px !important; }
      .repair-history-head { margin-bottom: 12px; }
      .repair-history-head h2 { font-size: 25px; }
      .repair-history-toolbar { top: 0; display: grid; grid-template-columns: minmax(0, 1fr); align-items: end; gap: 10px; margin-inline: -4px; padding: 10px; border-radius: 14px; }
      .history-toolbar-search { grid-column: 1; min-width: 0; flex-direction: column; flex-wrap: nowrap; }
      .history-toolbar-search .history-search-input,
      .history-toolbar-search .btn { width: 100% !important; min-width: 0; }
      .history-search-help { margin: 0; font-size: 12px; }
      .history-mobile-filter-toggle { display: inline-flex !important; min-height: 44px; align-items: center; justify-content: center; gap: 6px; }
      .history-mobile-filter-toggle span { display: grid; place-items: center; min-width: 22px; height: 22px; border-radius: 999px; background: #2563eb; color: #fff; font-size: 12px; }
      .repair-history-toolbar > .history-filter-field:not(.history-sort-field):not(.history-page-size-field), .repair-history-toolbar > .history-date-range, .repair-history-toolbar > .history-apply-filter, .repair-history-toolbar > .history-reset-filter { display: none; }
      .repair-history-toolbar.is-filter-open > .history-filter-field:not(.history-sort-field), .repair-history-toolbar.is-filter-open > .history-date-range, .repair-history-toolbar.is-filter-open > .history-page-size-field, .repair-history-toolbar.is-filter-open > .history-apply-filter, .repair-history-toolbar.is-filter-open > .history-reset-filter { display: flex; }
      .repair-history-toolbar.is-filter-open > .history-filter-field:not(.history-sort-field), .repair-history-toolbar.is-filter-open > .history-page-size-field { display: grid; }
      .repair-history-toolbar.is-filter-open > .history-filter-field:not(.history-sort-field), .repair-history-toolbar.is-filter-open > .history-date-range, .repair-history-toolbar.is-filter-open > .history-page-size-field { grid-column: 1 / -1; width: 100%; }
      .history-sort-field { grid-column: 2; min-width: 128px; }
      .history-sort-field > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
      .history-apply-filter, .history-reset-filter { min-height: 44px; justify-content: center; }
      .history-mobile-filter-count { display: none; }
      .history-page-size-field { display: grid !important; grid-column: 1; width: 132px; }
      .repair-history-result-meta { align-items: flex-start; flex-direction: column; gap: 2px; margin: 0; text-align: left; }
      .repair-history-table-wrap { max-height: none; overflow: visible; border: 0; background: transparent; }
      .history-list-table, .history-list-table tbody { display: block !important; width: 100% !important; }
      .history-list-table thead { display: none !important; }
      .history-list-table .repair-history-list-row { position: relative; display: grid !important; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; height: auto; min-height: 0; margin-bottom: 10px; padding: 14px 14px 12px; border: 1px solid #dbe7f4; border-left: 4px solid #60a5fa; border-radius: 14px; background: #fff !important; box-shadow: 0 7px 18px rgba(15,47,79,.06); }
      .history-list-table .repair-history-list-row > td { display: block !important; width: auto !important; min-height: 0 !important; padding: 0 !important; border: 0 !important; background: transparent !important; box-shadow: none !important; }
      .history-list-table .repair-history-list-row > td:before { display: none !important; content: none !important; }
      .history-col-order { grid-column: 1; grid-row: 1; }
      .history-col-status { grid-column: 1; grid-row: 2; }
      .history-col-customer { grid-column: 1 / -1; grid-row: 3; }
      .history-col-device { grid-column: 1 / -1; grid-row: 4; }
      .history-col-job { grid-column: 1 / -1; grid-row: 5; }
      .history-col-updated { grid-column: 1; grid-row: 6; }
      .history-col-updated:before { display: inline !important; content: "อัปเดต " !important; color: #64748b; }
      .history-col-received, .history-col-total { display: none !important; }
      .history-col-actions { grid-column: 1 / -1; grid-row: 7; margin-top: 4px; }
      .history-row-actions { justify-content: space-between; }
      .admin-page .history-open-button { min-height: 48px !important; flex: 1 1 auto; }
      .admin-page .history-menu-trigger { width: 48px; min-height: 48px !important; height: 48px; flex: 0 0 48px; }
      .history-col-order > strong { font-size: 17px; }
      .history-col-customer strong { font-size: 16px; }
      .history-col-device, .history-col-job { color: #475569; }
      .history-action-menu { position: fixed; z-index: 250; left: 10px; right: 10px; top: auto; bottom: max(10px, env(safe-area-inset-bottom)); width: auto; max-height: 72vh; padding: 10px; border-radius: 20px; }
      .history-action-menu:before { content: "จัดการรายการ"; display: block; padding: 8px 10px 10px; color: #0f2f4f; font-size: 16px; font-weight: 900; }
      .history-action-menu a, .history-action-menu button, .history-action-menu label { min-height: 48px; font-size: 16px; }
      .repair-history-expanded-detail-row, .repair-history-attachment-row, .repair-history-timeline-detail-row { display: block !important; margin: -4px 0 10px; padding: 0 !important; }
      .admin-page .admin-repairs-table .repair-history-expanded-detail-row[hidden],
      .admin-page .admin-repairs-table .repair-history-attachment-row[hidden],
      .admin-page .admin-repairs-table .repair-history-timeline-detail-row[hidden] { display: none !important; }
      .repair-history-expanded-detail-row > td, .repair-history-attachment-row > td, .repair-history-timeline-detail-row > td { display: block !important; width: 100% !important; box-sizing: border-box; padding: 10px !important; }
      .repair-history-expanded-detail-row > td:before, .repair-history-attachment-row > td:before, .repair-history-timeline-detail-row > td:before { display: none !important; content: none !important; }
      .repair-history-pagination { align-items: stretch; flex-direction: column; }
      .history-pagination-links { justify-content: space-between; }
      .history-pagination-links .btn { min-height: 44px; }
      .history-page-number { min-width: 44px; height: 44px; }
    }

    /* Repair history overlap and nested-scroll correction */
    .admin-page.repair-history-view .container { max-width: 1500px; }
    .repair-history-table-wrap {
      max-height: none !important;
      overflow: visible !important;
      overscroll-behavior: auto;
    }
    .repair-history-toolbar { position: relative; top: auto; }
    .history-list-table { width: 100%; table-layout: fixed; }
    .history-list-table col.history-width-status { width: 132px; }
    .history-list-table col.history-width-order { width: 164px; }
    .history-list-table col.history-width-customer { width: 22%; }
    .history-list-table col.history-width-device { width: 13%; }
    .history-list-table col.history-width-job { width: 17%; }
    .history-list-table col.history-width-received,
    .history-list-table col.history-width-updated { width: 110px; }
    .history-list-table col.history-width-total { width: 132px; }
    .history-list-table col.history-width-actions { width: 138px; }
    .history-list-table thead th {
      top: 0;
      height: 44px;
      box-sizing: border-box;
      padding: 8px 10px;
      line-height: 1.3;
      text-align: center !important;
    }
    .history-list-table th:nth-child(6),
    .history-list-table th:nth-child(7) { text-align: center; }
    .history-list-table .repair-history-list-row { height: auto; min-height: 68px; }
    .history-list-table .repair-history-list-row > td {
      height: 68px;
      box-sizing: border-box;
      padding: 8px 10px;
      line-height: 1.4;
    }
    .history-col-status { text-align: center; }
    .history-col-status .badge {
      width: 84px;
      min-height: 30px;
      max-height: 30px;
      box-sizing: border-box;
      align-items: center;
      justify-content: center;
      padding: 3px 6px;
      overflow: hidden;
      font-size: 11px;
      line-height: 1.15;
      box-shadow: none !important;
    }
    .history-col-order { white-space: nowrap; }
    .history-col-customer > strong {
      overflow: visible;
      text-overflow: clip;
      white-space: normal;
    }
    .history-customer-open {
      height: auto;
      overflow: visible;
      text-overflow: clip;
      white-space: normal;
      overflow-wrap: anywhere;
      word-break: normal;
    }
    .history-copy-mini { width: 26px; height: 26px; margin-left: 3px; }
    .history-clamp {
      max-width: 100%;
      overflow-wrap: anywhere;
      -webkit-line-clamp: 2;
      line-clamp: 2;
      line-height: 1.4;
    }
    .history-col-received, .history-col-updated { text-align: center; }
    .history-col-received time, .history-col-updated time {
      display: inline-block;
      width: 74px;
      white-space: normal;
      line-height: 1.35;
    }
    .history-open-button {
      width: 82px;
      min-width: 82px;
      min-height: 38px;
      height: 38px;
      padding: 6px 10px;
    }
    .history-menu-trigger { width: 38px; height: 38px; }
    .repair-history-pagination { margin: 18px 0 22px; }
    .history-tablet-symptom { display: none !important; }

    @media (min-width: 1200px) {
      .history-list-table col.history-width-customer { width: 32%; }
      .history-list-table col.history-width-device { width: 9%; }
      .history-list-table col.history-width-job { width: 11%; }
      .history-col-customer > strong,
      .history-customer-open {
        white-space: nowrap;
      }
      .history-customer-open {
        font-size: 18px;
        overflow: hidden;
        text-overflow: clip;
      }
      .repair-history-toolbar {
        display: grid;
        grid-template-columns: 132px minmax(0, 1fr);
      }
      .history-toolbar-search { grid-column: 1 / -1; grid-row: 1; min-width: 0; }
      .history-page-size-field { grid-column: 1; grid-row: 2; width: 132px; }
      .repair-history-result-meta {
        grid-column: 2;
        grid-row: 2;
        align-self: center;
        justify-self: end;
        margin: 0;
        text-align: right;
      }
    }

    @media (max-width: 1199px) and (min-width: 1024px) {
      .history-list-table th:nth-child(4), .history-list-table td:nth-child(4),
      .history-list-table th:nth-child(6), .history-list-table td:nth-child(6),
      .history-list-table th:nth-child(8), .history-list-table td:nth-child(8) { display: none; }
      .history-list-table th:nth-child(5), .history-list-table td:nth-child(5) { display: table-cell; }
      .history-list-table col.history-width-device,
      .history-list-table col.history-width-received,
      .history-list-table col.history-width-total { width: 0; }
      .history-list-table col.history-width-status { width: 16%; }
      .history-list-table col.history-width-order { width: 18%; }
      .history-list-table col.history-width-customer { width: 24%; }
      .history-list-table col.history-width-job { width: 18%; }
      .history-list-table col.history-width-updated { width: 11%; }
      .history-list-table col.history-width-actions { width: 13%; }
      .history-tablet-device { display: block !important; }
    }

    @media (max-width: 1023px) and (min-width: 768px) {
      .history-list-table th:nth-child(4), .history-list-table td:nth-child(4),
      .history-list-table th:nth-child(5), .history-list-table td:nth-child(5),
      .history-list-table th:nth-child(6), .history-list-table td:nth-child(6),
      .history-list-table th:nth-child(8), .history-list-table td:nth-child(8) { display: none; }
      .history-list-table col.history-width-device,
      .history-list-table col.history-width-job,
      .history-list-table col.history-width-received,
      .history-list-table col.history-width-total { width: 0; }
      .history-list-table col.history-width-status { width: 20%; }
      .history-list-table col.history-width-order { width: 22%; }
      .history-list-table col.history-width-customer { width: 29%; }
      .history-list-table col.history-width-updated { width: 13%; }
      .history-list-table col.history-width-actions { width: 16%; }
      .history-tablet-device, .history-tablet-symptom { display: block !important; }
      .history-list-table .repair-history-list-row > td { min-height: 76px; height: 76px; font-size: 13px; }
    }

    @media (max-width: 767px) {
      .repair-history-table-wrap { border-radius: 10px; }
      .history-list-table .repair-history-list-row {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 7px 12px;
        margin: 0;
        padding: 15px 14px;
        border: 0;
        border-bottom: 1px solid #dbe7f4;
        border-radius: 0;
        box-shadow: none;
      }
      .admin-page.repair-history-view .admin-repairs-table.history-list-table .repair-history-list-row {
        border: 0 !important;
        border-bottom: 1px solid #dbe7f4 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
      }
      .history-list-table .repair-history-list-row > td { height: auto !important; }
      .history-list-table .repair-history-list-row:nth-of-type(odd) { background: #f9fcff !important; }
      .history-col-order { grid-column: 1 / -1; grid-row: 1; padding-right: 50px !important; }
      .history-col-status { grid-column: 1 / -1; grid-row: 2; text-align: left; }
      .history-col-customer { grid-column: 1 / -1; grid-row: 3; }
      .history-col-device { grid-column: 1 / -1; grid-row: 4; }
      .history-col-job { grid-column: 1 / -1; grid-row: 5; }
      .history-col-received { display: block !important; grid-column: 1; grid-row: 6; }
      .history-col-updated { grid-column: 2; grid-row: 6; }
      .history-list-table .repair-history-list-row > .history-col-received:before {
        display: inline !important;
        content: "รับงาน: " !important;
        color: #64748b;
      }
      .history-list-table .repair-history-list-row > .history-col-updated:before {
        display: inline !important;
        content: "อัปเดต: " !important;
        color: #64748b;
      }
      .history-col-received time, .history-col-updated time { display: inline; width: auto; }
      .history-col-total {
        display: flex !important;
        grid-column: 1 / -1;
        grid-row: 7;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        min-width: 0;
        padding: 9px 12px !important;
        border: 1px solid #dbeafe !important;
        border-radius: 10px;
        background: #f8fbff;
      }
      .history-col-total:before { content: "ยอดจริงในใบเสร็จ"; color: #64748b; font-size: 12px; font-weight: 800; }
      .history-col-total .history-receipt-total { width: auto; max-width: 60%; flex: 0 1 auto; text-align: right; }
      .history-col-actions { grid-column: 1 / -1; grid-row: 8; margin-top: 4px; }
      .history-row-actions { position: static; justify-content: flex-start; }
      .history-list-table .repair-history-list-row > .history-col-total { display: flex !important; }
      .history-list-table .repair-history-list-row .history-copy-mini {
        display: inline-grid !important;
        width: 28px !important;
        min-width: 28px !important;
        height: 28px !important;
        min-height: 28px !important;
        padding: 0 !important;
        vertical-align: middle;
      }
      .admin-page .history-open-button {
        width: 92px;
        min-width: 92px;
        min-height: 44px !important;
        height: 44px;
        flex: 0 0 92px;
      }
      .admin-page .history-menu-trigger {
        position: absolute;
        top: 4px !important;
        right: 14px;
        transform: translateY(-6px) !important;
        width: 44px !important;
        min-width: 44px !important;
        min-height: 44px !important;
        height: 44px !important;
        padding: 0 !important;
        flex: 0 0 44px;
      }
      .history-col-status .badge { width: 84px; }
    }

    /* Shared feedback system for repair history actions */
    html.history-feedback-open,
    body.history-feedback-open { overflow: hidden; }
    .history-feedback-layer[hidden],
    .history-toast-stack[hidden],
    .history-loading-state[hidden] { display: none !important; }
    .history-feedback-layer {
      position: fixed;
      z-index: 520;
      inset: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 3vh 2.5vw;
    }
    .history-feedback-backdrop {
      position: absolute;
      inset: 0;
      border: 0;
      background: rgba(15, 23, 42, .55);
      backdrop-filter: blur(3px);
      cursor: pointer;
    }
    .history-detail-drawer {
      position: relative;
      z-index: 1;
      display: grid;
      grid-template-rows: auto minmax(0, 1fr) auto;
      width: 95vw;
      max-width: 1820px;
      height: 94dvh;
      border: 1px solid rgba(191,219,254,.9);
      border-radius: 18px;
      overflow: hidden;
      background: #f8fbff;
      box-shadow: 0 28px 80px rgba(15, 23, 42, .28);
    }
    .history-dialog-header,
    .history-dialog-footer {
      position: sticky;
      z-index: 3;
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 16px 20px;
      background: rgba(255,255,255,.98);
    }
    .history-dialog-header { top: 0; justify-content: space-between; border-bottom: 1px solid #dbe7f4; }
    .history-detail-drawer > .history-dialog-header { display:grid; grid-template-columns:minmax(330px,auto) minmax(0,1fr) 44px; align-items:center; gap:12px; }
    .history-dialog-footer { bottom: 0; justify-content: flex-end; flex-wrap: wrap; border-top: 1px solid #dbe7f4; }
    .history-dialog-heading { display: flex; min-width: 0; align-items: center; flex-wrap: nowrap; gap: 10px; overflow:hidden; }
    .history-dialog-title { min-width:0; margin: 0; overflow:hidden; color: #0f2f4f; font-size: 24px; font-weight:950; line-height:1.25; overflow-wrap:normal; text-overflow:ellipsis; white-space:nowrap; }
    .history-dialog-warranty-brief { display:flex; align-items:center; gap:8px; min-width:0; width:100%; height:42px; padding:4px 6px 4px 12px; border:1px solid #93c5fd; border-radius:11px; background:linear-gradient(90deg,#f8fbff 0%,#f0fdf4 100%); box-shadow:0 3px 12px rgba(30,64,175,.07); overflow:hidden; }
    .history-dialog-warranty-brief[hidden] { display:none !important; }
    .history-dialog-warranty-text { display:flex; align-items:center; gap:5px; min-width:0; flex:1 1 auto; overflow:hidden; color:#173b5e; font-size:15px; font-weight:900; line-height:1.3; text-overflow:ellipsis; white-space:nowrap; }
    .history-dialog-warranty-text::before { content:"ประกัน ทั้งหมด/เหลือ: "; flex:0 0 auto; color:#15803d; font-weight:950; }
    .history-dialog-warranty-chip { display:block; flex:0 1 auto; min-width:0; max-width:100%; min-height:27px; padding:3px 8px; overflow:hidden; border:1px solid #cbd5e1; border-radius:999px; background:#f8fafc; color:#475569; font-size:inherit; font-weight:950; line-height:20px; text-overflow:ellipsis; white-space:nowrap; }
    .history-dialog-warranty-chip.is-active { border-color:#86efac; background:#dcfce7; color:#166534; }
    .history-dialog-warranty-chip.is-expired { border-color:#fca5a5; background:#fee2e2; color:#b91c1c; }
    .history-dialog-warranty-chip.is-upcoming { border-color:#c4b5fd; background:#ede9fe; color:#6d28d9; }
    .history-dialog-warranty-chip.is-unset { border-color:#cbd5e1; background:#f1f5f9; color:#64748b; }
    .history-dialog-warranty-brief .history-after-service-badge { flex:0 0 auto; min-height:28px; padding:3px 8px; font-size:11px; box-shadow:none; }
    .history-dialog-warranty-brief .history-after-service-icon { width:18px; height:18px; flex-basis:18px; }
    .history-dialog-warranty-brief .history-after-service-icon svg { width:17px; height:17px; }
    .history-detail-drawer > .history-dialog-header > .history-dialog-close { justify-self:end; }
    .history-after-service-badge { display:inline-flex; align-items:center; gap:7px; min-height:34px; padding:6px 11px; border:1px solid #cbd5e1; border-radius:999px; background:#f8fafc; color:#475569; font-size:12px; font-weight:900; white-space:nowrap; }
    .history-after-service-badge[hidden] { display:none !important; }
    .history-after-service-icon { position:relative; display:grid; place-items:center; flex:0 0 22px; width:22px; height:22px; }
    .history-after-service-icon svg { display:block; width:21px; height:21px; }
    .history-after-service-badge.is-available { border-color:#6ee7b7; background:#ecfdf5; color:#047857; box-shadow:0 0 12px rgba(16,185,129,.14); }
    .history-after-service-badge.is-unavailable { border-color:#fda4af; background:#fff1f2; color:#be123c; box-shadow:0 0 12px rgba(244,63,94,.12); }
    .history-after-service-badge.is-unavailable .history-after-service-icon::after { content:""; position:absolute; width:25px; height:2px; border-radius:2px; background:currentColor; transform:rotate(-42deg); box-shadow:0 0 0 2px rgba(255,241,242,.8); }
    .history-dialog-close {
      display: grid;
      place-items: center;
      flex: 0 0 44px !important;
      width: 44px !important;
      min-width: 44px !important;
      max-width: 44px !important;
      height: 44px;
      padding: 0;
      border: 1px solid #cbd5e1;
      border-radius: 12px;
      background: #fff;
      color: #334155;
      font-size: 22px;
      cursor: pointer;
    }
    .history-dialog-close:focus-visible,
    .history-confirm-button:focus-visible,
    .history-confirm-cancel:focus-visible { outline: 3px solid rgba(37,99,235,.28); outline-offset: 2px; }
    .history-detail-body { min-width: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; padding: 12px 14px 18px; scroll-padding: 78px 0 88px; }
    .history-detail-content { display: grid; gap: 14px; }
    .history-detail-skeleton[hidden],
    .history-detail-content[hidden] { display: none !important; }
    .history-detail-content > * { min-width: 0; }
    .history-detail-drawer .repair-history-expanded-detail { display: block; min-width: 0; margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
    .history-detail-sections { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items:start; gap: 10px; }
    .history-detail-section {
      grid-column:span 6;
      min-width: 0;
      padding: 10px;
      border: 1px solid #dbeafe;
      border-radius: 12px;
      background: #fff;
      box-shadow: 0 8px 24px rgba(30,64,175,.06);
    }
    /* The warranty rail is a long visual record, so use the drawer's full
       desktop width instead of leaving an unused right-hand grid column. */
    .history-outside-warranty-timeline { grid-column:1 / -1; width:100%; box-sizing:border-box; }
    .history-detail-section h3 { display: flex; align-items: center; gap: 7px; margin: 0 0 7px; color: #13395f; font-size: 16px; }
    .history-detail-section h3 > span { display: grid; flex:0 0 29px; place-items: center; width: 29px; height: 29px; border-radius: 9px; background: #e8f2ff; color: #2563eb; }
    .history-detail-section h3 > span > svg { display:block; width:17px; height:17px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
    .history-financial-overview { grid-column:1 / -1; border-color:#bae6fd; background:linear-gradient(135deg,#fff 0%,#f0f9ff 52%,#f0fdf4 100%); }
    .history-financial-overview-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:8px; }
    .history-financial-overview-head h3 { margin:0; }
    .history-financial-result { display:inline-flex; align-items:center; min-height:32px; padding:5px 11px; border:1px solid #86efac; border-radius:999px; background:#dcfce7; color:#166534; font-size:13px; font-weight:900; white-space:nowrap; }
    .history-financial-result.is-loss { border-color:#fecaca; background:#fee2e2; color:#b91c1c; }
    .history-financial-metrics { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:7px; }
    .history-financial-card { position:relative; display:grid; grid-template-columns:32px minmax(0,1fr); grid-template-rows:auto auto auto; column-gap:7px; min-width:0; padding:8px; border:1px solid #dbeafe; border-radius:10px; background:rgba(255,255,255,.94); box-shadow:0 5px 15px rgba(15,47,79,.05); }
    .history-financial-card > .history-financial-icon { grid-row:1 / 4; display:grid; place-items:center; align-self:start; width:32px; height:32px; border-radius:9px; background:#e0f2fe; color:#0369a1; }
    .history-financial-card > .history-financial-icon svg { width:21px; height:21px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
    .history-financial-card > span:not(.history-financial-icon) { min-width:0; color:#64748b; font-size:11px; font-weight:800; line-height:1.3; }
    .history-financial-card > strong { min-width:0; margin-top:1px; color:#17324d; font-size:19px; font-weight:950; line-height:1.15; overflow-wrap:anywhere; }
    .history-financial-card > small { min-width:0; margin-top:3px; color:#64748b; font-size:10px; line-height:1.3; overflow-wrap:anywhere; }
    .history-financial-card.is-revenue .history-financial-icon { background:#dcfce7; color:#15803d; }
    .history-financial-card.is-cost .history-financial-icon { background:#e0e7ff; color:#4338ca; }
    .history-financial-card.is-parts .history-financial-icon { background:#ffedd5; color:#c2410c; }
    .history-financial-card.is-expense .history-financial-icon { background:#fef3c7; color:#b45309; }
    .history-financial-card.is-net { border-color:#86efac; background:#f0fdf4; }
    .history-financial-card.is-net .history-financial-icon { background:#bbf7d0; color:#047857; }
    .history-financial-card.is-net > strong { color:#047857; }
    .history-financial-card.is-net.is-negative { border-color:#fecaca; background:#fff1f2; }
    .history-financial-card.is-net.is-negative .history-financial-icon { background:#fee2e2; color:#be123c; }
    .history-financial-card.is-net.is-negative > strong { color:#be123c; }
    .history-financial-breakdown { display:flex; align-items:center; flex-wrap:wrap; gap:7px 18px; margin-top:10px; padding:8px 10px; border:1px solid #dbeafe; border-radius:10px; background:rgba(255,255,255,.72); color:#64748b; font-size:11px; }
    .history-financial-breakdown strong { color:#1e3a5f; font-weight:900; }
    .history-financial-details { margin-top:10px; border:1px solid #cbd5e1; border-radius:12px; background:rgba(255,255,255,.9); overflow:hidden; }
    .history-financial-details > summary { display:grid; grid-template-columns:34px minmax(0,1fr) 28px; align-items:center; gap:9px; min-height:52px; padding:8px 11px; color:#17324d; cursor:pointer; list-style:none; user-select:none; }
    .history-financial-details > summary::-webkit-details-marker { display:none; }
    .history-financial-details > summary:hover { background:#f8fbff; }
    .history-financial-details > summary:focus-visible { outline:3px solid rgba(37,99,235,.25); outline-offset:-3px; }
    .history-financial-details-summary-icon { display:grid; place-items:center; width:34px; height:34px; border-radius:9px; background:#e0e7ff; color:#4338ca; }
    .history-financial-details-summary-icon svg,.history-financial-chevron svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
    .history-financial-details summary strong,.history-financial-details summary small { display:block; }
    .history-financial-details summary strong { font-size:13px; font-weight:900; }
    .history-financial-details summary small { margin-top:2px; color:#64748b; font-size:10px; }
    .history-financial-chevron { display:grid; place-items:center; color:#475569; transition:transform .2s ease; }
    .history-financial-details[open] .history-financial-chevron { transform:rotate(180deg); }
    .history-financial-detail-table-wrap { padding:0 10px 10px; overflow-x:auto; }
    .history-financial-detail-table { width:100%; min-width:820px; border-collapse:separate; border-spacing:0; font-size:12px; }
    .history-financial-detail-table th,.history-financial-detail-table td { padding:9px 10px; border-right:1px solid #e2e8f0; border-bottom:1px solid #e2e8f0; text-align:left; vertical-align:top; }
    .history-financial-detail-table th:first-child,.history-financial-detail-table td:first-child { border-left:1px solid #e2e8f0; }
    .history-financial-detail-table thead th { border-top:1px solid #e2e8f0; background:#eff6ff; color:#334155; font-size:11px; font-weight:900; white-space:nowrap; }
    .history-financial-detail-table thead th:first-child { border-top-left-radius:9px; }
    .history-financial-detail-table thead th:last-child { border-top-right-radius:9px; }
    .history-financial-detail-table tbody td:first-child { width:34%; }
    .history-financial-detail-table tbody td > strong { display:block; color:#172f4d; font-size:12px; line-height:1.35; }
    .history-financial-detail-table tbody td > small { display:block; margin-top:3px; color:#64748b; font-size:10px; line-height:1.35; }
    .history-financial-detail-table .is-money { text-align:right; font-weight:900; white-space:nowrap; }
    .history-financial-detail-table .is-revenue,.history-financial-detail-table .is-profit { color:#047857; }
    .history-financial-detail-table .is-cost,.history-financial-detail-table .is-loss { color:#be123c; }
    .history-financial-detail-table tfoot th { background:#f8fafc; color:#17324d; font-weight:950; text-align:right; white-space:nowrap; }
    .history-financial-detail-table tfoot th:first-child { text-align:left; border-bottom-left-radius:9px; }
    .history-financial-detail-table tfoot th:last-child { border-bottom-right-radius:9px; }
    .history-financial-kind { display:inline-flex; align-items:center; min-height:25px; padding:3px 8px; border-radius:999px; background:#e2e8f0; color:#334155; font-size:10px; font-weight:900; white-space:nowrap; }
    .history-financial-kind.is-service { background:#dcfce7; color:#166534; }
    .history-financial-kind.is-stock { background:#e0e7ff; color:#3730a3; }
    .history-financial-kind.is-parts,.history-financial-kind.is-external { background:#ffedd5; color:#9a3412; }
    .history-financial-kind.is-warranty { background:#dcfce7; color:#047857; }
    .history-financial-kind.is-cost,.history-financial-kind.is-expense { background:#fee2e2; color:#991b1b; }
    .history-financial-empty { padding:20px!important; color:#64748b; text-align:center!important; }
    .history-detail-summary,
    .history-section-combined,
    .history-section-external,
    .history-section-warranty { grid-column: 1 / -1; }
    .history-detail-summary { padding:12px; }
    .history-detail-summary h3 { margin-bottom:8px; font-size:17px; }
    .history-payment-section { grid-column:span 5; }
    .history-receipt-preview-section { grid-column:span 7; }
    .history-detail-combined-grid { display:grid; align-items:start; gap:10px; }
    .history-section-profile > .history-detail-combined-grid { grid-template-columns:minmax(0,2fr) minmax(0,3fr); }
    .history-section-work > .history-detail-combined-grid { grid-template-columns:minmax(0,3fr) minmax(0,2fr); }
    .history-detail-subsection { min-width:0; }
    .history-detail-subsection + .history-detail-subsection { padding-left:10px; border-left:1px solid #dbeafe; }
    .history-section-customer h3 > span { background:#e0f2fe; color:#0369a1; }
    .history-section-device h3 > span { background:#ede9fe; color:#6d28d9; }
    .history-section-job h3 > span { background:#ffedd5; color:#c2410c; }
    .history-section-finance h3 > span { background:#dcfce7; color:#15803d; }
    .history-detail-grid > div:has(> strong.is-empty-value) { display:none; }
    .history-section-finance .history-detail-grid-three,
    .history-payment-section .history-detail-grid-three { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .history-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows:auto; align-items:start; gap: 6px; }
    .history-detail-grid-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .history-detail-grid-summary { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .history-detail-grid > div { align-self:start; min-width: 0; height:auto; min-height:0; padding: 6px 8px; border: 1px solid #e2e8f0; border-radius: 8px; background: #f8fbff; }
    .history-detail-grid > .is-wide { grid-column: span 2; }
    .history-detail-grid span:not(.badge) { display: block; margin-bottom: 2px; color: #52657d; font-size: 12px; font-weight: 500; }
    .history-detail-grid strong { display: block; min-width: 0; color: #172f4d; line-height: 1.4; overflow-wrap: anywhere; word-break: break-word; white-space: normal; }
    .history-detail-grid strong small { display: block; margin-top: 6px; color: #64748b; font-weight: 600; overflow-wrap: anywhere; }
    @media (min-width: 1024px) {
      .history-section-profile .history-section-customer .history-detail-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
      .history-section-profile .history-section-device .history-detail-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
      .history-section-work .history-section-job .history-detail-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
      .history-section-work .history-section-finance .history-detail-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
      .history-section-external .history-detail-grid-three,
      .history-section-warranty > .history-detail-grid-three { grid-template-columns:repeat(5,minmax(0,1fr)); }
      .history-detail-grid-summary .history-summary-appointment { grid-column: span 2; }
      .history-detail-grid-summary .history-summary-appointment > strong {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        overflow-wrap: normal;
        word-break: normal;
        white-space: nowrap;
      }
      .history-detail-grid-summary .history-summary-appointment .appointment-relative-label {
        display: inline !important;
        white-space: nowrap;
      }
    }
    .history-detail-grid .is-empty-value { color: #718096; font-weight: 700; }
    .history-copy-inline { min-height: 32px; margin-left: 6px; padding: 4px 9px; border: 1px solid #bfdbfe; border-radius: 9px; background: #eff6ff; color: #1d4ed8; font: inherit; font-size: 12px; font-weight: 900; cursor: pointer; }
    .history-map-link { display: inline-flex; min-height: 36px; align-items: center; padding: 6px 12px; border: 1px solid #93c5fd; border-radius: 10px; background: #eff6ff; color: #1d4ed8; text-decoration: none; }
    .history-warranty-notice { display: flex; align-items: center; gap: 8px; min-width: 0; margin: 14px 0 0; padding: 12px 14px; border-left: 4px solid #0ea5e9; border-radius: 12px; background: #ecfeff; color: #155e75; line-height: 1.45; }
    .after-service-summary { position:relative; overflow:hidden; container-type:inline-size; box-sizing:border-box; width:auto; min-width:0; align-items:center; justify-content:center; gap:6px; border:2px solid #cbd5e1; text-align:center; transition:background-color .2s ease, border-color .2s ease, box-shadow .2s ease; }
    .after-service-summary .after-service-summary-icon { position:relative; z-index:1; display:flex; flex:0 0 auto; align-items:center; justify-content:center; width:30px; height:30px; margin:0 auto; color:#334155; opacity:1; pointer-events:none; }
    .after-service-summary .after-service-summary-icon svg { display:block; width:100%; height:100%; filter:drop-shadow(0 2px 3px rgba(15,23,42,.18)); }
    .after-service-summary strong { position:relative; z-index:1; display:block; width:100%; overflow:hidden; font-size:clamp(10px, 8cqw, 18px) !important; line-height:1.15; font-weight:950 !important; letter-spacing:-.45px; text-align:center; text-overflow:ellipsis; white-space:nowrap; }
    @container (min-width: 150px) { .after-service-summary strong { font-size:clamp(11px, 10cqw, 18px) !important; } }
    @container (min-width: 180px) { .after-service-summary strong { font-size:clamp(12px, 10.5cqw, 18px) !important; } }
    .after-service-summary.is-available { background: #ecfdf5; border-color: #22c55e; box-shadow: 0 8px 20px rgba(22,163,74,.16); }
    .after-service-summary.is-available span, .after-service-summary.is-available strong { color: #047857; }
    .after-service-summary.is-available strong { text-shadow:0 0 4px rgba(16,185,129,.48), 0 0 11px rgba(52,211,153,.30); }
    .after-service-summary.is-available .after-service-summary-icon { color:#047857; opacity:1; }
    .after-service-summary.is-unavailable { background: #fff1f2; border-color: #fb7185; box-shadow: 0 8px 20px rgba(225,29,72,.14); }
    .after-service-summary.is-unavailable span, .after-service-summary.is-unavailable strong { color: #be123c; }
    .after-service-summary.is-unavailable strong { text-shadow:0 0 4px rgba(244,63,94,.48), 0 0 11px rgba(251,113,133,.30); }
    .after-service-summary.is-unavailable .after-service-summary-icon { color:#be123c; opacity:1; }
    .after-service-choices { display:flex; align-items:center; flex-wrap:wrap; gap:14px; margin-top:12px; }
    .after-service-card label.after-service-choice { position:relative; display:inline-flex; flex-direction:row; align-items:center; justify-content:flex-start; column-gap:14px; width:auto; min-width:210px; min-height:48px; margin:0; padding:10px 15px; border:2px solid #cbd5e1; border-radius:12px; background:#fff; color:#334155; font-size:14px; line-height:1.4; font-weight:800; cursor:pointer; transition:.18s ease; }
    .after-service-choice:hover { border-color:#60a5fa; background:#f8fbff; }
    .after-service-choice input { display:block; align-self:center; flex:0 0 18px; width:18px; height:18px; margin:0 !important; padding:0; vertical-align:middle; accent-color:#0f766e; }
    .after-service-choice span { display:block; min-width:0; min-height:0; overflow:hidden; line-height:1.4; text-overflow:ellipsis; white-space:nowrap; }
    .after-service-choice:has(input:checked) { border-color:#0f766e; background:#ecfdf5; box-shadow:0 7px 18px rgba(15,118,110,.13); color:#065f46; }
    .after-service-choice.is-none:has(input:checked) { border-color:#e11d48; background:#fff1f2; color:#be123c; box-shadow:0 7px 18px rgba(225,29,72,.12); }
    .after-service-choice.is-receipt-signature:has(input:checked) { border-color:#2563eb; background:#eff6ff; color:#1d4ed8; box-shadow:0 7px 18px rgba(37,99,235,.13); }
    @media (max-width: 640px) {
      .after-service-summary { width:100%; min-width:0; gap:5px; }
      .after-service-summary .after-service-summary-icon { width:27px; height:27px; }
      .after-service-summary strong { font-size:clamp(9px, 10cqw, 13px) !important; letter-spacing:-.3px; }
      .after-service-choices { align-items:stretch; flex-wrap:wrap; gap:8px; margin-top:10px; }
      .after-service-card label.after-service-choice { display:flex; flex:1 1 0; flex-direction:row; width:auto; min-width:0; min-height:44px; padding:8px 9px; column-gap:7px; font-size:clamp(9px, 2.55vw, 12px); }
      .after-service-choice input { flex-basis:16px; width:16px; height:16px; }
      .after-service-card label.after-service-choice.is-receipt-signature { flex-basis:100%; }
    }
    .history-warranty-notice > strong { flex: 0 0 auto; }
    .history-warranty-copy { min-width: 0; overflow-wrap: anywhere; }
    .history-warranty-status-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin: 0 0 14px; }
    .history-warranty-status { display: grid; gap: 4px; min-width: 0; padding: 14px 16px; border: 2px solid #cbd5e1; border-radius: 14px; background: #f8fafc; }
    .history-warranty-status > span { color: #475569; font-size: 13px; font-weight: 900; }
    .history-warranty-status > strong { color: #334155; font-size: 20px; line-height: 1.3; overflow-wrap: anywhere; }
    .history-warranty-status > small { color: #64748b; font-weight: 700; }
    .history-warranty-status.is-active { border-color: #22c55e; background: #ecfdf5; box-shadow: 0 8px 22px rgba(22,163,74,.10); }
    .history-warranty-status.is-active > span,
    .history-warranty-status.is-active > strong { color: #047857; }
    .history-warranty-status.is-expired { border-color: #ef4444; background: #fff1f2; box-shadow: 0 8px 22px rgba(220,38,38,.10); }
    .history-warranty-status.is-expired > span,
    .history-warranty-status.is-expired > strong { color: #b91c1c; }
    .history-warranty-timeline { margin: 16px 0; padding: 16px; border: 1px solid #bfdbfe; border-radius: 16px; background: linear-gradient(145deg,#f8fbff 0%,#f0fdfa 100%); }
    .history-warranty-timeline-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
    .history-warranty-timeline-head strong { color: #12395d; font-size: 16px; }
    .history-warranty-timeline-head span { padding: 5px 9px; border-radius: 999px; background: #dbeafe; color: #1d4ed8; font-size: 11px; font-weight: 900; white-space: nowrap; }
    .history-warranty-timeline-list { display: grid; grid-template-columns:repeat(auto-fit,minmax(360px,1fr)); gap: 12px; align-items:stretch; }
    .history-warranty-track { --warranty-accent:#2563eb; --warranty-soft:#eff6ff; min-width: 0; min-height:156px; padding: 13px 14px 12px; border: 1px solid #bfdbfe; border-left: 5px solid var(--warranty-accent); border-radius: 14px; background: #fff; box-shadow: 0 6px 18px rgba(15,47,79,.06); }
    .history-warranty-track.is-external { --warranty-accent:#f97316; --warranty-soft:#fff7ed; border-color:#fed7aa; }
    .history-warranty-track.is-active { --warranty-accent:#16a34a; --warranty-soft:#f0fdf4; border-color:#86efac; }
    .history-warranty-track.is-expired { --warranty-accent:#dc2626; --warranty-soft:#fff1f2; border-color:#fecaca; }
    .history-warranty-track.is-upcoming { --warranty-accent:#7c3aed; --warranty-soft:#f5f3ff; border-color:#ddd6fe; }
    .history-warranty-track-head { display: grid; grid-template-columns:auto minmax(0,1fr) auto; align-items: start; gap: 10px; }
    .history-warranty-track-icon { display:grid; place-items:center; width:36px; height:36px; border-radius:11px; background:var(--warranty-soft); color:var(--warranty-accent); box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--warranty-accent) 17%,transparent); }
    .history-warranty-track-icon svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
    .history-warranty-track-title { min-width: 0; }
    .history-warranty-track-title > span { display: inline-flex; margin: 0 0 4px; padding: 3px 8px; border-radius: 999px; background: var(--warranty-soft); color: var(--warranty-accent); font-size: 10px; font-weight: 900; }
    .history-warranty-track-title > strong { display: block; color: #17324d; font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; }
    .history-warranty-track-title > small { display: block; margin-top: 3px; color: #64748b; line-height: 1.4; overflow-wrap: anywhere; }
    .history-warranty-track-state { align-self: center; padding: 6px 10px; border-radius: 999px; background: var(--warranty-soft); color: var(--warranty-accent); font-size: 12px; font-weight: 950; white-space: nowrap; }
    .history-warranty-track-line { position: relative; height: 12px; margin: 17px 7px 8px; border-radius: 999px; background: #dbe7f3; box-shadow: inset 0 1px 3px rgba(15,47,79,.12); }
    .history-warranty-track-fill { position: absolute; inset: 0 auto 0 0; width: var(--warranty-progress,0%); max-width: 100%; border-radius: inherit; background: linear-gradient(90deg,#22c55e,var(--warranty-accent)); }
    .history-warranty-track-dot { position: absolute; top: 50%; width: 16px; height: 16px; border: 3px solid #fff; border-radius: 50%; background: var(--warranty-accent); box-shadow: 0 2px 8px rgba(15,47,79,.25); transform: translate(-50%,-50%); }
    .history-warranty-track-dot.is-start { left: 0; }
    .history-warranty-track-dot.is-now { left: var(--warranty-progress,0%); }
    .history-warranty-track-dot.is-end { left: 100%; }
    .history-warranty-track-dates { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; color: #64748b; font-size: 11px; }
    .history-warranty-track-dates > span { min-width: 0; }
    .history-warranty-track-dates > span:nth-child(2) { text-align: center; }
    .history-warranty-track-dates > span:last-child { text-align: right; }
    .history-warranty-track-dates b { display: block; margin-top: 2px; color: #23415f; font-size: 12px; overflow-wrap: anywhere; }
    .history-warranty-track-empty { margin-top: 12px; padding: 10px 12px; border: 1px dashed #cbd5e1; border-radius: 10px; background: #f8fafc; color: #64748b; font-size: 12px; font-weight: 800; text-align: center; }
    .history-warranty-code { display:inline-flex; align-items:center; gap:9px; max-width:100%; margin-top:2px; padding:8px 12px; border:1px solid #bfdbfe; border-radius:11px; background:#eff6ff; color:#1e3a5f; }
    .history-warranty-code > span { color:#64748b; font-size:11px; font-weight:800; }
    .history-warranty-code > strong { font-size:14px; font-weight:950; overflow-wrap:anywhere; }
    /* The main warranty section is treated as a compact control panel: state
       first, then visual period progress, then exact dates. */
    .history-section-warranty { position:relative; overflow:hidden; border-color:#a7f3d0; background:radial-gradient(circle at 96% 0,rgba(16,185,129,.17),transparent 27%),linear-gradient(135deg,#f0fdf4 0%,#f8fffd 48%,#eff6ff 100%); }
    .history-section-warranty::before { content:""; position:absolute; inset:0 auto 0 0; width:5px; background:linear-gradient(#10b981,#06b6d4,#4f46e5); }
    .history-section-warranty > * { position:relative; }
    .history-warranty-hero { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:12px; margin:0 0 12px; padding:12px 14px; border:1px solid #86efac; border-radius:14px; background:rgba(255,255,255,.78); box-shadow:0 8px 20px rgba(16,185,129,.09); }
    .history-warranty-hero-icon { display:grid; place-items:center; width:42px; height:42px; border-radius:13px; background:linear-gradient(135deg,#059669,#0ea5e9); color:#fff; box-shadow:0 8px 16px rgba(5,150,105,.24); }
    .history-warranty-hero-icon svg { width:24px; height:24px; fill:none; stroke:currentColor; stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round; }
    .history-warranty-hero-copy { min-width:0; }.history-warranty-hero-copy span { display:block; color:#047857; font-size:11px; font-weight:900; letter-spacing:.03em; }.history-warranty-hero-copy strong { display:block; margin-top:2px; color:#12395d; font-size:17px; line-height:1.25; }.history-warranty-hero-copy small { display:block; margin-top:3px; color:#52708d; font-size:11px; line-height:1.35; }
    .history-warranty-hero-count { display:grid; place-items:center; min-width:54px; min-height:42px; padding:4px 9px; border-radius:12px; background:#ecfdf5; color:#047857; text-align:center; }.history-warranty-hero-count b { display:block; font-size:19px; line-height:1; }.history-warranty-hero-count small { display:block; margin-top:3px; font-size:9px; font-weight:900; }
    .history-warranty-status-grid { gap:10px; margin-bottom:12px; }.history-warranty-status { position:relative; padding:11px 14px 11px 52px; overflow:hidden; }.history-warranty-status::before { content:"✓"; position:absolute; left:13px; top:50%; display:grid; place-items:center; width:27px; height:27px; border-radius:9px; background:#e2e8f0; color:#475569; font-size:16px; font-weight:950; transform:translateY(-50%); }.history-warranty-status.is-active::before { background:#bbf7d0; color:#047857; }.history-warranty-status.is-expired::before { content:"!"; background:#fecdd3; color:#be123c; }
    .history-warranty-timeline { margin:12px 0; padding:13px; border-color:#99f6e4; background:linear-gradient(145deg,rgba(255,255,255,.92),rgba(236,253,245,.88)); box-shadow:inset 0 0 0 1px rgba(255,255,255,.72),0 8px 22px rgba(14,116,144,.07); }.history-warranty-track { position:relative; padding:12px 14px 11px; background:linear-gradient(105deg,#fff,var(--warranty-soft)); box-shadow:0 7px 18px rgba(15,47,79,.07); }.history-warranty-track::after { display:none; }.history-warranty-track-title > span::before { content:""; margin:0; }.history-warranty-track-line { margin:15px 8px 9px; background:linear-gradient(90deg,#dbe7f3,#e0f2fe); }.history-warranty-track-fill { box-shadow:0 0 12px rgba(14,165,233,.24); }
    .history-outside-warranty-timeline { position:relative; overflow:hidden; margin-top:10px; padding:12px; border:1px solid #a5f3fc; border-radius:14px; background:radial-gradient(circle at 96% 8%,rgba(139,92,246,.22),transparent 26%),linear-gradient(135deg,#ecfeff 0%,#eff6ff 52%,#f5f3ff 100%); box-shadow:0 12px 28px rgba(14,165,233,.12); }
    .history-outside-warranty-timeline::before { content:""; position:absolute; inset:0; pointer-events:none; background:linear-gradient(108deg,transparent 32%,rgba(255,255,255,.54) 48%,transparent 63%); background-size:220% 100%; animation:outside-warranty-sheen 5.5s ease-in-out infinite; }
    .outside-warranty-head { position:relative; z-index:1; display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-bottom:6px; }
    .outside-warranty-head h3 { display:flex; align-items:center; gap:9px; margin:0; color:#155e75; font-size:17px; }
    .outside-warranty-head-icon { display:grid; place-items:center; width:34px; height:34px; border-radius:11px; background:linear-gradient(135deg,#06b6d4,#2563eb 55%,#8b5cf6); color:#fff; box-shadow:0 7px 15px rgba(37,99,235,.25); }
    .outside-warranty-head-icon svg { width:19px; height:19px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
    .outside-warranty-count { padding:5px 10px; border-radius:999px; background:#ddd6fe; color:#5b21b6; font-size:11px; font-weight:900; }
    .outside-warranty-intro { position:relative; z-index:1; margin:0 0 8px; color:#0e7490; font-size:12px; }
    .outside-warranty-list { position:relative; z-index:1; display:grid; gap:8px; width:100%; }
    .outside-warranty-track { --outside-accent:#2563eb; --outside-progress:50%; position:relative; width:100%; min-width:0; padding:10px 12px; border:1px solid #bfdbfe; border-radius:12px; background:rgba(255,255,255,.94); box-shadow:0 7px 18px rgba(30,64,175,.10); animation:outside-warranty-enter .48s ease both; }
    .outside-warranty-track::before { content:""; position:absolute; inset:0 auto 0 0; width:5px; border-radius:15px 0 0 15px; background:linear-gradient(#06b6d4,#2563eb,#8b5cf6); }
    .outside-warranty-track.is-active { --outside-accent:#0f9f6e; border-color:#86efac; }
    .outside-warranty-track.is-expired { --outside-accent:#dc2626; border-color:#fecaca; }
    .outside-warranty-track.is-upcoming { --outside-accent:#7c3aed; border-color:#ddd6fe; }
    .outside-warranty-track.is-unset { --outside-accent:#0e7490; border-color:#bae6fd; }
    .outside-warranty-track-head { display:flex; align-items:flex-start; justify-content:space-between; gap:9px; margin-bottom:9px; }
    .outside-warranty-shop { min-width:0; display:flex; align-items:center; gap:9px; color:#0f172a; font-size:16px; font-weight:950; overflow-wrap:anywhere; }
    .outside-warranty-shop-icon { display:grid; place-items:center; flex:0 0 auto; width:29px; height:29px; border-radius:9px; background:#ecfeff; color:#0e7490; }
    .outside-warranty-shop-icon svg { width:17px; height:17px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
    .outside-warranty-condition { flex:0 0 auto; padding:5px 9px; border-radius:999px; background:#dcfce7; color:#166534; font-size:11px; font-weight:900; text-align:right; }
    .outside-warranty-rail { position:relative; height:10px; margin:0 10px 8px; border-radius:999px; background:#dbe7f3; box-shadow:inset 0 1px 3px rgba(15,47,79,.14); overflow:visible; }
    .outside-warranty-rail-fill { position:absolute; inset:0 auto 0 0; width:var(--outside-progress); max-width:100%; border-radius:inherit; background:linear-gradient(90deg,#06b6d4,#2563eb,#8b5cf6); background-size:180% 100%; animation:outside-warranty-flow 3s linear infinite; }
    .outside-warranty-point { position:absolute; top:50%; display:grid; place-items:center; width:23px; height:23px; border:3px solid #fff; border-radius:50%; color:#fff; font-size:10px; font-style:normal; box-shadow:0 2px 9px rgba(15,47,79,.28); transform:translate(-50%,-50%); }
    .outside-warranty-point.is-start { left:0; background:#06b6d4; }
    .outside-warranty-point.is-now { left:var(--outside-progress); width:27px; height:27px; background:var(--outside-accent); box-shadow:0 0 0 5px rgba(37,99,235,.15),0 3px 10px rgba(15,47,79,.28); animation:outside-warranty-current 1.8s ease-in-out infinite; }
    .outside-warranty-point.is-end { left:100%; background:#8b5cf6; }
    .outside-warranty-dates { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
    .outside-warranty-date { min-width:0; padding:6px 8px; border:1px solid #dbeafe; border-radius:9px; background:#f8fbff; color:#64748b; font-size:11px; font-weight:800; }
    .outside-warranty-date.is-now { border-color:#bfdbfe; background:linear-gradient(135deg,#eff6ff,#eef2ff); color:#1d4ed8; text-align:center; }
    .outside-warranty-date.is-end { border-color:#ddd6fe; background:#faf5ff; color:#6d28d9; text-align:right; }
    .outside-warranty-date b { display:block; margin-top:2px; color:#16324f; font-size:13px; overflow-wrap:anywhere; }
    .outside-warranty-date.is-now b { color:#1d4ed8; }
    .outside-warranty-date.is-end b { color:#6d28d9; }
    .outside-warranty-parts { margin:7px 0 0; padding:6px 8px; border-radius:8px; background:#f8fafc; color:#475569; font-size:12px; }
    .history-section-external article { padding:9px!important; border-radius:10px!important; }
    .history-section-external article > div:first-child { margin-bottom:6px!important; }
    @keyframes outside-warranty-sheen { 0%,32% { background-position:120% 0; } 68%,100% { background-position:-120% 0; } }
    @keyframes outside-warranty-flow { to { background-position:-180% 0; } }
    @keyframes outside-warranty-current { 0%,100% { transform:translate(-50%,-50%) scale(1); } 50% { transform:translate(-50%,-50%) scale(1.12); } }
    @keyframes outside-warranty-enter { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
    @media (prefers-reduced-motion: reduce) { .history-outside-warranty-timeline::before,.outside-warranty-rail-fill,.outside-warranty-point.is-now,.outside-warranty-track { animation:none; } }
    .history-payment-section { border-color: #a7f3d0; background: linear-gradient(145deg,#ffffff 0%,#f0fdfa 100%); }
    .history-payment-section h3 > span { background: #d1fae5; color: #047857; }
    .history-payment-grid > div { border-color: #ccfbf1; background: rgba(255,255,255,.92); }
    .history-payment-total { border-color: #6ee7b7 !important; background: #ecfdf5 !important; text-align:center; }
    .history-detail-grid .history-payment-total strong { color: #047857; font-size: 26px; line-height:1.25; }
    .history-external-profit { text-align:center; }
    /* The payment section shares a desktop grid row with the receipt preview.
       When a slip exists, let its preview use only the resulting empty space. */
    .history-payment-section:has(.history-payment-slip-preview) { align-self:stretch; display:flex; flex-direction:column; }
    .history-payment-slip-list { display:grid; flex:1 1 auto; min-height:0; gap:10px; margin-top:10px; }
    .history-payment-slip-preview { display:grid; grid-template-rows:minmax(0,1fr) auto; min-width:0; min-height:220px; padding:9px; overflow:hidden; border:1px solid #99f6e4; border-radius:12px; background:rgba(236,253,245,.85); box-shadow:inset 0 0 0 1px rgba(255,255,255,.7); cursor:pointer; font-family:inherit; }
    .history-payment-slip-preview img { display:block; min-width:0; min-height:0; width:100%; height:100%; max-width:100%; max-height:100% !important; aspect-ratio:auto !important; border-radius:8px; object-fit:contain; background:#f8fafc; }
    .history-payment-slip-preview small { display:block; width:100%; margin-top:7px; overflow:hidden; color:#047857; font-size:11px; font-weight:800; line-height:1.25; text-align:center; text-overflow:ellipsis; white-space:nowrap; }
    .history-tax-preview { min-width:0; margin-top:12px; padding:12px; border:1px solid #99f6e4; border-radius:12px; background:#f0fdfa; }
    .history-tax-preview-head { display:flex; align-items:center; justify-content:space-between; gap:10px; }
    .history-tax-preview-head > div { min-width:0; }
    .history-tax-preview-head h4 { margin:0; color:#115e59; font-size:14px; line-height:1.35; }
    .history-tax-preview-head span { display:block; margin-top:3px; color:#475569; font-size:12px; overflow-wrap:anywhere; }
    .history-tax-preview-head .btn { flex:none; white-space:nowrap; }
    .history-tax-preview .history-tax-preview-image,
    .history-tax-preview-pdf { box-sizing:border-box; width:100%; margin-top:10px; border:1px solid #99f6e4; border-radius:10px; background:#fff; }
    .admin-page .history-tax-preview .history-tax-preview-image img { display:block; width:100%; height:clamp(240px,45vh,520px); max-height:none; aspect-ratio:auto; object-fit:contain; background:#fff; }
    .history-tax-preview-pdf { display:grid; place-items:center; min-height:84px; padding:8px; }
    .history-tax-preview-pdf p { margin:0; padding:10px; color:#475569; text-align:center; }
    .history-tax-preview-pdf canvas { display:block; max-width:100%; max-height:560px; width:auto; height:auto; object-fit:contain; }
    .history-tax-preview-pdf [hidden] { display:none!important; }
    @media (max-width:760px) {
      .history-tax-preview { padding:10px; }
      .history-tax-preview-head { align-items:flex-start; flex-wrap:wrap; }
      .history-tax-preview-head > div { flex:1 1 170px; }
      .admin-page .history-tax-preview .history-tax-preview-image img { height:clamp(200px,44vh,380px); }
    }
    .history-payment-empty { display: grid; place-items: center; gap: 6px; min-height: 180px; padding: 24px; border: 1px dashed #94a3b8; border-radius: 14px; background: rgba(248,250,252,.82); color: #64748b; text-align: center; }
    .history-payment-empty > span { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: #d1fae5; color: #047857; font-size: 25px; font-weight: 900; }
    .history-payment-empty > strong { color: #334155; font-size: 16px; }
    .history-payment-empty > small { max-width: 360px; line-height: 1.55; }
    .history-receipt-preview-section { border-color:#bbf7d0; background:linear-gradient(145deg,#ffffff 0%,#f0fdf4 100%); }
    .history-receipt-preview-section h3 > span { background:#dcfce7; color:#15803d; }
    .history-receipt-preview-shell { position:relative; width:100%; min-height:260px; overflow:hidden; border:1px solid #86efac; border-radius:14px; background:#dbe7f3; box-shadow:inset 0 0 0 1px rgba(255,255,255,.65); }
    .history-receipt-preview-shell iframe { position:absolute; left:0; top:0; width:794px !important; max-width:none !important; height:1123px; border:0; background:#fff; transform-origin:top left; }
    .history-receipt-preview-loading { position:absolute; inset:0; display:grid; place-items:center; padding:20px; color:#166534; font-weight:900; text-align:center; background:linear-gradient(135deg,#ecfdf5,#eff6ff); }
    .history-receipt-preview-shell.is-ready .history-receipt-preview-loading { display:none; }
    .history-detail-drawer .repair-history-attachments,
    .history-detail-drawer .repair-history-timeline { min-width: 0; margin: 0; padding: 18px; border: 1px solid #dbeafe; border-radius: 16px; background: #fff; box-shadow: 0 8px 24px rgba(30,64,175,.06); }
    .history-attachment-summary { margin: 8px 0 14px; color: #64748b; }
    .history-section-empty { display: grid; place-items: center; gap: 6px; min-height: 120px; padding: 20px; border: 1px dashed #cbd5e1; border-radius: 14px; background: #f8fafc; color: #64748b; text-align: center; }
    .history-section-empty > span { font-size: 28px; color: #60a5fa; }
    .history-section-empty small { font-size: 13px; }
    .history-detail-drawer .repair-history-attachment-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); overflow: visible; }
    .history-detail-drawer .repair-media-thumb { width: 100%; min-width: 0; }
    @media (min-width: 768px) {
      .history-detail-drawer .repair-history-attachment-grid {
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: minmax(180px, 220px);
        grid-template-columns: none;
        justify-content: start;
        align-items: stretch;
        gap: 12px;
        max-width: 100%;
        padding: 2px 2px 10px;
        overflow-x: auto;
        overflow-y: hidden;
        overscroll-behavior-inline: contain;
        scrollbar-gutter: stable;
      }
      .history-detail-drawer .repair-history-attachment-grid .repair-media-thumb {
        width: 100%;
        min-width: 0;
        height: 100%;
        margin: 0;
      }
    }
    .history-detail-drawer .repair-history-timeline-row { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; overflow: hidden; }
    .history-detail-drawer .repair-history-timeline-step { min-width: 0; overflow:hidden; }
    .history-detail-drawer .repair-history-timeline-step * { min-width:0; overflow-wrap:anywhere; }
    .history-detail-skeleton { display: grid; gap: 12px; }
    .history-detail-skeleton span {
      height: 84px;
      border-radius: 14px;
      background: linear-gradient(90deg,#e8f0f8 25%,#f8fbff 45%,#e8f0f8 65%);
      background-size: 220% 100%;
      animation: history-skeleton 1.1s linear infinite;
    }
    @keyframes history-skeleton { to { background-position: -220% 0; } }
    @media (prefers-reduced-motion: reduce) { .history-detail-skeleton span { animation: none; } }
    .history-confirm-layer { align-items: center; justify-content: center; padding: 18px; }
    .history-confirm-dialog {
      position: relative;
      z-index: 1;
      width: min(520px, 100%);
      max-height: min(86dvh, 640px);
      overflow-y: auto;
      border-radius: 20px;
      background: #fff;
      box-shadow: 0 28px 80px rgba(15,23,42,.30);
    }
    .history-confirm-body { display: grid; gap: 14px; padding: 20px; color: #475569; }
    .history-confirm-body p { margin: 0; line-height: 1.6; }
    .history-confirm-meta { padding: 12px 14px; border-left: 4px solid #3b82f6; border-radius: 10px; background: #eff6ff; color: #17385f; }
    .history-confirm-field { display: grid; gap: 7px; color: #334155; font-weight: 800; }
    .history-confirm-field[hidden] { display: none !important; }
    .history-confirm-field input { height: 44px; padding: 8px 12px; border: 1px solid #cbd5e1; border-radius: 10px; font: inherit; }
    .history-confirm-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 0 20px 20px; }
    .history-confirm-button,
    .history-confirm-cancel { min-height: 44px; padding: 9px 18px; border: 1px solid #bfdbfe; border-radius: 11px; font: inherit; font-weight: 900; cursor: pointer; }
    .history-confirm-cancel { background: #fff; color: #334155; }
    .history-confirm-button { background: #2563eb; color: #fff; }
    .history-confirm-button.is-danger { border-color: #dc2626; background: #dc2626; }
    .history-confirm-button:disabled { opacity: .48; cursor: not-allowed; }
    .history-toast-stack {
      position: fixed;
      z-index: 650;
      top: 88px;
      right: 18px;
      display: grid;
      width: min(380px, calc(100vw - 36px));
      gap: 10px;
      pointer-events: none;
    }
    .history-toast-item {
      display: grid;
      grid-template-columns: auto minmax(0, 1fr) auto;
      align-items: start;
      gap: 10px;
      padding: 13px 14px;
      border: 1px solid transparent;
      border-radius: 14px;
      color: #fff;
      box-shadow: 0 16px 36px rgba(15,23,42,.20);
      pointer-events: auto;
    }
    .history-toast-item.success { background: #15803d; border-color: #16a34a; }
    .history-toast-item.error { background: #b91c1c; border-color: #dc2626; }
    .history-toast-item.warning { background: #b45309; border-color: #d97706; }
    .history-toast-item.info { background: #1d4ed8; border-color: #2563eb; }
    .history-toast-icon { font-size: 19px; line-height: 1.2; }
    .history-toast-message { line-height: 1.45; }
    .history-toast-dismiss { width: 28px; height: 28px; padding: 0; border: 0; background: transparent; color: inherit; font-size: 18px; cursor: pointer; }
    .history-loading-state {
      position: fixed;
      z-index: 620;
      inset: 0;
      display: grid;
      place-items: center;
      background: rgba(15,23,42,.28);
      pointer-events: auto;
    }
    .history-loading-card { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-radius: 14px; background: #fff; color: #0f2f4f; font-weight: 900; box-shadow: 0 18px 48px rgba(15,23,42,.24); }
    .history-loading-spinner { width: 22px; height: 22px; border: 3px solid #bfdbfe; border-top-color: #2563eb; border-radius: 50%; animation: history-spin .7s linear infinite; }
    @keyframes history-spin { to { transform: rotate(360deg); } }
    @media (prefers-reduced-motion: reduce) { .history-loading-spinner { animation-duration: 1.6s; } }
    /* Full-screen repair editor: keep every existing field and submit contract,
       but present them with the same clear section/card hierarchy as the detail view. */
    .repair-edit-modal {
      z-index: 510;
      place-items: stretch;
      padding: 0;
      background: #eef5fc;
    }
    .repair-edit-modal-dialog {
      width: 100vw;
      max-width: none;
      height: 100dvh;
      max-height: 100dvh;
      border: 0;
      border-radius: 0;
      background: #f4f8fd;
      box-shadow: none;
      scrollbar-gutter: stable;
    }
    .repair-edit-modal-bar {
      min-height: 74px;
      padding: 12px 22px;
      color: #0f2f4f;
      background: rgba(255,255,255,.98);
      border-bottom: 1px solid #d8e6f5;
      box-shadow: 0 8px 26px rgba(15,47,79,.08);
      backdrop-filter: blur(14px);
    }
    .repair-edit-modal-bar strong {
      min-width: 0;
      color: #0f2f4f;
      font-size: clamp(18px, 1.7vw, 24px);
      overflow-wrap: anywhere;
    }
    .repair-edit-modal-bar-actions { flex-wrap: wrap; }
    .repair-edit-modal-action {
      min-height: 46px;
      border-color: #bfdbfe;
      box-shadow: 0 8px 18px rgba(37,99,235,.10);
    }
    .repair-edit-modal-action-save { background: #0f766e; border-color: #5eead4; }
    .repair-edit-modal-action-copy { color: #1d4ed8; background: #eff6ff; border-color: #bfdbfe; }
    .repair-edit-modal-action-save-close { background: #15803d; border-color: #86efac; }
    .repair-edit-modal-close { min-height: 46px; background: #dc2626; border-color: #fca5a5; }
    .repair-edit-modal-dialog .edit-order-panel { background: #f4f8fd !important; }
    .repair-edit-modal-dialog .edit-order-hero {
      grid-template-columns: minmax(320px, 1.25fr) minmax(520px, 1fr);
      align-items: center;
      gap: 24px;
      padding: 24px clamp(18px, 3vw, 44px);
      background: linear-gradient(135deg, #f0fbff 0%, #eef4ff 55%, #f7f4ff 100%) !important;
      border-bottom: 1px solid #cfe1f3;
    }
    .repair-edit-modal-dialog .edit-order-hero h2 {
      color: #0f2f4f;
      font-size: clamp(25px, 2.6vw, 38px);
      overflow-wrap: anywhere;
    }
    .repair-edit-modal-dialog .edit-order-kicker {
      color: #1d4ed8;
      border-color: #bfdbfe;
      background: #fff;
    }
    .repair-edit-modal-dialog .edit-order-summary {
      grid-template-columns: repeat(4, minmax(130px, 1fr));
      gap: 12px;
    }
    .repair-edit-modal-dialog .edit-summary-chip,
    .repair-edit-modal-dialog .edit-scroll-btn {
      min-height: 80px;
      padding: 15px;
      border-radius: 16px;
      border: 1px solid #bfe3ed;
      background: linear-gradient(180deg, #ffffff 0%, #edfaff 100%);
      box-shadow: 0 8px 20px rgba(15,47,79,.06);
    }
    .repair-edit-modal-dialog .edit-summary-chip {
      display: flex;
      min-width: 0;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      text-align: center;
    }
    .repair-edit-modal-dialog .edit-summary-chip > span:not(.after-service-summary-icon),
    .repair-edit-modal-dialog .edit-summary-chip > strong {
      width: 100%;
      min-width: 0;
      text-align: center;
    }
    .repair-edit-modal-dialog .edit-summary-chip-payment > strong {
      overflow: hidden;
      font-size: clamp(11px, 1vw, 16px);
      letter-spacing: -.2px;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .repair-edit-modal-dialog .edit-scroll-btn { box-sizing: border-box; }
    .repair-edit-modal-dialog .edit-order-form {
      width: min(1760px, 100%);
      margin: 0 auto;
      padding: 24px clamp(14px, 2.4vw, 36px) 36px;
      box-sizing: border-box;
    }
    .repair-edit-modal-dialog .edit-group {
      margin: 0 0 26px;
      padding: 0;
      border: 0;
      border-radius: 0;
      background: transparent;
    }
    .repair-edit-modal-dialog .edit-group-head {
      align-items: center;
      margin: 0 0 14px;
      padding: 15px 18px;
      border: 1px solid #cfe0f2;
      border-left: 5px solid #2563eb;
      border-radius: 15px;
      background: linear-gradient(90deg, #eaf3ff 0%, #f7fbff 100%);
      box-shadow: 0 8px 22px rgba(37,99,235,.05);
    }
    .repair-edit-modal-dialog .edit-group:nth-of-type(2) .edit-group-head {
      border-left-color: #0f766e;
      background: linear-gradient(90deg, #e9fbf7 0%, #f7fffd 100%);
    }
    .repair-edit-modal-dialog .edit-group-head h3 {
      color: #0f2f4f;
      font-size: clamp(19px, 1.7vw, 24px);
    }
    .repair-edit-modal-dialog .edit-group-head p {
      max-width: none;
      margin-top: 5px;
      color: #60748b;
    }
    .repair-edit-modal-dialog .edit-group-badge {
      color: #1d4ed8;
      background: #fff;
      border: 1px solid #bfdbfe;
    }
    .repair-edit-modal-dialog .edit-group:nth-of-type(2) .edit-group-badge {
      color: #0f766e;
      border-color: #99f6e4;
    }
    .repair-edit-modal-dialog .edit-section {
      margin-bottom: 16px;
      padding: 18px;
      border: 1px solid #d4e3f2;
      border-radius: 18px;
      background: #fff;
      box-shadow: 0 10px 28px rgba(15,47,79,.055);
    }
    .repair-edit-modal-dialog .edit-section-head {
      margin: -2px 0 14px;
      padding: 0 0 12px;
      border-bottom: 1px solid #e2ebf5;
    }
    .repair-edit-modal-dialog .edit-section-head h3 {
      color: #0f2f4f;
      font-size: clamp(18px, 1.45vw, 22px);
    }
    .repair-edit-modal-dialog .edit-section-head p { color: #64748b; }
    .repair-edit-modal-dialog .edit-card-grid,
    .repair-edit-modal-dialog .edit-card-grid-2,
    .repair-edit-modal-dialog .edit-card-grid-3 { gap: 12px; }
    .repair-edit-modal-dialog .edit-card {
      min-width: 0;
      padding: 14px;
      border: 1px solid #d7e4f1;
      border-radius: 14px;
      background: linear-gradient(180deg, #fbfdff 0%, #f5f9fd 100%);
      box-shadow: none;
    }
    .repair-edit-modal-dialog .edit-card label {
      color: #526a82;
      font-size: 13px;
    }
    .repair-edit-modal-dialog .edit-card .input,
    .repair-edit-modal-dialog .edit-card textarea,
    .repair-edit-modal-dialog .edit-card select {
      min-width: 0;
      min-height: 48px;
      padding: 11px 13px;
      border: 1px solid #bfd3e8;
      border-radius: 12px;
      background: #fff;
      color: #172f4d;
      font-size: 16px;
      line-height: 1.45;
      box-sizing: border-box;
    }
    .repair-edit-modal-dialog .edit-card textarea { min-height: 94px; }
    .repair-edit-modal-dialog .choice-card {
      min-height: 48px;
      justify-content: flex-start;
      border-color: #d7e4f1;
      background: #fff;
    }
    .repair-edit-modal-dialog .edit-order-actions {
      position: sticky;
      bottom: 0;
      z-index: 12;
      grid-template-columns: repeat(5, minmax(0, 1fr));
      width: 100%;
      margin: 20px 0 0;
      padding: 14px;
      border: 1px solid #d4e3f2;
      border-radius: 16px;
      background: rgba(255,255,255,.96);
      box-shadow: 0 -10px 26px rgba(15,47,79,.08);
      backdrop-filter: blur(12px);
    }
    .repair-edit-modal-action.is-loading { opacity: .72; pointer-events: none; }
    .history-field-error { display: block; margin-top: 6px; color: #b91c1c; font-size: 13px; font-weight: 800; }
    .history-field-invalid { border-color: #dc2626 !important; box-shadow: 0 0 0 3px rgba(220,38,38,.12) !important; }

    /* Compact only the groups marked by the user on desktop. */
    @media (min-width: 1024px) {
      .repair-edit-modal-dialog .desktop-marked-grid { align-items: stretch; }
      .repair-edit-modal-dialog .desktop-marked-grid > .edit-card:not(.desktop-unmarked-card) {
        min-width: 0;
        min-height: 66px;
        padding: 7px 9px;
        display: flex;
        flex-direction: column;
        justify-content: center;
      }
      .repair-edit-modal-dialog .desktop-marked-grid > .edit-card:not(.desktop-unmarked-card):not(.desktop-preserve-full) {
        display: grid;
        grid-template-columns: clamp(70px, 5.2vw, 92px) minmax(0, 1fr);
        align-items: center;
        column-gap: 4px;
        row-gap: 4px;
        text-align: left !important;
        height: 100%;
      }
      .repair-edit-modal-dialog .desktop-marked-grid > .edit-card:not(.desktop-unmarked-card) > label:first-child {
        grid-column: 1;
        margin: 0;
        text-align: left !important;
        line-height: 1.25;
      }
      .repair-edit-modal-dialog .desktop-marked-grid > .edit-card:not(.desktop-unmarked-card):not(.desktop-preserve-full) > :not(label:first-child) {
        grid-column: 2;
        width: 100%;
        min-width: 0;
        max-width: none;
        box-sizing: border-box;
      }
      .repair-edit-modal-dialog .desktop-marked-grid > .edit-card:not(.desktop-unmarked-card) > .input,
      .repair-edit-modal-dialog .desktop-marked-grid > .edit-card:not(.desktop-unmarked-card) > input:not([type="checkbox"]):not([type="radio"]),
      .repair-edit-modal-dialog .desktop-marked-grid > .edit-card:not(.desktop-unmarked-card) > select,
      .repair-edit-modal-dialog .desktop-marked-grid > .edit-card:not(.desktop-unmarked-card) > textarea {
        min-height: 36px;
        text-align: left !important;
      }
      .repair-edit-modal-dialog .desktop-marked-grid > .edit-card:not(.desktop-unmarked-card) > textarea {
        height: 40px;
        resize: vertical;
      }
      .repair-edit-modal-dialog .desktop-marked-grid > .edit-card:not(.desktop-unmarked-card) > .input,
      .repair-edit-modal-dialog .desktop-marked-grid > .edit-card:not(.desktop-unmarked-card) > input:not([type="checkbox"]):not([type="radio"]),
      .repair-edit-modal-dialog .desktop-marked-grid > .edit-card:not(.desktop-unmarked-card) > select,
      .repair-edit-modal-dialog .desktop-marked-grid > .edit-card:not(.desktop-unmarked-card) > textarea {
        width: 100% !important;
        max-width: none !important;
        box-sizing: border-box;
      }
      .repair-edit-modal-dialog .desktop-customer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
      .repair-edit-modal-dialog .desktop-customer-grid > .edit-card:nth-child(-n+4) {
        grid-template-columns: clamp(58px, 4vw, 72px) minmax(0, 1fr);
        column-gap: 4px;
        text-align: left !important;
      }
      .repair-edit-modal-dialog .desktop-customer-grid > .edit-card:nth-child(-n+4) > label,
      .repair-edit-modal-dialog .desktop-customer-grid > .edit-card:nth-child(-n+4) > .input,
      .repair-edit-modal-dialog .desktop-customer-grid > .edit-card:nth-child(-n+4) > input:not([type="checkbox"]):not([type="radio"]),
      .repair-edit-modal-dialog .desktop-customer-grid > .edit-card:nth-child(-n+4) > textarea,
      .repair-edit-modal-dialog .desktop-customer-grid > .edit-card:nth-child(-n+4) > small {
        width: 100% !important;
        min-width: 0;
        text-align: left !important;
      }
      .repair-edit-modal-dialog .desktop-customer-grid > .edit-card:nth-child(-n+4) > .input,
      .repair-edit-modal-dialog .desktop-customer-grid > .edit-card:nth-child(-n+4) > input:not([type="checkbox"]):not([type="radio"]),
      .repair-edit-modal-dialog .desktop-customer-grid > .edit-card:nth-child(-n+4) > textarea {
        height: 36px;
        min-height: 36px;
      }
      .repair-edit-modal-dialog .desktop-customer-grid textarea[name="customer_address"] {
        height: 76px;
        min-height: 76px;
        line-height: 1.5;
        resize: vertical;
      }
      .repair-edit-modal-dialog .desktop-customer-grid > .edit-card:nth-child(5),
      .repair-edit-modal-dialog .desktop-customer-grid > .edit-card:nth-child(6) { grid-column: auto; }
      .repair-edit-modal-dialog .desktop-device-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
      .repair-edit-modal-dialog .desktop-device-grid > .edit-card:nth-child(5),
      .repair-edit-modal-dialog .desktop-device-grid > .edit-card:nth-child(6) {
        grid-column: span 2;
        grid-template-columns: clamp(90px, 6.2vw, 112px) minmax(0, 1fr);
      }
      .repair-edit-modal-dialog .desktop-device-grid > .edit-card:last-child {
        grid-column: span 2;
        grid-template-columns: clamp(90px, 6.2vw, 112px) minmax(0, 1fr);
      }
      .repair-edit-modal-dialog .desktop-symptom-section {
        grid-template-columns: minmax(170px, .42fr) minmax(0, 1.58fr) !important;
      }
      .repair-edit-modal-dialog .desktop-symptom-section > .edit-card,
      .repair-edit-modal-dialog .desktop-images-grid > .edit-card,
      .repair-edit-modal-dialog .desktop-status-grid > .edit-card,
      .repair-edit-modal-dialog .desktop-finance-grid > .edit-card,
      .repair-edit-modal-dialog .desktop-notes-grid > .edit-card { grid-column: auto !important; }
      .repair-edit-modal-dialog .desktop-symptom-section > .edit-card:first-child {
        grid-column: 1 / -1 !important;
      }
      .repair-edit-modal-dialog .desktop-symptom-section > .edit-card:not(:first-child) {
        grid-template-columns: clamp(90px, 6.2vw, 112px) minmax(0, 1fr);
      }
      .repair-edit-modal-dialog .desktop-symptom-choices {
        grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
        gap: 8px;
      }
      .repair-edit-modal-dialog .desktop-symptom-choices .choice-card {
        min-height: 36px;
        padding: 6px;
        justify-content: flex-start;
        text-align: left !important;
      }
      .repair-edit-modal-dialog .desktop-images-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
      .repair-edit-modal-dialog .desktop-status-grid { grid-template-columns: minmax(210px, 24%) minmax(0, 76%) !important; }
      .repair-edit-modal-dialog .desktop-status-grid > .edit-card:last-child {
        grid-template-columns: clamp(120px, 8vw, 145px) minmax(0, 1fr);
      }
      .repair-edit-modal-dialog .desktop-warranty-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
      .repair-edit-modal-dialog .desktop-warranty-grid > .edit-card:last-child { grid-column: 1 / -1; }
      .repair-edit-modal-dialog .desktop-finance-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
      .repair-edit-modal-dialog .desktop-finance-grid > .desktop-preserve-full { grid-column: 1 / -1 !important; }
      .repair-edit-modal-dialog .desktop-finance-grid .repair-part-row {
        grid-template-columns: minmax(0, 1.65fr) minmax(240px, .35fr) !important;
        align-items: center !important;
      }
      .repair-edit-modal-dialog .desktop-finance-grid .repair-part-row .input {
        width: 100% !important;
        min-width: 0;
        min-height: 36px;
        box-sizing: border-box;
        text-align: left !important;
      }
      .repair-edit-modal-dialog .desktop-notes-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
      .repair-edit-modal-dialog .desktop-notes-grid > .after-service-card { grid-column: 1 / -1 !important; }
      .repair-edit-modal-dialog .desktop-notes-grid .after-service-choices { justify-content: center; }
    }

    @media (max-width: 1023px) {
      .repair-edit-modal-dialog .edit-order-hero { grid-template-columns: 1fr; }
      .repair-edit-modal-dialog .edit-order-summary { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
      .repair-edit-modal-dialog .edit-card-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .history-feedback-layer { padding: 2dvh 2vw; }
      .history-detail-drawer { width: 96vw; max-width: none; height: 96dvh; }
      .history-detail-sections { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .history-detail-section,
      .history-payment-section,
      .history-receipt-preview-section { grid-column:span 1; }
      .history-detail-summary,
      .history-section-combined,
      .history-section-external,
      .history-section-warranty { grid-column:1 / -1; }
      .history-detail-grid-summary,
      .history-detail-grid-three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .history-detail-drawer .repair-history-timeline-row { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
      .history-detail-drawer > .history-dialog-header { grid-template-columns:minmax(210px,.8fr) minmax(0,1.2fr) 44px; gap:8px; }
      .history-dialog-title { font-size:17px; }
      .history-dialog-warranty-text { font-size:13px; }
      .history-dialog-warranty-text::before { content:"ประกัน: "; }
      .history-dialog-heading > .badge { display:none !important; }
      .history-financial-metrics { grid-template-columns:repeat(3,minmax(0,1fr)); }
    }
    @media (max-width: 767px) {
      .history-feedback-layer { padding: 0; }
      .history-detail-drawer { width: 100vw; height: 100dvh; border: 0; border-radius: 0; }
      .history-dialog-header, .history-dialog-footer { padding: 12px max(12px, env(safe-area-inset-right)) 12px max(12px, env(safe-area-inset-left)); }
      .history-dialog-footer { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
      .history-dialog-footer .btn { min-height: 44px; flex: 1 1 42%; }
      .history-detail-body { padding: 14px 12px 24px; }
      .history-financial-overview-head { align-items:flex-start; flex-direction:column; }
      .history-financial-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
      .history-financial-card.is-net { grid-column:1 / -1; }
      .history-financial-breakdown { display:grid; grid-template-columns:1fr; gap:5px; }
      .history-financial-details > summary { grid-template-columns:32px minmax(0,1fr) 24px; padding:8px; }
      .history-financial-detail-table-wrap { padding:0 8px 8px; overflow:visible; }
      .history-financial-detail-table { display:block; min-width:0; }
      .history-financial-detail-table thead { display:none; }
      .history-financial-detail-table tbody { display:grid; gap:8px; }
      .history-financial-detail-table tbody tr { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0; border:1px solid #dbeafe; border-radius:10px; background:#fff; overflow:hidden; }
      .history-financial-detail-table tbody td { display:block; width:auto!important; padding:8px; border:0; border-bottom:1px solid #eef2f7; text-align:right; }
      .history-financial-detail-table tbody td:first-child { grid-column:1 / -1; border-left:0; text-align:left; }
      .history-financial-detail-table tbody td::before { content:attr(data-label); display:block; margin-bottom:3px; color:#64748b; font-size:9px; font-weight:800; }
      .history-financial-detail-table tbody td:first-child::before { display:none; }
      .history-financial-detail-table tbody td:nth-child(2) { text-align:left; }
      .history-financial-detail-table .is-money { text-align:right; }
      .history-financial-detail-table tfoot { display:block; margin-top:8px; }
      .history-financial-detail-table tfoot tr { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); border:1px solid #cbd5e1; border-radius:10px; overflow:hidden; }
      .history-financial-detail-table tfoot th { display:block; padding:7px 5px; border:0; text-align:right; font-size:10px; white-space:normal; }
      .history-financial-detail-table tfoot th:first-child { grid-column:1 / -1; border-bottom:1px solid #e2e8f0; text-align:left; }
      .history-detail-sections { grid-template-columns: 1fr; gap: 12px; }
      .history-section-profile > .history-detail-combined-grid,
      .history-section-work > .history-detail-combined-grid { grid-template-columns:1fr; gap:10px; }
      .history-detail-subsection + .history-detail-subsection { padding-top:10px; padding-left:0; border-top:1px solid #dbeafe; border-left:0; }
      .history-detail-section,
      .history-detail-drawer .repair-history-attachments,
      .history-detail-drawer .repair-history-timeline { grid-column: auto; padding: 10px; border-radius: 12px; }
      .history-detail-grid,
      .history-detail-grid-three,
      .history-detail-grid-summary {
        display:flex;
        flex-wrap:wrap;
        grid-template-columns:none;
        gap:5px;
      }
      .history-detail-grid > div {
        flex:1 1 calc(50% - 5px);
        width:auto;
        min-width:0;
        padding:6px 7px;
        border-radius:8px;
      }
      .history-detail-grid span:not(.badge) { margin-bottom:2px; font-size:11px; line-height:1.35; font-weight:500; }
      .history-detail-grid strong { font-size:13px; line-height:1.45; font-weight:650; }
      .history-detail-grid > .is-wide > strong { font-weight:500; }
      .history-detail-grid strong small { margin-top:3px; font-size:11px; line-height:1.4; font-weight:400; }
      .history-detail-grid .history-payment-total strong,
      .history-detail-grid .history-external-profit strong { font-weight:800; }
      .history-detail-drawer .muted { font-size:11px; line-height:1.45; font-weight:400; }
      .history-detail-grid-summary > div:nth-child(1),
      .history-detail-grid-summary > div:nth-child(2) { flex-basis:calc(50% - 5px); }
      .history-detail-grid-summary > div:nth-child(3),
      .history-detail-grid-summary > div:nth-child(4) { flex-basis:calc(50% - 5px); }
      .history-detail-grid-summary > .history-summary-appointment { flex-basis:100%; }
      .history-detail-grid-summary .history-summary-appointment > strong { font-size:13px; line-height:1.4; }
      .history-detail-grid-summary .history-copy-inline { min-height:24px; margin:3px 0 0; padding:2px 6px; font-size:9px; }
      .history-detail-grid strong:has(.history-copy-inline) { display:grid; gap:8px; }
      .history-detail-grid strong:has(.history-copy-inline) .history-copy-inline { width:100%; margin-left:0; }
      .history-detail-grid-summary strong:has(.history-copy-inline) { display:flex; align-items:center; flex-wrap:wrap; gap:3px 5px; }
      .history-detail-grid-summary strong:has(.history-copy-inline) .history-copy-inline { display:inline-flex !important; flex:0 0 22px !important; width:22px !important; min-width:22px !important; max-width:22px !important; min-height:22px !important; height:22px !important; margin:0 !important; padding:1px !important; align-items:center; justify-content:center; overflow:hidden; font-size:0 !important; }
      .history-detail-grid-summary strong:has(.history-copy-inline) .history-copy-inline::before { content:"⧉"; font-size:11px; line-height:1; }
      .history-detail-section h3 { gap:6px; margin-bottom:8px; font-size:16px; font-weight:750; line-height:1.4; }
      .history-detail-section h3 > span { flex-basis:24px; width:24px; height:24px; border-radius:7px; }
      .history-detail-section h3 > span > svg { width:14px; height:14px; }
      .history-warranty-status-grid { grid-template-columns:repeat(auto-fit,minmax(135px,1fr)); gap:6px; margin-bottom:9px; }
      .history-warranty-hero { grid-template-columns:auto minmax(0,1fr); gap:9px; padding:10px; }.history-warranty-hero-icon { width:36px; height:36px; border-radius:11px; }.history-warranty-hero-copy strong { font-size:14px; }.history-warranty-hero-copy small { font-size:10px; }.history-warranty-hero-count { grid-column:1 / -1; grid-template-columns:auto auto; justify-content:start; gap:6px; min-width:0; min-height:0; padding:5px 8px; }.history-warranty-hero-count small { margin:0; }
      .history-warranty-status { gap:2px; padding:8px 9px 8px 43px; border-radius:10px; }.history-warranty-status::before { left:10px; width:24px; height:24px; border-radius:8px; font-size:14px; }
      .history-warranty-status > span { font-size:11px; font-weight:500; }
      .history-warranty-status > strong { font-size:15px; line-height:1.4; font-weight:750; }
      .history-warranty-status > small { font-size:11px; font-weight:400; }
      .history-warranty-timeline { padding: 12px; border-radius: 14px; }
      .history-warranty-timeline-head { align-items: flex-start; flex-direction: column; gap: 7px; }
      .history-warranty-timeline-list { grid-template-columns:1fr; }
      .history-warranty-track { min-height:0; padding: 12px 11px; }
      .history-warranty-track-head { grid-template-columns:auto minmax(0,1fr); gap: 8px; }
      .history-warranty-track-icon { width:32px; height:32px; border-radius:10px; }
      .history-warranty-track-state { grid-column:2; justify-self:start; }
      .history-warranty-track-dates { gap: 4px; font-size: 10px; }
      .history-warranty-track-dates b { font-size: 11px; }
      .history-outside-warranty-timeline { padding:13px; border-radius:14px; }
      .outside-warranty-head h3 { font-size:15px; }
      .outside-warranty-track { padding:13px 12px 12px; }
      .outside-warranty-track-head { gap:8px; margin-bottom:13px; }
      .outside-warranty-shop { font-size:14px; }
      .outside-warranty-condition { max-width:44%; font-size:10px; white-space:normal; }
      .outside-warranty-rail { margin-left:11px; margin-right:11px; }
      .outside-warranty-dates { gap:5px; }
      .outside-warranty-date { padding:7px 5px; font-size:9px; }
      .outside-warranty-date b { font-size:10px; }
      .history-detail-grid > .is-wide { flex-basis:100%; grid-column:auto; }
      .history-section-external .history-external-item-grid { gap:5px; align-items:stretch; }
      .history-section-external .history-external-item-grid > div {
        flex:1 1 calc(50% - 5px); padding:5px 8px; min-width:0; min-height:0;
      }
      .history-section-external .history-external-item-grid > .is-wide,
      .history-section-external .history-external-item-grid > div:has(> small) { flex-basis:100%; }
      .history-section-external .history-external-item-grid > div > span { font-size:11px; line-height:1.3; margin-bottom:2px; }
      .history-section-external .history-external-item-grid > div > strong { font-size:13px; line-height:1.35; overflow-wrap:anywhere; }
      .history-section-external .history-external-item-grid > div > small { font-size:11px; line-height:1.4; overflow-wrap:anywhere; }
      .history-payment-section:has(.history-payment-slip-preview) { display:block; }
      .history-payment-slip-list { margin-top:8px; }
      .history-payment-slip-preview { min-height:220px; padding:7px; }
      .history-payment-slip-preview small { margin-top:5px; font-size:9px; }
      .history-receipt-preview-shell iframe[data-history-receipt-preview-kind="repair"] {
        width: 794px !important;
        max-width: none !important;
        height: 1123px !important;
      }
      .history-warranty-notice { align-items: flex-start; padding: 10px 12px; }
      .history-warranty-notice > strong { display: none; }
      .history-warranty-copy { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
      .history-detail-content,
      .history-detail-content .repair-history-expanded-detail,
      .history-detail-content .repair-history-timeline,
      .history-detail-content .repair-history-timeline-row { min-width: 0; max-width: 100%; overflow-x: hidden; }
      .history-detail-drawer > .history-dialog-header {
        grid-template-columns:minmax(0,1fr) 40px;
        grid-template-rows:auto auto;
        grid-template-areas:
          "heading close"
          "warranty warranty";
        align-items:center;
        gap:7px 8px;
        padding-top:9px;
        padding-bottom:9px;
      }
      .history-detail-drawer > .history-dialog-header > .history-dialog-heading { grid-area:heading; }
      .history-detail-drawer > .history-dialog-header > .history-dialog-warranty-brief { grid-area:warranty; }
      .history-detail-drawer > .history-dialog-header > .history-dialog-close { grid-area:close; align-self:start; }
      .history-dialog-heading { gap:4px; }
      .history-dialog-title { font-size:16px; }
      .history-dialog-heading > .badge { display:none !important; }
      .history-dialog-warranty-brief { height:34px; gap:5px; padding:4px 6px 4px 8px; border-radius:9px; }
      .history-dialog-warranty-text { font-size:11px; text-overflow:ellipsis; }
      .history-dialog-warranty-text::before { content:"ประกัน: "; }
      .history-dialog-warranty-chip { min-height:22px; padding:1px 6px; line-height:20px; }
      .history-dialog-warranty-brief .history-after-service-badge { min-height:24px; padding:2px 6px; font-size:9px; }
      .history-dialog-warranty-brief .history-after-service-icon { display:none; }
      .history-after-service-badge { min-height:32px; padding:5px 9px; font-size:11px; }
      .history-detail-drawer .repair-history-timeline-row { grid-template-columns: 1fr !important; }
      .history-detail-drawer .repair-history-timeline-step::after { display: none !important; content: none !important; }
      .history-toast-stack { top: auto; right: 10px; bottom: max(12px, env(safe-area-inset-bottom)); width: calc(100vw - 20px); }
      .history-confirm-layer { padding: 10px; }
      .history-confirm-dialog { width: 100%; max-height: 92dvh; border-radius: 18px; }
      .history-confirm-actions { flex-direction: column-reverse; }
      .history-confirm-button, .history-confirm-cancel { width: 100%; }
      .repair-edit-modal-dialog { width: 100vw; max-width: none; height: 100dvh; max-height: 100dvh; border-radius: 0; }
      .repair-edit-modal-bar {
        min-height: 0;
        padding: 10px 12px;
        align-items: stretch;
        gap: 8px;
      }
      .repair-edit-modal-bar strong { font-size: 17px; }
      .repair-edit-modal-bar-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .repair-edit-modal-action,
      .repair-edit-modal-close { min-height: 44px; font-size: 13px; }
      .repair-edit-modal-dialog .edit-order-hero { padding: 18px 14px; gap: 16px; }
      .repair-edit-modal-dialog .edit-order-hero h2 { font-size: 25px; }
      .repair-edit-modal-dialog .edit-order-summary { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
      .repair-edit-modal-dialog .edit-summary-chip,
      .repair-edit-modal-dialog .edit-scroll-btn { min-height: 70px; padding: 12px; }
      .repair-edit-modal-dialog .edit-order-form { padding: 14px 10px 24px; }
      .repair-edit-modal-dialog .edit-group-head {
        align-items: flex-start;
        padding: 13px 14px;
        border-radius: 13px;
      }
      .repair-edit-modal-dialog .edit-group-badge { padding: 6px 9px; font-size: 11px; }
      .repair-edit-modal-dialog .edit-section { padding: 13px; border-radius: 15px; }
      .repair-edit-modal-dialog .edit-card-grid-2,
      .repair-edit-modal-dialog .edit-card-grid-3 { grid-template-columns: 1fr; }
      .repair-edit-modal-dialog .edit-card { padding: 12px; border-radius: 12px; }
      .repair-edit-modal-dialog .edit-card .input,
      .repair-edit-modal-dialog .edit-card input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
      .repair-edit-modal-dialog .edit-card select,
      .repair-edit-modal-dialog .edit-card textarea {
        min-height: 48px !important;
        font-size: 16px !important;
      }
      .repair-edit-modal-dialog .edit-order-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 10px;
        border-radius: 14px;
      }
    }
    /* Keep the redesigned repair timeline sequence intact after drawer breakpoints. */
    .history-detail-drawer .repair-history-timeline-step { min-height:108px !important; padding:9px 10px !important; }
    .history-detail-drawer .repair-history-timeline-step > i { grid-row:1 / 3 !important; }
    .history-detail-drawer .repair-history-timeline-step > strong.repair-timeline-datetime { min-height:44px !important; margin-top:3px; padding:3px; }
    .history-detail-drawer .repair-history-timeline-step { overflow:visible !important; }
    .history-detail-drawer .repair-history-timeline-step > b,
    .history-detail-drawer .repair-history-timeline-step > strong,
    .history-detail-drawer .repair-history-timeline-step > em,
    .history-detail-drawer .repair-history-timeline-step > small { min-width:0; max-width:100%; overflow-wrap:anywhere; }
    @media (min-width:1181px) {
      /* Keep the ten-step journey balanced as two tidy rows of five. */
      .history-detail-drawer .repair-history-timeline-row { grid-template-columns:repeat(5,minmax(0,1fr)) !important; gap:18px !important; overflow:visible !important; }
      /* Step 5 ends the first row; do not draw a connector into empty space. */
      .history-detail-drawer .repair-history-timeline-row > .repair-history-timeline-step:nth-child(5)::after { content:none !important; display:none !important; }
    }
    @media (min-width:768px) and (max-width:1180px) {
      .history-detail-drawer .repair-history-timeline-row {
        grid-template-columns:none !important; grid-auto-flow:column !important; grid-auto-columns:minmax(175px,200px) !important;
        gap:18px !important; justify-content:start !important; overflow-x:auto !important; overflow-y:hidden !important; padding:4px 2px 12px !important;
      }
    }
    @media (max-width:767px) {
      .history-detail-drawer .repair-history-timeline-row { grid-template-columns:1fr !important; gap:16px !important; overflow:visible !important; }
      .history-detail-drawer .repair-history-timeline-row > .repair-history-timeline-step:not(:last-child)::after,
      .history-detail-drawer .repair-history-timeline-row > .repair-history-timeline-step.is-linked:not(:last-child)::after {
        content:"" !important; display:block !important; top:auto !important; right:auto !important; bottom:-16px !important; left:24px !important;
        width:14px !important; height:16px !important; background:#cbd5e1 !important;
        clip-path:polygon(36% 0,64% 0,64% 70%,100% 70%,50% 100%,0 70%,36% 70%) !important;
      }
      .history-detail-drawer .repair-history-timeline-row > .repair-history-timeline-step.is-linked:not(:last-child)::after { background:#10b981 !important; }
    }
    /* Responsive repair journey: status icons, connected steps and readable timestamps. */
    .history-detail-drawer .repair-journey {
      background:linear-gradient(145deg,#f8fbff,#fff) !important;
      border:1px solid #dbe7f3 !important; border-radius:18px; gap:14px;
    }
    .history-detail-drawer .repair-journey .repair-history-timeline-progress {
      border:0; background:#12395d; padding:15px 17px; border-radius:14px; gap:10px;
    }
    .history-detail-drawer .repair-journey .repair-history-timeline-progress strong { color:#fff; font-weight:750; font-size:16px; }
    .history-detail-drawer .repair-journey .repair-history-timeline-progress small { color:#c8ddf0; font-weight:500; }
    .history-detail-drawer .repair-journey .repair-history-timeline-progress > b { color:#8de9d6; font-size:26px; }
    .history-detail-drawer .repair-journey .repair-history-timeline-progress > i { height:6px; background:#345773; }
    .history-detail-drawer .repair-journey .repair-history-timeline-row {
      gap:16px !important; align-items:start; padding:8px 3px !important;
    }
    .history-detail-drawer .repair-journey .repair-history-timeline-step {
      grid-template-columns:minmax(0,1fr) !important; grid-template-rows:auto auto auto auto !important;
      gap:7px !important; padding:15px 9px !important; min-height:0 !important;
      border-radius:14px !important; border:1px solid #dce5ee !important;
      background:#f5f7fa !important; box-shadow:none !important; text-align:center;
    }
    .history-detail-drawer .repair-journey .repair-history-timeline-step.is-done { background:#fff !important; border-color:#b9e2d6 !important; }
    .history-detail-drawer .repair-journey .repair-history-timeline-step.is-current {
      background:linear-gradient(160deg,#eff6ff,#fff) !important; border:2px solid #2563eb !important;
      box-shadow:0 5px 16px rgba(37,99,235,.12) !important;
    }
    .history-detail-drawer .repair-journey .repair-history-timeline-step > i {
      grid-column:1 !important; grid-row:1 !important; justify-self:center; align-self:center !important;
      width:46px !important; height:46px !important; border-radius:14px !important;
      background:#e2e8f0 !important; color:#64748b !important; border:0 !important; box-shadow:none !important;
    }
    .history-detail-drawer .repair-journey .repair-history-timeline-step > i > svg { width:26px; height:26px; stroke-width:1.8; }
    .history-detail-drawer .repair-journey .repair-history-timeline-step > i > span { top:-5px; right:-5px; box-shadow:none; font-size:10px; }
    .history-detail-drawer .repair-journey .repair-history-timeline-step.is-done > i { background:#dcfce7 !important; color:#047857 !important; }
    .history-detail-drawer .repair-journey .repair-history-timeline-step.is-current > i { background:#2563eb !important; color:#fff !important; box-shadow:0 0 0 4px #dbeafe !important; }
    .history-detail-drawer .repair-journey .repair-history-timeline-step > i:has(.repair-status-art) {
      background:#fff !important; border:1px solid #e2e8f0 !important;
      box-shadow:0 3px 8px rgba(15,23,42,.08) !important;
    }
    .history-detail-drawer .repair-journey .repair-history-timeline-step.is-current > i:has(.repair-status-art) {
      border-color:#93c5fd !important; box-shadow:0 0 0 4px #dbeafe !important;
    }
    .history-detail-drawer .repair-journey .repair-history-timeline-step > i > svg.repair-status-art {
      width:36px; height:36px; fill:none; stroke:none; stroke-width:0;
    }
    .history-detail-drawer .repair-journey .repair-history-timeline-step > b { grid-column:1 !important; grid-row:2; font-size:13px !important; font-weight:750; }
    .history-detail-drawer .repair-journey .repair-history-timeline-step > em { grid-column:1 !important; grid-row:3; justify-self:center; font-size:10px; font-weight:600; padding:3px 6px; margin:0; }
    .history-detail-drawer .repair-journey .repair-history-timeline-step > strong.repair-timeline-datetime {
      grid-column:1 !important; grid-row:4; grid-template-columns:1fr; gap:3px; padding:6px 0 0;
      margin-top:2px; border:0; border-top:1px solid #e2e8f0; border-radius:0; background:transparent; min-height:0 !important;
    }
    .history-detail-drawer .repair-journey .repair-timeline-datetime > span { padding:0 3px; }
    .history-detail-drawer .repair-journey .repair-timeline-datetime > span::before { content:none; }
    .history-detail-drawer .repair-journey .repair-timeline-datetime-date { font-size:12px; font-weight:600; }
    .history-detail-drawer .repair-journey .repair-timeline-datetime-time { min-width:0 !important; background:transparent; font-size:20px; font-weight:800; }
    .history-detail-drawer .repair-journey .repair-history-timeline-step.is-current .repair-timeline-datetime-time { background:#dbeafe; color:#1d4ed8; }
    .history-detail-drawer .repair-journey .repair-history-timeline-step > small { grid-column:1 / -1 !important; font-weight:400; text-align:left; }
    .repair-timeline-toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
    .repair-timeline-toolbar > span { display:inline-flex; align-items:center; gap:7px; width:fit-content; padding:6px 12px; border-radius:999px; color:#fff; background:linear-gradient(135deg,#06b6d4 0%,#2563eb 52%,#9333ea 100%); box-shadow:0 10px 22px rgba(37,99,235,.20); font-size:13px; font-weight:950; }
    .repair-timeline-toolbar > span svg { display:block; flex:0 0 17px; width:17px; height:17px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
    .repair-timeline-edit-toggle { border:1px solid #93c5fd; border-radius:10px; padding:8px 13px; background:#fff; color:#1d4ed8; font:inherit; font-size:12px; font-weight:850; cursor:pointer; box-shadow:0 3px 9px rgba(37,99,235,.10); }
    .repair-timeline-edit-toggle:hover { background:#eff6ff; }
    .repair-timeline-editor { display:none; grid-column:1 / -1; gap:8px; margin-top:8px; padding-top:9px; border-top:1px dashed #bfdbfe; text-align:left; }
    .repair-timeline-editor label { display:grid; gap:4px; color:#334155; font-size:11px; font-weight:800; }
    .repair-timeline-editor input,
    .repair-timeline-editor textarea { box-sizing:border-box; width:100%; border:1px solid #cbd5e1; border-radius:9px; padding:8px 9px; background:#fff; color:#0f172a; font:inherit; font-size:12px; outline:none; }
    .repair-timeline-editor input:focus,
    .repair-timeline-editor textarea:focus { border-color:#2563eb; box-shadow:0 0 0 3px rgba(37,99,235,.12); }
    .repair-timeline-editor textarea { min-height:72px; resize:vertical; }
    .repair-timeline-note-toggle { justify-self:start; border:0; padding:3px 0; background:transparent; color:#2563eb; font:inherit; font-size:11px; font-weight:850; cursor:pointer; }
    .repair-timeline-note-field[hidden] { display:none; }
    .repair-history-timeline.is-editing .repair-timeline-editor { display:grid; }
    .repair-history-timeline.is-editing .repair-history-timeline-step.is-editable { cursor:pointer; }
    .repair-history-timeline.is-editing .repair-history-timeline-step.is-editable:hover { border-color:#60a5fa !important; box-shadow:0 0 0 3px rgba(59,130,246,.10) !important; }
    .repair-history-timeline.is-editing .repair-history-timeline-step:not(.is-editable) { opacity:.68; }
    .repair-timeline-editor-lock { grid-column:1 / -1; color:#64748b; font-size:11px; }
    .repair-timeline-form-actions { display:none; justify-content:flex-end; gap:8px; padding-top:4px; }
    .repair-history-timeline.is-editing .repair-timeline-form-actions { display:flex; }
    .repair-timeline-form-actions button { border:0; border-radius:10px; padding:9px 15px; font:inherit; font-size:12px; font-weight:850; cursor:pointer; }
    .repair-timeline-save { background:#2563eb; color:#fff; box-shadow:0 5px 14px rgba(37,99,235,.22); }
    .repair-timeline-cancel { background:#e2e8f0; color:#334155; }
    .repair-status-note-summary { display:grid; gap:7px; margin-top:10px; }
    .repair-status-note-summary > div { display:grid; grid-template-columns:minmax(130px,.7fr) minmax(0,1.3fr); gap:10px; padding:9px 10px; border:1px solid #dbeafe; border-radius:10px; background:#f8fbff; }
    .repair-status-note-summary b { color:#1e3a8a; font-size:12px; }
    .repair-status-note-summary span { color:#334155; font-size:12px; white-space:pre-wrap; overflow-wrap:anywhere; }
    .history-detail-drawer .repair-journey .repair-history-timeline-row > .repair-history-timeline-step:not(:last-child)::after {
      top:36px !important; right:-17px !important; width:16px !important; height:10px !important;
    }
    @media (max-width:767px) {
      .history-detail-drawer .repair-journey .repair-history-timeline-row { gap:12px !important; padding:3px 0 !important; }
      .history-detail-drawer .repair-journey .repair-history-timeline-step {
        grid-template-columns:46px minmax(0,1fr) !important; grid-template-rows:auto auto auto !important;
        gap:3px 12px !important; padding:12px !important; text-align:left;
      }
      .history-detail-drawer .repair-journey .repair-history-timeline-step > i { grid-column:1 !important; grid-row:1 / 3 !important; }
      .history-detail-drawer .repair-journey .repair-history-timeline-step > b { grid-column:2 !important; grid-row:1; font-size:15px !important; }
      .history-detail-drawer .repair-journey .repair-history-timeline-step > em { grid-column:2 !important; grid-row:2; justify-self:start; font-size:11px; }
      .history-detail-drawer .repair-journey .repair-history-timeline-step > strong.repair-timeline-datetime {
        grid-column:2 !important; grid-row:3; grid-template-columns:minmax(0,1fr) auto; align-items:center; padding-top:5px;
      }
      .history-detail-drawer .repair-journey .repair-timeline-datetime-date { text-align:left; font-size:12px; }
      .history-detail-drawer .repair-journey .repair-timeline-datetime-time { font-size:20px; }
      .history-detail-drawer .repair-journey .repair-history-timeline-row > .repair-history-timeline-step:not(:last-child)::after,
      .history-detail-drawer .repair-journey .repair-history-timeline-row > .repair-history-timeline-step.is-linked:not(:last-child)::after {
        top:auto !important; bottom:-13px !important; left:33px !important; right:auto !important;
        width:3px !important; height:12px !important; clip-path:none !important; border-radius:0 !important;
      }
      .repair-timeline-toolbar { align-items:stretch; }
      .repair-timeline-edit-toggle { width:100%; }
      .repair-status-note-summary > div { grid-template-columns:1fr; gap:4px; }
    }
    /* Repair list: compact, touch-friendly card layout for tablet and mobile.
       All existing links, forms and server-side actions remain available. */
    @media (max-width: 1024px) {
      .admin-page .repair-active-spacer-row {
        display: none !important;
      }

      .admin-page .repair-overview-panel {
        padding: 16px !important;
        border-radius: 22px !important;
      }

      .admin-page .repair-overview-panel > .actions {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 12px;
        align-items: center !important;
      }

      .admin-page .repair-overview-panel > .actions > .btn {
        min-height: 48px;
        padding: 10px 16px;
      }

      .admin-page .repair-overview-grid {
        grid-template-columns: repeat(5, minmax(138px, 1fr));
        gap: 10px;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scroll-snap-type: inline mandatory;
        scrollbar-width: thin;
        padding: 2px 2px 10px;
      }

      .admin-page .repair-overview-card {
        min-height: 72px;
        scroll-snap-align: start;
      }

      .admin-page .table-wrap:has(.repair-active-table) {
        overflow: visible !important;
      }

      .admin-page .repair-active-table,
      .admin-page .repair-active-table tbody {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
      }

      .admin-page .repair-active-table thead {
        display: none !important;
      }

      .admin-page .repair-active-table tbody {
        display: grid !important;
        gap: 16px;
      }

      .admin-page .repair-active-table .repair-active-row {
        display: grid !important;
        grid-template-columns: minmax(180px, .72fr) minmax(0, 1.5fr);
        gap: 14px;
        width: 100% !important;
        min-width: 0 !important;
        padding: 14px;
        overflow: hidden;
        border: 1px solid rgba(96, 165, 250, .26);
        border-radius: 20px;
        background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
        box-shadow: 0 12px 28px rgba(37, 99, 235, .09);
      }

      .admin-page .repair-active-table .repair-active-row > td {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        border: 0 !important;
        background: transparent !important;
      }

      .admin-page .repair-active-table .repair-active-row > td:nth-child(3) {
        grid-column: 1 / -1;
        padding-top: 14px !important;
        border-top: 1px solid #dbeafe !important;
      }

      .admin-page .repair-active-table .repair-active-summary-row {
        display: block;
        width: 100%;
        min-width: 0;
        margin-top: -16px;
      }

      .admin-page .repair-active-table .repair-active-summary-row > td {
        display: block !important;
        width: 100% !important;
        box-sizing: border-box;
        padding: 0 14px 18px !important;
      }

      .admin-page .repair-ticket-card {
        min-height: 116px;
        align-content: start;
      }

      .admin-page .repair-list-status-tools {
        display: grid;
        grid-template-columns: minmax(0, 1.25fr) minmax(220px, .75fr);
        gap: 12px;
        width: 100%;
        min-width: 0;
        max-width: none;
        overflow: visible;
      }

      .admin-page .repair-list-status-head {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        width: 100%;
        overflow: visible;
      }

      .admin-page .repair-list-status-head > *,
      .admin-page .repair-list-status-tools .quick-status-form,
      .admin-page .repair-list-status-tools .quick-status-form .input,
      .admin-page .repair-list-status-tools .quick-status-form .auto-submit-status,
      .admin-page .repair-list-status-tools .repair-job-summary-toggle {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
      }

      .admin-page .repair-list-status-tools .badge,
      .admin-page .repair-confirm-queue-btn,
      .admin-page .repair-confirm-queue-done,
      .admin-page .repair-list-edit-btn,
      .admin-page .repair-list-status-tools .quick-status-form .input,
      .admin-page .repair-list-status-tools .quick-status-form .auto-submit-status,
      .admin-page .repair-job-summary-toggle {
        min-height: 48px !important;
        padding: 10px 12px !important;
        border-radius: 14px !important;
        font-size: 15px !important;
        line-height: 1.25 !important;
        white-space: normal !important;
        overflow-wrap: anywhere;
      }

      .admin-page .repair-list-status-tools .quick-status-form {
        align-content: start;
        gap: 8px;
      }

      .admin-page .repair-list-status-tools .auto-submit-status {
        display: none !important;
      }

      .admin-page .repair-alert-visual,
      .admin-page .repair-job-summary-toggle,
      .admin-page .repair-media-side {
        grid-column: 1 / -1;
      }

      .admin-page .repair-alert-visual {
        min-height: 72px;
      }
    }

    @media (max-width: 767px) {
      .admin-page {
        overflow-x: hidden;
      }

      .admin-page .repair-overview-panel {
        padding: 12px !important;
        border-radius: 18px !important;
      }

      .admin-page .repair-overview-panel > .actions {
        grid-template-columns: 1fr;
        align-items: stretch !important;
      }

      .admin-page .repair-overview-panel > .actions h2 {
        font-size: 24px;
        line-height: 1.25;
      }

      .admin-page .repair-overview-panel > .actions > .btn {
        width: 100%;
        justify-content: center;
        text-align: center;
      }

      .admin-page .repair-overview-grid {
        margin-inline: -2px;
      }

      .admin-page .repair-overview-card {
        min-width: 142px;
      }

      .admin-page .repair-active-table .repair-active-row {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 12px;
        padding: 12px;
        border-radius: 18px;
      }

      .admin-page .repair-active-table .repair-active-row > td:nth-child(3) {
        grid-column: auto;
        padding-top: 12px !important;
      }

      .admin-page .repair-ticket-card {
        min-height: 0;
        padding: 14px;
      }

      .admin-page .repair-ticket-card strong,
      .admin-page .repair-active-detail > strong {
        font-size: 19px;
      }

      .admin-page .repair-info-grid {
        grid-template-columns: 1fr !important;
        gap: 8px;
      }

      .admin-page .repair-info-chip {
        padding: 11px 12px;
      }

      .admin-page .repair-list-status-tools,
      .admin-page .repair-list-status-head {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
      }

      .admin-page .repair-list-status-tools .quick-status-form,
      .admin-page .repair-alert-visual,
      .admin-page .repair-job-summary-toggle,
      .admin-page .repair-media-side {
        grid-column: 1 / -1;
      }

      .admin-page .repair-list-status-tools .badge,
      .admin-page .repair-confirm-queue-btn,
      .admin-page .repair-confirm-queue-done,
      .admin-page .repair-list-edit-btn {
        min-height: 48px !important;
        font-size: 14px !important;
        text-align: center;
      }

      .admin-page .repair-alert-visual {
        grid-template-columns: 46px minmax(0, 1fr);
        padding: 12px;
      }

      .admin-page .repair-alert-visual div:not(.repair-alert-icon),
      .admin-page .repair-alert-visual span,
      .admin-page .repair-alert-visual strong {
        text-align: left !important;
      }

      .admin-page .repair-job-summary-panel {
        margin-top: 10px;
      }

      .admin-page .repair-job-summary-body {
        grid-template-columns: 1fr !important;
      }
    }

    @media (max-width: 380px) {
      .admin-page .repair-list-status-tools,
      .admin-page .repair-list-status-head {
        grid-template-columns: 1fr;
      }

      .admin-page .repair-list-status-tools > *,
      .admin-page .repair-list-status-head > * {
        grid-column: 1 !important;
      }
    }

    /* Keep the four primary repair actions in one compact row on phones/tablets. */
    @media (max-width: 760px) {
      .admin-page .repair-active-table .repair-list-status-head {
        display: grid !important;
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        align-items: stretch !important;
        gap: 6px !important;
        overflow: visible !important;
      }

      .admin-page .repair-active-table .repair-list-status-head > * {
        grid-column: auto !important;
        min-width: 0 !important;
        width: 100% !important;
      }

      .admin-page .repair-active-table .repair-list-status-head .repair-confirm-queue-form {
        display: flex !important;
      }

      .admin-page .repair-active-table .repair-list-status-head .badge,
      .admin-page .repair-active-table .repair-list-status-head .repair-confirm-queue-btn,
      .admin-page .repair-active-table .repair-list-status-head .repair-confirm-queue-done,
      .admin-page .repair-active-table .repair-list-status-head .repair-list-edit-btn {
        box-sizing: border-box !important;
        min-height: 56px !important;
        height: 100% !important;
        padding: 7px 4px !important;
        font-size: 12px !important;
        line-height: 1.25 !important;
        text-align: center !important;
        white-space: normal !important;
        overflow-wrap: anywhere;
      }

      .admin-page .repair-active-table .repair-list-status-head .repair-list-track-copy-btn {
        grid-column: 2 / 4 !important;
        justify-self: center !important;
        width: 100% !important;
      }
    }

    .repair-edit-mobile-actions {
      display: none;
    }

    @media (max-width: 760px) {
      .repair-edit-modal-dialog {
        padding-bottom: calc(78px + env(safe-area-inset-bottom));
      }

      .repair-edit-mobile-actions {
        position: fixed;
        right: 8px;
        bottom: max(8px, env(safe-area-inset-bottom));
        left: 8px;
        z-index: 100;
        /* Header already exposes the same save/close controls.  Keeping a
           second fixed dock duplicates actions and can cover form fields. */
        display: none !important;
        grid-template-columns: minmax(0, .8fr) minmax(0, 1.35fr) minmax(0, .8fr);
        gap: 8px;
        padding: 8px;
        border: 1px solid rgba(147, 197, 253, .72);
        border-radius: 18px;
        background: rgba(255, 255, 255, .96);
        box-shadow: 0 16px 42px rgba(15, 23, 42, .24);
        backdrop-filter: blur(14px);
        pointer-events: auto;
        touch-action: manipulation;
      }

      .repair-edit-mobile-actions > * {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        min-width: 0;
        min-height: 52px;
        padding: 9px 8px;
        border: 1px solid #bfdbfe;
        border-radius: 13px;
        font: inherit;
        font-size: 14px;
        font-weight: 900;
        line-height: 1.2;
        text-align: center;
        text-decoration: none;
        white-space: normal;
        cursor: pointer;
        touch-action: manipulation;
      }

      .repair-edit-mobile-status {
        color: #1d4ed8;
        background: #eff6ff;
      }

      .repair-edit-mobile-save-close {
        color: #ffffff;
        background: #15803d;
        border-color: #86efac;
      }

      .repair-edit-mobile-close {
        color: #ffffff;
        background: #dc2626;
        border-color: #fca5a5;
      }

      #repair-status-select {
        scroll-margin-top: 110px;
        scroll-margin-bottom: 100px;
      }

      /* Compact repair status summary on phones: two columns reduce vertical
         space while preserving every status filter and a comfortable tap area. */
      .admin-page .repair-overview-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
        margin: 12px 0 4px !important;
        padding: 0 !important;
        overflow: visible !important;
        scroll-snap-type: none !important;
      }

      .admin-page .repair-overview-card {
        min-width: 0 !important;
        min-height: 54px !important;
        gap: 8px !important;
        padding: 9px 12px !important;
        border-radius: 13px !important;
        box-shadow: 0 7px 16px rgba(15, 23, 42, 0.14),
          inset 0 1px 0 rgba(255, 255, 255, 0.18) !important;
        scroll-snap-align: none !important;
      }

      .admin-page .repair-overview-card:last-child {
        grid-column: 1 / -1;
      }

      .admin-page .repair-overview-card span {
        min-width: 0;
        font-size: 13px;
        line-height: 1.25;
      }

      .admin-page .repair-overview-card strong {
        flex: 0 0 auto;
        font-size: 22px;
      }

      .admin-page .repair-overview-card:hover {
        transform: none;
      }

      .admin-page .repair-overview-card:active {
        transform: scale(0.985);
      }

      .admin-page .repair-overview-card.is-active {
        outline-width: 2px;
        outline-offset: 1px;
      }
    }

    @media (max-width: 360px) {
      .admin-page .repair-overview-card {
        min-height: 50px !important;
        padding: 8px 10px !important;
      }

      .admin-page .repair-overview-card span {
        font-size: 12px;
      }

      .admin-page .repair-overview-card strong {
        font-size: 20px;
      }
    }

    /* Mobile admin hero: reduce unused vertical space and keep the heading,
       clock and first menu group close to the top of the panel. */
    @media (max-width: 760px) {
      body.admin-page > .container {
        margin-top: 3px !important;
      }

      body.admin-page .admin-main-hero.panel {
        margin-top: 3px !important;
        padding: 8px 10px 10px !important;
      }

      body.admin-page .admin-main-hero > .actions:first-child {
        align-items: flex-start !important;
        min-height: 0 !important;
        margin: 0 !important;
      }

      body.admin-page .admin-main-hero > .actions:first-child > div {
        min-width: 0;
      }

      body.admin-page .admin-main-hero h1 {
        font-size: 19px !important;
        line-height: 1.15 !important;
        margin: 0 !important;
      }

      body.admin-page .admin-main-hero > .actions:first-child .muted {
        font-size: 11px !important;
        line-height: 1.3 !important;
        margin: 3px 0 0 !important;
      }

      body.admin-page .admin-main-hero > .actions:first-child > .btn {
        display: none !important;
      }

      body.admin-page .admin-main-hero .admin-subnav-clock {
        height: 32px !important;
        margin: 3px 0 1px !important;
        padding: 0 2px !important;
      }

      body.admin-page .admin-main-hero .admin-subnav-clock strong,
      body.admin-page .admin-main-hero .admin-subnav-clock span {
        height: 32px !important;
      }

      body.admin-page .admin-main-hero .admin-subnav-clock strong {
        font-size: 19px !important;
        font-variant-numeric: tabular-nums;
      }

      body.admin-page .admin-main-hero .admin-subnav-clock span {
        font-size: 13px !important;
        font-weight: 800 !important;
      }

      body.admin-page .admin-main-hero .admin-subnav {
        margin-top: 1px !important;
      }

      body.admin-page .admin-main-hero .admin-subnav-group {
        margin-top: 2px !important;
        min-height: 19px !important;
      }

      body.admin-page .admin-main-hero .admin-subnav a {
        min-height: 52px !important;
        padding: 4px 8px !important;
      }

      body.admin-page .admin-main-hero .admin-subnav .admin-menu-icon {
        height: 30px !important;
        width: 30px !important;
      }

      /* Facebook-style compact search action: the input and round search
         control stay on one line and provide a clear pressed/loading state. */
      body.admin-page.repair-history-view .history-toolbar-search {
        align-items: center !important;
        display: grid !important;
        gap: 8px !important;
        grid-template-columns: minmax(0, 1fr) 48px !important;
        width: 100% !important;
      }

      body.admin-page.repair-history-view .history-toolbar-search .history-search-input {
        background: #f0f2f5 !important;
        border: 1px solid transparent !important;
        border-radius: 999px !important;
        font-size: 16px !important;
        grid-column: 1 !important;
        height: 48px !important;
        min-height: 48px !important;
        padding: 9px 16px !important;
        transition: background .18s ease, border-color .18s ease, box-shadow .18s ease !important;
      }

      body.admin-page.repair-history-view .history-toolbar-search .history-search-input:focus {
        background: #ffffff !important;
        border-color: #1877f2 !important;
        box-shadow: 0 0 0 3px rgba(24, 119, 242, .16) !important;
        outline: 0 !important;
      }

      body.admin-page.repair-history-view .history-toolbar-search .history-search-submit {
        align-items: center !important;
        background: #1877f2 !important;
        border: 0 !important;
        border-radius: 50% !important;
        box-shadow: 0 5px 14px rgba(24, 119, 242, .28) !important;
        display: inline-flex !important;
        font-size: 0 !important;
        grid-column: 2 !important;
        height: 48px !important;
        justify-content: center !important;
        min-height: 48px !important;
        min-width: 48px !important;
        padding: 0 !important;
        position: relative !important;
        transition: transform .16s ease, background .16s ease, box-shadow .16s ease !important;
        width: 48px !important;
      }

      body.admin-page.repair-history-view .history-toolbar-search .history-search-submit::before {
        border: 3px solid #ffffff;
        border-radius: 50%;
        box-sizing: border-box;
        content: "";
        height: 17px;
        left: 14px;
        position: absolute;
        top: 12px;
        width: 17px;
      }

      body.admin-page.repair-history-view .history-toolbar-search .history-search-submit::after {
        background: #ffffff;
        border-radius: 999px;
        content: "";
        height: 3px;
        left: 28px;
        position: absolute;
        top: 28px;
        transform: rotate(45deg);
        transform-origin: left center;
        width: 10px;
      }

      body.admin-page.repair-history-view .history-toolbar-search .history-search-submit:active {
        background: #166fe5 !important;
        box-shadow: 0 2px 7px rgba(24, 119, 242, .25) !important;
        transform: scale(.92) !important;
      }

      body.admin-page.repair-history-view .repair-history-toolbar[aria-busy="true"] .history-search-submit::before {
        animation: history-search-spin .7s linear infinite;
        border-color: rgba(255, 255, 255, .45);
        border-top-color: #ffffff;
        height: 21px;
        left: 13px;
        top: 13px;
        width: 21px;
      }

      body.admin-page.repair-history-view .repair-history-toolbar[aria-busy="true"] .history-search-submit::after {
        display: none;
      }

      body.admin-page.repair-history-view .history-toolbar-search .history-search-help {
        display: none !important;
      }

      body.admin-page.repair-history-view .repair-history-head .muted {
        display: none !important;
      }

      /* Tighter repair cards on phones only. */
      body.admin-page.repair-history-view .admin-repairs-table.history-list-table .repair-history-list-row {
        gap: 3px 8px !important;
        margin-bottom: 8px !important;
        padding: 7px 10px 52px !important;
      }

      body.admin-page.repair-history-view .admin-repairs-table.history-list-table .repair-history-list-row > td {
        margin: 0 !important;
        min-height: 0 !important;
        padding-bottom: 2px !important;
        padding-top: 2px !important;
      }

      body.admin-page.repair-history-view .history-col-order {
        min-height: 36px !important;
        padding-right: 92px !important;
      }

      body.admin-page.repair-history-view .history-col-status {
        padding-bottom: 4px !important;
        padding-top: 3px !important;
      }

      body.admin-page.repair-history-view .history-inline-status-form,
      body.admin-page.repair-history-view .history-inline-status-select {
        height: 36px !important;
        min-height: 36px !important;
      }

      body.admin-page.repair-history-view .history-col-customer {
        padding-bottom: 2px !important;
        padding-top: 2px !important;
      }

      body.admin-page.repair-history-view .history-customer-open {
        font-size: 18px !important;
        line-height: 1.2 !important;
        margin: 0 0 2px !important;
        min-height: 40px !important;
        padding: 5px 9px !important;
      }

      body.admin-page.repair-history-view .history-col-customer > span,
      body.admin-page.repair-history-view .history-col-device,
      body.admin-page.repair-history-view .history-col-job {
        font-size: 12px !important;
        line-height: 1.3 !important;
      }

      body.admin-page.repair-history-view .history-col-device .history-clamp,
      body.admin-page.repair-history-view .history-col-job .history-clamp {
        -webkit-line-clamp: 1 !important;
        line-clamp: 1 !important;
      }

      body.admin-page.repair-history-view .history-col-received,
      body.admin-page.repair-history-view .history-col-updated {
        font-size: 11px !important;
        line-height: 1.25 !important;
        padding-top: 3px !important;
      }

      body.admin-page.repair-history-view .history-col-actions {
        margin-top: 0 !important;
      }

      body.admin-page.repair-history-view .history-open-button {
        bottom: 6px !important;
        height: 40px !important;
        min-height: 40px !important;
      }

      body.admin-page.repair-history-view .history-menu-trigger {
        height: 40px !important;
        min-height: 40px !important;
        top: 8px !important;
      }

      /* Put status and management beside the order number. Both controls use
         the same compact touch target without changing their existing logic. */
      body.admin-page.repair-history-view .history-col-order {
        align-items: center !important;
        display: flex !important;
        height: 38px !important;
        min-height: 40px !important;
        padding-right: calc(clamp(96px, 30vw, 124px) + 100px) !important;
      }

      body.admin-page.repair-history-view .history-col-status {
        height: 0 !important;
        margin: 0 !important;
        min-height: 0 !important;
        padding: 0 !important;
        position: static !important;
      }

      body.admin-page.repair-history-view .history-inline-status-form {
        height: 38px !important;
        min-height: 38px !important;
        position: absolute !important;
        right: 100px !important;
        top: 0 !important;
        width: clamp(96px, 30vw, 124px) !important;
        z-index: 11 !important;
      }

      body.admin-page.repair-history-view .history-inline-status-select {
        font-size: 14px !important;
        height: 38px !important;
        line-height: 1.1 !important;
        min-height: 38px !important;
        padding: 4px 22px 4px 7px !important;
        text-align: center !important;
        text-align-last: center !important;
        width: clamp(96px, 30vw, 124px) !important;
      }

      body.admin-page.repair-history-view .history-inline-status-select option {
        font-size: 16px !important;
        line-height: 1.5 !important;
        min-height: 42px !important;
        padding: 10px 12px !important;
      }

      body.admin-page.repair-history-view .history-inline-status-select.is-mobile-expanded {
        background: #ffffff !important;
        border: 2px solid #1877f2 !important;
        border-radius: 14px !important;
        box-shadow: 0 18px 42px rgba(15, 47, 79, .28) !important;
        font-size: 16px !important;
        height: auto !important;
        max-height: min(70vh, 430px) !important;
        padding: 6px !important;
        text-align: left !important;
        text-align-last: left !important;
        z-index: 13000 !important;
      }

      body.admin-page.repair-history-view .repair-history-list-row.is-status-expanded {
        isolation: isolate !important;
        z-index: 14000 !important;
      }

      body.admin-page.repair-history-view .repair-history-list-row.is-status-expanded .history-inline-status-form {
        position: static !important;
      }

      body.admin-page.repair-history-view .repair-history-list-row.is-status-expanded .history-inline-status-select.is-mobile-expanded {
        left: 8px !important;
        max-height: min(70vh, 430px) !important;
        position: absolute !important;
        right: 8px !important;
        top: 48px !important;
        width: calc(100% - 16px) !important;
      }

      body.admin-page.repair-history-view .history-status-save-state {
        display: none !important;
      }

      body.admin-page.repair-history-view .history-menu-trigger {
        height: 38px !important;
        max-width: 84px !important;
        min-height: 38px !important;
        min-width: 84px !important;
        padding: 0 8px !important;
        right: 8px !important;
        top: 8px !important;
        transform: none !important;
        width: 84px !important;
      }

      body.admin-page.repair-history-view .history-menu-trigger::before {
        font-size: 12px !important;
      }

      html body.admin-page.repair-history-view .admin-repairs-table.history-list-table .repair-history-list-row .history-menu-trigger {
        height: 38px !important;
        max-height: 38px !important;
        max-width: 84px !important;
        min-height: 38px !important;
        min-width: 84px !important;
        right: 8px !important;
        top: 6px !important;
        transform: none !important;
        width: 84px !important;
      }

      /* Final phone header alignment: one visual baseline for order, status
         and management, with a centered solid divider underneath. */
      body.admin-page.repair-history-view .admin-repairs-table.history-list-table .repair-history-list-row .history-col-order {
        align-items: center !important;
        border-bottom: 0 !important;
        display: flex !important;
        height: 40px !important;
        line-height: 1 !important;
        min-height: 40px !important;
        padding-bottom: 0 !important;
        padding-top: 0 !important;
        position: relative !important;
      }

      body.admin-page.repair-history-view .admin-repairs-table.history-list-table .repair-history-list-row .history-col-order::after {
        background: linear-gradient(90deg, transparent, #bfd4e8 10%, #bfd4e8 90%, transparent);
        bottom: -5px;
        content: "" !important;
        display: block !important;
        height: 1px;
        left: 0;
        position: absolute;
        width: 100%;
      }

      body.admin-page.repair-history-view .history-inline-status-form,
      html body.admin-page.repair-history-view .admin-repairs-table.history-list-table .repair-history-list-row .history-menu-trigger {
        top: 7px !important;
      }

      body.admin-page.repair-history-view .history-status-display {
        font-size: 13px !important;
      }

      html body.admin-page.repair-history-view .admin-repairs-table.history-list-table .repair-history-list-row .history-menu-trigger {
        font-size: 0 !important;
      }

      html body.admin-page.repair-history-view .admin-repairs-table.history-list-table .repair-history-list-row .history-menu-trigger::before {
        font-size: 12px !important;
      }

      /* Phone-only refinement: remove the separator below the compact header
         and make the primary open action slightly smaller. */
      html body.admin-page.repair-history-view .admin-repairs-table.history-list-table .repair-history-list-row .history-col-order {
        border-bottom: 0 !important;
        margin-bottom: 0 !important;
      }

      html body.admin-page.repair-history-view .admin-repairs-table.history-list-table .repair-history-list-row .history-col-order::after {
        content: none !important;
        display: none !important;
      }

      html body.admin-page.repair-history-view .admin-repairs-table.history-list-table .repair-history-list-row .history-col-customer {
        border-top: 0 !important;
        margin-top: 0 !important;
        padding-top: 4px !important;
      }

      html body.admin-page.repair-history-view .admin-repairs-table.history-list-table .repair-history-list-row .history-open-button {
        bottom: 8px !important;
        border-radius: 10px !important;
        font-size: 14px !important;
        height: 40px !important;
        left: 28px !important;
        min-height: 40px !important;
        padding: 7px 12px !important;
        right: 28px !important;
        width: auto !important;
      }

      /* Keep the phone result controls on one compact row. The range repeats
         the total already shown beside it, so omit that duplicate on phones. */
      html body.admin-page.repair-history-view .repair-history-toolbar {
        align-items: center !important;
        gap: 6px 8px !important;
        grid-template-columns: 112px minmax(0, 1fr) !important;
        padding: 8px !important;
      }

      html body.admin-page.repair-history-view .history-page-size-field {
        align-self: center !important;
        display: block !important;
        grid-column: 1 !important;
        grid-row: 2 !important;
        height: 40px !important;
        margin: 0 !important;
        width: 112px !important;
      }

      html body.admin-page.repair-history-view .history-page-size-field > span {
        display: none !important;
      }

      html body.admin-page.repair-history-view .history-page-size-field > .input {
        display: block !important;
        height: 40px !important;
        margin: 0 !important;
        min-height: 40px !important;
        padding-bottom: 6px !important;
        padding-top: 6px !important;
        vertical-align: top !important;
        width: 112px !important;
      }

      html body.admin-page.repair-history-view .repair-history-result-meta {
        align-items: center !important;
        align-self: center !important;
        display: flex !important;
        flex-direction: row !important;
        grid-column: 2 !important;
        grid-row: 2 !important;
        height: 40px !important;
        margin: 0 !important;
        min-height: 40px !important;
        overflow: hidden !important;
        white-space: nowrap !important;
      }

      html body.admin-page.repair-history-view .repair-history-result-meta > span {
        display: none !important;
      }
    }

    /* Keep history list controls on one centered row at every viewport. */
    .repair-history-toolbar .history-list-controls {
      align-items: center;
      display: flex;
      flex: 0 0 auto;
      flex-wrap: nowrap;
      gap: 10px;
      min-width: 0;
    }
    .repair-history-toolbar .history-list-controls .history-page-size-field {
      align-items: center;
      display: flex;
      flex: 0 0 132px;
      flex-direction: row;
      gap: 7px;
      height: 40px;
      min-height: 40px;
      min-width: 0;
      width: 132px;
    }
    .repair-history-toolbar .history-list-controls .history-page-size-field > span {
      display: none !important;
    }
    .repair-history-toolbar .history-list-controls .history-page-size-field > .input {
      border: 1px solid rgba(96, 165, 250, .34) !important;
      border-radius: 14px !important;
      font-size: 14px !important;
      height: 40px !important;
      line-height: 1.25 !important;
      margin: 0 !important;
      min-height: 40px !important;
      padding-bottom: 8px !important;
      padding-top: 8px !important;
      width: 132px !important;
    }
    .repair-history-toolbar .history-list-controls .history-cancelled-link {
      align-self: center;
      box-sizing: border-box;
      flex: 0 0 132px;
      border: 1px solid rgba(96, 165, 250, .34);
      border-radius: 14px;
      background: #fff;
      font-size: 14px;
      height: 40px;
      line-height: 1.25;
      min-height: 40px;
      padding: 6px 10px;
      width: 132px;
    }

    @media (max-width: 767px) {
      html body.admin-page.repair-history-view .repair-history-toolbar {
        grid-template-columns: auto minmax(0, 1fr) !important;
      }
      html body.admin-page.repair-history-view .repair-history-toolbar .history-list-controls {
        grid-column: 1 !important;
        grid-row: 2 !important;
        gap: 5px !important;
        width: auto !important;
      }
      html body.admin-page.repair-history-view .repair-history-toolbar .history-list-controls .history-page-size-field {
        display: flex !important;
        flex: 0 0 102px !important;
        height: 36px !important;
        min-height: 36px !important;
        width: 102px !important;
      }
      html body.admin-page.repair-history-view .repair-history-toolbar .history-list-controls .history-page-size-field > span {
        display: none !important;
      }
      html body.admin-page.repair-history-view .repair-history-toolbar .history-list-controls .history-page-size-field > .input {
        box-sizing: border-box !important;
        border-radius: 11px !important;
        font-size: 12px !important;
        height: 36px !important;
        line-height: 1.2 !important;
        margin: 0 !important;
        min-height: 36px !important;
        padding: 4px 25px 4px 9px !important;
        width: 102px !important;
      }
      html body.admin-page.repair-history-view .repair-history-toolbar .history-list-controls .history-cancelled-link {
        box-sizing: border-box !important;
        flex: 0 0 102px !important;
        height: 36px !important;
        min-height: 36px !important;
        padding: 5px 6px !important;
        border-radius: 11px !important;
        font-size: 12px !important;
        line-height: 1.2 !important;
        width: 102px !important;
      }
      html body.admin-page.repair-history-view .repair-history-toolbar > .repair-history-result-meta {
        grid-column: 2 !important;
        grid-row: 2 !important;
      }
    }

    /* Unified status picker for desktop, tablet and phone. The native select
       remains in the form as the single source of truth. */
    body.admin-page.repair-history-view .history-inline-status-select.has-custom-picker {
      height: 1px !important;
      left: -9999px !important;
      min-height: 1px !important;
      opacity: 0 !important;
      pointer-events: none !important;
      position: absolute !important;
      width: 1px !important;
    }

    /* The active-repair list reuses the same visual picker while its original
       POST form remains the source of truth. */
    .repair-list-status-select.has-custom-picker {
      height: 1px !important;
      left: -9999px !important;
      min-height: 1px !important;
      opacity: 0 !important;
      pointer-events: none !important;
      position: absolute !important;
      width: 1px !important;
    }

    .history-status-picker-control {
      min-width: 0;
      position: relative;
      width: 100%;
    }

    .history-status-display {
      align-items: center !important;
      background: var(--status-soft, #eff6ff) !important;
      border: 1px solid var(--status-color, #2563eb) !important;
      border-radius: 999px !important;
      color: var(--status-color, #1d4ed8) !important;
      cursor: pointer;
      display: grid !important;
      font-family: inherit;
      font-size: 12px !important;
      font-weight: 900 !important;
      gap: 5px;
      grid-template-columns: 24px minmax(0, 1fr) 12px;
      height: 38px !important;
      line-height: 1.1 !important;
      min-height: 38px !important;
      padding: 4px 7px 4px 5px !important;
      width: 100% !important;
    }

    .history-status-display:hover,
    .history-status-display:focus-visible,
    .history-status-display[aria-expanded="true"] {
      box-shadow: 0 0 0 3px color-mix(in srgb, var(--status-color, #2563eb) 18%, transparent) !important;
      outline: 0 !important;
    }

    .history-status-display-icon,
    .history-status-option-icon {
      align-items: center;
      background: var(--status-color, #2563eb);
      border-radius: 50%;
      color: #ffffff;
      display: inline-flex;
      flex: 0 0 auto;
      font-size: 13px;
      font-style: normal;
      height: 24px;
      justify-content: center;
      line-height: 1;
      width: 24px;
    }

    .history-status-display-label {
      min-width: 0;
      overflow: hidden;
      text-align: center;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .history-status-display-caret {
      border-left: 4px solid transparent;
      border-right: 4px solid transparent;
      border-top: 5px solid currentColor;
      height: 0;
      justify-self: center;
      transition: transform .18s ease;
      width: 0;
    }

    .history-status-display[aria-expanded="true"] .history-status-display-caret {
      transform: rotate(180deg);
    }

    .history-status-picker-menu {
      background: #ffffff;
      border: 1px solid #bfdbfe;
      border-radius: 16px;
      box-shadow: 0 20px 48px rgba(15, 47, 79, .28);
      display: grid;
      gap: 5px;
      max-height: min(70vh, 470px);
      overflow-y: auto;
      padding: 8px;
      position: fixed;
      width: 270px;
      z-index: 22000;
    }

    .history-status-picker-menu[hidden] { display: none !important; }

    .history-status-option {
      align-items: center !important;
      background: var(--status-soft, #f8fafc) !important;
      border: 1px solid transparent !important;
      border-radius: 11px !important;
      color: var(--status-color, #334155) !important;
      cursor: pointer;
      display: grid !important;
      font-family: inherit;
      font-size: 15px !important;
      font-weight: 850 !important;
      gap: 10px;
      grid-template-columns: 30px minmax(0, 1fr) 22px;
      min-height: 48px !important;
      padding: 7px 10px !important;
      text-align: left !important;
      width: 100% !important;
    }

    .history-status-option:hover,
    .history-status-option:focus-visible,
    .history-status-option.is-current {
      border-color: var(--status-color, #2563eb) !important;
      box-shadow: inset 0 0 0 1px var(--status-color, #2563eb) !important;
      outline: 0 !important;
    }

    .history-status-option-check {
      font-size: 18px;
      font-weight: 900;
      text-align: center;
    }

    .history-status-picker-control[data-status="pending"], .history-status-option[data-status="pending"] { --status-color:#c2410c; --status-soft:#fff7ed; }
    .history-status-picker-control[data-status="confirmed"], .history-status-option[data-status="confirmed"] { --status-color:#1d4ed8; --status-soft:#eff6ff; }
    .history-status-picker-control[data-status="repair_confirmed"], .history-status-option[data-status="repair_confirmed"] { --status-color:#0f766e; --status-soft:#f0fdfa; }
    .history-status-picker-control[data-status="repairing"], .history-status-option[data-status="repairing"] { --status-color:#6d28d9; --status-soft:#f5f3ff; }
    .history-status-picker-control[data-status="repair_quote"], .history-status-option[data-status="repair_quote"] { --status-color:#a16207; --status-soft:#fffbeb; }
    .history-status-picker-control[data-status="repair_in_progress"], .history-status-option[data-status="repair_in_progress"] { --status-color:#0369a1; --status-soft:#f0f9ff; }
    .history-status-picker-control[data-status="completed"], .history-status-option[data-status="completed"] { --status-color:#15803d; --status-soft:#f0fdf4; }
    .history-status-picker-control[data-status="payment_pending"], .history-status-option[data-status="payment_pending"] { --status-color:#b45309; --status-soft:#fffbeb; }
    .history-status-picker-control[data-status="paid"], .history-status-option[data-status="paid"] { --status-color:#047857; --status-soft:#ecfdf5; }
    .history-status-picker-control[data-status="delivered"], .history-status-option[data-status="delivered"] { --status-color:#334155; --status-soft:#f8fafc; }
    .history-status-picker-control[data-status="cancelled"], .history-status-option[data-status="cancelled"] { --status-color:#b91c1c; --status-soft:#fef2f2; }

    @media (max-width: 760px) {
      .history-status-display {
        font-size: 11px !important;
        grid-template-columns: 22px minmax(0, 1fr) 10px;
      }
      .history-status-display-icon { height: 22px; width: 22px; }
      .history-status-picker-menu { width: calc(100vw - 36px); }
    }

    /* Compact active-repair cards on phones only. Keep every data field and
       action, but use the available width instead of stacking five tall chips. */
    @media (max-width: 760px) {
      .admin-page .repair-active-table tbody {
        gap: 9px !important;
      }

      .admin-page .repair-active-table tbody > tr.repair-active-summary-row[hidden] {
        display: none !important;
      }

      .admin-page .repair-active-table .repair-active-row {
        gap: 7px !important;
        padding: 8px !important;
        border-radius: 15px !important;
      }

      .admin-page .repair-active-table .repair-active-row > td:nth-child(3) {
        padding-top: 7px !important;
      }

      .admin-page .repair-ticket-card {
        gap: 4px !important;
        padding: 9px !important;
      }

      .admin-page .repair-active-detail > strong {
        font-size: 17px !important;
        line-height: 1.2 !important;
      }

      .admin-page .repair-active-detail > .muted {
        font-size: 12px !important;
        line-height: 1.25 !important;
      }

      .admin-page .repair-info-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 6px !important;
        margin-top: 7px !important;
      }

      .admin-page .repair-info-chip {
        min-height: 0 !important;
        padding: 7px 8px !important;
        border-radius: 12px !important;
      }

      .admin-page .repair-info-chip.symptom {
        grid-column: 1 / -1 !important;
      }

      .admin-page .repair-info-chip > span {
        font-size: 10px !important;
        line-height: 1.2 !important;
        margin-bottom: 3px !important;
      }

      .admin-page .repair-info-chip > strong {
        font-size: 12px !important;
        line-height: 1.3 !important;
      }

      .admin-page .repair-list-status-tools,
      .admin-page .repair-list-status-head {
        gap: 6px !important;
      }

      .admin-page .repair-active-table .repair-list-status-head .badge,
      .admin-page .repair-active-table .repair-list-status-head .repair-confirm-queue-btn,
      .admin-page .repair-active-table .repair-list-status-head .repair-confirm-queue-done,
      .admin-page .repair-active-table .repair-list-status-head .repair-list-edit-btn {
        min-height: 44px !important;
        padding: 5px 3px !important;
        font-size: 11px !important;
      }

      .admin-page .repair-active-table .repair-list-status-head .repair-list-track-copy-btn {
        min-height: 44px !important;
      }

      .admin-page .repair-list-status-tools .quick-status-form {
        gap: 4px !important;
      }

      .admin-page .repair-alert-visual {
        grid-template-columns: 40px minmax(0, 1fr) !important;
        min-height: 58px !important;
        padding: 8px 10px !important;
      }

      .admin-page .repair-alert-icon {
        height: 38px !important;
        width: 38px !important;
      }

      .admin-page .repair-job-summary-toggle {
        min-height: 42px !important;
        padding: 7px 10px !important;
      }
    }

    /* Active repair rows: one consistent visual language per status. */
    .admin-page .repair-active-row {
      --repair-status: #64748b;
      --repair-status-soft: #f8fafc;
      --repair-status-line: #cbd5e1;
    }
    .admin-page .repair-active-row.pending, .admin-page .repair-active-summary-row.pending { --repair-status:#ea580c; --repair-status-soft:#fff7ed; --repair-status-line:#fdba74; }
    .admin-page .repair-active-row.confirmed, .admin-page .repair-active-summary-row.confirmed { --repair-status:#0f766e; --repair-status-soft:#f0fdfa; --repair-status-line:#5eead4; }
    .admin-page .repair-active-row.repair_confirmed, .admin-page .repair-active-summary-row.repair_confirmed { --repair-status:#7c3aed; --repair-status-soft:#f5f3ff; --repair-status-line:#c4b5fd; }
    .admin-page .repair-active-row.repairing, .admin-page .repair-active-summary-row.repairing { --repair-status:#4f46e5; --repair-status-soft:#eef2ff; --repair-status-line:#a5b4fc; }
    .admin-page .repair-active-row.completed, .admin-page .repair-active-summary-row.completed { --repair-status:#16a34a; --repair-status-soft:#f0fdf4; --repair-status-line:#86efac; }
    .admin-page .repair-active-row.payment_pending, .admin-page .repair-active-summary-row.payment_pending { --repair-status:#d97706; --repair-status-soft:#fffbeb; --repair-status-line:#fcd34d; }

    .admin-page .repair-list-status-tools .repair-current-status {
      align-items: center;
      background: var(--repair-status) !important;
      border: 1px solid var(--repair-status) !important;
      border-radius: 10px;
      color: #fff !important;
      display: flex;
      font-size: 13px;
      font-weight: 950;
      gap: 7px;
      grid-column: 1 / -1;
      justify-content: flex-start;
      min-height: 36px;
      padding: 7px 10px;
      width: 100%;
    }

    .repair-current-status::before {
      background: #fff;
      border-radius: 999px;
      box-shadow: 0 0 0 3px rgba(255,255,255,.25);
      content: '';
      flex: 0 0 8px;
      height: 8px;
    }

    .repair-new-label {
      align-items: center;
      animation: repair-new-alert-pulse 1.45s ease-in-out infinite;
      background: #dc2626;
      border-radius: 999px;
      color: #fff;
      display: inline-flex !important;
      font-size: 10px !important;
      font-weight: 950;
      justify-content: center;
      margin: 0 0 6px !important;
      padding: 4px 8px;
      width: max-content;
    }

    .admin-page .repair-active-row.is-new-repair .repair-ticket-card {
      animation: repair-new-card-pulse 1.45s ease-in-out infinite;
    }

    @keyframes repair-new-card-pulse {
      0%,100% { box-shadow: inset 4px 0 0 var(--repair-status),0 8px 18px rgba(15,23,42,.07); }
      50% { box-shadow: inset 6px 0 0 #dc2626,0 0 0 4px rgba(37,99,235,.18),0 10px 24px rgba(37,99,235,.16); }
    }

    /* One colour language across summary cards, rows, filters and selects. */
    .history-status-confirmed { --history-accent:#0f766e; --history-bg-1:#f0fdfa; --history-bg-2:#ccfbf1; --history-border:rgba(15,118,110,.28); --history-shadow:rgba(15,118,110,.13); }
    .history-status-repair_confirmed { --history-accent:#7c3aed; --history-bg-1:#f5f3ff; --history-bg-2:#ede9fe; --history-border:rgba(124,58,237,.28); --history-shadow:rgba(124,58,237,.13); }
    .history-status-repairing { --history-accent:#4f46e5; --history-bg-1:#eef2ff; --history-bg-2:#e0e7ff; --history-border:rgba(79,70,229,.28); --history-shadow:rgba(79,70,229,.13); }
    .history-inline-status-select.confirmed { --status-accent:#0f766e; border-color:#2dd4bf; background-color:#f0fdfa; color:#0f766e; }
    .history-inline-status-select.repair_confirmed { --status-accent:#7c3aed; border-color:#a78bfa; background-color:#f5f3ff; color:#6d28d9; }
    .history-inline-status-select.repairing { --status-accent:#4f46e5; border-color:#818cf8; background-color:#eef2ff; color:#4338ca; }
    .history-list-table .repair-history-list-row.status-confirmed { --row-status-accent:#0f766e; }
    .history-list-table .repair-history-list-row.status-repair_confirmed { --row-status-accent:#7c3aed; }
    .history-list-table .repair-history-list-row.status-repairing { --row-status-accent:#4f46e5; }
    .dashboard-status-confirmed { --status-color:#0f766e; --status-color-2:#14b8a6; }
    .dashboard-status-repair_confirmed { --status-color:#7c3aed; --status-color-2:#8b5cf6; }
    .dashboard-status-repairing { --status-color:#4f46e5; --status-color-2:#6366f1; }

    @media (prefers-reduced-motion: reduce) {
      .repair-overview-card.status-pending.has-pending-alert,
      .admin-page .repair-active-row.pending .repair-current-status { animation:none !important; }
    }

    .admin-page .repair-active-row > td {
      border-top: 4px solid var(--repair-status) !important;
      border-bottom: 5px solid var(--repair-status) !important;
      background: var(--repair-status-soft) !important;
    }
    .admin-page .repair-active-row > td:first-child {
      border-left: 6px solid var(--repair-status) !important;
      border-radius: 18px 0 0 18px;
    }
    .admin-page .repair-active-row > td:last-child {
      border-right: 6px solid var(--repair-status) !important;
      border-radius: 0 18px 18px 0;
    }
    .admin-page .repair-active-row {
      clip-path: inset(0 round 18px);
    }
    .admin-page .repair-active-row.has-open-summary {
      clip-path: inset(0 round 18px 18px 0 0);
    }
    .admin-page .repair-active-row.has-open-summary > td:first-child {
      border-bottom-left-radius: 0;
    }
    .admin-page .repair-active-row.has-open-summary > td:last-child {
      border-bottom-right-radius: 0;
    }
    .admin-page .repair-active-row .repair-ticket-card {
      background: linear-gradient(135deg, var(--repair-status-soft) 0%, #fff 100%);
      border-color: var(--repair-status-line);
      box-shadow: inset 4px 0 0 var(--repair-status), 0 8px 18px rgba(15, 23, 42, .07);
    }
    .repair-followup-alert[hidden],
    .repair-line-delivery[hidden] { display: none !important; }
    .repair-followup-alert:not([hidden]) {
      display: flex;
      align-items: center;
      gap: 7px;
      margin: 8px 0 0;
      padding: 8px 7px;
      border: 2px solid #60a5fa;
      border-radius: 11px;
      background: #1e40af;
      box-shadow: 0 3px 9px rgba(30, 64, 175, .16);
      color: #fff;
      line-height: 1.2;
    }
    .repair-followup-alert[data-subscription-state="notifications"] {
      border-color: #4ade80;
      background: #166534;
      box-shadow: 0 3px 9px rgba(22, 101, 52, .16);
    }
    .repair-followup-icon {
      display: grid;
      flex: 0 0 25px;
      height: 25px;
      place-items: center;
      border-radius: 8px;
      background: #fff;
      color: #1e40af;
    }
    .repair-followup-alert[data-subscription-state="notifications"] .repair-followup-icon { color: #166534; }
    .repair-followup-icon svg { width: 16px; height: 16px; }
    .repair-followup-text { display: grid; gap: 3px; min-width: 0; }
    .repair-followup-text > span { color: #fff; font-size: 14px; font-weight: 900; }
    .repair-followup-text > strong { color: #fff; font-size: 12px; font-weight: 800; }
    @media (max-width: 760px) {
      .repair-ticket-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 5px;
        margin-block: 7px;
      }
      .repair-ticket-actions:has(.repair-followup-alert:not([hidden])) {
        grid-template-columns: minmax(0, 1fr) minmax(0, .85fr) minmax(0, 1.3fr);
      }
      .repair-ticket-actions > [role="status"]:not(:has(.repair-followup-alert:not([hidden]))) {
        position: absolute;
      }
      .repair-ticket-actions > [role="status"] { min-width: 0; }
      .repair-ticket-actions .repair-ticket-tracking { display: contents; }
      .repair-ticket-actions .repair-ticket-tracking > :is(a, button) {
        width: auto !important;
        min-width: 0;
        min-height: 44px;
        margin: 0;
        padding: 4px 3px;
        font-size: 11px;
        line-height: 1.2;
        text-align: center;
        white-space: normal;
        overflow-wrap: anywhere;
      }
      .repair-ticket-actions .repair-followup-alert:not([hidden]) {
        box-sizing: border-box;
        height: 100%;
        min-height: 44px;
        margin: 0;
        padding: 4px 3px;
        gap: 3px;
      }
      .repair-ticket-actions .repair-followup-icon { flex-basis: 16px; height: 16px; }
      .repair-ticket-actions .repair-followup-icon svg { width: 12px; height: 12px; }
      .repair-ticket-actions .repair-followup-text > span { font-size: 11px; }
      .repair-ticket-actions .repair-followup-text > strong { font-size: 10px; }
      .repair-ticket-actions .repair-followup-text { overflow-wrap: anywhere; }
    }
    .repair-line-delivery {
      display: grid;
      gap: 4px;
      margin-block: 6px;
      padding: 7px 9px;
      border: 1px solid #cbd5e1;
      border-inline-start: 3px solid #64748b;
      border-radius: 9px;
      background: #f8fafc;
      color: #334155;
      font-size: 12px;
      overflow-wrap: anywhere;
    }
    .repair-line-delivery strong { display: block; font-size: 13px; }
    .repair-line-delivery small:not([hidden]) { display: block; margin-top: 3px; }
    .repair-line-delivery a { justify-self: start; color: #075985; text-decoration: underline; }
    .repair-line-delivery[data-repair-delivery-state="sent"] {
      border-inline-start-color: #15803d;
      background: #f0fdf4;
      color: #166534;
    }
    .repair-line-delivery:is([data-repair-delivery-state="failed"], [data-repair-delivery-state="blocked"]) {
      border-inline-start-color: #b91c1c;
      background: #fef2f2;
      color: #991b1b;
    }
    .repair-line-delivery:is([data-repair-delivery-state="retry"], [data-repair-delivery-state="paused"]) {
      border-inline-start-color: #b45309;
      background: #fffbeb;
      color: #92400e;
    }
    .admin-page .repair-active-row .repair-list-status-tools {
      border-color: var(--repair-status-line);
      grid-template-columns: minmax(0, 1fr) !important;
      min-width: 0;
      overflow: visible;
    }
    .admin-page .repair-active-row .repair-list-status-tools > * {
      grid-column: 1 / -1 !important;
      min-width: 0;
    }
    .admin-page .repair-active-table .repair-active-row .repair-list-status-head {
      grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
      align-items: stretch;
      justify-content: stretch;
      gap: 6px;
      overflow: visible;
    }
    .admin-page .repair-active-table .repair-active-row .repair-list-status-head .repair-current-status {
      grid-column: 1 / -1 !important;
      width: 100% !important;
      height: auto !important;
      min-height: 36px !important;
      box-sizing: border-box;
      white-space: normal !important;
      overflow-wrap: anywhere;
      text-align: center;
    }
    .admin-page .repair-active-table .repair-active-row .repair-list-status-head :is(.repair-confirm-queue-form, .repair-confirm-queue-btn, .repair-confirm-queue-done, .repair-list-edit-btn) {
      box-sizing: border-box;
      min-width: 0;
      width: 100%;
      white-space: normal;
      overflow-wrap: anywhere;
    }
    .admin-page .repair-active-row .repair-list-status-tools .repair-list-track-copy-btn {
      min-height: 40px !important;
    }
    .admin-page .repair-active-row .repair-ticket-actions {
      display: block;
    }
    .admin-page .repair-active-row .repair-ticket-tracking {
      display: grid;
      grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
      gap: 4px;
    }
    .admin-page .repair-active-row .repair-ticket-tracking > :is(a, button) {
      box-sizing: border-box;
      width: 100% !important;
      min-width: 0;
      margin: 0;
      padding-inline: 3px;
      font-size: 11px;
      line-height: 1.2;
      white-space: nowrap;
    }
    .repair-ticket-open {
      min-height: 34px !important;
      margin-top: 4px;
      padding: 6px 10px !important;
      border: 1px solid var(--repair-status-line) !important;
      border-radius: 10px !important;
      color: var(--repair-status) !important;
      background: #fff !important;
      box-shadow: none !important;
      font-size: 12px !important;
      font-weight: 900;
    }
    .repair-ticket-open::after { content: ' ›'; font-size: 17px; line-height: 0; }

    @media (max-width: 1180px) {
      .admin-page .repair-active-table .repair-active-row {
        position: relative;
        border: 1px solid var(--repair-status-line) !important;
        border-left: 7px solid var(--repair-status) !important;
        border-bottom: 5px solid var(--repair-status) !important;
        background: linear-gradient(135deg, #fff 0%, var(--repair-status-soft) 100%) !important;
        box-shadow: 0 12px 26px rgba(15, 23, 42, .10) !important;
      }
      .admin-page .repair-active-table .repair-active-row > td {
        border: 0 !important;
        background: transparent !important;
      }
      .admin-page .repair-active-table .repair-active-row > td:nth-child(3) {
        border-top: 2px solid var(--repair-status-line) !important;
      }
    }

    @media (max-width: 760px) {
      .admin-page .repair-active-table tbody { gap: 14px !important; }
      .admin-page .repair-active-table .repair-active-row {
        border-radius: 16px !important;
        padding: 10px !important;
      }
      .repair-ticket-open { min-height: 40px !important; font-size: 13px !important; }
    }

    /* Mobile expanded repair: keep the main row and job details as one compact
       status-coloured card, while retaining every field and action. */
    @media (max-width: 760px) {
      .admin-page .repair-active-table tbody {
        gap: 9px !important;
      }

      .admin-page .repair-active-table .repair-active-row {
        border-bottom: 0 !important;
        clip-path: inset(0 round 16px) !important;
      }

      .admin-page .repair-active-table .repair-active-row.has-open-summary {
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
        border-bottom: 0 !important;
        border-left: 6px solid var(--repair-status, #2563eb) !important;
        border-right: 6px solid var(--repair-status, #2563eb) !important;
        border-bottom-right-radius: 0 !important;
        border-bottom-left-radius: 0 !important;
        clip-path: inset(0 round 16px 16px 0 0) !important;
      }

      .admin-page .repair-active-table .repair-active-summary-row {
        margin-top: -11px !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        overflow: visible !important;
      }

      .admin-page .repair-active-table .repair-active-summary-row > td {
        padding: 7px 6px 7px 6px !important;
        border-top: 0 !important;
        border-bottom: 1px solid var(--repair-status-line, #cbd5e1) !important;
        border-radius: 0 0 16px 16px !important;
        overflow: hidden !important;
        clip-path: inset(0 round 0 0 16px 16px) !important;
      }

      .admin-page .repair-active-table tbody > tr.repair-active-spacer-row {
        display: none !important;
        height: 0 !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
      }

      .admin-page .repair-active-expanded-grid {
        gap: 6px !important;
      }

      .admin-page .repair-active-summary-row .repair-job-summary-panel {
        margin: 0 !important;
      }

      .admin-page .repair-job-summary-body {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 2px 6px !important;
        padding: 6px 8px !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
      }

      .admin-page .repair-job-summary-body > div {
        padding-bottom: 2px !important;
      }

      .admin-page .repair-job-summary-body span {
        margin-bottom: 2px !important;
        font-size: 10px !important;
        line-height: 1.15 !important;
      }

      .admin-page .repair-job-summary-body strong {
        font-size: 11px !important;
        line-height: 1.25 !important;
      }

      .admin-page .repair-job-summary-body > .repair-print-btn {
        min-height: 32px !important;
        height: 32px !important;
        margin-top: 2px !important;
        padding: 5px 12px !important;
        font-size: 12px !important;
      }

      .admin-page .repair-active-summary-media-slot > .repair-media-side {
        padding: 8px !important;
        border-radius: 11px !important;
        box-shadow: none !important;
      }

      .admin-page .repair-media-side > span,
      .admin-page .repair-media-side > strong {
        font-size: 11px !important;
      }

      .admin-page .repair-media-thumb img,
      .admin-page .repair-video-thumb,
      .admin-page .repair-document-thumb {
        max-height: 150px;
        aspect-ratio: 16 / 8;
      }
    }

    /* Only the circled print action in the active-repair detail: compact and
       centered on tablet/desktop, without changing neighbouring layout. */
    @media (min-width: 761px) {
      .admin-page .repair-active-table .repair-job-summary-body > .repair-print-btn {
        align-items: center !important;
        box-sizing: border-box !important;
        display: inline-flex !important;
        font-size: 16px !important;
        height: 42px !important;
        justify-self: center !important;
        min-height: 42px !important;
        min-width: 210px !important;
        padding: 7px 24px !important;
        width: fit-content !important;
      }
    }

    /* iPad/tablet repair history uses the complete desktop table. Preserve
       desktop column widths and allow horizontal scrolling when needed. */
    @media (min-width: 768px) and (max-width: 1199px) {
      body.admin-page.repair-history-view .repair-history-table-wrap {
        overflow-x: hidden !important;
        overscroll-behavior-inline: contain;
        -webkit-overflow-scrolling: touch;
      }

      body.admin-page.repair-history-view .history-list-table {
        min-width: 0 !important;
        table-layout: fixed !important;
        width: 100% !important;
      }

      body.admin-page.repair-history-view .history-list-table th:nth-child(4),
      body.admin-page.repair-history-view .history-list-table td:nth-child(4),
      body.admin-page.repair-history-view .history-list-table th:nth-child(5),
      body.admin-page.repair-history-view .history-list-table td:nth-child(5),
      body.admin-page.repair-history-view .history-list-table th:nth-child(6),
      body.admin-page.repair-history-view .history-list-table td:nth-child(6),
      body.admin-page.repair-history-view .history-list-table th:nth-child(8),
      body.admin-page.repair-history-view .history-list-table td:nth-child(8) {
        display: table-cell !important;
      }

      body.admin-page.repair-history-view .history-list-table col.history-width-status { width: 11% !important; }
      body.admin-page.repair-history-view .history-list-table col.history-width-order { width: 12% !important; }
      body.admin-page.repair-history-view .history-list-table col.history-width-customer { width: 16% !important; }
      body.admin-page.repair-history-view .history-list-table col.history-width-device { width: 9% !important; }
      body.admin-page.repair-history-view .history-list-table col.history-width-job { width: 10% !important; }
      body.admin-page.repair-history-view .history-list-table col.history-width-received,
      body.admin-page.repair-history-view .history-list-table col.history-width-updated { width: 8% !important; }
      body.admin-page.repair-history-view .history-list-table col.history-width-total { width: 10% !important; }
      body.admin-page.repair-history-view .history-list-table col.history-width-actions { width: 15% !important; }

      body.admin-page.repair-history-view .history-list-table .repair-history-list-row > td {
        font-size: clamp(11px, 1.35vw, 14px) !important;
        height: 68px !important;
        min-height: 68px !important;
        padding-left: 6px !important;
        padding-right: 6px !important;
      }

      body.admin-page.repair-history-view .history-list-table .history-row-actions {
        gap: 4px !important;
      }

      body.admin-page.repair-history-view .history-list-table .history-open-button {
        font-size: 11px !important;
        min-width: 72px !important;
        padding-left: 7px !important;
        padding-right: 7px !important;
        width: 72px !important;
      }

      body.admin-page.repair-history-view .history-list-table .history-menu-trigger {
        height: 34px !important;
        min-width: 34px !important;
        width: 34px !important;
      }

      body.admin-page.repair-history-view .history-tablet-device,
      body.admin-page.repair-history-view .history-tablet-symptom {
        display: none !important;
      }
    }

    @media (min-width: 768px) and (max-width: 1050px) {
      body.admin-page.repair-history-view .history-list-table .history-row-actions {
        align-items: center !important;
        flex-direction: column !important;
        gap: 3px !important;
        justify-content: center !important;
      }
    }

    /* Repair editor UX/UI v3
       Presentation only: every existing field, name, value and save path stays intact. */
    .repair-edit-modal-dialog {
      --edit-ink: #17324d;
      --edit-muted: #64748b;
      --edit-line: #dbe7f2;
      --edit-soft: #f7faff;
      --edit-control: 42px;
    }
    .repair-edit-modal-dialog .edit-order-panel {
      color: var(--edit-ink);
      background: #eef5fc !important;
    }
    .repair-edit-modal-dialog .edit-order-form {
      display: grid;
      gap: 12px;
      padding: 14px;
    }
    .repair-edit-modal-dialog .edit-group {
      display: grid;
      gap: 10px;
      margin: 0;
    }
    .repair-edit-modal-dialog .edit-group-head {
      min-height: 0;
      margin: 0;
      padding: 11px 14px;
      border-radius: 12px;
    }
    .repair-edit-modal-dialog .edit-group-head h3 {
      margin: 0 0 2px;
      font-size: 17px;
      line-height: 1.35;
    }
    .repair-edit-modal-dialog .edit-group-head p {
      margin: 0;
      font-size: 12px;
      line-height: 1.45;
    }
    .repair-edit-modal-dialog .edit-section {
      margin: 0;
      padding: 12px;
      border: 1px solid var(--edit-line);
      border-radius: 14px;
      box-shadow: 0 4px 14px rgba(30, 64, 100, .045);
    }
    .repair-edit-modal-dialog .edit-section-head {
      display: flex;
      align-items: flex-end;
      justify-content: space-between;
      gap: 12px;
      margin: 0 0 9px;
      padding: 0 2px 8px;
      border-bottom: 1px solid #e7eef6;
    }
    .repair-edit-modal-dialog .edit-section-head h3 {
      flex: 0 0 auto;
      margin: 0;
      font-size: 16px;
      line-height: 1.35;
    }
    .repair-edit-modal-dialog .edit-section-head p {
      margin: 0;
      font-size: 11px;
      line-height: 1.4;
      text-align: right;
    }
    .repair-edit-modal-dialog .edit-card-grid,
    .repair-edit-modal-dialog .edit-card-grid-2,
    .repair-edit-modal-dialog .edit-card-grid-3 {
      gap: 8px !important;
      align-items: stretch;
    }
    .repair-edit-modal-dialog .edit-card,
    .repair-edit-modal-dialog .desktop-marked-grid > .edit-card,
    .repair-edit-modal-dialog .desktop-marked-grid > .edit-card:not(.desktop-unmarked-card) {
      display: flex !important;
      flex-direction: column !important;
      align-items: stretch !important;
      justify-content: flex-start !important;
      gap: 5px !important;
      min-width: 0;
      min-height: 0 !important;
      padding: 9px !important;
      border: 1px solid #e3ebf4 !important;
      border-radius: 10px !important;
      background: var(--edit-soft) !important;
      box-shadow: none !important;
    }
    .repair-edit-modal-dialog .edit-card > label:first-child,
    .repair-edit-modal-dialog .desktop-marked-grid > .edit-card:not(.desktop-unmarked-card) > label:first-child {
      display: block !important;
      width: auto !important;
      max-width: 100% !important;
      margin: 0 !important;
      color: #40566e;
      font-size: 11px !important;
      font-weight: 700 !important;
      line-height: 1.3 !important;
      text-align: left !important;
      white-space: normal !important;
    }
    .repair-edit-modal-dialog .edit-card > .input,
    .repair-edit-modal-dialog .edit-card > input:not([type="checkbox"]):not([type="radio"]),
    .repair-edit-modal-dialog .edit-card > select,
    .repair-edit-modal-dialog .edit-card > textarea,
    .repair-edit-modal-dialog .desktop-marked-grid > .edit-card:not(.desktop-unmarked-card) > :is(.input, input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
      width: 100% !important;
      max-width: none !important;
      min-width: 0 !important;
      min-height: var(--edit-control) !important;
      margin: 0 !important;
      padding: 8px 10px !important;
      border-radius: 8px !important;
      box-sizing: border-box !important;
      font-size: 14px !important;
      line-height: 1.45 !important;
      text-align: left !important;
    }
    .repair-edit-modal-dialog .edit-card > textarea,
    .repair-edit-modal-dialog .desktop-marked-grid > .edit-card:not(.desktop-unmarked-card) > textarea {
      min-height: 64px !important;
      resize: vertical;
    }
    .repair-edit-modal-dialog textarea[name="customer_address"] {
      min-height: 92px !important;
    }
    .repair-edit-modal-dialog .edit-card small,
    .repair-edit-modal-dialog .edit-card .muted,
    .repair-edit-modal-dialog .edit-card .field-note {
      margin: 0 !important;
      font-size: 10px !important;
      line-height: 1.35 !important;
      text-align: left !important;
    }
    .repair-edit-modal-dialog .choice-card {
      min-height: 36px;
      padding: 7px 9px;
      border-radius: 8px;
      font-size: 12px;
    }
    .repair-edit-modal-dialog .edit-order-actions {
      gap: 7px;
      padding: 9px;
      border-radius: 12px;
    }

    @media (min-width: 1024px) {
      .repair-edit-modal-dialog .edit-order-form { padding: 14px 18px 22px; }
      .repair-edit-modal-dialog .desktop-customer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
      }
      .repair-edit-modal-dialog .desktop-customer-grid > .edit-card:nth-child(n) {
        grid-column: auto !important;
      }
      .repair-edit-modal-dialog .desktop-device-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
      }
      .repair-edit-modal-dialog .desktop-device-grid > .edit-card:nth-child(5),
      .repair-edit-modal-dialog .desktop-device-grid > .edit-card:nth-child(6) {
        grid-column: span 2 !important;
      }
      .repair-edit-modal-dialog .desktop-device-grid > .edit-card:last-child {
        grid-column: 1 / -1 !important;
      }
      .repair-edit-modal-dialog .desktop-symptom-section {
        grid-template-columns: minmax(0, 1fr) minmax(180px, .28fr) minmax(300px, .72fr) !important;
      }
      .repair-edit-modal-dialog .desktop-symptom-section > .edit-card:first-child {
        grid-column: 1 / -1 !important;
      }
      .repair-edit-modal-dialog .desktop-symptom-section > .edit-card:not(:first-child) {
        grid-column: auto !important;
      }
      .repair-edit-modal-dialog .desktop-symptom-choices {
        grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
        gap: 6px !important;
      }
      .repair-edit-modal-dialog .desktop-images-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
      }
      .repair-edit-modal-dialog .desktop-status-grid {
        grid-template-columns: minmax(210px, .28fr) minmax(0, .72fr) !important;
      }
      .repair-edit-modal-dialog .desktop-status-grid > .edit-card:nth-child(n) {
        grid-column: auto !important;
      }
      .repair-edit-modal-dialog .desktop-warranty-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
      }
      .repair-edit-modal-dialog .desktop-warranty-grid > .edit-card:last-child {
        grid-column: 1 / -1 !important;
      }
      .repair-edit-modal-dialog .desktop-finance-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
      }
      .repair-edit-modal-dialog .desktop-finance-grid > .edit-card:not(.desktop-preserve-full) {
        grid-column: auto !important;
      }
      .repair-edit-modal-dialog .desktop-finance-grid > .desktop-preserve-full,
      .repair-edit-modal-dialog .desktop-finance-grid > .edit-card-wide.desktop-preserve-full {
        grid-column: 1 / -1 !important;
      }
      .repair-edit-modal-dialog .desktop-finance-grid .repair-part-row {
        grid-template-columns: minmax(0, 1fr) minmax(190px, .26fr) !important;
      }
      .repair-edit-modal-dialog .desktop-notes-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
      }
      .repair-edit-modal-dialog .desktop-notes-grid > .edit-card:not(.after-service-card) {
        grid-column: auto !important;
      }
      .repair-edit-modal-dialog .desktop-notes-grid > .after-service-card {
        grid-column: 1 / -1 !important;
      }
    }

    @media (max-width: 1023px) {
      .repair-edit-modal-dialog .edit-order-form { padding: 10px; gap: 10px; }
      .repair-edit-modal-dialog .edit-order-hero { padding: 14px 12px; gap: 10px; }
      .repair-edit-modal-dialog .edit-order-summary { gap: 7px; }
      .repair-edit-modal-dialog .edit-summary-chip,
      .repair-edit-modal-dialog .edit-scroll-btn { min-height: 58px; padding: 9px; }
      .repair-edit-modal-dialog .edit-card-grid-2,
      .repair-edit-modal-dialog .edit-card-grid-3,
      .repair-edit-modal-dialog .desktop-marked-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
      }
      .repair-edit-modal-dialog .edit-card-wide,
      .repair-edit-modal-dialog .desktop-preserve-full,
      .repair-edit-modal-dialog .desktop-unmarked-card,
      .repair-edit-modal-dialog .desktop-device-grid > .edit-card:last-child,
      .repair-edit-modal-dialog .desktop-symptom-section > .edit-card,
      .repair-edit-modal-dialog .desktop-images-grid > .edit-card,
      .repair-edit-modal-dialog .desktop-status-grid > .edit-card,
      .repair-edit-modal-dialog .desktop-warranty-grid > .edit-card:last-child,
      .repair-edit-modal-dialog .desktop-finance-grid > .desktop-preserve-full,
      .repair-edit-modal-dialog .desktop-notes-grid > .after-service-card {
        grid-column: 1 / -1 !important;
      }
      .repair-edit-modal-dialog .desktop-customer-grid > .edit-card:nth-child(2),
      .repair-edit-modal-dialog .desktop-customer-grid > .edit-card:nth-child(5),
      .repair-edit-modal-dialog .desktop-customer-grid > .edit-card:nth-child(6) {
        grid-column: 1 / -1 !important;
      }
      .repair-edit-modal-dialog .desktop-symptom-choices {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 5px !important;
      }
      .repair-edit-modal-dialog .repair-part-row {
        grid-template-columns: minmax(0, 1fr) minmax(120px, .38fr) !important;
      }
    }

    @media (max-width: 767px) {
      .repair-edit-modal-dialog { --edit-control: 44px; }
      .repair-edit-modal-bar { position: sticky; top: 0; z-index: 5; }
      .repair-edit-modal-dialog .edit-order-hero h2 { font-size: 21px; }
      .repair-edit-modal-dialog .edit-group-head { padding: 9px 11px; }
      .repair-edit-modal-dialog .edit-group-head h3 { font-size: 15px; }
      .repair-edit-modal-dialog .edit-group-head p { font-size: 10px; }
      .repair-edit-modal-dialog .edit-section { padding: 9px; border-radius: 12px; }
      .repair-edit-modal-dialog .edit-section-head {
        display: block;
        margin-bottom: 7px;
        padding-bottom: 6px;
      }
      .repair-edit-modal-dialog .edit-section-head h3 { font-size: 15px; }
      .repair-edit-modal-dialog .edit-section-head p {
        margin-top: 2px;
        font-size: 10px;
        text-align: left;
      }
      .repair-edit-modal-dialog .edit-card,
      .repair-edit-modal-dialog .desktop-marked-grid > .edit-card,
      .repair-edit-modal-dialog .desktop-marked-grid > .edit-card:not(.desktop-unmarked-card) {
        padding: 7px !important;
        gap: 4px !important;
        border-radius: 9px !important;
      }
      .repair-edit-modal-dialog .edit-card > .input,
      .repair-edit-modal-dialog .edit-card > input:not([type="checkbox"]):not([type="radio"]),
      .repair-edit-modal-dialog .edit-card > select,
      .repair-edit-modal-dialog .edit-card > textarea {
        font-size: 16px !important;
      }
      .repair-edit-modal-dialog textarea[name="customer_address"] {
        min-height: 108px !important;
      }
      .repair-edit-modal-dialog .desktop-images-grid,
      .repair-edit-modal-dialog .desktop-status-grid {
        grid-template-columns: 1fr !important;
      }
      .repair-edit-modal-dialog .desktop-images-grid > .edit-card,
      .repair-edit-modal-dialog .desktop-status-grid > .edit-card {
        grid-column: auto !important;
      }
      .repair-edit-modal-dialog .edit-order-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        position: sticky;
        bottom: 0;
        z-index: 4;
        background: rgba(255,255,255,.96);
        backdrop-filter: blur(8px);
      }
      .repair-edit-modal-dialog .repair-part-row {
        grid-template-columns: 1fr !important;
      }
    }

    @keyframes history-search-spin {
      to { transform: rotate(360deg); }
    }
  
  /* Final responsive layer is loaded last so the edit form stays predictable. */
  body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .repair-part-row {
    display: grid !important;
    grid-template-columns: minmax(210px,1.4fr) minmax(170px,1fr) 82px 110px 118px minmax(155px,auto) auto !important;
    gap: 8px !important;
    align-items: center !important;
    margin-bottom: 10px !important;
  }
  body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .repair-part-field {
    display: grid !important;
    grid-template-rows: auto var(--edit-control) !important;
    gap: 5px !important;
    min-width: 0 !important;
    margin: 0 !important;
  }
  body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .repair-part-field > span:first-child {
    display: block !important;
    color: #475569 !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    line-height: 1.25 !important;
    white-space: nowrap !important;
  }
  body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .repair-part-field > .input,
  body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .repair-part-action > .btn {
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
  }
  body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .repair-part-receipt {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px !important;
    min-height: var(--edit-control) !important;
    padding: 7px 10px !important;
    border: 1px solid #bbf7d0 !important;
    border-radius: 10px !important;
    background: #f0fdf4 !important;
    color: #166534 !important;
    font-weight: 750 !important;
    white-space: nowrap !important;
  }
  body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .repair-part-receipt input { width:18px !important;height:18px !important; }
  body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .repair-part-action > .btn { min-height:var(--edit-control) !important; }
  body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .edit-card > label:first-child,
  body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .desktop-marked-grid > .edit-card > label:first-child {
    font-size: 13px !important;
    font-weight: 750 !important;
    line-height: 1.4 !important;
  }
  body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog textarea[name="customer_address"] {
    min-height: 92px !important;
  }
  @media (min-width: 1024px) {
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .repair-edit-modal-bar > strong {
      font-size: 17px !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .repair-edit-modal-action,
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .edit-order-form .btn,
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .edit-scroll-btn {
      font-size: 15px !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .edit-order-kicker {
      font-size: 13px !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .edit-section-head h3,
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .edit-group-head h3 {
      font-size: 18px !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .edit-section-head p,
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .edit-group-head p,
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .edit-card small,
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .muted {
      font-size: 12px !important;
      line-height: 1.45 !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .edit-card > label:first-child,
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .desktop-marked-grid > .edit-card > label:first-child,
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .edit-card label {
      font-size: 14px !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .edit-card :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea),
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .repair-part-row :is(input,select) {
      font-size: 15px !important;
      line-height: 1.45 !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .desktop-symptom-choices label,
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .after-service-choice {
      font-size: 14px !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .edit-summary-chip > span:not(.after-service-summary-icon) {
      font-size: 13px !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .edit-summary-chip > strong {
      font-size: 17px !important;
      line-height: 1.25 !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .desktop-finance-grid > .edit-card:has(input[name="repair_income_enabled"]) {
      grid-column: 1 / -1 !important;
      min-height: 54px !important;
      padding: 9px 12px !important;
      justify-content: center !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .desktop-finance-grid > .edit-card:has(input[name="repair_income_enabled"]) > label {
      display: flex !important;
      width: 100% !important;
      align-items: center !important;
      gap: 10px !important;
      margin: 0 !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .desktop-finance-grid > .edit-card:has(input[name="repair_income_enabled"]) > label > span {
      display: flex !important;
      min-width: 0 !important;
      align-items: baseline !important;
      gap: 10px !important;
      white-space: nowrap !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .desktop-finance-grid > .edit-card:has(input[name="repair_income_enabled"]) strong {
      display: inline !important;
      flex: 0 0 auto !important;
      font-size: 15px !important;
      line-height: 1.4 !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .desktop-finance-grid > .edit-card:has(input[name="repair_income_enabled"]) small {
      display: inline !important;
      margin: 0 !important;
      font-size: 13px !important;
      line-height: 1.4 !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .desktop-symptom-section {
      grid-template-columns: minmax(190px, 28%) minmax(0, 72%) !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .desktop-symptom-section > .edit-card:first-child {
      grid-column: 1 / -1 !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .desktop-symptom-section > .edit-card:nth-child(2) {
      grid-column: 1 !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .desktop-symptom-section > .edit-card:nth-child(3) {
      grid-column: 2 !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .desktop-symptom-section > .edit-card:nth-child(3) > textarea {
      width: 100% !important;
      max-width: none !important;
      min-width: 0 !important;
      box-sizing: border-box !important;
    }
  }
  @media (max-width: 1023px) {
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .repair-part-row {
      grid-template-columns: repeat(2,minmax(0,1fr)) !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog :is(.edit-card-grid-2,.edit-card-grid-3,.desktop-marked-grid) {
      display: grid !important;
      grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
      gap: 8px !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .desktop-marked-grid > .edit-card,
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .desktop-marked-grid > .edit-card:not(.desktop-unmarked-card) {
      display: flex !important;
      flex-direction: column !important;
      align-items: stretch !important;
      gap: 5px !important;
      min-width: 0 !important;
      min-height: 0 !important;
      padding: 8px !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .desktop-marked-grid > .edit-card > label:first-child {
      display: block !important;
      width: 100% !important;
      margin: 0 !important;
      font-size: 11px !important;
      line-height: 1.3 !important;
      text-align: left !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .desktop-marked-grid > .edit-card > :is(.input,input:not([type="checkbox"]):not([type="radio"]),select,textarea) {
      width: 100% !important;
      max-width: none !important;
      min-width: 0 !important;
      margin: 0 !important;
      box-sizing: border-box !important;
      text-align: left !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog :is(.edit-card-wide,.desktop-preserve-full,.desktop-unmarked-card) {
      grid-column: 1 / -1 !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .desktop-device-grid > .edit-card:last-child,
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .desktop-symptom-section > .edit-card,
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .desktop-warranty-grid > .edit-card:last-child,
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .desktop-finance-grid > .desktop-preserve-full,
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .desktop-notes-grid > .after-service-card {
      grid-column: 1 / -1 !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .desktop-symptom-choices {
      grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
  }
  @media (max-width: 767px) {
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .repair-part-row {
      grid-template-columns: 1fr !important;
      padding: 9px !important;
      border: 1px solid #dbeafe !important;
      border-radius: 12px !important;
      background: #f8fbff !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .edit-card > label:first-child,
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .desktop-marked-grid > .edit-card > label:first-child {
      font-size: 12px !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .edit-order-form {
      padding: 9px !important;
      gap: 9px !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .edit-order-hero {
      padding: 10px !important;
      gap: 7px !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .edit-order-hero h2 {
      margin-top: 4px !important;
      color: #0f4c81 !important;
      font-size: 19px !important;
      line-height: 1.25 !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .edit-order-summary {
      gap: 5px !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .edit-summary-chip {
      min-height: 46px !important;
      padding: 5px 7px !important;
      border-radius: 11px !important;
      box-shadow: 0 4px 10px rgba(15,47,79,.07) !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .edit-summary-chip:nth-child(1) {
      border-color: #99f6e4 !important;
      background: linear-gradient(135deg,#f0fdfa,#ccfbf1) !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .edit-summary-chip:nth-child(2) {
      border-color: #bfdbfe !important;
      background: linear-gradient(135deg,#eff6ff,#dbeafe) !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .edit-summary-chip:nth-child(3) {
      border-color: #fde68a !important;
      background: linear-gradient(135deg,#fffbeb,#fef3c7) !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .edit-summary-chip:nth-child(4) {
      border-color: #ddd6fe !important;
      background: linear-gradient(135deg,#f5f3ff,#ede9fe) !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .edit-summary-chip > :is(span,strong) {
      line-height: 1.15 !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .edit-summary-chip > span:not(.after-service-summary-icon) {
      font-size: 10px !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .edit-summary-chip > strong {
      font-size: 12px !important;
      overflow: hidden !important;
      text-overflow: ellipsis !important;
      white-space: nowrap !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .after-service-summary-icon {
      display: none !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .edit-section {
      padding: 9px !important;
      margin: 0 !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .desktop-customer-grid > .edit-card:nth-child(1) {
      grid-column: 1 !important;
      grid-row: 1 !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .desktop-customer-grid > .edit-card:nth-child(3) {
      grid-column: 2 !important;
      grid-row: 1 !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .desktop-customer-grid > .edit-card:nth-child(2),
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .desktop-customer-grid > .edit-card:nth-child(4),
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .desktop-customer-grid > .edit-card:nth-child(5),
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .desktop-customer-grid > .edit-card:nth-child(6) {
      grid-column: 1 / -1 !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog textarea[name="customer_address"] {
      min-height: 108px !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .edit-card:has(> select[name="service_type"]) {
      grid-column: 1 / -1 !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog select[name="service_type"] {
      width: 100% !important;
      max-width: none !important;
      padding-right: 42px !important;
      text-overflow: ellipsis !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .edit-card:has(> textarea[name="customer_note"]) {
      grid-column: 1 / -1 !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog textarea[name="customer_note"] {
      width: 100% !important;
      min-height: 72px !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .desktop-finance-grid > .edit-card:has(input[name="repair_income_enabled"]) {
      min-height: 46px !important;
      padding: 4px 7px !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .desktop-finance-grid > .edit-card:has(input[name="repair_income_enabled"]) > label {
      align-items: center !important;
      gap: 7px !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .desktop-finance-grid > .edit-card:has(input[name="repair_income_enabled"]) > label > span {
      min-width: 0 !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .desktop-finance-grid > .edit-card:has(input[name="repair_income_enabled"]) strong,
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .desktop-finance-grid > .edit-card:has(input[name="repair_income_enabled"]) small {
      display: block !important;
      margin: 0 !important;
      overflow: hidden !important;
      line-height: 1.25 !important;
      text-overflow: ellipsis !important;
      white-space: nowrap !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .desktop-finance-grid input[name="repair_income_enabled"] {
      width: 16px !important;
      height: 16px !important;
      margin-top: 0 !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .desktop-finance-grid > .edit-card:has(input[name="repair_income_enabled"]) strong {
      font-size: 11px !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .desktop-finance-grid > .edit-card:has(input[name="repair_income_enabled"]) small {
      font-size: 10px !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog :is(.desktop-images-grid,.desktop-status-grid) {
      grid-template-columns: 1fr !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog :is(.desktop-images-grid,.desktop-status-grid) > .edit-card {
      grid-column: auto !important;
    }
    body.admin-page.repair-edit-modal-open .repair-edit-modal-dialog .repair-part-row {
      grid-template-columns: 1fr !important;
    }
  }

    .repair-billing-top-action { color:#fff; background:linear-gradient(135deg,#7c3aed,#4f46e5); border-color:#c4b5fd; }
    .billing-modal { position:fixed; inset:0; z-index:1000; display:none; align-items:center; justify-content:center; padding:24px; }
    .billing-modal.is-open { display:flex; }
    .billing-modal-backdrop { position:absolute; inset:0; background:rgba(15,23,42,.64); backdrop-filter:blur(5px); }
    .billing-modal-card { position:relative; z-index:1; width:min(680px,100%); max-height:calc(100vh - 48px); overflow:auto; border:1px solid rgba(196,181,253,.9); border-radius:24px; background:#fff; box-shadow:0 28px 80px rgba(15,23,42,.42); }
    .billing-modal-head { display:flex; justify-content:space-between; gap:18px; padding:24px 26px 20px; color:#fff; background:radial-gradient(circle at 100% 0,rgba(255,255,255,.24),transparent 37%),linear-gradient(135deg,#4c1d95,#6d28d9 55%,#2563eb); }
    .billing-modal-kicker { font-size:11px; font-weight:900; letter-spacing:.12em; opacity:.82; }
    .billing-modal-head h3 { margin:5px 0; font-size:28px; }
    .billing-modal-head p { max-width:520px; margin:0; line-height:1.5; opacity:.92; }
    .billing-modal-x { width:38px; height:38px; flex:0 0 38px; border:1px solid rgba(255,255,255,.55); border-radius:12px; color:#fff; background:rgba(255,255,255,.14); font-size:27px; line-height:1; cursor:pointer; }
    .billing-group-notice { display:grid; gap:4px; margin:18px 22px 0; padding:13px 15px; border:1px solid #c4b5fd; border-radius:14px; color:#4c1d95; background:#f5f3ff; }
    .billing-group-notice span { font-size:13px; line-height:1.45; }
    .billing-modal-body { display:grid; grid-template-columns:1.25fr .9fr; gap:14px; padding:22px 26px; }
    .billing-field, .billing-owner-card { display:grid; gap:8px; padding:16px; border:1px solid #dbeafe; border-radius:16px; background:#f8fbff; }
    .billing-field > span, .billing-owner-card > span { color:#334155; font-size:13px; font-weight:900; }
    .billing-field small, .billing-owner-card p { margin:0; color:#64748b; font-size:12px; line-height:1.5; }
    .billing-owner-card { border-color:#ddd6fe; background:linear-gradient(135deg,#faf5ff,#eef2ff); }
    .billing-owner-card strong { color:#5b21b6; font-size:19px; }
    .billing-modal-actions { display:flex; justify-content:flex-end; gap:9px; padding:16px 26px 24px; border-top:1px solid #e2e8f0; }
    .billing-modal-actions .btn { min-height:42px; }
    @media (max-width:760px) {
      .repair-billing-top-action { grid-column:span 2; }
      .billing-modal { align-items:flex-end; padding:0; }
      .billing-modal-card { width:100%; max-height:88vh; border-radius:24px 24px 0 0; }
      .billing-modal-head { padding:20px 18px 17px; }
      .billing-modal-head h3 { font-size:24px; }
      .billing-modal-body { grid-template-columns:1fr; padding:16px 18px; }
      .billing-group-notice { margin:14px 18px 0; }
      .billing-modal-actions { display:grid; grid-template-columns:1fr 1fr; padding:14px 18px calc(16px + env(safe-area-inset-bottom)); }
      .billing-modal-actions .btn:last-child { grid-column:span 2; }
    }
/* Compact active-repair overview and truthful, concise LINE delivery result. */
.admin-page .repair-overview-panel > .repair-overview-header { display:grid!important; grid-template-columns:minmax(0,1fr) auto; gap:6px 10px; align-items:center!important; }
.admin-page .repair-overview-heading { display:contents; }
.admin-page .repair-overview-heading h2 { grid-column:1; grid-row:1; font-size:22px; }
.admin-page .repair-overview-heading p { grid-column:1/-1; grid-row:2; margin:0!important; font-size:12px; line-height:1.4; }
.admin-page .repair-overview-panel > .repair-overview-header > .btn { grid-column:2; grid-row:1; width:auto!important; min-width:0!important; min-height:34px; padding:7px 12px; font-size:12px; white-space:nowrap; }
.admin-page .repair-overview-grid { gap:8px!important; margin-top:10px!important; }
.admin-page .repair-overview-card { min-height:0!important; padding:10px 12px!important; border-radius:12px!important; }
.admin-page .repair-overview-card strong { font-size:25px!important; }
.admin-page .repair-line-delivery { gap:2px; margin-block:4px; padding:5px 7px; font-size:10px; line-height:1.35; }
.admin-page .repair-line-delivery strong { font-size:12px; line-height:1.35; }
.admin-page .repair-line-delivery small:not([hidden]) { margin-top:1px; font-size:10px; line-height:1.35; }
.admin-page .repair-line-delivery a { font-size:10px; }
@media(max-width:760px) {
  .admin-page .repair-overview-panel { padding:12px!important; }
  .admin-page .repair-overview-heading h2 { font-size:19px!important; }
  .admin-page .repair-overview-heading p { font-size:10px; }
  .admin-page .repair-overview-panel > .repair-overview-header > .btn { padding:6px 8px!important; min-height:32px!important; font-size:10px!important; }
  .admin-page .repair-overview-grid { grid-template-columns:repeat(6,minmax(0,1fr))!important; gap:6px!important; }
  .admin-page .repair-overview-grid .repair-overview-card { grid-column:span 2!important; min-width:0!important; width:auto!important; min-height:0!important; height:auto!important; padding:8px!important; gap:4px!important; }
  .admin-page .repair-overview-grid .repair-overview-card:nth-child(n+4) { grid-column:span 3!important; }
  .admin-page .repair-overview-card .repair-overview-copy { gap:2px!important; min-width:0; }
  .admin-page .repair-overview-card .repair-overview-step { font-size:8px!important; line-height:1.2!important; }
  .admin-page .repair-overview-card .repair-overview-label { font-size:10px!important; line-height:1.25!important; white-space:normal!important; }
  .admin-page .repair-overview-card small { font-size:8px!important; line-height:1.3!important; }
  .admin-page .repair-overview-card strong { font-size:21px!important; }
  .admin-page .repair-active-table tbody { gap:7px!important; }
  .admin-page .repair-active-table .repair-active-row { padding:8px!important; }
  .admin-page .repair-active-row > td { padding:5px!important; }
  .admin-page .repair-active-row .repair-ticket-card { padding:7px 9px!important; }
  .admin-page .repair-active-row .repair-ticket-tracking > :is(a,button) { min-height:34px!important; padding:5px 7px!important; }
  .admin-page .repair-active-row .repair-followup-alert:not([hidden]) { box-sizing:border-box; width:100%; height:32px!important; min-height:32px!important; padding:5px 7px!important; margin-top:4px!important; gap:5px!important; }
  .admin-page .repair-active-row .repair-ticket-actions > [role="status"] { position:static!important; height:auto!important; }
  .admin-page .repair-active-row .repair-followup-text { display:flex!important; align-items:center; flex-wrap:nowrap; gap:6px; white-space:nowrap; }
  .admin-page .repair-active-row .repair-followup-text > span { font-size:10px!important; }
  .admin-page .repair-active-row .repair-followup-text > strong { font-size:10px!important; }
  .admin-page .repair-active-row .repair-followup-icon { flex-basis:16px!important; height:16px!important; }
  .admin-page .repair-active-row .repair-info-grid { gap:5px!important; margin-top:7px!important; }
  .admin-page .repair-active-row .repair-info-chip { min-height:0!important; padding:6px 8px!important; }
  .admin-page .repair-active-row .repair-info-chip > strong { line-height:1.4!important; }
  .admin-page .repair-active-row .repair-info-chip .appointment-display strong { padding:5px 7px!important; font-size:14px!important; line-height:1.35!important; }
  .admin-page .repair-active-row .repair-info-chip .appointment-mobile-date,
  .admin-page .repair-active-row .repair-info-chip .appointment-mobile-time { font-size:14px!important; line-height:1.35!important; }
  .admin-page .repair-active-row .repair-list-status-tools { gap:5px!important; }
  .admin-page .repair-active-row .repair-alert-visual { min-height:56px!important; padding:7px 9px!important; gap:8px!important; border-radius:12px!important; }
  .admin-page .repair-active-row .repair-alert-icon { width:32px; height:32px; font-size:22px; }
  .admin-page .repair-active-row .repair-alert-visual span { margin-bottom:2px; font-size:10px; }
  .admin-page .repair-active-row .repair-alert-visual strong { font-size:12px; line-height:1.35; }
  .admin-page .repair-active-row .repair-list-status-head .repair-current-status { min-height:29px!important; padding:6px 8px!important; }
  .admin-page .repair-active-row .repair-list-status-head :is(.repair-confirm-queue-btn,.repair-confirm-queue-done,.repair-list-edit-btn) { min-height:32px!important; padding:5px!important; }
  .admin-page .repair-active-row .repair-list-status-tools > :is(.repair-job-summary-toggle,.repair-list-track-copy-btn) { min-height:34px!important; padding:6px 8px!important; }
}
/* Clear status-coloured boundaries: an expanded job remains one visual card. */
.admin-page .repair-overview-card::after { content:""; position:absolute; bottom:3px; left:9px; right:9px; height:2px; border-radius:3px; background:rgba(255,255,255,.7); pointer-events:none; }
.admin-page .repair-active-row .repair-current-status { border-bottom:3px solid rgba(255,255,255,.65)!important; }
@media(max-width:760px) {
  .admin-page .repair-active-table tbody { gap:12px!important; }
  .admin-page .repair-active-table .repair-active-row:not(.has-open-summary) {
    border-top:3px solid var(--repair-status,#2563eb)!important;
    border-bottom:6px solid var(--repair-status,#2563eb)!important;
    box-shadow:0 3px 0 #fff,0 6px 12px rgba(15,23,42,.09)!important;
  }
  .admin-page .repair-active-table .repair-active-row.has-open-summary { border-top:3px solid var(--repair-status,#2563eb)!important; }
  .admin-page .repair-active-table .repair-active-summary-row { margin-top:-12px!important; }
  .admin-page .repair-active-table .repair-active-summary-row > td {
    border-left:6px solid var(--repair-status,#2563eb)!important;
    border-right:2px solid var(--repair-status,#2563eb)!important;
    border-bottom:6px solid var(--repair-status,#2563eb)!important;
    background:var(--repair-status-soft,#eff6ff)!important;
  }
}
/* Readable delivery outcome within the compact ticket column. */
.admin-page .repair-line-delivery { --delivery-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v6m0-10v.1'/%3E%3C/svg%3E"); gap:2px; padding:5px 7px; line-height:1.25; }
.admin-page .repair-line-delivery > span { font-size:12px; font-weight:700; line-height:1.25; }
.admin-page .repair-line-delivery [data-delivery-label] { display:flex; align-items:center; gap:5px; font-size:17px; font-weight:900; line-height:1.2; }
.admin-page .repair-line-delivery [data-delivery-label]::before { content:""; display:block; width:18px; height:18px; flex:0 0 18px; background:currentColor; -webkit-mask:var(--delivery-icon) center/contain no-repeat; mask:var(--delivery-icon) center/contain no-repeat; }
.admin-page .repair-line-delivery small[data-delivery-detail]:not([hidden]) { margin-top:2px; font-size:12px; font-weight:700; line-height:1.3; }
.admin-page .repair-line-delivery a { font-size:11px; line-height:1.25; }
.admin-page .repair-line-delivery[data-repair-delivery-state="sent"] { --delivery-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m8 12 3 3 5-6'/%3E%3C/svg%3E"); }
.admin-page .repair-line-delivery:is([data-repair-delivery-state="failed"],[data-repair-delivery-state="blocked"],[data-repair-delivery-state="retry"]) { --delivery-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m9 9 6 6m0-6-6 6'/%3E%3C/svg%3E"); }
.admin-page .repair-line-delivery:is([data-repair-delivery-state="queued"],[data-repair-delivery-state="processing"]) { --delivery-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E"); }
.admin-page .repair-line-delivery[data-repair-delivery-state="paused"] { --delivery-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M9 8v8m6-8v8'/%3E%3C/svg%3E"); }
/* Mobile-only ticket presentation; existing controls retain their layout slots. */
.repair-ticket-mobile-status { display:none; }
@media(max-width:760px) {
  .admin-page .is-mobile-ticket-layout .repair-ticket-card { position:relative; }
  .admin-page .is-mobile-ticket-layout .repair-ticket-mobile-status { position:absolute; top:8px; right:8px; display:flex; align-items:center; justify-content:center; box-sizing:border-box; width:45%; max-width:165px; height:26px; min-height:0; margin:0; padding:3px 6px; gap:4px; border:1px solid var(--repair-status-line); border-radius:8px; background:var(--repair-status); color:#fff; font-size:clamp(10px,2.5vw,12px); font-weight:800; line-height:1.2; white-space:nowrap; }
  .admin-page .is-mobile-ticket-layout .repair-ticket-mobile-status::before { content:""; width:6px; height:6px; flex:0 0 6px; border-radius:50%; background:#fff; box-shadow:0 0 0 2px #ffffff38; }
  .admin-page .is-mobile-ticket-layout .repair-list-status-head > .repair-current-status { visibility:hidden; }
  .admin-page .is-mobile-ticket-layout.has-mobile-line-details > td:first-child { box-sizing:border-box; display:grid!important; grid-template-columns:minmax(0,.45fr) minmax(0,.55fr); grid-template-rows:var(--mobile-ticket-height) calc(var(--mobile-ticket-actions-height) + var(--mobile-ticket-actions-gap)) minmax(0,1fr); gap:0 7px; }
  .admin-page .is-mobile-ticket-layout.has-mobile-line-details .repair-ticket-card { grid-column:1/-1; grid-row:1; box-sizing:border-box; height:var(--mobile-ticket-height); }
  .admin-page .is-mobile-ticket-layout.has-mobile-line-details .repair-ticket-actions { display:contents!important; }
  .admin-page .is-mobile-ticket-layout.has-mobile-line-details .repair-ticket-tracking { grid-column:1/-1; grid-row:2; height:var(--mobile-ticket-actions-height); margin-top:var(--mobile-ticket-actions-gap); }
  .admin-page .is-mobile-ticket-layout.has-mobile-line-details .repair-ticket-actions > [role="status"] { grid-column:1; grid-row:3; min-width:0; }
  .admin-page .is-mobile-ticket-layout.has-mobile-line-details .repair-followup-alert:not([hidden]) { height:100%!important; margin:0!important; min-height:0!important; flex-direction:column; justify-content:center; padding:7px!important; }
  .admin-page .is-mobile-ticket-layout.has-mobile-line-details .repair-followup-text { display:grid!important; gap:3px; white-space:normal; text-align:center; }
  .admin-page .is-mobile-ticket-layout.has-mobile-line-details .repair-followup-text > span { font-size:12px!important; line-height:1.35; }
  .admin-page .is-mobile-ticket-layout.has-mobile-line-details .repair-followup-text > strong { font-size:11px!important; line-height:1.35; }
  .admin-page .is-mobile-ticket-layout.has-mobile-line-details .repair-followup-icon { flex:0 0 20px!important; width:20px; height:20px!important; }
  .admin-page .is-mobile-ticket-layout.has-mobile-line-details .repair-line-delivery { grid-column:2; grid-row:3; min-width:0; margin:0; align-content:center; }
}
/* Smaller mobile LINE cards and an unmistakable, status-specific ticket badge. */
@media(max-width:760px) {
  .admin-page .is-mobile-ticket-layout.has-mobile-line-details > td:first-child { grid-template-rows:var(--mobile-ticket-height) calc(var(--mobile-ticket-actions-height) + var(--mobile-ticket-actions-gap)) auto; }
  .admin-page .is-mobile-ticket-layout.has-mobile-line-details .repair-followup-alert:not([hidden]) { gap:3px!important; padding:5px!important; }
  .admin-page .is-mobile-ticket-layout.has-mobile-line-details .repair-followup-icon { flex-basis:18px!important; width:18px; height:18px!important; }
  .admin-page .is-mobile-ticket-layout.has-mobile-line-details .repair-followup-text { gap:2px; }
  .admin-page .is-mobile-ticket-layout.has-mobile-line-details .repair-line-delivery { padding:5px 7px; gap:1px; }
  .admin-page .is-mobile-ticket-layout .repair-ticket-mobile-status { top:6px; height:30px; max-width:175px; padding:4px 6px; gap:5px; font-size:clamp(12px,2.8vw,14px)!important; font-weight:900; animation:mobileTicketStatusBeacon 2.6s ease-in-out infinite; }
  .admin-page .is-mobile-ticket-layout .repair-ticket-mobile-status::before { width:16px; height:16px; flex:0 0 16px; border-radius:0; box-shadow:none; -webkit-mask:var(--ticket-status-icon) center/contain no-repeat; mask:var(--ticket-status-icon) center/contain no-repeat; }
  .admin-page .is-mobile-ticket-layout .repair-ticket-mobile-status:is([data-status="delivered"],[data-status="cancelled"]) { animation:none; }
  @keyframes mobileTicketStatusBeacon { 0%,100% { opacity:1; box-shadow:0 0 0 0 transparent; } 50% { opacity:.72; box-shadow:0 0 0 3px color-mix(in srgb,var(--repair-status) 18%,transparent); } }
}
@media(prefers-reduced-motion:reduce) { .admin-page .repair-ticket-mobile-status { animation:none!important; } }

@media(max-width:760px) {
.admin-page .repair-ticket-mobile-status[data-status="pending"] { --ticket-status-icon:url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='1.8'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Crect%20x='4'%20y='3'%20width='16'%20height='12'%20rx='2'/%3E%3Cpath%20d='M2%2018h20l-2%203H4zM12%205v7m-3-3%203%203%203-3'/%3E%3C/svg%3E"); }
.admin-page .repair-ticket-mobile-status[data-status="confirmed"] { --ticket-status-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M7 3v4M17 3v4M3 10h18m-13 5 3 3 5-5'/%3E%3C/svg%3E"); }
.admin-page .repair-ticket-mobile-status[data-status="repair_confirmed"] { --ticket-status-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 12 2 2 4-4M12 3l8 4v5c0 5-8 9-8 9s-8-4-8-9V7z'/%3E%3C/svg%3E"); }
.admin-page .repair-ticket-mobile-status[data-status="repairing"] { --ticket-status-icon:url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='1.8'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Crect%20x='2'%20y='3'%20width='15'%20height='12'%20rx='2'/%3E%3Cpath%20d='M8%2015v5m-5%200h8m3%200%207-7a4%204%200%200%200%201-5l-3%203-3-3%203-3a4%204%200%200%200-5%205l-4%204'/%3E%3C/svg%3E"); }
.admin-page .repair-ticket-mobile-status[data-status="repair_quote"] { --ticket-status-icon:url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='1.8'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Crect%20x='2'%20y='3'%20width='15'%20height='12'%20rx='2'/%3E%3Cpath%20d='M8%2015v5m-5%200h8m3%200%207-7a4%204%200%200%200%201-5l-3%203-3-3%203-3a4%204%200%200%200-5%205l-4%204'/%3E%3C/svg%3E"); }
.admin-page .repair-ticket-mobile-status[data-status="repair_in_progress"] { --ticket-status-icon:url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='1.8'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Crect%20x='2'%20y='3'%20width='15'%20height='12'%20rx='2'/%3E%3Cpath%20d='M8%2015v5m-5%200h8m3%200%207-7a4%204%200%200%200%201-5l-3%203-3-3%203-3a4%204%200%200%200-5%205l-4%204'/%3E%3C/svg%3E"); }
.admin-page .repair-ticket-mobile-status[data-status="completed"] { --ticket-status-icon:url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='1.8'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Crect%20x='3'%20y='3'%20width='18'%20height='14'%20rx='2'/%3E%3Cpath%20d='M12%2017v4m-4%200h8M8%2010l3%203%205-6'/%3E%3C/svg%3E"); }
.admin-page .repair-ticket-mobile-status[data-status="payment_pending"] { --ticket-status-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='M3 10h18M7 15h4'/%3E%3C/svg%3E"); }
.admin-page .repair-ticket-mobile-status[data-status="paid"] { --ticket-status-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3h12v18l-3-2-3 2-3-2-3 2zM9 8h6m-6 5 2 2 4-4'/%3E%3C/svg%3E"); }
.admin-page .repair-ticket-mobile-status[data-status="delivered"] { --ticket-status-icon:url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='1.8'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='m12%202%209%205v10l-9%205-9-5V7zm0%209%209-4M3%207l9%204v11M7%204l10%205m-9%206%203%203%205-5'/%3E%3C/svg%3E"); }
.admin-page .repair-ticket-mobile-status[data-status="cancelled"] { --ticket-status-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m9 9 6 6m0-6-6 6'/%3E%3C/svg%3E"); }
}
/* Two-line mobile LINE panels and removal of the old status placeholder. */
@media(max-width:760px) {
  .admin-page .repair-overview-heading p { display:none!important; }
  .admin-page .is-mobile-ticket-layout .repair-list-status-head > .repair-current-status { display:none!important; }
  .admin-page .is-mobile-ticket-layout.has-mobile-line-details .repair-followup-alert:not([hidden]) { display:grid!important; grid-template-columns:12px minmax(0,1fr); align-items:center; justify-content:start; column-gap:3px!important; padding:5px!important; }
  .admin-page .is-mobile-ticket-layout.has-mobile-line-details .repair-followup-icon { width:12px; height:18px!important; flex-basis:12px!important; }
  .admin-page .is-mobile-ticket-layout.has-mobile-line-details .repair-followup-text { display:grid!important; grid-template-rows:auto auto; gap:2px; text-align:left; }
  .admin-page .is-mobile-ticket-layout.has-mobile-line-details .repair-followup-text > span,
  .admin-page .is-mobile-ticket-layout.has-mobile-line-details .repair-followup-text > strong { font-size:clamp(9px,2.65vw,12px)!important; line-height:1.35; white-space:nowrap; }
  .admin-page .is-mobile-ticket-layout.has-mobile-line-details .repair-line-delivery { display:grid; grid-template-columns:minmax(0,1fr) auto; grid-template-rows:auto auto; gap:2px 4px; padding:6px; align-content:center; align-items:center; }
  .admin-page .is-mobile-ticket-layout.has-mobile-line-details .repair-line-delivery > span { grid-column:1; grid-row:1; font-size:clamp(9px,2.5vw,11px); white-space:nowrap; }
  .admin-page .is-mobile-ticket-layout.has-mobile-line-details .repair-line-delivery > [role="status"] { display:contents; }
  .admin-page .is-mobile-ticket-layout.has-mobile-line-details .repair-line-delivery [data-delivery-label] { grid-column:2; grid-row:1; gap:3px; font-size:clamp(12px,3vw,15px); white-space:nowrap; }
  .admin-page .is-mobile-ticket-layout.has-mobile-line-details .repair-line-delivery [data-delivery-label]::before { width:13px; height:13px; flex-basis:13px; }
  .admin-page .is-mobile-ticket-layout.has-mobile-line-details .repair-line-delivery small[data-delivery-detail]:not([hidden]) { grid-column:1; grid-row:2; margin:0; font-size:clamp(9px,2.5vw,11px); white-space:nowrap; }
  .admin-page .is-mobile-ticket-layout.has-mobile-line-details .repair-line-delivery a { grid-column:2; grid-row:2; justify-self:end; font-size:0; line-height:1.3; white-space:nowrap; }
  .admin-page .is-mobile-ticket-layout.has-mobile-line-details .repair-line-delivery a::after { content:"ประวัติ"; font-size:clamp(9px,2.5vw,11px); text-decoration:underline; }
  .admin-page .is-mobile-ticket-layout.has-mobile-line-details .repair-line-delivery[data-repair-delivery-state="none"] [data-delivery-label] { grid-column:1/-1; grid-row:2; font-size:clamp(10px,2.5vw,12px); }
  .admin-page .is-mobile-ticket-layout.has-mobile-line-details .repair-line-delivery[data-repair-delivery-state="unconfirmed"] [data-delivery-label] { font-size:clamp(9px,2.2vw,11px); }
  .admin-page .is-mobile-ticket-layout.has-mobile-line-details .repair-line-delivery[data-repair-delivery-state="none"] a { grid-row:1; }
}

/* Larger mobile-only status beacon; absolute positioning preserves every surrounding block. */
@media(max-width:760px) {
  .admin-page .is-mobile-ticket-layout .repair-ticket-mobile-status {
    height:52px; padding:5px 6px; gap:5px;
    font-size:clamp(14px,3.6vw,18px)!important;
    line-height:1.2; white-space:normal; text-align:center;
    border:2px solid #ffffffb3; border-radius:10px;
    text-shadow:0 1px 2px #00000038;
    animation:mobileTicketStatusSpotlight 1.6s ease-in-out infinite;
  }
  .admin-page .is-mobile-ticket-layout .repair-ticket-mobile-status::before {
    width:24px; height:24px; flex:0 0 24px;
    filter:drop-shadow(0 0 3px #ffffff9c);
  }
  .admin-page .is-mobile-ticket-layout .repair-ticket-mobile-status:is([data-status="delivered"],[data-status="cancelled"]) { animation:none; }
  @keyframes mobileTicketStatusSpotlight {
    0%,100% { box-shadow:0 0 0 0 transparent,0 2px 5px #00000018; filter:brightness(1); }
    50% { box-shadow:0 0 0 3px color-mix(in srgb,var(--repair-status) 28%,transparent),0 0 13px color-mix(in srgb,var(--repair-status) 55%,transparent); filter:brightness(1.18); }
  }
}

/* Small breathing space between mobile tracking buttons and LINE panels. */
@media(max-width:760px) {
  .admin-page .is-mobile-ticket-layout.has-mobile-line-details > td:first-child {
    grid-template-rows:var(--mobile-ticket-height) calc(var(--mobile-ticket-actions-height) + var(--mobile-ticket-actions-gap) + 5px) auto;
  }
}

/* Backup warning lives in the existing information chip on all screen sizes. */

  .admin-page .repair-active-row .repair-alert-visual { display:none!important; }
  .admin-page .repair-active-row .repair-info-chip.backup > span::before {
    content:"!"; display:inline-flex; align-items:center; justify-content:center;
    width:14px; height:14px; margin-right:4px; border:1px solid currentColor;
    border-radius:50%; font-size:11px; font-weight:900; line-height:1;
    vertical-align:middle;
  }
  .admin-page .repair-active-row .repair-info-chip.backup.backup-success > span::before { content:"✓"; }
  .admin-page .repair-active-row .repair-info-chip.backup.backup-danger {
    animation:mobileBackupAttention 1.6s ease-in-out infinite;
  }
  @keyframes mobileBackupAttention {
    0%,100% { box-shadow:0 0 0 0 #ef444400; }
    50% { background:#fecaca; box-shadow:0 0 0 3px #ef44444d,0 0 10px #ef444433; }
  }

@media(prefers-reduced-motion:reduce) {
  .admin-page .repair-active-row .repair-info-chip.backup.backup-danger { animation:none!important; }
}

/* Keep original text measurements; a larger visual layer stays inside the same chip. */
.admin-page .repair-active-row .repair-info-chip.backup { position:relative; }
.admin-page .repair-active-row .repair-info-chip.backup > span,
.admin-page .repair-active-row .repair-info-chip.backup > strong { visibility:hidden; }
.admin-page .repair-active-row .repair-backup-emphasis {
 position:absolute; inset:4px 6px; display:flex; align-items:center; gap:6px; color:inherit; pointer-events:none;
}
.admin-page .repair-active-row .repair-backup-emphasis i {
 display:block; width:30px; height:30px; flex:0 0 30px; background:currentColor;
 mask:var(--backup-meaning-icon) center/contain no-repeat;
 -webkit-mask:var(--backup-meaning-icon) center/contain no-repeat;
}
.admin-page .repair-active-row .repair-backup-emphasis b { min-width:0; font-size:12px; line-height:1.2; font-weight:900; }
.admin-page .repair-active-row .repair-backup-emphasis em { display:block; margin-top:2px; font-size:15px; line-height:1.25; font-weight:900; font-style:normal; overflow-wrap:anywhere; }
.admin-page .repair-active-row .repair-info-chip.backup { --backup-meaning-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M4%204h16v7H4zM6%208h.01M9%208h.01M12%2014v7m-3-3%203%203%203-3%27%2F%3E%3Cpath%20d%3D%27M4%2014v6h3m13-6v6h-3%27%2F%3E%3C%2Fsvg%3E"); }
.admin-page .repair-active-row .repair-info-chip.backup.backup-danger { animation:backupProminentPulse 1.5s ease-in-out infinite; }
@keyframes backupProminentPulse {
 0%,100% { box-shadow:0 0 0 0 #ef444400; }
 50% { background:#fca5a5; box-shadow:0 0 0 3px #ef444466,0 0 14px #ef444455; }
}
@media(max-width:760px) {
 .admin-page .repair-active-row .repair-backup-emphasis { gap:4px; inset:4px 5px; }
 .admin-page .repair-active-row .repair-backup-emphasis i { width:24px; height:28px; flex-basis:24px; }
 .admin-page .repair-active-row .repair-backup-emphasis b { font-size:11px; }
 .admin-page .repair-active-row .repair-backup-emphasis em { font-size:clamp(11px,2.8vw,14px); }
}

.admin-page .repair-active-row .repair-info-chip.backup.backup-danger { --backup-meaning-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27m12%203%2010%2018H2zM12%209v5m0%203h.01%27%2F%3E%3C%2Fsvg%3E"); }

.admin-page .repair-active-row .repair-info-chip.backup.backup-success { --backup-meaning-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M4%204h16v7H4zM6%208h.01M9%208h.01M8%2017l3%203%206-7%27%2F%3E%3C%2Fsvg%3E"); }
@media(prefers-reduced-motion:reduce) {
 .admin-page .repair-active-row .repair-info-chip.backup.backup-danger { animation:none!important; }
}
.admin-page .repair-active-row .repair-info-chip.backup.backup-success .repair-backup-emphasis { color:#166534; }
.admin-page .repair-active-row .repair-info-chip.backup.backup-danger .repair-backup-emphasis { color:#991b1b; }
.admin-page .repair-active-row .repair-info-chip.backup.backup-warning .repair-backup-emphasis { color:#92400e; }

/* Full-color service graphics, within the existing fixed icon footprint. */
 .admin-page .repair-active-row .repair-info-chip.backup.backup-success { --backup-graphic:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2036%2036%27%3E%3Cdefs%3E%3ClinearGradient%20id%3D%27body%27%20x2%3D%270%27%20y2%3D%271%27%3E%3Cstop%20stop-color%3D%27%2364748b%27%2F%3E%3Cstop%20offset%3D%271%27%20stop-color%3D%27%231e293b%27%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%27face%27%20x2%3D%270%27%20y2%3D%271%27%3E%3Cstop%20stop-color%3D%27%23e0f2fe%27%2F%3E%3Cstop%20offset%3D%271%27%20stop-color%3D%27%237dd3fc%27%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3Crect%20x%3D%273%27%20y%3D%274%27%20width%3D%2725%27%20height%3D%2727%27%20rx%3D%276%27%20fill%3D%27url%28%23body%29%27%2F%3E%3Crect%20x%3D%276%27%20y%3D%277%27%20width%3D%2719%27%20height%3D%2716%27%20rx%3D%273%27%20fill%3D%27url%28%23face%29%27%2F%3E%3Ccircle%20cx%3D%2715.5%27%20cy%3D%2715%27%20r%3D%276%27%20fill%3D%27%23f8fafc%27%2F%3E%3Ccircle%20cx%3D%2715.5%27%20cy%3D%2715%27%20r%3D%272.5%27%20fill%3D%27%230284c7%27%2F%3E%3Cpath%20d%3D%27m15%2016%206%205%27%20stroke%3D%27%23475569%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%2F%3E%3Cpath%20d%3D%27M7%2027h9%27%20stroke%3D%27%2394a3b8%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%2F%3E%3Ccircle%20cx%3D%2722%27%20cy%3D%2727%27%20r%3D%271.5%27%20fill%3D%27%2334d399%27%2F%3E%3Ccircle%20cx%3D%2726%27%20cy%3D%2726%27%20r%3D%279%27%20fill%3D%27%2316a34a%27%20stroke%3D%27white%27%20stroke-width%3D%272%27%2F%3E%3Cpath%20d%3D%27m22%2025%203%203%205-6%27%20fill%3D%27none%27%20stroke%3D%27white%27%20stroke-width%3D%272.5%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%2F%3E%3C%2Fsvg%3E"); }
 .admin-page .repair-active-row .repair-info-chip.backup.backup-danger { --backup-graphic:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2036%2036%27%3E%3Cdefs%3E%3ClinearGradient%20id%3D%27body%27%20x2%3D%270%27%20y2%3D%271%27%3E%3Cstop%20stop-color%3D%27%2364748b%27%2F%3E%3Cstop%20offset%3D%271%27%20stop-color%3D%27%231e293b%27%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%27face%27%20x2%3D%270%27%20y2%3D%271%27%3E%3Cstop%20stop-color%3D%27%23e0f2fe%27%2F%3E%3Cstop%20offset%3D%271%27%20stop-color%3D%27%237dd3fc%27%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3Crect%20x%3D%273%27%20y%3D%274%27%20width%3D%2725%27%20height%3D%2727%27%20rx%3D%276%27%20fill%3D%27url%28%23body%29%27%2F%3E%3Crect%20x%3D%276%27%20y%3D%277%27%20width%3D%2719%27%20height%3D%2716%27%20rx%3D%273%27%20fill%3D%27url%28%23face%29%27%2F%3E%3Ccircle%20cx%3D%2715.5%27%20cy%3D%2715%27%20r%3D%276%27%20fill%3D%27%23f8fafc%27%2F%3E%3Ccircle%20cx%3D%2715.5%27%20cy%3D%2715%27%20r%3D%272.5%27%20fill%3D%27%230284c7%27%2F%3E%3Cpath%20d%3D%27m15%2016%206%205%27%20stroke%3D%27%23475569%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%2F%3E%3Cpath%20d%3D%27M7%2027h9%27%20stroke%3D%27%2394a3b8%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%2F%3E%3Ccircle%20cx%3D%2722%27%20cy%3D%2727%27%20r%3D%271.5%27%20fill%3D%27%2334d399%27%2F%3E%3Ccircle%20cx%3D%2726%27%20cy%3D%2726%27%20r%3D%279%27%20fill%3D%27%23ef4444%27%20stroke%3D%27white%27%20stroke-width%3D%272%27%2F%3E%3Cpath%20d%3D%27M26%2021v5m0%203h.01%27%20stroke%3D%27white%27%20stroke-width%3D%272.5%27%20stroke-linecap%3D%27round%27%2F%3E%3C%2Fsvg%3E"); }
 .admin-page .repair-active-row .repair-info-chip.backup.backup-warning { --backup-graphic:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2036%2036%27%3E%3Cdefs%3E%3ClinearGradient%20id%3D%27body%27%20x2%3D%270%27%20y2%3D%271%27%3E%3Cstop%20stop-color%3D%27%2364748b%27%2F%3E%3Cstop%20offset%3D%271%27%20stop-color%3D%27%231e293b%27%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%27face%27%20x2%3D%270%27%20y2%3D%271%27%3E%3Cstop%20stop-color%3D%27%23e0f2fe%27%2F%3E%3Cstop%20offset%3D%271%27%20stop-color%3D%27%237dd3fc%27%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3Crect%20x%3D%273%27%20y%3D%274%27%20width%3D%2725%27%20height%3D%2727%27%20rx%3D%276%27%20fill%3D%27url%28%23body%29%27%2F%3E%3Crect%20x%3D%276%27%20y%3D%277%27%20width%3D%2719%27%20height%3D%2716%27%20rx%3D%273%27%20fill%3D%27url%28%23face%29%27%2F%3E%3Ccircle%20cx%3D%2715.5%27%20cy%3D%2715%27%20r%3D%276%27%20fill%3D%27%23f8fafc%27%2F%3E%3Ccircle%20cx%3D%2715.5%27%20cy%3D%2715%27%20r%3D%272.5%27%20fill%3D%27%230284c7%27%2F%3E%3Cpath%20d%3D%27m15%2016%206%205%27%20stroke%3D%27%23475569%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%2F%3E%3Cpath%20d%3D%27M7%2027h9%27%20stroke%3D%27%2394a3b8%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%2F%3E%3Ccircle%20cx%3D%2722%27%20cy%3D%2727%27%20r%3D%271.5%27%20fill%3D%27%2334d399%27%2F%3E%3Ccircle%20cx%3D%2726%27%20cy%3D%2726%27%20r%3D%279%27%20fill%3D%27%23f59e0b%27%20stroke%3D%27white%27%20stroke-width%3D%272%27%2F%3E%3Cpath%20d%3D%27M26%2021v5l3%202%27%20fill%3D%27none%27%20stroke%3D%27white%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%2F%3E%3C%2Fsvg%3E"); }
.admin-page .repair-active-row .repair-backup-emphasis i {
 background:var(--backup-graphic) center/contain no-repeat;
 mask:none; -webkit-mask:none; filter:drop-shadow(0 2px 2px #0f172a26);
}

/* Enlarge the disk graphic within its existing absolute-positioned content layer. */
.admin-page .repair-active-row .repair-backup-emphasis i {
 width:34px; height:34px; flex-basis:34px;
}
@media(max-width:760px) {
 .admin-page .repair-active-row .repair-backup-emphasis i {
  width:28px; height:32px; flex-basis:28px;
 }
}

/* Fill the existing backup chip height without changing its layout or stored data. */
.admin-page .repair-active-row .repair-backup-emphasis { gap:5px; }
.admin-page .repair-active-row .repair-backup-emphasis i {
 width:44px; height:100%; max-height:52px; flex:0 0 44px;
}
@media(max-width:760px) {
 .admin-page .repair-active-row .repair-backup-emphasis { gap:3px; inset:3px 4px; }
 .admin-page .repair-active-row .repair-backup-emphasis i {
  width:36px; height:100%; max-height:52px; flex-basis:36px;
 }
}

/* Slightly enlarge only the graphic inside its unchanged icon area. */
.admin-page .repair-active-row .repair-backup-emphasis i {
 background-size:110% auto;
}

/* Color graphics identify workflow stages and the current repair status. */
.admin-page .repair-overview-card.status-pending, .admin-page .repair-current-status.pending, .admin-page .repair-ticket-mobile-status[data-status="pending"] { --repair-stage-graphic:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2036%2036%27%3E%3Cpath%20d%3D%27M7%207h22v15H7z%27%20fill%3D%27%23dbeafe%27%20stroke%3D%27%232563eb%27%20stroke-width%3D%272%27%2F%3E%3Cpath%20d%3D%27M4%2025h28l-3%205H7z%27%20fill%3D%27%2364748b%27%2F%3E%3Ccircle%20cx%3D%2726%27%20cy%3D%2711%27%20r%3D%278%27%20fill%3D%27%23f59e0b%27%20stroke%3D%27white%27%20stroke-width%3D%272%27%2F%3E%3Cpath%20d%3D%27M26%207v4l3%202%27%20fill%3D%27none%27%20stroke%3D%27white%27%20stroke-width%3D%272%27%2F%3E%3C%2Fsvg%3E"); }
.admin-page .repair-overview-card.status-confirmed, .admin-page .repair-current-status.confirmed, .admin-page .repair-ticket-mobile-status[data-status="confirmed"] { --repair-stage-graphic:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2036%2036%27%3E%3Crect%20x%3D%275%27%20y%3D%276%27%20width%3D%2726%27%20height%3D%2726%27%20rx%3D%275%27%20fill%3D%27%23f8fafc%27%2F%3E%3Cpath%20d%3D%27M5%2014h26%27%20stroke%3D%27%230d9488%27%20stroke-width%3D%275%27%2F%3E%3Cpath%20d%3D%27M11%204v6m14-6v6%27%20stroke%3D%27%2399f6e4%27%20stroke-width%3D%273%27%20stroke-linecap%3D%27round%27%2F%3E%3Cpath%20d%3D%27m11%2023%205%204%209-9%27%20fill%3D%27none%27%20stroke%3D%27%230d9488%27%20stroke-width%3D%273%27%20stroke-linecap%3D%27round%27%2F%3E%3C%2Fsvg%3E"); }
.admin-page .repair-overview-card.status-repair_confirmed, .admin-page .repair-current-status.repair_confirmed, .admin-page .repair-ticket-mobile-status[data-status="repair_confirmed"] { --repair-stage-graphic:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2036%2036%27%3E%3Cpath%20d%3D%27m18%203%2013%205v10c0%208-13%2015-13%2015S5%2026%205%2018V8z%27%20fill%3D%27%23ddd6fe%27%20stroke%3D%27white%27%20stroke-width%3D%272%27%2F%3E%3Cpath%20d%3D%27m11%2017%205%205%2010-11%27%20fill%3D%27none%27%20stroke%3D%27%237c3aed%27%20stroke-width%3D%274%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%2F%3E%3C%2Fsvg%3E"); }
.admin-page .repair-overview-card.status-repairing, .admin-page .repair-current-status.repairing, .admin-page .repair-ticket-mobile-status[data-status="repairing"] { --repair-stage-graphic:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2036%2036%27%3E%3Crect%20x%3D%273%27%20y%3D%276%27%20width%3D%2725%27%20height%3D%2719%27%20rx%3D%273%27%20fill%3D%27%23dbeafe%27%20stroke%3D%27%231d4ed8%27%20stroke-width%3D%272%27%2F%3E%3Cpath%20d%3D%27M15%2025v5M9%2031h12%27%20stroke%3D%27white%27%20stroke-width%3D%273%27%2F%3E%3Cpath%20d%3D%27m16%2029%2013-13c5%201%207-3%205-7l-4%204-3-3%204-4c-5-2-9%201-8%206L11%2024z%27%20fill%3D%27%23fbbf24%27%20stroke%3D%27%2392400e%27%20stroke-width%3D%271.5%27%2F%3E%3C%2Fsvg%3E"); }
.admin-page .repair-overview-card.status-completed, .admin-page .repair-current-status.completed, .admin-page .repair-ticket-mobile-status[data-status="completed"] { --repair-stage-graphic:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2036%2036%27%3E%3Crect%20x%3D%274%27%20y%3D%275%27%20width%3D%2728%27%20height%3D%2721%27%20rx%3D%274%27%20fill%3D%27%23dcfce7%27%20stroke%3D%27white%27%20stroke-width%3D%272%27%2F%3E%3Cpath%20d%3D%27m10%2015%205%205%2011-10%27%20fill%3D%27none%27%20stroke%3D%27%2316a34a%27%20stroke-width%3D%273%27%20stroke-linecap%3D%27round%27%2F%3E%3Cpath%20d%3D%27M18%2026v5M11%2032h14%27%20stroke%3D%27%23f0fdf4%27%20stroke-width%3D%273%27%2F%3E%3C%2Fsvg%3E"); }
.admin-page .repair-overview-card.status-payment_pending, .admin-page .repair-current-status.payment_pending, .admin-page .repair-ticket-mobile-status[data-status="payment_pending"] { --repair-stage-graphic:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2036%2036%27%3E%3Crect%20x%3D%273%27%20y%3D%277%27%20width%3D%2730%27%20height%3D%2723%27%20rx%3D%275%27%20fill%3D%27%23fef3c7%27%20stroke%3D%27white%27%20stroke-width%3D%272%27%2F%3E%3Cpath%20d%3D%27M3%2015h30%27%20stroke%3D%27%23b45309%27%20stroke-width%3D%275%27%2F%3E%3Cpath%20d%3D%27M8%2024h8%27%20stroke%3D%27%23b45309%27%20stroke-width%3D%273%27%2F%3E%3C%2Fsvg%3E"); }
.admin-page .repair-overview-card.status-delivered, .admin-page .repair-current-status.delivered, .admin-page .repair-ticket-mobile-status[data-status="delivered"] { --repair-stage-graphic:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2036%2036%27%3E%3Cpath%20d%3D%27m18%203%2014%207v17l-14%207-14-7V10z%27%20fill%3D%27%23a7f3d0%27%20stroke%3D%27white%27%20stroke-width%3D%272%27%2F%3E%3Cpath%20d%3D%27m4%2010%2014%207%2014-7M18%2017v17%27%20fill%3D%27none%27%20stroke%3D%27%23059669%27%20stroke-width%3D%272%27%2F%3E%3Cpath%20d%3D%27m11%2023%204%204%208-9%27%20fill%3D%27none%27%20stroke%3D%27%23065f46%27%20stroke-width%3D%273%27%2F%3E%3C%2Fsvg%3E"); }
.admin-page .repair-overview-card.status-cancelled, .admin-page .repair-current-status.cancelled, .admin-page .repair-ticket-mobile-status[data-status="cancelled"] { --repair-stage-graphic:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2036%2036%27%3E%3Ccircle%20cx%3D%2718%27%20cy%3D%2718%27%20r%3D%2714%27%20fill%3D%27%23fee2e2%27%20stroke%3D%27white%27%20stroke-width%3D%272%27%2F%3E%3Cpath%20d%3D%27m12%2012%2012%2012m0-12L12%2024%27%20stroke%3D%27%23dc2626%27%20stroke-width%3D%274%27%20stroke-linecap%3D%27round%27%2F%3E%3C%2Fsvg%3E"); }
.admin-page .repair-overview-card.status-paid, .admin-page .repair-current-status.paid, .admin-page .repair-ticket-mobile-status[data-status="paid"] { --repair-stage-graphic:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2036%2036%27%3E%3Crect%20x%3D%274%27%20y%3D%275%27%20width%3D%2728%27%20height%3D%2721%27%20rx%3D%274%27%20fill%3D%27%23dcfce7%27%20stroke%3D%27white%27%20stroke-width%3D%272%27%2F%3E%3Cpath%20d%3D%27m10%2015%205%205%2011-10%27%20fill%3D%27none%27%20stroke%3D%27%2316a34a%27%20stroke-width%3D%273%27%20stroke-linecap%3D%27round%27%2F%3E%3Cpath%20d%3D%27M18%2026v5M11%2032h14%27%20stroke%3D%27%23f0fdf4%27%20stroke-width%3D%273%27%2F%3E%3C%2Fsvg%3E"); }

.admin-page .repair-overview-card { position:relative; }
.admin-page .repair-overview-card::before {
 content:""; position:absolute; right:36px; top:50%; margin-top:-20px; width:40px; height:40px;
 background:var(--repair-stage-graphic) center/contain no-repeat; pointer-events:none;
 filter:drop-shadow(0 2px 2px #00000026);
}
.admin-page .repair-current-status::before,
.admin-page .is-mobile-ticket-layout .repair-ticket-mobile-status::before {
 background:var(--repair-stage-graphic) center/contain no-repeat;
 -webkit-mask:none; mask:none; border-radius:0; box-shadow:none;
 width:26px; height:26px; flex:0 0 26px;
 filter:drop-shadow(0 1px 2px #00000030);
}
@media(max-width:760px) {
 .admin-page .repair-overview-card::before {
  width:24px; height:28px; right:23px; margin-top:-14px;
 }
}
@media(min-width:761px) {
 .admin-page .repair-current-status::before { height:18px; }
}

/* Shorter mobile workflow controls, with full labels and comfortable tap targets. */
@media(max-width:760px) {
 .admin-page .repair-overview-grid .repair-overview-card {
  padding:5px 7px!important; min-height:44px!important; border-radius:10px!important;
 }
 .admin-page .repair-overview-card .repair-overview-copy { gap:1px!important; }
 .admin-page .repair-overview-card::before {
  width:23px; height:26px; right:22px; margin-top:-13px;
 }
 .admin-page .is-mobile-ticket-layout .repair-ticket-mobile-status {
  height:44px; padding:3px 5px; gap:4px;
  font-size:clamp(14px,3.4vw,17px)!important; line-height:1.15;
 }
 .admin-page .is-mobile-ticket-layout .repair-ticket-mobile-status::before {
  width:25px; height:25px; flex-basis:25px;
 }
}

.history-menu-edit { display:block!important; }
@media(max-width:760px) {
 .admin-page .repair-overview-grid .repair-overview-card { height:46px!important; min-height:44px!important; padding:4px 6px!important; display:block; box-sizing:border-box; }
 .admin-page .repair-overview-card .repair-overview-copy { display:flex; flex-direction:column; width:100%; gap:0!important; }
 .admin-page .repair-overview-card .repair-overview-step { height:12px; box-sizing:border-box; padding-left:19px; padding-right:24px; white-space:nowrap; }
 .admin-page .repair-overview-card .repair-overview-label { white-space:nowrap!important; font-size:clamp(8px,2.3vw,10px)!important; line-height:13px!important; }
 .admin-page .repair-overview-card small { display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; line-height:10px!important; }
 .admin-page .repair-overview-card::before { left:5px; right:auto; top:3px; margin:0; width:17px; height:16px; }
 .admin-page .repair-overview-card > strong { position:absolute; right:6px; top:1px; font-size:22px!important; line-height:1; font-weight:950; text-shadow:0 2px 3px #00000040; }
 .admin-page .history-row-actions > .history-open-button { display:none!important; }
 .history-menu-edit { display:block!important; }
}

/* Repair history actions are consistent on desktop and mobile. */
.admin-page .history-row-actions > .history-open-button { display:none!important; }

/* Override legacy responsive card rules that force the redundant open button visible. */
html body.admin-page.repair-history-view .admin-repairs-table.history-list-table .repair-history-list-row .history-open-button {
 display:none!important;
}
html body.admin-page.repair-history-view .history-action-menu a.history-menu-edit {
 display:flex!important; align-items:center; gap:9px; min-height:42px;
 font-size:14px!important; font-weight:800; color:#1d4ed8;
}
html body.admin-page.repair-history-view .history-action-menu a.history-menu-edit::before {
 content:""; width:22px; height:22px; flex:0 0 22px;
 background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='2' y='2' width='20' height='20' rx='5' fill='%23dbeafe'/%3E%3Cpath d='m6 15 9-9 3 3-9 9-4 1z' fill='%233b82f6' stroke='%231d4ed8' stroke-width='1.3'/%3E%3Cpath d='m13 8 3 3' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E") center/contain no-repeat;
}
@media(max-width:760px) {
 html body.admin-page.repair-history-view .admin-repairs-table.history-list-table .repair-history-list-row { padding-bottom:10px!important; }
}

/* Semantic icons for every history management action; actions and targets unchanged. */
html body.admin-page.repair-history-view .history-action-menu [data-history-navigation="edit"] { --history-action-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%232563eb%27%20stroke-width%3D%271.8%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27m5%2015%2010-10%204%204L9%2019l-5%201zM13%207l4%204%27%2F%3E%3C%2Fsvg%3E"); --history-action-tint:#2563eb; }
html body.admin-page.repair-history-view .history-action-menu [name="quick_confirm_queue"] { --history-action-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%230d9488%27%20stroke-width%3D%271.8%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Crect%20x%3D%273%27%20y%3D%275%27%20width%3D%2718%27%20height%3D%2716%27%20rx%3D%272%27%2F%3E%3Cpath%20d%3D%27M7%203v4m10-4v4M3%2010h18m-13%205%203%203%205-5%27%2F%3E%3C%2Fsvg%3E"); --history-action-tint:#0d9488; }
html body.admin-page.repair-history-view .history-action-menu [data-history-document="repair"] { --history-action-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%230284c7%27%20stroke-width%3D%271.8%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M6%209V3h12v6M6%2017H3V9h18v8h-3M6%2014h12v7H6zM17%2011h1%27%2F%3E%3C%2Fsvg%3E"); --history-action-tint:#0284c7; }
html body.admin-page.repair-history-view .history-action-menu [data-history-copy-repair-link] { --history-action-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%230891b2%27%20stroke-width%3D%271.8%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27m10%2013%204-4m-6%206-2%202a4%204%200%200%201-5-5l4-4a4%204%200%200%201%205%200m4%201%202-2a4%204%200%200%201%205%205l-4%204a4%204%200%200%201-5%200%27%2F%3E%3C%2Fsvg%3E"); --history-action-tint:#0891b2; }
html body.admin-page.repair-history-view .history-action-menu [href^="admin-quotes.php"] { --history-action-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%237c3aed%27%20stroke-width%3D%271.8%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M5%203h10l4%204v14H5zM14%203v5h5M8%2012h8m-8%204h5%27%2F%3E%3C%2Fsvg%3E"); --history-action-tint:#7c3aed; }
html body.admin-page.repair-history-view .history-action-menu [data-history-document="receipt"] { --history-action-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%23059669%27%20stroke-width%3D%271.8%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M5%203h14v18l-3-2-4%202-4-2-3%202zM8%207h8m-8%204h8m-8%204h4%27%2F%3E%3C%2Fsvg%3E"); --history-action-tint:#059669; }
html body.admin-page.repair-history-view .history-action-menu [href^="warranty.php"] { --history-action-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%234f46e5%27%20stroke-width%3D%271.8%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27m12%203%208%203v6c0%205-8%209-8%209s-8-4-8-9V6zM8%2012l3%203%205-6%27%2F%3E%3C%2Fsvg%3E"); --history-action-tint:#4f46e5; }
html body.admin-page.repair-history-view .history-action-menu [data-copy-label="คัดลอกเลขที่ใบซ่อม"] { --history-action-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%23475569%27%20stroke-width%3D%271.8%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Crect%20x%3D%278%27%20y%3D%277%27%20width%3D%2712%27%20height%3D%2714%27%20rx%3D%272%27%2F%3E%3Cpath%20d%3D%27M15%207V3H4v14h4M11%2012h6m-6%204h4%27%2F%3E%3C%2Fsvg%3E"); --history-action-tint:#475569; }
html body.admin-page.repair-history-view .history-action-menu [name="quick_copy_order"] { --history-action-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%232563eb%27%20stroke-width%3D%271.8%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M8%207V3H3v14h5%27%2F%3E%3Crect%20x%3D%278%27%20y%3D%277%27%20width%3D%2712%27%20height%3D%2714%27%20rx%3D%272%27%2F%3E%3Cpath%20d%3D%27M14%2011v6m-3-3h6%27%2F%3E%3C%2Fsvg%3E"); --history-action-tint:#2563eb; }
html body.admin-page.repair-history-view .history-action-menu [data-history-confirm-action="cancel"] { --history-action-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%23d97706%27%20stroke-width%3D%271.8%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Ccircle%20cx%3D%2712%27%20cy%3D%2712%27%20r%3D%279%27%2F%3E%3Cpath%20d%3D%27m6%206%2012%2012%27%2F%3E%3C%2Fsvg%3E"); --history-action-tint:#d97706; }
html body.admin-page.repair-history-view .history-action-menu [data-history-confirm-action="delete"] { --history-action-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%23dc2626%27%20stroke-width%3D%271.8%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M3%206h18M9%206V3h6v3M5%206l1%2015h12l1-15M10%2010v7m4-7v7%27%2F%3E%3C%2Fsvg%3E"); --history-action-tint:#dc2626; }
html body.admin-page.repair-history-view .history-action-menu :is(a,button)[role="menuitem"] {
 display:flex!important; align-items:center; gap:10px; min-height:44px; padding:9px 10px;
 font-size:14px!important; font-weight:700; line-height:1.4; white-space:normal;
}
html body.admin-page.repair-history-view .history-action-menu :is(a,button)[role="menuitem"]::before {
 content:""; display:block; width:30px; height:30px; flex:0 0 30px; border-radius:8px;
 background:var(--history-action-icon) center/22px 22px no-repeat;
 background-color:color-mix(in srgb,var(--history-action-tint,#2563eb) 10%,white);
}
html body.admin-page.repair-history-view .history-action-menu :is(a,button)[role="menuitem"]:focus-visible {
 outline:2px solid #2563eb; outline-offset:-2px;
}
@media(max-width:760px) {
 html body.admin-page.repair-history-view .history-action-menu :is(a,button)[role="menuitem"] { min-height:48px; font-size:15px!important; }
}

/* Consistent left-aligned management rows; compact spacing on phones only. */
html body.admin-page.repair-history-view .history-action-menu :is(a,button)[role="menuitem"] {
 justify-content:flex-start!important; text-align:left!important;
 align-items:center!important; flex-direction:row!important; gap:9px!important;
 margin:0!important; width:100%;
}
html body.admin-page.repair-history-view .history-action-menu form { margin:0!important; padding:0!important; width:100%; }
html body.admin-page.repair-history-view .history-action-menu :is(a,button)[role="menuitem"]::before {
 margin:0!important; align-self:center; box-sizing:border-box;
}
@media(max-width:760px) {
 html body.admin-page.repair-history-view .history-action-menu {
  padding:7px!important; border-radius:14px;
 }
 html body.admin-page.repair-history-view .history-action-menu :is(a,button)[role="menuitem"] {
  min-height:42px!important; padding:6px 9px!important; font-size:14px!important;
  line-height:1.25!important; border-radius:8px;
 }
 html body.admin-page.repair-history-view .history-action-menu :is(a,button)[role="menuitem"]::before {
  width:26px; height:26px; flex-basis:26px; background-size:20px 20px; border-radius:7px;
 }
 html body.admin-page.repair-history-view .history-action-menu .history-menu-divider { margin:4px 0!important; }
}

/* Compact desktop management popup; mobile keeps its existing tap spacing. */
@media(min-width:761px) {
 html body.admin-page.repair-history-view .history-action-menu {
  width:238px!important; max-width:calc(100vw - 20px); padding:6px!important; border-radius:12px;
 }
 html body.admin-page.repair-history-view .history-action-menu :is(a,button)[role="menuitem"] {
  min-height:34px!important; padding:4px 7px!important; gap:8px!important;
  font-size:13px!important; line-height:1.3!important; border-radius:7px;
 }
 html body.admin-page.repair-history-view .history-action-menu :is(a,button)[role="menuitem"]::before {
  width:24px; height:24px; flex-basis:24px; background-size:19px 19px; border-radius:6px;
 }
 html body.admin-page.repair-history-view .history-action-menu .history-menu-divider { margin:3px 0!important; }
}

/* Receipt amounts: zero is neutral; payment state follows the existing repair status. */
html body.admin-page.repair-history-view .history-col-total .history-amount-pill {
 display:inline-flex; flex-direction:column; align-items:center; justify-content:center;
 padding:4px 7px; border:1px solid #e2e8f0; border-radius:8px;
 background:#f1f5f9; color:#64748b; line-height:1.2; max-width:100%; box-sizing:border-box;
}
html body.admin-page.repair-history-view .history-amount-pill .history-receipt-total {
 color:inherit!important; font-variant-numeric:tabular-nums; line-height:1.3;
}
html body.admin-page.repair-history-view .history-amount-pill small {
 display:block; color:inherit; font-size:9px; line-height:1.3; margin-top:2px; white-space:nowrap;
}
html body.admin-page.repair-history-view .history-col-total .history-amount-pill.is-paid { color:#166534; background:#f0fdf4; border-color:#bbf7d0; }
html body.admin-page.repair-history-view .history-col-total .history-amount-pill.is-pending { color:#9a3412; background:#fff7ed; border-color:#fed7aa; }
html body.admin-page.repair-history-view .history-col-total .history-amount-pill.is-amount { color:#1e40af; background:#eff6ff; border-color:#bfdbfe; }

/* Compact history rows, with the customer's call action beside their name on phones. */
@media(min-width:761px) {
 html body.admin-page.repair-history-view .admin-repairs-table.history-list-table .repair-history-list-row { min-height:56px!important; }
 html body.admin-page.repair-history-view .admin-repairs-table.history-list-table .repair-history-list-row > td {
  height:56px!important; padding-top:5px!important; padding-bottom:5px!important; line-height:1.25;
 }
 html body.admin-page.repair-history-view .history-customer-open { min-height:30px!important; padding-top:3px!important; padding-bottom:3px!important; }
}
@media(max-width:760px) {
 html body.admin-page.repair-history-view .admin-repairs-table.history-list-table .repair-history-list-row {
  gap:2px 7px!important; padding:6px 9px 7px!important; margin-bottom:6px!important;
 }
 html body.admin-page.repair-history-view .admin-repairs-table.history-list-table .repair-history-list-row > td {
  padding-top:1px!important; padding-bottom:1px!important;
 }
 html body.admin-page.repair-history-view .admin-repairs-table.history-list-table .repair-history-list-row .history-col-customer {
  display:flex!important; flex-wrap:wrap; align-items:center; gap:4px 6px; padding-top:2px!important;
 }
 html body.admin-page.repair-history-view .history-col-customer > strong { flex:1 1 100px; min-width:0; }
 html body.admin-page.repair-history-view .history-customer-open {
  min-height:36px!important; margin:0!important; padding:4px 6px!important;
  font-size:14px!important; line-height:1.2!important; text-align:left!important;
 }
 html body.admin-page.repair-history-view a.history-customer-phone {
  display:inline-flex!important; align-items:center; justify-content:center; gap:4px;
  flex:0 0 auto; width:auto; max-width:100%; min-height:40px; padding:5px 7px;
  box-sizing:border-box; margin:0; background:#ecfdf5; color:#047857;
  border:1px solid #a7f3d0; border-radius:9px; font-size:12px; font-weight:800;
  text-decoration:none; line-height:1.2;
 }
 html body.admin-page.repair-history-view a.history-customer-phone::before {
  content:""; width:16px; height:16px; flex:0 0 16px;
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23047857' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 3h4l2 5-3 2c2 3 3 4 6 6l2-3 5 2v4c0 2-2 3-4 2C9 19 5 15 3 7c-1-2 0-4 2-4z'/%3E%3C/svg%3E") center/contain no-repeat;
 }
 html body.admin-page.repair-history-view a.history-customer-phone:focus-visible { outline:2px solid #059669; outline-offset:2px; }
 html body.admin-page.repair-history-view .history-col-total .history-amount-pill { padding:2px 6px; }
}
html body.admin-page.repair-history-view .history-amount-pill .history-receipt-total { max-width:none!important; width:auto!important; white-space:nowrap; }
@media(max-width:760px) {
 html body.admin-page.repair-history-view .history-col-customer > strong { flex:1 1 0!important; width:auto!important; min-width:0!important; }
 html body.admin-page.repair-history-view .history-customer-open { width:100%!important; box-sizing:border-box; }
 html body.admin-page.repair-history-view a.history-customer-phone { flex:0 0 auto!important; }
}

/* Phone summary: two compact information rows, with a fixed amount column. */
@media(max-width:760px) {
 html body.admin-page.repair-history-view .admin-repairs-table.history-list-table .repair-history-list-row {
  grid-template-columns:minmax(0,1fr) minmax(0,1fr) 72px!important;
 }
 html body.admin-page.repair-history-view .history-col-customer { grid-column:1/-1!important; }
 html body.admin-page.repair-history-view .history-col-device { grid-column:1!important; grid-row:4!important; }
 html body.admin-page.repair-history-view .history-col-job { grid-column:2!important; grid-row:4!important; }
 html body.admin-page.repair-history-view .history-col-received { grid-column:1!important; grid-row:5!important; }
 html body.admin-page.repair-history-view .history-col-updated { grid-column:2!important; grid-row:5!important; }
 html body.admin-page.repair-history-view .history-col-total {
  grid-column:3!important; grid-row:4/6!important; align-self:center; justify-content:center!important;
  margin:0!important; padding:0!important; min-width:0; border:0!important; background:transparent!important;
 }
 html body.admin-page.repair-history-view .history-col-total::before { display:none!important; }
 html body.admin-page.repair-history-view .history-col-total .history-amount-pill { max-width:100%; padding:2px 4px; }
 html body.admin-page.repair-history-view .history-col-total .history-receipt-total { font-size:12px!important; }
 html body.admin-page.repair-history-view .history-col-total .history-amount-pill small { font-size:8px; }
 html body.admin-page.repair-history-view .history-col-device .history-clamp,
 html body.admin-page.repair-history-view .history-col-job .history-clamp {
  display:block!important; white-space:nowrap!important; overflow:hidden; text-overflow:ellipsis; line-height:18px!important;
 }
 html body.admin-page.repair-history-view :is(.history-col-received,.history-col-updated) { text-align:left!important; overflow:hidden; white-space:nowrap; }
 html body.admin-page.repair-history-view :is(.history-col-received,.history-col-updated)::before { display:none!important; }
 html body.admin-page.repair-history-view :is(.history-col-received,.history-col-updated) time {
  display:block; width:100%!important; white-space:nowrap!important; overflow:hidden; text-overflow:ellipsis; font-size:10px!important; line-height:18px!important;
 }
 html body.admin-page.repair-history-view a.history-customer-phone {
  width:40px!important; height:40px; min-width:40px; flex:0 0 40px!important;
  padding:0!important; font-size:0!important; gap:0!important;
 }
 html body.admin-page.repair-history-view a.history-customer-phone::before { width:21px; height:21px; flex-basis:21px; }
}

/* Remove the duplicate menu heading and share the final action row. */
html body.admin-page.repair-history-view .history-action-menu::before { display:none!important; content:none!important; }
html body.admin-page.repair-history-view .history-action-menu > .history-menu-divider { display:none!important; }
@media(max-width:760px) {
 html body.admin-page.repair-history-view .history-action-menu > form:has([name="quick_cancel_order"]) { grid-column:1!important; }
 html body.admin-page.repair-history-view .history-action-menu > .history-menu-delete { grid-column:2!important; align-self:stretch; }
 html body.admin-page.repair-history-view .history-action-menu:not(:has([name="quick_cancel_order"])) > .history-menu-delete { grid-column:1/-1!important; }
 html body.admin-page.repair-history-view .history-col-received time,
 html body.admin-page.repair-history-view .history-col-updated time {
  border-radius:4px; box-sizing:border-box; padding:0 2px; font-size:9px!important;
  line-height:18px!important; height:18px;
 }
 html body.admin-page.repair-history-view .history-col-received time { color:#1d4ed8; background:#eff6ff; }
 html body.admin-page.repair-history-view .history-col-updated time { color:#047857; background:#ecfdf5; }
 html body.admin-page.repair-history-view .history-col-received time::before { content:"รับงาน "; font-weight:800; }
 html body.admin-page.repair-history-view .history-col-updated time::before { content:"อัปเดต "; font-weight:800; }
}

/* Phone history: a subtle receipt-to-update timeline within the same date row. */
@media(max-width:760px) {
 html body.admin-page.repair-history-view .history-customer-open {
  font-size:16px!important; font-weight:900!important; line-height:1.2!important;
  color:#0f2f4f!important;
 }
 html body.admin-page.repair-history-view :is(.history-col-received,.history-col-updated) time {
  position:relative; border-top:2px solid transparent; border-radius:0 0 4px 4px;
  padding-top:0; line-height:16px!important; height:18px;
 }
 html body.admin-page.repair-history-view .history-col-received time {
  border-top-color:#60a5fa; background:linear-gradient(90deg,#dbeafe,#eff6ff);
 }
 html body.admin-page.repair-history-view .history-col-updated time {
  border-top-color:#34d399; background:linear-gradient(90deg,#d1fae5,#ecfdf5);
  animation:historyUpdateTimelineGlow 2.4s ease-in-out infinite;
 }
 html body.admin-page.repair-history-view :is(.history-col-received,.history-col-updated) time::after {
  content:""; position:absolute; left:0; top:0; width:4px; height:4px;
  border-radius:50%; background:currentColor; box-shadow:0 0 4px currentColor;
 }
 @keyframes historyUpdateTimelineGlow {
  0%,100% { border-top-color:#34d399; }
  50% { border-top-color:#059669; box-shadow:inset 0 2px 4px #10b98126; }
 }
}
@media(prefers-reduced-motion:reduce) {
 html body.admin-page.repair-history-view .history-col-updated time { animation:none!important; }
}

/* Balanced two-line mobile timeline, with labels above complete timestamps. */
@media(max-width:760px) {
 html body.admin-page.repair-history-view .history-col-device .history-clamp,
 html body.admin-page.repair-history-view .history-col-job .history-clamp { line-height:12px!important; font-size:11px; }
 html body.admin-page.repair-history-view :is(.history-col-received,.history-col-updated) time {
  height:24px!important; line-height:12px!important; font-size:9px!important;
  border-top-width:1px; overflow:visible!important; text-overflow:clip; padding:0 1px;
  letter-spacing:-.15px; font-variant-numeric:tabular-nums;
 }
 html body.admin-page.repair-history-view :is(.history-col-received,.history-col-updated) time::before {
  display:block; height:10px; line-height:10px; font-size:9px; letter-spacing:0;
 }
 html body.admin-page.repair-history-view .history-col-received time::before { content:"รับงาน"; }
 html body.admin-page.repair-history-view .history-col-updated time::before { content:"อัปเดตล่าสุด"; }
 html body.admin-page.repair-history-view .repair-history-head {
  min-height:0!important; padding:0 0 7px!important; margin:0 0 8px!important;
 }
 html body.admin-page.repair-history-view .repair-history-head h2 {
  display:flex; align-items:center; gap:7px; font-size:18px!important; line-height:28px; margin:0!important;
 }
 html body.admin-page.repair-history-view .repair-history-head h2::before {
  content:""; flex:0 0 28px; width:28px; height:28px; border-radius:8px;
  background:#e0f2fe url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230284c7' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6v5h5M4 11a8 8 0 1 1 1 7M12 7v5l3 2'/%3E%3C/svg%3E") center/22px no-repeat;
 }
 html body.admin-page.repair-history-view .history-status-picker-menu { gap:3px; padding:6px; border-radius:12px; box-sizing:border-box; }
 html body.admin-page.repair-history-view .history-status-option {
  min-height:40px!important; padding:5px 7px!important; font-size:13px!important;
  gap:7px; grid-template-columns:24px minmax(0,1fr) 18px; border-radius:8px!important;
 }
 html body.admin-page.repair-history-view .history-status-option-icon { width:24px; height:24px; font-size:16px; }
}

/* Mobile timeline uses meaningful graphics instead of duplicate date labels. */
@media(max-width:760px) {
 html body.admin-page.repair-history-view :is(.history-col-received,.history-col-updated) time {
  display:flex!important; align-items:center; gap:3px; padding:0!important;
  height:24px!important; line-height:24px!important; font-size:9px!important;
  white-space:nowrap!important; letter-spacing:-.2px;
 }
 html body.admin-page.repair-history-view :is(.history-col-received,.history-col-updated) time::before {
  content:""!important; display:block; flex:0 0 18px; width:18px; height:22px;
  background:var(--history-date-graphic) center/contain no-repeat;
 }
 html body.admin-page.repair-history-view :is(.history-col-received,.history-col-updated) time::after { display:none!important; }
 html body.admin-page.repair-history-view .history-col-received time { --history-date-graphic:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2036%2036%27%3E%3Crect%20x%3D%273%27%20y%3D%274%27%20width%3D%2722%27%20height%3D%2716%27%20rx%3D%273%27%20fill%3D%27%23dbeafe%27%20stroke%3D%27%232563eb%27%20stroke-width%3D%271.7%27%2F%3E%3Cpath%20d%3D%27M1%2023h26l-3%205H4z%27%20fill%3D%27%2364748b%27%2F%3E%3Ccircle%20cx%3D%2724%27%20cy%3D%2710%27%20r%3D%278%27%20fill%3D%27%232563eb%27%20stroke%3D%27white%27%20stroke-width%3D%271.5%27%2F%3E%3Cpath%20d%3D%27M24%205v9m-3-3%203%203%203-3%27%20fill%3D%27none%27%20stroke%3D%27white%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%2F%3E%3C%2Fsvg%3E"); }
 html body.admin-page.repair-history-view .history-col-updated time { --history-date-graphic:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2036%2036%27%3E%3Crect%20x%3D%274%27%20y%3D%273%27%20width%3D%2721%27%20height%3D%2727%27%20rx%3D%274%27%20fill%3D%27%23d1fae5%27%20stroke%3D%27%23059669%27%20stroke-width%3D%271.5%27%2F%3E%3Cpath%20d%3D%27M9%209h10m-10%205h7m-7%205h5%27%20stroke%3D%27%23059669%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%2F%3E%3Ccircle%20cx%3D%2724%27%20cy%3D%2723%27%20r%3D%279%27%20fill%3D%27%23059669%27%20stroke%3D%27white%27%20stroke-width%3D%271.5%27%2F%3E%3Cpath%20d%3D%27M20%2023a4%204%200%201%201%202%204m-2-4v-4m0%204h4%27%20fill%3D%27none%27%20stroke%3D%27white%27%20stroke-width%3D%271.6%27%20stroke-linecap%3D%27round%27%2F%3E%3C%2Fsvg%3E"); }
 html body.admin-page.repair-history-view .repair-history-head h2 { font-size:22px!important; font-weight:900; line-height:32px; gap:8px; }
 html body.admin-page.repair-history-view .repair-history-head h2::before {
  width:32px; height:32px; flex-basis:32px; border-radius:0;
  background:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2036%2036%27%3E%3Crect%20x%3D%275%27%20y%3D%272%27%20width%3D%2722%27%20height%3D%2729%27%20rx%3D%274%27%20fill%3D%27%23dbeafe%27%20stroke%3D%27%232563eb%27%20stroke-width%3D%271.5%27%2F%3E%3Cpath%20d%3D%27M10%209h12m-12%205h9m-9%205h6%27%20stroke%3D%27%233b82f6%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%2F%3E%3Ccircle%20cx%3D%2725%27%20cy%3D%2724%27%20r%3D%279%27%20fill%3D%27%230ea5e9%27%20stroke%3D%27white%27%20stroke-width%3D%272%27%2F%3E%3Cpath%20d%3D%27M25%2019v5l3%202%27%20fill%3D%27none%27%20stroke%3D%27white%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%2F%3E%3C%2Fsvg%3E") center/contain no-repeat;
 }
}
