/* ============================================================
   iCamera — Ortak Stil
   Tüm sayfalar bu CSS'i kullanır
============================================================ */

:root {
  --bg:       #0d0f12;
  --surface:  #151820;
  --border:   #1e2535;
  --accent:   #e8a020;
  --ok:       #22c55e;
  --err:      #ef4444;
  --warn:     #f59e0b;
  --text:     #c8d0dc;
  --muted:    #505a6e;
  --radius:   4px;
  --mono:     'Courier New', monospace;
  --sans:     system-ui, sans-serif;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
}

/* ---- Layout ---- */
.center-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
}

.page-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem;
}

.layout {
  display: flex;
  gap: 0;
  min-height: calc(100vh - 52px - 3rem);
}

/* ---- Nav ---- */
.nav {
  height: 52px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 50;
}

.nav-brand {
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  letter-spacing: .02em;
  margin-right: auto;
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: .85rem;
  padding: .25rem .6rem;
  border-radius: var(--radius);
  transition: color .15s;
}

.nav-link:hover, .nav-link.active {
  color: var(--accent);
}

.nav-user {
  font-size: .82rem;
  color: var(--muted);
}

/* ---- Sidebar ---- */
.sidebar {
  width: 200px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: var(--surface);
  overflow-y: auto;
}

.sidebar-section {
  padding: .75rem .875rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-label {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin-bottom: .5rem;
}

.sidebar-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .4rem .5rem;
  border-radius: var(--radius);
  color: var(--muted);
  text-decoration: none;
  font-size: .82rem;
  transition: background .1s, color .1s;
  margin-bottom: .15rem;
}

.sidebar-link:hover, .sidebar-link.active {
  background: rgba(255,255,255,.04);
  color: var(--accent);
}

/* ---- Main ---- */
.main {
  flex: 1;
  padding: 1.25rem;
  overflow-y: auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: .75rem;
}

.page-title {
  font-size: .95rem;
  font-weight: 600;
  color: #fff;
}

/* ---- Grid ---- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.clip-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color .15s;
}

.clip-card:hover { border-color: var(--accent); }

.clip-thumb {
  height: 120px;
  background: #0a0c0f;
  display: flex;
  align-items: center;
  justify-content: center;
}

.play-btn {
  width: 42px;
  height: 42px;
  border: 2px solid rgba(255,255,255,.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: rgba(255,255,255,.5);
  transition: all .2s;
}

.clip-card:hover .play-btn {
  border-color: var(--accent);
  color: var(--accent);
}

.clip-info {
  padding: .6rem .75rem;
  border-top: 1px solid var(--border);
}

.clip-name {
  font-size: .75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: .25rem;
  color: var(--text);
}

.clip-meta {
  font-size: .7rem;
  color: var(--muted);
  font-family: var(--mono);
}

/* ---- Stats ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.stat-label {
  font-size: .72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .6rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--mono);
}

/* ---- Table ---- */
.section-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: .75rem;
}

.section-hdr h2 {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}

th {
  text-align: left;
  padding: .6rem .875rem;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  font-weight: 500;
  white-space: nowrap;
}

td {
  padding: .65rem .875rem;
  border-bottom: 1px solid rgba(30,37,53,.8);
  vertical-align: middle;
}

tr:hover td { background: rgba(255,255,255,.015); }
tr:last-child td { border-bottom: none; }

/* ---- Forms ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}

.brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1rem;
}

.label {
  display: block;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: .4rem;
}

.input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--sans);
  font-size: .875rem;
  padding: .55rem .875rem;
  border-radius: var(--radius);
  outline: none;
  transition: border-color .15s;
}

.input:focus { border-color: var(--accent); }
.input::placeholder { color: var(--muted); }

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--sans);
  font-size: .82rem;
  padding: .45rem .9rem;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition: all .15s;
  white-space: nowrap;
}

.btn:hover { border-color: #3a4258; color: #fff; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
  font-weight: 600;
}

.btn-primary:hover { background: #fbbf24; border-color: #fbbf24; color: #000; }

.btn-ok  { border-color: rgba(34,197,94,.3);  color: var(--ok);  }
.btn-ok:hover  { background: rgba(34,197,94,.1); }

.btn-err { border-color: rgba(239,68,68,.3);  color: var(--err); }
.btn-err:hover { background: rgba(239,68,68,.1); }

.btn-sm {
  font-size: .72rem;
  padding: .25rem .6rem;
}

/* ---- Badges ---- */
.badge {
  font-size: .65rem;
  padding: .15rem .45rem;
  border-radius: 3px;
  font-weight: 600;
  background: var(--border);
  color: var(--muted);
}

.badge-ok   { background: rgba(34,197,94,.12);  color: var(--ok);   border: 1px solid rgba(34,197,94,.2);  }
.badge-warn { background: rgba(245,158,11,.12); color: var(--warn); border: 1px solid rgba(245,158,11,.2); }
.badge-err  { background: rgba(239,68,68,.12);  color: var(--err);  border: 1px solid rgba(239,68,68,.2);  }
.badge-off  { background: rgba(80,90,110,.12);  color: var(--muted);border: 1px solid rgba(80,90,110,.2);  }

/* ---- Alerts ---- */
.alert {
  padding: .7rem 1rem;
  border-radius: var(--radius);
  font-size: .85rem;
  margin-bottom: 1rem;
}

.alert-ok  { background: rgba(34,197,94,.08);  border: 1px solid rgba(34,197,94,.25);  color: var(--ok);  }
.alert-err { background: rgba(239,68,68,.08);  border: 1px solid rgba(239,68,68,.25);  color: var(--err); }

/* ---- Modals ---- */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.88);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal.open { display: flex; }

.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 880px;
  overflow: hidden;
}

.modal-hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: .85rem;
  color: var(--text);
  gap: 1rem;
}

.modal-ftr {
  padding: .65rem 1rem;
  border-top: 1px solid var(--border);
}

/* ---- Log ---- */
.log-hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .65rem 0;
  margin-bottom: .75rem;
  border-bottom: 1px solid var(--border);
  font-size: .85rem;
}

.log-content {
  font-family: var(--mono);
  font-size: .75rem;
  line-height: 1.7;
  white-space: pre-wrap;
  background: #0a0c0f;
  color: #9aa3b2;
  padding: 1rem;
  border-radius: var(--radius);
  max-height: calc(100vh - 200px);
  overflow-y: auto;
}

/* ---- Misc ---- */
.muted { color: var(--muted); }
.mono  { font-family: var(--mono); font-size: .8rem; }

.pagination {
  display: flex;
  gap: .4rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--muted);
  font-size: .9rem;
}

.icon-ok {
  width: 56px; height: 56px;
  background: rgba(34,197,94,.12);
  border: 2px solid rgba(34,197,94,.3);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; color: var(--ok);
  margin: 0 auto 1rem;
}

.icon-err {
  width: 56px; height: 56px;
  background: rgba(239,68,68,.12);
  border: 2px solid rgba(239,68,68,.3);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; color: var(--err);
  margin: 0 auto 1rem;
}

@media (max-width: 768px) {
  .sidebar { display: none; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-user { display: none; }
}
