/* -------------------------------------------------------------
 * Adrian Budiasna - Private Admin & Owner Dashboard Stylesheet
 * v3.1 — Fixes: Mobile Responsive, box-sizing, modal transitions,
 *         sidebar mobile, chart grid, search hub input, stop robot btn
 * ----------------------------------------------------------- */

:root {
  --adm-bg: #090d16;
  --adm-sidebar: #0f172a;
  --adm-surface: #1e293b;
  --adm-border: rgba(255, 255, 255, 0.08);
  --adm-primary: #3b82f6;
  --adm-accent: #06b6d4;
  --adm-emerald: #10b981;
  --adm-amber: #f59e0b;
  --adm-rose: #f43f5e;
  --adm-text: #f8fafc;
  --adm-muted: #94a3b8;
}

body.admin-body {
  background: var(--adm-bg);
  background-image: radial-gradient(rgba(59, 130, 246, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
  color: var(--adm-text);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  min-height: 100vh;
  margin: 0;
  display: flex;
}

/* Auth Overlay / PIN Gate */
.auth-gate-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 15%, rgba(30, 58, 138, 0.22) 0%, rgba(9, 13, 22, 0.98) 75%);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 1rem 1.25rem 2.5rem;
  overflow-y: auto;
}

/* Auth Top Navigation Bar di Atas */
.auth-gate-topbar {
  width: 100%;
  max-width: 1100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.5rem 1.25rem;
  margin-bottom: auto;
}

.auth-topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--adm-text);
  transition: opacity 0.2s ease;
}

.auth-topbar-brand:hover {
  opacity: 0.9;
}

.auth-brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(6, 182, 212, 0.2));
  border: 1px solid rgba(59, 130, 246, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #60a5fa;
  font-size: 1.1rem;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
}

.auth-brand-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.auth-brand-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}

.auth-brand-deg {
  color: #60a5fa;
  font-weight: 700;
}

.auth-brand-sub {
  font-size: 0.73rem;
  color: var(--adm-muted);
}

.auth-topbar-links {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.auth-topbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.85rem;
  border-radius: 9px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--adm-muted);
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--adm-border);
  text-decoration: none;
  transition: all 0.2s ease;
}

.auth-topbar-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Auth Card */
.auth-card {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  max-width: 500px;
  width: 100%;
  padding: 2.25rem 2.25rem 2rem;
  text-align: center;
  box-shadow: 0 30px 70px -15px rgba(0, 0, 0, 0.8), 0 0 45px rgba(59, 130, 246, 0.12);
  position: relative;
  margin: auto;
  box-sizing: border-box;
}

.auth-badge-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #93c5fd;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}

.auth-lock-icon {
  width: 62px;
  height: 62px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(6, 182, 212, 0.15));
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: var(--adm-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  margin: 0 auto 0.9rem;
  animation: pulse-glow 2.5s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4); }
  50% { box-shadow: 0 0 0 12px rgba(59, 130, 246, 0); }
}

/* Auth Gateway Nav Tabs (Segmented 3-Column Pill Control) */
.auth-nav-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: rgba(2, 6, 23, 0.65);
  padding: 5px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  gap: 5px;
  margin-bottom: 1.4rem;
}

.auth-tab-btn {
  padding: 0.65rem 0.35rem;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--adm-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-family: inherit;
  white-space: nowrap;
}

.auth-tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.auth-tab-btn.active {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
}

.auth-tab-btn i {
  font-size: 0.88rem;
}

.auth-view {
  display: none !important;
}

.auth-view.active {
  display: block !important;
  animation: authFadeIn 0.25s ease-out;
}

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

.auth-form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--adm-muted);
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.auth-input {
  width: 100%;
  box-sizing: border-box;
}

/* Password input with toggle button */
.pwd-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.pwd-input-wrap input {
  width: 100%;
  padding-right: 2.75rem !important;
  box-sizing: border-box;
}

.pwd-toggle-btn {
  position: absolute;
  right: 0.6rem;
  background: transparent;
  border: none;
  color: var(--adm-muted);
  padding: 0.4rem 0.5rem;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pwd-toggle-btn:hover {
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.15);
}

/* Biometric button & divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--adm-border);
}

.auth-divider span {
  font-size: 0.72rem;
  color: var(--adm-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.btn-biometric {
  width: 100%;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(6, 182, 212, 0.15));
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  transition: all 0.25s ease;
  font-family: inherit;
}

.btn-biometric:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.28), rgba(6, 182, 212, 0.28));
  border-color: #34d399;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.35);
  transform: translateY(-1px);
}

.auth-alert-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  font-size: 0.82rem;
  padding: 0.55rem 0.8rem;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  text-align: left;
}

/* Biometric HUD Dialog & Animation */
.biometric-hud-dialog {
  background: var(--adm-sidebar);
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 20px;
  max-width: 380px;
  width: 100%;
  padding: 2.25rem 2rem;
  text-align: center;
  box-shadow: 0 0 40px rgba(16, 185, 129, 0.25);
  animation: authFadeIn 0.3s ease;
}

.biometric-scanner-ring {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 2px dashed #10b981;
  background: rgba(16, 185, 129, 0.08);
  margin: 0 auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.3);
}

.biometric-icon-large {
  font-size: 3rem;
  color: #34d399;
  animation: pulseBio 2s infinite ease-in-out;
}

.biometric-laser-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #34d399, #10b981, transparent);
  box-shadow: 0 0 8px #34d399;
  animation: laserScan 2s ease-in-out infinite alternate;
}

@keyframes laserScan {
  0% { top: 5%; }
  100% { top: 92%; }
}

@keyframes pulseBio {
  0%, 100% { transform: scale(0.96); opacity: 0.85; }
  50% { transform: scale(1.04); opacity: 1; }
}

.biometric-pulse-loader {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.biometric-loader-fill {
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, #10b981, #06b6d4);
  border-radius: 999px;
  animation: loaderSlide 1.5s infinite ease-in-out;
}

@keyframes loaderSlide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}

/* Client Portal Packages Card */
.client-pkg-card {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--adm-border);
  border-radius: 14px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.25s ease;
}

.client-pkg-card:hover {
  transform: translateY(-4px);
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

/* ---- Sidebar Toggle Button (Mobile) ---- */
.sidebar-mobile-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 9990;
  background: var(--adm-surface);
  border: 1px solid var(--adm-border);
  color: var(--adm-text);
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.2s;
}
.sidebar-mobile-toggle:hover { background: var(--adm-primary); }

/* Sidebar */
.admin-sidebar {
  width: 280px;
  background: var(--adm-sidebar);
  border-right: 1px solid var(--adm-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  min-height: 100vh;
  transition: transform 0.3s ease, width 0.3s ease;
}

.sidebar-header {
  padding: 1.8rem 1.5rem;
  border-bottom: 1px solid var(--adm-border);
}

.sidebar-brand {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.role-badge-pill {
  font-size: 0.72rem;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-weight: 700;
  text-transform: uppercase;
}

.role-admin { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.role-owner { background: rgba(239, 68, 68, 0.2); color: #f87171; }

.sidebar-menu {
  list-style: none;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-grow: 1;
  margin: 0;
}

.menu-item-btn {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--adm-muted);
  padding: 0.8rem 1rem;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  transition: all 0.2s ease;
}

.menu-item-btn:hover, .menu-item-btn.active {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.sidebar-footer {
  padding: 1.25rem;
  border-top: 1px solid var(--adm-border);
}

/* Main Content Area */
.admin-main {
  flex-grow: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2.5rem;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.topbar-title h2 {
  font-size: 1.8rem;
  margin-bottom: 0.25rem;
}

.topbar-title p {
  color: var(--adm-muted);
  font-size: 0.9rem;
}

/* Stat KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.kpi-card {
  background: var(--adm-surface);
  border: 1px solid var(--adm-border);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.kpi-card:hover {
  border-color: rgba(59, 130, 246, 0.3);
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.1);
}

.kpi-icon {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.kpi-icon.blue { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.kpi-icon.emerald { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.kpi-icon.amber { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.kpi-icon.purple { background: rgba(168, 85, 247, 0.15); color: #c084fc; }

.kpi-info h4 {
  font-size: 1.75rem;
  font-weight: 800;
  margin: 0 0 0.15rem;
  transition: color 0.3s;
}

.kpi-info span {
  font-size: 0.85rem;
  color: var(--adm-muted);
}

/* Data Table */
.data-card {
  background: var(--adm-surface);
  border: 1px solid var(--adm-border);
  border-radius: 16px;
  padding: 1.75rem;
  margin-bottom: 2rem;
}

.card-header-flex {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.adm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  min-width: 600px;
}

.adm-table th {
  text-align: left;
  padding: 0.85rem 1rem;
  background: rgba(15, 23, 42, 0.5);
  color: var(--adm-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--adm-border);
  white-space: nowrap;
}

.adm-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--adm-border);
  vertical-align: middle;
}

.adm-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.action-btns {
  display: flex;
  gap: 0.5rem;
}

.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--adm-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--adm-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: var(--adm-primary);
  color: #ffffff;
  border-color: transparent;
}

/* Diagnostics & SQL Backup Boxes (Owner Role) */
.owner-diagnostic-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.terminal-box {
  background: #020617;
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 1.25rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  color: #38bdf8;
  line-height: 1.7;
  max-height: 280px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.terminal-box::-webkit-scrollbar { width: 4px; }
.terminal-box::-webkit-scrollbar-thumb { background: #1e3a5f; border-radius: 4px; }

/* Admin Modals */
.adm-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 13, 22, 0.88);
  backdrop-filter: blur(14px);
  z-index: 10005;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.adm-modal-dialog {
  background: var(--adm-sidebar);
  border: 1px solid var(--adm-primary);
  border-radius: 18px;
  max-width: 700px;
  width: 100%;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  animation: modal-slide-in 0.25s ease;
}

@keyframes modal-slide-in {
  from { opacity: 0; transform: translateY(-20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.adm-modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--adm-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.adm-modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.adm-modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--adm-border);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background: rgba(10, 15, 29, 0.5);
  flex-wrap: wrap;
}

/* Modal Close Button */
.modal-close-btn {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--adm-border);
  color: var(--adm-muted);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.3rem;
  line-height: 1;
  padding: 0;
  transition: all 0.2s;
}
.modal-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
  color: #f87171;
}

.adm-form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.adm-form-group {
  margin-bottom: 1.1rem;
}

.adm-form-group label {
  display: block;
  font-size: 0.82rem;
  color: var(--adm-muted);
  margin-bottom: 0.35rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* FIX: box-sizing so inputs never overflow their container */
.adm-form-control {
  width: 100%;
  box-sizing: border-box;
  background: #090d16;
  border: 1px solid var(--adm-border);
  border-radius: 8px;
  color: var(--adm-text);
  padding: 0.65rem 0.85rem;
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.adm-form-control:focus {
  outline: none;
  border-color: var(--adm-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.adm-form-control option {
  background: #0f172a;
}

/* Search input for File Hub */
.files-hub-search {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  align-items: center;
  flex-wrap: wrap;
}

.files-hub-search input {
  flex: 1;
  min-width: 200px;
  box-sizing: border-box;
  background: #090d16;
  border: 1px solid var(--adm-border);
  border-radius: 8px;
  color: var(--adm-text);
  padding: 0.6rem 0.85rem;
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color 0.2s;
}

.files-hub-search input:focus {
  outline: none;
  border-color: var(--adm-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Analytics Metric Meters */
.chart-bar-item {
  margin-bottom: 1.25rem;
}

.chart-bar-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.chart-meter-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
}

.chart-meter-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.8s ease;
}

.fill-blue    { background: linear-gradient(90deg, #2563eb, #38bdf8); }
.fill-emerald { background: linear-gradient(90deg, #059669, #34d399); }
.fill-amber   { background: linear-gradient(90deg, #d97706, #fbbf24); }
.fill-purple  { background: linear-gradient(90deg, #7c3aed, #c084fc); }
.fill-rose    { background: linear-gradient(90deg, #e11d48, #fb7185); }

/* Billing Invoice Receipt */
.invoice-slip {
  background: #090d16;
  border: 1px dashed var(--adm-border);
  border-radius: 12px;
  padding: 1.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
}

.invoice-header {
  border-bottom: 1px dashed var(--adm-border);
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 600;
}
.badge-primary { background: rgba(59,130,246,0.15); color: #60a5fa; }
.badge-success { background: rgba(16,185,129,0.15); color: #34d399; }
.badge-warning { background: rgba(245,158,11,0.15); color: #fbbf24; }
.badge-danger  { background: rgba(244,63,94,0.15);  color: #fb7185; }

/* Shared Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
  text-decoration: none;
  font-family: inherit;
  white-space: nowrap;
}
.btn-sm { padding: 0.35rem 0.85rem; font-size: 0.82rem; border-radius: 8px; }
.btn-primary   { background: var(--adm-primary); color: #fff; border-color: var(--adm-primary); }
.btn-primary:hover { background: #2563eb; }
.btn-secondary { background: rgba(255,255,255,0.07); color: var(--adm-text); border-color: var(--adm-border); }
.btn-secondary:hover { background: rgba(255,255,255,0.14); }
.btn-danger    { background: rgba(244,63,94,0.15); color: #fb7185; border-color: rgba(244,63,94,0.3); }
.btn-danger:hover { background: rgba(244,63,94,0.3); }
.btn-stop      { background: rgba(244,63,94,0.15); color: #f87171; border-color: rgba(244,63,94,0.3); }
.btn-stop:hover { background: rgba(244,63,94,0.3); }

/* ZIP Export status badge */
.zip-status-badge {
  display: inline-block;
  font-size: 0.78rem;
  color: var(--adm-muted);
  margin-top: 0.5rem;
}

/* ============================================================
   RESPONSIVE — Mobile & Tablet
   ============================================================ */
@media (max-width: 900px) {
  .sidebar-mobile-toggle { display: flex; }

  .admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9980;
    transform: translateX(-100%);
    height: 100vh;
    overflow-y: auto;
  }

  .admin-sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.6);
  }

  .admin-main {
    padding: 1.25rem;
    padding-top: 4rem; /* space for toggle button */
  }

  .admin-topbar { flex-direction: column; align-items: flex-start; }
  .topbar-title h2 { font-size: 1.4rem; }

  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 1rem; }
}

@media (max-width: 600px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .adm-form-grid-2 { grid-template-columns: 1fr; }
  .adm-modal-dialog { margin: 0.5rem; border-radius: 14px; }
}

@media (max-width: 520px) {
  .auth-card {
    padding: 1.75rem 1.2rem 1.5rem;
    border-radius: 18px;
    margin-top: 0.5rem;
  }
  .auth-nav-tabs {
    gap: 3px;
    padding: 3px;
  }
  .auth-tab-btn {
    padding: 0.55rem 0.2rem;
    font-size: 0.76rem;
    gap: 0.3rem;
  }
  .auth-tab-btn i {
    font-size: 0.78rem;
  }
  .auth-topbar-brand .auth-brand-sub {
    display: none;
  }
  .auth-topbar-btn span {
    display: none;
  }
  .auth-topbar-btn {
    padding: 0.45rem 0.65rem;
  }
}

/* Analytics & Diagnostics grids */
@media (max-width: 800px) {
  .analytics-double-grid,
  .owner-diagnostic-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Print styles for Invoice */
@media print {
  .admin-sidebar,
  .admin-topbar,
  .kpi-grid,
  .sidebar-mobile-toggle,
  .adm-modal-footer { display: none !important; }
  .invoice-slip {
    border: 1px solid #333;
    color: #000;
    background: #fff;
  }
}
