:root{
  --bg:#f6f8fb;
  --card:#fff;
  --line:#e5e7eb;
  --txt:#1f2937;
  --muted:#6b7280;
  --pri:#0d6efd;      /* default saja, nanti dioverride dari header.php */
  --pri-100:#e8f1ff;
  --good:#16a34a;
  --danger:#dc2626;
}

*{box-sizing:border-box}
html,body{height:100%}
body{margin:0;background:var(--bg);color:var(--txt);font-family:Segoe UI,Arial,sans-serif}

/* LAYOUT */
.app{display:flex;min-height:100vh}
.sidebar{
  width:240px;background:#ffffff;border-right:1px solid var(--line);
  display:flex;flex-direction:column;position:sticky;top:0;height:100vh
}
.sidebar.collapsed{width:64px}
.brand{display:flex;align-items:center;justify-content:space-between;padding:12px 12px 8px}
.brand-link{font-weight:700;color:#111;text-decoration:none}
.toggle{border:none;background:#f0f2f5;border-radius:8px;padding:6px 10px;cursor:pointer}

.menu{padding:6px 8px;display:flex;flex-direction:column;gap:4px}
.menu-label{font-size:12px;color:var(--muted);padding:8px 10px 4px}

.nav-link{
  padding:10px 12px;border-radius:10px;color:#111;text-decoration:none;display:block;
}
.nav-link:hover{background:#f5f7fb}
.nav-link.active{background:var(--pri-100);color:#0b63c1;font-weight:600}

.sidebar-footer{margin-top:auto;padding:12px;border-top:1px solid var(--line)}
.user-name{font-size:14px;font-weight:600}
.user-role{font-size:12px;color:var(--muted)}
.logout{display:inline-block;margin-top:8px;background:#ffecec;color:#b42318;border:1px solid #ffd1d1;padding:8px 10px;border-radius:8px;text-decoration:none}
.logout:hover{background:#ffdede}

.content{flex:1;display:flex;flex-direction:column}
.topbar{
  position:sticky;top:0;background:#fff;border-bottom:1px solid var(--line);
  display:flex;align-items:center;justify-content:space-between;padding:10px 16px;z-index:5
}
.page-title{font-weight:700}
.user-mini{font-size:13px;color:var(--muted)}

.page-wrap{padding:16px;max-width:1200px;margin:0 auto;width:100%}
.footer{border-top:1px solid var(--line);padding:12px 16px;text-align:center;font-size:13px;color:var(--muted)}

/* KOMPONEN BAWAAN */
.card{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:16px}
.grid-2{display:grid;grid-template-columns:1fr 2fr;gap:16px}
.grid-4{display:grid;grid-template-columns:repeat(4,1fr);gap:14px}
@media (max-width:1024px){.grid-2{grid-template-columns:1fr}.grid-4{grid-template-columns:repeat(2,1fr)}}
@media (max-width:560px){
  .sidebar{position:fixed;left:0;z-index:10}
  .content{margin-left:64px}
  .grid-4{grid-template-columns:1fr}
}

label{
  font-size:13px;
  margin-bottom:6px;
  display:block;
}

input[type=text],
input[type=date],
input[type=number],
input[type=password],
select,
textarea{
  width:100%;
  padding:10px;
  border:1px solid var(--line);
  border-radius:10px;   /* ini yang bikin lengkung */
  font-size:14px;
  background:#fff;
}

/* Judul form / heading di dalam card */
.form-title,
.card h1,
.card h2,
.card h3 {
  color: var(--pri);
}


textarea{min-height:80px}
.row{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.btn{background:var(--pri);color:#fff;border:none;padding:10px 14px;border-radius:10px;cursor:pointer;font-size:14px}
.btn.secondary{background:#e5e7eb;color:#111}
.btn.outline{background:#fff;color:var(--pri);border:1px solid var(--pri)}

.table{width:100%;border-collapse:separate;border-spacing:0}
.table th,.table td{padding:10px;border-bottom:1px solid var(--line);font-size:14px;text-align:left}
.table thead th{background:#f9fafb}
.badge{display:inline-block;background:#eef2ff;color:#3730a3;padding:3px 8px;border-radius:999px;font-size:12px}
.status{padding:4px 8px;border-radius:20px;font-size:12px;display:inline-block}
.s-aktif{background:#e8f5ff;color:#0b63c1}
.s-selesai{background:#ecfdf5;color:#065f46}
.s-batal{background:#fef2f2;color:#991b1b}

.alert{background:#fff3cd;border:1px solid #ffe69c;color:#664d03;padding:10px 12px;border-radius:10px;font-size:14px;margin-bottom:12px}
.muted{color:var(--muted);font-size:12px}

/* ========== MENU GROUP (Laporan & Master Data) ========== */
.menu-group {
  margin-top: 6px;
}

.menu-group-header {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font: inherit;
  color: inherit;
}

.menu-group-header:hover {
  background:#f5f7fb;
}

.menu-group .caret {
  font-size: 10px;
}

/* submenu default tersembunyi */
.menu-group .submenu {
  display: none;
  padding-left: 10px;
  margin-top: 2px;
}

/* kalau group ada class .open -> submenu muncul */
.menu-group.open .submenu {
  display: block;
}

/* tampilan sub menu sedikit lebih kecil + menjorok */
.nav-link.sub {
  font-size: 13px;
  padding: 8px 12px 8px 24px;
}

/* Tombol aksi kotak kecil berwarna (seperti invoice alterna) */
.action-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:32px;
  height:32px;
  border-radius:8px;
  border:1px solid transparent;
  background:#fff;
  margin-right:4px;
  font-size:16px;
  cursor:pointer;
  text-decoration:none;
}

/* Warna-warna */
.action-blue{
  border-color:#3b82f6;
  color:#2563eb;
}

.action-yellow{
  border-color:#f59e0b;
  color:#d97706;
}

.action-orange{
  border-color:#fb923c;
  color:#ea580c;
}

.action-red{
  border-color:#ef4444;
  color:#dc2626;
}

/* Supaya button <button> tidak ada border default */
.action-btn:focus{
  outline:none;
}
.action-btn:hover{
  filter:brightness(0.95);
}

        .kop {
            text-align: center;
            margin-bottom: 20px;
        }
        .kop-logo {
            max-height: 60px;
            display: block;
            margin: 0 auto 8px auto;
        }
        .kop-nama {
            font-size: 18px;
            font-weight: bold;
            color: #007b8a;
        }
        .kop-sub {
            font-size: 12px;
            color: #555;
        }

option.opt-add {
    background: #ffe5e5;      /* merah muda */
    color: #c40000;           /* merah tua */
    font-weight: bold;
}
