
:root{
  --bg:#0b1220;
  --panel:#0f172a;
  --muted:#94a3b8;
  --text:#e2e8f0;
  --primary:#7c3aed;
  --accent:#22d3ee;
  --border:#1e293b;
  --success:#22c55e;
  --warn:#f59e0b;
  --danger:#ef4444;
  --radius:16px;
}
*{box-sizing:border-box}
html,body{height:100%}
body{margin:0;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Arial;color:var(--text);background:#0b1220}

.topbar{position:sticky;top:0;z-index:100;display:flex;align-items:center;gap:.75rem;padding:.75rem 1rem;background:rgba(15,23,42,.8);backdrop-filter:blur(6px);border-bottom:1px solid var(--border)}
.logo{height:28px}
.app-title{font-size:1rem;margin:0}
.icon-btn{background:none;border:1px solid var(--border);color:var(--text);border-radius:10px;padding:.35rem .55rem;cursor:pointer}
.icon-btn:hover{border-color:#334155}
.spacer{margin-left:auto}

.layout{display:grid;grid-template-columns:1fr;gap:1rem;max-width:1300px;margin:1rem auto;padding:0 1rem}
.sidebar{position:fixed;inset:0 auto 0 0;width:280px;background:var(--panel);transform:translateX(-100%);transition:transform .2s ease;border-right:1px solid var(--border);z-index:120}
.sidebar.open{transform:translateX(0)}
.sidebar-header{display:flex;align-items:center;justify-content:space-between;padding:.75rem;border-bottom:1px solid var(--border)}
.menu{padding:.5rem;height:calc(100% - 48px);overflow:auto}
.menu a,.menu button.group{display:flex;align-items:center;justify-content:space-between;width:100%;padding:.6rem .7rem;border-radius:12px;border:0;background:transparent;color:var(--text);text-decoration:none;cursor:pointer}
.menu a:hover,.menu button.group:hover{background:#111827}
.menu a.active{background:#1f2937;outline:1px solid #293548}
.menu .children{padding-left:1rem}

.backdrop{position:fixed;inset:0;background:rgba(0,0,0,.4);backdrop-filter: blur(2px);z-index:110;display:none}
.backdrop.show{display:block}

.content{background:#0f172a;border:1px solid var(--border);border-radius:var(--radius);padding:1rem;box-shadow:0 10px 30px rgba(0,0,0,.25);min-height:60vh}

.card{background:#0b1325;border:1px solid var(--border);border-radius:14px;padding:1rem}
.row{display:flex;flex-wrap:wrap;gap:1rem}
.col{flex:1 1 280px}
.h1{font-size:1.25rem;margin:.2rem 0 1rem 0}
.h2{font-size:1.1rem;margin:.2rem 0 .6rem 0}
.muted{color:var(--muted)}
.badge{display:inline-block;padding:.25rem .5rem;border:1px solid var(--border);border-radius:999px;font-size:.75rem;background:#0b1325}
.btn{background:var(--primary);border:0;border-radius:10px;padding:.5rem .8rem;color:white;cursor:pointer}
.btn.ghost{background:transparent;border:1px solid var(--border)}
.input,.select2,.textarea{width:100%;background:#0b1325;color:var(--text);border:1px solid var(--border);border-radius:10px;padding:.55rem .6rem}

.kpi{display:flex;align-items:center;gap:.6rem}
.kpi .num{font-size:1.5rem;font-weight:700}
.progress{height:10px;background:#0b1325;border:1px solid var(--border);border-radius:999px;overflow:hidden}
.progress > div{height:100%;background:linear-gradient(90deg,var(--accent),var(--primary))}

.kanban{display:grid;grid-template-columns:repeat(6,minmax(240px,1fr));gap:1rem;overflow:auto}
.column{background:#0b1325;border:1px solid var(--border);border-radius:14px;min-height:200px;padding:.5rem}
.col-title{display:flex;align-items:center;justify-content:space-between;padding:.25rem .25rem .5rem .25rem}
.task{background:#0f182a;border:1px solid var(--border);border-radius:10px;padding:.6rem;margin:.5rem 0;cursor:grab}
.task[draggable=true]:active{cursor:grabbing}
.task small{color:var(--muted)}

.table{width:100%;border-collapse:separate;border-spacing:0 8px}
.table tr{background:#0b1325}
.table td,.table th{padding:.6rem .7rem;border-top:1px solid var(--border);border-bottom:1px solid var(--border)}
.table tr td:first-child,.table tr th:first-child{border-left:1px solid var(--border);border-top-left-radius:10px;border-bottom-left-radius:10px}
.table tr td:last-child,.table tr th:last-child{border-right:1px solid var(--border);border-top-right-radius:10px;border-bottom-right-radius:10px}

.calendar{display:grid;grid-template-columns:repeat(7,1fr);gap:8px}
.day{background:#0b1325;border:1px solid var(--border);border-radius:10px;min-height:90px;padding:.4rem}
.day .d{font-size:.85rem;color:var(--muted)}
.event{margin-top:.3rem;font-size:.8rem;border-left:3px solid var(--accent);padding-left:.35rem}

.footer{max-width:1300px;margin:1rem auto;padding:0 1rem 2rem;color:var(--muted)}

@media(min-width:980px){
  .layout{grid-template-columns:280px 1fr}
  .sidebar{position:sticky;top:57px;transform:translateX(0);height:calc(100vh - 57px)}
  #btn-open-menu,#btn-close-menu{display:none}
  .backdrop{display:none !important}
}
@media(min-width:1200px){
  .content{padding:1.25rem 1.5rem}
  .table td,.table th{padding:.75rem .9rem}
  .h1{font-size:1.35rem}
  .h2{font-size:1.2rem}
}
@media(max-width:640px){
  .table thead{display:none}
  .table,.table tbody,.table tr,.table td{display:block;width:100%}
  .table tr{margin-bottom:10px;border-radius:10px;overflow:hidden}
  .table td{border:none;border-bottom:1px solid var(--border);display:grid;grid-template-columns:9rem 1fr;gap:.5rem}
  .table td:last-child{border-bottom:none}
  .td-label{color:var(--muted)}
  .kanban{grid-template-columns:1fr}
}
