/* ============================================================
   Design tokens
   ============================================================ */
:root {
  --font-ui: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;

  --brand-950: #042f2c;
  --brand-900: #064e42;
  --brand-800: #065f52;
  --brand-700: #0f766e;
  --brand-600: #0d9488;
  --brand-500: #14b8a6;
  --brand-400: #2dd4bf;
  --brand-100: #ccfbf1;
  --brand-50: #f0fdfa;

  --accent-500: #f59e0b;
  --accent-600: #d97706;

  --ink-900: #0f172a;
  --ink-700: #334155;
  --ink-500: #64748b;
  --ink-400: #94a3b8;
  --ink-200: #e2e8f0;
  --ink-100: #eef2f6;
  --ink-50: #f6f8fa;

  --surface: #ffffff;
  --surface-app: #f4f7f8;

  --danger: #e11d48;
  --warning: #d97706;
  --success: #0d9488;
  --info: #2563eb;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 14px rgba(6, 78, 66, 0.08), 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 12px 32px rgba(6, 78, 66, 0.12), 0 2px 6px rgba(15, 23, 42, 0.06);
}

/* ============================================================
   Base
   ============================================================ */
html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 15.5px;
  }
}

html, body {
  position: relative;
  min-height: 100%;
}

body {
  font-family: var(--font-ui);
  background-color: var(--surface-app);
  color: var(--ink-900);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink-900);
}

.text-tabular, .fw-numeric {
  font-variant-numeric: tabular-nums;
}

a {
  color: var(--brand-700);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus, .form-select:focus {
  box-shadow: 0 0 0 0.15rem #fff, 0 0 0 0.3rem var(--brand-400);
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  font-weight: 600;
  border-radius: var(--radius-sm);
  letter-spacing: 0.01em;
}

.btn-success, .btn-primary {
  background: linear-gradient(135deg, var(--brand-600), var(--brand-700));
  border-color: var(--brand-700);
}

.btn-success:hover, .btn-primary:hover {
  background: linear-gradient(135deg, var(--brand-700), var(--brand-800));
  border-color: var(--brand-800);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-outline-primary, .btn-outline-success {
  color: var(--brand-700);
  border-color: var(--brand-500);
}

.btn-outline-primary:hover, .btn-outline-success:hover {
  background-color: var(--brand-600);
  border-color: var(--brand-600);
}

.btn-outline-excel {
  color: #1d6f42;
  border: 1px solid #bfe3cf;
  background-color: #f3fbf6;
  font-weight: 600;
}

.btn-outline-excel:hover {
  background-color: #1d6f42;
  border-color: #1d6f42;
  color: #fff;
}

.btn, .btn-sm {
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}

/* ============================================================
   Top navbar
   ============================================================ */
.app-navbar {
  background: linear-gradient(120deg, var(--brand-800), var(--brand-700) 55%, var(--brand-600));
  box-shadow: var(--shadow-md);
  z-index: 30;
  position: sticky;
  top: 0;
}

.app-navbar .navbar-brand {
  font-weight: 800;
  letter-spacing: -0.02em;
}

.app-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.16);
  margin-right: 0.5rem;
  font-size: 0.95rem;
}

/* ============================================================
   Sidebar — plain custom show/hide, deliberately not using Bootstrap's
   .offcanvas component: its lg-breakpoint rules force
   background-color/padding to transparent/0 with !important, which fights
   any custom styling placed on the same element. Full control here instead.
   ============================================================ */
.app-sidebar {
  background: linear-gradient(180deg, #0a2e28, #0c1f1c 60%, #0a1613);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

@media (max-width: 991.98px) {
  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1045;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: var(--shadow-lg);
  }

  .app-sidebar.show {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.5);
    z-index: 1040;
  }

  .sidebar-backdrop.show {
    display: block;
  }
}

.app-sidebar .sidebar-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: rgba(255, 255, 255, 0.35);
  padding: 1rem 0.75rem 0.35rem;
}

.app-sidebar .nav-link {
  color: rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.7rem;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.86rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.app-sidebar .nav-link .nav-icon {
  width: 20px;
  text-align: center;
  opacity: 0.85;
  flex-shrink: 0;
}

.app-sidebar .nav-link:hover,
.app-sidebar .nav-link:focus {
  background-color: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.app-sidebar .nav-link.active {
  background-color: rgba(45, 212, 191, 0.14);
  color: #fff;
  border-left-color: var(--brand-400);
}

.app-sidebar .nav-link.placeholder-link {
  color: rgba(255, 255, 255, 0.32);
}

.app-sidebar .nav-link.placeholder-link:hover {
  color: rgba(255, 255, 255, 0.55);
}

/* Desktop-only collapsed sidebar: icons only, labels/section headers hidden.
   Mobile uses a completely different off-canvas mechanism (see the
   max-width media query above) so this is scoped to the same min-width
   breakpoint to avoid any interaction between the two. */
@media (min-width: 992px) {
  .app-sidebar.collapsed {
    width: 64px !important;
  }

  .app-sidebar.collapsed .sidebar-section-label,
  .app-sidebar.collapsed .nav-link span {
    display: none;
  }

  .app-sidebar.collapsed .nav-link {
    justify-content: center;
    gap: 0;
  }
}

/* ============================================================
   Cards & tables
   ============================================================ */
.card {
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.card-hover {
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

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

.kpi-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--ink-200);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  height: 100%;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

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

.kpi-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.kpi-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-500);
  margin-bottom: 0.15rem;
}

.kpi-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--ink-900);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.table {
  --bs-table-hover-bg: var(--brand-50);
}

.table thead th {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-500);
  border-bottom: 2px solid var(--ink-200);
  background-color: var(--ink-50);
  white-space: nowrap;
}

.table tbody td {
  font-size: 0.88rem;
  vertical-align: middle;
}

.table tfoot td {
  background-color: var(--brand-50);
  border-top: 2px solid var(--brand-200, #99f6e4);
}

.card > .table-responsive:first-child .table,
.card > .table-responsive:first-child table {
  margin-bottom: 0;
}

/* ============================================================
   Filter bar
   ============================================================ */
.filter-bar {
  background: var(--surface);
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow-sm);
}

.filter-bar .form-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-500);
}

.lokasyon-pill {
  border: 1px solid var(--brand-500);
  background: linear-gradient(135deg, var(--brand-50), #fff);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.6rem;
}

.lokasyon-pill .form-label {
  color: var(--brand-700);
}

.canli-gosterge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-500);
}

.canli-nokta {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-500);
  box-shadow: 0 0 0 0 rgba(20, 184, 166, 0.6);
  animation: canli-pulse 1.6s infinite;
}

@keyframes canli-pulse {
  0% { box-shadow: 0 0 0 0 rgba(20, 184, 166, 0.55); }
  70% { box-shadow: 0 0 0 6px rgba(20, 184, 166, 0); }
  100% { box-shadow: 0 0 0 0 rgba(20, 184, 166, 0); }
}

/* ============================================================
   Badges & alerts
   ============================================================ */
.badge {
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: 6px;
}

.alert {
  border-radius: var(--radius-md);
  border: 1px solid transparent;
}

.alert-danger {
  background-color: #fef2f4;
  border-color: #fecdd6;
  color: #9f1239;
}

.alert-secondary {
  background-color: var(--ink-50);
  border-color: var(--ink-200);
  color: var(--ink-500);
}

/* ============================================================
   Login page
   ============================================================ */
.login-page {
  background: radial-gradient(circle at top left, #0d9488 0%, #064e42 45%, #042f2c 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.login-card {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.login-card .card-header {
  background: linear-gradient(135deg, var(--brand-700), var(--brand-600));
  color: #fff;
  border: none;
  padding: 1.5rem 1.5rem 1.25rem;
}

/* ============================================================
   Misc
   ============================================================ */
.sidebar-scroll {
  overflow-y: auto;
}

.sidebar-scroll::-webkit-scrollbar {
  width: 6px;
}

.sidebar-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--ink-500);
}

.empty-state i {
  font-size: 1.8rem;
  color: var(--ink-400);
  margin-bottom: 0.5rem;
}

/* ============================================================
   Pending-package cards (Bekleyen Paketler) — a grid of cards
   instead of a wide data table, so richer per-order detail
   (phone, address, courier, notes) never forces horizontal
   scrolling on a phone: minmax(280px, 1fr) collapses to a single
   column on narrow viewports and flows into multiple columns as
   space allows.
   ============================================================ */
.paket-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.paket-karti {
  background: var(--surface);
  border: 1px solid var(--ink-100);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.paket-karti-ust {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.paket-referans {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink-500);
  text-transform: uppercase;
}

.paket-musteri {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink-900);
}

.paket-detay-satirlari {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.paket-detay-satiri {
  font-size: 0.85rem;
  color: var(--ink-700);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.paket-detay-satiri i {
  color: var(--brand-600);
  width: 1em;
  flex-shrink: 0;
}

a.paket-telefon {
  color: var(--brand-700);
  text-decoration: none;
  font-weight: 600;
}

a.paket-telefon:hover {
  text-decoration: underline;
}

.paket-urunler {
  font-size: 0.88rem;
  color: var(--ink-700);
  background: var(--ink-50);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.65rem;
  line-height: 1.4;
}

.paket-not {
  font-size: 0.82rem;
  color: var(--accent-600);
  font-style: italic;
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
}

.paket-not i {
  margin-top: 0.15rem;
  flex-shrink: 0;
}

.paket-karti-alt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--ink-200);
}

.paket-tutar {
  font-weight: 700;
  color: var(--brand-700);
  font-size: 1rem;
}

.paket-zaman {
  font-size: 0.78rem;
  color: var(--ink-400);
}
