/* ==========================================
   BatteryPro — Design System & Global Styles
   ========================================== */

:root {
  /* Core Colors */
  --bg-primary: #08080f;
  --bg-secondary: #0e0e1a;
  --bg-card: #12121f;
  --bg-card-hover: #181828;
  --bg-glass: rgba(18, 18, 31, 0.8);
  --bg-input: rgba(255, 255, 255, 0.04);

  /* Brand */
  --brand: #6c63ff;
  --brand-dim: rgba(108, 99, 255, 0.15);
  --brand-glow: rgba(108, 99, 255, 0.3);

  /* Text */
  --text-primary: #f0f0ff;
  --text-secondary: #8888aa;
  --text-muted: #555577;

  /* Status */
  --red: #ff4757;
  --red-dim: rgba(255, 71, 87, 0.12);
  --red-border: rgba(255, 71, 87, 0.3);
  --orange: #ff9f43;
  --orange-dim: rgba(255, 159, 67, 0.12);
  --orange-border: rgba(255, 159, 67, 0.3);
  --green: #2ecc71;
  --green-dim: rgba(46, 204, 113, 0.12);
  --green-border: rgba(46, 204, 113, 0.3);
  --blue: #54a0ff;
  --blue-dim: rgba(84, 160, 255, 0.12);

  /* Borders */
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.5);
  --shadow-brand: 0 0 30px rgba(108, 99, 255, 0.2);

  /* Spacing */
  --nav-height: 68px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Transitions */
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ===== BACKGROUND ===== */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  z-index: 0;
  pointer-events: none;
}

.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  z-index: 0;
  pointer-events: none;
  opacity: 0.4;
}

.bg-glow-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(108, 99, 255, 0.15), transparent 70%);
  top: -200px;
  right: -200px;
}

.bg-glow-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(84, 160, 255, 0.1), transparent 70%);
  bottom: -100px;
  left: -100px;
}

/* ===== NAVBAR ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(8, 8, 15, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
  gap: 16px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.nav-logo {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--brand), #9b59b6);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 0 20px var(--brand-glow);
}

.nav-title-group { display: flex; flex-direction: column; }
.nav-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
  line-height: 1;
}
.nav-subtitle {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  line-height: 1;
  margin-top: 2px;
}

.nav-tabs {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  gap: 2px;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  position: relative;
}

.nav-tab:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
}

.nav-tab.active {
  background: var(--brand);
  color: white;
  box-shadow: 0 2px 12px var(--brand-glow);
}

.nav-badge {
  background: var(--red);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 20px;
  min-width: 18px;
  text-align: center;
}

.nav-actions { display: flex; gap: 8px; flex-shrink: 0; }

.btn-icon {
  width: 40px;
  height: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.btn-icon:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.notif-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: var(--brand);
  border-radius: 50%;
  border: 2px solid var(--bg-primary);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}

/* ===== NOTIFICATION PANEL ===== */
.notif-overlay {
  position: fixed;
  inset: 0;
  z-index: 149;
  display: none;
}

.notif-overlay.visible { display: block; }

.notif-panel {
  position: fixed;
  top: calc(var(--nav-height) + 8px);
  right: 16px;
  width: 320px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 150;
  overflow: hidden;
  transform: translateY(-10px) scale(0.96);
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

.notif-panel.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: all;
}

.notif-panel-header {
  padding: 20px 20px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.notif-panel-header h3 { font-size: 15px; font-weight: 600; }

.notif-status { display: flex; align-items: center; gap: 6px; }

.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  transition: var(--transition);
}
.status-dot.active { background: var(--green); box-shadow: 0 0 8px var(--green); }
.status-dot.inactive { background: var(--text-muted); }

.notif-status span { font-size: 12px; color: var(--text-secondary); }

.notif-panel-body { padding: 16px 20px 20px; }

.notif-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
}

.btn-notif-toggle {
  width: 100%;
  padding: 12px 16px;
  background: var(--brand-dim);
  border: 1px solid var(--brand-glow);
  border-radius: var(--radius-md);
  color: var(--brand);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
  margin-bottom: 16px;
}

.btn-notif-toggle:hover { background: var(--brand); color: white; }
.btn-notif-toggle.active {
  background: var(--red-dim);
  border-color: var(--red-border);
  color: var(--red);
}
.btn-notif-toggle.active:hover { background: var(--red); color: white; }

/* Notification Options Panel */
.notif-options {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 14px;
}

.notif-options-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 10px 14px 6px;
}

.notif-option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: var(--transition);
  border-top: 1px solid var(--border);
}

.notif-option-row:first-of-type { border-top: none; }

.notif-option-row:hover { background: rgba(255,255,255,0.02); }

.notif-option-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.notif-option-icon {
  font-size: 16px;
  flex-shrink: 0;
  line-height: 1;
}

.notif-option-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.2;
}

.notif-option-desc {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  width: 38px;
  height: 22px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 11px;
  transition: var(--transition);
  cursor: pointer;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: var(--transition);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--brand);
  box-shadow: 0 0 10px var(--brand-glow);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(16px);
}

/* Divider */
.notif-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}

/* Test Button */
.btn-notif-test {
  width: 100%;
  padding: 9px 14px;
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition);
  margin: 8px 14px 10px;
  width: calc(100% - 28px);
}

.btn-notif-test:hover {
  border-color: var(--brand-glow);
  color: var(--brand);
  background: var(--brand-dim);
}

.notif-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  padding: 0 2px;
  margin-top: 4px;
}

.notif-panel {
  width: 360px;
}

.notif-panel-body {
  padding: 14px 16px 18px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

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

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  font-size: 13px;
  font-weight: 500;
  transform: translateX(120%);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  min-width: 240px;
  max-width: 360px;
}

.toast.show { transform: translateX(0); }
.toast.toast-success { border-color: var(--green-border); }
.toast.toast-error { border-color: var(--red-border); }
.toast.toast-info { border-color: var(--brand-glow); }

.toast-icon { flex-shrink: 0; }
.toast-success .toast-icon { color: var(--green); }
.toast-error .toast-icon { color: var(--red); }
.toast-info .toast-icon { color: var(--brand); }

/* ===== MAIN CONTENT ===== */
.main-content {
  padding-top: calc(var(--nav-height) + 24px);
  padding-bottom: 40px;
  min-height: 100vh;
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* ===== PAGES ===== */
.page { display: none; animation: fadeInUp 0.35s ease; }
.page.active { display: block; }

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

/* ===== PAGE HEADER ===== */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.page-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1.2;
  background: linear-gradient(135deg, var(--text-primary), rgba(255,255,255,0.6));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.deadline-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--brand-dim);
  border: 1px solid var(--brand-glow);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ===== FORM ===== */
.kayit-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.form-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.form-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--brand-glow), transparent);
  opacity: 0;
  transition: var(--transition);
}

.form-section:focus-within::before { opacity: 1; }

.form-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--brand);
  background: var(--brand-dim);
  padding: 2px 8px;
  border-radius: 6px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full-width { grid-column: 1 / -1; }

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.required { color: var(--brand); }

.form-input {
  padding: 11px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  transition: var(--transition);
  outline: none;
  width: 100%;
}

.form-input::placeholder { color: var(--text-muted); }

.form-input:hover { border-color: var(--border-hover); }

.form-input:focus {
  border-color: var(--brand);
  background: rgba(108, 99, 255, 0.05);
  box-shadow: 0 0 0 3px var(--brand-dim);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238888aa' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.form-select option { background: var(--bg-card); color: var(--text-primary); }

.form-textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

/* ===== DEADLINE PREVIEW ===== */
.deadline-preview {
  background: linear-gradient(135deg, rgba(108,99,255,0.1), rgba(84,160,255,0.05));
  border: 1px solid var(--brand-glow);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  animation: fadeInUp 0.3s ease;
}

.deadline-preview-icon {
  width: 44px; height: 44px;
  background: var(--brand-dim);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: var(--brand);
  flex-shrink: 0;
}

.deadline-preview-text { flex: 1; }
.dp-label { display: block; font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.dp-date { font-size: 20px; font-weight: 700; color: var(--text-primary); font-family: 'JetBrains Mono', monospace; }

.dp-countdown {
  font-family: 'JetBrains Mono', monospace;
  font-size: 24px;
  font-weight: 800;
  color: var(--brand);
}

/* ===== FORM ACTIONS ===== */
.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* ===== BOTTOM NAV (Mobile only) ===== */
.bottom-nav {
  display: none; /* Hidden by default — shown on mobile */
}

/* ===== RESPONSIVE — MOBILE FIRST ===== */

/* ─── Desktop: show desktop nav-tabs, hide bottom-nav ─── */
@media (min-width: 769px) {
  .desktop-nav-tabs { display: flex; }
  .bottom-nav { display: none !important; }
}

/* ─── Mobile/Tablet: hide desktop nav-tabs, show bottom-nav ─── */
@media (max-width: 768px) {

  /* ── TOP NAVBAR: slim, logo + notif only ── */
  .navbar {
    height: 56px;
    padding: 0 16px;
    justify-content: space-between;
    gap: 0;
  }

  /* Hide desktop nav-tabs from top bar on mobile */
  .desktop-nav-tabs {
    display: none !important;
  }

  /* ── BOTTOM NAV ── */
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 110;
    background: rgba(8, 8, 15, 0.97);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid rgba(255,255,255,0.07);
    padding: 6px 4px env(safe-area-inset-bottom, 8px);
    flex-direction: row;
    align-items: stretch;
  }

  .bottom-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 4px 8px;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.38);
    font-family: 'Inter', sans-serif;
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.3px;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.18s ease;
    position: relative;
  }

  .bottom-tab svg {
    width: 22px;
    height: 22px;
    transition: all 0.18s ease;
  }

  .bottom-tab:hover {
    color: rgba(255,255,255,0.65);
    background: rgba(255,255,255,0.04);
  }

  .bottom-tab.active {
    color: var(--brand);
  }

  .bottom-tab.active svg {
    filter: drop-shadow(0 0 6px var(--brand));
  }

  /* Active indicator pill */
  .bottom-tab.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 2px;
    background: var(--brand);
    border-radius: 0 0 4px 4px;
    box-shadow: 0 0 8px var(--brand-glow);
  }

  /* Badge on bottom nav */
  .bottom-badge {
    position: absolute;
    top: -4px;
    right: -8px;
    background: var(--red);
    color: white;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 20px;
    min-width: 15px;
    text-align: center;
    border: 2px solid var(--bg-primary);
    line-height: 1.3;
  }

  /* ── NOTIFICATION PANEL ── */
  .notif-panel {
    position: fixed;
    top: 56px;
    left: 8px;
    right: 8px;
    width: auto;
    max-height: calc(100vh - 56px - 80px);
    overflow-y: auto;
    border-radius: var(--radius-lg);
    z-index: 150;
  }

  /* ── NOTIFICATION BUTTON ── */
  .nav-actions {
    display: flex;
    align-items: center;
    flex-shrink: 0;
  }

  .btn-icon {
    width: 38px;
    height: 38px;
  }

  /* ── NAV BRAND ── */
  .nav-subtitle { display: none; }
  .nav-title { font-size: 14px; }

  /* ── MAIN CONTENT ── */
  .main-content {
    padding-top: calc(56px + 20px);
    padding-bottom: calc(72px + 20px);
    padding-left: 16px;
    padding-right: 16px;
  }

  /* ── PAGE HEADER ── */
  .page-title { font-size: 22px; }
  .page-desc { font-size: 13px; }

  .page-header {
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
    align-items: flex-start;
  }

  .deadline-badge, .live-indicator {
    align-self: flex-start;
    font-size: 11px;
  }

  /* ── STATS ── */
  .stats-bar {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 16px;
  }

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

  /* ── LEGEND ── */
  .legend-bar {
    gap: 10px;
    padding: 10px 12px;
  }

  /* ── FORM ── */
  .form-section { padding: 18px 14px; }
  .form-grid { grid-template-columns: 1fr; }

  .form-actions {
    flex-direction: column-reverse;
    gap: 8px;
  }

  .btn-primary, .btn-secondary {
    width: 100%;
    justify-content: center;
  }

  /* ── PRODUCT CARDS ── */
  .urun-kart {
    grid-template-columns: 4px 1fr;
    gap: 10px;
    padding: 14px 12px;
  }

  .kart-side {
    grid-column: 2;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
  }

  .kalan-gun-display { font-size: 18px; }
  .kalan-gun-label { font-size: 9px; }
  .kart-musteri { font-size: 14px; }

  .kart-aciklama {
    max-width: 100%;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .kart-info { gap: 8px; }

  /* ── MODAL: Bottom Sheet on mobile ── */
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .modal {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-width: 100%;
    width: 100%;
    max-height: 90dvh;
    overflow-y: auto;
  }

  .modal-form { padding: 18px 16px; }
  .modal-header { padding: 18px 16px 14px; }

  .modal-actions {
    flex-direction: column-reverse;
    gap: 8px;
  }

  .modal-actions .btn-secondary,
  .modal-actions .btn-success {
    width: 100%;
    justify-content: center;
  }

  /* ── TOAST ── */
  .toast-container {
    bottom: calc(72px + 12px);
    right: 12px;
    left: 12px;
    z-index: 300;
  }

  .toast {
    min-width: unset;
    max-width: unset;
    width: 100%;
  }

  /* ── GECMIS ── */
  .gecmis-kart {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 12px;
  }

  .gecmis-tamamlama {
    width: 100%;
    text-align: left;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
  }

  .gecmis-details { gap: 8px; }
  .search-input-wrap { max-width: 100%; }

  /* ── DEADLINE PREVIEW ── */
  .deadline-preview { flex-wrap: wrap; gap: 10px; }
  .dp-date { font-size: 16px; }
  .dp-countdown { font-size: 20px; }
}

/* ─── Very small phones ─── */
@media (max-width: 380px) {
  .nav-logo { width: 32px; height: 32px; }
  .nav-title { font-size: 13px; }
  .page-title { font-size: 19px; }
  .stat-value { font-size: 20px; }
  .form-section { padding: 14px 10px; }
  .urun-kart { padding: 12px 10px; }
  .bottom-tab { font-size: 8px; }
}

/* ===== BUTTONS ===== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--brand), #9b59b6);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 20px var(--brand-glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 28px var(--brand-glow);
}

.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

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

.btn-success {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: linear-gradient(135deg, #27ae60, #2ecc71);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 20px rgba(46, 204, 113, 0.3);
}

.btn-success:hover { transform: translateY(-1px); box-shadow: 0 6px 28px rgba(46, 204, 113, 0.4); }

/* ===== LIVE INDICATOR ===== */
.live-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--green-border);
  border-radius: 100px;
  cursor: default;
  flex-shrink: 0;
  transition: var(--transition);
}

.live-indicator.connecting {
  border-color: var(--orange-border);
}

.live-indicator.offline {
  border-color: var(--red-border);
  opacity: 0.7;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: live-pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}

.connecting .live-dot {
  background: var(--orange);
  box-shadow: 0 0 8px var(--orange);
}

.offline .live-dot {
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
  animation: none;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 8px var(--green); }
  50% { opacity: 0.5; transform: scale(0.75); box-shadow: 0 0 4px var(--green); }
}

.live-text {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--green);
}

.connecting .live-text { color: var(--orange); }
.offline .live-text { color: var(--red); }

.live-update-time {
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

/* ===== STATS BAR ===== */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  transition: var(--transition);
}

.stat-card:hover { border-color: var(--border-hover); transform: translateY(-1px); }
.stat-card.stat-warning { border-color: var(--orange-border); background: var(--orange-dim); }
.stat-card.stat-success { border-color: var(--green-border); background: var(--green-dim); }

.stat-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.stat-warning .stat-value { color: var(--orange); }
.stat-success .stat-value { color: var(--green); }

.stat-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

/* ===== LEGEND ===== */
.legend-bar {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

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

.legend-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-red { background: var(--red); box-shadow: 0 0 6px var(--red); }
.dot-orange { background: var(--orange); box-shadow: 0 0 6px var(--orange); }
.dot-green { background: var(--green); box-shadow: 0 0 6px var(--green); }

/* ===== PRODUCT LIST ===== */
.liste-container, .gecmis-container { display: flex; flex-direction: column; gap: 10px; }

.urun-kart {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: grid;
  grid-template-columns: 4px 1fr auto;
  gap: 16px;
  align-items: center;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.urun-kart::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, rgba(108,99,255,0.03));
  opacity: 0;
  transition: var(--transition);
}

.urun-kart:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.urun-kart:hover::after { opacity: 1; }

.urun-kart.durum-kritik {
  border-color: var(--red-border);
  background: linear-gradient(135deg, var(--red-dim), var(--bg-card));
}

.urun-kart.durum-uyari {
  border-color: var(--orange-border);
  background: linear-gradient(135deg, var(--orange-dim), var(--bg-card));
}

.urun-kart.durum-normal {
  border-color: var(--green-border);
}

.kart-indicator {
  width: 4px;
  border-radius: 4px;
  height: 100%;
  min-height: 48px;
  align-self: stretch;
}

.durum-kritik .kart-indicator { background: linear-gradient(180deg, var(--red), rgba(255,71,87,0.3)); }
.durum-uyari .kart-indicator { background: linear-gradient(180deg, var(--orange), rgba(255,159,67,0.3)); }
.durum-normal .kart-indicator { background: linear-gradient(180deg, var(--green), rgba(46,204,113,0.3)); }

.kart-content { flex: 1; min-width: 0; }

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

.kart-musteri {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

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

.kart-badge {
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-kritik { background: var(--red-dim); color: var(--red); border: 1px solid var(--red-border); }
.badge-uyari { background: var(--orange-dim); color: var(--orange); border: 1px solid var(--orange-border); }
.badge-normal { background: var(--green-dim); color: var(--green); border: 1px solid var(--green-border); }

.kart-info {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.kart-info-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-secondary);
}

.kart-info-item svg { flex-shrink: 0; }

.kart-aciklama {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 500px;
}

.kart-side { text-align: right; flex-shrink: 0; }

.kalan-gun-display {
  font-family: 'JetBrains Mono', monospace;
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
}

.durum-kritik .kalan-gun-display { color: var(--red); }
.durum-uyari .kalan-gun-display { color: var(--orange); }
.durum-normal .kalan-gun-display { color: var(--green); }

.kalan-gun-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.kart-tamamla-hint {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
  justify-content: flex-end;
  transition: var(--transition);
}

.urun-kart:hover .kart-tamamla-hint { color: var(--brand); }

/* ===== SIRA NUMARA ===== */
.kart-sira {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

/* ===== STATES ===== */
.loading-state, .empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 24px;
  color: var(--text-muted);
  text-align: center;
}

.spinner {
  width: 32px; height: 32px;
  border: 2px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.empty-icon { color: var(--text-muted); margin-bottom: 4px; }
.empty-state h3 { font-size: 16px; color: var(--text-secondary); }
.empty-state p { font-size: 13px; max-width: 280px; }

/* ===== GEÇMİŞ ===== */
.gecmis-search-bar { margin-bottom: 20px; }

.search-input-wrap {
  position: relative;
  max-width: 400px;
}

.search-input-wrap svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 11px 14px 11px 42px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  outline: none;
  transition: var(--transition);
}

.search-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-dim);
}

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

.gecmis-kart {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  transition: var(--transition);
  border-left: 3px solid var(--green-border);
}

.gecmis-kart:hover { border-color: var(--green-border); background: var(--bg-card-hover); }

.gecmis-kart-info { flex: 1; }

.gecmis-musteri { font-size: 15px; font-weight: 700; color: var(--text-primary); }

.gecmis-details {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 6px;
}

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

.gecmis-tamamlama { text-align: right; flex-shrink: 0; }

.gecmis-teknisyen {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.gecmis-zaman {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.gecmis-completed-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  background: var(--green-dim);
  border: 1px solid var(--green-border);
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  color: var(--green);
  margin-top: 4px;
}

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 16px;
}

.page-btn {
  min-width: 36px; height: 36px;
  padding: 0 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}

.page-btn:hover { border-color: var(--border-hover); color: var(--text-primary); }
.page-btn.active { background: var(--brand); border-color: var(--brand); color: white; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-lg), var(--shadow-brand);
  transform: translateY(20px) scale(0.97);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.modal-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 24px 24px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-icon {
  width: 48px; height: 48px;
  background: var(--green-dim);
  border: 1px solid var(--green-border);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  color: var(--green);
  flex-shrink: 0;
}

.modal-title { font-size: 18px; font-weight: 700; }
.modal-desc { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

.modal-close {
  margin-left: auto;
  width: 36px; height: 36px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.modal-close:hover { background: var(--red-dim); border-color: var(--red-border); color: var(--red); }

.modal-form { padding: 24px; display: flex; flex-direction: column; gap: 16px; }

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 4px;
}

/* ===== REMOVING ANIMATION ===== */
@keyframes slideOutRight {
  to { opacity: 0; transform: translateX(40px) scale(0.97); }
}

.urun-kart.removing {
  animation: slideOutRight 0.35s ease forwards;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

/* ===== INPUT DATE NATIVE ===== */
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.5);
  cursor: pointer;
}


