/* =============================================
   MAILCUAN - Global Styles
   Light: Pure White | Dark: Pure Black
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Poppins:wght@300;400;500;600;700;800&display=swap');

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: auto;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

html.modal-open, body.modal-open {
    overflow: hidden !important;
    height: 100vh !important;
}

:root {
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-light: #dbeafe;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --radius: 14px;
  --radius-sm: 8px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow: 0 2px 16px 0 rgba(0,0,0,0.07);
  --shadow-md: 0 4px 32px 0 rgba(0,0,0,0.12);
}

/* Light Mode */
:root {
  --bg: #ffffff;
  --bg-2: #f8f9fa;
  --bg-3: #f1f3f5;
  --card: #ffffff;
  --border: #e9ecef;
  --border-2: #dee2e6;
  --text: #111827;
  --text-2: #6b7280;
  --text-3: #9ca3af;
}

/* Dark Mode - Comfortable Dark */
.dark {
  --bg: #141414;
  --bg-2: #1c1c1e;
  --bg-3: #242426;
  --card: #1c1c1e;
  --border: #2c2c2e;
  --border-2: #3a3a3c;
  --text: #f5f5f7;
  --text-2: #98989f;
  --text-3: #6c6c70;
  --shadow: 0 2px 16px 0 rgba(0,0,0,0.3);
  --shadow-md: 0 4px 32px 0 rgba(0,0,0,0.4);
}

body {
  font-family: 'Poppins', 'Inter', -apple-system, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--transition), color var(--transition);
  font-size: 14px;
  line-height: 1.6;
}

/* CRITICAL: .hidden utility (replaces Tailwind) */
.hidden { display: none !important; }

/* =============================================
   SCROLLBAR
   ============================================= */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 99px; }

/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}
.shake {
    animation: shake 0.3s ease-in-out;
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4); }
  70% { box-shadow: 0 0 0 12px rgba(37, 99, 235, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes countdownPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
@keyframes rowIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes fabPulse {
  0%, 100% { box-shadow: 0 4px 24px rgba(37,99,235,0.4); }
  50% { box-shadow: 0 4px 40px rgba(37,99,235,0.7); }
}
@keyframes pulse-soft {
  0% { transform: scale(0.95); opacity: 0.5; }
  50% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.5; }
}

.animate-fade-in { animation: fadeIn 0.3s ease-out forwards; }
.animate-fade-in-up { animation: fadeInUp 0.4s ease-out forwards; }
.animate-slide-down { animation: slideDown 0.3s ease-out forwards; }
.animate-scale-in { animation: scaleIn 0.25s ease-out forwards; }
.animate-spin { animation: spin 0.8s linear infinite; }

/* =============================================
   LAYOUT SHELL
   ============================================= */
.app-shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  position: relative;
}

/* =============================================
   NAVBAR
   ============================================= */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: slideDown 0.3s ease-out;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-pic {
  height: 38px;
  object-fit: contain;
}
.logo-text {
  font-family: 'Poppins', sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
  line-height: 1;
}

.navbar-actions { display: flex; gap: 8px; align-items: center; }

/* =============================================
   USER STATS CARD
   ============================================= */
.user-stats-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
  animation: scaleIn 0.3s ease-out;
}

.user-stats-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px dashed var(--border);
}

.user-stats-email {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--bg-2);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
}
.user-stats-email i {
  font-size: 16px;
  color: var(--accent);
}

.user-stats-saldo-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.user-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  padding: 14px 8px;
  border-radius: 12px;
}

.stat-value {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  font-family: 'SF Mono', 'Fira Mono', monospace;
  line-height: 1;
}

.stat-value-large {
  font-size: 34px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -1.5px;
  font-family: 'Poppins', sans-serif;
  line-height: 1;
}

.stat-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1;
}

.stat-item .warn { color: #d97706; }
.stat-item .success { color: #16a34a; }
.stat-item .danger { color: #dc2626; }

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  outline: none;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.55; pointer-events: none; }

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 4px 16px rgba(37,99,235,0.3); }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-3); color: var(--text); }

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

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

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
}

.btn-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  padding: 0;
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-2);
}
.btn-icon:hover { background: var(--bg-2); color: var(--text); }

/* FAB */
.fab {
  position: fixed;
  bottom: 28px;
  right: 50%;
  transform: translateX(50%);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  box-shadow: 0 4px 24px rgba(37,99,235,0.4);
  animation: fabPulse 2.5s ease-in-out infinite;
  transition: all var(--transition);
  z-index: 40;
}
.fab:active { transform: translateX(50%) scale(0.92); }
.fab.fab-fixed-right:active { transform: scale(0.92); }

/* Garapan Badge Dot */
.garapan-badge-dot {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    background: #ff4d4d;
    border: 2px solid #fff;
    border-radius: 10px;
    z-index: 2;
    box-shadow: 0 0 10px rgba(255, 77, 77, 0.5);
    animation: badgePulse 1.5s infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
    color: #fff;
}

/* Choice Modal Badge */
.choice-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 3;
    border: 2px solid var(--card);
}
.badge-gmail-modal {
    color: var(--accent);
    background: rgba(37, 99, 235, 0.1);
    backdrop-filter: blur(4px);
}
.badge-garapan-modal {
    color: #d97706;
    background: rgba(217, 119, 6, 0.1);
    backdrop-filter: blur(4px);
}
.dark .badge-gmail-modal {
    background: rgba(37, 99, 235, 0.2);
    border-color: var(--bg-2);
}
.dark .badge-garapan-modal {
    background: rgba(217, 119, 6, 0.2);
    border-color: var(--bg-2);
}

@keyframes badgePulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 77, 77, 0.7); }
    70% { transform: scale(1.2); box-shadow: 0 0 0 6px rgba(255, 77, 77, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 77, 77, 0); }
}

/* =============================================
   CARD
   ============================================= */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  animation: scaleIn 0.25s ease-out;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.card:hover { border-color: var(--border-2); }

/* =============================================
   FORMS
   ============================================= */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 8px;
}
.form-input {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text);
  outline: none;
  font-family: 'Inter', sans-serif;
  transition: all var(--transition);
}
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,0.12); }
.form-input::placeholder { color: var(--text-3); }
.form-input[readonly] { cursor: default; }

/* =============================================
   BADGE
   ============================================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.badge-blue { background: rgba(37,99,235,0.12); color: #2563eb; border: 1px solid rgba(37,99,235,0.2); }
.dark .badge-blue { background: rgba(37,99,235,0.15); }
.badge-green { background: rgba(22,163,74,0.12); color: #16a34a; border: 1px solid rgba(22,163,74,0.2); }
.dark .badge-green { background: rgba(22,163,74,0.15); }
.badge-red { background: rgba(220,38,38,0.1); color: #dc2626; border: 1px solid rgba(220,38,38,0.2); }
.badge-amber { background: rgba(217,119,6,0.1); color: #d97706; border: 1px solid rgba(217,119,6,0.2); }
.badge-gray { background: var(--bg-3); color: var(--text-2); border: 1px solid var(--border); }

/* =============================================
   TABLE
   ============================================= */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
}
.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text);
  vertical-align: middle;
}
.data-table tbody tr {
  transition: background var(--transition);
  animation: rowIn 0.3s ease-out forwards;
}
.data-table tbody tr:hover { background: var(--bg-2); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* =============================================
   SALDO CHIP
   ============================================= */
.saldo-chip {
  display: flex;
  align-items: center;
  gap: 8px;
}
.saldo-amount {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
}

/* =============================================
   COUNTDOWN TIMER
   ============================================= */
.countdown-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(220,38,38,0.08);
  border: 1px solid rgba(220,38,38,0.2);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  color: #dc2626;
  font-size: 16px;
  font-weight: 800;
  font-family: 'SF Mono', 'Fira Mono', monospace;
}
.dark .countdown-badge { background: rgba(220,38,38,0.12); border-color: rgba(220,38,38,0.3); }

/* =============================================
   VIEWS / SCREENS
   ============================================= */
.view { animation: fadeIn 0.25s ease-out; }
.view.hidden { display: none; }

/* =============================================
   AUTH GATE & LOADING
   ============================================= */

/* =============================================
   LOADING OVERLAY
   ============================================= */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 99990;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  animation: fadeIn 0.2s ease-out;
}

/* =============================================
   TASK SCREEN
   ============================================= */
.task-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 90;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Vertical Steps Styling */
.steps-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 10px;
}

.step-item {
  display: flex;
  gap: 14px;
}

.step-number {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-3);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  border: 1px solid var(--border);
}

.step-content {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
  padding-top: 3px;
}

.step-content strong {
  color: var(--text);
}
.loading-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.loading-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
}

/* =============================================
   TASK CARD ACTIVE
   ============================================= */
.task-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 90;
  overflow-y: auto;
  animation: fadeIn 0.25s ease-out;
  display: flex;
  flex-direction: column;
}
.task-screen-inner {
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 0 0 32px;
}
.task-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 5;
}

/* =============================================
   TOAST
   ============================================= */
.toast-container {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: calc(100% - 32px);
  max-width: 360px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  animation: fadeInUp 0.3s ease-out;
  transition: all 0.3s ease;
  pointer-events: all;
  backdrop-filter: blur(8px);
}
.toast-success { background: var(--card); border: 1px solid var(--border); color: var(--text); }
.dark .toast-success { background: #181818; border-color: #2a2a2a; }
.toast-error { background: #fff0f0; border: 1px solid #fecaca; color: #991b1b; }
.dark .toast-error { background: #1a0000; border-color: #7f1d1d; color: #fca5a5; }

/* =============================================
   DIVIDER
   ============================================= */
.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* =============================================
   ADMIN SPECIFIC
   ============================================= */
.admin-shell {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 16px;
}

/* =============================================
   AUTH PAGE
   ============================================= */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  background: var(--bg);
}
.auth-card { width: 100%; max-width: 380px; }
.auth-logo {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--accent);
  text-align: center;
  margin-bottom: 4px;
}
.auth-subtitle {
  font-size: 13px;
  color: var(--text-2);
  text-align: center;
  margin-bottom: 28px;
}

/* =============================================
   EMPTY STATE
   ============================================= */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  color: var(--text-3);
  gap: 10px;
}
.empty-state-icon { font-size: 40px; }
.empty-state-text { font-size: 13px; font-weight: 500; }

/* =============================================
   COPY BUTTON
   ============================================= */
.input-group {
  display: flex;
  gap: 8px;
}
.input-group .form-input { flex: 1; }
.copy-btn {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all var(--transition);
}
.copy-btn:hover { background: var(--bg-2); color: var(--text); border-color: var(--border-2); }
.copy-btn:active { transform: scale(0.92); }

/* =============================================
   STATUS ICONS
   ============================================= */
.status-success { color: var(--success); font-weight: 700; font-size: 12px; }
.status-antrean { color: var(--warning); font-weight: 700; font-size: 12px; }
.status-reject { color: var(--danger); font-weight: 700; font-size: 12px; }
.status-revision { color: var(--accent); font-weight: 700; font-size: 12px; }
.status-cancel { color: var(--text-3); font-weight: 700; font-size: 12px; }
.status-proses { color: var(--accent); font-weight: 700; font-size: 12px; }

.status-revision-btn {
    background: rgba(37, 99, 235, 0.1);
    color: var(--accent);
    border: 1px solid rgba(37, 99, 235, 0.2);
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 11.5px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s;
}
.status-revision-btn:hover {
    background: var(--accent);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.revision-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--accent);
    border: 1px solid rgba(37, 99, 235, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}
.revision-btn:hover {
    background: var(--accent);
    color: #fff;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (min-width: 640px) {
  .fab.fab-center {
    right: auto;
    left: 50%;
    transform: translateX(calc(-50% + 200px));
  }
  .fab.fab-center:active { transform: translateX(calc(-50% + 200px)) scale(0.92); }
}

/* =============================================
   CUSTOM MODAL (Alert / Confirm)
   ============================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 10000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 0 16px;
  animation: fadeIn 0.2s ease-out;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.modal-overlay.center { align-items: center; padding: 20px; }

.modal-card {
  background: var(--card);
  border: 1px solid var(--border-2);
  border-radius: var(--radius) var(--radius) 12px 12px;
  width: 100%;
  max-width: 480px;
  padding: 24px 20px 12px;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.25);
  animation: modalUp 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.modal-overlay.center .modal-card {
  border-radius: var(--radius);
  animation: scaleIn 0.25s cubic-bezier(0.34,1.38,0.64,1);
  box-shadow: var(--shadow-md);
}

@keyframes modalUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin: 0 auto 14px;
}
.modal-icon.success { background: rgba(22,163,74,0.12); color: #16a34a; }
.modal-icon.danger  { background: rgba(220,38,38,0.1);  color: #dc2626; }
.modal-icon.warning { background: rgba(217,119,6,0.1);  color: #d97706; }
.modal-icon.info    { background: rgba(37,99,235,0.1);  color: #2563eb; }

.modal-title {
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  color: var(--text);
  margin-bottom: 8px;
}
.modal-body {
  font-size: 13px;
  color: var(--text-2);
  text-align: center;
  line-height: 1.7;
  margin-bottom: 20px;
}
.modal-actions {
  display: grid;
  gap: 8px;
}
.modal-actions.two { grid-template-columns: 1fr 1fr; }

/* =============================================
   ACTIVE TASK BANNER (shown when minimized)
   ============================================= */
.task-active-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(37,99,235,0.08);
  border: 1px solid rgba(37,99,235,0.2);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 14px;
  cursor: pointer;
  transition: all var(--transition);
  animation: fadeInUp 0.3s ease-out;
}
.task-active-banner:hover { background: rgba(37,99,235,0.13); }
.task-active-banner.hidden { display: none; }

.task-banner-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.task-banner-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse-ring 2s infinite;
  flex-shrink: 0;
}
.task-banner-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}
.task-banner-timer {
  font-size: 13px;
  font-weight: 800;
  color: var(--accent);
  font-family: 'SF Mono', monospace;
}

/* Rules Section Accordion */
.rules-card { margin-bottom: 20px; padding: 0 !important; overflow: hidden; }

.rules-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text);
    font-family: inherit;
    transition: background 0.2s ease;
}
.rules-toggle:hover { background: var(--hover); }

.rules-badge {
    font-size: 10px;
    font-weight: 700;
    background: rgba(var(--accent-rgb, 99,102,241), 0.1);
    color: var(--accent);
    padding: 3px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid rgba(var(--accent-rgb, 99,102,241), 0.2);
}

.rules-caret {
    font-size: 16px;
    color: var(--text-3);
    transition: transform 0.3s ease;
}
.rules-caret.open { transform: rotate(180deg); }

/* Collapsible body - smooth max-height animation */
.rules-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}
.rules-body.open { max-height: 2000px; }

.rules-inner {
    padding: 0 14px 14px;
    display: grid;
    gap: 6px;
    border-top: 1px solid var(--border);
    padding-top: 12px;
}

.rules-group-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--accent);
    margin-top: 4px;
    margin-bottom: 2px;
}
.rules-group-label.danger-label { color: var(--danger); }

.rule-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: var(--hover);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 13px;
    color: var(--text-2);
    line-height: 1.55;
    transition: background 0.15s ease;
}
.rule-item i {
    font-size: 17px;
    color: var(--accent);
    flex-shrink: 0;
    margin-top: 1px;
}
.rule-item strong { color: var(--text); }
.rule-item.warn {
    border-color: rgba(234, 179, 8, 0.25);
    background: rgba(234, 179, 8, 0.04);
}
.rule-item.warn i { color: #ca8a04; }
.rule-item.danger {
    border-color: rgba(220, 38, 38, 0.25);
    background: rgba(220, 38, 38, 0.04);
}
.rule-item.danger i { color: var(--danger); }

/* =============================================
   RULES MODAL TABS
   ============================================= */

/* Tab Bar */

.rtab-bar {
    display: flex;
    gap: 4px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.rtab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px 6px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: transparent;
    color: var(--text-3);
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}
.rtab:hover { background: var(--hover); color: var(--text-2); }
.rtab.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.rtab i { font-size: 14px; }

/* Tab Panels */
.rtab-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.rtab-panel {
    display: none;
    flex-direction: column;
    gap: 8px;
    animation: fadeInUp 0.25s ease;
}
.rtab-panel.active { display: flex; }
/* =============================================
   ADMIN TABS SYSTEM
   ============================================= */
.admin-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-2);
  padding: 4px;
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
  border: 1px solid var(--border);
  overflow-x: auto;
  white-space: nowrap;
  position: sticky;
  top: 60px;
  z-index: 45;
}
.tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  background: transparent;
}
.tab-btn i { font-size: 18px; }
.tab-btn:hover { color: var(--text); background: var(--bg-3); }
.tab-btn.active {
  background: var(--card);
  color: var(--accent);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.dark .tab-btn.active {
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s ease-out;
}
.tab-content.active {
  display: block;
}

/* Database Table Specific */
.db-status {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}
.db-status.success { background: rgba(22,163,74,0.1); color: #16a34a; }
.db-status.reject { background: rgba(220,38,38,0.1); color: #dc2626; }
.db-status.antrean { background: rgba(37,99,235,0.1); color: #2563eb; }

.stat-grid-admin {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (max-width: 768px) {
  .admin-tabs {
    position: sticky;
    top: 60px;
    margin: 0 -16px 20px;
    border-radius: 0;
    border-left: none;
    border-right: none;
    padding: 6px 12px;
  }
  .tab-btn {
    padding: 8px 12px;
    font-size: 12px;
  }
  .tab-btn i { font-size: 16px; }
  
  .stat-grid-admin {
    display: flex !important;
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    margin: 0 -16px 20px !important;
    padding: 4px 16px 12px !important;
    gap: 12px !important;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .stat-grid-admin::-webkit-scrollbar { display: none; }
  .stat-grid-admin > div {
    flex: 0 0 140px;
  }
  
  .data-table td, .data-table th {
    padding: 10px 12px;
    font-size: 12px;
  }
}

.admin-shell {
  min-height: calc(100vh - 100px);
  padding-bottom: 100px;
}


