:root{
  --bg:#0b0b0b; --text:#f2f2f2; --muted:#b7b7b7;
  --gold:#d4af37; --danger:#ff5a5a; --ok:#61ffb0;
  --border: rgba(212,175,55,.25);
  --shadow: 0 10px 35px rgba(0,0,0,.55);
  --radius: 14px;
  --today: rgba(97,255,176,.55);
}
*{box-sizing:border-box}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background:
    radial-gradient(1000px 600px at 20% 0%, rgba(212,175,55,.08), transparent 55%),
    radial-gradient(800px 500px at 90% 20%, rgba(212,175,55,.06), transparent 60%),
    var(--bg);
  color:var(--text);
  min-height:100vh;
}
.wrap{max-width:1250px;margin:0 auto;padding:28px 18px 60px}
.topbar{
  display:flex;align-items:center;justify-content:space-between;gap:14px;
  padding:14px 16px;
  background: linear-gradient(180deg, rgba(17,17,17,.88), rgba(15,15,15,.88));
  border:1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: sticky; top: 10px; z-index: 5;
  backdrop-filter: blur(8px);
  flex-wrap:wrap;
}
.brand{display:flex;align-items:center;gap:12px;font-weight:800;letter-spacing:.8px}
.logo{
  width:40px;height:40px;border-radius:12px;border:1px solid var(--border);
  background: radial-gradient(circle at 30% 30%, rgba(212,175,55,.35), rgba(212,175,55,.08) 55%, rgba(0,0,0,.3));
  display:grid;place-items:center;color:var(--gold);font-weight:900;
  box-shadow: 0 10px 25px rgba(212,175,55,.12);
}
.brand small{display:block;font-weight:600;color:var(--muted);letter-spacing:.2px;margin-top:2px}
.actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.btn{
  border:1px solid var(--border);
  background: rgba(17,17,17,.8);
  color:var(--text);
  padding:10px 12px;
  border-radius: 12px;
  cursor:pointer;
  font-weight:700;
  transition: transform .05s ease, border-color .15s ease, background .15s ease;
  user-select:none;
  display:inline-flex;align-items:center;gap:8px;
  text-decoration:none;
  white-space:nowrap;
}
.btn:hover{border-color: rgba(212,175,55,.55); background: rgba(20,20,20,.95)}
.btn:active{transform: translateY(1px)}
.btn-primary{
  background: linear-gradient(180deg, rgba(212,175,55,.22), rgba(212,175,55,.12));
  border-color: rgba(212,175,55,.65);
}
.btn-danger{border-color: rgba(255,90,90,.45); background: rgba(255,90,90,.08)}
.btn-ghost{background: transparent; border-color: rgba(212,175,55,.22); color: var(--muted)}
.grid{display:grid;grid-template-columns:1fr;gap:18px;margin-top:18px}
.card{
  background: linear-gradient(180deg, rgba(17,17,17,.88), rgba(12,12,12,.88));
  border:1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding:16px;
  margin-bottom: 20px;
  overflow: hidden;
}
.row{display:flex;gap:12px;flex-wrap:wrap;align-items:center;justify-content:space-between;margin-bottom:16px}
.muted{color:var(--muted)}
.sep{height:1px;background: rgba(212,175,55,.16);margin:12px 0}
.pill{
  display:inline-flex;padding:6px 10px;border-radius:999px;
  border:1px solid rgba(212,175,55,.25);
  background: rgba(212,175,55,.06);
  color: var(--gold); font-weight:800; font-size:12px;
  letter-spacing:.3px; white-space:nowrap;
}
.tabs{display:flex;gap:10px;flex-wrap:wrap}
.tab-active{border-color: rgba(212,175,55,.75); background: rgba(212,175,55,.10); color:#fff}
.table-wrap{overflow-x:auto;border-radius:12px;border:1px solid rgba(212,175,55,.18);max-width:100%}
table{width:100%;border-collapse:collapse;min-width: 800px;background: rgba(0,0,0,.25)}
th,td{padding:8px 10px;border-bottom:1px solid rgba(212,175,55,.14);font-size:13px;vertical-align:top;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:180px}
th{
  color: var(--gold); font-size:12px; letter-spacing:.7px; text-transform:uppercase;
  background: rgba(212,175,55,.06);
  position: sticky; top: 0; z-index: 2;
}
tr:hover td{background: rgba(212,175,55,.05)}

/* Login */
.login-shell{min-height:100vh;display:grid;place-items:center;padding:24px 16px}
.login{width:min(460px, 100%);padding:18px}
label{display:block;font-size:12px;color:var(--muted);margin:10px 0 6px}
input, select, textarea{
  width:100%;padding:12px 12px;border-radius:12px;
  border:1px solid rgba(212,175,55,.18);
  background: rgba(0,0,0,.35); color: var(--text); outline:none;
}
input:focus, select:focus, textarea:focus{border-color: rgba(212,175,55,.55); box-shadow: 0 0 0 4px rgba(212,175,55,.08)}
.msg{margin-top:10px;font-weight:700;font-size:13px}
.msg.err{color: var(--danger)}
.msg.ok{color: var(--ok)}
.hint{font-size:12px;color:var(--muted);margin-top:6px}

/* Modal */
.modal-backdrop{
  position:fixed; inset:0; background: rgba(0,0,0,.72);
  display:none; align-items:center; justify-content:center;
  padding:18px; z-index: 50;
}
.modal{
  width:min(860px, 100%);
  background: linear-gradient(180deg, rgba(18,18,18,.98), rgba(10,10,10,.98));
  border:1px solid rgba(212,175,55,.28);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.7);
  overflow:hidden;
}
.modal-head{
  padding:14px 14px; display:flex; align-items:center; justify-content:space-between; gap:10px;
  background: rgba(212,175,55,.06);
  border-bottom:1px solid rgba(212,175,55,.18);
}
.modal-body{padding:14px}
.modal-foot{
  padding:14px; border-top: 1px solid rgba(212,175,55,.18);
  display:flex; justify-content:flex-end; gap:10px;
}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.full{grid-column:1/-1}
@media (max-width:720px){ .form-grid{grid-template-columns:1fr} }

/* Planilha cells */
.cell-input, .cell-select{
  width:100%;
  padding:8px 8px;
  border-radius:10px;
  border:1px solid rgba(212,175,55,.18);
  background: rgba(0,0,0,.25);
  color: var(--text);
  outline:none;
  font-size: 13px;
}
.cell-input:focus, .cell-select:focus{
  border-color: rgba(212,175,55,.55);
  box-shadow: 0 0 0 4px rgba(212,175,55,.08);
}

/* Status bolinhas */
.status-wrap{display:flex;align-items:center;gap:10px}
.dotbtn{
  width:14px;height:14px;border-radius:999px;
  border:1px solid rgba(255,255,255,.20);
  cursor:pointer;
  opacity:.5;
  box-shadow: 0 0 0 4px rgba(255,255,255,.03);
}
.dotbtn.red{background: rgba(255,90,90,.65)}
.dotbtn.green{background: rgba(97,255,176,.65)}
.dotbtn.active{
  opacity:1;
  border-color: rgba(212,175,55,.55);
  box-shadow: 0 0 0 5px rgba(212,175,55,.10);
}

/* Calendário */
.cal-top{display:flex;gap:10px;flex-wrap:wrap;align-items:end}
.cal-grid{
  display:grid;
  grid-template-columns: repeat(7, 1fr);
  gap:10px;
  margin-top:12px;
}
.cal-cell{
  background: rgba(0,0,0,.25);
  border:1px solid rgba(212,175,55,.18);
  border-radius:12px;
  min-height:70px;
  padding:10px;
}
.cal-cell .day{font-weight:900;color:var(--muted);font-size:12px}
.cal-cell.has{
  border-color: rgba(212,175,55,.65);
  background: rgba(212,175,55,.10);
}
.cal-cell.today{
  outline: 2px solid var(--today);
  outline-offset: 2px;
}
.cal-weekhead{
  display:grid;
  grid-template-columns: repeat(7, 1fr);
  gap:10px;
  margin-top:10px;
}
.cal-weekhead div{
  color: var(--gold);
  font-size: 12px;
  letter-spacing:.7px;
  text-transform:uppercase;
  padding:0 10px;
}
