/* ============================================================
   Aplikasi Laporan Rapat Berjenjang - Stylesheet Utama
   Skema warna: Navy Blue Professional
   ============================================================ */

:root {
  --primary:        #1E4D8C;
  --primary-dark:   #163A6B;
  --primary-light:  #2E6DB4;
  --secondary:      #2E7D9C;
  --accent:         #E8F4FD;
  --sidebar-bg:     #1A3557;
  --sidebar-text:   #C8D8EC;
  --sidebar-hover:  rgba(255,255,255,0.1);
  --sidebar-active: rgba(255,255,255,0.18);

  --success:        #27AE60;
  --success-light:  #E8F8EE;
  --warning:        #E67E22;
  --warning-light:  #FEF5E7;
  --danger:         #E74C3C;
  --danger-light:   #FDEDEC;
  --info:           #2980B9;
  --info-light:     #EBF5FB;

  --bg:             #F4F7FB;
  --surface:        #FFFFFF;
  --border:         #DDE3EE;
  --border-light:   #EEF1F7;
  --text:           #1A2B45;
  --text-secondary: #5A6A85;
  --text-muted:     #8A99B0;

  --radius:         8px;
  --radius-lg:      12px;
  --shadow:         0 2px 8px rgba(30,77,140,0.08);
  --shadow-md:      0 4px 16px rgba(30,77,140,0.12);
  --shadow-lg:      0 8px 32px rgba(30,77,140,0.16);

  --sidebar-width:  260px;
  --topbar-height:  60px;
  --transition:     0.2s ease;
}

/* ============================================================
   Reset & Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-light); }

img { max-width: 100%; height: auto; }

/* ============================================================
   Layout Shell
   ============================================================ */
.app-wrapper { display: flex; min-height: 100vh; }

/* ===== Sidebar ===== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform var(--transition);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.sidebar-brand {
  padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-brand img {
  width: 40px; height: 40px;
  border-radius: 8px;
  object-fit: contain;
  background: rgba(255,255,255,0.9);
  padding: 3px;
}

.sidebar-brand .brand-placeholder {
  width: 40px; height: 40px;
  border-radius: 8px;
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: rgba(255,255,255,0.8);
  flex-shrink: 0;
}

.sidebar-brand-text { flex: 1; min-width: 0; }
.sidebar-brand-text h1 {
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  white-space: normal;
}
.sidebar-brand-text span {
  font-size: 0.7rem;
  color: var(--sidebar-text);
}

.sidebar-user {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-info .name {
  font-size: 0.82rem; font-weight: 600;
  color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user-info .role {
  font-size: 0.7rem; color: var(--sidebar-text);
}

.sidebar-nav { flex: 1; padding: 10px 0; }

.sidebar-section-title {
  padding: 8px 18px 4px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(200,216,236,0.5);
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  color: var(--sidebar-text);
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 0;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  position: relative;
}

.sidebar-item:hover {
  background: var(--sidebar-hover);
  color: #fff;
}

.sidebar-item.active {
  background: var(--sidebar-active);
  color: #fff;
  font-weight: 600;
}

.sidebar-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: #4FC3F7;
  border-radius: 0 2px 2px 0;
}

.sidebar-item svg { flex-shrink: 0; width: 18px; height: 18px; opacity: 0.85; }
.sidebar-item.active svg, .sidebar-item:hover svg { opacity: 1; }

.sidebar-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-footer a {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  color: rgba(200,216,236,0.7);
  font-size: 0.82rem;
  border-radius: var(--radius);
  transition: all var(--transition);
}

.sidebar-footer a:hover {
  background: rgba(231,76,60,0.15);
  color: #ff7675;
}

/* ===== Main Content ===== */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== Top Bar ===== */
.topbar {
  height: var(--topbar-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow);
}

.topbar-hamburger {
  display: none;
  background: none; border: none;
  cursor: pointer; padding: 6px;
  color: var(--text);
}

.topbar-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.topbar-right {
  display: flex; align-items: center; gap: 10px;
}

.topbar-btn {
  background: none; border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 0.8rem; color: var(--text-secondary);
  cursor: pointer; transition: all var(--transition);
  display: flex; align-items: center; gap: 6px;
}

.topbar-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--accent);
}

/* ===== Page Content ===== */
.page-content {
  flex: 1;
  padding: 24px;
}

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
  overflow: hidden;
}

.card-header {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; gap: 12px;
}

.card-header h2, .card-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}

.card-header .card-actions { margin-left: auto; display: flex; gap: 8px; }

.card-body { padding: 22px; }

/* ===== Stat Cards ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
  display: flex; align-items: center; gap: 16px;
  transition: box-shadow var(--transition);
}

.stat-card:hover { box-shadow: var(--shadow-md); }

.stat-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.stat-icon.blue   { background: #EEF5FF; color: var(--primary); }
.stat-icon.green  { background: var(--success-light); color: var(--success); }
.stat-icon.orange { background: var(--warning-light); color: var(--warning); }
.stat-icon.red    { background: var(--danger-light); color: var(--danger); }
.stat-icon.cyan   { background: #E8F8FC; color: var(--secondary); }

.stat-info { flex: 1; min-width: 0; }
.stat-value {
  font-size: 1.6rem; font-weight: 800;
  color: var(--text); line-height: 1.1;
}
.stat-label {
  font-size: 0.78rem; color: var(--text-secondary);
  margin-top: 2px;
}

/* ============================================================
   Tabel
   ============================================================ */
.table-wrapper { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.87rem;
}

thead th {
  background: var(--bg);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 14px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }

tbody tr:hover { background: #F8FAFD; }

/* ============================================================
   Badge / Status
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-draft       { background: #F0F0F0; color: #666; }
.badge-terjadwal   { background: var(--info-light); color: var(--info); }
.badge-berlangsung { background: var(--warning-light); color: var(--warning); }
.badge-selesai     { background: var(--success-light); color: var(--success); }
.badge-dibatalkan  { background: var(--danger-light); color: var(--danger); }
.badge-hadir       { background: var(--success-light); color: var(--success); }
.badge-tidak_hadir { background: var(--danger-light); color: var(--danger); }
.badge-izin        { background: var(--warning-light); color: var(--warning); }
.badge-sakit       { background: #F0E6FF; color: #7B2FBE; }
.badge-baru        { background: var(--info-light); color: var(--info); }
.badge-diangkat    { background: var(--warning-light); color: var(--warning); }
.badge-selesai-log { background: var(--success-light); color: var(--success); }
.badge-tinggi      { background: var(--danger-light); color: var(--danger); }
.badge-sedang      { background: var(--warning-light); color: var(--warning); }
.badge-rendah      { background: var(--success-light); color: var(--success); }

/* ============================================================
   Tombol
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  border: none; cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}

.btn:hover { text-decoration: none; }

.btn svg { width: 15px; height: 15px; flex-shrink: 0; }

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

.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); background: var(--accent); }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #219A52; color: #fff; }

.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #CA6F1E; color: #fff; }

.btn-danger  { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #C0392B; color: #fff; }

.btn-info    { background: var(--info); color: #fff; }
.btn-info:hover { background: #1F618D; color: #fff; }

.btn-sm { padding: 5px 12px; font-size: 0.78rem; }
.btn-lg { padding: 12px 24px; font-size: 0.95rem; }

.btn-ghost { background: transparent; color: var(--text-secondary); padding: 5px 8px; }
.btn-ghost:hover { background: var(--bg); color: var(--primary); }

/* ============================================================
   Form
   ============================================================ */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 0.83rem; font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.form-label .required { color: var(--danger); margin-left: 2px; }

.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30,77,140,0.1);
}

.form-control::placeholder { color: var(--text-muted); }

.form-control[readonly] { background: var(--bg); cursor: not-allowed; }

textarea.form-control { min-height: 90px; resize: vertical; }

select.form-control { cursor: pointer; }

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.form-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }

.form-error {
  font-size: 0.75rem; color: var(--danger);
  margin-top: 4px; display: flex; align-items: center; gap: 4px;
}

/* ============================================================
   Alert
   ============================================================ */
.alert {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.87rem;
  margin-bottom: 18px;
  border-left: 4px solid;
}

.alert svg { width: 18px; height: 18px; flex-shrink: 0; }
.alert-close { margin-left: auto; background: none; border: none; cursor: pointer; font-size: 1.1rem; opacity: 0.6; }
.alert-close:hover { opacity: 1; }

.alert-success { background: var(--success-light); color: #1A5C38; border-color: var(--success); }
.alert-error   { background: var(--danger-light);  color: #7B241C; border-color: var(--danger); }
.alert-warning { background: var(--warning-light); color: #784212; border-color: var(--warning); }
.alert-info    { background: var(--info-light);    color: #1A5276; border-color: var(--info); }

/* ============================================================
   Halaman Login
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1A3557 0%, #1E4D8C 50%, #2E7D9C 100%);
  padding: 20px;
}

.login-card {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
}

.login-logo {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo img {
  height: 70px;
  object-fit: contain;
  margin-bottom: 10px;
}

.login-logo .logo-placeholder {
  width: 70px; height: 70px;
  border-radius: 16px;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 10px;
  color: var(--primary);
}

.login-logo h2 {
  font-size: 1.1rem; font-weight: 800;
  color: var(--text);
  line-height: 1.3;
}

.login-logo p {
  font-size: 0.8rem; color: var(--text-secondary);
  margin-top: 2px;
}

.login-card .form-control {
  padding: 11px 14px;
}

.login-submit {
  width: 100%;
  padding: 12px;
  font-size: 0.95rem;
  margin-top: 8px;
}

.login-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ============================================================
   Page Header
   ============================================================ */
.page-header {
  display: flex; align-items: flex-start; gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.page-header-left { flex: 1; min-width: 0; }

.page-header h1 {
  font-size: 1.25rem; font-weight: 800;
  color: var(--text);
  line-height: 1.3;
}

.page-header .breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.78rem; color: var(--text-muted);
  margin-top: 3px;
}

.page-header .breadcrumb a { color: var(--primary); }
.page-header .breadcrumb span { color: var(--text-muted); }

.page-header-actions {
  display: flex; gap: 8px; align-items: center;
  flex-wrap: wrap;
}

/* ============================================================
   Empty State
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-secondary);
}

.empty-state svg {
  width: 64px; height: 64px;
  margin: 0 auto 16px;
  color: var(--text-muted);
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1rem; font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.empty-state p { font-size: 0.85rem; margin-bottom: 20px; }

/* ============================================================
   Detail Rapat
   ============================================================ */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.detail-item { }
.detail-label {
  font-size: 0.75rem; font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.detail-value {
  font-size: 0.9rem; color: var(--text);
  font-weight: 500;
}

/* ===== Agenda Items ===== */
.agenda-list { list-style: none; }
.agenda-item {
  display: flex; gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
}
.agenda-item:last-child { border-bottom: none; }
.agenda-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 0.8rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 1px;
}
.agenda-content { flex: 1; }
.agenda-title { font-weight: 600; color: var(--text); margin-bottom: 3px; }
.agenda-desc { font-size: 0.83rem; color: var(--text-secondary); }

/* ============================================================
   Foto Grid
   ============================================================ */
.foto-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.foto-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4/3;
  border: 2px solid var(--border-light);
  cursor: pointer;
  transition: border-color var(--transition);
}

.foto-item:hover { border-color: var(--primary); }

.foto-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.foto-item:hover img { transform: scale(1.05); }

.foto-item .foto-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
}

.foto-item:hover .foto-overlay { opacity: 1; }

.foto-item .foto-delete {
  position: absolute; top: 6px; right: 6px;
  background: rgba(231,76,60,0.9);
  border: none; border-radius: 4px;
  padding: 3px 7px;
  color: #fff; font-size: 0.7rem;
  cursor: pointer; opacity: 0;
  transition: opacity var(--transition);
}

.foto-item:hover .foto-delete { opacity: 1; }

/* ============================================================
   Undangan Publik
   ============================================================ */
.undangan-page {
  min-height: 100vh;
  background: var(--bg);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 30px 16px;
}

.undangan-card {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  max-width: 680px;
  width: 100%;
  overflow: hidden;
}

.undangan-header {
  background: linear-gradient(135deg, #1A3557 0%, #1E4D8C 100%);
  padding: 28px 32px;
  text-align: center;
  color: #fff;
}

.undangan-header img { height: 60px; object-fit: contain; margin-bottom: 10px; }

.undangan-header h2 { font-size: 1.1rem; font-weight: 800; margin-bottom: 4px; }
.undangan-header p  { font-size: 0.8rem; opacity: 0.8; }

.undangan-body { padding: 28px 32px; }

.undangan-title {
  font-size: 1rem; font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  margin-bottom: 4px;
}

.undangan-sub {
  text-align: center;
  font-size: 0.83rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.undangan-divider {
  border: none;
  border-top: 2px solid var(--primary);
  margin: 16px 0;
  width: 60px;
  margin-left: auto; margin-right: auto;
}

.undangan-info-table { width: 100%; margin: 18px 0; }
.undangan-info-table td { padding: 7px 0; font-size: 0.87rem; vertical-align: top; }
.undangan-info-table td:first-child {
  font-weight: 600; color: var(--text);
  width: 140px; padding-right: 12px;
}
.undangan-info-table td:nth-child(2) { color: var(--text-secondary); width: 10px; }
.undangan-info-table td:last-child { color: var(--text); }

.undangan-agenda-list {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 16px 0;
}

.undangan-agenda-list ol { padding-left: 18px; }
.undangan-agenda-list li { padding: 4px 0; font-size: 0.87rem; color: var(--text); }

.undangan-footer {
  padding: 20px 32px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  font-size: 0.83rem;
}

/* ============================================================
   Absensi Form
   ============================================================ */
.absensi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.absensi-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition);
}

.absensi-item:has(input:checked) { border-color: var(--success); background: var(--success-light); }

.absensi-item .user-info { flex: 1; min-width: 0; }
.absensi-item .user-name { font-weight: 600; font-size: 0.87rem; color: var(--text); }
.absensi-item .user-role { font-size: 0.75rem; color: var(--text-secondary); }

.absensi-status select {
  font-size: 0.78rem;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

/* ============================================================
   Modal
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition);
}

.modal-overlay.open {
  opacity: 1; pointer-events: all;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform var(--transition);
}

.modal-overlay.open .modal { transform: translateY(0); }

.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; gap: 10px;
}

.modal-header h3 { flex: 1; font-size: 1rem; font-weight: 700; }

.modal-close {
  background: none; border: none;
  font-size: 1.3rem; cursor: pointer;
  color: var(--text-secondary); padding: 4px;
  line-height: 1;
}

.modal-body { padding: 22px; }
.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border-light);
  display: flex; gap: 10px; justify-content: flex-end;
}

/* ============================================================
   Pagination
   ============================================================ */
.pagination {
  display: flex; align-items: center; gap: 6px;
  justify-content: center;
  padding: 18px 0 4px;
}

.pagination a, .pagination span {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border-radius: var(--radius);
  font-size: 0.83rem;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: all var(--transition);
}

.pagination a:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--accent);
}

.pagination span.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 700;
}

.pagination span.disabled { opacity: 0.4; pointer-events: none; }

/* ============================================================
   Lightbox Foto
   ============================================================ */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 300;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}

.lightbox.open { opacity: 1; pointer-events: all; }

.lightbox img {
  max-width: 90vw; max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox-close {
  position: absolute; top: 16px; right: 20px;
  color: #fff; font-size: 2rem;
  background: none; border: none;
  cursor: pointer; opacity: 0.7;
}

.lightbox-close:hover { opacity: 1; }

.lightbox-caption {
  position: absolute; bottom: 20px;
  color: rgba(255,255,255,0.8);
  font-size: 0.87rem;
  text-align: center;
  padding: 0 24px;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
  :root { --sidebar-width: 260px; }

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .main-content { margin-left: 0; }

  .topbar-hamburger { display: flex; }

  .page-content { padding: 16px; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  .form-row { grid-template-columns: 1fr; }

  .page-header { flex-direction: column; }

  .undangan-footer { flex-direction: column; gap: 12px; }

  .undangan-header, .undangan-body { padding: 20px; }

  .modal { max-width: 100%; margin: 0; border-radius: 16px 16px 0 0; }
  .modal-overlay { align-items: flex-end; }
}

/* ============================================================
   Utilities
   ============================================================ */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-small   { font-size: 0.8rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

.fw-bold { font-weight: 700; }
.w-100 { width: 100%; }

.divider {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 20px 0;
}

.overlay-spinner {
  position: fixed; inset: 0;
  background: rgba(255,255,255,0.7);
  z-index: 500;
  display: flex; align-items: center; justify-content: center;
  display: none;
}

.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Print styles */
@media print {
  .sidebar, .topbar, .page-header-actions, .btn, nav { display: none !important; }
  .main-content { margin-left: 0 !important; }
  .page-content { padding: 0 !important; }
  .card { box-shadow: none !important; border: 1px solid #ccc !important; }
}
