:root{
  --bg:#ffffff;               /* putih */
  --panel:#ffffff;            /* panel */
  --text:#0f172a;             /* slate-900 */
  --muted:#64748b;            /* slate-500 */
  --line:rgba(15,23,42,.08);

  --accent:#d32f2f;           /* merah utama */
  --accent-2:#ef4444;         /* merah terang */
  --accent-soft:#fde7e7;      /* soft merah */

  --list-soft:#e8f5e9;        /* hijau muda row */
  --list-soft-border:#c8e6c9;

  --shadow: 0 16px 28px rgba(2,6,23,.08);
  --shadow-soft: 0 10px 20px rgba(2,6,23,.06);

  --r-xl:18px;
  --r-lg:14px;
  --r-md:12px;
}

*{ box-sizing:border-box }
html,body{ height:100% }

body{
  margin:0;
  font-family: Inter, Segoe UI, system-ui, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* Links */
a{ color: var(--accent); text-decoration:none }
a:hover{ text-decoration:underline }

/* Layout container (public pages) */
.container{
  max-width:1200px;
  margin:0 auto;
  padding:20px;
}

/* Card */
.card{
  background: var(--panel);
  border:1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow);
}
.card-header{
  padding:16px 20px;
  border-bottom:1px solid var(--line);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.card-title{
  font-size:18px;
  font-weight:900;
  letter-spacing:.2px;
}
.card-body{ padding:20px }

/* Badge / Pill */
.badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 12px;
  border-radius:999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight:800;
  font-size:12px;
  border:1px solid rgba(211,47,47,.18);
}
.pill{
  display:inline-flex;
  align-items:center;
  padding:8px 12px;
  border-radius:999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight:900;
  font-size:12px;
  border:1px solid rgba(211,47,47,.18);
}

/* Grid */
.grid{ display:grid; gap:16px }
.grid-2{ grid-template-columns:1fr 1fr }
.grid-3{ grid-template-columns:repeat(3,1fr) }
.grid-4{ grid-template-columns:repeat(4,1fr) }
@media (max-width:900px){
  .grid-2,.grid-3,.grid-4{ grid-template-columns:1fr }
}

/* Inputs */
.input, select, textarea{
  width:100%;
  padding:12px 14px;
  border-radius: var(--r-md);
  background:#fff;
  border:1px solid rgba(15,23,42,.14);
  color: var(--text);
  outline:none;
  transition: box-shadow .15s ease, border-color .15s ease, transform .15s ease;
}
.input:focus, select:focus, textarea:focus{
  border-color: rgba(211,47,47,.55);
  box-shadow: 0 0 0 4px rgba(211,47,47,.12);
}
label{ font-weight:800; font-size:12px; color:#111827; display:block; }
.tooltip{ color: var(--muted); font-size:12px; font-weight:600; }

/* Buttons */
.btn{
  appearance:none;
  border:none;
  border-radius: var(--r-md);
  padding:12px 16px;
  font-weight:900;
  letter-spacing:.2px;
  color:#fff;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  cursor:pointer;
  box-shadow: 0 10px 18px rgba(211,47,47,.18);
  transition: transform .12s ease, filter .12s ease, box-shadow .12s ease;
}
.btn:hover{ filter:brightness(1.05); transform: translateY(-1px) }
.btn:active{ transform: translateY(0px) }

.btn-secondary{
  background: linear-gradient(90deg,#e5e7eb,#cbd5e1);
  color:#0f172a;
  box-shadow: var(--shadow-soft);
}
.btn-danger{
  background: linear-gradient(90deg,#ef4444,#b91c1c);
  color:#fff;
}

/* HR + Footer */
.hr{ height:1px; background: var(--line); margin:16px 0 }
.footer{ color:#94a3b8; font-size:12px; text-align:center; padding:24px }

/* Chart canvas */
canvas{
  border:1px dashed rgba(15,23,42,.10);
  border-radius: var(--r-lg);
  background:#fff;
}

/* ===== Executive App Layout (Sidebar + Topbar) ===== */
.app{
  display:flex;
  min-height:100vh;
  background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
}

/* Sidebar */
.sidebar{
  width: 300px;
  background: linear-gradient(180deg, #ffffff 0%, #fff5f5 100%);
  border-right: 1px solid var(--line);
  padding: 18px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand{
  display:flex;
  align-items:center;
  gap:12px;
  padding: 10px 10px 14px;
  border-bottom: 1px solid var(--line);
}

.logo-mark{
  width:44px;
  height:44px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 14px 24px rgba(211,47,47,.22);
}

.brand-text .brand-name{
  font-weight: 900;
  letter-spacing: .2px;
  font-size: 14px;
}
.brand-text .brand-sub{
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin-top: 2px;
}

.sidebar-profile{
  display:flex;
  gap:12px;
  align-items:center;
  padding: 14px 10px;
}

.avatar{
  width:44px;
  height:44px;
  border-radius: 16px;
  display:grid;
  place-items:center;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 900;
}

.profile-meta .profile-name{
  font-weight: 900;
  font-size: 13px;
}
.profile-meta .profile-role{
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin-top: 2px;
}

/* Nav */
.nav{ padding: 6px 6px 0; overflow:auto; height: calc(100vh - 230px); }

.nav-section{
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .14em;
  margin: 10px 8px 8px;
}

.nav-group{ margin-top: 14px; }
.nav-group-title{
  color:#111827;
  font-weight: 900;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .14em;
  margin: 10px 8px 8px;
}

.nav-item{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 10px 10px;
  border-radius: 14px;
  color: var(--text);
  border: 1px solid transparent;
  font-weight: 800;
  transition: background .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.nav-item:hover{
  background: #fff;
  border-color: rgba(211,47,47,.18);
  box-shadow: var(--shadow-soft);
  text-decoration:none;
}
.nav-item.is-active{
  background: linear-gradient(90deg, var(--accent-soft), #ffffff);
  border-color: rgba(211,47,47,.22);
}

.nav-ic{
  width: 30px;
  height: 30px;
  border-radius: 12px;
  display:grid;
  place-items:center;
  background: #fff;
  border: 1px solid rgba(15,23,42,.10);
}

.sidebar-footer{
  position:absolute;
  bottom: 16px;
  left: 16px;
  right: 16px;
}

.btn-ghost{
  display:block;
  text-align:center;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(15,23,42,.10);
  color: #111827;
  font-weight: 900;
  box-shadow: var(--shadow-soft);
}
.btn-ghost:hover{
  border-color: rgba(211,47,47,.25);
  color: var(--accent);
  text-decoration:none;
}

/* Main area */
.main{
  flex:1;
  min-width:0;
}

.topbar{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--line);
  background:#fff;
  position: sticky;
  top: 0;
  z-index: 5;
}

.page-title{
  font-size: 18px;
  font-weight: 900;
  letter-spacing:.2px;
}
.page-subtitle{
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin-top: 4px;
}

.container-app{
  padding: 22px 26px 26px;
  max-width: 1400px;
}

.app-footer{
  color:#94a3b8;
  font-size:12px;
  text-align:center;
  padding: 16px 0 26px;
}

/* ===== Table (clean + smaller, executive) ===== */
.table{
  width:100%;
  border-collapse:separate;
  border-spacing:0 10px;
}

.table thead th{
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:#64748b;
  text-align:left;
  padding:8px 10px;
  font-weight: 900;
}

.table tbody td{
  background: var(--list-soft);
  padding: 10px 10px;
  border-top: 1px solid var(--list-soft-border);
  border-bottom: 1px solid var(--list-soft-border);
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
}

.table tbody tr td:first-child{
  border-left:1px solid var(--list-soft-border);
  border-radius: 12px 0 0 12px;
}
.table tbody tr td:last-child{
  border-right:1px solid var(--list-soft-border);
  border-radius: 0 12px 12px 0;
}

/* hierarchy per kolom (biar tidak terasa besar) */
.table tbody td:nth-child(3){
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .15px;
}
.table tbody td:nth-child(4){
  font-size: 12.5px;
  color:#334155;
}
.table tbody td:nth-child(5){
  font-size: 11.5px;
  color: var(--muted);
}
.table tbody td:nth-child(6){
  font-size: 12px;
  color:#334155;
}
.table tbody td:nth-child(7){
  font-size: 12px;
  font-weight: 900;
}

/* table buttons smaller */
.table tbody td:last-child .btn{
  font-size: 12px;
  padding: 7px 12px;
  border-radius: 10px;
  box-shadow: var(--shadow-soft);
}

/* details summary (edit) tidy */
details > summary{
  list-style:none;
}
details > summary::-webkit-details-marker{
  display:none;
}

/* ===== Master Page Layout (Form vs List) ===== */
.grid-master{
  display: grid;
  grid-template-columns: 420px 1fr; /* kiri pas, kanan lebar */
  gap: 20px;
}

/* layar besar: kanan makin lega */
@media (min-width: 1400px){
  .grid-master{
    grid-template-columns: 460px 1fr;
  }
}

/* mobile */
@media (max-width: 900px){
  .grid-master{
    grid-template-columns: 1fr;
  }
}
/* Tabel di panel kanan terasa lebih padat & profesional */
.card .table{
  margin-top: 6px;
}

.table td,
.table th{
  font-size: 13px;
}

.table tbody td{
  padding: 12px 12px;
}

/* Kolom aksi lebih rapat */
.table td:last-child{
  white-space: nowrap;
}
/* ===== Master Page Layout (Form vs List) ===== */
.grid-master{
  display:grid;
  grid-template-columns: 420px 1fr; /* kiri pas, kanan lebar */
  gap: 20px;
}
@media (min-width: 1400px){
  .grid-master{ grid-template-columns: 460px 1fr; }
}
@media (max-width: 900px){
  .grid-master{ grid-template-columns: 1fr; }
}

/* Biarkan tabel kanan lega */
.table td:last-child{ white-space:nowrap; }
.status{
  display:inline-flex; align-items:center; gap:8px;
  padding:6px 10px; border-radius:999px;
  font-weight:900; font-size:12px;
  border:1px solid rgba(15,23,42,.10);
  background:#fff;
}
.status .dot{
  width:8px;height:8px;border-radius:50%;
  background:#94a3b8;
}
.status.on{
  color:#166534;
  border-color: rgba(34,197,94,.25);
  background: rgba(34,197,94,.10);
}
.status.on .dot{ background:#22c55e; }
.status.off{
  color:#991b1b;
  border-color: rgba(239,68,68,.22);
  background: rgba(239,68,68,.10);
}
.status.off .dot{ background:#ef4444; }
