:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #edf3fa;
  --surface-dark: #16324f;
  --line: #d7e2ee;
  --line-strong: #8ea9c4;
  --text: #1e293b;
  --muted: #64748b;
  --orange: #4f7cac;
  --orange-deep: #24476b;
  --orange-soft: #e8f1fb;
  --danger: #b91c1c;
  --success: #166534;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

body {
  margin: 0;
  font-family: Tahoma, Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(79, 124, 172, 0.12), transparent 30%),
    linear-gradient(180deg, #f8fbff 0%, #eef4fa 100%);
  color: var(--text);
}

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

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

@keyframes logoFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-2px);
  }
}

a {
  color: var(--orange-deep);
  text-decoration: none;
}

.container {
  width: 92%;
  max-width: 1120px;
  margin: 0 auto;
}

img {
  max-width: 100%;
  height: auto;
}

.nav {
  background:
    linear-gradient(120deg, rgba(255,255,255,0.04), rgba(255,255,255,0) 28%),
    linear-gradient(180deg, rgba(22, 50, 79, 0.98) 0%, rgba(31, 66, 104, 0.98) 100%);
  background-size: 200% 200%, 100% 100%;
  color: #fff;
  border-bottom: 3px solid var(--orange);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16);
  animation: navGlowShift 14s ease-in-out infinite;
}

.nav .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-logo {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  object-fit: contain;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 6px;
  box-sizing: border-box;
  transition: transform 0.28s ease, box-shadow 0.28s ease;
  animation: logoFloat 5.6s ease-in-out infinite;
}

.brand-logo-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--surface-dark);
  font-size: 12px;
  font-weight: bold;
}

.brand-meta {
  min-width: 0;
}

.brand-name {
  font-size: 22px;
  font-weight: bold;
  letter-spacing: 0.4px;
  line-height: 1.05;
}

.brand-address {
  margin-top: 4px;
  color: #dbeafe;
  font-size: 12px;
  line-height: 1.2;
}

.menu a {
  color: #eff6ff;
  margin-right: 14px;
  padding: 8px 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: background 0.24s ease, color 0.24s ease, transform 0.24s ease;
}

.menu a:after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 4px;
  height: 2px;
  border-radius: 999px;
  background: rgba(191, 219, 254, 0.85);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.24s ease;
}

.menu a:hover {
  background: rgba(148, 184, 224, 0.18);
  color: #fff;
  transform: translateY(-1px);
}

.menu a:hover:after,
.menu a:focus-visible:after {
  transform: scaleX(1);
}

.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.subnav a {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text);
  font-weight: bold;
  border: 1px solid var(--line);
}

.subnav a.active {
  background: linear-gradient(135deg, var(--orange) 0%, var(--orange-deep) 100%);
  color: #fff;
  border-color: transparent;
}

.menu-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--surface-dark);
  color: #fff;
  font-size: 11px;
  font-weight: bold;
}

.status-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 16px;
}

.status-filters a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text);
  border: 1px solid var(--line);
  font-weight: bold;
}

.status-filters a.active {
  background: linear-gradient(135deg, var(--orange) 0%, var(--orange-deep) 100%);
  color: #fff;
  border-color: transparent;
}

.status-filters a .menu-badge {
  margin-left: 8px;
}

.hero, .panel {
  background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(245,249,253,0.98) 100%);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 26px;
  margin: 24px 0;
  border: 1px solid rgba(142, 169, 196, 0.24);
  animation: softFadeUp 0.5s ease both;
  transition: transform 0.26s ease, box-shadow 0.26s ease, border-color 0.26s ease;
}

.hero-grid, .grid-2, .grid-3, .grid-4, .stats {
  display: grid;
  gap: 18px;
}

.form-panel form > * + * {
  margin-top: 18px;
}

.hero-grid {
  grid-template-columns: 2fr 1fr;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3, .stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.hero {
  position: relative;
  overflow: hidden;
}

.hero:before {
  content: "";
  position: absolute;
  right: -70px;
  top: -70px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(79, 124, 172, 0.18) 0%, rgba(79, 124, 172, 0) 70%);
}

.hero h1 {
  margin: 0 0 12px;
  font-size: 40px;
  line-height: 1.12;
  color: var(--text);
  max-width: 680px;
}

.hero-kicker {
  display: inline-block;
  margin-bottom: 14px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--surface-dark);
  color: #eff6ff;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 1.2px;
}

.card {
  background: linear-gradient(180deg, #ffffff 0%, #f5f9fd 100%);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

.field-note {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}

.checkbox-line {
  margin: 12px 0 0;
  line-height: 1.65;
}

.compact-actions {
  margin-top: 10px;
}

.compact-actions .btn {
  padding: 10px 16px;
}

.choice-card {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 54px;
}

.choice-card input {
  flex: 0 0 auto;
}

.signature-box {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #f8fbff;
  overflow: hidden;
}

#signaturePad {
  display: block;
  width: 100%;
  height: 220px;
  touch-action: none;
}

.summary-section {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  background: linear-gradient(180deg, #f8fbff 0%, #edf4fb 100%);
}

.section-title {
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: var(--orange-deep);
}

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

.summary-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 82px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(142, 169, 196, 0.28);
}

.summary-card strong {
  color: var(--orange-deep);
  font-size: 13px;
}

.summary-card span {
  color: var(--text);
  line-height: 1.55;
  word-break: break-word;
}

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

.submit-actions {
  justify-content: center;
}

.compact-grid {
  gap: 14px;
}

.stat-card {
  background: linear-gradient(180deg, #ffffff 0%, #f2f7fc 100%);
}

.stat-card strong {
  display: block;
  margin-bottom: 8px;
}

.money {
  font-size: 28px;
  font-weight: bold;
  color: #111111;
}

.stat-card.profit .money {
  color: #166534;
}

.stat-card.loss .money {
  color: #b91c1c;
}

.financial-lines {
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}

.dashboard-hero-main,
.dashboard-hero-side {
  position: relative;
  overflow: hidden;
}

.dashboard-hero-main {
  background:
    radial-gradient(circle at top right, rgba(148, 184, 224, 0.30), transparent 34%),
    linear-gradient(135deg, #f2f8fe 0%, #ffffff 52%, #edf4fb 100%);
}

.dashboard-hero-main:after {
  content: "";
  position: absolute;
  right: -64px;
  bottom: -64px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(15, 23, 42, 0.10), rgba(15, 23, 42, 0));
}

.dashboard-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(79, 124, 172, 0.10);
  color: var(--orange-deep);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dashboard-hero-main h2 {
  margin: 14px 0 8px;
  font-size: 32px;
  line-height: 1.15;
}

.dashboard-pill-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.dashboard-pill {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(251, 146, 60, 0.20);
  background: rgba(255, 255, 255, 0.84);
}

.dashboard-pill span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-pill strong {
  display: block;
  margin-top: 6px;
  font-size: 26px;
  color: var(--text);
}

.dashboard-hero-side {
  display: flex;
  align-items: stretch;
  background: linear-gradient(180deg, #16324f 0%, #24476b 100%);
  color: #fff;
}

.dashboard-ring-card {
  width: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: 24px;
  background:
    radial-gradient(circle at center, rgba(148, 184, 224, 0.28) 0%, rgba(148, 184, 224, 0.10) 34%, transparent 35%),
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
}

.ring-label {
  font-size: 13px;
  color: rgba(255,255,255,0.75);
}

.ring-value {
  margin-top: 12px;
  font-size: 42px;
  font-weight: 800;
  color: #fff7ed;
}

.ring-note {
  margin-top: 6px;
  color: rgba(255,255,255,0.72);
  font-size: 13px;
}

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.metric-card {
  position: relative;
  overflow: hidden;
  padding: 20px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f5f9fd 100%);
  box-shadow: 0 16px 28px rgba(15, 23, 42, 0.06);
}

.metric-card:after {
  content: "";
  position: absolute;
  right: -24px;
  top: -24px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(79, 124, 172, 0.18) 0%, rgba(79, 124, 172, 0) 70%);
}

.metric-amber {
  background: linear-gradient(135deg, #edf4fb 0%, #ffffff 100%);
}

.metric-dark {
  background: linear-gradient(135deg, #16324f 0%, #24476b 100%);
  color: #fff;
}

.metric-dark .metric-title,
.metric-dark .metric-foot,
.metric-dark .metric-value {
  color: #fff;
}

.metric-soft {
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.metric-title {
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-size: 13px;
}

.metric-value {
  position: relative;
  z-index: 1;
  margin-top: 10px;
  font-size: 30px;
  font-weight: 800;
  color: var(--text);
}

.metric-foot {
  position: relative;
  z-index: 1;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.chart-card {
  padding: 18px;
}

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

.chart-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 16px;
}

.chart-head h3 {
  margin: 0;
}

.chart-stack {
  display: grid;
  gap: 12px;
}

.chart-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) 50px;
  gap: 10px;
  align-items: center;
}

.chart-label,
.chart-value {
  font-size: 13px;
}

.chart-value {
  text-align: right;
  font-weight: bold;
}

.chart-bar-wrap {
  height: 12px;
  border-radius: 999px;
  background: #dde8f4;
  overflow: hidden;
}

.chart-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--orange) 0%, var(--orange-deep) 100%);
}

.monthly-chart {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
  min-height: 280px;
  margin-top: 16px;
}

.monthly-col {
  display: grid;
  gap: 10px;
  align-items: end;
  justify-items: center;
}

.monthly-top {
  font-size: 12px;
  font-weight: 700;
  color: var(--orange-deep);
}

.monthly-bar-track {
  width: 100%;
  height: 190px;
  display: flex;
  align-items: flex-end;
  padding: 8px;
  box-sizing: border-box;
  border-radius: 18px;
  background: linear-gradient(180deg, #f3f8fd 0%, #e3edf7 100%);
  border: 1px solid #d0ddec;
}

.monthly-bar-fill {
  width: 100%;
  min-height: 16px;
  border-radius: 14px;
  background: linear-gradient(180deg, #5b8fc2 0%, #24476b 100%);
  box-shadow: 0 10px 20px rgba(36, 71, 107, 0.22);
}

.monthly-label {
  font-weight: 700;
  color: var(--text);
}

.monthly-sub {
  font-size: 12px;
  color: var(--muted);
}

.status-pending { background: linear-gradient(135deg, #fdba74 0%, #f97316 100%); }
.status-confirmed { background: linear-gradient(135deg, #fb923c 0%, #ea580c 100%); }
.status-repairing { background: linear-gradient(135deg, #f97316 0%, #c2410c 100%); }
.status-completed { background: linear-gradient(135deg, #34d399 0%, #059669 100%); }
.status-delivered { background: linear-gradient(135deg, #78716c 0%, #292524 100%); }
.status-payment_pending { background: linear-gradient(135deg, #facc15 0%, #ca8a04 100%); }
.status-paid { background: linear-gradient(135deg, #22c55e 0%, #15803d 100%); }
.service-onsite { background: linear-gradient(135deg, #fb923c 0%, #ea580c 100%); }
.service-online { background: linear-gradient(135deg, #1f2937 0%, #111827 100%); }

.mini-note {
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.mini-table table {
  min-width: 100%;
}

.summary-list {
  display: grid;
  gap: 10px;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 159, 67, 0.2);
}

.summary-line strong {
  color: var(--orange-deep);
}

.warranty-preview-card {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.warranty-preview-inner {
  width: 170px;
  min-height: 236px;
  border: 1px solid #111111;
  border-radius: 18px;
  background: linear-gradient(180deg, #fffdfb 0%, #fff2e2 100%);
  padding: 18px 14px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 16px 30px rgba(17, 17, 17, 0.08);
}

.warranty-preview-title {
  font-size: 24px;
  font-weight: bold;
  line-height: 1;
  margin-bottom: 10px;
}

.warranty-preview-sub {
  font-size: 13px;
  line-height: 1.3;
}

.warranty-preview-bar {
  width: 100%;
  height: 74px;
  margin: 16px 0 12px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background:
    repeating-linear-gradient(
      90deg,
      #111111 0,
      #111111 2px,
      #ffffff 2px,
      #ffffff 5px,
      #111111 5px,
      #111111 9px,
      #ffffff 9px,
      #ffffff 12px
    );
}

.warranty-preview-code {
  font-size: 26px;
  font-weight: bold;
  letter-spacing: 3px;
}

.warranty-code-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 128px;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--surface-dark);
  color: #ffffff;
  font-size: 18px;
  font-weight: bold;
  letter-spacing: 3px;
}

.info-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #f5f9fd 0%, #edf4fb 100%);
}

.input, textarea, select {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #cfdae7;
  background: rgba(255, 255, 255, 0.96);
  margin-top: 6px;
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 4px rgba(79, 124, 172, 0.14);
  background: #fff;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

.btn {
  display: inline-block;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  background: linear-gradient(135deg, var(--orange) 0%, var(--orange-deep) 100%);
  color: #fff;
  cursor: pointer;
  font-weight: bold;
  box-shadow: 0 12px 24px rgba(36, 71, 107, 0.18);
  transition: transform 0.22s ease, box-shadow 0.22s ease, filter 0.22s ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 16px 28px rgba(36, 71, 107, 0.2);
  filter: saturate(1.03);
}

.btn.secondary {
  background: var(--surface-dark);
  box-shadow: 0 12px 24px rgba(22, 50, 79, 0.18);
}

.btn.danger {
  background: var(--danger);
  box-shadow: none;
}

.btn.light {
  background: var(--surface-soft);
  color: var(--text);
  box-shadow: none;
  border: 1px solid var(--line);
}

.btn.accent {
  background: linear-gradient(135deg, #16324f 0%, #24476b 100%);
  box-shadow: none;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
  align-items: center;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 16px;
}

.panel:hover,
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 36px rgba(15, 23, 42, 0.1);
  border-color: rgba(142, 169, 196, 0.34);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

th, td {
  padding: 12px;
  border-bottom: 1px solid #f1d3b4;
  text-align: left;
  vertical-align: top;
}

.repair-main {
  display: grid;
  gap: 5px;
  line-height: 1.45;
}

.repair-status-cell {
  display: grid;
  gap: 10px;
  min-width: 180px;
}

.status-panel {
  padding: 12px;
  border-radius: 18px;
  border: 1px solid transparent;
}

.status-panel.pending { background: linear-gradient(180deg, #fff7ed 0%, #ffedd5 100%); border-color: #fdba74; }
.status-panel.confirmed { background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%); border-color: #93c5fd; }
.status-panel.repairing { background: linear-gradient(180deg, #faf5ff 0%, #ede9fe 100%); border-color: #c4b5fd; }
.status-panel.completed { background: linear-gradient(180deg, #f0fdf4 0%, #dcfce7 100%); border-color: #86efac; }
.status-panel.delivered { background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%); border-color: #cbd5e1; }
.status-panel.payment_pending { background: linear-gradient(180deg, #fefce8 0%, #fef3c7 100%); border-color: #facc15; }
.status-panel.paid { background: linear-gradient(180deg, #f0fdf4 0%, #dcfce7 100%); border-color: #4ade80; }
.status-panel.cancelled { background: linear-gradient(180deg, #fff1f2 0%, #ffe4e6 100%); border-color: #fda4af; }

.quick-inline-form,
.quick-status-form {
  display: grid;
  gap: 8px;
}

.quick-inline-form .btn,
.quick-status-form .btn,
.quick-status-form .input {
  width: 100%;
  box-sizing: border-box;
  text-align: center;
}

.quick-status-form {
  padding: 10px;
  border-radius: 16px;
  background: #f5f9fd;
  border: 1px solid #d7e2ee;
}

.auto-submit-status {
  display: none;
}

th {
  color: var(--text);
  background: #eef4fb;
}

.badge {
  display: inline-block;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: bold;
  border: 1px solid transparent;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.pending { background: linear-gradient(135deg, #fff7ed 0%, #fdba74 100%); color: #9a3412; border-color: #fb923c; box-shadow: 0 10px 20px rgba(249, 115, 22, 0.18); }
.confirmed { background: linear-gradient(135deg, #eff6ff 0%, #93c5fd 100%); color: #1d4ed8; border-color: #60a5fa; box-shadow: 0 10px 20px rgba(59, 130, 246, 0.16); }
.repairing { background: linear-gradient(135deg, #faf5ff 0%, #c4b5fd 100%); color: #6d28d9; border-color: #8b5cf6; box-shadow: 0 10px 20px rgba(139, 92, 246, 0.16); }
.completed { background: linear-gradient(135deg, #f0fdf4 0%, #86efac 100%); color: #166534; border-color: #4ade80; box-shadow: 0 10px 20px rgba(34, 197, 94, 0.16); }
.delivered { background: linear-gradient(135deg, #f8fafc 0%, #cbd5e1 100%); color: #0f172a; border-color: #94a3b8; box-shadow: 0 10px 20px rgba(100, 116, 139, 0.18); }
.payment_pending { background: linear-gradient(135deg, #fef9c3 0%, #fde68a 100%); color: #854d0e; border-color: #facc15; box-shadow: 0 10px 20px rgba(234, 179, 8, 0.18); }
.paid { background: linear-gradient(135deg, #dcfce7 0%, #86efac 100%); color: #166534; border-color: #22c55e; box-shadow: 0 10px 20px rgba(34, 197, 94, 0.18); }
.backup-ok { background: #dcfce7; color: #166534; }
.backup-alert { background: #fee2e2; color: #991b1b; }
.backup-neutral { background: #ffedd5; color: #9a3412; }

.flash {
  padding: 14px 16px;
  border-radius: 16px;
  margin: 18px 0;
  border: 1px solid transparent;
}

.flash.success {
  background: #ecfdf5;
  color: var(--success);
  border-color: #bbf7d0;
}

.flash.error {
  background: #fff1f2;
  color: #991b1b;
  border-color: #fecdd3;
}

.warning-soft {
  background: #eef5fd;
  color: #24476b;
  border-color: #a8bfd8;
}

.muted {
  color: var(--muted);
}

.warning {
  background: linear-gradient(180deg, #fff1f2 0%, #ffe4e6 100%);
  border: 2px solid #ef4444;
  border-radius: 18px;
  padding: 16px;
  color: #9f1239;
  box-shadow: 0 16px 32px rgba(239, 68, 68, 0.14);
}

.warning strong {
  display: inline-block;
  color: #881337;
  font-size: 18px;
  margin-bottom: 6px;
}

.footer {
  text-align: center;
  padding: 24px 0 36px;
  color: var(--muted);
}

.container > .panel:first-of-type .subnav a[href="admin.php"] {
  display: none;
}

.edit-order-panel {
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(142, 169, 196, 0.28);
  background:
    radial-gradient(circle at top right, rgba(148, 184, 224, 0.18), transparent 28%),
    linear-gradient(180deg, #f9fbfe 0%, #ffffff 100%);
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.08);
}

.edit-order-hero {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  gap: 18px;
  padding: 24px 26px 18px;
  border-bottom: 1px solid rgba(142, 169, 196, 0.18);
  background:
    linear-gradient(135deg, rgba(242, 248, 254, 0.98) 0%, rgba(255, 255, 255, 0.98) 58%),
    linear-gradient(120deg, rgba(148, 184, 224, 0.10), rgba(15, 23, 42, 0.04));
}

.edit-order-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(142, 169, 196, 0.24);
  background: rgba(255, 255, 255, 0.9);
  color: var(--orange-deep);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.edit-order-hero h2 {
  margin: 8px 0 10px;
  color: #111827;
  font-size: 30px;
  line-height: 1.15;
}

.edit-order-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.edit-summary-chip {
  padding: 16px 16px 14px;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: linear-gradient(180deg, #ffffff 0%, #f4f9fd 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.edit-summary-chip span {
  display: block;
  color: #6b7280;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.edit-summary-chip strong {
  display: block;
  margin-top: 6px;
  color: #111827;
  font-size: 18px;
  line-height: 1.35;
}

.edit-order-form {
  padding: 22px 26px 26px;
}

.edit-section {
  margin-bottom: 20px;
  padding: 20px;
  border-radius: 24px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(249, 250, 251, 0.98) 100%);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.05);
}

.edit-section-head {
  margin-bottom: 16px;
}

.edit-section-head h3 {
  margin: 0 0 4px;
  color: #111827;
  font-size: 20px;
}

.edit-section-head p {
  margin: 0;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.6;
}

.edit-group {
  margin-top: 24px;
  padding: 18px;
  border: 1px solid rgba(251, 146, 60, 0.18);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96) 0%, rgba(255,247,237,0.9) 100%);
}

.edit-group:first-of-type {
  margin-top: 0;
}

.edit-group-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.edit-group-head h3 {
  margin: 0;
  font-size: 20px;
  color: #111827;
}

.edit-group-head p {
  margin: 8px 0 0;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.6;
  max-width: 680px;
}

.edit-group-badge {
  padding: 8px 12px;
  border-radius: 999px;
  background: #111827;
  color: #fff7ed;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.edit-card-grid,
.edit-card-grid-2,
.edit-card-grid-3 {
  display: grid;
  gap: 16px;
}

.edit-card-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.edit-card-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.edit-card {
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(251, 146, 60, 0.14);
  background: linear-gradient(180deg, #ffffff 0%, #fffbf5 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.edit-card-backup-alert {
  border-color: rgba(220, 38, 38, 0.45);
  background: linear-gradient(180deg, #fff5f5 0%, #fee2e2 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82), 0 0 0 1px rgba(220, 38, 38, 0.08);
}

.edit-card-backup-alert label {
  color: #991b1b;
}

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

.edit-card label {
  display: block;
  margin-bottom: 8px;
  color: #1f2937;
  font-size: 13px;
  font-weight: 800;
}

.edit-card .input,
.edit-card textarea,
.edit-card select {
  width: 100%;
  box-sizing: border-box;
}

.edit-card textarea {
  min-height: 104px;
  resize: vertical;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(251, 146, 60, 0.18);
  background: rgba(255, 247, 237, 0.9);
  color: #1f2937;
  font-size: 14px;
  font-weight: 700;
}

.check-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--orange-deep);
}

.edit-card-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.edit-card-actions .btn {
  min-width: 132px;
  text-align: center;
}

.symptom-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.symptom-tag {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(249, 115, 22, 0.12);
  border: 1px solid rgba(249, 115, 22, 0.18);
  color: #9a3412;
  font-size: 13px;
  font-weight: 700;
}

.upload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.upload-card {
  display: block;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(251, 146, 60, 0.18);
  background: #fff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.upload-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
  background: #fff7ed;
}

.upload-card span {
  display: block;
  padding: 10px 12px;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.4;
}

.edit-order-actions {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding-top: 12px;
}

.edit-order-actions .btn {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  padding: 10px 12px;
  font-size: 14px;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 860px) {
  .container {
    width: min(94%, 100%);
  }

  .nav .container {
    gap: 14px;
    padding: 14px 0;
    align-items: stretch;
  }

  .brand {
    width: 100%;
    text-align: center;
    font-size: 20px;
  }

  .menu {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .menu a {
    margin-right: 0;
    width: 100%;
    padding: 11px 10px;
  }

  .hero-grid, .grid-2, .grid-3, .grid-4, .stats, .info-strip {
    grid-template-columns: 1fr;
  }

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

  .dashboard-hero,
  .dashboard-metrics,
  .dashboard-pill-row {
    grid-template-columns: 1fr;
  }

  .monthly-chart {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero,
  .panel {
    padding: 20px 16px;
    margin: 18px 0;
    border-radius: 18px;
  }

  .hero h1 {
    font-size: 30px;
  }

  h1 {
    font-size: 28px;
    line-height: 1.2;
  }

  h2 {
    font-size: 22px;
    line-height: 1.25;
  }

  .actions {
    flex-direction: column;
    align-items: stretch;
  }

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

  .actions .btn,
  .actions .input,
  .actions input,
  .actions select,
  .actions button {
    width: 100%;
    max-width: 100% !important;
    box-sizing: border-box;
    text-align: center;
  }

  .subnav {
    display: grid;
    grid-template-columns: 1fr;
  }

  .brand {
    align-items: flex-start;
  }

  .brand-logo {
    width: 50px;
    height: 50px;
  }

  .brand-name {
    font-size: 18px;
  }

  .brand-address {
    font-size: 11px;
  }

  .subnav a {
    text-align: center;
  }

  .status-filters {
    display: grid;
    grid-template-columns: 1fr;
  }

  .status-filters a {
    width: 100%;
    box-sizing: border-box;
  }

  .edit-order-hero,
  .edit-order-summary,
  .edit-card-grid-2,
  .edit-card-grid-3 {
    grid-template-columns: 1fr;
  }

  .edit-order-hero {
    padding: 22px 18px 16px;
  }

  .edit-order-form {
    padding: 18px;
  }

  .edit-section {
    padding: 16px;
    border-radius: 20px;
  }

  th,
  td {
    padding: 10px;
    font-size: 14px;
  }

  .badge {
    max-width: 100%;
    text-align: center;
    white-space: normal;
  }

  .money {
    font-size: 24px;
  }

  .financial-lines {
    font-size: 12px;
    line-height: 1.5;
  }

  .table-wrap {
    margin: 0 -4px;
    padding-bottom: 4px;
  }

  table {
    min-width: 620px;
  }

  .warning {
    padding: 14px;
  }

  .choice-card {
    min-height: auto;
  }

  .chart-head,
  .summary-line {
    flex-direction: column;
    align-items: flex-start;
  }

  .chart-row {
    grid-template-columns: 1fr;
  }

  .chart-value {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 15px;
  }

  .brand {
    font-size: 18px;
  }

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

  .hero h1 {
    font-size: 25px;
  }

  h1 {
    font-size: 24px;
  }

  h2 {
    font-size: 20px;
  }

  .hero-kicker {
    font-size: 11px;
    letter-spacing: 0.8px;
  }

  .btn {
    padding: 12px 16px;
  }

  .input,
  textarea,
  select {
    padding: 11px 12px;
    border-radius: 12px;
  }

  .card,
  .warning,
  .info-strip,
  .summary-section,
  .signature-box {
    border-radius: 14px;
  }

  th,
  td {
    font-size: 13px;
  }

  table {
    min-width: 560px;
  }

  .dashboard-hero-main h2 {
    font-size: 25px;
  }

  .metric-value,
  .ring-value {
    font-size: 28px;
  }

  .monthly-chart {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .edit-order-kicker {
    font-size: 11px;
    letter-spacing: 0.05em;
  }

  .edit-order-hero h2 {
    font-size: 24px;
  }

  .edit-section-head h3 {
    font-size: 18px;
  }

  .edit-card,
  .edit-summary-chip {
    padding: 14px;
  }

  .edit-order-actions {
    align-items: stretch;
  }

  .edit-card-actions {
    justify-content: stretch;
  }

  .edit-card-actions .btn {
    width: 100%;
  }

  .edit-order-actions .btn {
    width: 100%;
  }

  .monthly-bar-track {
    height: 140px;
  }

  #signaturePad {
    height: 180px;
  }
}
