/* ==========================================================================
   Zeyker Global Yönetim Paneli - Mobil Öncelikli Modern Tasarım
   Renk Paleti: Zeyker Lacivert (#040E27 / #0B1F3A) + Gerçek Altın (#D2AF85)
   ========================================================================== */

:root {
  --bg: #040E27;
  --bg-elevated: #0B1F3A;
  --bg-card: #0F2442;
  --bg-hover: #152E52;
  --bg-input: #07152D;
  --border: rgba(210, 175, 133, 0.18);
  --border-strong: rgba(210, 175, 133, 0.35);
  --text: #F4F6FA;
  --text-soft: #CBD5E1;
  --text-muted: #94A3B8;

  --gold: #D2AF85;
  --gold-line: #C2A377;
  --gold-dark: #A98A5E;
  --gold-light: #EADDBB;
  --gold-text: #EADDBB;
  --gold-soft: rgba(210, 175, 133, 0.14);
  --btn-gold-text: #040E27;

  --success: #22C55E;
  --success-soft: rgba(34, 197, 94, 0.15);
  --warning: #EAB308;
  --warning-soft: rgba(234, 179, 8, 0.15);
  --danger: #EF4444;
  --danger-soft: rgba(239, 68, 68, 0.16);
  --info: #38BDF8;
  --info-soft: rgba(56, 189, 248, 0.15);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.35);
  --radius: 14px;
  --radius-sm: 10px;
  --sidebar-w: 256px;
  --header-h: 60px;
  --bottom-nav-h: 64px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

[data-theme="light"] {
  --bg: #F4F6FA;
  --bg-elevated: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-hover: #F1F5F9;
  --bg-input: #F8FAFC;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;
  --text: #040E27;
  --text-soft: #334155;
  --text-muted: #64748B;

  --gold: #B89668;
  --gold-line: #A98A5E;
  --gold-dark: #8E7149;
  --gold-light: #D2AF85;
  --gold-text: #7D6544;
  --gold-soft: rgba(184, 150, 104, 0.13);
  --btn-gold-text: #FFFFFF;

  --success: #16A34A;
  --success-soft: rgba(22, 163, 74, 0.11);
  --warning: #CA8A04;
  --warning-soft: rgba(202, 138, 4, 0.12);
  --danger: #DC2626;
  --danger-soft: rgba(220, 38, 38, 0.10);
  --info: #0284C7;
  --info-soft: rgba(2, 132, 199, 0.10);

  --shadow-sm: 0 1px 4px rgba(4, 14, 39, 0.06);
  --shadow-md: 0 8px 24px rgba(4, 14, 39, 0.09);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  display: block;
}

/* Scrollbar */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; }

/* App Shell */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* Desktop Sidebar */
.sidebar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  flex-direction: column;
  z-index: 40;
  padding: 18px 14px;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}

.sidebar__logo {
  height: 34px;
  width: auto;
  object-fit: contain;
}

[data-theme="light"] .sidebar__logo-wrap {
  background: #040E27;
  padding: 6px 10px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
}

.sidebar__nav {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  font-weight: 500;
  font-size: 13.5px;
  transition: background .15s, color .15s;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text);
  text-decoration: none;
}

.nav-item.is-active {
  background: var(--gold-soft);
  color: var(--gold-text);
  font-weight: 600;
  border: 1px solid var(--border);
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--gold);
  color: var(--btn-gold-text);
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 99px;
  min-width: 20px;
  text-align: center;
}

.sidebar__footer {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Main Area */
.main-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom) + 18px);
}

/* Top Bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: calc(var(--header-h) + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 14px;
  padding-right: 14px;
  gap: 10px;
  backdrop-filter: blur(12px);
}

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

.topbar__title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  transition: background .15s, border-color .15s;
}

.icon-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
  text-decoration: none;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

/* Content Container */
.content {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 16px 14px 24px;
}

/* Bottom Navigation (Mobile) */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 35;
  height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
}

.bottom-nav__item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  padding: 6px 2px;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}

.bottom-nav__item svg {
  width: 20px;
  height: 20px;
}

.bottom-nav__item.is-active {
  color: var(--gold-text);
  font-weight: 600;
}

.bottom-nav__badge {
  position: absolute;
  top: 4px;
  right: calc(50% - 18px);
  background: var(--gold);
  color: var(--btn-gold-text);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 99px;
}

/* Mobile Drawer */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.65);
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}

.drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: 280px;
  max-width: 85vw;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  z-index: 65;
  transform: translateX(-100%);
  transition: transform .22s ease;
  display: flex;
  flex-direction: column;
  padding: 16px 14px calc(16px + env(safe-area-inset-bottom));
}

.drawer.is-open {
  transform: translateX(0);
}

/* Cards & Grids */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.card + .card {
  margin-top: 14px;
}

.card__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.card__title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color .15s, transform .15s;
}

.kpi-card:hover {
  border-color: var(--border-strong);
  text-decoration: none;
}

.kpi-card__label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.kpi-card__value {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.kpi-card--gold .kpi-card__value {
  color: var(--gold-text);
}

.kpi-card__sub {
  font-size: 11.5px;
  color: var(--text-muted);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

/* Page Header & Filters */
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.page-head__title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
}

.page-head__sub {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--text-muted);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-soft);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
}

.chip.is-active {
  background: var(--gold);
  color: var(--btn-gold-text);
  border-color: var(--gold);
  font-weight: 700;
}

.chip:hover {
  text-decoration: none;
  border-color: var(--border-strong);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s, opacity .15s, transform .1s;
  white-space: nowrap;
}

.btn:hover {
  background: var(--bg-hover);
  text-decoration: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn--gold {
  background: var(--gold);
  color: var(--btn-gold-text);
  border-color: var(--gold);
}

.btn--gold:hover {
  background: var(--gold-dark);
  border-color: var(--gold-dark);
  color: var(--btn-gold-text);
}

.btn--outline-gold {
  background: var(--gold-soft);
  color: var(--gold-text);
  border-color: var(--border-strong);
}

.btn--success {
  background: var(--success-soft);
  color: var(--success);
  border-color: rgba(34, 197, 94, 0.35);
}

.btn--danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.35);
}

.btn--sm {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 8px;
}

.btn--block {
  width: 100%;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.badge--gold { background: var(--gold-soft); color: var(--gold-text); }
.badge--success { background: var(--success-soft); color: var(--success); }
.badge--warning { background: var(--warning-soft); color: var(--warning); }
.badge--danger { background: var(--danger-soft); color: var(--danger); }
.badge--info { background: var(--info-soft); color: var(--info); }
.badge--muted { background: rgba(148, 163, 184, 0.14); color: var(--text-muted); }

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field__label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-soft);
}

.input, select.input, textarea.input {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}

textarea.input {
  min-height: 88px;
  resize: vertical;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13.5px;
}

.check-row input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--gold);
}

/* Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.table th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 600;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table tbody tr:hover {
  background: var(--bg-hover);
}

/* Alerts & Banners */
.alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 14px;
  font-size: 13.5px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.alert--success { background: var(--success-soft); border-color: rgba(34, 197, 94, 0.35); color: var(--success); }
.alert--danger { background: var(--danger-soft); border-color: rgba(239, 68, 68, 0.35); color: var(--danger); }
.alert--warning { background: var(--warning-soft); border-color: rgba(234, 179, 8, 0.35); color: var(--warning); }
.alert--gold { background: var(--gold-soft); border-color: var(--border-strong); color: var(--gold-text); }

/* Modals */
.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: flex-end;
  justify-content: center;
  background: rgba(2, 6, 23, 0.72);
  padding: 0;
}

.modal.is-open {
  display: flex;
}

.modal__panel {
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 18px 18px 0 0;
  padding: 18px 16px calc(22px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-md);
}

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.modal__title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

/* Activity / Timeline List */
.list-stack {
  display: flex;
  flex-direction: column;
}

.list-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}

.list-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.list-row__main {
  min-width: 0;
  flex: 1;
}

.list-row__title {
  font-weight: 600;
  color: var(--text);
  font-size: 13.5px;
}

.list-row__meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Toast */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 340px;
}

.toast {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--gold);
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
}

/* Login Page */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(circle at top right, rgba(210, 175, 133, 0.14), transparent 45%), var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px 22px;
  box-shadow: var(--shadow-md);
}

.auth-card__logo {
  height: 44px;
  margin: 0 auto 18px;
}

/* Utilities */
.text-muted { color: var(--text-muted); }
.text-gold { color: var(--gold-text); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.fw-bold { font-weight: 700; }
.mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 18px; }
.mb-2 { margin-bottom: 12px; }
.flex-wrap { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.code-box {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  overflow-x: auto;
  white-space: pre;
  color: var(--gold-light);
}
[data-theme="light"] .code-box {
  color: #0F172A;
}

/* Responsive Breakpoints */
@media (min-width: 640px) {
  .form-grid--2 {
    grid-template-columns: repeat(2, 1fr);
  }
  .modal {
    align-items: center;
    padding: 20px;
  }
  .modal__panel {
    border-radius: 16px;
    padding: 22px;
  }
  .kpi-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 960px) {
  .sidebar {
    display: flex;
  }
  .main-wrap {
    margin-left: var(--sidebar-w);
    padding-bottom: 24px;
  }
  .bottom-nav,
  #menuToggle {
    display: none;
  }
  .content {
    padding: 24px 28px;
  }
  .kpi-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
  }
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Print Styles */
@media print {
  .sidebar, .topbar, .bottom-nav, .no-print {
    display: none !important;
  }
  .main-wrap {
    margin: 0 !important;
    padding: 0 !important;
  }
  body {
    background: #FFFFFF !important;
    color: #000000 !important;
  }
}
