/* ═══════════════════════════════════════════════════════
   CARİSTOK — Epic Design System v3
   ═══════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --p1: #4f46e5; --p2: #7c3aed;
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --primary-light: #ede9fe;

  --success: #059669; --success-light: #d1fae5;
  --warning: #d97706; --warning-light: #fef3c7;
  --danger:  #dc2626; --danger-light:  #fee2e2;
  --info:    #0284c7; --info-light:    #e0f2fe;

  --bg:        #f0f2ff;
  --surface:   #ffffff;
  --border:    #e4e6f5;
  --text:      #1e1b4b;
  --text-sub:  #4338ca;
  --text-muted:#64748b;
  --text-faint:#a5b4fc;

  --sidebar-w: 250px;
  --topbar-h:  62px;
  --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 20px;

  --sh-sm: 0 1px 4px rgba(79,70,229,.08), 0 1px 2px rgba(0,0,0,.04);
  --sh:    0 4px 16px rgba(79,70,229,.12), 0 2px 6px rgba(0,0,0,.04);
  --sh-lg: 0 8px 28px rgba(79,70,229,.16), 0 4px 12px rgba(0,0,0,.06);
  --sh-xl: 0 20px 56px rgba(79,70,229,.22), 0 8px 20px rgba(0,0,0,.08);

  --g-primary: linear-gradient(135deg,#4f46e5 0%,#7c3aed 100%);
  --g-success: linear-gradient(135deg,#059669 0%,#047857 100%);
  --g-danger:  linear-gradient(135deg,#dc2626 0%,#b91c1c 100%);
  --g-warning: linear-gradient(135deg,#d97706 0%,#b45309 100%);
  --g-info:    linear-gradient(135deg,#0284c7 0%,#0369a1 100%);
  --g-sidebar: linear-gradient(175deg,#1e1b4b 0%,#2e1065 55%,#1e1b4b 100%);
}

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

/* ── Layout ── */
.sidebar {
  position: fixed; left:0; top:0; bottom:0;
  width: var(--sidebar-w);
  background: var(--g-sidebar);
  display: flex; flex-direction: column;
  z-index: 100;
  box-shadow: 6px 0 24px rgba(0,0,0,.2);
  transition:width .24s cubic-bezier(.4,0,.2,1),transform .28s cubic-bezier(.4,0,.2,1);
}
.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; transition:margin-left .24s cubic-bezier(.4,0,.2,1); }
.content { flex:1; padding: 24px; animation: fadeUp .3s ease; }

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

/* ── Sidebar Brand ── */
.sidebar-brand {
  padding: 22px 16px 18px;
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.15);
  position:relative;
}
.brand-icon {
  width: 40px; height: 40px;
  background: var(--g-primary);
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(79,70,229,.5);
  flex-shrink: 0;
}
.brand-name {
  font-size: 17px; font-weight: 800; color: white;
  letter-spacing: -.3px;
}
.sidebar-collapse-btn {
  margin-left:auto; width:27px; height:27px; flex:0 0 27px;
  display:flex; align-items:center; justify-content:center;
  border:1px solid rgba(255,255,255,.16); border-radius:8px;
  background:rgba(255,255,255,.08); color:#fff;
  font-size:21px; line-height:1; cursor:pointer; transition:all .18s;
}
.sidebar-collapse-btn:hover { background:rgba(255,255,255,.18); transform:scale(1.05); }

@media (min-width:1025px) {
  body.sidebar-collapsed .sidebar { width:76px; }
  body.sidebar-collapsed .main { margin-left:76px; }
  body.sidebar-collapsed .sidebar-brand { padding:16px 10px; justify-content:center; }
  body.sidebar-collapsed .brand-icon { width:38px; height:38px; }
  body.sidebar-collapsed .brand-name,
  body.sidebar-collapsed .nav-section,
  body.sidebar-collapsed .user-info,
  body.sidebar-collapsed .btn-cikis { display:none; }
  body.sidebar-collapsed .sidebar-collapse-btn {
    position:absolute; right:-13px; top:50%; transform:translateY(-50%);
    background:var(--primary); box-shadow:0 3px 10px rgba(0,0,0,.3);
  }
  body.sidebar-collapsed .sidebar-collapse-btn:hover { transform:translateY(-50%) scale(1.06); }
  body.sidebar-collapsed .sidebar-nav { padding:12px 9px; }
  body.sidebar-collapsed .nav-item {
    justify-content:center; padding:10px 8px; gap:0;
    font-size:0; overflow:hidden;
  }
  body.sidebar-collapsed .nav-item .icon { width:auto; font-size:18px; }
  body.sidebar-collapsed .nav-item:hover { transform:none; }
  body.sidebar-collapsed .sidebar-user { justify-content:center; padding:12px 8px; }
  body.sidebar-collapsed .user-avatar { width:36px; height:36px; }
}

/* ── Sidebar Nav ── */
.sidebar-nav {
  flex:1; padding: 10px 10px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.06) transparent;
}
.nav-section {
  font-size: 9px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 1.8px;
  color: rgba(255,255,255,.22);
  padding: 18px 10px 5px;
}
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 12px;
  border-radius: 10px;
  color: rgba(255,255,255,.55);
  text-decoration: none;
  font-size: 13px; font-weight: 500;
  transition: all .18s;
  margin-bottom: 1px;
  position: relative;
}
.nav-item:hover { background: rgba(255,255,255,.1); color: white; transform: translateX(3px); }
.nav-item.active {
  background: var(--g-primary);
  color: white; font-weight: 700;
  box-shadow: 0 4px 14px rgba(79,70,229,.5);
}
.nav-item .icon { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; }

/* ── Sidebar User ── */
.sidebar-user {
  padding: 12px 14px;
  border-top: 1px solid rgba(255,255,255,.07);
  display: flex; align-items: center; gap: 10px;
  background: rgba(0,0,0,.12);
}
.user-avatar {
  width: 34px; height: 34px;
  background: var(--g-primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: white;
  flex-shrink: 0;
  box-shadow: 0 3px 8px rgba(79,70,229,.4);
}
.user-info { flex:1; min-width:0; }
.user-name { font-size:13px; font-weight:650; color:white; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.user-rol  { font-size:11px; color:rgba(255,255,255,.38); }
.btn-cikis {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.45); cursor:pointer; border-radius:7px;
  padding:5px 8px; font-size:14px; transition:all .15s; flex-shrink:0;
}
.btn-cikis:hover { background: rgba(220,38,38,.4); color:white; border-color:transparent; }

/* ── Topbar ── */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 2px solid transparent;
  background-clip: padding-box;
  position: relative;
  display: flex; align-items: center; padding: 0 24px; gap:12px;
  position: sticky; top:0; z-index:50;
  box-shadow: 0 2px 12px rgba(79,70,229,.08);
}
.topbar::after {
  content:''; position:absolute; bottom:-2px; left:0; right:0; height:2px;
  background: var(--g-primary);
}
.topbar-title {
  font-size:16px; font-weight:800; color:var(--text);
  letter-spacing:-.3px; flex:1;
}
.topbar-actions { display:flex; gap:8px; align-items:center; }

/* ── Buttons ── */
.btn {
  display:inline-flex; align-items:center; gap:6px;
  padding:8px 16px; border-radius:var(--r-sm); border:none;
  font-size:13px; font-weight:650; cursor:pointer;
  transition:all .18s; text-decoration:none; white-space:nowrap;
  line-height:1; font-family:inherit;
}
.btn:active { transform:scale(.96) !important; }
.btn:disabled { opacity:.5; cursor:not-allowed; transform:none !important; }

.btn-primary {
  background: var(--g-primary); color:white;
  box-shadow: 0 4px 12px rgba(79,70,229,.4);
}
.btn-primary:hover { box-shadow:0 6px 20px rgba(79,70,229,.55); transform:translateY(-2px); }

.btn-success {
  background: var(--g-success); color:white;
  box-shadow: 0 4px 12px rgba(5,150,105,.3);
}
.btn-success:hover { box-shadow:0 6px 20px rgba(5,150,105,.45); transform:translateY(-2px); }

.btn-danger {
  background: var(--g-danger); color:white;
  box-shadow: 0 4px 12px rgba(220,38,38,.3);
}
.btn-danger:hover { box-shadow:0 6px 20px rgba(220,38,38,.45); transform:translateY(-2px); }

.btn-warning {
  background: var(--g-warning); color:white;
  box-shadow: 0 4px 12px rgba(217,119,6,.3);
}
.btn-warning:hover { box-shadow:0 6px 20px rgba(217,119,6,.45); transform:translateY(-2px); }

.btn-secondary {
  background:var(--surface); color:var(--text-muted);
  border:1.5px solid var(--border); box-shadow:var(--sh-sm);
}
.btn-secondary:hover { background:var(--primary-light); color:var(--primary); border-color:#c4b5fd; transform:translateY(-1px); }

.btn-outline {
  background:transparent; color:var(--primary);
  border:1.5px solid var(--primary);
}
.btn-outline:hover { background:var(--primary-light); }

.btn-sm  { padding:5px 12px; font-size:12px; }
.btn-lg  { padding:12px 24px; font-size:14px; }
.btn-icon { padding:7px; border-radius:var(--r-sm); }

/* ── Cards ── */
.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--sh);
  border: 1.5px solid var(--border);
  overflow: hidden;
  margin-bottom: 20px;
  transition: box-shadow .22s, transform .22s;
}
.card:hover { box-shadow: var(--sh-lg); }

.card-header {
  padding: 15px 20px;
  display:flex; align-items:center; justify-content:space-between;
  border-bottom: 1.5px solid var(--border);
  background: linear-gradient(135deg, #faf9ff 0%, #f5f3ff 100%);
}
.card-title { font-size:14px; font-weight:750; color:var(--text); letter-spacing:-.15px; }
.card-body  { padding:20px; }

.search-bar { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.search-input-wrap { position:relative; }
.search-input-wrap .icon { position:absolute; left:10px; top:50%; transform:translateY(-50%); color:var(--text-muted); }
.search-input-wrap input { padding-left:32px; }

/* ── Stat Cards ── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px; margin-bottom: 22px;
}
.stat-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 20px;
  border: 1.5px solid var(--border);
  box-shadow: var(--sh-sm);
  display: flex; align-items: center; gap: 15px;
  transition: all .22s;
  position: relative; overflow: hidden;
}
.stat-card::before {
  content:''; position:absolute;
  top:0; left:0; bottom:0; width:4px;
  background: var(--g-primary);
  border-radius: 0 2px 2px 0;
}
.stat-card:nth-child(2)::before { background: var(--g-success); }
.stat-card:nth-child(3)::before { background: var(--g-warning); }
.stat-card:nth-child(4)::before { background: var(--g-danger); }
.stat-card:hover { transform:translateY(-3px); box-shadow:var(--sh-lg); }

.stat-icon {
  width:50px; height:50px; border-radius:var(--r);
  background: var(--g-primary);
  display:flex; align-items:center; justify-content:center;
  font-size:22px; flex-shrink:0;
  box-shadow: 0 6px 16px rgba(79,70,229,.35);
}
.stat-card:nth-child(2) .stat-icon { background:var(--g-success); box-shadow:0 6px 16px rgba(5,150,105,.35); }
.stat-card:nth-child(3) .stat-icon { background:var(--g-warning); box-shadow:0 6px 16px rgba(217,119,6,.35); }
.stat-card:nth-child(4) .stat-icon { background:var(--g-danger);  box-shadow:0 6px 16px rgba(220,38,38,.35); }

.stat-info { flex:1; min-width:0; }
.stat-info .label {
  font-size:10.5px; font-weight:750;
  text-transform:uppercase; letter-spacing:.7px;
  color:var(--text-muted); margin-bottom:5px;
}
.stat-info .value { font-size:24px; font-weight:800; color:var(--text); line-height:1; }
.stat-info .sub   { font-size:11px; color:var(--text-faint); margin-top:3px; }

/* ── Tables ── */
.table-wrap { overflow-x:auto; }
table { width:100%; border-collapse:collapse; font-size:13px; }

thead tr { background: var(--g-primary); }
thead th {
  padding: 11px 16px;
  text-align: left;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .7px;
  color: rgba(255,255,255,.9);
  border-bottom: none;
  white-space: nowrap;
}

tbody tr { border-bottom: 1px solid #f0f1fa; transition: background .12s; }
tbody tr:hover { background: #f5f3ff; }
tbody tr:nth-child(even) { background: #fafafe; }
tbody tr:nth-child(even):hover { background: #f5f3ff; }
tbody tr:last-child { border-bottom: none; }

td {
  padding: 11px 16px;
  color: #374151;
  vertical-align: middle;
}

.text-right   { text-align:right; }
.text-center  { text-align:center; }
.font-bold    { font-weight:700; }
.text-muted   { color:var(--text-muted); }
.text-sm      { font-size:12px; }
.text-xs      { font-size:11px; }
.text-success { color:var(--success) !important; }
.text-danger  { color:var(--danger)  !important; }
.text-warning { color:var(--warning) !important; }
.text-primary { color:var(--primary) !important; }

.empty-state { text-align:center; padding:50px 20px; color:var(--text-faint); font-size:13px; }

/* ── Badges ── */
.badge {
  display:inline-flex; align-items:center;
  padding:3px 10px; border-radius:20px;
  font-size:11px; font-weight:700; letter-spacing:.2px; white-space:nowrap;
}
.badge-green  { background:#d1fae5; color:#065f46; }
.badge-blue   { background:#dbeafe; color:#1e40af; }
.badge-red    { background:#fee2e2; color:#991b1b; }
.badge-yellow { background:#fef3c7; color:#92400e; }
.badge-purple { background:#ede9fe; color:#5b21b6; }
.badge-gray   { background:#f3f4f6; color:#4b5563; }
.badge-indigo { background:#e0e7ff; color:#3730a3; }
.badge-orange { background:#ffedd5; color:#c2410c; }
.badge-teal   { background:#ccfbf1; color:#0f766e; }

/* ── Forms ── */
.form-grid   { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.form-grid-3 { display:grid; grid-template-columns:1fr 1fr 1fr; gap:14px; }
.form-group  { display:flex; flex-direction:column; gap:5px; }
.form-group label { font-size:12px; font-weight:650; color:#4b5563; }

.form-control {
  padding:9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size:13px; color:var(--text); background:var(--surface);
  outline:none; transition:all .18s; width:100%; font-family:inherit;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
  background: #faf9ff;
}
.form-control::placeholder { color:#c4b5fd; }
select.form-control { cursor:pointer; }
textarea.form-control { resize:vertical; min-height:80px; }

/* ── Modals ── */
.modal-overlay {
  position:fixed; inset:0;
  background: rgba(10,8,40,.55);
  backdrop-filter: blur(6px);
  display:none; align-items:center; justify-content:center;
  z-index:1000; padding:20px;
}
.modal-overlay.active { display:flex; animation:fadeIn .18s ease; }
@keyframes fadeIn { from{opacity:0} to{opacity:1} }

.modal {
  background:var(--surface); border-radius:var(--r-xl);
  width:100%; max-width:560px; max-height:90vh; overflow-y:auto;
  box-shadow:var(--sh-xl); border:1.5px solid var(--border);
  animation: slideUp .22s cubic-bezier(.22,1,.36,1);
}
.modal-lg { max-width:780px; }
.modal-sm { max-width:420px; }

@keyframes slideUp {
  from { opacity:0; transform:translateY(22px) scale(.96); }
  to   { opacity:1; transform:translateY(0) scale(1); }
}

.modal-header {
  padding:18px 22px;
  display:flex; align-items:center; justify-content:space-between;
  border-bottom:1.5px solid var(--border);
  background: linear-gradient(135deg,#f9f7ff,#fff);
  border-radius:var(--r-xl) var(--r-xl) 0 0;
  position:sticky; top:0; z-index:1;
}
.modal-title { font-size:15px; font-weight:800; color:var(--text); letter-spacing:-.2px; }
.modal-close {
  background:var(--bg); border:1.5px solid var(--border);
  width:30px; height:30px; border-radius:50%;
  cursor:pointer; font-size:14px; color:var(--text-muted);
  display:flex; align-items:center; justify-content:center;
  transition:all .15s; flex-shrink:0;
}
.modal-close:hover { background:var(--danger-light); color:var(--danger); border-color:var(--danger-light); }
.modal-body   { padding:22px; }
.modal-footer {
  padding:14px 22px; border-top:1.5px solid var(--border);
  display:flex; gap:8px; justify-content:flex-end;
  background:#faf9ff;
  border-radius:0 0 var(--r-xl) var(--r-xl);
}

/* ── Toast ── */
#toast-container {
  position:fixed; bottom:24px; right:24px;
  z-index:9999; display:flex; flex-direction:column; gap:8px;
}
.toast {
  padding:12px 18px; border-radius:var(--r);
  font-size:13px; font-weight:650; color:white;
  box-shadow:var(--sh-lg);
  transform:translateX(120%);
  transition:transform .3s cubic-bezier(.22,1,.36,1);
  max-width:320px; display:flex; align-items:center; gap:8px;
}
.toast.show { transform:translateX(0); }
.toast-success { background:var(--g-success); }
.toast-error   { background:var(--g-danger); }
.toast-info    { background:var(--g-primary); }
.toast-warning { background:var(--g-warning); }

/* ── Tabs ── */
.tabs {
  display:flex; gap:2px;
  border-bottom:2px solid var(--border);
  margin-bottom:18px;
}
.tab-btn {
  padding:9px 18px; border:none; background:none;
  cursor:pointer; font-size:13px; font-weight:650;
  color:var(--text-muted);
  border-bottom:2.5px solid transparent; margin-bottom:-2px;
  transition:all .15s; white-space:nowrap; font-family:inherit;
}
.tab-btn:hover { color:var(--primary); background:var(--primary-light); border-radius:8px 8px 0 0; }
.tab-btn.active { color:var(--primary); border-bottom-color:var(--primary); font-weight:700; }
.tab-content { display:none; }
.tab-content.active { display:block; animation:fadeUp .2s ease; }

/* ── Helpers ── */
.flex { display:flex; } .flex-col { flex-direction:column; }
.items-center { align-items:center; } .items-start { align-items:flex-start; }
.justify-between { justify-content:space-between; } .justify-end { justify-content:flex-end; }
.gap-1{gap:4px} .gap-2{gap:8px} .gap-3{gap:12px} .gap-4{gap:16px}
.w-full{width:100%} .mt-2{margin-top:8px} .mt-4{margin-top:16px}
.mb-2{margin-bottom:8px} .mb-4{margin-bottom:16px} .p-4{padding:16px}
.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* ── Scrollbar ── */
::-webkit-scrollbar { width:5px; height:5px; }
::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb { background:#c4b5fd; border-radius:3px; }
::-webkit-scrollbar-thumb:hover { background:var(--primary); }

/* ── Loading ── */
.loading-spinner {
  display:inline-block; width:18px; height:18px;
  border:2.5px solid rgba(79,70,229,.15);
  border-top-color:var(--primary); border-radius:50%;
  animation:spin .7s linear infinite;
}
@keyframes spin { to{transform:rotate(360deg)} }

/* ── Info Box ── */
.info-box {
  background:var(--primary-light); border:1.5px solid #c4b5fd;
  border-radius:var(--r-sm); padding:10px 14px;
  font-size:12px; color:#4338ca;
}

.divider { border:none; border-top:1.5px solid var(--border); margin:16px 0; }
a { text-decoration:none; }
a.link { color:var(--primary); font-weight:650; }
a.link:hover { color:var(--primary-dark); }

.grad-text {
  background:var(--g-primary);
  -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text;
}

/* ══════════════════════════════════════════════════
   MOBİL RESPONSIVE
   ══════════════════════════════════════════════════ */

/* ── Hamburger Butonu ── */
.btn-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 38px; height: 38px;
  background: var(--primary-light);
  border: 1.5px solid #c4b5fd;
  border-radius: var(--r-sm);
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: background .15s;
}
.btn-hamburger:hover { background: #ddd6fe; }
.btn-hamburger span {
  display: block;
  width: 18px; height: 2px;
  background: var(--primary);
  border-radius: 2px;
  transition: all .2s;
}

/* ── Sidebar Overlay ── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(15,12,41,.55);
  z-index: 199;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.sidebar-overlay.active { display: block; }

/* ── Tablet (≤900px) ── */
@media (max-width: 900px) {
  :root { --sidebar-w: 220px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .content { padding: 18px 16px; }
}

/* ── Mobil (≤768px) ── */
@media (max-width: 768px) {

  /* Hamburger görünür */
  .btn-hamburger { display: flex; }

  /* Sidebar — drawer olarak */
  .sidebar {
    transform: translateX(-100%);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
    z-index: 200;
    width: 260px;
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 8px 0 40px rgba(0,0,0,.35);
  }

  /* Main — tam genişlik */
  .main { margin-left: 0 !important; }

  /* Content padding */
  .content { padding: 14px 12px; }

  /* Topbar */
  .topbar { padding: 0 12px; gap: 8px; height: 54px; }
  .topbar-title { font-size: 14px; }
  .topbar-actions { gap: 5px; }
  .topbar-actions .btn { padding: 6px 10px; font-size: 12px; }
  .topbar-actions .btn .btn-text { display: none; }

  /* Tablo yatay scroll */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-wrap table { min-width: 560px; }

  /* Stat grid */
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-icon { width: 42px; height: 42px; font-size: 18px; }
  .stat-value { font-size: 20px; }

  /* Form grid */
  .form-grid, .form-grid-3 { grid-template-columns: 1fr !important; }
  [style*="grid-column:1/-1"], [style*="grid-column: 1/-1"] { grid-column: 1 !important; }

  /* Modal — aşağıdan çıkan sheet */
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .modal {
    border-radius: 20px 20px 0 0;
    max-height: 92dvh;
    overflow-y: auto;
    width: 100%;
    max-width: 100%;
    margin: 0;
    animation: slideUp .3s cubic-bezier(.22,1,.36,1);
  }
  .modal-lg { max-width: 100%; }
  .modal-sm { max-width: 100%; }
  @keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
  }

  /* Kart */
  .card { margin-bottom: 12px; border-radius: var(--r); }
  .card-header { padding: 12px 14px; flex-wrap: wrap; gap: 8px; }

  /* Search bar */
  .search-bar { flex-wrap: wrap; }
  .search-input-wrap { width: 100%; }
  .search-input-wrap input { width: 100% !important; }

  /* Butonlar */
  .btn-lg { padding: 10px 18px; font-size: 13px; }

  /* POS layout — dikey */
  .pos-layout {
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
  }
  .pos-katalog {
    height: 340px;
    order: 1;
  }
  .pos-sepet {
    order: 2;
    height: auto;
    min-height: 0;
    max-height: none;
  }

  /* Fatura/form sayfaları */
  .fatura-layout { flex-direction: column !important; }

  /* Topbar actions wrap */
  .topbar-actions { flex-shrink: 0; }
}

/* ── Küçük Mobil (≤480px) ── */
@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }

  .topbar-title { font-size: 13px; }
  /* Sadece ikon bırak, yazıyı gizle */
  .topbar-actions .btn span:not([class]) { display: none; }
  .topbar-actions .btn { padding: 7px 9px; }

  .table-wrap table { min-width: 480px; font-size: 12px; }
  th, td { padding: 7px 8px !important; }

  .pos-katalog { height: 280px; }
  .katalog-kart { min-width: 120px; }

  .modal { max-height: 96dvh; }
  .modal-header { padding: 14px 16px; }
  .modal-body { padding: 14px 16px; }
  .modal-footer { padding: 12px 16px; gap: 8px; }
  .modal-footer .btn { flex: 1; justify-content: center; }
}

/* ══════════════════════════════════════════════════
   TABLET + TELEFON GÜVENLİK KATMANI
   Masaüstü (>1024px) düzenine dokunmaz.
   ══════════════════════════════════════════════════ */
@media (min-width: 769px) and (max-width: 1024px) {
  .btn-hamburger { display:flex; }
  .sidebar-collapse-btn { display:none; }
  .sidebar {
    width:270px;
    transform:translateX(-100%);
    transition:transform .28s cubic-bezier(.4,0,.2,1);
    z-index:200;
    box-shadow:none;
  }
  .sidebar.open { transform:translateX(0); box-shadow:8px 0 40px rgba(0,0,0,.35); }
  html,body { width:100%; max-width:100%; overflow-x:clip !important; }
  .main { margin-left:0 !important; width:100%; max-width:100vw; min-width:0; overflow-x:clip; }
  .content { width:100%; max-width:100%; padding:18px; min-width:0; overflow-x:clip; }
  .content > *,.main > * { min-width:0; max-width:100%; }
  .topbar { padding:0 18px; }
  .modal-lg { max-width:calc(100vw - 40px); }
  .table-wrap,.tablo-wrap,.ek-tablo-wrap {
    width:100%; max-width:100%; overflow-x:auto;
    overscroll-behavior-inline:contain; -webkit-overflow-scrolling:touch;
    scrollbar-width:none;
  }
  .table-wrap::-webkit-scrollbar,.tablo-wrap::-webkit-scrollbar,.ek-tablo-wrap::-webkit-scrollbar { display:none; }
}

/* Yatay tablette sidebar gizlenmez; başlangıçta dar ikon şeridi olarak görünür. */
@media (hover: none) and (pointer: coarse) and (orientation: landscape) and (min-width: 769px) and (max-width: 1366px) {
  .btn-hamburger { display:none; }
  .sidebar-collapse-btn { display:flex; }
  .sidebar {
    width:var(--sidebar-w);
    transform:none;
    z-index:100;
    box-shadow:6px 0 24px rgba(0,0,0,.2);
  }
  .sidebar.open { transform:none; box-shadow:6px 0 24px rgba(0,0,0,.2); }
  .main { margin-left:var(--sidebar-w) !important; width:auto; max-width:none; min-width:0; overflow-x:clip; }
  .content { width:100%; max-width:100%; min-width:0; overflow-x:clip; }
  body.sidebar-collapsed .sidebar { width:76px; }
  body.sidebar-collapsed .main { margin-left:76px !important; }
  body.sidebar-collapsed .sidebar-brand { padding:16px 10px; justify-content:center; }
  body.sidebar-collapsed .brand-icon { width:38px; height:38px; }
  body.sidebar-collapsed .brand-name,
  body.sidebar-collapsed .nav-section,
  body.sidebar-collapsed .user-info,
  body.sidebar-collapsed .btn-cikis { display:none; }
  body.sidebar-collapsed .sidebar-collapse-btn {
    position:absolute; display:flex; right:-13px; top:50%; transform:translateY(-50%);
    background:var(--primary); box-shadow:0 3px 10px rgba(0,0,0,.3);
  }
  body.sidebar-collapsed .sidebar-nav { padding:12px 9px; }
  body.sidebar-collapsed .nav-item { justify-content:center; padding:10px 8px; gap:0; font-size:0; overflow:hidden; }
  body.sidebar-collapsed .nav-item .icon { width:auto; font-size:18px; }
  body.sidebar-collapsed .nav-item:hover { transform:none; }
  body.sidebar-collapsed .sidebar-user { justify-content:center; padding:12px 8px; }
  body.sidebar-collapsed .user-avatar { width:36px; height:36px; }
}

@media (max-width: 768px) {
  .sidebar-collapse-btn { display:none; }
  html,body { width:100%; max-width:100%; overflow-x:clip !important; }
  .main { width:100%; max-width:100vw; overflow-x:clip !important; }
  .main,.content,.card,.card-body,.card-header { min-width:0; max-width:100%; }
  .content { width:100%; overflow-x:clip; }
  .content > *, .main > * { min-width:0; }
  .topbar { width:100%; min-width:0; }
  .topbar-title { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .topbar-actions { max-width:55vw; overflow-x:auto; scrollbar-width:none; }
  .topbar-actions::-webkit-scrollbar { display:none; }
  .table-wrap,.tablo-wrap,.ek-tablo-wrap {
    width:100%; max-width:100%; overflow-x:auto;
    overscroll-behavior-inline:contain; -webkit-overflow-scrolling:touch;
    scrollbar-width:none;
  }
  .table-wrap::-webkit-scrollbar,.tablo-wrap::-webkit-scrollbar,.ek-tablo-wrap::-webkit-scrollbar { display:none; }
  .tabs { overflow-x:auto; -webkit-overflow-scrolling:touch; scrollbar-width:none; }
  .tabs::-webkit-scrollbar { display:none; }
  .tab-btn { flex:0 0 auto; }
  .report-tools { width:100%; display:grid !important; grid-template-columns:1fr 1fr; align-items:end; }
  .report-tools .form-group,.report-tools .form-control { min-width:0; width:100%; }
  .mode-bar { align-items:stretch !important; }
  .segmented { max-width:100%; overflow-x:auto; }
  .segmented button { flex:1; min-width:max-content; }
  img,svg,canvas,video { max-width:100%; height:auto; }
  #toast-container { left:12px; right:12px; bottom:14px; }
  .toast { width:100%; max-width:none; }
  input.form-control,select.form-control,textarea.form-control { min-width:0; }
  .modal-overlay { width:100%; max-width:100vw; overflow-x:clip; }
  .modal,.modal-body,.modal-footer { max-width:100%; min-width:0; }
  [id$="-oner"] { max-width:calc(100vw - 24px) !important; }
}

@media (max-width: 520px) {
  .report-tools { grid-template-columns:1fr !important; }
  .mode-bar { flex-direction:column !important; gap:12px !important; }
  .mode-bar > * { width:100%; }
  input.form-control,select.form-control,textarea.form-control { font-size:16px; }
  .card-header { align-items:stretch; }
  .card-header > * { min-width:0; }
  .search-bar > .form-control,.search-bar > button,.search-bar > a { max-width:100%; }
  .customer-row { align-items:stretch !important; flex-direction:column; }
  .customer-row .btn { width:100%; justify-content:center; }
}
