/* ==========================================================================
   HAL — Kabzımal, Balık & Toptan Hal Otomasyonu
   Design System & Styling
   ========================================================================== */

html {
  background-color: #f1f5f9;
  color-scheme: light;
}

:root {
  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-light: #e0f2fe;
  --primary-dark: #075985;
  
  --navy-950: #080e1a;
  --navy-900: #0f172a;
  --navy-850: #141f36;
  --navy-800: #1e293b;
  --navy-700: #334155;
  
  --emerald-500: #10b981;
  --emerald-600: #059669;
  --emerald-50: #ecfdf5;
  
  --amber-500: #f59e0b;
  --amber-50: #fffbeb;
  
  --rose-500: #f43f5e;
  --rose-50: #fff1f2;
  
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  --sidebar-w: 260px;
  --topbar-h: 68px;
  
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.03);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
}

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

body {
  font-family: var(--font-main);
  background-color: #f1f5f9;
  color: var(--gray-800);
  min-height: 100vh;
  display: flex;
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
}

/* ── Sidebar ── */
.app-sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--navy-950) 0%, var(--navy-900) 100%);
  color: #fff;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
  transition: transform 0.25s ease;
}

.sidebar-header {
  min-height: 80px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-sizing: border-box;
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.35);
}

.brand-text {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand-text h1 {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #fff;
  line-height: 1.25;
  margin: 0 0 3px 0;
  word-break: break-word;
}

.brand-subname {
  font-size: 10px;
  color: #94a3b8;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-text span {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #38bdf8;
  font-weight: 700;
  line-height: 1;
}

.sidebar-nav {
  padding: 20px 12px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--gray-400);
  padding: 12px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: #cbd5e1;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  transition: all 0.15s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  transform: translateX(3px);
}

.nav-item.active {
  background: linear-gradient(90deg, #0284c7 0%, #0369a1 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

.nav-item i {
  font-size: 17px;
  width: 20px;
  text-align: center;
}

.nav-badge {
  margin-left: auto;
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1;
}

.sidebar-footer {
  padding: 16px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
}

.quick-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  transition: all 0.2s;
}

.quick-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.45);
}

/* ── Main Content Area ── */
.app-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.app-topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.page-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--navy-900);
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-breadcrumb {
  font-size: 12px;
  color: var(--gray-500);
  font-weight: 500;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13.5px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-success {
  background: var(--emerald-500);
  color: #fff;
}
.btn-success:hover {
  background: var(--emerald-600);
}

.btn-outline {
  background: #fff;
  border-color: var(--gray-300);
  color: var(--gray-700);
}
.btn-outline:hover {
  background: var(--gray-100);
  border-color: var(--gray-400);
}

/* ══════════════════════════════════════════════════════════════
   HAL STANDART EYLEM BUTONLARI (ACTION SUITE / BUTTON SYSTEM)
   Tüm modüllerde (Sefer, Cari, Araç, Kasa, Portal) yeknesak tasarım
   ══════════════════════════════════════════════════════════════ */
.act-group {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.btn-act {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 11px;
  font-size: 11.5px;
  font-weight: 700;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
  transition: all 0.15s ease;
  white-space: nowrap;
  user-select: none;
}

.btn-act:active {
  transform: scale(0.97);
}

/* 1. YENİ / EKLE (Yeni Sefer, Yeni Cari, Yeni Araç) */
.btn-act-add {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #fff !important;
  border-color: #0284c7;
  box-shadow: 0 2px 5px rgba(2, 132, 199, 0.25);
}
.btn-act-add:hover {
  background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.35);
}

/* 2. KAYDET / GÜNCELLE / ONAYLA (Form Gönderme, Kaydetme) */
.btn-act-save {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff !important;
  border-color: #10b981;
  box-shadow: 0 2px 5px rgba(16, 185, 129, 0.25);
}
.btn-act-save:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.35);
}

/* 3. DÜZENLE / DÜZELT (Mevcut Kaydı Güncelleme) */
.btn-act-edit {
  background: #f8fafc;
  color: #0f172a !important;
  border-color: #cbd5e1;
}
.btn-act-edit:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0284c7 !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* 4. SİL (Kritik İşlem - Emniyet Kilidi ile Çalışır) */
.btn-act-del {
  background: #fff1f2;
  color: #e11d48 !important;
  border-color: #fecdd3;
}
.btn-act-del:hover {
  background: #ffe4e6;
  border-color: #fda4af;
  color: #be123c !important;
}

/* 5. GÖNDER / WHATSAPP / YAZDIR */
.btn-act-send {
  background: #ecfdf5;
  color: #059669 !important;
  border-color: #a7f3d0;
}
.btn-act-send:hover {
  background: #10b981;
  color: #fff !important;
  border-color: #10b981;
}

/* 6. DETAY / İNCELE / EKSTRE */
.btn-act-view {
  background: #f0f9ff;
  color: #0284c7 !important;
  border-color: #bae6fd;
}
.btn-act-view:hover {
  background: #0284c7;
  color: #fff !important;
  border-color: #0284c7;
}

/* 7. VAZGEÇ / İPTAL */
.btn-act-cancel {
  background: #f1f5f9;
  color: #64748b !important;
  border-color: #e2e8f0;
}
.btn-act-cancel:hover {
  background: #e2e8f0;
  color: #334155 !important;
}

/* ── STANDART CALLBOX SÜİTİ (Vitrin / İletişim & Aksiyon Barı) ── */
.callbox {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1.4fr;
  gap: 8px;
  align-items: center;
}

.callbox-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: all 0.15s ease;
  line-height: 1;
  text-align: center;
}

.callbox-btn:active {
  transform: scale(0.97);
}

.callbox-call {
  background: #0284c7;
  color: #ffffff !important;
  border-color: #0369a1;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.3);
}
.callbox-call:hover {
  background: #0369a1;
  color: #ffffff !important;
}

.callbox-wa {
  background: #16a34a;
  color: #ffffff !important;
  border-color: #15803d;
  box-shadow: 0 2px 6px rgba(22, 163, 74, 0.3);
}
.callbox-wa:hover {
  background: #15803d;
  color: #ffffff !important;
}

.callbox-order {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff !important;
  border-color: #b45309;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
}
.callbox-order:hover {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  color: #ffffff !important;
}

.app-content {
  padding: 28px;
  flex: 1;
}

/* ── KPI Cards ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.kpi-card {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

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

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--primary);
}

.kpi-card.emerald::before { background: var(--emerald-500); }
.kpi-card.amber::before { background: var(--amber-500); }
.kpi-card.purple::before { background: #8b5cf6; }

.kpi-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.kpi-title {
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-500);
}

.kpi-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: var(--primary-light);
  color: var(--primary-dark);
}

.kpi-icon.emerald { background: var(--emerald-50); color: var(--emerald-600); }
.kpi-icon.amber { background: var(--amber-50); color: var(--amber-500); }
.kpi-icon.purple { background: #f5f3ff; color: #7c3aed; }

.kpi-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--navy-900);
  font-family: var(--font-mono);
  letter-spacing: -0.5px;
}

.kpi-sub {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 4px;
}

/* ── Content Box / Cards ── */
.box {
  background: #fff;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  overflow: hidden;
}

.box-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fafbfc;
}

.box-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy-900);
  display: flex;
  align-items: center;
  gap: 8px;
}

.box-body {
  padding: 20px;
}

/* ── Tables ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.data-table th {
  background: var(--gray-50);
  padding: 12px 14px;
  text-align: left;
  font-weight: 700;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--gray-600);
  border-bottom: 1.5px solid var(--gray-200);
}

.data-table td {
  padding: 14px;
  border-bottom: 1px solid var(--gray-200);
  color: var(--gray-800);
  vertical-align: middle;
}

.data-table tr:hover td {
  background-color: #f8fafc;
}

.data-table td.mono {
  font-family: var(--font-mono);
  font-weight: 600;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-success { background: var(--emerald-50); color: var(--emerald-600); border: 1px solid #a7f3d0; }
.badge-warning { background: var(--amber-50); color: var(--amber-500); border: 1px solid #fde68a; }
.badge-primary { background: var(--primary-light); color: var(--primary-dark); border: 1px solid #bae6fd; }

/* ── Vintage Dot-Matrix / Receipt View ── */
.receipt-paper {
  background: #ffffff;
  color: #111;
  font-family: var(--font-mono);
  padding: 24px 30px;
  border-radius: var(--radius-md);
  border: 1px dashed #cbd5e1;
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
  max-width: 680px;
  margin: 0 auto;
  line-height: 1.35;
  font-size: 13px;
  position: relative;
}

.receipt-paper::before, .receipt-paper::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 6px;
  background: repeating-linear-gradient(45deg, #cbd5e1, #cbd5e1 5px, transparent 5px, transparent 10px);
}
.receipt-paper::before { top: -6px; }
.receipt-paper::after { bottom: -6px; }

.receipt-header {
  margin-bottom: 16px;
}

.receipt-code {
  font-size: 15px;
  font-weight: 700;
}

.receipt-name {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.receipt-date {
  text-align: right;
  font-weight: 600;
  margin-top: -30px;
  margin-bottom: 20px;
}

.receipt-items {
  width: 100%;
  border-collapse: collapse;
  margin: 15px 0;
}

.receipt-items td {
  padding: 4px 6px;
  vertical-align: top;
}

.receipt-summary {
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px dashed #64748b;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.receipt-row {
  display: flex;
  gap: 16px;
  min-width: 320px;
  justify-content: space-between;
}

.receipt-total {
  font-size: 15px;
  font-weight: 800;
  border-top: 1.5px solid #111;
  padding-top: 6px;
  margin-top: 4px;
}

@media print {
  body { background: #fff; }
  .app-sidebar, .app-topbar, .no-print { display: none !important; }
  .app-main { margin-left: 0 !important; }
  .receipt-paper { box-shadow: none; border: none; padding: 0; max-width: 100%; }
}

/* ==========================================================================
   Yazıhane Tipografi Ölçekleme & Görünüm (Arayüz Boyutları)
   ========================================================================== */
body.font-kompakt {
  font-size: 12.5px;
}
body.font-kompakt .data-table {
  font-size: 12px;
}
body.font-kompakt .data-table th {
  padding: 8px 10px;
  font-size: 10.5px;
}
body.font-kompakt .data-table td {
  padding: 8px 10px;
  font-size: 12px;
}
body.font-kompakt .btn,
body.font-kompakt .btn-act {
  font-size: 11.5px;
  padding: 5px 10px;
}
body.font-kompakt input,
body.font-kompakt select,
body.font-kompakt textarea {
  font-size: 12.5px !important;
  padding: 7px 10px !important;
}
body.font-kompakt .box-title {
  font-size: 13.5px;
}
body.font-kompakt .box-header {
  padding: 10px 16px;
}
body.font-kompakt .app-content {
  padding: 16px 20px;
}

body.font-normal {
  font-size: 13.5px;
}
body.font-normal .data-table {
  font-size: 13px;
}
body.font-normal input,
body.font-normal select {
  font-size: 13.5px !important;
}

body.font-buyuk {
  font-size: 15px;
}
body.font-buyuk .data-table {
  font-size: 14px;
}
body.font-buyuk input,
body.font-buyuk select {
  font-size: 15px !important;
  padding: 10px 14px !important;
}

