/* ============================================
   LAUNDRIFY — Minimalist Modern CSS
   ============================================ */

@import url("https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Sans:wght@300;400;500;600&display=swap");

/* ---- Variables ---- */
:root {
  --bg: #f7f5f2;
  --bg-card: #ffffff;
  --bg-hover: #f0ede8;
  --text: #1a1a18;
  --text-muted: #7a7873;
  --text-light: #b0ada8;
  --accent: #2563eb;
  --accent-light: #eef3ff;
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --success: #16a34a;
  --success-light: #f0fdf4;
  --warning: #d97706;
  --border: #e8e4df;
  --border-dark: #d0cbc4;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --font-display: "DM Serif Display", serif;
  --font-body: "DM Sans", sans-serif;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --sidebar-w: 240px;
}

/* ---- Reset ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  font-size: 16px;
  scroll-behavior: smooth;
}
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
}

a {
  text-decoration: none;
  color: inherit;
}
img {
  max-width: 100%;
  display: block;
}
button {
  cursor: pointer;
  font-family: var(--font-body);
}

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-brand {
  padding: 32px 24px 24px;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand .logo-mark {
  width: 36px;
  height: 36px;
  background: var(--text);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.sidebar-brand .logo-mark svg {
  color: white;
}

.sidebar-brand h1 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.sidebar-brand p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.sidebar-nav {
  padding: 20px 12px;
  flex: 1;
}

.nav-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-light);
  padding: 0 12px;
  margin-bottom: 8px;
  margin-top: 16px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition);
  margin-bottom: 2px;
  position: relative;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.nav-item.aktif {
  background: var(--text);
  color: white;
}

.nav-item .badge {
  margin-left: auto;
  background: var(--accent);
  color: white;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
}

.nav-item.aktif .badge {
  background: rgba(255, 255, 255, 0.25);
}

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-light);
}

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

/* ---- Topbar ---- */
.topbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.hamburger:hover {
  background: var(--bg-hover);
}

.page-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--text);
}

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

.topbar-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ---- Page Body ---- */
.page-body {
  padding: 32px;
  flex: 1;
  animation: fadeUp 0.4s ease both;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---- Page Header ---- */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header-text h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.page-header-text p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 4px;
}

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

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all var(--transition);
  animation: fadeUp 0.4s ease both;
}

.stat-card:nth-child(1) {
  animation-delay: 0.05s;
}
.stat-card:nth-child(2) {
  animation-delay: 0.1s;
}
.stat-card:nth-child(3) {
  animation-delay: 0.15s;
}
.stat-card:nth-child(4) {
  animation-delay: 0.2s;
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--border-dark);
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon.blue {
  background: var(--accent-light);
  color: var(--accent);
}
.stat-icon.green {
  background: var(--success-light);
  color: var(--success);
}
.stat-icon.amber {
  background: #fffbeb;
  color: var(--warning);
}
.stat-icon.red {
  background: var(--danger-light);
  color: var(--danger);
}

.stat-icon svg {
  width: 20px;
  height: 20px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--text);
  line-height: 1;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ---- Cards ---- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.card-body {
  padding: 24px;
}

/* ---- Table ---- */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
}

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

thead {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

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

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

tbody tr {
  transition: background var(--transition);
}

tbody tr:hover {
  background: var(--bg-hover);
}

/* ---- Badges / Status ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
}

.badge-antri {
  background: #fef3c7;
  color: #92400e;
}
.badge-proses {
  background: #dbeafe;
  color: #1e40af;
}
.badge-selesai {
  background: #d1fae5;
  color: #065f46;
}
.badge-diambil {
  background: #f3f4f6;
  color: #374151;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge-reguler {
  background: #f3f4f6;
  color: #374151;
}
.badge-member {
  background: #ede9fe;
  color: #5b21b6;
}

/* ---- Membership toggle (admin users page) ---- */
.membership-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg);
}
.toggle-btn {
  padding: 5px 14px;
  font-size: .78rem;
  font-weight: 500;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .15s, color .15s;
  line-height: 1.4;
}
.toggle-btn:not(:last-child) {
  border-right: 1px solid var(--border);
}
.toggle-btn:hover:not(.active-reguler):not(.active-member) {
  background: var(--bg-hover);
  color: var(--text);
}
.toggle-btn.active-reguler {
  background: var(--text);
  color: white;
}
.toggle-btn.active-member {
  background: #5b21b6;
  color: white;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
  cursor: pointer;
  font-family: var(--font-body);
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: var(--text);
  color: white;
}
.btn-primary:hover {
  background: #333;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

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

.btn-danger {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid #fecaca;
}
.btn-danger:hover {
  background: var(--danger);
  color: white;
}

.btn-edit {
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid #bfdbfe;
  padding: 6px 14px;
  font-size: 0.8rem;
  border-radius: 6px;
}
.btn-edit:hover {
  background: var(--accent);
  color: white;
}

.btn-hapus {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid #fecaca;
  padding: 6px 14px;
  font-size: 0.8rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
}
.btn-hapus:hover {
  background: var(--danger);
  color: white;
}

/* ---- Forms ---- */
.form-wrapper {
  max-width: 580px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 7px;
  letter-spacing: 0.02em;
}

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

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg-card);
  transition: all var(--transition);
  outline: none;
}

.form-control:hover {
  border-color: var(--border-dark);
}

.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-control.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-6px);
  }
  40% {
    transform: translateX(6px);
  }
  60% {
    transform: translateX(-4px);
  }
  80% {
    transform: translateX(4px);
  }
}

.form-control.success {
  border-color: var(--success);
}

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

.error-msg {
  font-size: 0.75rem;
  color: var(--danger);
  margin-top: 5px;
  display: none;
}

.form-control.error + .error-msg {
  display: block;
}

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

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%237A7873' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='4 6 8 10 12 6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

/* ---- Alert / Toast ---- */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.alert-success {
  background: var(--success-light);
  color: #166534;
  border: 1px solid #bbf7d0;
}
.alert-danger {
  background: var(--danger-light);
  color: #991b1b;
  border: 1px solid #fecaca;
}
.alert-info {
  background: var(--accent-light);
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

/* ---- Toast Notification ---- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--text);
  color: white;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  min-width: 260px;
  max-width: 340px;
}

.toast.hide {
  animation: toastOut 0.25s ease both;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(40px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateX(40px) scale(0.95);
  }
}

.toast-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.toast.success {
  background: #166534;
}
.toast.danger {
  background: var(--danger);
}

/* ---- Empty State ---- */
.empty-state {
  text-align: center;
  padding: 64px 24px;
}

.empty-state svg {
  width: 56px;
  height: 56px;
  color: var(--text-light);
  margin: 0 auto 16px;
}

.empty-state h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--text);
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 20px;
}

/* ---- Search Bar ---- */
.search-bar {
  position: relative;
  flex: 1;
  max-width: 280px;
}

.search-bar svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-bar input {
  width: 100%;
  padding: 9px 14px 9px 38px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-family: var(--font-body);
  background: var(--bg-card);
  color: var(--text);
  outline: none;
  transition: all var(--transition);
}

.search-bar input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ---- Table Controls ---- */
.table-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.info-total {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: auto;
}

/* ---- Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

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

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 400px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.show .modal {
  transform: scale(1) translateY(0);
}

.modal-icon {
  width: 52px;
  height: 52px;
  background: var(--danger-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.modal-icon svg {
  width: 24px;
  height: 24px;
  color: var(--danger);
}

.modal h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.modal p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ---- Dashboard recent table ---- */
.recent-section {
  margin-top: 28px;
}

/* ---- Loading Skeleton ---- */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg) 25%,
    var(--border) 50%,
    var(--bg) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

@keyframes shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

/* ---- Hitung Otomatis (Transaksi) ---- */
.calc-preview {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-top: 20px;
  display: none;
}

.calc-preview.show {
  display: block;
  animation: fadeUp 0.3s ease;
}

.calc-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: 4px 0;
}

.calc-row.total {
  color: var(--text);
  font-weight: 600;
  font-size: 1rem;
  border-top: 1px solid var(--border);
  margin-top: 8px;
  padding-top: 10px;
}

/* ---- Overlay untuk mobile sidebar ---- */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 99;
}
.sidebar-overlay.show {
  display: block;
}

/* ---- Standalone page (auth + user) ---- */
body.standalone {
  display: block;
}

/* ---- Auth Layout ---- */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-md);
  animation: fadeUp 0.4s ease both;
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo .logo-mark {
  width: 48px;
  height: 48px;
  background: var(--text);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}

.auth-logo h1 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.auth-logo p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 6px;
}

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

.auth-footer-link a {
  color: var(--accent);
  font-weight: 500;
}

/* ---- User Layout ---- */
.user-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.user-navbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.user-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.user-brand .logo-mark {
  width: 32px;
  height: 32px;
  background: var(--text);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-brand span {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.user-nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
}

.user-nav-link {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.user-nav-link:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.user-nav-link.aktif {
  background: var(--text);
  color: white;
}

.user-nav-logout {
  color: var(--danger) !important;
}

/* Hamburger untuk user navbar (mobile only) */
.user-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text);
  flex-shrink: 0;
}
.user-nav-toggle:hover {
  background: var(--bg-hover);
}

.user-main {
  flex: 1;
  padding: 32px;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  animation: fadeUp 0.4s ease both;
}

/* =============================================
   RESPONSIVE BREAKPOINTS
   ============================================= */

/* --- Tablet & Mobile (≤ 1024px) --- */
@media (max-width: 1024px) {
  :root { --sidebar-w: 220px; }
  .page-body { padding: 24px; }
}

/* --- Mobile (≤ 768px) --- */
@media (max-width: 768px) {

  /* Admin Sidebar */
  .sidebar {
    transform: translateX(-100%);
    width: 260px;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  .main-content {
    margin-left: 0;
  }
  .hamburger {
    display: flex;
  }

  /* Admin Topbar */
  .topbar {
    padding: 0 16px;
  }
  .topbar-date {
    display: none;
  }

  /* Admin Page Body */
  .page-body {
    padding: 20px 16px;
  }

  /* Page Header */
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
  }
  .page-header > .btn,
  .page-header > a.btn {
    width: 100%;
    justify-content: center;
  }
  .page-header-text h2 {
    font-size: 1.4rem;
  }

  /* Stat Cards */
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
  }
  .stat-card {
    padding: 16px;
    gap: 8px;
  }
  .stat-value {
    font-size: 1.5rem;
  }

  /* Cards */
  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 16px;
  }
  .card-header form,
  .card-header > div {
    width: 100%;
  }
  .card-body {
    padding: 16px;
  }

  /* Search */
  .search-bar {
    max-width: 100%;
    width: 100%;
  }
  .table-controls {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .info-total {
    margin-left: 0;
  }

  /* Forms */
  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .form-actions {
    flex-direction: column;
    gap: 8px;
  }
  .form-actions .btn {
    width: 100%;
    justify-content: center;
  }

  /* Membership toggle */
  .membership-toggle {
    width: 100%;
  }
  .toggle-btn {
    flex: 1;
    justify-content: center;
    text-align: center;
  }

  /* User Navbar — hamburger menu */
  .user-navbar {
    padding: 0 16px;
    position: relative;
  }
  .user-nav-toggle {
    display: flex;
  }
  .user-nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px 14px;
    z-index: 99;
    animation: slideDown 0.2s ease;
  }
  .user-nav-links.open {
    display: flex;
  }
  .user-nav-link {
    padding: 11px 14px;
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
    display: block;
  }

  /* User Main */
  .user-main {
    padding: 20px 16px;
  }

  /* Auth */
  .auth-card {
    padding: 28px 20px;
    border-radius: var(--radius-md);
  }

  /* Modal */
  .modal {
    padding: 24px 20px;
    border-radius: var(--radius-md);
  }
  .modal-actions {
    flex-direction: column-reverse;
    gap: 8px;
  }
  .modal-actions .btn {
    width: 100%;
    justify-content: center;
  }

  /* Tables keep overflow as fallback for landscape */
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Dashboard form-row (status + quick actions) */
  .form-row.dashboard-row {
    grid-template-columns: 1fr;
  }
}

/* --- Card-flip tables (≤ 640px portrait) --- */
@media (max-width: 640px) {
  .table-wrapper {
    border: none;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    overflow-x: visible;
  }

  .table-wrapper table,
  .table-wrapper thead,
  .table-wrapper tbody,
  .table-wrapper th,
  .table-wrapper td,
  .table-wrapper tr {
    display: block;
    width: 100%;
  }

  .table-wrapper thead {
    display: none;
  }

  .table-wrapper tbody tr {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
  }

  .table-wrapper tbody tr:hover {
    background: var(--bg-card);
  }

  .table-wrapper td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    border-top: none;
    border-left: none;
    border-right: none;
    text-align: right;
    gap: 12px;
    min-height: 44px;
  }

  .table-wrapper tr td:last-child {
    border-bottom: none;
  }

  /* Label from data-label attribute */
  .table-wrapper td::before {
    content: attr(data-label);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    flex-shrink: 0;
    text-align: left;
    min-width: 72px;
  }

  /* Hide row number — not useful on cards */
  .table-wrapper td[data-label="#"] {
    display: none;
  }

  /* Action cells — full width, no label */
  .table-wrapper td[data-label="Aksi"] {
    justify-content: flex-start;
    text-align: left;
    padding: 12px 14px;
  }
  .table-wrapper td[data-label="Aksi"]::before {
    display: none;
  }
  .table-wrapper td[data-label="Aksi"] > div,
  .table-wrapper td[data-label="Aksi"] > form {
    width: 100%;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
  }
  .table-wrapper td[data-label="Aksi"] .btn-edit,
  .table-wrapper td[data-label="Aksi"] .btn-hapus,
  .table-wrapper td[data-label="Aksi"] > a,
  .table-wrapper td[data-label="Aksi"] > span {
    flex: 1;
    min-width: 80px;
    justify-content: center;
    text-align: center;
  }

  /* Membership toggle inside card */
  .table-wrapper .membership-toggle {
    width: 100%;
  }
  .table-wrapper td[data-label="Aksi"] > form {
    flex-direction: column;
    gap: 6px;
  }
  .table-wrapper td[data-label="Aksi"] .membership-toggle {
    order: 1;
  }
}

/* --- Small Mobile (≤ 480px) --- */
@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .stat-value {
    font-size: 1.4rem;
  }
  .page-header-text h2 {
    font-size: 1.25rem;
  }
  .auth-card {
    padding: 24px 16px;
  }
  .auth-logo h1 {
    font-size: 1.4rem;
  }
  .toast {
    min-width: unset;
    max-width: calc(100vw - 32px);
    right: 16px;
    left: 16px;
  }
  .toast-container {
    right: 0;
    left: 0;
    bottom: 16px;
    padding: 0 16px;
  }
}
