:root{
  --bg:#f6f9ff;
  --card:#ffffff;
  --line:#e6edf7;
  --blue:#1f6bff;
  --blue2:#0d4bff;
  --text:#0f172a;
  --muted:#475569;
  --charcoal:#1f2937;
  --shadow:0 18px 60px rgba(2, 8, 23, .10);
  --radius:16px;
  --radius2:20px;
  --font: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:var(--font);
  background: linear-gradient(180deg, #f6f9ff 0%, #ffffff 60%);
  color:var(--text);
}

a{color:inherit}
.container{max-width:1280px;margin:0 auto;padding:0 18px}

.app{
  min-height:100vh;
  display:grid;
  grid-template-columns: 270px 1fr;
}

.sidebar{
  background: #ffffff;
  border-right:1px solid var(--line);
  position:sticky;
  top:0;
  height:100vh;
  padding:18px 14px;
}

.brand{
  display:flex;
  gap:12px;
  align-items:center;
  padding:10px 10px 14px;
  border-bottom:1px solid var(--line);
  margin-bottom:14px;
}
.brand .mark{
  width:42px;height:42px;border-radius:14px;
  display:grid;place-items:center;
  background: linear-gradient(135deg, var(--blue), #6aa9ff);
  color:white;font-weight:900;
  box-shadow: 0 12px 26px rgba(31,107,255,.22);
}
.brand .title{font-weight:900;letter-spacing:-.02em}
.brand .sub{font-size:12px;color:var(--muted);margin-top:2px}

.nav{
  display:flex;flex-direction:column;gap:6px;
  padding:10px;
}
.nav a{
  text-decoration:none;
  padding:11px 12px;
  border-radius:14px;
  color:var(--charcoal);
  font-weight:700;
  display:flex; align-items:center; justify-content:space-between;
  border:1px solid transparent;
}
.nav a:hover{background:#f2f6ff;border-color:#e6eefc}
.nav a.active{
  background: rgba(31,107,255,.08);
  border-color: rgba(31,107,255,.20);
  color: var(--blue2);
}

.nav .tag{
  font-size:11px;
  color:#64748b;
  font-weight:800;
  padding:4px 8px;
  border-radius:999px;
  background:#f1f5f9;
}

.sidebar .user{
  margin-top:auto;
  padding:12px 10px;
  border-top:1px solid var(--line);
  display:flex; gap:10px; align-items:center;
}
.avatar{
  width:38px;height:38px;border-radius:14px;
  background:#f1f5f9;
  display:grid;place-items:center;
  font-weight:900;color:#334155;
}
.user .meta{line-height:1.2}
.user .meta .name{font-weight:900}
.user .meta .role{font-size:12px;color:var(--muted);font-weight:700}
.btn-ghost{
  margin-left:auto;
  text-decoration:none;
  font-weight:900;
  color:var(--muted);
  padding:8px 10px;
  border-radius:12px;
}
.btn-ghost:hover{background:#f1f5f9}

.main{
  padding:22px 24px 60px;
}
.topbar{
  display:flex;align-items:flex-end;justify-content:space-between;
  gap:12px;margin-bottom:16px;
}
.h1{margin:0;font-size:22px;letter-spacing:-.03em}
.breadcrumb{color:var(--muted);font-weight:700;font-size:13px;margin-top:4px}

.grid{display:grid;gap:14px}
.grid-4{grid-template-columns:repeat(4, minmax(0,1fr))}
.grid-3{grid-template-columns:repeat(3, minmax(0,1fr))}
.grid-2{grid-template-columns:repeat(2, minmax(0,1fr))}
@media (max-width: 1050px){
  .app{grid-template-columns: 1fr}
  .sidebar{position:relative;height:auto}
  .grid-4{grid-template-columns:repeat(2, minmax(0,1fr))}
}
@media (max-width: 560px){
  .grid-4,.grid-3,.grid-2{grid-template-columns:1fr}
  .main{padding:18px 16px 60px}
}

.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius: var(--radius2);
  box-shadow: var(--shadow);
}
.section{padding:16px}
.kpi{padding:14px}
.kpi .t{color:var(--muted);font-weight:800;font-size:12px}
.kpi .v{font-weight:900;font-size:22px;margin-top:8px}
.kpi .s{color:var(--muted);font-weight:700;font-size:12px;margin-top:6px}

.table{
  width:100%;
  border-collapse:collapse;
}
.table th,.table td{
  text-align:left;
  padding:10px 10px;
  border-bottom:1px solid var(--line);
  font-size:13px;
}
.table th{color:#334155;font-weight:900}
.table td{color:#111827;font-weight:600}
.badge{
  display:inline-flex;align-items:center;
  padding:6px 10px;border-radius:999px;
  font-size:12px;font-weight:900;
  border:1px solid var(--line);
  background:#f8fafc;color:#0f172a;
}
.badge.blue{background:rgba(31,107,255,.10);border-color:rgba(31,107,255,.20);color:var(--blue2)}
.badge.green{background:rgba(16,185,129,.12);border-color:rgba(16,185,129,.20);color:#065f46}
.badge.red{background:rgba(239,68,68,.12);border-color:rgba(239,68,68,.20);color:#7f1d1d}
.badge.gray{background:#f1f5f9;color:#334155}

.btn{
  appearance:none;border:0;cursor:pointer;
  padding:10px 12px;border-radius:14px;
  font-family:var(--font);
  font-weight:900;
  background:var(--blue);
  color:white;
  box-shadow: 0 10px 22px rgba(31,107,255,.18);
}
.btn:hover{filter:brightness(1.03)}
.btn.secondary{
  background:#0f172a;
  box-shadow:none;
}
.btn.light{
  background:#f1f5f9;color:#0f172a;
  box-shadow:none;
}
.btn.small{padding:8px 10px;border-radius:12px;font-size:12px}

.input, select, textarea{
  width:100%;
  padding:11px 12px;
  border-radius:14px;
  border:1px solid var(--line);
  background:#ffffff;
  font-family:var(--font);
  font-weight:700;
  color:#0f172a;
  outline:none;
}
textarea{min-height:90px;resize:vertical}
.input:focus,select:focus,textarea:focus{
  border-color: rgba(31,107,255,.45);
  box-shadow: 0 0 0 4px rgba(31,107,255,.10);
}

.form-grid{display:grid;gap:12px;grid-template-columns:repeat(2,minmax(0,1fr))}
.form-grid .full{grid-column:1 / -1}
@media (max-width: 560px){ .form-grid{grid-template-columns:1fr} }

.alert{
  padding:12px 12px;
  border-radius:14px;
  border:1px solid var(--line);
  background:#f8fafc;
  color:#0f172a;
  font-weight:800;
  margin-bottom:12px;
}
.alert.ok{border-color:rgba(16,185,129,.20);background:rgba(16,185,129,.10);color:#065f46}
.alert.err{border-color:rgba(239,68,68,.20);background:rgba(239,68,68,.10);color:#7f1d1d}

.split{
  display:flex;gap:12px;flex-wrap:wrap;align-items:center;justify-content:space-between;
}

.kanban{
  display:grid;
  grid-template-columns: repeat(6, minmax(260px, 1fr));
  gap:12px;
  overflow-x:auto;
  padding-bottom:6px;
}
.col{
  background:#ffffff;
  border:1px solid var(--line);
  border-radius: var(--radius2);
  box-shadow: var(--shadow);
  min-height: 260px;
}
.col .head{
  padding:12px 12px;
  border-bottom:1px solid var(--line);
  display:flex;align-items:center;justify-content:space-between;
}
.col .head .name{font-weight:900}
.col .head .count{font-weight:900;color:#64748b;font-size:12px}
.cards{padding:10px;display:flex;flex-direction:column;gap:10px}
.kcard{
  border:1px solid var(--line);
  border-radius: 16px;
  padding:10px 10px;
  background:#ffffff;
}
.kcard .row{display:flex;justify-content:space-between;gap:8px;align-items:center}
.kcard .code{font-weight:900}
.kcard .sub{color:var(--muted);font-size:12px;font-weight:700;margin-top:6px}
.kcard .drag{cursor:grab;color:#64748b;font-weight:900;font-size:12px}

.auth-wrap{
  min-height:100vh;
  display:grid;
  place-items:center;
  background: linear-gradient(180deg, #f6f9ff 0%, #ffffff 60%);
  padding:18px;
}
.auth-card{
  width:100%;
  max-width: 420px;
  background:#ffffff;
  border:1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding:18px;
}
.auth-card h1{margin:0;font-size:20px;letter-spacing:-.02em}
.auth-card p{margin:6px 0 14px;color:var(--muted);font-weight:700}
.auth-card form{display:flex;flex-direction:column;gap:10px}
.auth-card .small{font-size:12px;color:var(--muted);font-weight:700}
