/* ============================================================
   SIMPEK BLU — desain "Strata"
   Palet dari dunia pengujian mineral & batubara:
   antrasit, batu kabut, tembaga pirit, biru kobalt
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,500;12..96,600;12..96,700&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --ink:        #1b2422;   /* antrasit — batubara */
  --ink-soft:   #46524e;
  --bg:         #eef1ef;   /* batu kabut */
  --panel:      #ffffff;
  --line:       #dbe1dd;
  --copper:     #b06a24;   /* tembaga pirit */
  --copper-dk:  #8a4f16;
  --copper-bg:  #f7ecdf;
  --cobalt:     #2457c5;   /* biru kobalt — tanggal terlapor */
  --cobalt-bg:  #e3ebfb;
  --green:      #1e7a55;
  --green-bg:   #e2f2ea;
  --red:        #c23b3b;
  --red-bg:     #fbe7e7;
  --side:       #141d1b;   /* sidebar antrasit */
  --side-2:     #1d2926;
  --side-text:  #b9c4c0;
  --radius:     12px;
  --font-body:  'Inter', system-ui, sans-serif;
  --font-disp:  'Bricolage Grotesque', 'Inter', sans-serif;
  --font-mono:  'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.55;
}
a { color: var(--copper-dk); text-decoration: none; }
.ic { vertical-align: -3px; flex: none; }

/* ---------- Motif strata (lapisan batuan) ---------- */
.strata {
  height: 6px; display: flex; border-radius: 3px; overflow: hidden;
}
.strata i { flex: 1; }
.strata i:nth-child(1) { background: #2c3a36; }
.strata i:nth-child(2) { background: #b06a24; flex: 1.6; }
.strata i:nth-child(3) { background: #d9a45b; flex: .7; }
.strata i:nth-child(4) { background: #46524e; flex: 1.2; }
.strata i:nth-child(5) { background: #8a4f16; flex: .5; }

/* ============================================================
   LOGIN
   ============================================================ */
.login-wrap {
  min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr;
}
.login-hero {
  background:
    linear-gradient(160deg, rgba(20,29,27,.92) 0%, rgba(20,29,27,.78) 60%, rgba(138,79,22,.55) 130%),
    repeating-linear-gradient(-8deg,
      #141d1b 0 90px, #1d2926 90px 118px, #141d1b 118px 196px,
      #23312d 196px 214px, #141d1b 214px 300px, #6d4315 300px 308px, #141d1b 308px 420px);
  color: #eef1ef; padding: 56px; display: flex; flex-direction: column; justify-content: space-between;
}
.login-hero .brand { display: flex; align-items: center; gap: 14px; }
.login-hero h1 {
  font-family: var(--font-disp); font-weight: 700; font-size: 42px;
  line-height: 1.08; margin: 0 0 14px; letter-spacing: -.5px; max-width: 520px;
}
.login-hero p.sub { color: #c8d1cd; max-width: 460px; margin: 0; }
.login-hero .foot { font-size: 12.5px; color: #93a09b; font-family: var(--font-mono); }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--bg); }
.login-card { width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 34px; box-shadow: 0 20px 50px -30px rgba(20,29,27,.4); }
.login-card h2 { font-family: var(--font-disp); font-size: 24px; margin: 18px 0 4px; }
.login-card .hint { color: var(--ink-soft); font-size: 13.5px; margin: 0 0 22px; }

/* ============================================================
   APP SHELL
   ============================================================ */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--side); color: var(--side-text);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.side-brand { padding: 22px 20px 18px; display: flex; gap: 12px; align-items: center; }
.side-brand .mark { flex: none; }
.side-brand b { color: #fff; font-family: var(--font-disp); font-size: 17px; letter-spacing: .2px; display: block; line-height: 1.15; }
.side-brand span { font-size: 11px; color: #8fa09a; display: block; margin-top: 2px; }
.sidebar .strata { margin: 0 20px 16px; opacity: .9; }
.nav { flex: 1; padding: 4px 12px; overflow-y: auto; }
.nav .grp { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: #718079; padding: 14px 10px 6px; font-weight: 600; }
.nav a {
  display: flex; align-items: center; gap: 11px; color: var(--side-text);
  padding: 9px 10px; border-radius: 9px; margin: 2px 0; font-weight: 500; font-size: 14px;
  transition: background .15s, color .15s;
}
.nav a:hover { background: var(--side-2); color: #fff; }
.nav a.active { background: linear-gradient(90deg, rgba(176,106,36,.28), rgba(176,106,36,.10)); color: #f2d9b8; box-shadow: inset 3px 0 0 var(--copper); }
.badge-red {
  margin-left: auto; background: var(--red); color: #fff; font-size: 11px; font-weight: 700;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-mono);
}
.side-user { padding: 14px 20px 18px; border-top: 1px solid #243330; font-size: 13px; }
.side-user b { color: #fff; display: block; }
.side-user span { color: #8fa09a; font-size: 12px; text-transform: capitalize; }
.side-user a { display: inline-flex; align-items: center; gap: 7px; margin-top: 10px; color: #d9a45b; font-weight: 600; font-size: 13px; }

.main { padding: 30px 36px 60px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-family: var(--font-disp); font-size: 27px; font-weight: 700; margin: 0; letter-spacing: -.3px; }
.page-head .desc { color: var(--ink-soft); margin: 4px 0 0; font-size: 14px; }

/* ---------- Cards & grid ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.card .card-h { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card .card-h h3 { margin: 0; font-size: 15.5px; font-family: var(--font-disp); }
.card .card-b { padding: 20px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px 16px; display: block; color: var(--ink); position: relative; overflow: hidden;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.stat::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: linear-gradient(90deg, #2c3a36 0 22%, var(--copper) 22% 58%, #d9a45b 58% 70%, #46524e 70%); }
.stat:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -18px rgba(20,29,27,.45); border-color: var(--copper); }
.stat .k { font-size: 12.5px; color: var(--ink-soft); font-weight: 600; display: flex; gap: 8px; align-items: center; }
.stat .v { font-family: var(--font-disp); font-size: 38px; font-weight: 700; line-height: 1.1; margin-top: 6px; }
.stat .u { font-size: 12px; color: var(--ink-soft); }
.stat.total { background: var(--ink); color: #fff; border-color: var(--ink); }
.stat.total .k, .stat.total .u { color: #b9c4c0; }
.stat.total .v { color: #f2d9b8; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th {
  text-align: left; font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-soft); padding: 10px 14px; border-bottom: 2px solid var(--line);
  background: #f7f9f8; white-space: nowrap;
}
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:hover td { background: #f7f9f8; }
.tbl .mono { font-family: var(--font-mono); font-size: 12.5px; }
.mono { font-family: var(--font-mono); }
.tbl .muted { color: var(--ink-soft); font-size: 12.5px; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill.berjalan { background: var(--green-bg); color: var(--green); }
.pill.selesai { background: #e8eae9; color: var(--ink-soft); }
.pill.warn { background: var(--red-bg); color: var(--red); }
.pill.info { background: var(--cobalt-bg); color: var(--cobalt); }

/* ---------- Buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; border: 1px solid transparent;
  border-radius: 9px; padding: 8px 15px; font-weight: 600; font-size: 13.5px; cursor: pointer;
  font-family: var(--font-body); transition: background .15s, border-color .15s; line-height: 1.3;
}
.btn-primary { background: var(--copper); color: #fff; }
.btn-primary:hover { background: var(--copper-dk); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #2c3a36; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--copper); color: var(--copper-dk); }
.btn-danger { background: var(--red-bg); color: var(--red); }
.btn-danger:hover { background: #f5d3d3; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 7px; }
.btn-block { width: 100%; justify-content: center; padding: 11px; font-size: 14.5px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 5px; }
.field label .req { color: var(--red); }
.field input[type=text], .field input[type=password], .field input[type=email],
.field input[type=date], .field input[type=file], .field select, .field textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px;
  font: inherit; background: #fff; color: var(--ink);
}
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid rgba(176,106,36,.35); border-color: var(--copper);
}
.field.invalid input, .field.invalid textarea, .field.invalid select { border-color: var(--red); background: #fff7f7; }
.field .err { color: var(--red); font-size: 12.5px; margin-top: 4px; display: none; }
.field.invalid .err { display: block; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-grid .full { grid-column: 1 / -1; }

.flash { border-radius: 10px; padding: 12px 16px; margin-bottom: 18px; font-weight: 500; display: flex; gap: 10px; align-items: center; }
.flash.ok { background: var(--green-bg); color: var(--green); }
.flash.err { background: var(--red-bg); color: var(--red); }

/* ---------- Modal ---------- */
.modal-bg {
  position: fixed; inset: 0; background: rgba(20,29,27,.55); backdrop-filter: blur(2px);
  display: none; align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 60; overflow-y: auto;
}
.modal-bg.open { display: flex; }
.modal {
  background: #fff; border-radius: 14px; width: 100%; max-width: 640px;
  box-shadow: 0 30px 80px -30px rgba(0,0,0,.5); animation: pop .18s ease;
}
@keyframes pop { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal .modal-h { padding: 16px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal .modal-h h3 { margin: 0; font-family: var(--font-disp); font-size: 17px; }
.modal .modal-b { padding: 22px; }
.modal .modal-f { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.modal .close-x { background: none; border: none; cursor: pointer; color: var(--ink-soft); padding: 4px; }

/* ---------- Kalender ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cal-head h3 { font-family: var(--font-disp); font-size: 18px; margin: 0; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal .dow { text-align: center; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); padding: 6px 0; }
.cal .dow.we { color: var(--copper-dk); }
.day {
  border: 1px solid var(--line); border-radius: 10px; min-height: 72px; padding: 8px;
  background: #fff; position: relative; font-size: 13px; text-align: left; font-family: var(--font-body);
}
.day .n { font-weight: 600; font-family: var(--font-mono); font-size: 13px; }
.day .tag { display: block; font-size: 10.5px; margin-top: 5px; line-height: 1.25; color: var(--ink-soft); }
.day.blank { border: none; background: transparent; }
.day.clickable { cursor: pointer; transition: border-color .15s, background .15s, transform .1s; }
.day.clickable:hover { border-color: var(--copper); background: var(--copper-bg); transform: translateY(-1px); }
.day.reported { background: var(--cobalt); border-color: var(--cobalt); color: #fff; }
.day.reported .n, .day.reported .tag { color: #fff; }
.day.reported.clickable:hover { background: #1c46a3; border-color: #1c46a3; }
.day.weekend { background: #f4efe7; }
.day.holiday { background: var(--red-bg); border-color: #eec5c5; }
.day.holiday .n { color: var(--red); }
.day.today { outline: 2px solid var(--copper); outline-offset: 1px; }
.day.disabled { opacity: .45; }
.cal-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 14px; font-size: 12.5px; color: var(--ink-soft); }
.cal-legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; vertical-align: -1px; margin-right: 6px; border: 1px solid var(--line); }

/* ---------- Bintang penilaian ---------- */
.stars { display: inline-flex; gap: 4px; }
.stars button { background: none; border: none; cursor: pointer; padding: 2px; color: #cfd6d2; transition: color .1s, transform .1s; }
.stars button svg { fill: currentColor; stroke: currentColor; }
.stars button.on { color: var(--copper); }
.stars button:hover { transform: scale(1.15); }
.stars.readonly button { cursor: default; }
.stars.readonly button:hover { transform: none; }
.star-label { font-size: 12.5px; color: var(--ink-soft); margin-left: 8px; font-weight: 600; }

/* ---------- Validasi publik ---------- */
.valid-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.valid-card { max-width: 560px; width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.valid-card .vh { padding: 26px 30px; color: #fff; background: var(--ink); }
.valid-card .vh.ok { background: linear-gradient(135deg, #14532d, #1e7a55); }
.valid-card .vh.bad { background: linear-gradient(135deg, #7f1d1d, #c23b3b); }
.valid-card .vb { padding: 26px 30px; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 8px 14px; font-size: 14px; }
.kv dt { color: var(--ink-soft); font-weight: 600; }
.kv dd { margin: 0; }

.empty { text-align: center; color: var(--ink-soft); padding: 40px 20px; }
.empty svg { color: #cfd6d2; margin-bottom: 10px; }

.topbar-mobile { display: none; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 50; width: 260px; height: 100vh; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: 0 0 60px rgba(0,0,0,.4); }
  .topbar-mobile {
    display: flex; align-items: center; gap: 12px; background: var(--side); color: #fff;
    padding: 12px 16px; position: sticky; top: 0; z-index: 40;
  }
  .topbar-mobile button { background: none; border: 1px solid #33423e; color: #fff; border-radius: 8px; padding: 6px 10px; cursor: pointer; }
  .main { padding: 20px 16px 50px; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-hero { padding: 34px 26px; min-height: 240px; }
  .login-hero h1 { font-size: 28px; }
  .form-grid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
