/* MRGrupo Phase A — minimal institutional UI */
:root{
  --bg:#0b0f14;
  --panel:#0f1621;
  --panel2:#0c121b;
  --text:#e9eef7;
  --muted:#9cb0c9;
  --line:rgba(255,255,255,.08);
  --accent:#6aa6ff;
  --accent2:#7cf7c7;
  --danger:#ff6a7a;
  --shadow: 0 12px 40px rgba(0,0,0,.35);
  --radius:18px;
  --radius2:24px;
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}

[data-theme="light"]{
  --bg:#f6f7fb;
  --panel:#ffffff;
  --panel2:#ffffff;
  --text:#0c1220;
  --muted:#4c607a;
  --line:rgba(0,0,0,.08);
  --accent:#2d6bff;
  --accent2:#11b981;
  --danger:#d11b3e;
  --shadow: 0 10px 30px rgba(15,23,42,.12);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:var(--font);
  background: radial-gradient(1200px 700px at 20% 10%, rgba(106,166,255,.18), transparent 55%),
              radial-gradient(900px 600px at 85% 25%, rgba(124,247,199,.12), transparent 60%),
              var(--bg);
  color:var(--text);
}

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

.side{
  padding:18px;
  border-right:1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.03), transparent 60%);
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
  padding:12px;
  border:1px solid var(--line);
  border-radius:var(--radius);
  background: rgba(255,255,255,.03);
  box-shadow: var(--shadow);
}
.logo{
  width:44px;height:44px;border-radius:14px;
  display:grid;place-items:center;
  font-weight:800;
  background: linear-gradient(135deg, rgba(106,166,255,.9), rgba(124,247,199,.85));
  color:#08101a;
}
.brand-name{font-weight:800; letter-spacing:.2px}
.brand-sub{color:var(--muted); font-size:12px; margin-top:2px}

.nav{margin-top:14px; display:grid; gap:8px}
.nav-btn{
  display:flex; align-items:center; gap:10px;
  padding:12px 12px;
  border:1px solid var(--line);
  border-radius:14px;
  background: rgba(255,255,255,.02);
  color:var(--text);
  cursor:pointer;
  text-align:left;
}
.nav-btn:hover{background: rgba(255,255,255,.05)}
.nav-btn.active{
  border-color: rgba(106,166,255,.4);
  background: rgba(106,166,255,.12);
}
.dot{width:10px;height:10px;border-radius:999px;background:rgba(255,255,255,.25)}
.nav-btn.active .dot{background: var(--accent)}

.side-footer{
  margin-top:16px;
  display:flex; flex-wrap:wrap; gap:8px;
}
.chip{
  padding:8px 10px;
  border:1px solid var(--line);
  border-radius:999px;
  color:var(--muted);
  font-size:12px;
  background: rgba(255,255,255,.02);
}

.main{padding:18px 18px 10px}
.topbar{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:14px;
  margin-bottom:14px;
}
.h1{font-size:20px; font-weight:900}
.h2{font-size:13px;color:var(--muted); margin-top:4px; max-width:840px}
.topbar-right{display:flex; gap:10px; align-items:center}

.btn{
  border:1px solid var(--line);
  background: rgba(255,255,255,.02);
  color:var(--text);
  padding:10px 12px;
  border-radius:14px;
  cursor:pointer;
}
.btn:hover{background: rgba(255,255,255,.06)}
.btn.primary{
  border-color: rgba(106,166,255,.45);
  background: rgba(106,166,255,.16);
}
.btn.danger{
  border-color: rgba(255,106,122,.4);
  background: rgba(255,106,122,.12);
}

.panel{display:none}
.panel.active{display:block}

.grid{
  display:grid;
  grid-template-columns: 1.1fr .9fr;
  gap:14px;
}
@media (max-width: 980px){
  .app-shell{grid-template-columns: 1fr}
  .side{position:sticky; top:0; z-index:5}
  .grid{grid-template-columns:1fr}
}

.card{
  border:1px solid var(--line);
  border-radius: var(--radius2);
  background: rgba(255,255,255,.03);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.card-h{
  padding:14px 14px 0;
}
.card-title{font-weight:900}
.card-sub{color:var(--muted); font-size:12.5px; margin:6px 0 12px}

.form{padding:0 14px 14px}
.row{margin-bottom:12px}
.row.split{display:grid; grid-template-columns:1fr 1fr; gap:10px}
.lbl{display:block; font-size:12px; color:var(--muted); margin-bottom:6px}
.inp{
  width:100%;
  padding:11px 12px;
  border-radius:14px;
  border:1px solid var(--line);
  background: rgba(0,0,0,.12);
  color:var(--text);
  outline:none;
}
[data-theme="light"] .inp{background: rgba(0,0,0,.03)}
.inp.area{resize:vertical; min-height:150px}
.inp:focus{border-color: rgba(106,166,255,.45)}

.seg{display:flex; gap:8px; flex-wrap:wrap}
.seg-btn{
  padding:10px 12px;
  border-radius:999px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.02);
  color:var(--text);
  cursor:pointer;
}
.seg-btn.active{
  border-color: rgba(124,247,199,.45);
  background: rgba(124,247,199,.12);
}

.actions{display:flex; gap:10px; align-items:center; margin-top:8px}
.mini{margin-top:7px; font-size:12px; color:var(--muted); display:flex; gap:8px; align-items:center; flex-wrap:wrap}
.link{
  border:none;background:transparent;color:var(--accent);
  cursor:pointer; padding:0; font:inherit;
}
.sep{opacity:.6}
.hr{height:1px; background: var(--line); margin:12px 0}

.preview{padding:14px}
.preview-top{display:flex; gap:10px; align-items:center; margin-bottom:10px}
.avatar{width:36px;height:36px;border-radius:999px; background: rgba(106,166,255,.22); display:grid; place-items:center; font-weight:900; color:var(--accent)}
.pname{font-weight:800}
.ptime{color:var(--muted); font-size:12px}
.preview-media{
  border:1px solid var(--line);
  border-radius:18px;
  height:220px;
  background: rgba(255,255,255,.02);
  display:grid;
  place-items:center;
  overflow:hidden;
}
.preview-media img, .preview-media video{width:100%; height:100%; object-fit:cover}
.media-ph{color:var(--muted); font-size:13px}
.preview-body{margin-top:10px}
.ptitle{font-weight:900; margin-bottom:6px}
.ptext{white-space:pre-wrap; line-height:1.4}
.ptags{margin-top:8px; color:var(--accent2); font-weight:700}
.preview-bottom{display:flex; gap:8px; margin-top:10px}
.pill{
  padding:8px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.02);
  color:var(--muted);
  font-size:12px;
}

.quick{padding:0 14px 14px}
.qtitle{font-weight:900; margin-bottom:8px}
.check{list-style:none; padding:0; margin:0; display:grid; gap:8px}
.check li{display:flex; align-items:center; gap:10px; color:var(--muted)}
.check input{accent-color: var(--accent)}

.toolbar{
  padding:0 14px 14px;
  display:flex; gap:10px; flex-wrap:wrap;
}
.table-wrap{padding:0 14px 14px}
.tbl{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  overflow:hidden;
  border:1px solid var(--line);
  border-radius:18px;
  background: rgba(0,0,0,.10);
}
[data-theme="light"] .tbl{background: rgba(0,0,0,.02)}
.tbl th, .tbl td{
  padding:10px 10px;
  border-bottom:1px solid var(--line);
  text-align:left;
  font-size:13px;
}
.tbl th{color:var(--muted); font-weight:700; background: rgba(255,255,255,.02)}
.tbl tr:last-child td{border-bottom:none}
.t-actions{display:flex; gap:8px; flex-wrap:wrap}
.sm{
  padding:7px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.02);
  color:var(--text);
  cursor:pointer;
  font-size:12px;
}
.sm:hover{background: rgba(255,255,255,.06)}
.sm.danger{border-color: rgba(255,106,122,.4); color: var(--danger)}

.empty{
  margin-top:10px;
  padding:12px;
  color:var(--muted);
  border:1px dashed var(--line);
  border-radius:18px;
  display:none;
}

.calendar{padding:0 14px 14px}
.cal-head{
  display:flex; align-items:center; justify-content:space-between;
  gap:10px; margin-bottom:10px;
}
.cal-title{font-weight:900}
.cal-grid{
  display:grid;
  grid-template-columns: repeat(7, 1fr);
  gap:8px;
}
.day{
  border:1px solid var(--line);
  border-radius:16px;
  padding:10px;
  min-height:70px;
  background: rgba(255,255,255,.02);
  cursor:pointer;
}
.day:hover{background: rgba(255,255,255,.05)}
.day .dnum{font-weight:900}
.day .dmeta{margin-top:6px; display:flex; gap:6px; flex-wrap:wrap}
.badge{
  font-size:11px;
  padding:5px 7px;
  border-radius:999px;
  border:1px solid var(--line);
  color:var(--muted);
  background: rgba(255,255,255,.02);
}
.badge.on{border-color: rgba(106,166,255,.45); color:var(--accent)}
.daylist{color:var(--muted); font-size:13px}
.daylist .item{
  margin-top:8px;
  padding:10px;
  border:1px solid var(--line);
  border-radius:18px;
  background: rgba(255,255,255,.02);
}
.daylist .item b{color:var(--text)}

.exports{padding:0 14px 14px}
.steps{padding:0 30px 14px; color:var(--muted)}
.note{margin:0 14px 14px; padding:12px; border:1px solid rgba(124,247,199,.3); border-radius:18px; background: rgba(124,247,199,.08); color: var(--muted)}
.note b{color: var(--text)}

.help{padding:0 14px 14px; color:var(--muted)}
.help h3{color:var(--text); margin:12px 0 6px}

.footer{
  margin-top:14px;
  padding:10px 2px;
  display:flex;
  justify-content:space-between;
  gap:12px;
  color:var(--muted);
  font-size:12px;
}
.muted{opacity:.85}

.toast{
  position:fixed;
  right:16px;
  bottom:16px;
  max-width: 360px;
  padding:12px 14px;
  border-radius:18px;
  border:1px solid var(--line);
  background: rgba(0,0,0,.55);
  color:var(--text);
  box-shadow: var(--shadow);
  display:none;
}
[data-theme="light"] .toast{background: rgba(255,255,255,.9)}
@media print{
  .side, .topbar-right, .footer, .toast{display:none !important}
  .app-shell{grid-template-columns:1fr}
  body{background:#fff; color:#000}
  .card{box-shadow:none}
}
