:root{
  --bg:#f4f7fb;
  --panel:#ffffff;
  --text:#1f2937;
  --muted:#6b7280;
  --line:#e5e7eb;
  --primary:#2563eb;
  --primary-dark:#1d4ed8;
  --sidebar:#0f172a;
  --sidebar-text:#e5e7eb;
  --sidebar-active:#1e293b;
  --radius:16px;
  --shadow:0 10px 30px rgba(15,23,42,.08);
}

body.dark{
  --bg:#0b1220;
  --panel:#111827;
  --text:#e5e7eb;
  --muted:#9ca3af;
  --line:#243041;
  --primary:#60a5fa;
  --primary-dark:#3b82f6;
  --sidebar:#050b16;
  --sidebar-text:#e5e7eb;
  --sidebar-active:#111827;
  --shadow:0 10px 30px rgba(0,0,0,.35);
}

*{box-sizing:border-box}

body{
  margin:0;
  font-family:Inter, Arial, sans-serif;
  background:var(--bg);
  color:var(--text);
  overflow-x:hidden;
  transition:.25s ease;
}

.app{display:flex; min-height:100vh}

.sidebar{
  width:270px;
  background:var(--sidebar);
  color:var(--sidebar-text);
  padding:24px 16px;
  transition:all .3s ease;
  overflow:hidden;
}

/* Sidebar tertutup */
.sidebar.closed{
  width:80px;
}

/* Sembunyikan teks saat sidebar ditutup */
.sidebar.closed .brand,
.sidebar.closed .nav span:not(.icon){
  display:none;
}

/* Tengah-kan icon */
.sidebar.closed .nav a{
  justify-content:center;
}

.brand{
  font-size:20px;
  font-weight:700;
  margin-bottom:22px;
  white-space:nowrap;
}

.nav{display:grid; gap:8px}

.nav a{
  color:var(--sidebar-text);
  text-decoration:none;
  padding:11px 12px;
  border-radius:12px;
  display:flex;
  align-items:center;
  gap:10px;
  transition:.2s;
  white-space:nowrap;
}

.nav a:hover,
.nav a.active{background:var(--sidebar-active)}

.icon{width:20px; text-align:center; flex:0 0 20px}


.main{
  flex:1;
  padding:24px;
  transition:all .3s ease;
}

.topbar{
  background:var(--panel);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:16px 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:20px;
}

.theme-btn,
.sidebar-close{
  display:none;
}

.menu-btn{
  border:0;
  background:var(--primary);
  color:#fff;
  padding:11px 14px;
  border-radius:12px;
  cursor:pointer;
}

@media (max-width:900px){

  .sidebar-close{
    display:block;
  }

  .sidebar.closed{
    width:270px;
  }
}

.topbar input{
  width:300px;
  max-width:100%;
  padding:11px 12px;
  border:1px solid var(--line);
  border-radius:12px;
  outline:none;
  background:var(--panel);
  color:var(--text);
}

.pill{
  padding:8px 12px;
  border-radius:999px;
  background:rgba(96,165,250,.12);
  color:var(--primary-dark);
  font-size:14px;
}

.grid{
  display:grid;
  grid-template-columns:repeat(4, 1fr);
  gap:16px;
  margin-bottom:20px;
}

.card, .block{
  background:var(--panel);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:20px;
}

.card h3, .block h2{
  margin:0 0 8px;
  font-size:16px;
}

.card p{margin:0; color:var(--muted)}
.block{margin-bottom:20px}

.actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

button.action{
  border:0;
  background:var(--primary);
  color:#fff;
  padding:11px 16px;
  border-radius:12px;
  cursor:pointer;
  transition:.2s;
}

button.action:hover{background:var(--primary-dark)}

table{width:100%; border-collapse:collapse}

th, td{
  padding:12px;
  border-bottom:1px solid var(--line);
  text-align:left;
}

th{
  background:rgba(148,163,184,.08);
  font-size:14px;
}

.preview{
  min-height:150px;
  border:1px dashed var(--line);
  border-radius:14px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:var(--muted);
  background:rgba(148,163,184,.04);
}

.overlay{
  display:none;
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.45);
  z-index:9;
}

/* =========================
   FORM Beranda STYLE
========================= */

.block{
    margin-bottom:20px;
}

.block label{
    display:block;
    margin-bottom:8px;
    margin-top:15px;
    font-size:14px;
    font-weight:600;
    color:var(--text);
}

.block input[type="text"],
.block input[type="number"],
.block input[type="email"],
.block input[type="url"],
.block input[type="password"],
.block textarea,
.block select{
    width:100%;
    padding:12px 15px;
    border:1px solid var(--line);
    border-radius:12px;
    background:var(--bg);
    color:var(--text);
    font-size:14px;
    transition:all .3s ease;
}

.block textarea{
    min-height:120px;
    resize:vertical;
}

.block input:focus,
.block textarea:focus,
.block select:focus{
    outline:none;
    border-color:var(--primary);
    box-shadow:0 0 0 4px rgba(37,99,235,.12);
}

/* File Upload */
.block input[type="file"]{
    width:100%;
    padding:12px;
    border:2px dashed var(--line);
    border-radius:12px;
    background:rgba(148,163,184,.05);
    cursor:pointer;
}

/* Placeholder */
.block input::placeholder,
.block textarea::placeholder{
    color:var(--muted);
}

/* Tombol Form */
.form-actions{
    display:flex;
    gap:12px;
    flex-wrap:wrap;
}

.btn{
    border:none;
    padding:12px 20px;
    border-radius:12px;
    cursor:pointer;
    font-size:14px;
    font-weight:600;
    transition:.3s;
}

.btn-primary{
    background:var(--primary);
    color:white;
}

.btn-primary:hover{
    background:var(--primary-dark);
}

.btn-secondary{
    background:#64748b;
    color:white;
}

.btn-secondary:hover{
    opacity:.9;
}

/* Header Block */
.block h2{
    border-bottom:1px solid var(--line);
    padding-bottom:12px;
    margin-bottom:20px;
}

/* Grid Form */
.form-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:20px;
}

@media(max-width:768px){
    .form-grid{
        grid-template-columns:1fr;
    }
}

@media (max-width: 900px){
  .app{flex-direction:column}
  .menu-btn{display:inline-block}
  .sidebar{
    position:fixed;
    top:0;
    left:-290px;
    height:100vh;
    z-index:10;
    width:270px;
    box-shadow:20px 0 40px rgba(0,0,0,.2);
  }
  .sidebar.open{left:0}
  .overlay.show{display:block}
  .grid{grid-template-columns:repeat(2,1fr)}
}

@media (max-width: 600px){
  .main{padding:16px}
  .topbar{flex-direction:column; align-items:stretch}
  .grid{grid-template-columns:1fr}
}