*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Dark tema (varsayılan) ── */
:root {
  --bg: #0a0a0a;
  --bg1: #141414;
  --bg2: #1e1e1e;
  --bg3: #2a2a2a;
  --border: #333;
  --text: #f0f0f0;
  --text2: #a0a0a0;
  --text3: #666;
  --accent: #ea580c;
  --accent-hover: #c2410c;
  --green: #22c55e;
  --red: #ef4444;
  --radius: 12px;
  --radius-sm: 8px;
  --cam-bg: #000;
  --cam-ctrl: rgba(0,0,0,.92);
  --cam-ctrl-border: #222;
  --cam-btn-bg: #fff;
  --cam-text: #ccc;
}

/* ── Light tema ── */
html[data-theme="light"] {
  --bg: #f5f5f5;
  --bg1: #ffffff;
  --bg2: #ebebeb;
  --bg3: #d8d8d8;
  --border: #d0d0d0;
  --text: #111111;
  --text2: #555555;
  --text3: #999999;
  --accent: #ea580c;
  --accent-hover: #c2410c;
  --green: #16a34a;
  --red: #dc2626;
  --cam-bg: #1a1a1a;
  --cam-ctrl: rgba(255,255,255,.95);
  --cam-ctrl-border: #ddd;
  --cam-btn-bg: #fff;
  --cam-text: #333;
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  -webkit-font-smoothing: antialiased;
  transition: background .2s, color .2s;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; }

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: var(--text);
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  width: 100%;
  outline: none;
  transition: border-color .2s;
}
input:focus, select:focus { border-color: var(--accent); }

.card {
  background: var(--bg1);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: var(--radius-sm); font-weight: 600;
  font-size: 15px; transition: background .15s, transform .1s;
  min-height: 48px; white-space: nowrap; border: none; cursor: pointer;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--bg3); color: var(--text); }
.btn-secondary:hover { background: #333; }
.btn-lg { padding: 16px 28px; font-size: 18px; min-height: 60px; border-radius: var(--radius); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-full { width: 100%; }

.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--bg3); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.progress-bar { height: 6px; background: var(--bg3); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 99px; transition: width .4s; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 99px; }

/* Admin panel grid yardımcıları */
.admin-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.admin-stat { background: var(--bg1); border: 1px solid var(--border); border-radius: 12px; padding: 16px; text-align: center; }
.admin-stat .val { font-size: 2rem; font-weight: 700; }
.admin-stat .lbl { color: var(--text2); font-size: .875rem; margin-top: 4px; }

/* Admin layout — sidebar & tablo (CSS değişkeni bazlı) */
:root {
  --sidebar-bg: #0f0f0f;
  --sidebar-border: #1a1a1a;
  --sidebar-link-color: #a0a0a0;
  --sidebar-section-color: #444;
}
html[data-theme="light"] {
  --sidebar-bg: #1e1e2e;
  --sidebar-border: #2a2a3e;
  --sidebar-link-color: #9ca3c0;
  --sidebar-section-color: #6b7280;
}

.admin-sidebar { width:220px;background:var(--sidebar-bg);border-right:1px solid var(--sidebar-border);display:flex;flex-direction:column;position:fixed;height:100vh;overflow-y:auto }
.admin-sidebar-header { padding:18px 16px;border-bottom:1px solid var(--sidebar-border) }
.admin-sidebar-footer { padding:10px;border-top:1px solid var(--sidebar-border) }

.sidebar-link { display:flex;align-items:center;gap:10px;padding:9px 12px;border-radius:8px;font-size:14px;font-weight:500;transition:background .15s,color .15s;text-decoration:none;color:var(--sidebar-link-color) }
.sidebar-link:hover { background:rgba(255,255,255,.06);color:#fff }
.sidebar-link.active { background:#ea580c;color:#fff }
.sidebar-section-label { font-size:11px;color:var(--sidebar-section-color);font-weight:600;text-transform:uppercase;letter-spacing:.06em;padding:8px 12px 4px }

.admin-table { width:100%;border-collapse:collapse }
.admin-table th { background:var(--bg1);color:var(--text3);font-size:12px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;padding:10px 16px;text-align:left;border-bottom:1px solid var(--border);white-space:nowrap }
.admin-table td { padding:12px 16px;border-bottom:1px solid var(--border);vertical-align:middle;font-size:14px;color:var(--text) }
.admin-table tr:hover td { background:var(--bg1) }
.admin-table tr:last-child td { border-bottom:none }

.badge { display:inline-flex;align-items:center;padding:2px 10px;border-radius:99px;font-size:12px;font-weight:600;border:1px solid }
.badge-orange { background:rgba(234,88,12,.15);color:#fb923c;border-color:rgba(234,88,12,.3) }
.badge-green  { background:rgba(34,197,94,.12);color:#16a34a;border-color:rgba(34,197,94,.3) }
.badge-blue   { background:rgba(59,130,246,.12);color:#3b82f6;border-color:rgba(59,130,246,.3) }
.badge-gray   { background:rgba(100,100,100,.15);color:var(--text2);border-color:rgba(100,100,100,.3) }
html[data-theme="light"] .badge-green { color:#15803d }
html[data-theme="light"] .badge-blue  { color:#1d4ed8 }

.stat-card { background:var(--bg1);border:1px solid var(--border);border-radius:12px;padding:18px 22px }
.stat-card .num { font-size:2rem;font-weight:800;line-height:1;color:var(--text) }
.stat-card .lbl { font-size:12px;color:var(--text3);margin-top:4px }

.admin-main { flex:1;margin-left:220px;min-height:100vh;background:var(--bg) }

.theme-toggle-btn { position:fixed;bottom:18px;right:18px;z-index:8888;width:42px;height:42px;border-radius:50%;background:var(--bg2);border:1.5px solid var(--border);font-size:18px;cursor:pointer;box-shadow:0 2px 12px rgba(0,0,0,.4);display:flex;align-items:center;justify-content:center;transition:background .2s }

/* ── Admin sayfaları ortak bileşenler ── */
.adm-card { background:var(--bg1);border:1px solid var(--border);border-radius:12px;overflow:hidden }
.adm-card-header { padding:14px 18px;border-bottom:1px solid var(--border) }
.adm-modal-backdrop { display:none;position:fixed;inset:0;background:rgba(0,0,0,.65);align-items:center;justify-content:center;z-index:50;padding:24px }
.adm-modal { background:var(--bg1);border:1px solid var(--border);border-radius:16px;padding:28px;width:100%;max-width:440px }
.adm-modal h2 { font-size:18px;font-weight:700;color:var(--text);margin:0 }
.adm-modal-close { background:none;border:none;color:var(--text3);font-size:20px;cursor:pointer;padding:4px }
.adm-label { display:block;font-size:12px;color:var(--text3);margin-bottom:5px;font-weight:600;text-transform:uppercase;letter-spacing:.04em }
.adm-input { width:100%;background:var(--bg2);border:1px solid var(--border);color:var(--text);border-radius:8px;padding:10px 14px;font-size:14px;outline:none;box-sizing:border-box;font-family:inherit }
.adm-input:focus { border-color:var(--accent) }
.adm-btn-cancel { background:var(--bg2);color:var(--text2);border:1px solid var(--border);border-radius:8px;padding:11px;font-size:14px;cursor:pointer;flex:1 }
.adm-btn-submit { background:#ea580c;color:#fff;border:none;border-radius:8px;padding:11px;font-size:14px;font-weight:600;cursor:pointer;flex:1 }
.adm-search-input { flex:1;background:var(--bg1);border:1px solid var(--border);color:var(--text);border-radius:8px;padding:10px 16px;font-size:14px;outline:none;max-width:480px;font-family:inherit }
.adm-search-input:focus { border-color:var(--accent) }
.adm-search-btn { background:var(--bg2);color:var(--text2);border:1px solid var(--border);border-radius:8px;padding:10px 20px;font-size:14px;cursor:pointer }
.adm-icon-btn { background:var(--bg2);color:var(--text2);border:1px solid var(--border);border-radius:6px;padding:5px 10px;font-size:13px;cursor:pointer }
.adm-page-title { font-size:22px;font-weight:700;color:var(--text);margin:0 }
.adm-page-subtitle { font-size:13px;color:var(--text3);margin-top:3px }
.adm-empty { padding:60px;text-align:center;color:var(--text3) }
.adm-breadcrumb { font-size:13px;color:var(--text3);margin-bottom:8px }
.adm-breadcrumb a { color:var(--text2);text-decoration:none }
.adm-breadcrumb a:hover { color:var(--text) }
.adm-timeline-item { padding:12px 18px;border-bottom:1px solid var(--bg2);display:flex;align-items:flex-start;gap:12px }
.adm-timeline-dot { width:8px;height:8px;border-radius:50%;background:#ea580c;flex-shrink:0;margin-top:4px }
.adm-section-title { font-weight:700;font-size:14px;color:var(--text) }
