/* CamWatch Pro - Ana Stil Dosyası */
/* assets/css/style.css */

:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: #1a2236;
  --bg-hover: #1e2d47;
  --border: #2a3a5c;
  --border-light: #3a4d6e;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-dark: #1e40af;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #06b6d4;
  --text-primary: #f0f4ff;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --sidebar-w: 240px;
  --header-h: 60px;
  --radius: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

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

/* ── Layout ── */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: var(--header-h);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.page-content { padding: 24px; flex: 1; }

/* ── Sidebar ── */
.sidebar-logo {
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-logo .logo-icon {
  width: 36px; height: 36px;
  background: var(--accent);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.sidebar-logo .logo-text { font-size: 16px; font-weight: 700; letter-spacing: -0.3px; }
.sidebar-logo .logo-sub { font-size: 10px; color: var(--text-muted); letter-spacing: 1px; text-transform: uppercase; }

.sidebar-nav { padding: 12px 0; flex: 1; }
.nav-section { padding: 8px 16px 4px; }
.nav-section-label {
  font-size: 10px; font-weight: 600;
  color: var(--text-muted); letter-spacing: 1.2px;
  text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px;
  color: var(--text-secondary);
  font-weight: 500;
  border-radius: 0;
  transition: all 0.15s;
  cursor: pointer;
  position: relative;
}
.nav-item:hover { color: var(--text-primary); background: var(--bg-hover); }
.nav-item.active {
  color: var(--accent);
  background: rgba(59,130,246,0.1);
  border-left: 2px solid var(--accent);
}
.nav-item .nav-icon { font-size: 16px; width: 20px; flex-shrink: 0; }
.nav-item .nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 600;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}
.user-info { display: flex; align-items: center; gap: 10px; }
.user-avatar {
  width: 32px; height: 32px;
  background: var(--accent-dark);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 600; }
.user-role { font-size: 11px; color: var(--text-muted); }

/* ── Topbar ── */
.topbar-title { font-size: 16px; font-weight: 600; }
.topbar-spacer { flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.card-title { font-size: 15px; font-weight: 600; }
.card-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── Stats Grid ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex; align-items: center; gap: 16px;
}
.stat-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  flex-shrink: 0;
}
.stat-icon.blue   { background: rgba(59,130,246,0.15); color: var(--accent); }
.stat-icon.green  { background: rgba(16,185,129,0.15); color: var(--success); }
.stat-icon.yellow { background: rgba(245,158,11,0.15);  color: var(--warning); }
.stat-icon.red    { background: rgba(239,68,68,0.15);   color: var(--danger); }
.stat-icon.cyan   { background: rgba(6,182,212,0.15);   color: var(--info); }
.stat-value { font-size: 26px; font-weight: 700; line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500; font-family: var(--font);
  border: none; cursor: pointer; transition: all 0.15s;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary   { background: var(--accent);   color: #fff; }
.btn-primary:hover  { background: var(--accent-hover); }
.btn-success   { background: var(--success);  color: #fff; }
.btn-success:hover  { background: #059669; }
.btn-danger    { background: var(--danger);   color: #fff; }
.btn-danger:hover   { background: #dc2626; }
.btn-warning   { background: var(--warning);  color: #111; }
.btn-warning:hover  { background: #d97706; }
.btn-secondary { background: var(--bg-hover); color: var(--text-primary); border: 1px solid var(--border-light); }
.btn-secondary:hover { background: var(--border); }
.btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-lg { padding: 10px 20px; font-size: 15px; }
.btn-icon { width: 32px; height: 32px; padding: 0; justify-content: center; }

/* ── Forms ── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; letter-spacing: 0.3px; }
.form-control {
  width: 100%; padding: 8px 12px;
  background: var(--bg-primary); color: var(--text-primary);
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 13px; font-family: var(--font);
  transition: border-color 0.15s;
  outline: none;
}
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,130,246,0.15); }
.form-control::placeholder { color: var(--text-muted); }
select.form-control { cursor: pointer; }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.form-check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.form-check input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

/* ── Tables ── */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 10px 12px; font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 12px; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }
.td-actions { display: flex; gap: 4px; align-items: center; }

/* ── Badges ── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.badge-online  { background: rgba(16,185,129,0.15); color: var(--success); }
.badge-offline { background: rgba(239,68,68,0.15);  color: var(--danger); }
.badge-error   { background: rgba(245,158,11,0.15); color: var(--warning); }
.badge-unknown { background: rgba(100,116,139,0.2); color: var(--text-muted); }
.badge-primary { background: rgba(59,130,246,0.15); color: var(--accent); }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ── Camera Grid ── */
.camera-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.camera-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.camera-card:hover { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.camera-card.online  { border-color: rgba(16,185,129,0.3); }
.camera-card.offline { border-color: rgba(239,68,68,0.2); }

.camera-preview {
  position: relative; height: 180px;
  background: #060a14;
  overflow: hidden; cursor: pointer;
}
.camera-preview img { width: 100%; height: 100%; object-fit: cover; }
.camera-preview .no-signal {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--text-muted); gap: 8px;
}
.camera-preview .no-signal span { font-size: 32px; }
.camera-overlay {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
  gap: 8px;
}
.camera-preview:hover .camera-overlay { background: rgba(0,0,0,0.5); }
.camera-overlay .btn { opacity: 0; transform: scale(0.9); transition: all 0.15s; }
.camera-preview:hover .camera-overlay .btn { opacity: 1; transform: scale(1); }

.camera-info { padding: 12px; }
.camera-name { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.camera-meta { font-size: 11px; color: var(--text-muted); display: flex; gap: 12px; flex-wrap: wrap; }
.camera-footer { padding: 10px 12px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }

/* ── Video Player ── */
.video-player-wrapper {
  position: relative; background: #000; border-radius: var(--radius);
  overflow: hidden;
}
.video-player-wrapper video { width: 100%; display: block; }
.player-controls {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  padding: 20px 12px 12px;
  display: flex; align-items: center; gap: 8px;
}

/* ── PTZ Controller ── */
.ptz-pad { display: grid; grid-template-columns: repeat(3, 44px); gap: 4px; }
.ptz-btn {
  width: 44px; height: 44px;
  background: var(--bg-hover); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text-primary); font-size: 18px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.1s; user-select: none;
}
.ptz-btn:hover { background: var(--accent); border-color: var(--accent); }
.ptz-btn:active { transform: scale(0.92); }
.ptz-btn.center { background: var(--bg-card); }

/* ── Alerts ── */
.alert { padding: 12px 16px; border-radius: var(--radius); font-size: 13px; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
.alert-success { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.3); color: #6ee7b7; }
.alert-danger  { background: rgba(239,68,68,0.1);  border: 1px solid rgba(239,68,68,0.3);  color: #fca5a5; }
.alert-warning { background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.3); color: #fcd34d; }
.alert-info    { background: rgba(6,182,212,0.1);  border: 1px solid rgba(6,182,212,0.3);  color: #67e8f9; }

/* ── Modal ── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  z-index: 1000; display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; max-width: 680px; width: 100%;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 16px; font-weight: 600; }
.modal-body { padding: 20px 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }

/* ── Tabs ── */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab-btn {
  padding: 10px 16px; font-size: 13px; font-weight: 500;
  color: var(--text-secondary); background: transparent;
  border: none; border-bottom: 2px solid transparent;
  cursor: pointer; transition: all 0.15s; font-family: var(--font);
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Search & Filters ── */
.search-bar { position: relative; }
.search-bar input { padding-left: 36px; }
.search-bar::before { content: '🔍'; position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 14px; opacity: 0.5; pointer-events: none; }

/* ── Location Tree ── */
.location-tree { list-style: none; }
.location-tree li { position: relative; }
.location-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 6px;
  cursor: pointer; transition: background 0.15s;
}
.location-item:hover { background: var(--bg-hover); }
.location-item.active { background: rgba(59,130,246,0.1); color: var(--accent); }
.location-children { padding-left: 20px; border-left: 1px solid var(--border); margin-left: 10px; }

/* ── Timeline ── */
.timeline { position: relative; }
.timeline-item { display: flex; gap: 12px; margin-bottom: 12px; }
.timeline-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex-shrink: 0; margin-top: 4px; }
.timeline-content { flex: 1; }
.timeline-time { font-size: 11px; color: var(--text-muted); }

/* ── Fullscreen View ── */
/* ══════════════════════════════════════════════
   LIVE VIEW — Toolbar
══════════════════════════════════════════════ */
.live-toolbar {
  display: flex; align-items: center; gap: 1rem;
  flex-wrap: wrap; padding: .6rem 0; margin-bottom: .75rem;
  border-bottom: 1px solid var(--border-color);
}
.live-toolbar-group { display: flex; align-items: center; gap: .5rem; }
.toolbar-label { font-size: .72rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.live-toolbar-right { display: flex; align-items: center; gap: .5rem; margin-left: auto; }

/* Toolbar buton grupları */
.grid-btns, .grid-btns { display: flex; gap: 3px; }
.gb, .qb, .rb {
  background: var(--bg-tertiary); border: 1px solid var(--border-color);
  color: var(--text-secondary); border-radius: 5px;
  padding: 3px 9px; font-size: .78rem; font-weight: 600; cursor: pointer;
  transition: all .15s;
}
.gb:hover, .qb:hover, .rb:hover { border-color: var(--primary-color); color: var(--primary-color); }
.gb.active, .qb.active, .rb.active {
  background: var(--primary-color); border-color: var(--primary-color);
  color: #fff;
}

/* Bant genişliği indikatörü */
.bw-indicator {
  display: flex; align-items: center; gap: .4rem;
  font-size: .75rem; color: var(--text-muted); padding: 3px 10px;
  background: var(--bg-tertiary); border-radius: 20px;
  border: 1px solid var(--border-color); white-space: nowrap;
}
.bw-dot { width: 8px; height: 8px; border-radius: 50%; background: #666; flex-shrink: 0; }
.bw-green  { background: #43e97b; box-shadow: 0 0 6px #43e97b88; }
.bw-yellow { background: #f6d365; box-shadow: 0 0 6px #f6d36588; }
.bw-orange { background: #f89b29; box-shadow: 0 0 6px #f89b2988; }
.bw-red    { background: #fa709a; box-shadow: 0 0 6px #fa709a88; }

/* ══════════════════════════════════════════════
   LIVE VIEW — Ana wrap + grid + side panel
══════════════════════════════════════════════ */
.live-wrap {
  display: flex; gap: .75rem;
  height: calc(100vh - 200px); min-height: 400px;
}
.cam-grid {
  flex: 1; display: grid; gap: 8px;
  overflow: hidden;
}

/* Grid boyutları — 128'e kadar */
.cam-grid.grid-1   { grid-template-columns: 1fr; }
.cam-grid.grid-4   { grid-template-columns: repeat(2,  1fr); grid-template-rows: repeat(2,  1fr); }
.cam-grid.grid-9   { grid-template-columns: repeat(3,  1fr); grid-template-rows: repeat(3,  1fr); }
.cam-grid.grid-16  { grid-template-columns: repeat(4,  1fr); grid-template-rows: repeat(4,  1fr); }
.cam-grid.grid-25  { grid-template-columns: repeat(5,  1fr); grid-template-rows: repeat(5,  1fr); }
.cam-grid.grid-36  { grid-template-columns: repeat(6,  1fr); grid-template-rows: repeat(6,  1fr); }
.cam-grid.grid-64  { grid-template-columns: repeat(8,  1fr); grid-template-rows: repeat(8,  1fr); }
.cam-grid.grid-128 { grid-template-columns: repeat(12, 1fr); grid-template-rows: repeat(11, 1fr); }

/* ── Kamera hücresi ── */
.cam-cell {
  background: #050810; border-radius: 5px; overflow: hidden;
  position: relative; cursor: pointer;
  border: 1.5px solid transparent;
  transition: border-color .15s;
}
.cam-cell:hover      { border-color: rgba(79,172,254,.4); }
.cam-cell.cam-selected { border-color: var(--primary-color) !important; box-shadow: 0 0 0 1px var(--primary-color); }

/* Media alanı */
.cam-media {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
.cam-snap { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-nosnap { color: #2a3050; font-size: 1.5rem; }

/* Üst overlay */
.cam-top {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: .3rem;
  padding: 4px 6px;
  background: linear-gradient(to bottom, rgba(0,0,0,.65), transparent);
}
.cam-status-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dot-online  { background: #43e97b; box-shadow: 0 0 5px #43e97b; }
.dot-offline { background: #fa709a; }
.dot-unknown { background: #666; }
.cam-rec-badge {
  background: #fa709a; color: #fff; font-size: .6rem; font-weight: 700;
  padding: 1px 5px; border-radius: 3px; letter-spacing: .05em;
  animation: pulse 1s infinite;
}
.cam-top-actions { margin-left: auto; display: flex; gap: 3px; opacity: 0; transition: opacity .15s; }
.cam-cell:hover .cam-top-actions { opacity: 1; }
.cam-btn {
  background: rgba(0,0,0,.65); border: none; color: #fff;
  width: 24px; height: 24px; border-radius: 4px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; transition: background .15s;
}
.cam-btn:hover { background: var(--primary-color); }

/* Alt overlay — isim */
.cam-label {
  position: absolute; bottom: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 3px 6px;
  background: linear-gradient(to top, rgba(0,0,0,.75), transparent);
  font-size: .7rem; font-weight: 600; line-height: 1.3;
}
.cam-loc { color: rgba(255,255,255,.55); font-weight: 400; font-size: .65rem; }

/* Loading + Error overlay */
.cam-loading, .cam-error {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(5,8,16,.85); gap: .4rem; font-size: .75rem; color: var(--text-muted);
}
.cam-error { color: #fa709a; }
.cam-spinner {
  width: 24px; height: 24px;
  border: 2px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

/* ── Side Panel ── */
.live-side {
  width: 280px; flex-shrink: 0;
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: 10px; padding: 1rem;
  display: flex; flex-direction: column; gap: .5rem;
  overflow-y: auto;
}
.side-header {
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 700; font-size: .95rem; padding-bottom: .5rem;
  border-bottom: 1px solid var(--border-color); margin-bottom: .25rem;
}

/* PTZ */
.ptz-section { border: 1px solid var(--border-color); border-radius: 8px; padding: .75rem; }
.ptz-label { font-size: .75rem; font-weight: 600; color: var(--text-muted); margin-bottom: .6rem; }
.ptz-pad { display: grid; grid-template-columns: repeat(3,40px); grid-template-rows: repeat(3,40px); gap: 4px; justify-content: center; }
.ptz-btn {
  background: var(--bg-tertiary); border: 1px solid var(--border-color);
  color: var(--text-primary); border-radius: 6px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; transition: all .1s;
  user-select: none;
}
.ptz-btn:hover, .ptz-btn:active { background: var(--primary-color); border-color: var(--primary-color); color: #fff; }
.ptz-home { background: rgba(79,172,254,.1); border-color: var(--primary-color); color: var(--primary-color); }
.ptz-zoom { display: flex; align-items: center; justify-content: center; gap: .4rem; margin-top: .5rem; }

/* 64+ modunda hücre label gizle */
.cam-grid.grid-64 .cam-label,
.cam-grid.grid-128 .cam-label { display: none; }
.cam-grid.grid-128 .cam-top  { display: none; }
.cam-grid.grid-64 .cam-top-actions { display: none; }
.cam-grid.grid-64 .cam-status-dot,
.cam-grid.grid-128 .cam-status-dot { width: 5px; height: 5px; }

/* Eski sınıf uyumluluk */
.grid-cell { background: #050810; border-radius: 4px; overflow: hidden; position: relative; cursor: pointer; }
.grid-cell .cell-label { position: absolute; bottom: 6px; left: 6px; background: rgba(0,0,0,.7); padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }

/* ── Loading ── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── Toast Notifications ── */
#toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 12px 16px; border-radius: var(--radius);
  font-size: 13px; min-width: 240px; max-width: 360px;
  display: flex; align-items: center; gap: 10px;
  animation: toastIn 0.25s ease;
  box-shadow: var(--shadow);
}
.toast.success { background: var(--success); color: #fff; }
.toast.error   { background: var(--danger);  color: #fff; }
.toast.warning { background: var(--warning); color: #111; }
.toast.info    { background: var(--info);    color: #fff; }
@keyframes toastIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── Utilities ── */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mb-8   { margin-bottom: 8px; }
.mb-16  { margin-bottom: 16px; }
.mb-24  { margin-bottom: 24px; }
.text-muted   { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-right   { text-align: right; }
.font-mono    { font-family: 'Fira Code', monospace; }
.w-full       { width: 100%; }
.hidden       { display: none; }
.truncate     { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* ── Login Sayfası ── */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 30% 50%, rgba(30,64,175,0.15) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 20%, rgba(59,130,246,0.1) 0%, transparent 50%),
              var(--bg-primary);
}
.login-card {
  width: 100%; max-width: 420px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; padding: 40px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.login-logo {
  text-align: center; margin-bottom: 32px;
}
.login-logo-icon {
  width: 64px; height: 64px; background: var(--accent);
  border-radius: 16px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 28px; margin-bottom: 16px;
}
.login-logo h1 { font-size: 24px; font-weight: 700; }
.login-logo p  { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.3s; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .camera-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════════
   STANDARD AKSİYON BUTONLARI
   Tablo / kart / liste içindeki işlem butonları için tek standart.
   Kullanım:
     <div class="actions">
       <button class="btn-act primary"><i class="fas fa-play"></i> İzle</button>
       <button class="btn-act"><i class="fas fa-rotate"></i> Test</button>
       <button class="btn-act snap"><i class="fas fa-camera"></i> Snapshot</button>
       <a class="btn-act edit" href="..."><i class="fas fa-pen"></i> Düzenle</a>
       <button class="btn-act danger"><i class="fas fa-trash"></i> Sil</button>
     </div>
   ═══════════════════════════════════════════════════════════════ */
.actions {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.btn-act {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  border-radius: 6px;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  text-decoration: none;
  font-family: inherit;
  transition: all .15s ease;
}
.btn-act i { font-size: 11px; }
.btn-act:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-light);
  transform: translateY(-1px);
}
.btn-act:active { transform: translateY(0); }
.btn-act:disabled, .btn-act.is-loading {
  opacity: .55;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primary — ana eylem (İzle, Oynat) */
.btn-act.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-act.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
}

/* Snapshot — cyan */
.btn-act.snap {
  background: rgba(6,182,212,.13);
  color: var(--info);
  border-color: rgba(6,182,212,.35);
}
.btn-act.snap:hover {
  background: rgba(6,182,212,.22);
  color: #ffffff;
  border-color: var(--info);
}

/* Düzenle — turuncu */
.btn-act.edit {
  background: rgba(245,158,11,.12);
  color: var(--warning);
  border-color: rgba(245,158,11,.32);
}
.btn-act.edit:hover {
  background: rgba(245,158,11,.22);
  color: #fff;
  border-color: var(--warning);
}

/* Danger — kırmızı */
.btn-act.danger {
  background: rgba(239,68,68,.10);
  color: var(--danger);
  border-color: rgba(239,68,68,.32);
}
.btn-act.danger:hover {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

/* Success — yeşil (kayıt başlat, vb.) */
.btn-act.success {
  background: rgba(16,185,129,.12);
  color: var(--success);
  border-color: rgba(16,185,129,.32);
}
.btn-act.success:hover {
  background: var(--success);
  color: #fff;
}

/* İndir / dışa aktar — mor-tonu */
.btn-act.download {
  background: rgba(139,92,246,.12);
  color: #a78bfa;
  border-color: rgba(139,92,246,.32);
}
.btn-act.download:hover {
  background: rgba(139,92,246,.25);
  color: #fff;
  border-color: #a78bfa;
}

/* Sadece ikon modu — sıkışık yerler için */
.btn-act.icon-only { padding: 6px 9px; }
.btn-act.icon-only .lbl { display: none; }

/* Mobile: tüm aksiyon butonlarında metin gizlenip ikon büyür */
@media (max-width: 700px) {
  .btn-act .lbl { display: none; }
  .btn-act { padding: 8px 10px; }
  .btn-act i { font-size: 13px; }
}

/* ═══════════════════════════════════════════════════════════
   MODAL VIEW — sayfa iframe içinde açıldığında sidebar/topbar gizle
   ═══════════════════════════════════════════════════════════ */
body.modal-view .sidebar,
body.modal-view .topbar {
  display: none !important;
}
body.modal-view .main-content {
  margin-left: 0 !important;
}
body.modal-view .page-content {
  padding: 20px !important;
}
/* .layout flex display'i koru — yoksa içerik render olmaz */
body.modal-view {
  background: var(--bg-secondary) !important;
}
body.modal-view .layout {
  min-height: 100vh;
}
