:root{
  --bg:#f5f7fb;
  --panel:#ffffff;
  --text:#14213d;
  --muted:#6b7280;
  --primary:#0f766e;
  --primary-2:#115e59;
  --line:#e5e7eb;
  --soft:#eef7f6;
  --warning:#f59e0b;
  --danger:#dc2626;
  --ok:#16a34a;
  --info:#2563eb;
  --shadow:0 10px 30px rgba(15, 23, 42, .08);
  --sidebar-width:280px;
}
*{box-sizing:border-box}
html{min-height:100%;scroll-behavior:smooth}
body{margin:0;min-height:100%;font-family:Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;background:var(--bg);color:var(--text);overflow-x:hidden}
a{color:var(--primary);text-decoration:none}
a:hover{text-decoration:underline}
.app-shell{display:flex;align-items:flex-start;min-height:100vh;min-height:100dvh;width:100%}
.sidebar{width:var(--sidebar-width);flex:0 0 var(--sidebar-width);background:#0f172a;color:#e2e8f0;display:flex;flex-direction:column;position:sticky;top:0;height:100vh;height:100dvh;max-height:100vh;max-height:100dvh;padding:20px 16px 16px;overflow:hidden;z-index:40;scrollbar-gutter:stable}
.brand{display:flex;gap:12px;align-items:center;margin-bottom:18px;flex-shrink:0;min-width:0}
.brand-mark{width:44px;height:44px;flex:0 0 44px;border-radius:14px;background:linear-gradient(135deg,#14b8a6,#2563eb);display:grid;place-items:center;color:white;font-weight:800;box-shadow:0 8px 22px rgba(20,184,166,.35)}
.brand strong{display:block;font-size:1.2rem}
.brand span{display:block;color:#94a3b8;font-size:.86rem;margin-top:2px}
.sidebar nav{display:flex;flex-direction:column;gap:5px;flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;padding-right:5px;margin-right:-5px;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
.sidebar nav::-webkit-scrollbar{width:8px}
.sidebar nav::-webkit-scrollbar-track{background:rgba(255,255,255,.05);border-radius:999px}
.sidebar nav::-webkit-scrollbar-thumb{background:rgba(148,163,184,.55);border-radius:999px}
.sidebar nav::-webkit-scrollbar-thumb:hover{background:rgba(203,213,225,.75)}
.sidebar nav a{color:#cbd5e1;padding:11px 12px;border-radius:10px;font-weight:600;display:flex;align-items:center;min-height:42px;line-height:1.2;word-break:break-word}
.sidebar nav a.active,.sidebar nav a:hover{background:#1e293b;color:white;text-decoration:none}
.sidebar-footer{margin-top:14px;padding-top:12px;border-top:1px solid rgba(255,255,255,.10);font-size:.9rem;flex-shrink:0}
.user-box{padding:12px;border:1px solid rgba(255,255,255,.12);border-radius:12px;margin-bottom:10px;min-width:0}
.user-box strong{display:block;color:white}
.user-box span{display:block;color:#94a3b8;font-size:.82rem;word-break:break-word}
.logout{display:block;color:#fecaca!important;padding:8px 12px;border-radius:10px}
.logout:hover{background:rgba(254,202,202,.12);text-decoration:none}
.main{flex:1 1 auto;width:calc(100% - var(--sidebar-width));min-width:0;min-height:100vh;min-height:100dvh;padding:clamp(16px,2.1vw,30px)}
.topbar{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin-bottom:22px}
.topbar h1{margin:0;font-size:clamp(1.35rem,2.5vw,1.9rem);line-height:1.15}
.topbar p{margin:.35rem 0 0;color:var(--muted)}
.top-actions{display:flex;gap:10px;flex-wrap:wrap;justify-content:flex-end}
.sidebar-toggle,.sidebar-backdrop{display:none}
.card{background:var(--panel);border:1px solid var(--line);border-radius:18px;box-shadow:var(--shadow);padding:18px;margin-bottom:18px;max-width:100%}
.cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(220px,100%),1fr));gap:18px;margin-bottom:18px}
.kpi span{display:block;color:var(--muted);font-weight:700;font-size:.86rem;text-transform:uppercase;letter-spacing:.03em}
.kpi strong{display:block;font-size:clamp(1.55rem,3.4vw,2rem);margin:8px 0 4px}
.kpi small{color:var(--muted)}
.grid{display:grid;gap:18px;margin-bottom:18px}
.grid.two{grid-template-columns:repeat(auto-fit,minmax(min(420px,100%),1fr))}
.section-title{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px;flex-wrap:wrap}
.section-title h2{font-size:1.05rem;margin:0}
.section-title span,.section-title a{font-size:.9rem;color:var(--muted)}
.btn{appearance:none;border:0;background:var(--primary);color:white!important;border-radius:10px;padding:10px 14px;font-weight:800;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;text-decoration:none;box-shadow:0 6px 14px rgba(15,118,110,.2);line-height:1.2;min-height:40px;white-space:normal;text-align:center}
.btn:hover{background:var(--primary-2);text-decoration:none}
.btn.ghost{background:#e8f3f1;color:var(--primary)!important;box-shadow:none}
.btn.small{padding:7px 10px;font-size:.84rem;border-radius:8px;min-height:34px}
.btn.full{width:100%}
table{width:100%;border-collapse:collapse;font-size:.92rem}
th,td{padding:11px 10px;border-bottom:1px solid var(--line);vertical-align:top;text-align:left}
th{font-size:.78rem;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);background:#f8fafc}
tr:hover td{background:#fcfcfd}
.compact th,.compact td{padding:8px}
.badge{display:inline-flex;align-items:center;white-space:nowrap;border-radius:999px;padding:5px 9px;font-size:.78rem;font-weight:800}
.badge-done{background:#dcfce7;color:#166534}
.badge-running{background:#dbeafe;color:#1d4ed8}
.badge-waiting{background:#fef3c7;color:#92400e}
.badge-todo{background:#f1f5f9;color:#475569}
.badge-cancel{background:#fee2e2;color:#991b1b}
.progress{height:9px;background:#e5e7eb;border-radius:999px;overflow:hidden;min-width:80px}
.progress span{display:block;height:100%;background:linear-gradient(90deg,#14b8a6,#2563eb);border-radius:999px}
.toolbar .filters{display:flex;gap:10px;flex-wrap:wrap;align-items:flex-end}
.toolbar .filters label{flex:1 1 180px;min-width:min(220px,100%)}
.toolbar .filters .btn{flex:0 0 auto}
input,select,textarea{width:100%;border:1px solid #d1d5db;border-radius:10px;padding:10px 12px;background:white;font:inherit;color:var(--text);max-width:100%}
input:focus,select:focus,textarea:focus{outline:2px solid rgba(20,184,166,.25);border-color:#14b8a6}
label{font-weight:700;color:#334155;font-size:.92rem}
label input,label select,label textarea{margin-top:6px;font-weight:400}
.stack{display:flex;flex-direction:column;gap:14px}
.stack.wide{max-width:1180px}
.form-card{max-width:1240px}
.form-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(320px,100%),1fr));gap:14px}
.form-actions{display:flex;gap:10px;align-items:center;margin-top:6px;flex-wrap:wrap}
.inline{display:flex;align-items:center;gap:8px}
.inline input{width:auto;margin:0}
.flash{padding:12px 14px;border-radius:12px;margin-bottom:16px;font-weight:700}
.flash.success{background:#dcfce7;color:#166534}
.flash.error{background:#fee2e2;color:#991b1b}
.flash.warning{background:#fef3c7;color:#92400e}
.hint{color:var(--muted);font-size:.9rem}
small{color:var(--muted)}
.login-body{display:grid;place-items:center;min-height:100vh;min-height:100dvh;background:linear-gradient(135deg,#0f172a,#0f766e);padding:24px}
.login-card{width:min(440px,100%);background:white;border-radius:22px;box-shadow:0 30px 70px rgba(0,0,0,.28);padding:28px}
.login-brand{margin-bottom:24px}
.login-card h1{margin-top:0}
.login-card code{background:#f1f5f9;padding:2px 5px;border-radius:6px}
.kanban{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(260px,1fr);grid-template-columns:repeat(5,minmax(260px,1fr));gap:14px;overflow-x:auto;padding-bottom:10px;max-width:100%;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
.kanban-column{background:#eef2f7;border:1px solid #dbe2ea;border-radius:18px;min-height:65vh;padding:12px}
.kanban-column header{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px;gap:8px}
.kanban-column h2{margin:0;text-transform:capitalize;font-size:1rem}
.kanban-column header span{background:white;border-radius:999px;padding:5px 9px;font-weight:900;color:#64748b}
.kanban-dropzone{min-height:200px;display:flex;flex-direction:column;gap:10px}
.kanban-card{background:white;border:1px solid var(--line);border-radius:14px;padding:12px;box-shadow:0 6px 16px rgba(15,23,42,.07);cursor:grab}
.kanban-card.dragging{opacity:.55}
.kanban-card p{margin:8px 0;color:#334155}
.kanban-meta{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}
.kanban-meta span{background:#f1f5f9;border-radius:8px;padding:3px 6px;color:#64748b;font-size:.78rem;font-weight:800}
.kanban-meta strong{font-size:.92rem}
.kanban-column.over{outline:3px solid rgba(20,184,166,.35)}
canvas{width:100%;max-height:280px}
@media(max-width:1200px){
  .kanban{grid-template-columns:repeat(5,280px);grid-auto-columns:280px}
}
@media(max-width:980px){
  body.sidebar-open{overflow:hidden}
  .app-shell{display:block;min-height:100vh;min-height:100dvh}
  .sidebar-toggle{position:fixed;top:14px;left:14px;z-index:80;display:inline-flex;align-items:center;justify-content:center;gap:8px;border:0;border-radius:999px;background:#0f172a;color:white;padding:10px 14px;font-weight:900;box-shadow:0 12px 30px rgba(15,23,42,.20);cursor:pointer}
  .sidebar-toggle:focus{outline:3px solid rgba(20,184,166,.35)}
  .sidebar-backdrop{position:fixed;inset:0;background:rgba(15,23,42,.48);z-index:60;opacity:0;pointer-events:none;transition:opacity .2s ease;display:block}
  body.sidebar-open .sidebar-backdrop{opacity:1;pointer-events:auto}
  .sidebar{position:fixed;left:0;top:0;bottom:0;width:min(88vw,330px);max-width:330px;height:100vh;height:100dvh;max-height:100vh;max-height:100dvh;transform:translateX(-105%);transition:transform .22s ease;box-shadow:24px 0 48px rgba(15,23,42,.28);z-index:70}
  body.sidebar-open .sidebar{transform:translateX(0)}
  .main{width:100%;min-height:100vh;min-height:100dvh;padding:72px 16px 18px}
  .topbar{display:block;margin-bottom:16px}
  .top-actions{justify-content:flex-start;margin-top:12px}
  .card{padding:16px;border-radius:16px}
  table{display:block;overflow-x:auto;white-space:nowrap;-webkit-overflow-scrolling:touch}
}
@media(max-width:640px){
  .top-actions,.form-actions{display:grid;grid-template-columns:1fr;width:100%}
  .top-actions .btn,.form-actions .btn{width:100%}
  .toolbar .filters{display:grid;grid-template-columns:1fr;align-items:stretch}
  .toolbar .filters label,.toolbar .filters .btn{width:100%;min-width:0}
  .cards{gap:12px}
  .grid{gap:12px}
  .kanban{grid-template-columns:repeat(5,minmax(82vw,82vw));grid-auto-columns:82vw}
  .kanban-column{min-height:55vh}
  .login-body{padding:16px}
  .login-card{padding:22px;border-radius:18px}
}
@media(prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  .sidebar,.sidebar-backdrop{transition:none}
}
