/* Mandilas Group — Compliance Report Control Portal
   Palette pulled from the company mark: near-black + a single working green. */

:root{
  --ink:        #161616;
  --ink-soft:   #3a3a3a;
  --green:      #12A057;
  --green-dark: #0d7a42;
  --paper:      #f6f7f6;
  --card:       #ffffff;
  --line:       #e6e7e5;
  --muted:      #767a77;
  --red:        #c7402f;
  --amber:      #c07f16;
  --red-bg:     #fbeceA;
  --amber-bg:   #fbf1e0;
  --green-bg:   #e8f5ee;
  --grey-bg:    #eef0ee;
  --radius:     6px;
  --font: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family:var(--font);
  color:var(--ink);
  background:var(--paper);
  font-size:15px;
  -webkit-font-smoothing:antialiased;
}
a{ color:inherit; }
h1,h2,h3{ margin:0 0 4px; font-weight:800; letter-spacing:-.01em; }
p{ margin:0 0 8px; }

/* ---------- App shell ---------- */
.app-shell{ display:flex; min-height:100vh; }

.sidebar{
  width:236px; flex-shrink:0; background:var(--ink); color:#fff;
  display:flex; flex-direction:column; position:sticky; top:0; height:100vh;
}
.sidebar .brand{
  display:flex; align-items:center; gap:10px; padding:22px 20px 18px;
  border-bottom:1px solid rgba(255,255,255,.08);
}
.sidebar .brand img{ height:30px; width:auto; filter:brightness(0) invert(1); }
.sidebar .brand-text{ font-size:12.5px; line-height:1.3; color:#cfd2cf; }
.sidebar .brand-text strong{ display:block; color:#fff; font-size:13.5px; letter-spacing:.02em; }

.sidebar nav{ padding:14px 10px; flex:1; }
.sidebar nav a{
  display:flex; align-items:center; gap:10px; padding:10px 12px; margin-bottom:2px;
  border-radius:var(--radius); text-decoration:none; color:#c9ccc9; font-size:13.6px; font-weight:600;
}
.sidebar nav a:hover{ background:rgba(255,255,255,.06); color:#fff; }
.sidebar nav a.active{ background:var(--green); color:#fff; }
.sidebar nav .section-label{
  font-size:10.5px; text-transform:uppercase; letter-spacing:.08em; color:#797d79;
  padding:16px 12px 6px;
}
.sidebar .user-box{
  padding:14px 18px 18px; border-top:1px solid rgba(255,255,255,.08); font-size:12.5px; color:#aeb1ae;
}
.sidebar .user-box strong{ display:block; color:#fff; font-size:13px; }
.sidebar .user-box a{ color:var(--green); text-decoration:none; font-weight:700; }

.main{ flex:1; min-width:0; }
.topbar{
  display:flex; align-items:center; justify-content:space-between;
  padding:16px 28px; background:var(--card); border-bottom:1px solid var(--line);
  position:sticky; top:0; z-index:5;
}
.topbar h1{ font-size:19px; }
.topbar .subtitle{ color:var(--muted); font-size:13px; font-weight:600; }
.content{ padding:26px 28px 60px; max-width:1180px; }

/* ---------- Auth screen ---------- */
.auth-wrap{
  min-height:100vh; display:flex; align-items:center; justify-content:center;
  background: linear-gradient(160deg, var(--ink) 0%, #262b27 55%, var(--ink) 100%);
  padding:24px;
}
.auth-card{
  background:var(--card); border-radius:10px; padding:38px 36px 32px; width:100%; max-width:380px;
  box-shadow:0 20px 50px rgba(0,0,0,.35);
}
.auth-card img{ height:40px; margin-bottom:14px; }
.auth-card h1{ font-size:19px; margin-bottom:2px; }
.auth-card .lede{ color:var(--muted); font-size:13px; margin-bottom:24px; }
.auth-card label{ font-size:12.5px; font-weight:700; color:var(--ink-soft); }

/* ---------- Forms ---------- */
.field{ margin-bottom:16px; }
.field label{ display:block; font-size:12.5px; font-weight:700; color:var(--ink-soft); margin-bottom:5px; }
.field .hint{ font-size:11.5px; color:var(--muted); margin-top:4px; }
input[type=text],input[type=email],input[type=password],input[type=date],input[type=tel],
select,textarea{
  width:100%; padding:10px 12px; border:1px solid var(--line); border-radius:var(--radius);
  font-family:var(--font); font-size:13.8px; background:#fff; color:var(--ink);
}
textarea{ resize:vertical; min-height:72px; }
input:focus,select:focus,textarea:focus{ outline:2px solid var(--green); outline-offset:0; border-color:var(--green); }
.form-grid{ display:grid; grid-template-columns:1fr 1fr; gap:0 18px; }
@media (max-width:720px){ .form-grid{ grid-template-columns:1fr; } }

.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:6px;
  padding:10px 18px; border-radius:var(--radius); border:1px solid transparent;
  font-size:13.6px; font-weight:700; cursor:pointer; text-decoration:none;
}
.btn-primary{ background:var(--green); color:#fff; }
.btn-primary:hover{ background:var(--green-dark); }
.btn-dark{ background:var(--ink); color:#fff; }
.btn-outline{ background:#fff; border-color:var(--line); color:var(--ink); }
.btn-outline:hover{ border-color:var(--ink); }
.btn-danger{ background:#fff; border-color:var(--red); color:var(--red); }
.btn-danger:hover{ background:var(--red); color:#fff; }
.btn-block{ width:100%; }
.btn-sm{ padding:6px 12px; font-size:12.5px; }

/* ---------- Cards / stats ---------- */
.stat-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin-bottom:26px; }
@media (max-width:900px){ .stat-grid{ grid-template-columns:repeat(2,1fr); } }
.stat-card{
  background:var(--card); border:1px solid var(--line); border-radius:8px; padding:18px 18px;
  border-left:4px solid var(--ink);
}
.stat-card .num{ font-size:28px; font-weight:800; line-height:1; margin-bottom:6px; }
.stat-card .label{ font-size:12.5px; color:var(--muted); font-weight:700; }
.stat-card.overdue{ border-left-color:var(--red); }
.stat-card.overdue .num{ color:var(--red); }
.stat-card.duesoon{ border-left-color:var(--amber); }
.stat-card.duesoon .num{ color:var(--amber); }
.stat-card.done{ border-left-color:var(--green); }
.stat-card.done .num{ color:var(--green); }

.panel{ background:var(--card); border:1px solid var(--line); border-radius:8px; margin-bottom:22px; }
.panel-head{
  display:flex; align-items:center; justify-content:space-between;
  padding:15px 20px; border-bottom:1px solid var(--line);
}
.panel-head h2{ font-size:15px; }
.panel-body{ padding:4px 0; }
.panel-body.pad{ padding:18px 20px; }

/* ---------- Tables ---------- */
table{ width:100%; border-collapse:collapse; font-size:13.4px; }
th{
  text-align:left; padding:10px 20px; background:var(--grey-bg); color:var(--ink-soft);
  font-size:11.5px; text-transform:uppercase; letter-spacing:.05em; font-weight:800;
  border-bottom:1px solid var(--line);
}
td{ padding:12px 20px; border-bottom:1px solid var(--line); vertical-align:top; }
tr:last-child td{ border-bottom:none; }
tr:hover td{ background:#fafbfa; }
.cell-title{ font-weight:700; }
.cell-sub{ color:var(--muted); font-size:12px; margin-top:2px; }

.badge{
  display:inline-block; padding:3px 10px; border-radius:20px; font-size:11.5px; font-weight:800;
  letter-spacing:.01em;
}
.badge-grey{ background:var(--grey-bg); color:var(--ink-soft); }
.badge-amber{ background:var(--amber-bg); color:var(--amber); }
.badge-green{ background:var(--green-bg); color:var(--green-dark); }
.badge-red{ background:var(--red-bg); color:var(--red); }

.tag{
  display:inline-block; padding:2px 9px; border-radius:4px; background:var(--grey-bg);
  color:var(--ink-soft); font-size:11.5px; font-weight:700; margin-right:4px;
}

.tabs{ display:flex; gap:4px; border-bottom:1px solid var(--line); padding:0 20px; flex-wrap:wrap; }
.tabs a{
  padding:12px 14px; font-size:13px; font-weight:700; color:var(--muted); text-decoration:none;
  border-bottom:2px solid transparent; margin-bottom:-1px;
}
.tabs a.active{ color:var(--ink); border-bottom-color:var(--green); }

.empty-state{ padding:40px 20px; text-align:center; color:var(--muted); }
.empty-state strong{ display:block; color:var(--ink); font-size:14.5px; margin-bottom:4px; }

.flash{ padding:12px 16px; border-radius:var(--radius); font-size:13.4px; font-weight:600; margin-bottom:18px; }
.flash-success{ background:var(--green-bg); color:var(--green-dark); border:1px solid #bfe4cf; }
.flash-error{ background:var(--red-bg); color:var(--red); border:1px solid #f0c9c2; }

.toolbar{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:16px; flex-wrap:wrap; }
.toolbar .filters{ display:flex; gap:8px; flex-wrap:wrap; }
.toolbar select, .toolbar input[type=text]{ width:auto; min-width:160px; }

.avatar-chip{ display:inline-flex; align-items:center; gap:6px; font-size:12.8px; }
.avatar-dot{
  width:22px; height:22px; border-radius:50%; background:var(--ink); color:#fff;
  display:inline-flex; align-items:center; justify-content:center; font-size:10.5px; font-weight:800;
}

.detail-grid{ display:grid; grid-template-columns:180px 1fr; gap:10px 16px; font-size:13.6px; }
.detail-grid dt{ color:var(--muted); font-weight:700; }
.detail-grid dd{ margin:0; }

.timeline{ padding:0; margin:0; list-style:none; }
.timeline li{ padding:10px 0; border-bottom:1px solid var(--line); font-size:13px; }
.timeline li:last-child{ border-bottom:none; }
.timeline .meta{ color:var(--muted); font-size:11.8px; }

@media (max-width:860px){
  .sidebar{ display:none; }
  .content{ padding:18px 16px 50px; }
  .topbar{ padding:14px 16px; }
  table, thead, tbody, th, td, tr{ display:block; }
  thead{ display:none; }
  tr{ border-bottom:1px solid var(--line); padding:10px 0; }
  td{ border:none; padding:4px 0; }
  td:before{ content: attr(data-label); display:block; font-size:10.5px; text-transform:uppercase; color:var(--muted); font-weight:800; margin-bottom:2px; }
}
