* { box-sizing: border-box; margin: 0; }
:root {
  --bg: #16181c; --side: #1b1e23; --card: #21252b; --card2: #1c2025;
  --line: #2c3138; --line2: #343a42;
  --txt: #e7eaef; --mut: #8b95a4;
  --teal: #2cb592; --teal-dark: #219478;
  --blue: #4596f7; --blue-soft: rgba(69, 150, 247, 0.13);
  --ok: #3ecf8e; --bad: #f47272; --warn: #e8b53a;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 8px 24px -12px rgba(0, 0, 0, 0.45);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.3), 0 16px 32px -12px rgba(0, 0, 0, 0.55);
  --radius: 14px;
}
html { -webkit-font-smoothing: antialiased; color-scheme: dark; }
body {
  font-family: -apple-system, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--txt); display: flex; min-height: 100vh;
  font-size: 15px;
}

/* ---------- kenar cubugu (Publer: koyu) ---------- */
.sidebar {
  width: 230px; flex-shrink: 0; position: sticky; top: 0; height: 100vh;
  background: var(--side); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 18px 12px;
}
.brand { font-size: 1.3em; font-weight: 800; letter-spacing: -0.02em;
         padding: 4px 10px 16px; color: #fff; }
.brand span { color: var(--teal); }
.create-btn {
  display: block; text-align: center;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  color: #fff; font-weight: 700; text-decoration: none; padding: 11px 14px;
  border-radius: 12px; margin: 0 4px 16px;
  box-shadow: 0 6px 18px -6px rgba(44, 181, 146, 0.5);
  transition: transform 0.12s, filter 0.12s;
}
.create-btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar nav a {
  display: block; padding: 10px 12px; color: #9aa4b2; text-decoration: none;
  border-radius: 10px; font-weight: 600; font-size: 0.94em;
  transition: background 0.12s, color 0.12s;
}
.sidebar nav a:hover { background: #23272e; color: #fff; }
.sidebar nav a.on {
  background: #262b33; color: #fff;
  box-shadow: inset 3px 0 0 var(--teal);
}
.side-foot { border-top: 1px solid var(--line); padding-top: 10px; }
.side-foot a { display: block; padding: 9px 12px; color: var(--mut);
               text-decoration: none; border-radius: 10px; font-size: 0.92em; }
.side-foot a:hover { background: #23272e; color: #fff; }
.side-foot a.on { background: #262b33; color: #fff; box-shadow: inset 3px 0 0 var(--teal); }
html[data-theme="light"] .side-foot a.on { background: #eef7f4; color: #1d8a6f; }

/* ---------- ust cubuk ---------- */
.main-wrap { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20; background: rgba(22, 24, 28, 0.88);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 10px 28px;
}
.tb-jump { min-width: 260px; padding: 9px 12px; border: 1px solid var(--line2);
           border-radius: 10px; background: #23272d; font-size: 0.92em;
           color: var(--txt); }
.tb-right { display: flex; align-items: center; gap: 14px; }
.tb-chip { font-size: 0.82em; color: var(--mut); background: #23272d;
           border: 1px solid var(--line); padding: 5px 12px;
           border-radius: 99px; font-weight: 600; }
.tb-theme {
  background: transparent; border: 1px solid var(--line2); border-radius: 50%;
  width: 34px; height: 34px; cursor: pointer; font-size: 1em;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.12s;
}
.tb-theme:hover { background: rgba(128, 128, 128, 0.12); }
.tb-bell { position: relative; text-decoration: none; font-size: 1.1em; }
.tb-badge {
  position: absolute; top: -7px; right: -9px; background: #e8447c; color: #fff;
  font-size: 0.6em; font-weight: 800; padding: 1px 5px; border-radius: 99px;
}

main { padding: 24px 32px 60px; max-width: 1280px; width: 100%; }

/* ---------- avatarlar ---------- */
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.78em; letter-spacing: 0.02em;
  background: hsl(var(--h, 330), 55%, 30%); color: hsl(var(--h, 330), 90%, 82%);
}
.page-cell { display: flex; align-items: center; gap: 10px; }

/* ---------- basliklar ---------- */
.greet h1 { font-size: 1.5em; letter-spacing: -0.02em; }
.greet p { color: var(--mut); margin-top: 4px; }
.page-head { display: flex; justify-content: space-between; align-items: center;
             gap: 16px; margin: 18px 0 12px; flex-wrap: wrap; }
.page-head h1 { font-size: 1.5em; letter-spacing: -0.02em; }
.page-head h2 { font-size: 1.15em; letter-spacing: -0.01em; }
.actions { display: flex; gap: 10px; align-items: center; }
.muted { color: var(--mut); } .small { font-size: 0.85em; }
.err { color: var(--bad); }
.cat-title { margin: 28px 0 10px; font-size: 1.06em; display: flex; align-items: center; }
.cat-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%;
           margin-right: 9px; }

/* ---------- istatistik kartlari ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
         gap: 14px; margin: 18px 0; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); display: flex; gap: 13px;
  align-items: center; transition: transform 0.15s, box-shadow 0.15s, border 0.15s;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift);
              border-color: var(--line2); }
.card .ico {
  width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1.2em;
  background: var(--blue-soft);
}
.card .num { font-size: 1.4em; font-weight: 800; letter-spacing: -0.02em; color: #fff; }
.card .lbl { color: var(--mut); margin-top: 2px; font-size: 0.85em; font-weight: 500; }
.card.warn .num { color: var(--bad); }
.num.pos { color: var(--ok); } .num.neg { color: var(--bad); }

/* ---------- tablolar ---------- */
.tbl {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.tbl th {
  text-align: left; font-size: 0.73em; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--mut); padding: 11px 16px;
  background: var(--card2); border-bottom: 1px solid var(--line);
}
.tbl td { padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr { transition: background 0.12s; }
.tbl tr:hover td { background: #262b32; }
.tbl a { color: var(--blue); text-decoration: none; }
.tbl a:hover { text-decoration: underline; }

/* ---------- rozetler ---------- */
.pill {
  display: inline-block; padding: 3px 11px; border-radius: 99px;
  font-size: 0.78em; font-weight: 600; background: #2a2f37; color: #aab4c2;
}
.pill.ok { background: rgba(62, 207, 142, 0.14); color: var(--ok); }
.pill.bad { background: rgba(244, 114, 114, 0.14); color: var(--bad); }
.pill.info { background: rgba(232, 181, 58, 0.13); color: var(--warn); }

/* ---------- butonlar ---------- */
.btn {
  background: linear-gradient(135deg, var(--teal), var(--teal-dark)); color: #fff;
  border: 0; border-radius: 10px; padding: 10px 18px; font-size: 0.93em;
  font-weight: 700; cursor: pointer; text-decoration: none; display: inline-block;
  box-shadow: 0 4px 14px -5px rgba(44, 181, 146, 0.5);
  transition: filter 0.12s, transform 0.12s;
}
.btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.ghost {
  background: var(--card); color: var(--txt); border: 1px solid var(--line2);
  box-shadow: none;
}
.btn.ghost:hover { background: #262b32; filter: none; }
.btn.danger { background: transparent; color: var(--bad);
              border: 1px solid rgba(244, 114, 114, 0.4); box-shadow: none; }
.btn.danger:hover { background: rgba(244, 114, 114, 0.1); filter: none; }
.btn.small { padding: 6px 12px; font-size: 0.8em; border-radius: 8px; }
.row-actions { display: flex; gap: 6px; }
.row-actions form { display: inline; }

/* ---------- kutular & formlar ---------- */
.panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 12px 0 26px; }
@media (max-width: 980px) { .panel-grid { grid-template-columns: 1fr; } }
.box {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
}
.box h2 { font-size: 1em; margin-bottom: 15px; letter-spacing: -0.01em; color: #fff; }
.box label { display: block; margin-bottom: 13px; font-size: 0.9em; font-weight: 600; }
.box label.check { font-weight: 400; display: flex; align-items: center; gap: 8px; }
.box label.check.locked { opacity: .6; cursor: not-allowed; }
.box input[type=text], .box input[type=file], .box input[type=password],
.box input[type=number], .box select, .login-card input {
  display: block; width: 100%; margin-top: 6px; padding: 10px 13px;
  border: 1px solid var(--line2); border-radius: 10px; font-size: 0.95em;
  font-weight: 400; background: #1b1f24; color: var(--txt);
  transition: border 0.12s, box-shadow 0.12s;
}
.box input:focus, .box select:focus, .login-card input:focus, .tb-jump:focus {
  outline: none; border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(44, 181, 146, 0.18);
}
.box input[type=checkbox] { accent-color: var(--teal); width: 16px; height: 16px; }
.filters { display: flex; gap: 10px; }
.filters select { padding: 9px 12px; border: 1px solid var(--line2);
                  border-radius: 10px; background: var(--card); color: var(--txt); }
.tbl select { display: inline-block; width: auto; margin: 0; padding: 7px 10px;
              border: 1px solid var(--line2); border-radius: 9px;
              background: #1b1f24; color: var(--txt); }

/* kategori satirlari */
.cat-add label { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.cat-add input[type=text] { flex: 1; margin-top: 0; }
.cat-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cat-row input[type=text] { flex: 1; padding: 8px 11px; border: 1px solid var(--line2);
                            border-radius: 9px; background: #1b1f24; color: var(--txt); }
.cat-row input[type=color], .cat-add input[type=color] {
  width: 36px; height: 36px; border: 1px solid var(--line2); border-radius: 9px;
  padding: 2px; background: var(--card); cursor: pointer; flex-shrink: 0;
}

/* kitle karisimi satirlari */
.mix-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.mix-rank { color: var(--mut); font-size: 0.85em; width: 18px; }
.mix-row select { flex: 1; margin: 0; display: inline-block; width: auto; }
.mix-row input[type=number] { width: 86px; margin: 0; }
.mix-ind { font-size: 0.85em; color: var(--mut); margin: 2px 0 12px; font-weight: 600; }
.mix-ind.ok { color: var(--ok); }
.mix-ind.bad { color: var(--bad); }

/* oneri kartlari */
.rec-card { margin-bottom: 14px; }
.rec-head { display: flex; justify-content: space-between; align-items: center;
            gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.rec-times { display: flex; align-items: center; gap: 22px; margin: 10px 0; }
.rec-arrow { font-size: 1.4em; color: var(--teal); }
.rec-rationale { font-family: inherit; font-size: 0.88em; color: var(--txt);
                 background: var(--card2); border: 1px solid var(--line);
                 border-radius: 10px; padding: 12px 14px; margin-top: 8px;
                 white-space: pre-wrap; }
details summary { cursor: pointer; }

/* isi haritasi */
.heatmap { display: grid; grid-template-columns: 42px repeat(24, minmax(20px, 1fr));
           gap: 3px; min-width: 680px; }
.hm-h { font-size: 0.68em; color: var(--mut); text-align: center; align-self: end; }
.hm-d { font-size: 0.78em; color: var(--mut); font-weight: 600;
        display: flex; align-items: center; }
.hm-cell { aspect-ratio: 1 / 1; border-radius: 5px; background: #262b32;
           cursor: default; transition: transform 0.1s; }
.hm-cell:hover { transform: scale(1.18); outline: 1px solid var(--blue); }

/* icerik takvimi */
.cal-nav { display: flex; align-items: center; justify-content: space-between;
           margin: 16px 0 10px; }
.cal-nav h2 { font-size: 1.2em; }
.cal-legend { display: flex; gap: 18px; margin-bottom: 12px; font-size: 0.85em;
              color: var(--mut); }
.cal-legend .dot { display: inline-block; width: 10px; height: 10px;
                   border-radius: 50%; margin-right: 5px; }
.d-posted { background: var(--ok); } .d-planned { background: var(--blue); }
.d-recycle { background: var(--warn); } .d-empty { background: var(--bad); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-head { text-align: center; font-size: 0.78em; text-transform: uppercase;
            letter-spacing: 0.05em; color: var(--mut); padding: 4px 0; }
.cal-cell { background: var(--card); border: 1px solid var(--line);
            border-radius: 12px; min-height: 110px; padding: 8px; }
.cal-cell.pad { background: transparent; border: 0; }
.cal-cell.today { outline: 2px solid var(--teal); outline-offset: -1px; }
.cal-day { font-weight: 700; font-size: 0.85em; margin-bottom: 6px; color: var(--mut); }
.cal-cell.today .cal-day { color: var(--teal); }
.cal-entry { font-size: 0.72em; padding: 3px 6px; border-radius: 6px;
             margin-bottom: 3px; white-space: nowrap; overflow: hidden;
             text-overflow: ellipsis; cursor: default; }
.cal-time { font-weight: 700; }
.e-posted, .e-recycle-done { background: rgba(62, 207, 142, 0.13); color: #6fe0ad; }
.e-planned, .e-planned-shuffle { background: var(--blue-soft); color: #8ec0ff; }
.e-recycle { background: rgba(232, 181, 58, 0.13); color: #f0cd76; }
.e-empty { background: rgba(244, 114, 114, 0.15); color: #ff9d9d; font-weight: 700; }
.cal-more { font-size: 0.72em; color: var(--mut); padding: 2px 6px; }

/* istatistik merkezi */
.stat-section { margin: 28px 0 12px; font-size: 1.08em; letter-spacing: -0.01em; color: #fff; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
              gap: 14px; }
.stat-card {
  background: linear-gradient(150deg, #2f6fe0, #1d4ab0);
  color: #fff; border-radius: var(--radius); padding: 20px 22px;
  box-shadow: 0 8px 24px -10px rgba(0, 0, 0, 0.5);
}
.stat-period { font-weight: 700; font-size: 0.95em; opacity: 0.95; }
.stat-value { font-size: 2em; font-weight: 800; letter-spacing: -0.02em;
              margin: 8px 0 6px; }
.stat-delta { font-weight: 700; font-size: 0.9em; }
.stat-delta.up { color: #9ff3c0; }
.stat-delta.down { color: #ffb3b0; }
.stat-vs { font-size: 0.8em; opacity: 0.8; margin-top: 2px; }

/* mini cubuk grafik + trend */
.bar-strip { display: flex; align-items: flex-end; gap: 3px; height: 120px; }
.bar-col { flex: 1; height: 100%; display: flex; align-items: flex-end;
           background: #262b32; border-radius: 4px; overflow: hidden; }
.bar-fill { width: 100%; background: linear-gradient(180deg, var(--blue), #2563c4);
            border-radius: 4px 4px 0 0; min-height: 2px; }
.bar-fill.eng { background: linear-gradient(180deg, var(--ok), #1d9a64); }
.bar-col[title$="veri yok"] .bar-fill { min-height: 0; }
.bar-labels { display: flex; justify-content: space-between; margin-top: 8px;
              font-size: 0.8em; color: var(--mut); }
.trend-svg { width: 100%; height: 140px; display: block; }

/* kurtarma kodlari */
.recovery-codes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
                  margin: 14px 0; }
.recovery-codes code { background: var(--card2); border: 1px solid var(--line);
                       border-radius: 8px; padding: 8px 10px; text-align: center;
                       font-size: 0.9em; letter-spacing: 0.05em; }
html[data-theme="light"] .recovery-codes code { background: #f8fafd; }

/* kuyruk aciklama satiri */
.caption-row { display: flex; gap: 6px; margin-top: 6px; align-items: center; }
.caption-row input[type=text] {
  flex: 1; min-width: 180px; padding: 6px 10px; font-size: 0.82em;
  border: 1px solid var(--line2); border-radius: 8px;
  background: #1b1f24; color: var(--txt);
}
html[data-theme="light"] .caption-row input[type=text] { background: #f8fafd; }

/* kucuk gorseller */
.thumb-cell { width: 66px; }
.thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 10px;
         border: 1px solid var(--line2); }

/* flash */
.flash { padding: 12px 17px; border-radius: 12px; margin-bottom: 14px;
         font-size: 0.92em; font-weight: 500; }
.flash.info { background: rgba(69, 150, 247, 0.13); color: #8ec0ff;
              border: 1px solid rgba(69, 150, 247, 0.25); }
.flash.error { background: rgba(244, 114, 114, 0.13); color: #ff9d9d;
               border: 1px solid rgba(244, 114, 114, 0.3); }

/* giris */
.login-body { display: flex; align-items: center; justify-content: center;
              background: radial-gradient(1200px 600px at 70% -10%, #1d3a4f, var(--bg)); }
.login-card { background: var(--card); border: 1px solid var(--line);
              border-radius: 20px; padding: 40px 36px; width: 360px;
              display: flex; flex-direction: column; gap: 15px;
              box-shadow: 0 24px 60px -16px rgba(0, 0, 0, 0.6); }
.login-card h1 { font-size: 1.45em; text-align: center; letter-spacing: -0.02em; color: #fff; }
.login-card h1 span { color: var(--teal); }
.login-card input { margin-top: 0; }
.login-card button { background: linear-gradient(135deg, var(--teal), var(--teal-dark));
                     color: #fff; border: 0; border-radius: 10px; padding: 12px;
                     font-size: 1em; font-weight: 700; cursor: pointer; }
.login-card button:hover { filter: brightness(1.1); }

/* =================== GUNDUZ MODU (Publer light) =================== */
html[data-theme="light"] { color-scheme: light; }
html[data-theme="light"] body {
  --bg: #f3f6fb; --side: #ffffff; --card: #ffffff; --card2: #fafbfe;
  --line: #e6eaf2; --line2: #d6deea;
  --txt: #1f2a3d; --mut: #8593ab;
  --blue-soft: rgba(47, 125, 246, 0.10);
  --ok: #16a063; --bad: #d95454; --warn: #b58a1f;
  --shadow: 0 1px 2px rgba(31, 42, 61, 0.04), 0 6px 20px -10px rgba(31, 42, 61, 0.10);
  --shadow-lift: 0 2px 4px rgba(31, 42, 61, 0.05), 0 14px 28px -10px rgba(31, 42, 61, 0.16);
}
html[data-theme="light"] .brand { color: var(--txt); }
html[data-theme="light"] .sidebar nav a { color: #5a6880; }
html[data-theme="light"] .sidebar nav a:hover { background: #f2f6fd; color: var(--txt); }
html[data-theme="light"] .sidebar nav a.on { background: #eef7f4; color: #1d8a6f; }
html[data-theme="light"] .side-foot a:hover { background: #f2f6fd; color: var(--txt); }
html[data-theme="light"] .topbar { background: rgba(255, 255, 255, 0.88); }
html[data-theme="light"] .tb-jump { background: #f8fafd; }
html[data-theme="light"] .tb-chip { background: #f2f5fa; }
html[data-theme="light"] .card .num, html[data-theme="light"] .box h2,
html[data-theme="light"] .stat-section, html[data-theme="light"] .login-card h1 {
  color: var(--txt);
}
html[data-theme="light"] .num.pos { color: var(--ok); }
html[data-theme="light"] .num.neg { color: var(--bad); }
html[data-theme="light"] .tbl tr:hover td { background: #f7faff; }
html[data-theme="light"] .pill { background: #eef1f8; color: #5a6580; }
html[data-theme="light"] .pill.ok { background: #e0f5ea; color: var(--ok); }
html[data-theme="light"] .pill.bad { background: #fdeaea; color: var(--bad); }
html[data-theme="light"] .pill.info { background: #fcf3dd; color: var(--warn); }
html[data-theme="light"] .btn.ghost { background: #fff; }
html[data-theme="light"] .btn.ghost:hover { background: #f7faff; }
html[data-theme="light"] .box input[type=text], html[data-theme="light"] .box input[type=file],
html[data-theme="light"] .box input[type=password], html[data-theme="light"] .box input[type=number],
html[data-theme="light"] .box select, html[data-theme="light"] .login-card input,
html[data-theme="light"] .cat-row input[type=text], html[data-theme="light"] .tbl select {
  background: #f8fafd; color: var(--txt);
}
html[data-theme="light"] .hm-cell { background: #eef0f6; }
html[data-theme="light"] .bar-col { background: #f1f3f9; }
html[data-theme="light"] .e-posted, html[data-theme="light"] .e-recycle-done {
  background: #e0f5ea; color: #117a48; }
html[data-theme="light"] .e-planned, html[data-theme="light"] .e-planned-shuffle {
  background: #e8f0fe; color: #2257c4; }
html[data-theme="light"] .e-recycle { background: #fcf3dd; color: #8a6914; }
html[data-theme="light"] .e-empty { background: #fdeaea; color: var(--bad); }
html[data-theme="light"] .flash.info { background: #e6f0ff; color: #1e55b8; border: 0; }
html[data-theme="light"] .flash.error { background: #fdeaea; color: var(--bad); border: 0; }
html[data-theme="light"] .avatar {
  background: hsl(var(--h, 330), 75%, 90%); color: hsl(var(--h, 330), 55%, 34%);
}
html[data-theme="light"] .login-body {
  background: radial-gradient(1200px 600px at 70% -10%, #dceefc, #f3f6fb);
}
html[data-theme="light"] .rec-rationale { color: var(--txt); }
