:root {
  --paper: #F7F5EF;
  --paper-deep: #EFEAE0;
  --surface: #FFFFFF;
  --ink: #1B231E;
  --ink-soft: #4A4A42;
  --forest: #1E3D31;
  --forest-deep: #122820;
  --forest-tint: #E6EEE9;
  --brass: #9E6B2C;
  --brass-tint: #F3E7D3;
  --line: #E1D9C4;
  --danger: #96271F;
  --danger-tint: #FBEAE7;
  --success: #295C41;
  --success-tint: #E5F0E8;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --shadow-card: 0 1px 2px rgba(20,30,25,0.04), 0 8px 24px -12px rgba(20,30,25,0.14);
  --shadow-pop: 0 12px 32px -8px rgba(20,30,25,0.22);
  --step: 1;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { max-width: 100%; overflow-x: hidden; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: calc(16px * var(--step));
  line-height: 1.55;
  min-height: 100vh;
}

h1, h2, h3, .display {
  font-family: 'Fraunces', Georgia, serif;
  color: var(--forest-deep);
  letter-spacing: -0.01em;
  margin: 0;
}

a { color: var(--forest); font-weight: 600; text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 3px solid var(--brass);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ================= TOPBAR & HORIZONTAL NAVBAR ================= */
.topbar {
  background: linear-gradient(180deg, var(--forest) 0%, var(--forest-deep) 100%);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 0 var(--brass);
}
.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-title { font-weight: 700; font-size: 17px; line-height: 1.2; }
.brand-sub {
  font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase;
  color: #CFE3D6; font-weight: 600; margin-top: 2px;
}
.topbar-user {
  display: flex; align-items: center; gap: 14px;
  font-size: 14.5px; font-weight: 600;
  flex-wrap: wrap;
}
.btn-link {
  color: #fff; text-decoration: none; padding: 8px 12px;
  border-radius: var(--radius-sm); font-weight: 600;
}
.btn-link:hover { background: rgba(255,255,255,0.12); }

.navbar-bar {
  background: var(--forest-deep);
  border-top: 1px solid rgba(255,255,255,0.1);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);
  position: relative;
  z-index: 40;
}
.navbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  position: relative;
}
.menu-links-container {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px 0;
  width: 100%;
}
.menu-links-container a {
  color: #E2ECE5;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.menu-links-container a:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
  text-decoration: none;
}
.menu-links-container a.active {
  background: var(--brass);
  color: var(--forest-deep);
}

.nav-toggle-checkbox {
  display: none !important;
}
.dropdown-toggle-btn {
  display: none;
}

/* ================= LAYOUT UTAMA ================= */
.layout-single {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 20px 80px;
}
.content-full {
  width: 100%;
}

/* ================= CARDS ================= */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
  max-width: 100%;
}
.card-title { font-size: 19px; margin-bottom: 4px; }
.card-desc { color: var(--ink-soft); font-size: 14.5px; margin: 0 0 16px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.stat-card {
  background: var(--forest-tint);
  border: 1px solid #D3E3D9;
  border-radius: var(--radius-md);
  padding: 18px 20px;
}
.stat-num { font-family: 'Fraunces', serif; font-size: 30px; font-weight: 600; color: var(--forest-deep); }
.stat-label { font-size: 13px; color: var(--ink-soft); font-weight: 600; margin-top: 2px; }

/* ================= FORMS ================= */
label { display: flex; flex-direction: column; gap: 7px; font-size: 14.5px; font-weight: 700; color: #2C271D; margin-bottom: 16px; }
.hint { font-weight: 500; color: var(--ink-soft); font-size: 13px; }
input, select, textarea {
  border: 2px solid #D7CCAF;
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 16px;
  font-family: inherit;
  color: var(--ink);
  font-weight: 500;
  min-height: 50px;
  width: 100%;
  max-width: 100%;
}
textarea { min-height: 100px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--forest);
  box-shadow: 0 0 0 4px rgba(30,61,49,0.14);
}

/* ================= BUTTONS ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--forest); color: #fff; border: none;
  border-radius: var(--radius-sm); padding: 14px 22px;
  font-size: 15.5px; font-weight: 700; cursor: pointer;
  min-height: 48px; text-decoration: none;
  box-shadow: 0 2px 0 rgba(0,0,0,0.12);
}
.btn:hover { background: var(--forest-deep); color: #fff; text-decoration: none; }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn.secondary { background: transparent; color: var(--forest); border: 2px solid var(--forest); box-shadow: none; padding: 12px 22px; }
.btn.secondary:hover { background: var(--forest-tint); }
.btn.success { background: var(--success); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* ================= TABLE ================= */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--line); max-width: 100%; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; background: var(--surface); min-width: 560px; }
.table th, .table td { text-align: left; padding: 14px 16px; border-bottom: 1px solid #EEE7D4; font-size: 15px; }
.table th { text-transform: uppercase; font-size: 11.5px; letter-spacing: .06em; color: var(--forest); background: var(--paper-deep); font-weight: 800; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: #FBF9F3; }

/* ================= BADGES & ALERTS ================= */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  border-radius: 999px; padding: 5px 13px;
  font-size: 12.5px; font-weight: 700;
}
.badge.ok { background: var(--success-tint); color: var(--success); }
.badge.no { background: var(--danger-tint); color: var(--danger); }
.badge.pending { background: var(--brass-tint); color: var(--brass); }

.alert { border-radius: var(--radius-sm); padding: 14px 18px; margin-bottom: 18px; font-size: 15px; font-weight: 600; display: flex; gap: 10px; align-items: flex-start; }
.alert-success { background: var(--success-tint); color: var(--success); border: 1px solid #BFDBC9; }
.alert-error { background: var(--danger-tint); color: var(--danger); border: 1px solid #EFC7BF; }

.muted { color: var(--ink-soft); font-size: 13px; line-height: 1.5; }
.login-wrap { max-width: 400px; margin: 60px auto; width: 100%; padding: 0 16px; }

/* ================= RESPONSIVE MOBILE (<= 860px) ================= */
@media (max-width: 860px) {
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }
  .topbar-inner {
    padding: 12px 16px;
  }
  .topbar-user {
    gap: 8px;
    font-size: 13px;
  }

  .dropdown-toggle-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    background: var(--brass);
    color: #fff;
    border: none;
    padding: 12px 16px;
    font-size: 14.5px;
    font-weight: 700;
    cursor: pointer;
    border-radius: var(--radius-sm);
    margin: 8px 0;
  }

  .menu-links-container {
    display: none;
    flex-direction: column;
    background: var(--forest-deep);
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 10px 16px 16px;
    box-shadow: var(--shadow-pop);
    z-index: 99999;
    border-bottom: 3px solid var(--brass);
    max-height: 70vh;
    overflow-y: auto;
  }

  .nav-toggle-checkbox:checked ~ .menu-links-container {
    display: flex !important;
  }

  .menu-links-container a {
    padding: 10px 12px;
    font-size: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }
}
/* =========================================================================
   TAMBAHKAN BLOK INI KE PALING BAWAH FILE assets/style.css YANG SUDAH ADA
   (Jangan taruh di file/style terpisah — harus jadi bagian dari style.css
   yang sudah dimuat via <link>, supaya lolos Content-Security-Policy kamu)
   ========================================================================= */

/* ============ Halaman Presensiku - Filter Form Responsive ============ */
.presensiku-filter-form {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.presensiku-filter-form input[type="month"] {
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid #ddd;
}

.presensiku-filter-form .btn-kembali {
  margin-left: auto;
}

/* ============ Halaman Presensiku - Tabel jadi Kartu di Mobile ============ */
@media (max-width: 640px) {
  .presensiku-filter-form {
    flex-direction: column;
    align-items: stretch;
  }

  .presensiku-filter-form strong {
    text-align: center;
    margin-bottom: 4px;
  }

  .presensiku-filter-form input[type="month"],
  .presensiku-filter-form .btn {
    width: 100%;
    box-sizing: border-box;
    text-align: center;
  }

  .presensiku-filter-form .btn-kembali {
    margin-left: 0;
  }

  body table.presensiku-table thead {
    display: none;
  }

  body table.presensiku-table,
  body table.presensiku-table tbody,
  body table.presensiku-table tr,
  body table.presensiku-table td,
  body table.presensiku-table th {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  body table.presensiku-table {
    border: none;
    border-collapse: separate;
  }

  body table.presensiku-table tr {
    margin-bottom: 12px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 8px 12px;
    background: #fff;
  }

  body table.presensiku-table td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    padding: 6px 0;
    border: none;
    border-bottom: 1px dashed #eee;
    text-align: right;
  }

  body table.presensiku-table td:last-child {
    border-bottom: none;
  }

  body table.presensiku-table td[colspan] {
    display: block;
    text-align: center;
  }

  body table.presensiku-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #555;
    text-align: left;
    flex-shrink: 0;
  }
}

/* Fallback: kalau untuk suatu hal card-mode di atas tidak aktif,
   pastikan tabel tetap bisa digeser horizontal di layar sempit */
.presensiku-scroll-wrapper {
  display: block;
  width: 100%;
  max-width: 100vw;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.presensiku-scroll-wrapper table.presensiku-table {
  white-space: nowrap;
}

@media (max-width: 640px) {
  .presensiku-scroll-wrapper table.presensiku-table {
    white-space: normal;
  }
}