:root {
  --bg: #0f1115; --panel: #181b22; --panel2: #1f232c; --line: #2a2f3a;
  --text: #e7e9ee; --muted: #8b93a3; --accent: #4f8cff;
  --danger: #ff5d5d; --warn: #ffb84d; --ok: #46d39a;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex; align-items: center; gap: 20px;
  padding: 12px 22px; background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; flex-wrap: wrap;
}
.brand { font-weight: 700; font-size: 17px; }
.topbar nav { display: flex; gap: 16px; }
.topbar .owner { margin-left: auto; color: var(--muted); font-size: 13px; }

main { max-width: 1000px; margin: 0 auto; padding: 22px; }
h1 { font-size: 24px; margin: 0 0 18px; }
h2.sec { font-size: 16px; margin: 26px 0 10px; color: var(--muted); font-weight: 600; }
h2.sec.danger { color: var(--danger); }
.muted { color: var(--muted); }

.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.metric { display: flex; flex-direction: column; gap: 4px; }
.metric .num { font-size: 30px; font-weight: 700; }
.metric.danger .num { color: var(--danger); }
.metric.warn .num { color: var(--warn); }

.task {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--line);
  border-radius: 10px; padding: 12px 14px; margin-bottom: 8px;
}
.task .title { font-weight: 600; }
.task .desc { margin: 4px 0 0; font-weight: 400; font-size: 13px; }
.task-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.prio-high { border-left-color: var(--danger); }
.prio-normal { border-left-color: var(--accent); }
.prio-low { border-left-color: var(--muted); }

.badge {
  display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px;
  background: var(--panel2); color: var(--muted); margin-left: 6px;
}
.badge.ok { background: rgba(70,211,154,.15); color: var(--ok); }
.badge.bad { background: rgba(255,93,93,.15); color: var(--danger); }
.deadline { font-size: 13px; color: var(--warn); margin-left: 6px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.report { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; }
.report p { margin: 6px 0 0; }

.grid { width: 100%; border-collapse: collapse; }
.grid th, .grid td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.grid th { color: var(--muted); font-weight: 600; font-size: 13px; }
.grid tr.b-overdue td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.grid tr.b-today td:first-child { box-shadow: inset 3px 0 0 var(--warn); }

.btn {
  display: inline-block; background: var(--accent); color: #fff; border: 0;
  padding: 9px 16px; border-radius: 9px; font-size: 14px; cursor: pointer;
}
.btn:hover { opacity: .9; text-decoration: none; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.row-between { display: flex; align-items: center; justify-content: space-between; }

.form { display: flex; flex-direction: column; gap: 12px; max-width: 640px; }
.form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); }
.form input, .form select, .form textarea {
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  padding: 9px 11px; border-radius: 8px; font-size: 14px;
}
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row label { flex: 1; min-width: 150px; }
.form-actions { display: flex; gap: 10px; }
.inline { display: inline; margin: 0; }
select { background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; }

.login {
  max-width: 320px; margin: 12vh auto 0; display: flex; flex-direction: column; gap: 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 28px;
}
.login h1 { margin: 0; font-size: 20px; }
.login p { margin: 0; }
.login form { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.login input {
  background: var(--panel2); border: 1px solid var(--line); color: var(--text);
  padding: 11px 12px; border-radius: 9px; font-size: 15px;
}
.login button {
  background: var(--accent); color: #fff; border: 0; padding: 11px;
  border-radius: 9px; font-size: 15px; cursor: pointer;
}
.login button:hover { opacity: .9; }
.login-error { color: var(--danger); font-size: 14px; }

@media (max-width: 700px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
}
