:root{
  --bg:#ffffff;
  --page-bg:#f6f7f9;
  --card:#ffffff;
  --muted:#6b7280;
  --accent:#d32f2f;
  --accent-strong:#b71c1c;
  --border:#e6e9ef;
  --radius:12px;
  --max-width:980px;
  --status-complete-bg:#e6ffed;
  --status-complete-text:#0b7934;
  --status-progress-bg:#fff7e6;
  --status-progress-text:#8a5c00;
  font-family:Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  color-scheme: light;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background:var(--page-bg);
  color:#0f172a;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  line-height:1.45;
  font-size:15px;
}

.container{
  max-width:var(--max-width);
  margin:36px auto;
  padding:24px;
}

/* Header */
header{
  display:flex;
  gap:20px;
  align-items:center;
  justify-content:space-between;
  margin-bottom:18px;
}
.title {
  display:flex;
  gap:12px;
  align-items:flex-start;
  flex-direction:column;
}
h1{
  margin:0;
  font-size:20px;
  letter-spacing:-0.2px;
  font-weight:600;
}
.subtitle{
  color:var(--muted);
  font-size:13px;
  margin-top:6px;
}

/* Controls */
.controls{display:flex;gap:12px;align-items:center;flex-wrap:wrap}
.filters{display:flex;gap:8px}
.filter{
  background:transparent;
  border:1px solid var(--border);
  color:#1f2937;
  padding:8px 12px;
  border-radius:10px;
  cursor:pointer;
  font-weight:500;
}
.filter.active{
  background:var(--accent);
  color:#fff;
  border-color:var(--accent-strong);
  box-shadow:0 4px 14px rgba(211,47,47,0.12);
}

/* List layout */
.list{
  margin-top:18px;
  display:grid;
  gap:14px;
  grid-template-columns:repeat(2,1fr);
}
@media (max-width:760px){ .list{grid-template-columns:1fr} }

.card, .task {
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:16px;
  box-shadow:0 6px 18px rgba(15,23,42,0.04);
  transition:transform .12s ease, box-shadow .12s ease;
  display:flex;
  flex-direction:column;
}
.card:hover, .task:hover{ transform:translateY(-3px); box-shadow:0 10px 30px rgba(15,23,42,0.06); }

.task-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:8px;
}
.task-title {
  display:flex;
  gap:10px;
  align-items:center;
}
.task h4{margin:0;font-size:16px;font-weight:600}
.task p{margin:0 0 10px;color:#263238;max-height:84px;overflow:hidden}
.meta{font-size:13px;color:var(--muted)}

/* Status badge */
.status-badge{
  padding:6px 10px;
  border-radius:999px;
  font-size:13px;
  font-weight:700;
  display:inline-block;
  min-width:84px;
  text-align:center;
  box-shadow:0 4px 10px rgba(15,23,42,0.04);
}
.status-complete{
  background:var(--status-complete-bg);
  color:var(--status-complete-text);
  border:1px solid rgba(11,121,52,0.08);
}
.status-progress{
  background:var(--status-progress-bg);
  color:var(--status-progress-text);
  border:1px solid rgba(138,92,0,0.08);
}

/* Completed state styling */
.task.completed{
  opacity:0.9;
  background:linear-gradient(180deg,#fff 0%, #fffaf9 100%);
  text-decoration:line-through;
  border-style:dashed;
}

/* Pagination */
.pagination{display:flex;gap:8px;align-items:center;margin-top:18px;flex-wrap:wrap}
.pagination button{
  background:#fff;border:1px solid var(--border);padding:8px 12px;border-radius:10px;cursor:pointer;color:#0f172a;
}
.pagination button[disabled]{opacity:0.45;cursor:not-allowed}
.pagination .page-current{background:var(--accent);color:#fff;border-color:var(--accent-strong);font-weight:600}

/* Forms and admin */
.form-inline{display:flex;gap:8px;align-items:center}
input[type="text"], input[type="password"], textarea{
  padding:10px 12px;border:1px solid var(--border);border-radius:10px;background:linear-gradient(#fff,#fff);
  outline:none;transition:border-color .12s ease, box-shadow .12s ease;width:100%;
}
textarea{min-height:88px;resize:vertical}

button.primary{
  background:var(--accent);color:#fff;border:none;padding:10px 14px;border-radius:10px;cursor:pointer;font-weight:600;
  box-shadow:0 8px 20px rgba(211,47,47,0.12);
}
button.ghost{background:transparent;border:1px solid var(--border);color:#0f172a;padding:8px 12px;border-radius:10px;cursor:pointer}
.small{padding:6px 10px;font-size:14px;border-radius:8px}

/* Admin specific layout and responsiveness */
.grid{
  display:grid;
  gap:18px;
  grid-template-columns:320px 1fr;
  align-items:start;
}
@media (max-width:980px){
  .grid{grid-template-columns:1fr; padding-bottom:8px}
  aside.panel{order:2}
  .main{order:1}
}

/* admin panels */
.panel{display:flex;flex-direction:column;gap:12px}
.list-admin{display:flex;flex-direction:column;gap:12px}

/* admin task card tweaks */
.admin-card{
  display:flex;
  flex-direction:column;
  gap:8px;
  padding:12px;
  border-radius:10px;
  border:1px solid var(--border);
  background:var(--card);
  box-shadow:none;
}
.admin-row{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
}
.admin-title{display:flex;flex-direction:column;gap:6px}
.admin-actions{display:flex;gap:8px;align-items:center}

/* action button styles */
.btn-complete{background:transparent;border:1px solid #bdbdbd;color:#0f172a;padding:8px 10px;border-radius:8px}
.btn-edit{background:#fff;border:1px solid var(--border);color:#0f172a;padding:8px 10px;border-radius:8px}
.btn-delete{background:var(--accent);color:#fff;padding:8px 10px;border-radius:8px;border:none}

/* search input responsiveness */
#searchInput{min-width:140px}
@media (max-width:520px){
  #searchInput{min-width:80px;max-width:100px}
  .filter{padding:6px 8px;font-size:14px}
}

/* small visual helpers for admin messages */
.notice{
  padding:10px;border-radius:10px;background:#fff7f7;border:1px solid rgba(211,47,47,0.06);color:var(--muted)
}

/* Admin action row */
.actions{display:flex;gap:8px;margin-top:10px}
.actions button{padding:8px 10px;border-radius:8px;border:none;cursor:pointer}
.actions .btn-complete{background:transparent;border:1px solid #a7a7a7;color:#0f172a}
.actions .btn-delete{background:var(--accent);color:#fff}
.actions .btn-edit{background:#fff;border:1px solid var(--border);color:#0f172a}

/* Footer note */
footer{margin-top:18px;color:var(--muted);font-size:13px}

/* Utility */
.kv{display:flex;gap:8px;align-items:center;color:var(--muted);font-size:13px}
.center{display:flex;justify-content:center;align-items:center}

/* Small tweaks for accessibility */
button:focus, input:focus, textarea:focus { box-shadow:0 0 0 4px rgba(211,47,47,0.08); outline:none; }
