:root{
  --bg:#0f172a;
  --panel:#111827;
  --card:#1f2937;
  --text:#e5e7eb;
  --muted:#94a3b8;
  --line:#334155;
  --accent:#38bdf8;
  --danger:#ef4444;
  --good:#22c55e;
  --warn:#f59e0b;
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  background:linear-gradient(180deg,#0b1220 0%, #111827 100%);
  color:var(--text);
}

.app{
  max-width:1200px;
  margin:0 auto;
  padding:24px;
}

.header{
  display:flex;
  justify-content:space-between;
  gap:16px;
  align-items:flex-start;
  margin-bottom:20px;
}

.header h1{
  margin:0 0 6px;
  font-size:28px;
}

.header p{
  margin:0;
  color:var(--muted);
}

.header-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.panel{
  background:rgba(17,24,39,.9);
  border:1px solid var(--line);
  border-radius:16px;
  padding:18px;
  margin-bottom:16px;
  box-shadow:0 8px 24px rgba(0,0,0,.2);
}

.form{
  display:grid;
  gap:14px;
}

.grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
}

label{
  display:grid;
  gap:8px;
  font-size:14px;
  color:var(--muted);
}

input, select, textarea, button{
  font:inherit;
}

input, select, textarea{
  width:100%;
  padding:12px 14px;
  border-radius:12px;
  border:1px solid var(--line);
  background:var(--card);
  color:var(--text);
  outline:none;
}

input:focus, select:focus, textarea:focus{
  border-color:var(--accent);
}

.form-actions{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}

button{
  border:none;
  border-radius:12px;
  padding:11px 14px;
  cursor:pointer;
  color:#fff;
  background:var(--accent);
  transition:.2s ease;
}

button:hover{transform:translateY(-1px);}

button.secondary{background:#475569}
button.danger{background:var(--danger)}

.controls{
  display:grid;
  gap:14px;
}

.filters{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.filter-btn{
  background:#334155;
}

.filter-btn.active{
  background:var(--accent);
}

.search-row{
  display:flex;
}

.search-row input{
  max-width:420px;
}

.table-wrap{
  overflow:auto;
}

table{
  width:100%;
  border-collapse:collapse;
  min-width:900px;
}

th, td{
  text-align:left;
  padding:12px 10px;
  border-bottom:1px solid var(--line);
  vertical-align:top;
}

th{
  color:#cbd5e1;
  font-weight:600;
  font-size:14px;
}

td{
  color:var(--text);
  font-size:14px;
}

.badge{
  display:inline-flex;
  align-items:center;
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
  white-space:nowrap;
}

.badge.new{background:rgba(56,189,248,.15); color:#7dd3fc;}
.badge.progress{background:rgba(245,158,11,.15); color:#fbbf24;}
.badge.done{background:rgba(34,197,94,.15); color:#86efac;}

.row-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.small{
  padding:8px 10px;
  font-size:13px;
}

.count-info{
  color:var(--muted);
  font-size:14px;
}

.empty{
  color:var(--muted);
  text-align:center;
  padding:30px 10px;
}

@media (max-width: 780px){
  .header, .form-actions{
    flex-direction:column;
    align-items:stretch;
  }
  .grid{
    grid-template-columns:1fr;
  }
}