:root {
  --bg: #0b1020;
  --bg-soft: #121a33;
  --panel: #161f3b;
  --panel-2: #1c2748;
  --line: #27325a;
  --txt: #e8edff;
  --muted: #94a3c8;
  --brand: #5b8cff;
  --brand-2: #7c5cff;
  --ok: #22c55e;
  --warn: #f59e0b;
  --bad: #ef4444;
  --info: #38bdf8;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 18px 40px -22px rgba(0, 0, 0, .85);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background:
    radial-gradient(1100px 600px at 12% -10%, #1b2a5c 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #2a1c56 0%, transparent 50%),
    var(--bg);
  color: var(--txt);
  font-family: "Segoe UI", Inter, system-ui, -apple-system, Roboto, Arial, sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--info); }

/* ---------- LOGIN ---------- */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg-soft) 100%);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 30px 26px;
  box-shadow: var(--shadow);
}
.login-logo {
  width: 54px; height: 54px;
  border-radius: 15px;
  display: grid; place-items: center;
  font-size: 25px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 10px 24px -10px var(--brand);
  margin-bottom: 16px;
}
.login-card h1 { margin: 0 0 6px; font-size: 21px; letter-spacing: .2px; }
.login-card p.sub { margin: 0 0 20px; color: var(--muted); font-size: 13.5px; }

.user-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 18px; }
.user-btn {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 10px;
  text-align: left;
  display: flex; align-items: center; gap: 10px;
  transition: .16s ease;
}
.user-btn:hover { border-color: var(--brand); transform: translateY(-2px); }
.user-btn.active { border-color: var(--brand); background: rgba(91, 140, 255, .16); }
.avatar {
  width: 34px; height: 34px; flex: 0 0 34px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700; font-size: 13px;
  color: #08122c;
}
.user-btn .nm { font-weight: 600; font-size: 14px; }
.user-btn .rl { color: var(--muted); font-size: 11.5px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.input, .select, .textarea {
  width: 100%;
  background: #0e1730;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  outline: none;
  transition: .16s ease;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(91, 140, 255, .16); }
.textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.hint.bad { color: var(--bad); }
.hint.ok { color: var(--ok); }

.pin-row { display: flex; gap: 8px; }
.pin-row .input { text-align: center; letter-spacing: 8px; font-size: 20px; font-weight: 700; }

/* ---------- BUTTONS ---------- */
.btn {
  border: 1px solid var(--line);
  background: var(--panel-2);
  border-radius: var(--radius-sm);
  padding: 10px 15px;
  font-weight: 600;
  font-size: 14px;
  transition: .16s ease;
  display: inline-flex; align-items: center; gap: 8px;
  justify-content: center;
}
.btn:hover { border-color: var(--brand); background: #22305a; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); border-color: transparent; color: #fff; }
.btn-primary:hover { background: linear-gradient(135deg, #6f9bff, #8a6dff); }
.btn-ok { background: rgba(34, 197, 94, .16); border-color: rgba(34, 197, 94, .5); color: #bbf7d0; }
.btn-ok:hover { background: rgba(34, 197, 94, .26); border-color: var(--ok); }
.btn-bad { background: rgba(239, 68, 68, .14); border-color: rgba(239, 68, 68, .5); color: #fecaca; }
.btn-bad:hover { background: rgba(239, 68, 68, .24); border-color: var(--bad); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 9px; }
.btn-block { width: 100%; }

/* ---------- LAYOUT ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(11, 16, 32, .9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding: 12px 20px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 700; }
.brand .logo { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand), var(--brand-2)); font-size: 17px; }
.brand small { display: block; color: var(--muted); font-weight: 500; font-size: 11.5px; }
.topbar .spacer { flex: 1; }
.clock { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; background: var(--panel); border: 1px solid var(--line); padding: 7px 11px; border-radius: 9px; }
.clock b { color: var(--txt); }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding: 0 20px; background: rgba(11,16,32,.6); }
.tab { background: none; border: none; border-bottom: 2px solid transparent; padding: 12px 14px; color: var(--muted); font-weight: 600; font-size: 13.5px; }
.tab:hover { color: var(--txt); }
.tab.active { color: var(--txt); border-bottom-color: var(--brand); }
.tab .pill { background: var(--bad); color: #fff; border-radius: 20px; padding: 1px 7px; font-size: 11px; margin-left: 6px; }

.page { padding: 20px; max-width: 1500px; margin: 0 auto; }

/* ---------- QUOTA BAR (calisan paneli) ---------- */
.quota-hero {
  background: linear-gradient(135deg, rgba(91,140,255,.2), rgba(124,92,255,.09));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex; align-items: center; gap: 26px; flex-wrap: wrap;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.quota-hero .ring { flex: 0 0 auto; }
.quota-num { display: flex; align-items: baseline; gap: 8px; }
.quota-num .big { font-size: 40px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.quota-num .sep { color: var(--muted); font-size: 20px; }
.quota-num .tot { font-size: 20px; color: var(--muted); font-weight: 600; }
.quota-label { color: var(--muted); font-size: 13px; margin-top: 5px; }
.quota-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.qstat { background: rgba(9, 14, 30, .55); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 13px; min-width: 92px; }
.qstat .v { font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }
.qstat .l { color: var(--muted); font-size: 11.5px; margin-top: 2px; }

.bar { height: 10px; background: #0b1330; border-radius: 20px; overflow: hidden; border: 1px solid var(--line); }
.bar > i { display: block; height: 100%; border-radius: 20px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .4s ease; }
.bar.ok > i { background: linear-gradient(90deg, #16a34a, #4ade80); }
.bar.warn > i { background: linear-gradient(90deg, #d97706, #fbbf24); }
.bar.bad > i { background: linear-gradient(90deg, #b91c1c, #f87171); }

/* ---------- KANBAN ---------- */
.board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .board { grid-template-columns: 1fr; } }

.col { background: rgba(18, 26, 51, .6); border: 1px solid var(--line); border-radius: var(--radius); min-height: 220px; }
.col-head { display: flex; align-items: center; gap: 9px; padding: 13px 15px; border-bottom: 1px solid var(--line); }
.col-head .dot { width: 9px; height: 9px; border-radius: 50%; }
.col-head h3 { margin: 0; font-size: 14px; font-weight: 700; }
.col-head .cnt { margin-left: auto; background: var(--panel-2); border: 1px solid var(--line); border-radius: 20px; padding: 2px 9px; font-size: 12px; color: var(--muted); }
.col-body { padding: 12px; display: flex; flex-direction: column; gap: 11px; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius-sm);
  padding: 12px;
  transition: .16s ease;
}
.card:hover { border-color: var(--brand); transform: translateY(-1px); }
.card .t { font-weight: 650; font-size: 14px; margin-bottom: 6px; line-height: 1.4; }
.card .n { color: var(--muted); font-size: 12.5px; line-height: 1.5; margin-bottom: 9px; white-space: pre-wrap; word-break: break-word; }
.card .meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.card .acts { display: flex; gap: 7px; margin-top: 11px; flex-wrap: wrap; }
.tag { border: 1px solid var(--line); background: var(--panel-2); border-radius: 7px; padding: 2px 7px; font-size: 11px; }
.tag.due-soon { border-color: var(--warn); color: #fcd34d; }
.tag.due-late { border-color: var(--bad); color: #fca5a5; }
.tag.self { border-color: var(--brand-2); color: #c4b5fd; }
.empty { color: var(--muted); font-size: 13px; text-align: center; padding: 26px 10px; border: 1px dashed var(--line); border-radius: var(--radius-sm); }

/* ---------- ADMIN DASHBOARD ---------- */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 15px; }
.kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 17px;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--brand);
}
.kpi.top { border-top-color: var(--ok); }
.kpi.mid { border-top-color: var(--warn); }
.kpi.low { border-top-color: var(--bad); }
.kpi .who { display: flex; align-items: center; gap: 11px; margin-bottom: 13px; }
.kpi .who .nm { font-weight: 700; font-size: 15px; }
.kpi .who .rl { color: var(--muted); font-size: 11.5px; }
.kpi .nums { display: flex; align-items: baseline; gap: 6px; margin-bottom: 10px; }
.kpi .nums .a { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; }
.kpi .nums .b { color: var(--muted); font-size: 15px; }
.kpi .nums .pct { margin-left: auto; font-weight: 800; font-size: 19px; }
.kpi .foot { display: flex; gap: 8px; margin-top: 11px; flex-wrap: wrap; }

.mini-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 13px; margin-bottom: 18px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px; }
.tile .v { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tile .l { color: var(--muted); font-size: 12.5px; margin-top: 3px; }

/* ---------- TABLES ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table { width: 100%; border-collapse: collapse; min-width: 560px; }
th, td { padding: 11px 13px; text-align: left; border-bottom: 1px solid var(--line); font-size: 13.5px; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; background: rgba(9, 14, 30, .5); position: sticky; top: 0; }
tbody tr:hover { background: rgba(91, 140, 255, .06); }
tbody tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.miss td { background: rgba(239, 68, 68, .09); }
tr.miss td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
tr.partial td { background: rgba(245, 158, 11, .08); }
tr.partial td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
tr.full td:first-child { box-shadow: inset 3px 0 0 var(--ok); }

.badge { display: inline-block; border-radius: 20px; padding: 2px 10px; font-size: 11.5px; font-weight: 700; border: 1px solid; }
.badge.ok { color: #bbf7d0; background: rgba(34,197,94,.14); border-color: rgba(34,197,94,.45); }
.badge.warn { color: #fde68a; background: rgba(245,158,11,.14); border-color: rgba(245,158,11,.45); }
.badge.bad { color: #fecaca; background: rgba(239,68,68,.14); border-color: rgba(239,68,68,.45); }
.badge.info { color: #bae6fd; background: rgba(56,189,248,.14); border-color: rgba(56,189,248,.45); }
.badge.mute { color: var(--muted); background: var(--panel-2); border-color: var(--line); }

/* ---------- FILTER BAR ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.filters .field { margin: 0; }
.filters .field label { font-size: 11.5px; }

/* ---------- MODAL ---------- */
.modal {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--txt);
  border-radius: 16px;
  padding: 0;
  width: min(680px, calc(100vw - 32px));
  box-shadow: 0 30px 80px -30px #000;
}
.modal::backdrop { background: rgba(3, 7, 18, .72); backdrop-filter: blur(3px); }
.modal .m-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.modal .m-head h3 { margin: 0; font-size: 16px; }
.modal .m-head .x { margin-left: auto; background: none; border: none; color: var(--muted); font-size: 22px; line-height: 1; }
.modal .m-head .x:hover { color: var(--txt); }
.modal .m-body { padding: 18px 20px; max-height: min(70vh, 620px); overflow-y: auto; }
.modal .m-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 9px; justify-content: flex-end; flex-wrap: wrap; }

.counter-row { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; margin-top: 6px; }
.counter-row .c { font-variant-numeric: tabular-nums; }

.submission-box { background: #0d1531; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 13px; white-space: pre-wrap; line-height: 1.6; max-height: 260px; overflow-y: auto; word-break: break-word; }
.submission-box.link-only { white-space: normal; }

.log-item { display: flex; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.log-item:last-child { border-bottom: none; }
.log-time { flex: 0 0 62px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; padding-top: 2px; }
.log-ico { flex: 0 0 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 14px; background: var(--panel-2); border: 1px solid var(--line); }
.log-body { flex: 1; min-width: 0; }
.log-body .t { font-size: 13.5px; }
.log-body .s { color: var(--muted); font-size: 12px; margin-top: 2px; word-break: break-word; }

.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.row-between h2 { margin: 0; font-size: 18px; }
.section { margin-bottom: 22px; }
.section > h3 { margin: 0 0 12px; font-size: 15px; }

.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 9px; z-index: 90; }
.toast {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius-sm);
  padding: 12px 15px;
  min-width: 250px;
  max-width: 380px;
  box-shadow: var(--shadow);
  font-size: 13.5px;
  animation: slide .22s ease;
}
.toast.ok { border-left-color: var(--ok); }
.toast.bad { border-left-color: var(--bad); }
.toast.warn { border-left-color: var(--warn); }
@keyframes slide { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }

.alert { border-radius: var(--radius-sm); padding: 11px 14px; font-size: 13px; margin-bottom: 15px; border: 1px solid; }
.alert.info { background: rgba(56,189,248,.1); border-color: rgba(56,189,248,.4); color: #bae6fd; }
.alert.warn { background: rgba(245,158,11,.1); border-color: rgba(245,158,11,.4); color: #fde68a; }
.alert.bad { background: rgba(239,68,68,.1); border-color: rgba(239,68,68,.4); color: #fecaca; }
.alert b { color: #fff; }

.legend { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 12px; margin-top: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.mt { margin-top: 14px; }
.flex { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }
.hidden { display: none !important; }
hr.sep { border: none; border-top: 1px solid var(--line); margin: 16px 0; }
