@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ─── DESIGN TOKENS ─────────────────────────────────────────── */
:root {
  --bg-base:    #0b0f1a;
  --bg-card:    #131929;
  --bg-card2:   #1a2235;
  --bg-input:   #0e1422;
  --border:     rgba(255,255,255,0.07);
  --border2:    rgba(255,255,255,0.12);

  --accent:     #f59e0b;
  --accent-d:   #d97706;
  --accent-glow:rgba(245,158,11,0.25);

  --green:      #10b981;
  --green-d:    #059669;
  --blue:       #3b82f6;
  --blue-d:     #2563eb;
  --red:        #ef4444;
  --purple:     #8b5cf6;

  --text-1:     #f1f5f9;
  --text-2:     #94a3b8;
  --text-3:     #475569;

  --radius-sm:  8px;
  --radius:     12px;
  --radius-lg:  18px;
  --radius-xl:  24px;

  --shadow:     0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg:  0 8px 48px rgba(0,0,0,0.6);

  --sidebar-w:  260px;
  --header-h:   60px;
  --transition: 0.22s cubic-bezier(0.4,0,0.2,1);
}

/* ─── RESET ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-tap-highlight-color: transparent; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-base);
  color: var(--text-1);
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, select, textarea { font-family: inherit; }
img { max-width: 100%; }

/* ─── SCROLLBAR ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 99px; }

/* ─── LAYOUT ─────────────────────────────────────────────────── */
.app-wrapper { display: flex; min-height: 100vh; }

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  transform: translateX(0);
  transition: transform var(--transition);
}
.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo h1 {
  font-size: 1.1rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), #fb923c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.3px;
}
.sidebar-logo p { font-size: 0.72rem; color: var(--text-2); margin-top: 2px; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 12px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 2px;
}
.nav-item:hover { background: var(--bg-card2); color: var(--text-1); }
.nav-item.active {
  background: var(--accent-glow);
  color: var(--accent);
}
.nav-item .icon { font-size: 1.15rem; width: 22px; text-align: center; }
.nav-label { flex: 1; }
.nav-badge {
  background: var(--red);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
}

.sidebar-user {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.user-avatar {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--accent), #fb923c);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.9rem; color: #000; flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 0.85rem; font-weight: 600; }
.user-role { font-size: 0.72rem; color: var(--text-2); text-transform: capitalize; }
.btn-logout { color: var(--text-3); font-size: 1rem; padding: 4px; transition: color var(--transition); }
.btn-logout:hover { color: var(--red); }

/* MAIN CONTENT */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* TOP HEADER */
.top-header {
  height: var(--header-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.btn-menu-toggle {
  display: none;
  padding: 8px;
  color: var(--text-2);
  font-size: 1.3rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition);
}
.btn-menu-toggle:hover { color: var(--text-1); }
.page-title { font-size: 1.05rem; font-weight: 700; flex: 1; }
.header-actions { display: flex; align-items: center; gap: 10px; }

/* PAGE CONTENT */
.page-content { flex: 1; padding: 24px; }
.page { display: none; }
.page.active { display: block; }

/* ─── CARDS ─────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ─── STAT CARDS ─────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition);
}
.stat-card:hover { transform: translateY(-2px); }
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 60px; height: 60px;
  border-radius: 50%;
  opacity: 0.12;
}
.stat-card.amber::before { background: var(--accent); }
.stat-card.green::before { background: var(--green); }
.stat-card.blue::before { background: var(--blue); }
.stat-card.red::before { background: var(--red); }
.stat-icon { font-size: 1.5rem; margin-bottom: 8px; }
.stat-value { font-size: 1.5rem; font-weight: 800; }
.stat-label { font-size: 0.75rem; color: var(--text-2); margin-top: 2px; }
.stat-card.amber .stat-value { color: var(--accent); }
.stat-card.green .stat-value { color: var(--green); }
.stat-card.blue .stat-value { color: var(--blue); }
.stat-card.red .stat-value { color: var(--red); }

/* ─── KANBAN ─────────────────────────────────────────────────── */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  align-items: start;
}
.kanban-col {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.kanban-header {
  padding: 12px 16px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}
.kanban-col.kabul .kanban-header { border-top: 3px solid var(--blue); color: var(--blue); }
.kanban-col.islemde .kanban-header { border-top: 3px solid var(--accent); color: var(--accent); }
.kanban-col.tamamlandi .kanban-header { border-top: 3px solid var(--green); color: var(--green); }
.kanban-col.teslim_edildi .kanban-header { border-top: 3px solid var(--text-3); color: var(--text-3); }
.kanban-count {
  background: var(--bg-input);
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 0.75rem;
}
.kanban-body { padding: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 80px; }
.kanban-card {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}
.kanban-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(245,158,11,0.1);
}
.kanban-card-plate {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--accent);
  margin-bottom: 4px;
}
.kanban-card-car { font-size: 0.78rem; color: var(--text-2); margin-bottom: 6px; }
.kanban-card-customer { font-size: 0.82rem; font-weight: 500; }
.kanban-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.kanban-card-amount { font-size: 0.82rem; font-weight: 700; color: var(--green); }
.kanban-card-type {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 99px;
}
.kanban-card-type.bakim { background: rgba(59,130,246,0.15); color: var(--blue); }
.kanban-card-type.tamir { background: rgba(245,158,11,0.15); color: var(--accent); }
.kanban-card-time { font-size: 0.68rem; color: var(--text-3); }

/* ─── BUTTONS ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #000; }
.btn-primary:hover { background: var(--accent-d); transform: translateY(-1px); }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: var(--green-d); }
.btn-danger { background: var(--red); color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--border2); color: var(--text-1); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 7px 13px; font-size: 0.8rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; pointer-events: none; }

/* ─── FORMS ─────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 0.875rem;
  color: var(--text-1);
  transition: border-color var(--transition);
  outline: none;
  -webkit-appearance: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-textarea { resize: vertical; min-height: 80px; }
.form-select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 12px; padding-right: 36px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-hint { font-size: 0.75rem; color: var(--text-3); margin-top: 4px; }

/* Search box */
.search-box {
  position: relative;
}
.search-box .form-input { padding-left: 38px; }
.search-box-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  font-size: 0.95rem;
}

/* ─── WIZARD ─────────────────────────────────────────────────── */
.wizard-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 28px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.wizard-step {
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
}
.step-num {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700;
  background: var(--bg-card2);
  border: 2px solid var(--border);
  color: var(--text-3);
  transition: all var(--transition);
}
.step-label {
  font-size: 0.75rem;
  color: var(--text-3);
  margin: 0 6px;
  white-space: nowrap;
  transition: color var(--transition);
}
.step-line {
  width: 24px; height: 2px;
  background: var(--border);
  transition: background var(--transition);
}
.wizard-step.completed .step-num { background: var(--green); border-color: var(--green); color: #fff; }
.wizard-step.completed .step-label { color: var(--green); }
.wizard-step.completed .step-line { background: var(--green); }
.wizard-step.active .step-num { background: var(--accent); border-color: var(--accent); color: #000; }
.wizard-step.active .step-label { color: var(--accent); }

.wizard-page { display: none; }
.wizard-page.active { display: block; }

/* SERVICE TYPE SELECTOR */
.service-types { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 20px 0; }
.service-type-btn {
  border: 2px solid var(--border);
  background: var(--bg-card2);
  border-radius: var(--radius-lg);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}
.service-type-btn .icon { font-size: 2.2rem; display: block; margin-bottom: 10px; }
.service-type-btn .title { font-size: 0.95rem; font-weight: 700; }
.service-type-btn .desc { font-size: 0.75rem; color: var(--text-2); margin-top: 4px; }
.service-type-btn.selected { border-color: var(--accent); background: rgba(245,158,11,0.08); }

/* CHECKBOX ITEMS */
.checkbox-group { display: flex; flex-direction: column; gap: 10px; }
.checkbox-item {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition);
}
.checkbox-item.checked { border-color: var(--accent); }
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  cursor: pointer;
  user-select: none;
}
.checkbox-label input[type="checkbox"] { display: none; }
.checkbox-custom {
  width: 20px; height: 20px;
  border: 2px solid var(--border2);
  border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}
.checkbox-item.checked .checkbox-custom { background: var(--accent); border-color: var(--accent); }
.checkbox-item.checked .checkbox-custom::after { content: '✓'; font-size: 0.75rem; font-weight: 700; color: #000; }
.checkbox-label-text { flex: 1; font-size: 0.875rem; font-weight: 500; }
.checkbox-detail {
  padding: 0 16px 14px;
  display: none;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  border-top: 1px solid var(--border);
}
.checkbox-item.checked .checkbox-detail { display: grid; }

/* CATEGORY SECTION */
.category-section { margin-bottom: 20px; }
.category-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.category-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ─── PHOTO GRID ─────────────────────────────────────────────── */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.photo-slot {
  aspect-ratio: 4/3;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all var(--transition);
  overflow: hidden;
  position: relative;
  background: var(--bg-input);
}
.photo-slot:hover { border-color: var(--accent); background: rgba(245,158,11,0.04); }
.photo-slot.uploaded { border-style: solid; border-color: var(--green); }
.photo-slot img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.photo-slot-label { font-size: 0.72rem; color: var(--text-2); text-align: center; font-weight: 500; position: relative; z-index: 1; }
.photo-slot-icon { font-size: 1.4rem; position: relative; z-index: 1; }
.photo-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
  z-index: 2;
}
.photo-slot.uploaded:hover .photo-overlay { opacity: 1; }

/* ─── TOTAL BAR ─────────────────────────────────────────────── */
.total-bar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  position: sticky;
  bottom: 0;
}
.total-label { font-size: 0.9rem; color: var(--text-2); }
.total-amount { font-size: 1.6rem; font-weight: 800; color: var(--accent); }

/* ─── TABLE ─────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 14px; text-align: left; font-size: 0.85rem; white-space: nowrap; }
th { color: var(--text-2); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.4px; border-bottom: 1px solid var(--border); }
td { border-bottom: 1px solid var(--border); color: var(--text-1); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }

/* ─── BADGE ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 700;
}
.badge-kabul { background: rgba(59,130,246,0.15); color: var(--blue); }
.badge-islemde { background: rgba(245,158,11,0.15); color: var(--accent); }
.badge-tamamlandi { background: rgba(16,185,129,0.15); color: var(--green); }
.badge-teslim_edildi { background: rgba(71,85,105,0.15); color: var(--text-3); }

/* ─── MODAL ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%;
  max-width: 680px;
  max-height: 92vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform var(--transition);
  border: 1px solid var(--border);
  border-bottom: none;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 10;
}
.modal-title { font-size: 1.05rem; font-weight: 700; }
.btn-modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-card2);
  color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  transition: all var(--transition);
}
.btn-modal-close:hover { background: var(--red); color: #fff; }
.modal-body { padding: 20px 22px; }
.modal-footer { padding: 16px 22px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* ─── SEARCH RESULTS ─────────────────────────────────────────── */
.search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  overflow: hidden;
  max-height: 260px;
  overflow-y: auto;
}
.search-result-item {
  padding: 11px 16px;
  cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid var(--border);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--bg-card2); }
.sri-main { font-size: 0.875rem; font-weight: 600; }
.sri-sub { font-size: 0.75rem; color: var(--text-2); margin-top: 2px; }

/* ─── LOGIN PAGE ─────────────────────────────────────────────── */
#login-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-base);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 24px;
}
.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
}
.login-logo {
  text-align: center;
  margin-bottom: 28px;
}
.login-logo-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 10px;
}
.login-logo h1 {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), #fb923c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.login-logo p { color: var(--text-2); font-size: 0.85rem; margin-top: 4px; }
.pin-input-group {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 20px 0;
}
.pin-digit {
  width: 52px; height: 60px;
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-1);
  transition: border-color var(--transition);
  outline: none;
}
.pin-digit:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

/* ─── TOAST ─────────────────────────────────────────────────── */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column-reverse; gap: 8px; }
.toast {
  background: var(--bg-card2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 12px 18px;
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
  max-width: 360px;
  box-shadow: var(--shadow);
  animation: slideIn 0.25s ease;
}
.toast.success { border-color: var(--green); }
.toast.error { border-color: var(--red); }
.toast.success .toast-icon { color: var(--green); }
.toast.error .toast-icon { color: var(--red); }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ─── LOADER ─────────────────────────────────────────────────── */
.loader { display: inline-block; width: 20px; height: 20px; border: 2px solid var(--border2); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 9998;
  display: none; align-items: center; justify-content: center;
}
.loading-overlay.show { display: flex; }

/* ─── MOBILE RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 1100px) {
  .kanban-board { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 260px; }
  body { overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .top-header { position: sticky; top: 0; z-index: 100; padding: 0 16px; min-height: 56px; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .main-content { margin-left: 0; min-height: 100vh; }
  .btn-menu-toggle { display: flex; }
  .sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 199;
  }
  .sidebar-overlay.show { display: block; }
  .page-content { padding: 14px; }
  .kanban-board { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
  .checkbox-detail { grid-template-columns: 1fr; }
  .service-types { grid-template-columns: 1fr; }
  .modal { max-height: 95vh; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
  .login-card { padding: 28px 20px; }
  .pin-digit { width: 44px; height: 52px; font-size: 1.3rem; }
}

/* ─── WHATSAPP PREVIEW ─────────────────────────────────────── */
.wa-preview {
  background: #0a2010;
  border: 1px solid #1a4a1a;
  border-radius: var(--radius);
  padding: 16px;
  font-size: 0.82rem;
  white-space: pre-wrap;
  font-family: 'Courier New', monospace;
  color: #e0f7e0;
  max-height: 300px;
  overflow-y: auto;
}

/* ─── EXTRAS ─────────────────────────────────────────────────── */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.text-muted { color: var(--text-2); }
.text-sm { font-size: 0.82rem; }
.text-accent { color: var(--accent); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-right { text-align: right; }
.separator { height: 1px; background: var(--border); margin: 16px 0; }
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-3);
}
.empty-state-icon { font-size: 2.5rem; display: block; margin-bottom: 10px; }
.km-badge {
  background: rgba(139,92,246,0.15);
  color: var(--purple);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
