/* ===========================
   RESET DASAR
   =========================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #fffaf0 0, #fff6e8 40%, #fdf4e3 100%);
  color: #111827;
  line-height: 1.5;
}

/* Link default */
a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ===========================
   HEADER & NAV
   =========================== */

.main-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.5rem;
  background: #fffdf7;
  border-bottom: 1px solid #f5e6c8;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.03);
}

.brand-link {
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.95rem;
  color: #111827;
}

.menu-button {
  border: none;
  outline: none;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #111827;
  font-size: 1.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 12px rgb(234 179 8 / 0.35);
  transition: transform 0.12s ease-out, box-shadow 0.12s ease-out, background 0.15s;
}

.menu-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgb(234 179 8 / 0.45);
}

.menu-button:active {
  transform: translateY(1px) scale(0.97);
  box-shadow: 0 3px 6px rgb(202 138 4 / 0.55);
}

/* Drawer */

.menu-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  width: 230px;
  background: #0b1120;
  color: #e5e7eb;
  padding: 4.5rem 1.25rem 1.25rem;
  transform: translateX(100%);
  transition: transform 0.2s ease-out;
  z-index: 90;
}

.menu-drawer.open {
  transform: translateX(0);
}

.menu-drawer a {
  display: block;
  padding: 0.55rem 0.4rem;
  border-radius: 0.6rem;
  font-size: 0.92rem;
  color: #e5e7eb;
  text-decoration: none;
  margin-bottom: 0.15rem;
}

.menu-drawer a:hover {
  background: rgba(248, 250, 252, 0.08);
}

.menu-drawer a.active {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #111827;
  font-weight: 600;
}

.menu-drawer a.logout {
  margin-top: 0.75rem;
  color: #fecaca;
}

/* Overlay belakang drawer */
.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-out;
  z-index: 80;
}

.menu-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ===========================
   LAYOUT KONTEN
   =========================== */

.content {
  max-width: 1040px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2.5rem;
}

.section {
  margin-bottom: 1.75rem;
}

.section h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.section h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.subtitle {
  font-size: 0.95rem;
  color: #6b7280;
}

/* GRID DASHBOARD */

.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

/* CARD GENERIK */

.card {
  background: rgba(255, 255, 255, 0.94);
  border-radius: 1rem;
  padding: 1rem 1.1rem;
  box-shadow: 0 10px 30px rgb(15 23 42 / 0.08);
  border: 1px solid rgba(250, 204, 21, 0.2);
}

.card h2 {
  margin-bottom: 0.35rem;
}

.big-number {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.15rem;
}

.note {
  font-size: 0.8rem;
  color: #6b7280;
}

/* BUTTONS */

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.soft-button,
.primary,
.danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  font-size: 0.9rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease-out, box-shadow 0.12s ease-out, background 0.15s;
}

/* Primary (emas) */
.primary {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #111827;
  box-shadow: 0 8px 18px rgb(234 179 8 / 0.45);
}

.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgb(234 179 8 / 0.55);
}

.primary:active {
  transform: translateY(1px) scale(0.97);
  box-shadow: 0 4px 8px rgb(202 138 4 / 0.6);
}

/* Soft button */
.soft-button {
  background: rgba(254, 243, 199, 0.85);
  color: #92400e;
  box-shadow: 0 4px 10px rgb(251 191 36 / 0.3);
}

.soft-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgb(251 191 36 / 0.4);
}

/* Danger */
.danger {
  background: #b91c1c;
  color: #fee2e2;
  box-shadow: 0 8px 18px rgb(185 28 28 / 0.45);
}

.danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgb(185 28 28 / 0.6);
}

/* ===========================
   FORM & TABEL
   =========================== */

form {
  width: 100%;
}

.form-row {
  display: flex;
  flex-direction: column;
  margin-bottom: 0.75rem;
}

.form-row label {
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.form-row input,
.form-row select,
.form-row textarea {
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  padding: 0.45rem 0.6rem;
  font-size: 0.9rem;
  outline: none;
  background: #f9fafb;
  transition: border 0.12s ease-out, box-shadow 0.12s ease-out, background 0.12s;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.35);
  background: #ffffff;
}

/* ALERT */

.alert {
  padding: 0.6rem 0.75rem;
  border-radius: 0.75rem;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.alert.success {
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  color: #065f46;
}

.alert.error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

/* TABLE */

.table-wrapper {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

table thead {
  background: #fef3c7;
}

table th,
table td {
  padding: 0.5rem 0.5rem;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
}

table th {
  font-weight: 600;
  white-space: nowrap;
}

/* ===========================
   HALAMAN LOGIN
   =========================== */

body.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top, #fffaf0 0, #fef3c7 40%, #fef9c3 100%);
}

.login-card {
  width: min(420px, 100% - 2.5rem);
  background: #ffffff;
  border-radius: 1.25rem;
  padding: 1.5rem 1.75rem 1.75rem;
  box-shadow: 0 18px 40px rgb(15 23 42 / 0.15);
  border: 1px solid rgba(250, 204, 21, 0.4);
}

.login-card h1 {
  text-align: center;
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}

.tagline {
  text-align: center;
  font-size: 0.86rem;
  color: #6b7280;
  margin-bottom: 1.1rem;
}

.login-form label {
  display: block;
  margin-bottom: 0.65rem;
}

.login-form span {
  display: block;
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
  color: #4b5563;
}

.login-form input {
  width: 100%;
  border-radius: 0.85rem;
  border: 1px solid #e5e7eb;
  padding: 0.5rem 0.6rem;
  font-size: 0.9rem;
  background: #f9fafb;
  outline: none;
  transition: border 0.12s ease-out, box-shadow 0.12s ease-out, background 0.12s;
}

.login-form input:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.35);
  background: #ffffff;
}

.login-form button {
  margin-top: 0.4rem;
  width: 100%;
  border-radius: 999px;
  border: none;
  padding: 0.6rem 0.8rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #111827;
  box-shadow: 0 10px 20px rgb(234 179 8 / 0.55);
}

.login-form button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgb(234 179 8 / 0.65);
}

.login-form button:active {
  transform: translateY(1px) scale(0.97);
  box-shadow: 0 5px 12px rgb(202 138 4 / 0.65);
}

.login-quote {
  margin-top: 0.9rem;
  font-size: 0.8rem;
  color: #6b7280;
  text-align: center;
}

/* ===========================
   RESPONSIVE
   =========================== */

@media (max-width: 640px) {
  .main-header {
    padding-inline: 1rem;
  }
  .content {
    padding-inline: 1rem;
  }
  .section h1 {
    font-size: 1.5rem;
  }
}

.page {
  width: 160mm;
  margin: 0 auto;
  position: relative;
  text-align: left;           /* PAKSA default halaman rata kiri */
}

.menu-button-chat {
  position: relative;
}

.chat-header-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ef4444;
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px #fefce8; /* halo kuning biar nyatu sama tema */
}

/* ===========================
   CHAT: toolbar penerima
   =========================== */

.chat-recipient-toolbar {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: #fefce8;      /* kuning lembut senada tema */
  border-radius: 1rem;
  border: 1px solid #fde68a;
}

.chat-recipient-toolbar-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #92400e;
  margin-bottom: 0.35rem;
}

.chat-recipient-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.chat-recipient-controls input[type="text"],
.chat-recipient-controls select {
  flex: 1;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
}

.chat-recipient-controls .btn.btn-sm,
.chat-recipient-controls button.btn-sm {
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.8rem;
}

/* Di HP, kolom jadi bertumpuk biar lega */
@media (max-width: 768px) {
  .chat-recipient-controls {
    flex-direction: column;
    align-items: stretch;
  }
}

html, body {
  max-width: 100%;
  overflow-x: hidden !important;
  touch-action: pan-y;
}

/* Supaya tidak ada elemen yang memaksa horizontal scroll */
* {
  box-sizing: border-box;
}

