/* Birkod Tələbə kabineti — build addımı tələb etməyən sadə CSS (mobile-first) */
:root {
  --brand: #14C0B9;
  --brand-600: #0E9F99;
  --brand-700: #0B7F7A;
  --brand-50: #E8F9F8;
  --ink: #111827;
  --ink-2: #374151;
  --muted: #6B7280;
  --line: #E5E7EB;
  --bg: #F6F7FB;
  --card: #FFFFFF;
  --ok: #059669; --ok-bg: #ECFDF5;
  --warn: #B45309; --warn-bg: #FFFBEB;
  --bad: #DC2626; --bad-bg: #FEF2F2;
  --info: #2563EB; --info-bg: #EFF6FF;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06);
  --sidebar: 248px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--brand-700); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 17px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 3px solid rgba(20,192,185,.45); outline-offset: 2px; border-radius: 6px; }

/* ---------- Layout ---------- */
.app { min-height: 100vh; }
.sidebar { display: none; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 20px; letter-spacing: -.02em; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 16px; }
.brand small { font-weight: 500; font-size: 12px; color: var(--muted); letter-spacing: 0; }
.topbar-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; color: var(--ink-2); background: transparent; border: 0; cursor: pointer; }
.icon-btn:hover { background: var(--bg); text-decoration: none; }
.dot { position: absolute; top: 7px; right: 7px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--bad); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; }
.main { padding: 16px 16px 96px; max-width: 1180px; margin: 0 auto; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 4px 0 16px; }
.page-head p { margin-top: 4px; }

/* Mobil alt tab bar */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 10px; font-size: 11px; color: var(--muted); background: none; border: 0; font-family: inherit; cursor: pointer; }
.tabbar a:hover { text-decoration: none; }
.tabbar .active { color: var(--brand-700); font-weight: 600; }
.sheet-backdrop { position: fixed; inset: 0; background: rgba(17,24,39,.4); z-index: 40; display: none; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; background: #fff; border-radius: 18px 18px 0 0; padding: 8px 12px calc(16px + env(safe-area-inset-bottom)); transform: translateY(100%); transition: transform .2s ease; }
.sheet.open { transform: none; }
.sheet.open + .sheet-backdrop, .sheet-backdrop.open { display: block; }
.sheet-handle { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 4px auto 10px; }

/* Nav list (sidebar + sheet) */
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--ink-2); font-weight: 500; }
.nav a:hover { background: var(--bg); text-decoration: none; }
.nav a.active { background: var(--brand-50); color: var(--brand-700); font-weight: 600; }
.nav .badge { margin-left: auto; }
.nav-sep { height: 1px; background: var(--line); margin: 8px 4px; }

@media (min-width: 1024px) {
  .sidebar { display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; width: var(--sidebar); background: #fff; border-right: 1px solid var(--line); padding: 18px 14px; }
  .sidebar .brand { padding: 4px 8px 18px; }
  .sidebar-foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--line); }
  .content { margin-left: var(--sidebar); }
  .topbar .brand { display: none; }
  .topbar { justify-content: flex-end; padding: 12px 28px; }
  .main { padding: 24px 28px 48px; }
  .tabbar, .sheet, .sheet-backdrop { display: none !important; }
}

/* ---------- Components ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.grid { display: grid; gap: 16px; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .grid-4 { grid-template-columns: repeat(4, 1fr); } .grid-main { grid-template-columns: 2fr 1fr; } }
@media (min-width: 640px) and (max-width: 1023px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
.stack > * + * { margin-top: 16px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent; font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; transition: background .15s; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--brand-600); color: #fff; }
.btn-primary:hover { background: var(--brand-700); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-outline { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-outline:hover { background: var(--bg); }
.btn-ghost { background: transparent; color: var(--brand-700); padding: 0 8px; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--bg); color: var(--ink-2); white-space: nowrap; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-brand { background: var(--brand-50); color: var(--brand-700); }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 14px; margin-bottom: 16px; }
.alert-ok { background: var(--ok-bg); color: #065F46; }
.alert-warn { background: var(--warn-bg); color: #92400E; }
.alert-bad { background: var(--bad-bg); color: #991B1B; }
.alert-info { background: var(--info-bg); color: #1E40AF; }

/* Stat kartları */
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat-label { color: var(--muted); font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.stat-value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.stat-value small { font-size: 14px; color: var(--muted); font-weight: 500; }
.progress { height: 8px; border-radius: 99px; background: var(--bg); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 99px; background: var(--brand); }

/* Növbəti dərs */
.hero { background: linear-gradient(135deg, #0F172A 0%, #134E4A 100%); color: #fff; border: 0; }
.hero .muted { color: rgba(255,255,255,.7); }
.hero-row { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 12px; font-size: 14px; }
.hero-row span { display: inline-flex; align-items: center; gap: 6px; }
.date-chip { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 56px; padding: 6px 10px; border-radius: 12px; background: rgba(255,255,255,.12); line-height: 1.1; }
.date-chip b { font-size: 22px; }
.date-chip small { font-size: 11px; text-transform: uppercase; opacity: .8; }

/* Siyahılar və cədvəllər */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; padding-top: 0; }
.list .grow { flex: 1; min-width: 0; }
.table-wrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
/* Mobil: cədvəl sətirləri kart kimi */
@media (max-width: 639px) {
  table.table.responsive thead { display: none; }
  table.table.responsive, .table.responsive tbody, .table.responsive tr, .table.responsive td { display: block; width: 100%; }
  .table.responsive tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .table.responsive tr:last-child { border-bottom: 0; }
  .table.responsive td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; }
  .table.responsive td::before { content: attr(data-label); color: var(--muted); font-size: 13px; }
  .table.responsive td.num { text-align: right; }
}

/* Tabs / seçim */
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: #EEF0F4; border-radius: 12px; max-width: 100%; overflow-x: auto; }
.tabs a { padding: 7px 14px; border-radius: 9px; font-size: 14px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.tabs a:hover { text-decoration: none; }
.tabs a.active { background: #fff; color: var(--ink); box-shadow: var(--shadow); font-weight: 600; }

/* Kurs kartı */
.course-card { display: flex; flex-direction: column; gap: 12px; }
.course-card .top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.course-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--brand-50); color: var(--brand-700); display: grid; place-items: center; flex: none; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); }
.meta span { display: inline-flex; align-items: center; gap: 5px; }

/* Həftəlik cədvəl */
.week { display: grid; gap: 10px; }
@media (min-width: 900px) { .week { grid-template-columns: repeat(7, 1fr); } }
.day { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; min-height: 64px; }
.day.today { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-50); }
.day-head { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
.lesson-pill { display: block; padding: 8px; border-radius: 9px; background: var(--brand-50); border-left: 3px solid var(--brand); font-size: 13px; margin-top: 6px; color: var(--ink); }
.lesson-pill.cancelled { background: var(--bad-bg); border-left-color: var(--bad); text-decoration: line-through; color: var(--muted); }
.lesson-pill.done { background: #F3F4F6; border-left-color: #9CA3AF; }
@media (max-width: 899px) { .day.empty { display: none; } }

/* Formlar */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.input, select.input, textarea.input { width: 100%; height: 44px; padding: 0 12px; border: 1px solid #D1D5DB; border-radius: 10px; font: inherit; background: #fff; color: var(--ink); }
textarea.input { height: auto; min-height: 120px; padding: 10px 12px; resize: vertical; }
.input:focus { border-color: var(--brand); outline: 3px solid rgba(20,192,185,.2); }
.input[readonly] { background: var(--bg); color: var(--muted); }
.error { color: var(--bad); font-size: 13px; }
.hint { color: var(--muted); font-size: 12px; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--brand-600); }
.phone-input { display: flex; }
.phone-input .prefix { display: grid; place-items: center; padding: 0 12px; border: 1px solid #D1D5DB; border-right: 0; border-radius: 10px 0 0 10px; background: var(--bg); font-weight: 600; color: var(--ink-2); }
.phone-input .input { border-radius: 0 10px 10px 0; }
.otp { display: flex; gap: 8px; justify-content: center; }
.otp input { width: 46px; height: 54px; text-align: center; font-size: 22px; font-weight: 700; border: 1px solid #D1D5DB; border-radius: 12px; }
.otp input:focus { border-color: var(--brand); outline: 3px solid rgba(20,192,185,.2); }

/* Auth */
.auth { min-height: 100vh; display: grid; }
@media (min-width: 960px) { .auth { grid-template-columns: 1fr 1fr; } }
.auth-side { display: none; background: linear-gradient(160deg, #0F172A, #115E59); color: #fff; padding: 48px; flex-direction: column; justify-content: space-between; }
.auth-side h2 { font-size: 34px; line-height: 1.15; font-weight: 800; letter-spacing: -.02em; }
.auth-side ul { padding: 0; list-style: none; display: grid; gap: 12px; margin: 28px 0 0; }
.auth-side li { display: flex; gap: 10px; align-items: center; color: rgba(255,255,255,.85); }
@media (min-width: 960px) { .auth-side { display: flex; } }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
.auth-box { width: 100%; max-width: 400px; }
.auth-box h1 { font-size: 26px; margin: 24px 0 6px; }
.lang-switch { display: inline-flex; gap: 2px; font-size: 13px; }
.lang-switch a { padding: 4px 8px; border-radius: 6px; color: var(--muted); font-weight: 600; }
.lang-switch a.active { background: var(--brand-50); color: var(--brand-700); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Boş vəziyyət */
.empty-state { text-align: center; padding: 32px 16px; color: var(--muted); }
.empty-state .ic { width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 12px; background: var(--bg); display: grid; place-items: center; color: var(--muted); }
.empty-state h3 { color: var(--ink); margin-bottom: 4px; }

/* Bildirişlər */
.notif-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.notif-unread { position: relative; }
.notif-unread::after { content: ""; position: absolute; left: -10px; top: 18px; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }

/* Avatar */
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--brand-50); color: var(--brand-700); display: grid; place-items: center; font-weight: 700; font-size: 14px; overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 80px; height: 80px; font-size: 26px; }
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-chip .name { font-weight: 600; font-size: 14px; }

/* Sertifikat */
.cert { position: relative; overflow: hidden; }
.cert::before { content: ""; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%; background: var(--brand-50); }
.cert > * { position: relative; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; background: var(--bg); padding: 3px 8px; border-radius: 6px; }

/* Score ring */
.ring { --v: 0; width: 120px; height: 120px; border-radius: 50%; background: conic-gradient(var(--brand) calc(var(--v) * 1%), #E5E7EB 0); display: grid; place-items: center; flex: none; }
.ring > div { width: 92px; height: 92px; border-radius: 50%; background: #fff; display: grid; place-items: center; text-align: center; line-height: 1.1; }
.ring b { font-size: 26px; }
.formula { font-size: 13px; background: var(--bg); padding: 10px 12px; border-radius: 10px; color: var(--ink-2); }
.dev-otp { background: #FEF3C7; color: #92400E; border: 1px dashed #F59E0B; padding: 10px 12px; border-radius: 10px; font-size: 14px; margin-bottom: 16px; text-align: center; }
details.lesson { border-top: 1px solid var(--line); padding: 12px 0; }
details.lesson:first-of-type { border-top: 0; }
details.lesson summary { cursor: pointer; list-style: none; display: flex; gap: 12px; align-items: center; }
details.lesson summary::-webkit-details-marker { display: none; }
.num-chip { width: 28px; height: 28px; border-radius: 8px; background: var(--bg); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--muted); flex: none; }
.num-chip.done { background: var(--brand-50); color: var(--brand-700); }
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }

/* Düzəlişlər */
.grid > .card + .card, .grid > * + .card { margin-top: 0; }
.sheet:not(.open) { visibility: hidden; }
.sheet { transition: transform .2s ease, visibility .2s; }
input[type=file] { max-width: 100%; }
@media (max-width: 1023px) { .topbar .brand small { display: none; } .topbar .lang-switch a { padding: 4px 6px; } }
@media (max-width: 639px) { .grid-4 { grid-template-columns: repeat(2, 1fr); gap: 10px; } .grid-4 .stat-value { font-size: 20px; } }
.table.responsive td > span.muted { margin-left: 4px; }
.grid > * { min-width: 0; }
