/* Inter fontu yerelden yüklenir (assets/fonts/). İnternet gerektirmez. */
@import url('fonts/inter.css');

:root {
  --bg: #eef2f7;
  --panel: #ffffff;
  --panel2: #f1f5f9;
  --line: #e2e8f0; /* Biraz daha yumuşak gri sınır çizgisi */
  --text: #0f172a;
  --muted: #475569;
  --accent: #1e3a8a;
  --accent2: #1d4ed8;
  --accent-glow: rgba(30, 58, 138, 0.06);
  --accent-grad: linear-gradient(135deg, #1e3a8a, #1e40af);
  --ok: #16a34a;
  --err: #dc2626;
  --warn: #ca8a04;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.05); /* Yumuşak katmanlı gölge */
  --shadow-lg: 0 4px 12px rgba(15, 23, 42, 0.06), 0 18px 40px rgba(15, 23, 42, 0.09);
  --grid-color: rgba(30, 58, 138, 0.015);
  --scanline-color: rgba(30, 58, 138, 0.015);

  /* Köşe yarıçapı ölçeği (modern, yumuşak) */
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  /* Boşluk ölçeği */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 44px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  background-image: 
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: center top;
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
  position: relative;
}
body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--scanline-color);
  filter: blur(1px);
  pointer-events: none;
  z-index: 99999;
  /* Sürekli kayan tarama çizgisi kaldırıldı (görsel gürültü). */
  display: none;
}

a {
  color: var(--accent2);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: .5px;
}
.muted { color: var(--muted); }

/* ============ Auth (Giriş Ekranı) ============ */
.auth-body {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(circle at center, #1e3a8a 0%, #020617 100%);
  position: relative;
  overflow: hidden;
}
.auth-body::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: center;
  pointer-events: none;
  z-index: 1;
}
.auth-card {
  position: relative;
  z-index: 2;
  background: var(--panel);
  padding: 44px 40px;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 400px;
  border: 1px solid var(--line);
  box-shadow: 0 30px 70px rgba(2, 6, 23, 0.55), 0 2px 8px rgba(2, 6, 23, 0.4);
  overflow: hidden;
}
/* Kartın üstünde ince accent şeridi (marka rengi) */
.auth-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), #b91c1c);
}
.auth-card h1 {
  margin: 0 0 24px;
  font-size: 1.5rem;
  text-align: center;
  color: var(--accent);
  font-weight: 800;
  letter-spacing: -0.01em;
}
.auth-card label {
  display: block;
  margin-bottom: 16px;
  font-size: .85rem;
  color: var(--muted);
  font-weight: 500;
}
.auth-card input {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--text);
  font-size: .95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.auth-card input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

@keyframes logo-glow {
  0% {
    box-shadow: 0 0 15px rgba(30, 58, 138, 0.2);
    border-color: rgba(30, 58, 138, 0.3);
  }
  50% {
    box-shadow: 0 0 25px rgba(220, 38, 38, 0.4);
    border-color: rgba(220, 38, 38, 0.5);
  }
  100% {
    box-shadow: 0 0 15px rgba(30, 58, 138, 0.2);
    border-color: rgba(30, 58, 138, 0.3);
  }
}
.login-logo-glow {
  padding: 8px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.4);
  border: 1.5px solid rgba(30, 58, 138, 0.3);
  display: inline-block;
  animation: logo-glow 4s infinite ease-in-out;
  margin-bottom: 12px;
}

/* ============ Buttons ============ */
button, .btn {
  background: var(--accent-grad);
  color: #fff;
  border: none;
  padding: 10px 22px;
  border-radius: 10px;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-block;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 4px rgba(30, 58, 138, 0.2);
  transition: all .2s ease;
}
button:hover, .btn:hover {
  background: #0f172a;
  box-shadow: 0 4px 8px rgba(30, 58, 138, 0.25);
  transform: translateY(-1px);
}
button:active, .btn:active {
  transform: translateY(0);
}

/* ============ Topbar ============ */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(180deg, #111c30 0%, #0f172a 100%);
  padding: 0 32px;
  min-height: 66px;
  border-bottom: 3px solid #b91c1c;
  position: sticky;
  top: 0;
  z-index: 50;
  flex-wrap: wrap;
  gap: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}
.brand {
  font-weight: 800;
  font-size: 1.15rem;
  color: #fff !important;
  letter-spacing: 0.3px;
}
.brand:hover {
  text-decoration: none !important;
  color: #e2e8f0 !important;
}
.topbar nav {
  display: flex;
  gap: 4px;
  align-items: center;
}
.topbar .who {
  color: #cbd5e1;
  font-size: .85rem;
  background: rgba(255, 255, 255, 0.06);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.topbar .logout {
  color: #fca5a5;
  font-weight: 600;
}
.topbar .logout:hover {
  color: #fecaca;
  text-decoration: none;
}
.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 44px 32px;
}

/* ============ Alerts ============ */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: .9rem;
  border-left: 4px solid transparent;
}
.alert-ok {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-left-color: var(--ok);
  color: #166534;
}
.alert-err {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-left-color: var(--err);
  color: #991b1b;
}
.alert-warn {
  background: #fefce8;
  border: 1px solid #fde68a;
  border-left-color: var(--warn);
  color: #854d0e;
}

/* ============ Stats Dashboard ============ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 36px;
}
.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 22px 24px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: var(--shadow);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s ease;
}
.stat-card:hover {
  border-color: var(--accent2);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.stat-icon {
  font-size: 1.6rem;
  background: var(--accent-grad);
  color: #fff;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  box-shadow: 0 6px 16px var(--accent-glow);
  flex-shrink: 0;
}
.stat-info {
  display: flex;
  flex-direction: column;
}
.stat-val {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.stat-lbl {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.stat-trend {
  font-size: 0.68rem;
  font-weight: 700;
  margin-top: 3px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.trend-up {
  color: var(--ok);
}
.trend-info {
  color: var(--accent2);
}
.trend-warn {
  color: var(--warn);
}

/* ============ Page Head + Search ============ */
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 32px;
}
h1 {
  font-size: 1.75rem;
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--accent);
}
.count {
  background: var(--accent);
  color: #ffffff;
  font-size: .8rem;
  padding: 4px 13px;
  border-radius: var(--radius-pill);
  vertical-align: middle;
  font-weight: 700;
}
.search {
  display: flex;
  gap: 8px;
}
.search input {
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  min-width: 280px;
  font-size: .9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow);
}
.search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.btn-clear {
  align-self: center;
  color: var(--muted);
  font-size: 0.9rem;
}
.btn-clear:hover {
  color: var(--err);
  text-decoration: none;
}

/* ============ Table ============ */
.table-wrap {
  overflow-x: auto;
  border: none;
  background: transparent;
  box-shadow: none;
}
table {
  width: 100%;
  border-collapse: separate; /* Satırları ayırmak için */
  border-spacing: 0 8px; /* Satırlar arası dikey boşluk */
  background: transparent;
}
th, td {
  padding: 12px 12px;
  text-align: left;
  white-space: nowrap;
  font-size: .88rem;
}
thead th {
  background: var(--panel);
  color: var(--muted);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  font-weight: 700;
  border-bottom: none;
  padding: 13px 12px;
}
thead th:first-child {
  border-radius: 10px 0 0 10px;
}
thead th:last-child {
  border-radius: 0 10px 10px 0;
}
tbody tr {
  background: var(--panel);
  box-shadow: var(--shadow);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
tbody tr td {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
tbody tr td:first-child {
  border-left: 1px solid var(--line);
  border-radius: 10px 0 0 10px;
}
tbody tr td:last-child {
  border-right: 1px solid var(--line);
  border-radius: 0 10px 10px 0;
}
tbody tr:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: var(--panel);
}
tbody tr:nth-child(even) {
  background: var(--panel); /* Modern stilde arkaplanı aynı tutup boşluklarla ayırıyoruz */
}
tbody tr:nth-child(even):hover {
  background: var(--panel);
}
.actions a {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--panel2);
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 600;
  font-size: 0.8rem;
  margin-right: 6px;
  text-decoration: none !important;
  transition: all 0.15s ease;
}
.actions a:hover {
  background: var(--accent-grad);
  color: #ffffff !important;
  border-color: transparent;
  transform: translateY(-1px);
}
.empty {
  color: var(--muted);
  padding: 40px 0;
  text-align: center;
  font-size: 1rem;
}

/* ============ Detail Card ============ */
.detail-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 24px;
  margin-bottom: 28px;
  box-shadow: var(--shadow);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s ease;
}
.detail-card:hover {
  border-color: var(--accent2);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
table.detail {
  background: transparent;
}
table.detail th {
  background: transparent;
  width: 200px;
  color: var(--muted);
  text-transform: none;
  font-size: .9rem;
  font-weight: 600;
  border-bottom: 1px solid #f1f5f9;
}
table.detail td {
  white-space: normal;
  border-bottom: 1px solid #f1f5f9;
}
.head-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
h2 {
  font-size: 1.25rem;
  margin: 28px 0 16px;
  color: var(--accent);
  font-weight: 800;
  letter-spacing: -0.01em;
}

/* ============ File List ============ */
.file-list {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
}
.file-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid #e2e8f0;
  gap: 12px;
  transition: background 0.12s ease;
}
.file-list li:hover {
  background: var(--panel2);
}
.upload-form {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  padding-top: 14px;
}
.upload-form input[type=file] {
  color: var(--muted);
}

/* ============ Danger Buttons ============ */
.btn-danger {
  background: var(--err);
  box-shadow: 0 2px 4px rgba(220, 38, 38, 0.15);
}
.btn-danger:hover {
  background: #b91c1c;
  box-shadow: 0 4px 8px rgba(220, 38, 38, 0.2);
}
.btn-danger-sm {
  background: transparent;
  color: var(--err);
  border: 1px solid #fecaca;
  padding: 6px 13px;
  border-radius: var(--radius-sm);
  font-size: .82rem;
}
.btn-danger-sm:hover {
  background: var(--err);
  color: #fff;
  border-color: var(--err);
}

/* ============ Form Grid ============ */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  background: var(--panel);
  padding: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: .8rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.2px;
}
.form-grid label.full {
  grid-column: 1 / -1;
}
.form-grid input, .form-grid textarea, .form-grid select {
  padding: 12px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--text);
  font-size: .9rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-grid input:focus, .form-grid textarea:focus, .form-grid select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-actions {
  display: flex;
  gap: 16px;
  align-items: center;
}
.foot {
  text-align: center;
  color: var(--muted);
  font-size: .82rem;
  padding: 32px;
}

@media(max-width: 768px) {
  .form-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media(max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
}

/* ============ Transitions ============ */
button, .btn, .btn-sm, .btn-clear, .btn-danger, .btn-danger-sm, a {
  transition: all .15s ease;
}

.container {
  animation: pageIn 0.3s ease both;
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.auth-card {
  animation: cardIn 0.4s ease both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

/* Nav links */
.topbar nav a {
  position: relative;
  padding: 8px 12px;
  color: #94a3b8;
  font-weight: 500;
  font-size: .88rem;
  border-radius: var(--radius-sm);
  transition: color .15s ease, background .15s ease;
}
.topbar nav a:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
}
.topbar nav a:not(.logout):not(.who)::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 0px;
  height: 2px;
  width: 0;
  background: #b91c1c;
  transition: width .2s ease;
}
.topbar nav a:not(.logout):not(.who):hover::after {
  width: calc(100% - 20px);
}

/* Table row stagger */
tbody tr {
  animation: rowIn 0.25s ease both;
}
tbody tr:nth-child(1) { animation-delay: .01s }
tbody tr:nth-child(2) { animation-delay: .02s }
tbody tr:nth-child(3) { animation-delay: .03s }
tbody tr:nth-child(4) { animation-delay: .04s }
tbody tr:nth-child(5) { animation-delay: .05s }
tbody tr:nth-child(n+6) { animation-delay: .06s }
@keyframes rowIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

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

.btn-sm {
  background: var(--panel2);
  color: var(--accent);
  border: 1px solid var(--line);
  padding: 5px 12px;
  border-radius: 10px;
  font-size: .82rem;
  font-weight: 600;
}
.btn-sm:hover {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 2px 6px rgba(30, 58, 138, 0.15);
  border-color: transparent;
}

.file-viewer {
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
  padding: 20px;
  background: #0f172a;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .88rem;
  line-height: 1.6;
  color: #e2e8f0;
  max-height: 60vh;
  overflow: auto;
}

/* ============ Modal ============ */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(11, 15, 25, 0.7);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}
.modal.open {
  display: flex;
  animation: fadeIn .2s ease both;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal-box {
  background: var(--panel);
  border: 1.5px solid var(--accent);
  border-radius: 12px;
  width: 100%;
  max-width: 800px;
  box-shadow: 0 0 40px var(--accent-glow);
  animation: modalIn .3s ease both;
  overflow: hidden;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--panel2);
}
.modal-close {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 6px 14px;
  font-size: .85rem;
  border-radius: 10px;
}
.modal-close:hover {
  background: var(--err);
  color: #fff;
  border-color: var(--err);
}
.modal-box .file-viewer {
  border: none;
  border-radius: 0;
  max-height: 65vh;
}

@media(prefers-reduced-motion: reduce) {
  *, *::after, *::before {
    animation: none !important;
    transition: none !important;
  }
}

/* ============ Category Folder Cards ============ */
.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
}
.folder-card {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 18px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;              /* let the ellipsis clip long names instead of overflowing */
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s ease, background 0.25s ease;
  cursor: pointer;
  box-shadow: var(--shadow);
  text-decoration: none !important;
  color: inherit;
}
.folder-card:hover {
  border-color: var(--accent2);
  background: var(--accent-glow);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.folder-card.active {
  background: var(--accent-glow);
  border-color: var(--accent);
  border-width: 2px;
  box-shadow: 0 4px 12px rgba(30, 58, 138, 0.12);
}
.folder-card span.f-icon {
  font-size: 1.6rem;
}
.folder-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}
.folder-name {
  font-size: 0.88rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}
.folder-count {
  font-size: 0.75rem;
  color: var(--muted);
}

/* ============ Official Warning Banner ============ */
.official-warning {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-left: 4px solid #dc2626;
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 24px;
  font-size: 0.8rem;
  color: #7f1d1d;
  display: flex;
  align-items: center;
  gap: 16px;
  line-height: 1.5;
  box-shadow: var(--shadow);
}
.official-warning strong {
  color: #991b1b;
}

.sentinel-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  padding: 6px 12px;
  border-radius: 6px;
  color: #b91c1c;
  font-weight: 800;
  font-size: 0.7rem;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.sentinel-dot {
  width: 14px;
  height: 14px;
  border: 1px solid rgba(220, 38, 38, 0.4);
  border-radius: 50%;
  position: relative;
  display: inline-block;
  box-shadow: 0 0 8px rgba(220, 38, 38, 0.2);
  flex-shrink: 0;
  overflow: hidden;
}
.sentinel-dot::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #dc2626;
  opacity: 0.75;
  /* Dönen radar taraması durduruldu — sabit kırmızı gösterge. */
}

@keyframes radar-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ============ Pulse dots & Authorizations ============ */
.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: #22c55e;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
}
/* Pulse yalnızca tek canlı odakta (canlı işlem akışı) oynar; diğer noktalar sabit. */
.pulse-dot.live {
  animation: pulse-animation 1.5s infinite;
}

@keyframes pulse-animation {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

.badge-role {
  background: rgba(34, 197, 94, 0.12);
  color: #22c55e;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  border: 1px solid rgba(34, 197, 94, 0.25);
  margin-left: 4px;
}

/* ============ Pure CSS Folder Icon ============ */
.folder-svg-icon {
  width: 32px;
  height: 24px;
  position: relative;
  background: #d97706; /* Solid Amber */
  border-radius: 4px;
  border-top-left-radius: 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.folder-svg-icon::before {
  content: '';
  width: 14px;
  height: 4px;
  background: #d97706;
  position: absolute;
  top: -4px;
  left: 0;
  border-top-left-radius: 3px;
  border-top-right-radius: 3px;
}
.folder-svg-icon::after {
  content: '';
  position: absolute;
  width: 28px;
  height: 19px;
  background: #f59e0b; /* Lighter Amber front flap */
  bottom: 0;
  left: 2px;
  border-radius: 2px;
  transition: all 0.2s ease;
  transform-origin: bottom left;
}
.folder-card:hover .folder-svg-icon::after {
  transform: skewX(-12deg) scaleY(0.85);
  background: #fbbf24;
}
.folder-card.active .folder-svg-icon {
  background: var(--accent);
}
.folder-card.active .folder-svg-icon::before {
  background: var(--accent);
}
.folder-card.active .folder-svg-icon::after {
  background: var(--accent2);
}

/* ============ Dark Theme Variables ============ */
body.dark-theme {
  --bg: #0b0f19;       /* Derin uzay laciverti */
  --panel: #131c2e;    /* Yumuşak panel kontrastı */
  --panel2: #1e293b;   /* İkincil elemanlar */
  --line: rgba(255, 255, 255, 0.08);
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #eab308; /* Tactical Gold */
  --accent2: #38bdf8; /* Tactical Cyan/Blue */
  --accent-glow: rgba(234, 179, 8, 0.08);
  --accent-grad: linear-gradient(135deg, #1e3a8a, #0f172a);
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.35), 0 2px 6px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 20px 46px rgba(0, 0, 0, 0.5), 0 6px 14px rgba(0, 0, 0, 0.4);
  --grid-color: rgba(56, 189, 248, 0.025);
  --scanline-color: rgba(56, 189, 248, 0.035);
}

/* Koyu temada uyarı kutuları (açık renkli kalıp bozuk görünmesin) */
body.dark-theme .alert-ok {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.3);
  border-left-color: #22c55e;
  color: #86efac;
}
body.dark-theme .alert-err {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
  border-left-color: #ef4444;
  color: #fca5a5;
}
body.dark-theme .alert-warn {
  background: rgba(234, 179, 8, 0.12);
  border-color: rgba(234, 179, 8, 0.3);
  border-left-color: #eab308;
  color: #fde68a;
}
body.dark-theme .login-notice {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.25);
  border-left-color: #ef4444;
  color: #fca5a5;
}

body.dark-theme .official-warning {
  background: rgba(239, 68, 68, 0.05);
  border-color: rgba(239, 68, 68, 0.2);
  border-left-color: #ef4444;
  color: #fca5a5;
}
body.dark-theme .official-warning strong {
  color: #fecaca;
}
body.dark-theme .sentinel-badge {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fecaca;
}
body.dark-theme .sentinel-dot {
  background-color: #ef4444;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
}

body.dark-theme .badge-role {
  background: rgba(234, 179, 8, 0.12);
  color: #facc15;
  border-color: rgba(234, 179, 8, 0.25);
}
body.dark-theme .pulse-dot {
  background-color: #eab308;
  box-shadow: 0 0 0 0 rgba(234, 179, 8, 0.7);
}
body.dark-theme .pulse-dot.live {
  animation-name: pulse-animation-dark;
}

@keyframes pulse-animation-dark {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(234, 179, 8, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(234, 179, 8, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(234, 179, 8, 0);
  }
}

body.dark-theme tbody tr {
  background: var(--panel);
}
body.dark-theme tbody tr:hover {
  background: var(--panel);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}
body.dark-theme tbody tr:nth-child(even) {
  background: var(--panel);
}
body.dark-theme tbody tr:nth-child(even):hover {
  background: var(--panel);
}
body.dark-theme table.detail th, body.dark-theme table.detail td {
  border-bottom: 1px solid #1f2937;
}
body.dark-theme .topbar nav a:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* ============ Dossier Details Card ============ */
.dossier-card {
  display: flex;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 28px;
  box-shadow: var(--shadow);
  gap: 28px;
  align-items: center;
}
.dossier-avatar {
  width: 110px;
  height: 140px;
  background: var(--panel2) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%2394a3b8"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/></svg>') no-repeat center;
  background-size: 70px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: 8px;
  font-size: 0.62rem;
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.dossier-avatar::after {
  content: "T.C. EGM";
  position: absolute;
  top: 6px;
  font-size: 0.55rem;
  background: rgba(30, 58, 138, 0.15);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 800;
}
body.dark-theme .dossier-avatar::after {
  background: rgba(234, 179, 8, 0.2);
  color: var(--accent);
}
.dossier-header-info {
  flex: 1;
}
.dossier-header-info h1 {
  font-size: 1.9rem;
  margin: 0 0 6px 0;
  color: var(--accent);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.dossier-meta {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
}
.dossier-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-bottom: 28px;
}
@media (max-width: 768px) {
  .dossier-grid {
    grid-template-columns: 1fr;
  }
  .dossier-card {
    flex-direction: column;
    text-align: center;
  }
}

/* ============ Audit Log Badges ============ */
.log-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border: 1px solid transparent;
}
.log-badge.badge-success {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.2);
}
.log-badge.badge-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.2);
}
.log-badge.badge-warning {
  background: rgba(249, 115, 22, 0.1);
  color: #f97316;
  border-color: rgba(249, 115, 22, 0.2);
}
.log-badge.badge-info {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  border-color: rgba(59, 130, 246, 0.2);
}
.log-badge.badge-accent {
  background: rgba(168, 85, 247, 0.1);
  color: #a855f7;
  border-color: rgba(168, 85, 247, 0.2);
}

body.dark-theme .log-badge.badge-success {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}
body.dark-theme .log-badge.badge-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}
body.dark-theme .log-badge.badge-warning {
  background: rgba(249, 115, 22, 0.15);
  color: #fb923c;
}
body.dark-theme .log-badge.badge-info {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}
body.dark-theme .log-badge.badge-accent {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
}

/* ============ Dossier Watermark Background ============ */
.dossier-watermark-bg {
  position: relative;
  overflow: hidden;
}
.dossier-watermark-bg::before {
  content: "T.C. EGM - GIZLI VERI / YETKISIZ COGALTILAMAZ";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-15deg);
  font-size: 1.5rem;
  font-weight: 900;
  color: rgba(30, 58, 138, 0.05);
  pointer-events: none;
  white-space: nowrap;
  letter-spacing: 2px;
  z-index: 0;
  text-transform: uppercase;
  font-family: inherit;
}
body.dark-theme .dossier-watermark-bg::before {
  color: rgba(255, 255, 255, 0.03);
}
.dossier-watermark-bg > * {
  position: relative;
  z-index: 1;
}

/* ============ Refactor: inline-style → class ============ */

/* -- Topbar brand & logo -- */
.topbar-brand-group { display: flex; align-items: center; gap: 14px; }
.topbar-logo { height: 40px; width: auto; }
.brand-sub {
  display: block; font-size: 0.65rem; color: #94a3b8;
  font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase;
}
.topbar-nav { display: flex; align-items: center; gap: 12px; }
.nav-backup { color: #fbbf24 !important; font-weight: 700; }

/* -- Topbar status cluster (clock + session countdown) -- */
.status-cluster {
  display: inline-flex; align-items: center; gap: 14px;
  background: rgba(0,0,0,0.3); padding: 5px 12px; border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.08);
}
.status-item { display: inline-flex; align-items: center; gap: 6px; }
.status-label { font-size: 0.62rem; color: #94a3b8; font-weight: 700; letter-spacing: 0.5px; }
.status-value { font-size: 0.8rem; color: #fff; font-weight: 700; }
.status-divider { width: 1px; height: 12px; background: rgba(255,255,255,0.15); }
.status-dot-warn { width: 6px; height: 6px; background: #eab308; border-radius: 50%; display: inline-block; }
.status-countdown { font-size: 0.8rem; color: #fbbf24; font-weight: 700; }
.theme-toggle {
  cursor: pointer; border: 1px solid var(--line); font-family: inherit;
  font-size: 0.82rem; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
}
.who-text { }
.official-warning-text { flex: 1; }

/* -- Auth / login screen -- */
.auth-card-login { max-width: 420px; }
.auth-head { text-align: center; margin-bottom: 20px; }
.auth-logo { height: 80px; width: auto; display: block; }
.auth-title {
  margin: 0; font-size: 1.35rem; font-weight: 800; letter-spacing: -0.01em;
  line-height: 1.3; color: var(--accent);
}
.auth-org {
  display: block; font-size: 0.7rem; color: var(--muted); font-weight: 600;
  letter-spacing: 1.5px; text-transform: uppercase; margin-top: 4px;
}
.login-notice {
  background: #fef2f2; border: 1px solid #fecaca; border-left: 3px solid #dc2626;
  border-radius: var(--radius-sm); padding: 11px 14px; margin-bottom: 20px;
  font-size: 0.72rem; color: #7f1d1d; line-height: 1.4; text-align: center;
}
.alert-sm { font-size: 0.82rem; padding: 10px 14px; }
.auth-foot {
  text-align: center; margin-top: 20px; font-size: 0.7rem;
  color: var(--muted); line-height: 1.3;
}
.auth-card input.auth-code-input {
  text-align: center; font-size: 1.5rem; font-weight: 700; letter-spacing: 8px;
  text-indent: 8px; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.auth-back { margin-top: 18px; text-align: center; }
.auth-back a { font-size: 0.9rem; color: var(--muted); }
.auth-lead { text-align: center; color: var(--muted); font-size: 0.9rem; margin-bottom: 20px; }
.btn-full { width: 100%; }
.auth-card .btn-full { padding: 14px 22px; font-size: 1rem; letter-spacing: 0.4px; margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-14 { margin-top: 14px; }
.mb-0 { margin-bottom: 0; }
.stack-sm { display: flex; flex-direction: column; gap: 12px; }
.table-scroll { max-height: 400px; overflow-y: auto; }

/* -- Generic panel card (admins / categories) -- */
.panel-card {
  background: var(--panel); border: 1px solid var(--line);
  padding: 20px; border-radius: 12px; margin-bottom: 24px;
}
.panel-card-inner {
  background: var(--panel2); border: 1px solid var(--line);
  padding: 18px; border-radius: 8px;
  display: flex; flex-direction: column; gap: 12px;
}
.card-row {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 16px;
}
.stack { display: flex; flex-direction: column; gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; margin-bottom: 24px; }
.field-full { width: 100%; margin-top: 4px; }
.avatar-exists-note { font-size: 0.8rem; margin-top: 6px; display: block; color: var(--ok); }
.muted-note { color: var(--muted); font-size: 0.88rem; margin: 4px 0 0 0; }
.pill { font-size: 0.8rem; padding: 4px 10px; border-radius: 20px; }
.pill-on { background: rgba(16,185,129,0.15); color: var(--ok); border: 1px solid rgba(16,185,129,0.2); }
.pill-off { background: rgba(239,68,68,0.15); color: var(--err); border: 1px solid rgba(239,68,68,0.2); }

/* -- 2FA setup panel -- */
.twofa-setup {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 8px;
  padding: 20px; display: flex; gap: 24px; flex-wrap: wrap; align-items: center;
  animation: fadeIn 0.3s ease;
}
.p-24 { padding: 24px; }
.panel-flex { display: flex; flex-direction: column; gap: 16px; }
.mb-24 { margin-bottom: 24px; }
.grid-align-start { align-items: start; }
.h-flex { margin: 0; display: flex; align-items: center; gap: 8px; }
.card-title { margin: 0 0 4px 0; display: flex; align-items: center; gap: 6px; }
.btn-inline { text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.select-styled {
  width: 100%; margin-top: 4px; padding: 9px 12px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text); font-size: 0.95rem;
}
.btn-outline-sm {
  padding: 4px 8px; font-size: 0.82rem; border: 1px solid var(--line);
  background: transparent; color: var(--text); border-radius: 4px; cursor: pointer;
}
.d-inline { display: inline; }
.d-block { display: block; }
.mb-4 { margin-bottom: 4px; }
.mt-4 { margin-top: 4px; }
.fs-88 { font-size: 0.88rem; }
.panel-card-inner input, .panel-card-inner label { width: 100%; }
.twofa-qr {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: #fff; padding: 12px; border-radius: 8px; width: fit-content;
  border: 1px solid var(--line);
}
.twofa-qr img { width: 180px; height: 180px; display: block; }
.twofa-qr-fallback { display: none; color: #111; width: 180px; text-align: center; font-size: 0.75rem; padding: 10px; }
.twofa-body { flex: 1; min-width: 250px; display: flex; flex-direction: column; gap: 12px; }
.twofa-key {
  margin-top: 8px; background: var(--panel); padding: 8px 12px; border-radius: 6px;
  border: 1px solid var(--line); font-size: 1.1rem; color: var(--accent);
  letter-spacing: 2px; width: fit-content;
}
.twofa-verify { margin-top: 8px; display: flex; flex-direction: column; gap: 10px; }
.twofa-verify-row { display: flex; gap: 10px; align-items: center; }
.code-input {
  width: 140px; padding: 10px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text); font-size: 1.1rem;
  letter-spacing: 2px; text-align: center;
}
.inline-actions { display: flex; gap: 8px; align-items: center; }

/* -- Dossier / view page -- */
.detail-title {
  margin: 12px 0 16px 0; font-size: 1.05rem; font-weight: 700; color: var(--accent);
  border-bottom: 2px solid var(--accent-glow); padding-bottom: 8px;
  display: flex; align-items: center; gap: 8px;
}
.dossier-avatar-img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 6px; }
.dossier-avatar.has-photo { padding: 0; }
.dossier-eyebrow {
  font-size: 0.72rem; color: var(--accent); font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; margin-bottom: 4px;
}
.btn-print { background: linear-gradient(135deg, #059669 0%, #10b981 100%); border: none; box-shadow: 0 2px 4px rgba(5,150,105,0.2); }
.mono-strong { font-weight: 700; }
.mono-accent { font-weight: 700; color: var(--accent2); }
.th-wide { width: 200px; }

/* -- Record list (index) -- */
.avatar-thumb {
  display: inline-block; width: 24px; height: 24px; border-radius: 50%;
  background-size: cover; background-position: center; margin-right: 8px;
  border: 1.5px solid var(--accent); flex-shrink: 0;
}
.avatar-thumb-empty {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%; background: var(--panel2);
  margin-right: 8px; border: 1.5px solid var(--line); font-size: 0.7rem;
  color: var(--muted); flex-shrink: 0;
}
.name-cell { display: inline-flex; align-items: center; }
.cat-badge {
  font-size: 0.7rem; padding: 3px 8px; border-radius: 6px; background: var(--accent-glow);
  color: var(--accent); border: 1px solid rgba(30,58,138,0.15); margin-right: 8px;
  font-weight: 600; display: inline-block; flex-shrink: 0; white-space: nowrap;
}
.stat-val-active { display: flex; align-items: center; gap: 8px; color: #22c55e; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.section-title { margin: 0; font-size: 1.3rem; font-weight: 800; letter-spacing: -0.01em; display: flex; align-items: center; gap: 10px; }
.manage-cats-link {
  font-size: 0.85rem; border: 1px solid var(--line); padding: 5px 12px; border-radius: 6px;
  background: var(--panel2); color: var(--text); cursor: pointer;
}
.folders-section { margin-bottom: 40px; }
.mark-hl { background: rgba(245,158,11,0.35); color: inherit; padding: 2px 4px; border-radius: 4px; }

/* -- Print-only official header / footer -- */
.print-official {
  display: flex; align-items: center; justify-content: center; gap: 15px;
  margin-bottom: 25px; border-bottom: 3px double #000; padding-bottom: 15px;
}
.print-official img { height: 65px; width: auto; }
.print-official h2 { margin: 0; font-size: 1.15rem; font-weight: 800; color: #000; letter-spacing: 1px; font-family: sans-serif; }
.print-official h3 { margin: 2px 0 0 0; font-size: 0.95rem; font-weight: 700; color: #000; letter-spacing: 0.5px; font-family: sans-serif; }
.print-official .unit { display: block; font-size: 0.7rem; font-weight: 600; color: #333; margin-top: 3px; letter-spacing: 1px; font-family: sans-serif; }
.print-only-footer { margin-top: 50px; justify-content: space-between; align-items: flex-end; }
.print-barcode {
  text-align: center; border: 1.5px solid #000; padding: 10px; width: 140px;
  font-family: monospace; font-size: 0.65rem; background: #fff; border-radius: 4px; display: inline-block;
}
.print-barcode-title { font-weight: bold; margin-bottom: 4px; color: #000; }
.print-barcode-bars { background: repeating-linear-gradient(90deg, #000, #000 2px, #fff 2px, #fff 6px); height: 35px; margin-bottom: 4px; }
.print-signature { position: relative; text-align: center; font-size: 0.85rem; line-height: 1.4; padding-right: 40px; display: inline-block; float: right; }
.print-signature .sig-note { font-size: 0.8rem; font-style: italic; color: #444; }
.print-seal { display: none; }
.ink { color: #000; }
.clearfix { clear: both; }
.ta-center { text-align: center; }
.text-ok-500 { color: var(--ok); font-weight: 500; }

/* -- Backup confirm modal (footer) -- */
.modal-backup { z-index: 10000; }
.modal-backup-box {
  max-width: 480px; text-align: center;
  border: 1.5px solid var(--accent); box-shadow: 0 0 30px var(--accent-glow);
}
.backup-modal-icon { font-size: 3rem; margin-bottom: 12px; animation: logo-glow 3s infinite ease-in-out; display: inline-block; }
.backup-modal-title { margin: 0 0 10px 0; font-size: 1.25rem; font-weight: 800; color: var(--accent); letter-spacing: 0.5px; }
.backup-modal-text { font-size: 0.82rem; line-height: 1.5; color: var(--muted); margin-bottom: 24px; }
.backup-modal-actions { display: flex; gap: 12px; justify-content: center; }
.btn-modal { padding: 10px 24px; border-radius: 10px; cursor: pointer; }
.btn-modal-cancel { border: 1px solid var(--line); background: var(--panel2); color: var(--text); }
.btn-modal-go { background: linear-gradient(135deg, #059669 0%, #10b981 100%); }

/* -- Activity log table cells -- */
.log-time { font-size: 0.85rem; }
.log-details { white-space: normal; min-width: 250px; }
.log-ua { font-size: 0.8rem; opacity: 0.7; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.pager { margin-top: 20px; display: flex; gap: 8px; justify-content: center; align-items: center; }

/* ============ Hamburger toggle (mobile nav) ============ */
.nav-toggle-cb { display: none; }
.nav-toggle { display: none; }        /* shown only on mobile via media query */
.nav-toggle span {
  display: block; width: 22px; height: 2px; background: #e2e8f0;
  border-radius: 2px; transition: transform .25s ease, opacity .2s ease;
}
.nav-toggle span + span { margin-top: 5px; }

/* ============ Responsive / Mobile ============ */
@media (max-width: 860px) {
  .topbar {
    padding: 0 16px;
    min-height: 56px;
    align-items: center;
  }
  /* Hamburger visible, sits opposite the brand */
  .nav-toggle {
    display: flex; flex-direction: column; justify-content: center;
    width: 44px; height: 40px; padding: 8px 10px; margin-left: auto;
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px; cursor: pointer; flex-shrink: 0;
  }
  /* Animate to X when open */
  .nav-toggle-cb:checked ~ .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle-cb:checked ~ .nav-toggle span:nth-child(2) { opacity: 0; }
  .nav-toggle-cb:checked ~ .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* Nav collapses; toggled open by the checkbox.
     Uses `.topbar nav` to out-specify the desktop `.topbar nav` rule. */
  .topbar nav.topbar-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 8px 0 14px;
    order: 3;                 /* full-width row under brand + toggle */
  }
  .nav-toggle-cb:checked ~ nav.topbar-nav { display: flex; }

  .topbar nav.topbar-nav a {
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 0.95rem;
    background: rgba(255,255,255,0.04);
  }
  .topbar nav.topbar-nav a::after { display: none !important; }   /* kill underline animation in stacked menu */

  .status-cluster { align-self: stretch; justify-content: center; margin-top: 4px; }
  .theme-toggle { align-self: stretch; justify-content: center; }
  .who { align-self: stretch; text-align: center; }

  /* Page content breathing room */
  .container { padding: 20px 14px; }

  /* Search goes full width, input flexes instead of a fixed 280px min */
  .page-head { gap: 12px; }
  .search { width: 100%; }
  .search input { min-width: 0; flex: 1; }

  /* Collapse all two-column grids */
  .grid-2 { grid-template-columns: 1fr; gap: 16px; }
  .form-grid { grid-template-columns: 1fr; padding: 18px; gap: 16px; }

  /* Action button rows wrap instead of overflowing */
  .head-actions, .form-actions, .inline-actions { flex-wrap: wrap; }
  .official-warning { flex-direction: column; align-items: flex-start; gap: 10px; }

  /* Slightly smaller headings on small screens */
  h1 { font-size: 1.35rem; }
  .dossier-header-info h1 { font-size: 1.4rem; }

  /* Smooth momentum scrolling for the horizontally-scrolling tables */
  .table-wrap { -webkit-overflow-scrolling: touch; }
}

@media (max-width: 420px) {
  .topbar-logo { height: 34px; }
  .brand { font-size: 1rem; }
  .brand-sub { font-size: 0.58rem; }
  .stat-icon { width: 40px; height: 40px; font-size: 1.3rem; }
  .stat-val { font-size: 1.25rem; }
  .folder-grid { grid-template-columns: 1fr 1fr; }
  .head-actions .btn, .head-actions form { flex: 1; }
}

/* ============ Baş harf avatarları ============ */
.avatar-initials {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%; margin-right: 8px;
  color: #fff; font-size: 0.62rem; font-weight: 800; flex-shrink: 0;
  border: 1.5px solid rgba(255,255,255,0.4); letter-spacing: 0.3px;
}
.dossier-initials {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; color: #fff; font-size: 2.6rem; font-weight: 800;
  border-radius: 6px; letter-spacing: 1px;
}

/* ============ Hassas alan gizle/ifşa ============ */
.sensitive {
  filter: blur(6px);
  cursor: pointer;
  transition: filter 0.2s ease;
  border-radius: 3px;
  -webkit-user-select: none; user-select: none;
}
.sensitive:hover { filter: blur(4px); }
.sensitive.revealed,
body.reveal-on .sensitive { filter: none; -webkit-user-select: auto; user-select: auto; }
.btn-reveal { background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%); border: none; box-shadow: 0 2px 4px rgba(124,58,237,0.2); }

/* ============ TC / yaş rozetleri ============ */
.tc-badge, .age-badge {
  display: inline-block; font-size: 0.66rem; font-weight: 800; padding: 2px 8px;
  border-radius: 20px; letter-spacing: 0.5px; margin-left: 8px; vertical-align: middle;
  white-space: nowrap;
}
.tc-ok  { background: rgba(34,197,94,0.15); color: #16a34a; border: 1px solid rgba(34,197,94,0.3); }
.tc-bad { background: rgba(239,68,68,0.15); color: #dc2626; border: 1px solid rgba(239,68,68,0.3); }
.age-badge { background: var(--accent-glow); color: var(--accent); border: 1px solid rgba(30,58,138,0.2); font-weight: 700; }
body.dark-theme .tc-ok  { color: #4ade80; }
body.dark-theme .tc-bad { color: #f87171; }

/* ============ Komuta Merkezi (dashboard) ============ */
.command-center { display: grid; grid-template-columns: 1.2fr 1fr 1.1fr; gap: 20px; margin-bottom: 36px; align-items: start; }
@media (max-width: 1024px) {
  .command-center { grid-template-columns: 1fr; }
}
.cc-panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 22px; box-shadow: var(--shadow);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.cc-panel:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }

/* ============ Sentinel Radar HUD ============ */
.radar-hud {
  position: relative;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: rgba(30, 58, 138, 0.05);
  margin: 0 auto 12px auto;
  overflow: hidden;
  box-shadow: 0 0 15px var(--accent-glow);
}
.radar-grid {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: 
    radial-gradient(circle, transparent 30%, rgba(56, 189, 248, 0.1) 31%, rgba(56, 189, 248, 0.1) 33%, transparent 34%),
    radial-gradient(circle, transparent 60%, rgba(56, 189, 248, 0.1) 61%, rgba(56, 189, 248, 0.1) 63%, transparent 64%),
    linear-gradient(to right, transparent 49%, rgba(56, 189, 248, 0.15) 50%, transparent 51%),
    linear-gradient(to bottom, transparent 49%, rgba(56, 189, 248, 0.15) 50%, transparent 51%);
}
.radar-sweep {
  position: absolute;
  width: 100%;
  height: 100%;
  background: conic-gradient(from 315deg, var(--accent2) 0deg, transparent 90deg);
  transform-origin: center;
  /* Radar taraması durduruldu — sabit ışık huzmesi. */
  opacity: 0.35;
}
.radar-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 10px #22c55e;
  /* Radar noktaları sabit. */
}
.dot-1 { top: 30%; left: 70%; animation-delay: 0.5s; }
.dot-2 { top: 60%; left: 25%; animation-delay: 1.8s; }

@keyframes radar-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes pulse-dot-anim {
  0%, 100% { opacity: 0.2; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.3); }
}

.radar-logs {
  font-family: monospace;
  font-size: 0.72rem;
  color: #22c55e;
  background: #020617;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  height: 90px;
  overflow-y: hidden;
  text-align: left;
  line-height: 1.4;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.4);
}
.radar-logs div {
  margin-bottom: 4px;
}
.cc-panel:hover {
  border-color: var(--accent2);
  transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.06);
}
.cc-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.9rem; font-weight: 700; color: var(--text); margin-bottom: 14px;
}
.cc-badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 0.6rem; font-weight: 800;
  letter-spacing: 0.8px; color: var(--accent2); background: var(--accent-glow);
  padding: 3px 10px; border-radius: 20px; border: 1px solid rgba(30,58,138,0.15);
}
/* Aktivite bar grafiği */
.activity-chart { display: flex; align-items: flex-end; gap: 8px; height: 170px; }
.ac-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; }
.ac-bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.ac-bar {
  width: 100%; border-radius: 5px 5px 0 0; min-height: 4px;
  background: linear-gradient(180deg, var(--accent2), var(--accent));
  transform-origin: bottom;
  animation: acGrow 1s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.ac-peak { background: linear-gradient(180deg, #f59e0b, #d97706); box-shadow: 0 0 12px rgba(245,158,11,0.4); }
@keyframes acGrow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.ac-val { font-size: 0.72rem; font-weight: 700; color: var(--text); }
.ac-lbl { font-size: 0.62rem; color: var(--muted); font-weight: 600; }
/* Canlı akış */
.feed-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.feed-item {
  display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: center;
  padding: 8px 10px; border-radius: 8px; background: var(--panel2);
  border: 1px solid var(--line); animation: rowIn 0.3s ease both;
}
.feed-detail { font-size: 0.82rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-meta { grid-column: 2; font-size: 0.72rem; color: var(--muted); }

/* ============ Açılış boot animasyonu ============ */
.boot-screen {
  position: fixed; inset: 0; z-index: 20000;
  background: radial-gradient(circle at center, #0b1220 0%, #020617 100%);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  transition: opacity 0.5s ease;
}
.boot-screen::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(56,189,248,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56,189,248,0.04) 1px, transparent 1px);
  background-size: 26px 26px;
}
.boot-screen.boot-done { opacity: 0; }
.boot-inner { position: relative; width: 100%; max-width: 440px; text-align: center; }
.boot-logo { height: 70px; width: auto; margin-bottom: 14px; animation: logo-glow 3s infinite ease-in-out; border-radius: 50%; }
.boot-title { color: #e2e8f0; font-size: 1.15rem; font-weight: 800; letter-spacing: 1px; }
.boot-sub { color: #38bdf8; font-size: 0.7rem; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; margin-top: 4px; margin-bottom: 20px; }
.boot-log {
  text-align: left; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem; color: #7dd3fc; min-height: 140px;
  background: rgba(2,6,23,0.6); border: 1px solid rgba(56,189,248,0.2);
  border-radius: 8px; padding: 14px; margin-bottom: 16px;
}
.boot-line { animation: fadeIn 0.2s ease both; margin-bottom: 4px; }
.boot-line.boot-ok { color: #4ade80; font-weight: 700; }
.boot-bar { height: 6px; background: rgba(56,189,248,0.15); border-radius: 20px; overflow: hidden; }
.boot-bar-fill { height: 100%; width: 0; background: linear-gradient(90deg, #38bdf8, #22c55e); transition: width 0.25s ease; }

/* ============ Komut Paleti (Ctrl+K) ============ */
.cmd-palette {
  position: fixed; inset: 0; z-index: 15000; display: none;
  background: rgba(2,6,23,0.55); backdrop-filter: blur(4px);
  align-items: flex-start; justify-content: center; padding: 12vh 16px 16px;
}
.cmd-palette.open { display: flex; animation: fadeIn 0.15s ease both; }
.cmd-box {
  width: 100%; max-width: 560px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  box-shadow: 0 25px 60px rgba(0,0,0,0.4); animation: modalIn 0.2s ease both;
}
.cmd-head { display: flex; align-items: center; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.cmd-kbd {
  font-size: 0.62rem; font-weight: 700; color: var(--muted); background: var(--panel2);
  border: 1px solid var(--line); border-radius: 5px; padding: 2px 6px;
}
.cmd-plus { color: var(--muted); font-size: 0.7rem; }
.cmd-input {
  flex: 1; border: none; background: transparent; color: var(--text);
  font-size: 1rem; font-family: inherit; padding: 6px 8px; outline: none;
}
.cmd-list { max-height: 320px; overflow-y: auto; padding: 6px; }
.cmd-item {
  padding: 10px 12px; border-radius: 8px; font-size: 0.9rem; cursor: pointer;
  color: var(--text); display: flex; align-items: center; gap: 8px;
}
.cmd-item.active { background: var(--accent-grad); color: #fff; }
.cmd-foot {
  padding: 8px 14px; border-top: 1px solid var(--line); font-size: 0.7rem;
  color: var(--muted); background: var(--panel2);
}

@media (max-width: 860px) {
  .command-center { grid-template-columns: 1fr; }
  .dossier-initials { font-size: 2.2rem; }

  /* Detay tablosunda etiketi değerin üstüne al: dar ekranda TC+rozet sığmıyordu */
  table.detail, table.detail tbody, table.detail tr { display: block; width: 100%; }
  table.detail tr {
    border-bottom: 1px solid #f1f5f9;
    padding: 8px 0;
  }
  table.detail tr:last-child { border-bottom: none; }
  table.detail th, table.detail td {
    display: block; width: 100% !important;
    padding: 4px 0; border-bottom: none;
    white-space: normal;
  }
  table.detail th {
    font-size: 0.72rem; text-transform: uppercase;
    letter-spacing: 0.5px; color: var(--muted); font-weight: 700;
  }
  body.dark-theme table.detail tr { border-bottom: 1px solid #1f2937; }

  /* Rozetler değere sığmazsa altına düşsün, üst satırı taşırmasın */
  .tc-badge, .age-badge { margin-left: 6px; }

  /* Dossier üst şeridinde reveal/print/edit/sil butonları düzgün sarsın */
  .dossier-card .head-actions { justify-content: center; }
  .dossier-card .head-actions .btn,
  .dossier-card .head-actions .btn-danger { padding: 8px 14px; font-size: 0.85rem; }

  /* Boot ekranı çok küçük ekranlarda daha kompakt */
  .boot-inner { padding: 0 4px; }
  .boot-log { font-size: 0.75rem; min-height: 120px; padding: 12px; }
  .boot-logo { height: 56px; }
}

/* ============ Print Styles ============ */
.print-only-header, .print-only-footer {
  display: none;
}

@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 11pt !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  /* Gizlenecek web arayüzü elemanları */
  .topbar, 
  .official-warning, 
  .head-actions, 
  .logout, 
  #theme-toggle, 
  .container > h2, 
  .container > .detail-card:last-of-type, 
  .btn-clear,
  .alert,
  form[action="delete.php"] {
    display: none !important;
  }
  .container {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    background: #ffffff !important;
  }
  .dossier-card {
    background: #ffffff !important;
    border: 1px solid #000000 !important;
    box-shadow: none !important;
    color: #000000 !important;
    padding: 16px !important;
    margin-bottom: 20px !important;
  }
  .detail-card {
    background: #ffffff !important;
    border: 1px solid #000000 !important;
    box-shadow: none !important;
    color: #000000 !important;
    page-break-inside: avoid;
    padding: 16px !important;
    margin-bottom: 16px !important;
  }
  .dossier-avatar {
    border: 1px solid #000000 !important;
    background: #ffffff !important;
  }
  .dossier-watermark-bg::before {
    color: rgba(0, 0, 0, 0.04) !important;
  }
  .print-only-header, .print-only-footer {
    display: block !important;
  }
  table.detail th {
    color: #000000 !important;
    border-bottom: 1px solid #000000 !important;
    background: transparent !important;
  }
  table.detail td {
    color: #000000 !important;
    border-bottom: 1px solid #000000 !important;
    background: transparent !important;
  }
  h3 {
    color: #000000 !important;
    border-bottom-color: #000000 !important;
  }
  .no-print {
    display: none !important;
  }
  /* Yazdırırken hassas alanlar açık gösterilsin, ekran öğeleri gizlensin */
  .sensitive { filter: none !important; }
  .tc-badge, .age-badge { border: 1px solid #000 !important; color: #000 !important; background: transparent !important; }
  .boot-screen, .cmd-palette, .command-center, .btn-reveal { display: none !important; }

  /* Yazdırma filigranı (Watermark) */
  body::before {
    content: "T.C. EMNIYET GENEL MUDURLUGU - GIZLI VERI - YETKISIZ KOPYALANAMAZ";
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    font-size: 2.2rem;
    font-weight: 900;
    color: rgba(0, 0, 0, 0.035) !important;
    pointer-events: none;
    white-space: nowrap;
    z-index: 99999;
    text-transform: uppercase;
    letter-spacing: 2px;
  }

  /* Resmi Mühür (Seal) */
  .print-seal {
    display: flex !important;
    position: absolute;
    right: 20px;
    top: -10px;
    width: 80px;
    height: 80px;
    border: 2px double #b91c1c;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #b91c1c;
    font-family: sans-serif;
    font-size: 0.55rem;
    font-weight: 800;
    transform: rotate(-12deg);
    opacity: 0.85;
    pointer-events: none;
  }
  .seal-inner {
    border: 1px dashed #b91c1c;
    border-radius: 50%;
    width: 70px;
    height: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
  }
  .seal-inner span:first-child {
    font-size: 0.5rem;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #b91c1c;
    padding-bottom: 2px;
    margin-bottom: 2px;
  }
}

/* ============ Focus-Out Blurring cards effect ============ */
.stats-grid:hover .stat-card {
  opacity: 0.6;
  filter: blur(1px);
}
.stats-grid:hover .stat-card:hover {
  opacity: 1;
  filter: none;
  transform: translateY(-5px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

.folder-grid:hover .folder-card {
  opacity: 0.6;
  filter: blur(1px);
}
.folder-grid:hover .folder-card:hover {
  opacity: 1;
  filter: none;
  transform: translateY(-5px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}


/* ============================================================
   Faz 1 — Kategori renk etiketleri
   ============================================================ */
.cat-dot {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--cat-color, #1e3a8a);
  vertical-align: middle;
  flex: none;
}

/* Klasör kartlarında kategori rengi */
.folder-card-colored { border-left: 4px solid var(--cat-color); }
.folder-card-colored:hover {
  border-color: var(--cat-color);
  background: color-mix(in srgb, var(--cat-color) 8%, transparent);
}
.folder-card-colored.active {
  border-color: var(--cat-color);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--cat-color) 25%, transparent);
}

/* Tablo satırındaki kategori rozeti (renkli) */
.cat-badge {
  background: color-mix(in srgb, var(--cat-color, #1e3a8a) 12%, transparent);
  color: var(--cat-color, #1e3a8a);
  border-color: color-mix(in srgb, var(--cat-color, #1e3a8a) 30%, transparent);
  display: inline-flex; align-items: center; gap: 5px;
}

/* categories.php — hazır renk paleti seçici */
.color-picker { display: inline-flex; flex-wrap: wrap; gap: 9px; margin-top: 6px; }
.swatch { position: relative; cursor: pointer; line-height: 0; }
.swatch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.swatch-dot {
  display: block; width: 26px; height: 26px; border-radius: 50%;
  background: var(--sw); border: 2px solid transparent;
  transition: transform .12s ease, box-shadow .12s ease;
}
.swatch:hover .swatch-dot { transform: scale(1.1); }
.swatch input:checked + .swatch-dot {
  transform: scale(1.12);
  box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--sw);
}
.swatch input:focus-visible + .swatch-dot { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--sw); }

/* categories.php — mevcut kategori için renk düzenleme */
.color-edit-form { margin: 0; }
.color-input {
  width: 42px; height: 28px; padding: 0;
  border: 1px solid var(--line); border-radius: 6px;
  background: none; cursor: pointer;
}

/* ============================================================
   Faz 2 — Toast bildirimleri + kopyala butonları
   ============================================================ */
.toast-wrap {
  position: fixed;
  right: 18px; bottom: 18px;
  z-index: 100000;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  min-width: 220px; max-width: 360px;
  padding: 12px 16px;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.18);
  font-size: 0.9rem; font-weight: 500;
  opacity: 0; transform: translateX(24px);
  transition: opacity .28s ease, transform .28s ease;
  pointer-events: auto;
}
.toast.show { opacity: 1; transform: none; }
.toast-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  font-size: 0.8rem; font-weight: 700; color: #fff; flex: none;
}
.toast-ok   { border-left-color: var(--ok); }
.toast-ok   .toast-icon { background: var(--ok); }
.toast-err  { border-left-color: var(--err); }
.toast-err  .toast-icon { background: var(--err); }
.toast-warn { border-left-color: var(--warn); }
.toast-warn .toast-icon { background: var(--warn); }
.toast-info .toast-icon { background: var(--accent); }
body.dark-theme .toast { background: #0f172a; border-color: #1e293b; }

/* Kopyala butonu */
.copy-btn {
  display: inline-flex; align-items: center; justify-content: center;
  margin-left: 6px; padding: 0;
  width: 24px; height: 22px;
  font-size: 0.72rem; line-height: 1;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 5px;
  cursor: pointer; vertical-align: middle;
  opacity: 0.55;
  transition: opacity .15s ease, background .15s ease, transform .1s ease;
}
.copy-btn:hover { opacity: 1; background: var(--accent-glow); border-color: var(--accent2); }
.copy-btn:active { transform: scale(0.9); }
.copy-btn.copied { opacity: 1; border-color: var(--ok); color: var(--ok); }
@media print { .copy-btn, .toast-wrap { display: none !important; } }

/* ============================================================
   Faz 3 — Komut paletinde canlı kayıt sonuçları
   ============================================================ */
.cmd-item.cmd-record {
  display: flex; align-items: center; gap: 10px;
}
.cmd-rec-dot {
  width: 9px; height: 9px; border-radius: 50%; flex: none;
  box-shadow: 0 0 0 3px rgba(0,0,0,0.04);
}
.cmd-rec-name { font-weight: 600; }
.cmd-rec-tc {
  font-size: 0.8rem; opacity: 0.7; letter-spacing: .5px;
}
.cmd-rec-cat {
  margin-left: auto; font-size: 0.72rem;
  padding: 2px 8px; border-radius: 20px;
  background: var(--panel2); color: var(--muted);
}

/* ============================================================
   Faz 4 — Tıklanabilir tablo sıralama
   ============================================================ */
.th-sortable { cursor: pointer; user-select: none; position: relative; white-space: nowrap; }
.th-sortable:hover { color: var(--accent2); }
.th-sortable::after {
  content: "↕";
  font-size: 0.7rem;
  opacity: 0.3;
  margin-left: 5px;
}
.th-sortable.sorted-asc::after { content: "▲"; opacity: 0.9; }
.th-sortable.sorted-desc::after { content: "▼"; opacity: 0.9; }

/* ============================================================
   Faz 5 — CSV dışa aktarma butonu
   ============================================================ */
.btn-export {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px;
  background: var(--panel2); color: var(--text);
  border: 1px solid var(--line);
  font-size: 0.85rem; font-weight: 600;
  text-decoration: none !important; cursor: pointer;
  transition: all .15s ease;
}
.btn-export:hover {
  border-color: var(--ok); color: var(--ok);
  background: color-mix(in srgb, var(--ok) 8%, transparent);
}

/* ============================================================
   Faz 6 — Son oturumlar güvenlik paneli
   ============================================================ */
.sessions-panel { margin-bottom: 28px; }
.sessions-hint { font-size: 0.8rem; }
.sessions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.session-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.session-current {
  border-color: var(--ok);
  box-shadow: 0 0 0 1px var(--ok), var(--shadow);
}
.session-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.session-user { font-weight: 700; font-size: 1rem; }
.session-badge-now {
  font-size: 0.62rem; font-weight: 700; letter-spacing: .5px;
  color: var(--ok);
  background: color-mix(in srgb, var(--ok) 12%, transparent);
  padding: 2px 8px; border-radius: 20px;
}
.session-line {
  display: flex; align-items: center; gap: 7px;
  font-size: 0.82rem; color: var(--muted);
  padding: 3px 0;
}
.session-ico { flex: none; opacity: 0.8; }
.session-time { flex-wrap: wrap; }
body.dark-theme .session-card { background: #0f172a; border-color: #1e293b; }

/* ============================================================
   Yönetim Merkezi — sekmeler
   ============================================================ */
.admin-center-title { margin: 0 0 14px; }
.admin-tabs {
  display: flex; gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}
.admin-tab {
  padding: 10px 20px;
  text-decoration: none !important;
  color: var(--muted); font-weight: 600; font-size: 0.92rem;
  border: 1px solid transparent; border-bottom: none;
  border-radius: 8px 8px 0 0;
  margin-bottom: -1px;
  transition: all .15s ease;
}
.admin-tab:hover { color: var(--text); background: var(--panel2); }
.admin-tab.active {
  color: var(--accent);
  background: var(--panel);
  border-color: var(--line);
  border-bottom: 1px solid var(--panel);
}
body.dark-theme .admin-tab.active { color: #fff; background: var(--panel); }
.tab-section-title { margin: 0; }

/* ============================================================
   Kaydırma çubuğu teması (açık + koyu) — daha önce yoktu,
   koyu temada beyaz kalan barları giderir.
   ============================================================ */
* {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;   /* Firefox */
}
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: #94a3b8; background-clip: content-box; }
::-webkit-scrollbar-corner { background: transparent; }

/* Koyu tema (html.dark-theme = ana pencere çubuğu da dahil) */
html.dark-theme, body.dark-theme { scrollbar-color: #475569 transparent; }
html.dark-theme::-webkit-scrollbar-thumb,
body.dark-theme ::-webkit-scrollbar-thumb { background: #475569; background-clip: content-box; }
html.dark-theme::-webkit-scrollbar-thumb:hover,
body.dark-theme ::-webkit-scrollbar-thumb:hover { background: #64748b; background-clip: content-box; }

/* Her zaman koyu olan üst bar için açık dolgulu çubuk */
.topbar ::-webkit-scrollbar-thumb { background: #475569; background-clip: content-box; }

/* ============================================================
   MOBİL — Kayıt tablosunu kartlara dönüştür (≤768px)
   Masaüstünde tablo aynen kalır.
   ============================================================ */
.col-name-soyad { display: none; }  /* masaüstünde soyad ayrı sütunda */

@media (max-width: 768px) {
  /* Kayıt tablosu: yatay kaydırma yerine yığılmış kartlar */
  .table-wrap:has(table.mobile-cards) { overflow: visible; border-radius: 0; }
  table.mobile-cards,
  table.mobile-cards tbody,
  table.mobile-cards tr,
  table.mobile-cards td { display: block; width: 100%; }
  table.mobile-cards thead { display: none; }

  table.mobile-cards tr {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
  }

  table.mobile-cards td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
    text-align: right;
    min-height: 0;
    animation: none;   /* satır giriş animasyonunu kartlarda kapat */
  }
  table.mobile-cards td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: .4px;
    text-align: left;
    flex: none;
  }

  /* Gizlenecekler: id ve (isim başlığına taşınan) soyad satırı */
  table.mobile-cards td.col-id,
  table.mobile-cards td[data-label="Soyad"] { display: none; }

  /* İsim hücresi = kart başlığı */
  table.mobile-cards td.col-name {
    border-bottom: 2px solid var(--line);
    padding-bottom: 12px;
    margin-bottom: 4px;
    text-align: left;
  }
  table.mobile-cards td.col-name::before { display: none; }
  table.mobile-cards td.col-name .name-cell { justify-content: flex-start; }
  table.mobile-cards td.col-name a { font-size: 1.05rem; }
  .col-name-soyad { display: inline; }   /* mobilde soyad, isimle beraber başlıkta */

  /* Son satırda alt çizgi olmasın */
  table.mobile-cards td.actions { border-bottom: none; }

  /* Aksiyonları tam genişlik butonlara çevir */
  table.mobile-cards td.actions {
    justify-content: stretch;
    gap: 8px;
    padding-top: 12px;
  }
  table.mobile-cards td.actions::before { display: none; }
  table.mobile-cards td.actions a {
    flex: 1;
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    background: var(--panel2);
    border: 1px solid var(--line);
    font-weight: 600;
    font-size: 0.9rem;
  }
  table.mobile-cards td.actions a:hover { background: var(--accent-glow); border-color: var(--accent2); }

  /* TC maskesi kartta sağda dursun */
  table.mobile-cards td.mono .sensitive { display: inline-block; }
}

/* ============================================================
   MOBİL — Komuta merkezi + istatistik optimizasyonu
   ============================================================ */
@media (max-width: 768px) {
  /* İstatistikler 2x2 (dikey alandan tasarruf) */
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { padding: 14px; gap: 10px; }
  .stat-val { font-size: 1.5rem; }
  .stat-lbl { font-size: 0.72rem; }

  /* Dekoratif "Siber Radar" panelini mobilde gizle (yer kaplıyor) */
  .cc-panel:has(.radar-hud) { display: none; }
  .command-center { gap: 12px; }
  .cc-panel { padding: 14px; }
}
@media (max-width: 480px) {
  /* Eski kural 1 sütuna düşürüyordu; 2 sütunda kalsın */
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* MOBİL — uzun metinli hücreleri alt alta yığ (kartta yan yana sıkışmasın) */
@media (max-width: 768px) {
  table.mobile-cards td.log-details,
  table.mobile-cards td.log-ua {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: 3px;
    word-break: break-word;
  }
  table.mobile-cards td.log-ua { font-size: 0.78rem; opacity: 0.8; }
  /* Toast mobilde kenarlara yapışmasın, taşmasın */
  .toast-wrap { right: 10px; left: 10px; bottom: 10px; }
  .toast { max-width: none; }
}

/* ============================================================
   MOBİL — Giriş / kimlik doğrulama ekranı cilası
   ============================================================ */
@media (max-width: 768px) {
  /* iOS'ta odaklanınca zoom yapmasın: form kontrolleri en az 16px */
  input, select, textarea { font-size: 16px; }

  .auth-body { padding: 16px; }
  .auth-card {
    padding: 30px 22px;
    border-radius: 16px;
  }
  .auth-card input {
    padding: 14px 15px;   /* daha rahat dokunma alanı (~48px) */
    margin-top: 8px;
    font-size: 16px;      /* iOS focus-zoom önle (.auth-card input'u ez) */
  }
  /* Birincil aksiyon butonu belirgin ve büyük */
  .auth-card .btn-full {
    padding: 15px;
    font-size: 1.05rem;
    min-height: 50px;
    border-radius: 12px;
  }
  /* Dikey alanı topla (küçük telefonlarda da sığsın) */
  .auth-card .auth-head { margin-bottom: 14px; }
  .auth-logo { height: 62px; }
  .login-logo-glow { padding: 6px; }
  .auth-card label { margin-bottom: 12px; }
  .login-notice { padding: 10px 12px; font-size: 0.82rem; margin: 4px 0 14px; }
  .auth-foot { margin-top: 14px; font-size: 0.78rem; }
}

/* ============================================================
   MOBİL — 2FA doğrulama kodu girişini büyük & ferah yap
   (.auth-card input'u ez: daha yüksek özgüllük)
   ============================================================ */
@media (max-width: 768px) {
  .auth-card input.auth-code-input {
    font-size: 1.75rem;      /* büyük, net rakamlar (≥16px → iOS zoom yok) */
    font-weight: 700;
    letter-spacing: 12px;
    text-indent: 12px;       /* letter-spacing'i görsel olarak ortala */
    padding: 16px 10px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  }
  .auth-lead { font-size: 0.88rem; margin-bottom: 18px; }
  .auth-back { margin-top: 16px; }
}

/* ============================================================
   MOBİL — 2FA kurulum ekranı (QR + manuel anahtar + kod doğrulama)
   ============================================================ */
@media (max-width: 768px) {
  .twofa-setup {
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
    padding: 16px;
  }
  .twofa-qr { align-self: center; }          /* QR ortada */
  .twofa-body { min-width: 0; }              /* taşmayı engelle */

  /* Manuel gizli anahtar: tam genişlik, ortalı, sarabilir */
  .twofa-key {
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    font-size: 1.05rem;
    letter-spacing: 3px;
    word-break: break-all;
  }

  /* Kod girişi + buton alt alta, tam genişlik */
  .twofa-verify-row { flex-direction: column; align-items: stretch; }
  .twofa-verify-row .code-input {
    width: 100%;
    box-sizing: border-box;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 8px;
    text-indent: 8px;
    padding: 14px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  }
  .twofa-verify-row button { width: 100%; min-height: 46px; }
}

/* ============================================================
   MOBİL — Kayıt ekleme/düzenleme formu cilası
   ============================================================ */
@media (max-width: 768px) {
  /* iOS'ta odaklanınca zoom yok + rahat dokunma alanı (~48px) */
  .form-grid input,
  .form-grid textarea,
  .form-grid select {
    font-size: 16px;
    padding: 13px 14px;
  }
  .form-grid label { font-size: 0.8rem; }

  /* Aksiyonlar: tam genişlik, büyük dokunma hedefleri */
  .form-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-top: 4px;
  }
  .form-actions button {
    width: 100%;
    min-height: 50px;
    font-size: 1.05rem;
    font-weight: 600;
  }
  .form-actions .btn-clear {
    width: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
  }
}

/* ============================================================
   Panel kartı form girişleri — düzgün input stili
   (categories & admins ekleme formlarındaki stilsiz inputları düzeltir)
   ============================================================ */
.panel-card input[type="text"],
.panel-card input[type="password"],
.panel-card select {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.panel-card input[type="text"]:focus,
.panel-card input[type="password"]:focus,
.panel-card select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ============================================================
   MOBİL — Kategori yönetimi cilası
   ============================================================ */
@media (max-width: 768px) {
  /* iOS zoom önle + rahat dokunma */
  .panel-card input[type="text"],
  .panel-card input[type="password"],
  .panel-card select { font-size: 16px; padding: 13px 14px; }

  /* Ekle / güncelle butonları tam genişlik, büyük */
  .panel-card form button[type="submit"] {
    width: 100%; min-height: 48px; font-size: 1rem; font-weight: 600;
  }

  /* Renk paleti kutucukları büyük (dokunma) */
  .color-picker { gap: 12px; }
  .swatch-dot { width: 34px; height: 34px; }

  /* Kategori kartında renk seçici + sil butonu rahat dokunma */
  table.mobile-cards .color-input { height: 40px; width: 60px; }
  table.mobile-cards .btn-danger-sm { min-height: 40px; padding: 9px 22px; }
  table.mobile-cards .color-edit-form { margin: 0; }
}

/* ============================================================
   Yöneticiler ekleme/şifre formları — düzgün input stili
   (.panel-card-inner içindeki stilsiz text/password inputları)
   ============================================================ */
.panel-card-inner input[type="text"],
.panel-card-inner input[type="password"] {
  margin-top: 4px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.panel-card-inner input[type="text"]:focus,
.panel-card-inner input[type="password"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

@media (max-width: 768px) {
  /* iOS zoom önle + rahat dokunma */
  .panel-card-inner input[type="text"],
  .panel-card-inner input[type="password"],
  .panel-card-inner .select-styled { font-size: 16px; padding: 13px 14px; }
  /* Ekle / güncelle butonları tam genişlik */
  .panel-card-inner button[type="submit"] {
    width: 100%; min-height: 48px; font-size: 1rem; font-weight: 600;
  }
}

/* ============================================================
   MOBİL — Kayıt detay (dossier) sayfası cilası
   ============================================================ */
@media (max-width: 768px) {
  /* Dossier aksiyon butonları: düzenli 2 sütun grid, eşit yükseklik */
  .head-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
    margin-top: 6px;
  }
  .head-actions > button,
  .head-actions > a,
  .head-actions > form { width: 100%; margin: 0; }
  .head-actions .btn,
  .head-actions button {
    width: 100%;
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    font-size: 0.9rem;
    text-align: center;
  }

  /* Ek dosyalar: her öğe dikey, aksiyonlar rahat dokunma */
  .file-list li { flex-direction: column; align-items: stretch; gap: 10px; }
  .file-actions { display: flex; gap: 8px; }
  .file-actions .btn-sm,
  .file-actions form { flex: 1; }
  .file-actions .btn-sm {
    text-align: center; min-height: 40px;
    display: inline-flex; align-items: center; justify-content: center;
  }
  .file-actions form button { width: 100%; min-height: 40px; }

  /* Dosya yükleme formu dikey */
  .upload-form { flex-direction: column; align-items: stretch; }
  .upload-form button { width: 100%; min-height: 46px; }

  /* Detay tablosunda etiketi (th) belirginleştir */
  table.detail th { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.4px; padding-bottom: 2px; }
}
