/* Dinleti — stil dosyası */
:root {
  --bg: #f5f2ec;
  --surface: #ffffff;
  --ink: #1d2b2d;
  --ink-2: #4c5a5c;
  --muted: #7d8789;
  --line: #e4ded3;
  --brand: #1f3a3d;
  --brand-2: #2f5a5e;
  --accent: #c9a96a;
  --accent-soft: #f3ead7;
  --ok: #2e7d5b;   --ok-bg: #e5f3ec;
  --warn: #9a6512; --warn-bg: #fbf0dc;
  --err: #b23b3b;  --err-bg: #fbe7e7;
  --info: #285e8a; --info-bg: #e5eef7;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(31,58,61,.06), 0 6px 24px rgba(31,58,61,.06);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--brand-2); }
code { background: #f0ece4; padding: 1px 6px; border-radius: 6px; font-size: .92em; }
h1, h2 { line-height: 1.25; margin: 0 0 .4em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.1rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

/* ---------- Üst çubuk (yönetim) ---------- */
.topbar { background: var(--brand); color: #fff; position: sticky; top: 0; z-index: 20; }
.topbar-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; gap: 16px; padding: 10px 20px; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-weight: 600; }
.brand small { opacity: .6; font-weight: 400; margin-left: 4px; }
.brand-mark { width: 26px; height: 26px; border-radius: 50%; background: var(--accent);
  background-image: radial-gradient(circle at 50% 50%, var(--brand) 0 22%, transparent 23%), repeating-radial-gradient(circle at 50% 50%, var(--accent) 0 3px, #e9d8b4 3px 6px); flex: none; }
.brand-mark.lg { width: 44px; height: 44px; }
.nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav a { color: rgba(255,255,255,.8); text-decoration: none; padding: 7px 12px; border-radius: 8px; font-size: .94rem; }
.nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav a.active { background: rgba(255,255,255,.14); color: #fff; }
.nav a.logout { opacity: .7; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 0; color: #fff; font-size: 22px; cursor: pointer; }

.container { max-width: 1200px; margin: 0 auto; padding: 24px 20px 60px; }
.center-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 0; }
.back { display: inline-block; font-size: .88rem; text-decoration: none; margin-bottom: 4px; color: var(--muted); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px; }
.card.narrow { max-width: 720px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.grid-main > * { min-width: 0; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; text-decoration: none; color: inherit; box-shadow: var(--shadow); }
.stat strong { display: block; font-size: 1.8rem; color: var(--brand); line-height: 1.1; }
.stat span { color: var(--muted); font-size: .9rem; }

/* ---------- Form ---------- */
.form { display: flex; flex-direction: column; gap: 12px; }
.form.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.span-2 { grid-column: 1 / -1; }
.form label { display: flex; flex-direction: column; gap: 5px; font-size: .9rem; color: var(--ink-2); font-weight: 500; }
.form fieldset { border: 0; padding: 0; margin: 0 0 8px; display: flex; flex-direction: column; gap: 12px; }
.form legend { font-weight: 600; margin-bottom: 8px; color: var(--ink); }
input, select, textarea {
  font: inherit; color: var(--ink); background: #fff; border: 1px solid #d6cfc2; border-radius: 10px; padding: 9px 12px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(47,90,94,.25); border-color: var(--brand-2); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--brand-2); }
input[type=file] { padding: 8px; background: #faf8f4; }
.check { flex-direction: row !important; align-items: center; gap: 8px !important; font-weight: 400 !important; cursor: pointer; }
.check-list { max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; display: flex; flex-direction: column; gap: 6px; }
.check-list.short { max-height: 200px; }
.input-group { display: flex; gap: 6px; }
.input-group input { flex: 1; }
.hint { font-size: .85rem; color: var(--muted); margin: 0; }
.days { display: flex; flex-wrap: wrap; gap: 8px; }
.day-chip { border: 1px solid var(--line); padding: 7px 12px; border-radius: 999px; background: #faf8f4; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar input[type=search] { max-width: 380px; }
.inline-form { flex-direction: row; align-items: center; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); }
.inline-form input[name=title] { max-width: 280px; }
.file-name { min-width: 220px; }

/* ---------- Buton ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600; font-size: .94rem; padding: 9px 16px; border-radius: 10px; border: 1px solid #d6cfc2;
  background: #fff; color: var(--ink); cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: #f7f4ee; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-2); }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--err); border-color: #e7c4c4; background: #fff; }
.btn-danger:hover { background: var(--err-bg); }
.btn-small { padding: 5px 10px; font-size: .84rem; border-radius: 8px; }
.btn-lg { padding: 15px 22px; font-size: 1.05rem; border-radius: 12px; }
.btn-block { width: 100%; }
.icon-btn { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 14px; color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; list-style: none; }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn.danger { color: var(--err); }
summary.icon-btn::-webkit-details-marker, summary.btn::-webkit-details-marker { display: none; }
summary { list-style: none; }

/* ---------- Tablo ---------- */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px; border-bottom: 1px solid #f0ebe2; vertical-align: top; }
.table.compact td { padding: 6px 10px; }
.table tr:last-child td { border-bottom: 0; }
.row-muted td { opacity: .55; }
.row-current td { background: #fbf8f1; }
.row-actions { display: flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
td.row-actions { display: table-cell; text-align: right; white-space: nowrap; }
td.row-actions > form, td.row-actions > details { display: inline-block; vertical-align: middle; margin: 0 0 0 4px; }
.row-actions form { margin: 0; }
.mini-bar { height: 6px; background: #eee8dd; border-radius: 6px; overflow: hidden; width: 110px; margin: 4px 0 2px; }
.mini-bar span { display: block; height: 100%; background: var(--brand-2); }

.inline-edit { position: relative; }
.inline-edit > .menu { display: none; }
.inline-edit[open] > .menu {
  position: absolute; right: 0; top: 36px; z-index: 10; background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.12); padding: 14px; width: 320px; display: flex; flex-direction: column; gap: 8px; text-align: left;
}
.inline-edit-actions { display: flex; gap: 6px; justify-content: flex-end; border-top: 1px solid var(--line); padding-top: 10px; }
.inline-edit-actions .btn { width: auto; }
.menu form { margin: 0; }
.menu > form:not(.move-form) > .btn { width: 100%; justify-content: flex-start; }
.move-form .btn { flex: none; }
.move-form select { flex: 1; min-width: 0; }
.move-form { display: flex; align-items: center; gap: 6px; }
.move-form input[type=number] { width: 64px; padding: 5px 8px; }
.move-form select { padding: 5px 8px; font-size: .88rem; }
.move-form span { font-size: .88rem; color: var(--ink-2); white-space: nowrap; }

/* ---------- Rozet / uyarı ---------- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-muted { background: #efebe4; color: var(--muted); }
.alert { padding: 12px 16px; border-radius: 12px; margin-bottom: 14px; border: 1px solid transparent; }
.alert-ok { background: var(--ok-bg); color: #1d5a40; border-color: #cbe6d8; }
.alert-error { background: var(--err-bg); color: #8a2a2a; border-color: #f0cccc; }
.alert-warn { background: var(--warn-bg); color: #7a500e; border-color: #f0dcb5; }
.container > .alert, .client-wrap > .alert { max-width: 1200px; }

.creds { border-color: var(--accent); background: #fffdf8; }
.creds pre { background: var(--accent-soft); padding: 14px; border-radius: 10px; font-size: 1rem; white-space: pre-wrap; margin: 10px 0; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.danger-zone { margin-top: 14px; }
.danger-zone summary { color: var(--err); cursor: pointer; font-size: .9rem; }

/* ---------- Program gün listesi ---------- */
.day-list { list-style: none; padding: 0; margin: 0; }
.day-list li { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid #f0ebe2; }
.day-no { width: 64px; flex: none; font-weight: 700; color: var(--brand-2); }
.day-title { flex: 1; }

/* ---------- Yükleme ---------- */
.upload-progress .bar { height: 10px; background: #eee8dd; border-radius: 10px; overflow: hidden; }
.upload-progress .bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand-2), var(--accent)); transition: width .3s; }
.upload-status { margin-top: 6px; font-size: .88rem; }
.preview-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 16px; z-index: 30; background: #fff; border: 1px solid var(--line); box-shadow: 0 10px 40px rgba(0,0,0,.18);
  border-radius: 14px; padding: 10px 14px; display: flex; align-items: center; gap: 12px; width: min(760px, calc(100% - 24px)); }
.preview-bar audio { flex: 1; min-width: 0; }
.preview-title { font-weight: 600; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Giriş kartı ---------- */
.auth-card { width: 100%; max-width: 400px; padding: 28px; }
.auth-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.auth-brand strong { display: block; font-size: 1.1rem; }
.auth-brand small { color: var(--muted); }

/* ======================= DANIŞAN ======================= */
.area-client { background: linear-gradient(180deg, #ebe4d6 0, var(--bg) 340px); min-height: 100vh; }
.client-wrap { max-width: 560px; margin: 0 auto; padding: 16px 16px 48px; min-height: 100vh; display: flex; flex-direction: column; }
.client-wrap > .auth-card { margin: auto; }
.client-top { display: flex; justify-content: space-between; align-items: center; padding: 6px 2px 18px; }
.client-top .brand { color: var(--brand); }
.link-quiet { color: var(--muted); text-decoration: none; font-size: .92rem; }
.listen-card { padding: 28px 24px; border-radius: 20px; }
.greet { color: var(--muted); margin: 0 0 14px; }
.journey { margin-bottom: 22px; }
.journey-bar { height: 6px; border-radius: 6px; background: #eee8dd; overflow: hidden; margin-bottom: 6px; }
.journey-bar span { display: block; height: 100%; background: var(--accent); }
.journey small { color: var(--muted); }
.day-label { display: inline-block; background: var(--accent-soft); color: #7a5a1e; font-weight: 700; padding: 4px 12px; border-radius: 999px; font-size: .88rem; margin-bottom: 10px; }
.sound-title { font-size: 1.55rem; margin-bottom: 6px; }
.sound-desc { color: var(--ink-2); margin: 0 0 18px; }
.state-box { text-align: center; padding: 18px 4px 8px; }
.state-box h1 { font-size: 1.35rem; }
.state-icon { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%; background: #efebe4; color: var(--brand-2); display: flex; align-items: center; justify-content: center; font-size: 28px; }
.state-icon.ok { background: var(--ok-bg); color: var(--ok); }

.player { margin: 22px 0 6px; }
.player .btn-lg small { font-weight: 400; opacity: .8; }
.player-ui { display: flex; align-items: center; gap: 16px; padding: 16px; background: #f7f4ee; border-radius: 16px; }
.play-toggle { width: 64px; height: 64px; border-radius: 50%; border: 0; background: var(--brand); color: #fff; cursor: pointer; flex: none; display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 18px rgba(31,58,61,.3); }
.play-toggle:active { transform: scale(.96); }
.play-toggle svg { width: 28px; height: 28px; fill: currentColor; }
.play-toggle .i-pause { display: none; }
.player-ui.is-playing .i-pause { display: block; }
.player-ui.is-playing .i-play { display: none; }
.track { flex: 1; min-width: 0; }
.track-bar { height: 8px; border-radius: 8px; background: #e3dccf; overflow: hidden; pointer-events: none; }
.track-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand-2), var(--accent)); transition: width .4s linear; }
.track-times { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; font-size: .9rem; color: var(--ink-2); margin-top: 8px; }
.player-msg { min-height: 1.4em; margin: 10px 0 0; text-align: center; color: var(--muted); font-size: .92rem; }
.player-msg.warn { color: var(--warn); }
.player-msg.ok { color: var(--ok); font-weight: 600; font-size: 1.05rem; }
.player audio { display: none; }
.rules { margin: 18px 0 0; padding: 14px 16px 14px 34px; background: #faf8f4; border-radius: 12px; color: var(--ink-2); font-size: .9rem; }
.rules li { margin: 3px 0; }
.client-note { margin-top: 16px; padding: 12px 14px; border-left: 3px solid var(--accent); background: #fffdf8; color: var(--ink-2); font-size: .92rem; border-radius: 0 10px 10px 0; }

/* ---------- Mobil ---------- */
@media (min-width: 901px) { .table-wrap { overflow: visible; } }
@media (max-width: 900px) {
  .grid-main { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .nav-toggle { display: block; }
  .nav { display: none; width: 100%; flex-direction: column; margin: 0; }
  .nav-open .nav { display: flex; }
  .topbar-inner { flex-wrap: wrap; }
}
@media (max-width: 600px) {
  .container { padding: 16px 12px 48px; }
  .form.grid-2 { grid-template-columns: 1fr; }
  .table { min-width: 620px; }
  .table.compact { min-width: 480px; }
  .card { padding: 16px; }
  h1 { font-size: 1.35rem; }
  .inline-edit[open] > .menu { position: fixed; left: 12px; right: 12px; top: 80px; width: auto; }
  .listen-card { padding: 22px 18px; }
  .sound-title { font-size: 1.35rem; }
}
