@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── Reset & Base ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:     #1e3a8a;
  --primary-mid: #2563eb;
  --primary-lt:  #dbeafe;
  --accent:      #0ea5e9;
  --success:     #22c55e;
  --warning:     #f59e0b;
  --danger:      #ef4444;
  --bg:          #0f172a;
  --surface:     #1e293b;
  --surface2:    #273448;
  --border:      rgba(255,255,255,0.08);
  --text:        #f1f5f9;
  --text-muted:  #94a3b8;
  --radius:      14px;
  --shadow:      0 8px 32px rgba(0,0,0,0.4);
  --glass:       rgba(30,41,59,0.7);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* ── Sidebar ──────────────────────────────────────── */
.sidebar {
  width: 260px;
  min-height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 100;
  transition: transform .3s ease;
}

.sidebar-brand {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
}
.sidebar-brand .logo {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-brand .logo-icon {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--primary-mid), var(--accent));
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.sidebar-brand .logo-text { font-size: 15px; font-weight: 700; line-height: 1.2; }
.sidebar-brand .logo-sub  { font-size: 11px; color: var(--text-muted); }

.sidebar-nav { padding: 16px 12px; flex: 1; overflow-y: auto; }
.nav-section-title {
  font-size: 10px; font-weight: 600; letter-spacing: .08em;
  color: var(--text-muted); text-transform: uppercase;
  padding: 8px 8px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13.5px; font-weight: 500;
  transition: all .2s;
  cursor: pointer;
  margin-bottom: 2px;
}
.nav-item:hover   { background: var(--surface2); color: var(--text); }
.nav-item.active  { background: linear-gradient(135deg, rgba(37,99,235,.25), rgba(14,165,233,.15)); color: #60a5fa; }
.nav-item .nav-icon { font-size: 17px; width: 22px; text-align: center; }
.nav-badge {
  margin-left: auto;
  background: var(--primary-mid);
  color: #fff; font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 20px;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-muted);
  text-align: center;
}

/* ── Main ─────────────────────────────────────────── */
.main {
  margin-left: 260px;
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px);
}
.topbar-title { font-size: 18px; font-weight: 700; }
.topbar-sub   { font-size: 12px; color: var(--text-muted); margin-top: 1px; }

.content { padding: 28px; flex: 1; }

/* ── Cards ────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.card-title { font-size: 16px; font-weight: 700; }
.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(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex; align-items: center; gap: 16px;
  transition: transform .2s, box-shadow .2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 12px 40px rgba(0,0,0,.5); }
.stat-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; flex-shrink: 0;
}
.stat-icon.blue   { background: rgba(37,99,235,.15); color: #60a5fa; }
.stat-icon.green  { background: rgba(34,197,94,.15);  color: #4ade80; }
.stat-icon.yellow { background: rgba(245,158,11,.15); color: #fbbf24; }
.stat-icon.red    { background: rgba(239,68,68,.15);  color: #f87171; }
.stat-value { font-size: 28px; font-weight: 800; line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ── Buttons ──────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px;
  border-radius: 9px;
  font-size: 13px; font-weight: 600;
  cursor: pointer; border: none;
  transition: all .2s;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary  { background: var(--primary-mid); color: #fff; }
.btn-primary:hover  { background: #1d4ed8; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(37,99,235,.4); }
.btn-success  { background: var(--success); color: #fff; }
.btn-success:hover  { background: #16a34a; transform: translateY(-1px); }
.btn-danger   { background: var(--danger); color: #fff; }
.btn-danger:hover   { background: #dc2626; transform: translateY(-1px); }
.btn-ghost    { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover    { background: var(--border); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-icon { padding: 8px; border-radius: 8px; font-size: 15px; }

/* ── Forms ────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .05em; }
.form-control {
  width: 100%; padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  font-size: 13.5px;
  font-family: 'Inter', sans-serif;
  transition: border-color .2s, box-shadow .2s;
}
.form-control:focus { outline: none; border-color: var(--primary-mid); box-shadow: 0 0 0 3px rgba(37,99,235,.2); }
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { resize: vertical; min-height: 90px; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }

/* ── Diff badges ──────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600;
}
.badge-kolay  { background: rgba(34,197,94,.15);  color: #4ade80; }
.badge-orta   { background: rgba(245,158,11,.15); color: #fbbf24; }
.badge-zor    { background: rgba(239,68,68,.15);  color: #f87171; }
.badge-vize   { background: rgba(14,165,233,.15); color: #38bdf8; }
.badge-final  { background: rgba(168,85,247,.15); color: #c084fc; }
.badge-but    { background: rgba(245,158,11,.15); color: #fbbf24; }

/* ── Table ────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
thead tr { background: var(--surface2); }
th { padding: 10px 14px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); text-align: left; }
td { padding: 11px 14px; font-size: 13px; border-top: 1px solid var(--border); }
tr:hover td { background: var(--surface2); }

/* ── Modal ────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.modal-backdrop.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px;
  width: 560px; max-width: 95vw; max-height: 90vh;
  overflow-y: auto;
  transform: scale(.95);
  transition: transform .25s;
  box-shadow: 0 24px 64px rgba(0,0,0,.6);
}
.modal-backdrop.open .modal { transform: scale(1); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.modal-title  { font-size: 17px; font-weight: 700; }
.modal-close  { background: none; border: none; color: var(--text-muted); font-size: 22px; cursor: pointer; padding: 4px; transition: color .2s; }
.modal-close:hover { color: var(--danger); }

/* ── Toast ────────────────────────────────────────── */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
  min-width: 280px; max-width: 380px;
  animation: slideIn .3s ease;
  font-size: 13.5px;
}
.toast.success { border-left: 4px solid var(--success); }
.toast.error   { border-left: 4px solid var(--danger); }
.toast.info    { border-left: 4px solid var(--accent); }
@keyframes slideIn { from { transform: translateX(120%); opacity:0; } to { transform: translateX(0); opacity:1; } }
@keyframes slideOut { to { transform: translateX(120%); opacity:0; } }

/* ── Difficulty counter inputs ─────────────────────── */
.diff-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.diff-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}
.diff-card .diff-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }
.diff-card.kolay .diff-label { color: #4ade80; }
.diff-card.orta  .diff-label { color: #fbbf24; }
.diff-card.zor   .diff-label { color: #f87171; }
.diff-card .diff-avail { font-size: 11px; color: var(--text-muted); margin-bottom: 8px; }
.diff-card input[type=number] { width: 80px; text-align: center; }

/* ── Tabs ─────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; background: var(--surface2); padding: 4px; border-radius: 10px; margin-bottom: 20px; }
.tab {
  flex: 1; padding: 8px 14px; text-align: center;
  border-radius: 8px; font-size: 13px; font-weight: 600;
  cursor: pointer; color: var(--text-muted);
  transition: all .2s;
  border: none; background: transparent;
}
.tab.active { background: var(--primary-mid); color: #fff; }

/* ── Empty state ──────────────────────────────────── */
.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 14px; opacity: .4; }
.empty-state p { font-size: 14px; }

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

/* ── Animations ───────────────────────────────────── */
.fade-in { animation: fadeIn .3s ease; }
@keyframes fadeIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
}
