/* =========================================================
   AMC - Al Falah Medical Center
   Style mengikuti infospelfas (Calibri, putih, aksen #c0392b)
   ========================================================= */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: Calibri, Arial, sans-serif; background-color: #ffffff; color: #222222; min-height: 100vh; display: flex; flex-direction: column; }
a { color: #c0392b; }

/* Header panel petugas */
header.app-header { display: flex; justify-content: space-between; align-items: center; padding: 18px 32px; border-bottom: 1px solid #e5e5e5; flex-wrap: wrap; gap: 10px; }
header.app-header .title { font-size: 15px; font-weight: 600; color: #c0392b; text-decoration: none; display: flex; align-items: center; gap: 8px; }
header.app-header .title svg { width: 20px; height: 20px; stroke: #c0392b; }
.nav-links { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.nav-links a { font-size: 13px; color: #888888; text-decoration: none; }
.nav-links a:hover, .nav-links a.active { color: #c0392b; }
.nav-links a.active { font-weight: 600; }
.nav-user { font-size: 12px; color: #aaaaaa; }

/* Header halaman publik */
header.public-header { text-align: center; padding: 40px 20px 20px 20px; border-bottom: 1px solid #e5e5e5; }
header.public-header h1 { font-size: 24px; color: #c0392b; letter-spacing: 0.3px; }
header.public-header p { margin-top: 6px; font-size: 14px; color: #555555; }

main { flex: 1; padding: 36px 20px; display: flex; justify-content: center; }
.wrap { width: 100%; max-width: 1080px; }
.wrap-narrow { width: 100%; max-width: 560px; }

h1.page-title { font-size: 20px; margin-bottom: 4px; }
.subtitle { font-size: 13px; color: #777777; margin-bottom: 24px; }
h2.section-title { font-size: 13px; color: #555555; text-transform: uppercase; letter-spacing: 0.3px; margin: 28px 0 12px 0; }

/* Kartu menu (landing) */
.card-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; max-width: 720px; width: 100%; margin: 0 auto; }
.card { border: 1px solid #e0e0e0; border-radius: 8px; padding: 32px 24px; text-align: center; background-color: #ffffff; text-decoration: none; color: inherit; display: block; transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease; }
.card:hover { box-shadow: 0 6px 16px rgba(0,0,0,0.08); transform: translateY(-3px); border-color: #c0392b; }
.card .icon { width: 56px; height: 56px; margin: 0 auto 16px auto; border-radius: 50%; background-color: #f7e9e7; display: flex; align-items: center; justify-content: center; }
.card .icon svg { width: 26px; height: 26px; stroke: #c0392b; }
.card h2 { font-size: 18px; font-weight: 600; margin-bottom: 8px; color: #222222; }
.card p { font-size: 13.5px; color: #666666; line-height: 1.5; }

/* Statistik */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; }
.stat-card { border: 1px solid #e0e0e0; border-radius: 8px; padding: 16px 18px; text-decoration: none; display: block; color: inherit; transition: box-shadow 0.15s ease, border-color 0.15s ease; }
a.stat-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); border-color: #c0392b; }
.stat-number { font-size: 26px; font-weight: 700; line-height: 1; margin-bottom: 6px; color: #222222; }
.stat-label { font-size: 12px; color: #888888; }
.tone-progress .stat-number { color: #1565c0; }
.tone-done .stat-number { color: #2e7d32; }
.tone-danger .stat-number { color: #c0392b; }
.tone-warn .stat-number { color: #a67c00; }

/* Panel & grafik */
.panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.panel-box { border: 1px solid #e0e0e0; border-radius: 8px; padding: 18px 20px; min-width: 0; }
.panel-box.span-2 { grid-column: span 2; }
.panel-box h3 { font-size: 13px; color: #555555; margin-bottom: 14px; text-transform: uppercase; letter-spacing: 0.3px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.panel-box h3 a { font-size: 12px; text-transform: none; letter-spacing: 0; color: #888888; text-decoration: none; font-weight: normal; }
.panel-box h3 a:hover { color: #c0392b; }
.chart-wrap { position: relative; height: 260px; }
.chart-wrap.tall { height: 320px; }
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.bar-row:last-child { margin-bottom: 0; }
.bar-label { font-size: 12.5px; color: #555555; width: 170px; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { flex: 1; height: 16px; background-color: #f2f2f2; border-radius: 8px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 8px; background-color: #c0392b; }
.bar-count { font-size: 12.5px; color: #888888; width: 34px; text-align: right; flex-shrink: 0; }
.empty-panel { font-size: 12.5px; color: #aaaaaa; text-align: center; padding: 14px 0; }

/* Form */
label.f { display: block; font-size: 13px; color: #555555; margin-bottom: 6px; margin-top: 16px; }
label.f .req { color: #c0392b; }
.inp, select.inp, textarea.inp { width: 100%; padding: 10px 12px; font-size: 14px; border: 1px solid #cccccc; border-radius: 6px; font-family: Calibri, Arial, sans-serif; background: #ffffff; color: #222222; }
textarea.inp { resize: vertical; min-height: 80px; }
.inp:focus { outline: none; border-color: #c0392b; }
.field-note { font-size: 11.5px; color: #999999; margin-top: 5px; }
.form-row { display: flex; gap: 12px; }
.form-row > div { flex: 1; min-width: 0; }

.btn { font-size: 13px; padding: 8px 16px; border-radius: 6px; border: none; cursor: pointer; font-family: Calibri, Arial, sans-serif; text-decoration: none; display: inline-block; line-height: 1.3; }
.btn-primary { background-color: #c0392b; color: #ffffff; }
.btn-primary:hover { background-color: #a5311f; }
.btn-light { background-color: #ffffff; color: #666666; border: 1px solid #cccccc; }
.btn-light:hover { border-color: #c0392b; color: #c0392b; }
.btn-export { background-color: #2e7d32; color: #ffffff; }
.btn-export:hover { background-color: #256428; }
.btn-block { width: 100%; padding: 11px 0; font-size: 14px; margin-top: 24px; }
.small-btn { font-size: 11.5px; padding: 5px 10px; border: 1px solid #cccccc; border-radius: 6px; background-color: #ffffff; color: #555555; cursor: pointer; font-family: Calibri, Arial, sans-serif; text-decoration: none; display: inline-block; }
.small-btn:hover { border-color: #c0392b; color: #c0392b; }
.small-btn.primary { background-color: #c0392b; color: #ffffff; border-color: #c0392b; }
.small-btn.primary:hover { background-color: #a5311f; color: #ffffff; }
.small-btn.green { background-color: #2e7d32; color: #ffffff; border-color: #2e7d32; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.filter-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.filter-form select, .filter-form input { padding: 8px 10px; font-size: 13px; border: 1px solid #cccccc; border-radius: 6px; font-family: Calibri, Arial, sans-serif; background: #ffffff; }
.filter-form .lbl { font-size: 12px; color: #888888; }

/* Tabel */
.table-scroll { width: 100%; overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
table.tbl th, table.tbl td { text-align: left; padding: 10px 8px; border-bottom: 1px solid #eeeeee; font-size: 13.5px; vertical-align: top; }
table.tbl th { color: #888888; font-weight: 600; font-size: 11px; text-transform: uppercase; white-space: nowrap; }
table.tbl td.num, table.tbl th.num { text-align: right; }
table.tbl tr.row-muted td { color: #aaaaaa; }
.muted { color: #999999; font-size: 12px; }
.empty-state { text-align: center; padding: 30px; color: #aaaaaa; font-size: 13px; }

.badge { font-size: 11px; padding: 3px 9px; border-radius: 10px; white-space: nowrap; display: inline-block; }
.badge-menunggu { background-color: #fff8e1; color: #a67c00; }
.badge-selesai { background-color: #e8f5e9; color: #2e7d32; }
.badge-pegawai { background-color: #e3f2fd; color: #1565c0; }
.badge-siswa { background-color: #fdf3f2; color: #c0392b; }
.badge-low { background-color: #fdf3f2; color: #c0392b; }
.badge-ok { background-color: #e8f5e9; color: #2e7d32; }
.badge-off { background-color: #f0f0f0; color: #888888; }

/* Alert */
.alert { padding: 10px 14px; border-radius: 6px; font-size: 13px; margin-bottom: 18px; }
.alert-success { background-color: #e8f5e9; color: #2e7d32; }
.alert-error { background-color: #fdf3f2; color: #c0392b; }
.alert-info { background-color: #e3f2fd; color: #1565c0; }

/* Modal */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 50; align-items: flex-start; justify-content: center; padding: 60px 16px; overflow-y: auto; }
.modal-overlay.show { display: flex; }
.modal { background: #ffffff; border-radius: 8px; width: 100%; max-width: 460px; padding: 24px 26px; }
.modal h3 { font-size: 16px; margin-bottom: 4px; }
.modal .modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }

/* Pilihan (form publik) */
.choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.choice-grid.three { grid-template-columns: repeat(3, 1fr); }
.choice { border: 1px solid #e0e0e0; border-radius: 8px; padding: 18px 14px; text-align: center; cursor: pointer; background: #ffffff; font-family: Calibri, Arial, sans-serif; font-size: 15px; color: #222222; transition: border-color 0.15s ease, background-color 0.15s ease; }
.choice:hover { border-color: #c0392b; }
.choice.selected { border-color: #c0392b; background-color: #fdf3f2; color: #c0392b; font-weight: 600; }
.choice small { display: block; font-size: 12px; color: #888888; font-weight: normal; margin-top: 4px; }
.choice .icon { width: 44px; height: 44px; margin: 0 auto 10px auto; border-radius: 50%; background-color: #f7e9e7; display: flex; align-items: center; justify-content: center; }
.choice .icon svg { width: 22px; height: 22px; stroke: #c0392b; }
.step { margin-top: 26px; }
.step-title { font-size: 13px; color: #555555; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.step-num { width: 20px; height: 20px; border-radius: 50%; background-color: #c0392b; color: #ffffff; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.name-list { border: 1px solid #e0e0e0; border-radius: 8px; max-height: 340px; overflow-y: auto; }
.name-item { padding: 11px 14px; border-bottom: 1px solid #f0f0f0; cursor: pointer; font-size: 14px; display: flex; justify-content: space-between; gap: 10px; }
.name-item:last-child { border-bottom: none; }
.name-item:hover { background-color: #fafafa; }
.name-item.selected { background-color: #fdf3f2; color: #c0392b; font-weight: 600; }
.name-item .jab { font-size: 12px; color: #999999; font-weight: normal; white-space: nowrap; }
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid #cccccc; border-radius: 16px; padding: 7px 14px; font-size: 13.5px; cursor: pointer; user-select: none; background: #ffffff; }
.chip input { display: none; }
.chip.on { border-color: #c0392b; background-color: #fdf3f2; color: #c0392b; }
.success-box { text-align: center; padding: 20px 0; }
.success-box .icon { width: 64px; height: 64px; border-radius: 50%; background-color: #e8f5e9; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px auto; }
.success-box .icon svg { width: 30px; height: 30px; stroke: #2e7d32; }
.success-box h2 { font-size: 19px; margin-bottom: 10px; }
.success-box p { font-size: 14px; color: #555555; line-height: 1.6; }
.error-text { font-size: 12.5px; color: #c0392b; margin-top: 14px; }
.back-link { display: inline-block; margin-top: 18px; font-size: 12.5px; color: #888888; text-decoration: none; }
.back-link:hover { color: #c0392b; }

/* Baris obat di form penanganan */
.obat-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.obat-row select { flex: 1; min-width: 0; }
.obat-row input { width: 90px; }

/* Tab */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid #e5e5e5; margin-bottom: 20px; flex-wrap: wrap; }
.tabs a { padding: 9px 14px; font-size: 13px; color: #888888; text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: #c0392b; }
.tabs a.active { color: #c0392b; border-bottom-color: #c0392b; font-weight: 600; }

footer { text-align: center; padding: 20px; font-size: 13px; color: #888888; border-top: 1px solid #e5e5e5; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background-color: #222222; color: #ffffff; padding: 10px 18px; border-radius: 6px; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity 0.25s ease; z-index: 60; }
.toast.show { opacity: 1; }

@media (max-width: 860px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .panel-grid { grid-template-columns: 1fr; }
  .panel-box.span-2 { grid-column: span 1; }
}
@media (max-width: 600px) {
  header.app-header { padding: 14px 16px; }
  main { padding: 24px 16px; }
  .card-grid { grid-template-columns: 1fr; }
  .choice-grid.three { grid-template-columns: repeat(2, 1fr); }
  .form-row { flex-direction: column; gap: 0; }
  .bar-label { width: 110px; }
}
@media print {
  header.app-header, footer, .filter-form, .no-print { display: none !important; }
}
