/* =====================================================================
   RotaCRM - Panel Teması
   Lacivert + Turuncu | Inter | Açık & Koyu tema
   ===================================================================== */

:root {
  /* Marka */
  --navy-900: #0a1830;
  --navy-800: #102a4f;
  --navy-700: #163563;
  --navy-600: #1d4079;
  --orange:   #f5821f;
  --orange-600: #e0700f;
  --orange-soft: #fff2e4;

  /* Semantik */
  --green:  #16a34a;  --green-soft:  #e7f6ec;
  --amber:  #f59e0b;  --amber-soft:  #fdf3e0;
  --red:    #dc2626;  --red-soft:    #fbeaea;
  --blue:   #2563eb;  --blue-soft:   #e9f0fe;
  --gray:   #64748b;  --gray-soft:   #eef1f6;

  /* Yüzeyler (açık tema) */
  --bg:        #f3f5fa;
  --surface:   #ffffff;
  --surface-2: #f8fafc;
  --border:    #e6eaf2;
  --text:      #0f1b33;
  --text-muted:#64748b;
  --shadow-sm: 0 1px 2px rgba(15,27,51,.05);
  --shadow:    0 4px 16px rgba(15,27,51,.06);
  --shadow-lg: 0 12px 32px rgba(15,27,51,.10);
  --radius:    14px;
  --radius-sm: 10px;
  --sidebar-w: 264px;
}

/* Koyu tema */
[data-theme="dark"] {
  --bg:        #0a101e;
  --surface:   #111a2c;
  --surface-2: #0e1626;
  --border:    #1e293b;
  --text:      #e6ecf6;
  --text-muted:#8a97ad;
  --gray-soft: #1a2438;
  --orange-soft:#2a1d0e;
  --green-soft:#13241a;
  --amber-soft:#251c0e;
  --red-soft:  #271417;
  --blue-soft: #131d33;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow:    0 4px 16px rgba(0,0,0,.35);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.45);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* =====================================================================
   GİRİŞ EKRANI
   ===================================================================== */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}
.auth-side {
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(245,130,31,.22), transparent 55%),
    linear-gradient(160deg, var(--navy-900), var(--navy-700));
  color: #fff;
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.auth-side .brand-lg { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.auth-side .brand-lg span { color: var(--orange); }
.auth-side h1 { font-size: 38px; line-height: 1.12; font-weight: 800; letter-spacing: -.03em; max-width: 440px; }
.auth-side .lead { color: rgba(255,255,255,.72); max-width: 400px; }
.auth-side .feat { display: flex; gap: 12px; align-items: center; margin: 10px 0; color: rgba(255,255,255,.85); }
.auth-side .feat svg { color: var(--orange); flex: 0 0 auto; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--surface); }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h2 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 4px; }
.auth-card .sub { color: var(--text-muted); margin-bottom: 28px; }

@media (max-width: 880px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { display: none; }
}

/* =====================================================================
   YERLEŞİM (sidebar + içerik)
   ===================================================================== */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: linear-gradient(180deg, var(--navy-900), var(--navy-800));
  color: #cdd6e6;
  position: fixed;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  z-index: 40;
  transition: transform .25s ease;
}
.sidebar .brand {
  display: flex; align-items: center; gap: 10px;
  padding: 22px 22px 18px;
  font-weight: 800; font-size: 20px; letter-spacing: -.02em; color: #fff;
}
.sidebar .brand .logo {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--orange), #ffb066);
  display: grid; place-items: center; color: #1a1206; font-weight: 900;
}
.sidebar .brand span { color: var(--orange); }
.nav-scroll { overflow-y: auto; padding: 6px 12px 20px; flex: 1; }
.nav-scroll::-webkit-scrollbar { width: 6px; }
.nav-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 8px; }

.nav-group-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: #5d6f8d; padding: 16px 12px 6px; font-weight: 600;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 10px; margin-bottom: 2px;
  color: #aebbd2; font-weight: 500; cursor: pointer;
  transition: background .15s, color .15s;
}
.nav-item svg { width: 18px; height: 18px; flex: 0 0 auto; opacity: .85; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: var(--orange); color: #1a1206; font-weight: 600; box-shadow: 0 6px 16px rgba(245,130,31,.32); }
.nav-item.active svg { opacity: 1; }
.nav-item .badge-count {
  margin-left: auto; background: rgba(255,255,255,.14); color: #fff;
  font-size: 11px; padding: 1px 7px; border-radius: 20px; font-weight: 600;
}
.nav-item.active .badge-count { background: rgba(26,18,6,.18); color: #1a1206; }

.content {
  flex: 1; margin-left: var(--sidebar-w);
  min-width: 0; display: flex; flex-direction: column;
}

/* Üst bar */
.topbar {
  height: 64px; background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px; position: sticky; top: 0; z-index: 30;
}
.topbar .page-title { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.topbar .spacer { flex: 1; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-muted);
  display: grid; place-items: center; cursor: pointer; position: relative;
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn .dot { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); border: 2px solid var(--surface); }
.menu-toggle { display: none; }

.user-chip { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--navy-700), var(--navy-600));
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px;
}
.user-chip .u-name { font-weight: 600; font-size: 13px; line-height: 1.1; }
.user-chip .u-role { font-size: 11px; color: var(--text-muted); }

.page { padding: 24px; max-width: 1480px; width: 100%; }
.page-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.page-head .sub { color: var(--text-muted); font-size: 13px; }
.page-head .spacer { flex: 1; }

/* =====================================================================
   KARTLAR
   ===================================================================== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card .card-h {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.card .card-h h3 { font-size: 15px; font-weight: 700; margin: 0; }
.card .card-h .spacer { flex: 1; }
.card .card-b { padding: 20px; }

/* İstatistik kartları */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 16px; }
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.stat .ic {
  width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 14px;
}
.stat .ic svg { width: 20px; height: 20px; }
.stat .val { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.stat .lbl { color: var(--text-muted); font-size: 13px; margin-top: 2px; }
.stat .trend { font-size: 12px; font-weight: 600; margin-top: 8px; display: inline-flex; gap: 4px; align-items: center; }
.ic.navy   { background: var(--navy-900); color: #fff; }
.ic.orange { background: var(--orange-soft); color: var(--orange-600); }
.ic.green  { background: var(--green-soft); color: var(--green); }
.ic.blue   { background: var(--blue-soft); color: var(--blue); }
.ic.red    { background: var(--red-soft); color: var(--red); }
.ic.amber  { background: var(--amber-soft); color: var(--amber); }

/* =====================================================================
   TABLOLAR
   ===================================================================== */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data thead th {
  text-align: left; font-weight: 600; color: var(--text-muted);
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  background: var(--surface-2); white-space: nowrap;
  font-size: 12px; text-transform: uppercase; letter-spacing: .03em;
}
table.data tbody td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data .muted { color: var(--text-muted); }
.cell-main { font-weight: 600; }
.cell-sub { font-size: 12px; color: var(--text-muted); }

/* =====================================================================
   ROZETLER
   ===================================================================== */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 20px;
  white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.is-green  { background: var(--green-soft); color: var(--green); }
.badge.is-orange { background: var(--orange-soft); color: var(--orange-600); }
.badge.is-blue   { background: var(--blue-soft); color: var(--blue); }
.badge.is-red    { background: var(--red-soft); color: var(--red); }
.badge.is-amber  { background: var(--amber-soft); color: var(--amber); }
.badge.is-gray   { background: var(--gray-soft); color: var(--gray); }

/* =====================================================================
   BUTONLAR
   ===================================================================== */
.btn {
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  font-family: inherit; font-size: 13.5px; font-weight: 600;
  padding: 9px 16px; border-radius: 10px; border: 1px solid transparent;
  cursor: pointer; transition: all .15s; white-space: nowrap; line-height: 1;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--navy-900); color: #fff; }
.btn-primary:hover { background: var(--navy-700); }
.btn-orange { background: var(--orange); color: #1a1206; }
.btn-orange:hover { background: var(--orange-600); color: #fff; }
.btn-outline { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-outline:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text-muted); padding: 8px; }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.btn-icon { padding: 7px; width: 34px; height: 34px; }

.row-actions { display: inline-flex; gap: 6px; }

/* =====================================================================
   FORMLAR
   ===================================================================== */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.field .req { color: var(--red); }
.input, .select, .textarea {
  width: 100%; font-family: inherit; font-size: 14px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 13px; transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 92px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(245,130,31,.14);
}
.input::placeholder { color: var(--text-muted); }
.field .hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 16px; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.search-box { position: relative; flex: 1; min-width: 200px; max-width: 340px; }
.search-box svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); width: 16px; height: 16px; }
.search-box .input { padding-left: 36px; }

/* =====================================================================
   MODAL (Bootstrap üzeri ince ayar)
   ===================================================================== */
.modal-content {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
.modal-header, .modal-footer { border-color: var(--border); padding: 18px 22px; }
.modal-body { padding: 22px; }
.modal-title { font-weight: 800; letter-spacing: -.01em; font-size: 17px; }

/* =====================================================================
   TOAST
   ===================================================================== */
.toast-stack { position: fixed; top: 18px; right: 18px; z-index: 1080; display: flex; flex-direction: column; gap: 10px; }
.toast-item {
  display: flex; align-items: center; gap: 12px; min-width: 280px; max-width: 380px;
  background: var(--surface); border: 1px solid var(--border); border-left-width: 4px;
  border-radius: 12px; padding: 13px 16px; box-shadow: var(--shadow-lg);
  animation: toastIn .25s ease;
}
.toast-item .t-ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: 0 0 auto; }
.toast-item .t-msg { font-size: 13.5px; font-weight: 500; }
.toast-item.success { border-left-color: var(--green); }
.toast-item.success .t-ic { background: var(--green-soft); color: var(--green); }
.toast-item.error   { border-left-color: var(--red); }
.toast-item.error .t-ic { background: var(--red-soft); color: var(--red); }
.toast-item.warning { border-left-color: var(--amber); }
.toast-item.warning .t-ic { background: var(--amber-soft); color: var(--amber); }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* =====================================================================
   YARDIMCILAR
   ===================================================================== */
.empty { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.empty svg { width: 44px; height: 44px; opacity: .4; margin-bottom: 12px; }
.flex { display: flex; } .items-center { align-items: center; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.mt-3 { margin-top: 16px; } .mb-0 { margin-bottom: 0; }
.text-muted { color: var(--text-muted); }
.alert-line { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 12px; }
.alert-line.warn { background: var(--amber-soft); color: var(--amber); }
.alert-line.danger { background: var(--red-soft); color: var(--red); }

/* =====================================================================
   MOBİL
   ===================================================================== */
.backdrop { display: none; }
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .content { margin-left: 0; }
  .menu-toggle { display: grid; }
  .backdrop.show { display: block; position: fixed; inset: 0; background: rgba(7,14,28,.5); z-index: 35; }
}
