/* ===================================================================
   SIM-RT AAS: SISTEM INFORMASI RUMAH TANGGA AKADEMI AKUPUNKTUR SURABAYA
   DESIGN SYSTEM & MODERN STYLING
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Color Tokens - Light Mode (Default) */
  --primary-50: #f0fdfa;
  --primary-100: #ccfbf1;
  --primary-200: #99f6e4;
  --primary-500: #14b8a6;
  --primary-600: #0d9488;
  --primary-700: #0f766e;
  --primary-800: #115e59;
  --primary-900: #134e4a;

  --accent-50: #fffbeb;
  --accent-500: #f59e0b;
  --accent-600: #d97706;
  --accent-700: #b45309;

  --success-bg: #ecfdf5;
  --success-text: #047857;
  --warning-bg: #fffbeb;
  --warning-text: #b45309;
  --danger-bg: #fef2f2;
  --danger-text: #b91c1c;
  --info-bg: #eff6ff;
  --info-text: #1d4ed8;

  --bg-app: #f8fafc;
  --bg-sidebar: #0f172a;
  --bg-card: #ffffff;
  --bg-card-subtle: #f8fafc;
  --bg-glass: rgba(255, 255, 255, 0.85);

  --border-color: #e2e8f0;
  --border-light: #f1f5f9;
  --border-focus: #0d9488;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --text-on-primary: #ffffff;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --sidebar-width: 270px;
  --header-height: 72px;
  --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

/* Dark Mode Tokens */
[data-theme="dark"] {
  --bg-app: #0b1120;
  --bg-sidebar: #070d18;
  --bg-card: #131d31;
  --bg-card-subtle: #18243c;
  --bg-glass: rgba(19, 29, 49, 0.9);

  --border-color: #24324f;
  --border-light: #1c2a44;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5);

  --success-bg: rgba(6, 95, 70, 0.25);
  --success-text: #34d399;
  --warning-bg: rgba(180, 83, 9, 0.25);
  --warning-text: #fbbf24;
  --danger-bg: rgba(185, 28, 28, 0.25);
  --danger-text: #f87171;
  --info-bg: rgba(29, 78, 216, 0.25);
  --info-text: #60a5fa;
}

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

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Layout Structure - Pinned App Shell */
.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  position: relative;
}

/* Sidebar Styling - Full Height Rigid Panel */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  max-width: var(--sidebar-width);
  height: 100vh;
  background-color: var(--bg-sidebar);
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 100;
  overflow: hidden;
  transition: margin-left var(--transition-normal), transform var(--transition-normal);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

/* Collapsed Sidebar on Desktop */
.app-container.sidebar-collapsed .sidebar {
  margin-left: calc(-1 * var(--sidebar-width));
}

/* Sidebar Mobile Backdrop */
.sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 95;
}

.sidebar-brand {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(13, 148, 136, 0.12) 0%, transparent 100%);
}

.brand-icon-wrapper {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 4px;
  flex-shrink: 0;
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform var(--transition-fast);
}

.brand-logo-img:hover {
  transform: scale(1.08);
}

.topbar-logo-badge {
  width: 36px;
  height: 36px;
  object-fit: contain;
  background: #ffffff;
  border-radius: var(--radius-sm);
  padding: 3px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.brand-info h2 {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #ffffff;
  line-height: 1.2;
}

.brand-info p {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary-200);
  letter-spacing: 0.3px;
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 20px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Custom Sleek Scrollbar for Sidebar */
.sidebar-nav::-webkit-scrollbar {
  width: 5px;
}
.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: var(--primary-500);
}

.nav-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #64748b;
  padding: 12px 14px 6px;
  margin-top: 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  color: #94a3b8;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  cursor: pointer;
  border: 1px solid transparent;
}

.nav-link i {
  font-size: 17px;
  width: 22px;
  text-align: center;
  transition: transform var(--transition-fast);
}

.nav-link:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.06);
}

.nav-link:hover i {
  transform: scale(1.15);
}

.nav-link.active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.85), rgba(15, 118, 110, 0.95));
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.nav-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.nav-badge.danger {
  background: #ef4444;
}

.nav-badge.warning {
  background: #f59e0b;
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px;
  border-radius: var(--radius-md);
  transition: background-color var(--transition-fast);
}

.user-card:hover {
  background-color: rgba(255, 255, 255, 0.06);
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary-600);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
}

.user-meta {
  min-width: 0;
  flex: 1;
}

.user-meta h4 {
  font-size: 12.5px;
  font-weight: 700;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-meta p {
  font-size: 11px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Main Content Area - Scroll Container */
.main-wrapper {
  flex: 1;
  min-width: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  background-color: var(--bg-app);
}

.main-wrapper::-webkit-scrollbar {
  width: 8px;
}
.main-wrapper::-webkit-scrollbar-track {
  background: transparent;
}
.main-wrapper::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
.main-wrapper::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

.app-container.sidebar-collapsed .main-wrapper {
  width: 100%;
}

/* Header Bar - Sticky at Top of Main Wrapper */
.topbar {
  height: var(--header-height);
  min-height: var(--header-height);
  background-color: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 90;
  gap: 12px;
  flex-shrink: 0;
}

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

.mobile-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 16px;
  color: var(--text-main);
  cursor: pointer;
  padding: 0;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.mobile-menu-btn:hover {
  background-color: var(--bg-card-subtle);
  border-color: var(--primary-600);
  color: var(--primary-600);
}

.page-title-box {
  min-width: 0;
  overflow: hidden;
}

.page-title-box h1 {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-title-box p {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Cloud Firestore & Cloudflare Sync Status Badge */
.cloud-sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

[data-theme="dark"] .cloud-sync-pill {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.35);
}

.cloud-sync-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.cloud-sync-pill .sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.cloud-sync-pill.syncing {
  background: rgba(234, 179, 8, 0.14);
  color: #d97706;
  border-color: rgba(234, 179, 8, 0.35);
}

.cloud-sync-pill.syncing .sync-dot {
  background: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
  animation: pulseSync 1s infinite alternate;
}

.cloud-sync-pill.warning {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
  border-color: rgba(245, 158, 11, 0.3);
}

.cloud-sync-pill.warning .sync-dot {
  background: #f59e0b;
  box-shadow: none;
}

.cloud-sync-pill.offline,
.cloud-sync-pill.error {
  background: rgba(100, 116, 139, 0.12);
  color: #64748b;
  border-color: rgba(100, 116, 139, 0.3);
}

.cloud-sync-pill.offline .sync-dot,
.cloud-sync-pill.error .sync-dot {
  background: #94a3b8;
  box-shadow: none;
}

@keyframes pulseSync {
  0% { transform: scale(0.85); opacity: 0.7; }
  100% { transform: scale(1.25); opacity: 1; }
}

.live-clock {
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-clock span.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.btn-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  background-color: var(--bg-card-subtle);
  border-color: var(--primary-600);
  color: var(--primary-600);
}

/* Page Container */
.page-content {
  padding: 28px;
  flex: 1;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.25s ease-in-out;
}

.tab-pane.active {
  display: block;
}

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

/* Section Header & Actions */
.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.view-header-info h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.4px;
}

.view-header-info p {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.view-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Button Component */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(13, 148, 136, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
  box-shadow: 0 6px 14px rgba(13, 148, 136, 0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--bg-card);
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-secondary:hover {
  background-color: var(--bg-card-subtle);
  border-color: var(--text-muted);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent-500), var(--accent-600));
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.25);
}

.btn-accent:hover {
  background: linear-gradient(135deg, #fbbf24, var(--accent-500));
  transform: translateY(-1px);
}

.btn-danger {
  background-color: #ef4444;
  color: #fff;
}

.btn-danger:hover {
  background-color: #dc2626;
}

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

/* Stat Cards Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

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

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary-600);
}

.stat-card.accent::before { background: var(--accent-500); }
.stat-card.warning::before { background: #f59e0b; }
.stat-card.danger::before { background: #ef4444; }
.stat-card.success::before { background: #10b981; }

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.stat-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background-color: var(--primary-50);
  color: var(--primary-700);
}

[data-theme="dark"] .stat-icon {
  background-color: rgba(13, 148, 136, 0.15);
  color: var(--primary-200);
}

.stat-card.accent .stat-icon {
  background-color: var(--accent-50);
  color: var(--accent-600);
}
[data-theme="dark"] .stat-card.accent .stat-icon {
  background-color: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.stat-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
  font-family: var(--font-mono);
  margin-bottom: 6px;
}

.stat-footer {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Card Wrapper */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 16px;
}

.card-title {
  font-size: 16.5px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title i {
  color: var(--primary-600);
}

/* Grid Layouts */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

/* Filter & Search Bar */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 360px;
}

.search-input-wrapper i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 14px;
}

.search-input {
  width: 100%;
  padding: 8px 14px 8px 38px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-main);
  font-size: 13px;
  outline: none;
  transition: border-color var(--transition-fast);
}

.search-input:focus {
  border-color: var(--primary-600);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.select-control {
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-main);
  font-size: 12.5px;
  outline: none;
  cursor: pointer;
}

.select-control:focus {
  border-color: var(--primary-600);
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
}

.table-responsive::-webkit-scrollbar {
  height: 7px;
}

.table-responsive::-webkit-scrollbar-track {
  background: var(--bg-card-subtle);
  border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

[data-theme="dark"] .table-responsive::-webkit-scrollbar-thumb {
  background: #334155;
}

[data-theme="dark"] .table-responsive::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.data-table th {
  background-color: var(--bg-card-subtle);
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-main);
  vertical-align: middle;
}

.data-table th:last-child,
.data-table td:last-child {
  white-space: nowrap;
}

.data-table tbody tr {
  transition: background-color var(--transition-fast);
}

.data-table tbody tr:hover {
  background-color: var(--primary-50);
}

[data-theme="dark"] .data-table tbody tr:hover {
  background-color: rgba(13, 148, 136, 0.08);
}

.data-table td.mono {
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.data-table td.text-right, .data-table th.text-right {
  text-align: right;
}

.data-table td.text-center, .data-table th.text-center {
  text-align: center;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.badge-success {
  background-color: var(--success-bg);
  color: var(--success-text);
}

.badge-warning {
  background-color: var(--warning-bg);
  color: var(--warning-text);
}

.badge-danger {
  background-color: var(--danger-bg);
  color: var(--danger-text);
}

.badge-info {
  background-color: var(--info-bg);
  color: var(--info-text);
}

.badge-neutral {
  background-color: var(--border-color);
  color: var(--text-muted);
}

/* Progress Bar */
.progress-bar-container {
  width: 100%;
  height: 8px;
  background-color: var(--border-color);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin: 6px 0;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--primary-600), var(--primary-500));
  transition: width 0.5s ease;
}

.progress-bar-fill.warning {
  background: linear-gradient(90deg, var(--accent-500), #f59e0b);
}

.progress-bar-fill.danger {
  background: linear-gradient(90deg, #ef4444, #dc2626);
}

/* Cash Opname Cash Counter Box */
.cash-count-table {
  width: 100%;
  border-collapse: collapse;
}

.cash-count-table th, .cash-count-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
}

.cash-count-input {
  width: 90px;
  padding: 6px 8px;
  text-align: center;
  font-family: var(--font-mono);
  font-weight: 600;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-main);
}

.cash-count-input:focus {
  border-color: var(--primary-600);
  outline: none;
}

/* Modal Popup System */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-backdrop.active {
  display: flex;
}

.modal-dialog {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  animation: modalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.modal-dialog.modal-lg {
  max-width: 880px;
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes modalStaticBounce {
  0% { transform: scale(1); }
  25% { transform: scale(1.025); }
  50% { transform: scale(0.985); }
  75% { transform: scale(1.01); }
  100% { transform: scale(1); }
}

.modal-dialog.modal-static-bounce {
  animation: modalStaticBounce 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-card-subtle);
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.modal-close-btn:hover {
  color: #ef4444;
  background-color: var(--border-color);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  background-color: var(--bg-card-subtle);
}

/* Form Controls in Modal & Pages */
.form-group {
  margin-bottom: 16px;
  min-width: 0;
}

.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

.form-label span.req {
  color: #ef4444;
}

.sub-label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.form-control {
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-main);
  font-size: 13.5px;
  outline: none;
  transition: all var(--transition-fast);
}

.form-control:focus {
  border-color: var(--primary-600);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

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

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  min-width: 0;
}

.form-row-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  min-width: 0;
}

/* Settings Official Cards */
.settings-officials-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 1024px) {
  .settings-officials-grid {
    grid-template-columns: 1fr;
  }
}

.settings-official-box {
  background: var(--bg-card-subtle);
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.settings-official-box:hover {
  border-color: var(--primary-500);
  box-shadow: var(--shadow-sm);
}

.official-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.official-box-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--primary-700);
  display: flex;
  align-items: center;
  gap: 8px;
}

[data-theme="dark"] .official-box-title {
  color: var(--primary-200);
}

.settings-footer-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
  gap: 16px;
}

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

.toast {
  background-color: var(--bg-sidebar);
  color: #ffffff;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  font-weight: 500;
  border-left: 4px solid var(--primary-500);
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  min-width: 300px;
}

.toast.success { border-left-color: #10b981; }
.toast.danger { border-left-color: #ef4444; }
.toast.warning { border-left-color: #f59e0b; }

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

/* ===================================================================
   PRINT PREVIEW & KOP SURAT RESMI AKADEMI AKUPUNKTUR SURABAYA
   =================================================================== */
#print-container {
  display: none;
}

@media print {
  html, body, .app-container, .main-wrapper {
    height: auto !important;
    overflow: visible !important;
    width: 100% !important;
  }

  body {
    background-color: #ffffff !important;
    color: #000000 !important;
    font-size: 12pt;
  }

  .sidebar, .topbar, .view-actions, .filter-bar, .modal-backdrop, .toast-container, .btn, .no-print {
    display: none !important;
  }

  .main-wrapper {
    margin-left: 0 !important;
    padding: 0 !important;
  }

  .page-content {
    padding: 0 !important;
  }

  #print-container {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 10mm 15mm !important;
  }

  .print-kop {
    display: flex;
    align-items: center;
    border-bottom: 3px double #000;
    padding-bottom: 12px;
    margin-bottom: 20px;
  }

  .print-kop-logo {
    width: 75px;
    height: 75px;
    margin-right: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .print-kop-logo-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-right: 18px;
  }

  .print-kop-text {
    flex: 1;
    text-align: center;
  }

  .print-kop-text h2 {
    font-size: 16pt;
    font-weight: 800;
    text-transform: uppercase;
    margin: 0;
    letter-spacing: 0.5px;
  }

  .print-kop-text h3 {
    font-size: 13pt;
    font-weight: 700;
    margin: 2px 0 4px;
    letter-spacing: 0.5px;
  }

  .print-kop-text p {
    font-size: 9pt;
    margin: 1px 0;
  }

  .print-doc-title {
    text-align: center;
    margin: 20px 0 15px;
  }

  .print-doc-title h4 {
    font-size: 13pt;
    font-weight: 800;
    text-transform: uppercase;
    text-decoration: underline;
    margin: 0;
  }

  .print-doc-title p {
    font-size: 10pt;
    margin-top: 4px;
  }

  .print-meta-table {
    width: 100%;
    margin-bottom: 15px;
    font-size: 10.5pt;
  }

  .print-meta-table td {
    padding: 4px 6px;
    vertical-align: top;
  }

  .print-data-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 25px;
    font-size: 10pt;
  }

  .print-data-table th, .print-data-table td {
    border: 1px solid #000;
    padding: 6px 8px;
  }

  .print-data-table th {
    background-color: #f2f2f2 !important;
    font-weight: 700;
    text-align: center;
  }

  .print-signatures {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    page-break-inside: avoid;
  }

  .sign-box {
    text-align: center;
    width: 30%;
    font-size: 10pt;
  }

  .sign-space {
    height: 70px;
  }

  .sign-name {
    font-weight: 700;
    text-decoration: underline;
  }

  .sign-nip {
    font-size: 9pt;
    margin-top: 2px;
  }
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

@media (max-width: 820px) {
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 200;
    transform: translateX(-100%);
    margin-left: 0 !important;
    box-shadow: var(--shadow-xl);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .sidebar-backdrop.active {
    display: block;
  }

  .main-wrapper {
    width: 100% !important;
    min-width: 0;
  }

  .topbar {
    padding: 0 14px;
  }

  .page-content {
    padding: 14px;
  }

  .form-row, .form-row-3 {
    grid-template-columns: 1fr;
  }
}

/* ===================================================================
   ATTACHMENTS & MEDIA SYSTEM (LOCAL STORAGE & GOOGLE DRIVE)
   =================================================================== */
.attachment-upload-section {
  margin-top: 14px;
  margin-bottom: 14px;
}


.attachment-box {
  background: var(--bg-card-subtle);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.attachment-box:hover {
  border-color: var(--primary-500);
}

.attachment-source-tabs {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.source-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.source-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 0 4px;
}

.source-divider span {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-dim);
  background: var(--bg-card);
  padding: 3px 6px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  white-space: nowrap;
}

.attachment-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 10px;
  border: 1.5px dashed var(--primary-600);
  background: rgba(13, 148, 136, 0.04);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: center;
  transition: all var(--transition-fast);
}

.attachment-dropzone:hover {
  background: rgba(13, 148, 136, 0.08);
  border-color: var(--primary-500);
  transform: translateY(-1px);
}

.attachment-dropzone i {
  font-size: 20px;
  color: var(--primary-600);
  margin-bottom: 4px;
}

.attachment-dropzone span {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-700);
}

.attachment-dropzone small {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

.attachment-preview-container {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.attachment-preview-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.attachment-preview-thumbnail {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}

.attachment-preview-thumbnail:hover {
  transform: scale(1.05);
}

.attachment-preview-info {
  flex: 1;
  min-width: 0;
}

.preview-filename {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 6px;
}

.preview-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-xs {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
}

.btn-outline-success {
  background: transparent;
  color: #10b981;
  border: 1px solid #10b981;
}

.btn-outline-success:hover {
  background: #10b981;
  color: #ffffff;
}

/* Mini Thumbnails & Chips in Data Tables */
.thumb-mini {
  width: 38px;
  height: 38px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  vertical-align: middle;
}

.thumb-mini:hover {
  transform: scale(1.15);
  box-shadow: var(--shadow-md);
}

.btn-gdrive-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  color: #047857;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.btn-gdrive-chip:hover {
  background: #047857;
  color: #ffffff;
}

.btn-attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--primary-700);
  background: var(--primary-50);
  border: 1px solid var(--primary-200);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-attach-chip:hover {
  background: var(--primary-600);
  color: #ffffff;
}

/* User Management Styling */
.user-avatar-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar-sm {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-600);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,0.2);
}

.user-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.active-profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: #ecfdf5;
  color: #047857;
  font-size: 11.5px;
  font-weight: 700;
  border-radius: var(--radius-full);
  border: 1px solid #a7f3d0;
}

.btn-switch-user {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-switch-user:hover {
  background: var(--primary-50);
  color: var(--primary-700);
  border-color: var(--primary-500);
}

/* Fullscreen Modal Image Preview */
.modal-image-preview-dialog {
  max-width: 800px;
}

.modal-image-preview-body {
  text-align: center;
  padding: 20px;
  background: #0f172a;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.modal-image-preview-body img {
  max-width: 100%;
  max-height: 480px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

/* Print Attachments */
@media print {
  .print-attachment-section {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid #000;
    page-break-inside: avoid;
  }

  .print-attachment-section h5 {
    font-size: 11pt;
    font-weight: bold;
    margin-bottom: 8px;
    text-transform: uppercase;
  }

  .print-attachment-img {
    max-width: 280px;
    max-height: 200px;
    object-fit: contain;
    border: 1px solid #999;
    padding: 3px;
    margin-bottom: 8px;
  }
}

@media (max-width: 768px) {
  .attachment-source-tabs {
    flex-direction: column;
  }
  .source-divider {
    padding: 6px 0;
  }
}

/* Inline Editable Branding & Navbar Text */
[contenteditable="true"] {
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

[contenteditable="true"]:hover {
  outline: 1.5px dashed rgba(42, 122, 92, 0.5);
  outline-offset: 3px;
  cursor: text;
}

[contenteditable="true"]:focus {
  outline: 2px solid var(--primary-600);
  outline-offset: 3px;
  background-color: var(--bg-card-subtle);
}


/* ==========================================================================
   PORTAL LOGIN RESMI SIM-RT AAS - ULTRA PREMIUM STYLING
   ========================================================================== */

.login-portal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 32px 16px;
  background-color: #031e14;
  background-image: 
    linear-gradient(135deg, rgba(2, 26, 17, 0.42) 0%, rgba(6, 60, 41, 0.32) 50%, rgba(2, 20, 14, 0.58) 100%),
    url('../assets/login-bg-3d.jpg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.login-mesh-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: 
    radial-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px),
    radial-gradient(circle at 50% 30%, rgba(16, 185, 129, 0.12), transparent 60%);
  background-size: 28px 28px, 100% 100%;
  opacity: 0.4;
}

.login-portal-container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 490px;
  animation: loginCardAppear 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes loginCardAppear {
  0% {
    opacity: 0;
    transform: translateY(24px) scale(0.97);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-card {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  box-shadow: 
    0 24px 60px -12px rgba(0, 0, 0, 0.45),
    0 0 50px rgba(16, 185, 129, 0.2),
    inset 0 1px 2px rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .login-card {
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid rgba(16, 185, 129, 0.3);
  box-shadow: 
    0 24px 60px -12px rgba(0, 0, 0, 0.7),
    0 0 45px rgba(16, 185, 129, 0.12);
}

.login-card-header {
  text-align: center;
  margin-bottom: 24px;
}

.login-emblem-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffffff, #ecfdf5);
  box-shadow: 
    0 10px 25px -4px rgba(4, 120, 87, 0.4),
    0 0 0 4px rgba(16, 185, 129, 0.25);
  margin-bottom: 14px;
  transition: transform 0.3s ease;
}

.login-emblem-wrapper:hover {
  transform: scale(1.05);
}

.login-emblem-glow {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.4), transparent 70%);
  animation: pulseGlow 3s infinite alternate;
  z-index: 1;
}

@keyframes pulseGlow {
  0% { transform: scale(0.95); opacity: 0.5; }
  100% { transform: scale(1.15); opacity: 0.9; }
}

.login-logo-img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  position: relative;
  z-index: 2;
}

.login-seal-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #059669;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

[data-theme="dark"] .login-seal-badge {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.login-brand-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-main);
  margin-bottom: 4px;
}

.login-brand-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Alert Error */
.login-error-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 18px;
  animation: shake 0.4s ease;
}

[data-theme="dark"] .login-error-alert {
  background: rgba(185, 28, 28, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

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

/* Form Styles */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon .input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
  transition: color var(--transition-fast);
}

.input-with-icon .form-control {
  padding-left: 40px;
  padding-right: 42px;
  height: 44px;
  font-size: 13.5px;
}

.input-with-icon .form-control:focus + .input-icon,
.input-with-icon:focus-within .input-icon {
  color: var(--primary);
}

.btn-toggle-password {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast);
}

.btn-toggle-password:hover {
  color: var(--primary);
}

.login-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  margin-top: -2px;
  margin-bottom: 4px;
}

.login-options-row .checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text-muted);
  user-select: none;
}

.login-forgot-link {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  transition: color var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.login-forgot-link:hover {
  text-decoration: underline;
  color: var(--primary-hover);
}

.btn-login-submit {
  height: 46px;
  font-size: 14.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 14px rgba(4, 120, 87, 0.35);
  margin-top: 4px;
  transition: all var(--transition-normal);
}

.btn-login-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(4, 120, 87, 0.45);
}

/* Quick 1-Click Login Section */
.quick-login-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 22px 0 16px;
  color: var(--text-muted);
}

.quick-login-divider::before,
.quick-login-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}

.quick-login-divider span {
  padding: 0 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--text-muted);
}

.quick-login-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quick-user-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
  width: 100%;
}

.quick-user-btn:hover {
  background: var(--bg-card);
  border-color: var(--primary);
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(4, 120, 87, 0.15);
}

.quick-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 0;
}

.quick-avatar-blue {
  background: #0284c7;
}

.quick-avatar-purple {
  background: #7c3aed;
}

.quick-user-meta {
  flex: 1;
  min-width: 0;
}

.quick-user-meta strong {
  display: block;
  font-size: 13px;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-user-meta span {
  display: block;
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-user-action {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 12px;
}

.quick-role-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.quick-user-btn:hover .quick-user-action i {
  color: var(--primary);
  transform: translateX(2px);
  transition: transform 0.2s;
}

/* Login Card Footer */
.login-card-footer {
  margin-top: 22px;
  text-align: center;
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
}

.login-hint-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-muted);
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
}

.mono-badge {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--primary);
  background: rgba(4, 120, 87, 0.1);
  padding: 1px 5px;
  border-radius: 4px;
}

.login-copyright {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
}

.login-address {
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.85;
}

/* ==========================================================================
   TOPBAR USER PROFILE & LOGOUT DROPDOWN
   ========================================================================== */

.topbar-user-menu {
  position: relative;
}

.topbar-user-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px 5px 6px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.topbar-user-btn:hover {
  border-color: var(--primary);
  background: var(--bg-card-subtle);
}

.topbar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}

.topbar-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.topbar-user-info {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.2;
}

.topbar-user-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-user-role {
  font-size: 10.5px;
  color: var(--text-muted);
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-user-chevron {
  font-size: 10px;
  color: var(--text-muted);
  margin-left: 2px;
  transition: transform 0.2s;
}

.topbar-user-menu.open .topbar-user-chevron {
  transform: rotate(180deg);
}

/* Floating Dropdown */
.topbar-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 240px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 8px 0;
  z-index: 1000;
  animation: fadeInDown 0.2s ease;
}

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

.dropdown-header {
  padding: 10px 16px 8px;
}

.dropdown-user-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2px;
}

.dropdown-user-role {
  font-size: 11.5px;
  color: var(--primary);
  font-weight: 600;
}

.dropdown-user-nip {
  font-size: 10.5px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 2px;
}

.dropdown-divider {
  height: 1px;
  background: var(--border-color);
  margin: 6px 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  font-size: 12.5px;
  color: var(--text-main);
  cursor: pointer;
  transition: background var(--transition-fast);
  text-decoration: none;
}

.dropdown-item:hover {
  background: var(--bg-card-subtle);
  color: var(--primary);
}

.dropdown-item-danger {
  color: #dc2626 !important;
}

.dropdown-item-danger:hover {
  background: #fee2e2 !important;
  color: #b91c1c !important;
}

[data-theme="dark"] .dropdown-item-danger:hover {
  background: rgba(220, 38, 38, 0.2) !important;
  color: #f87171 !important;
}

/* Sidebar Logout Button */
.btn-sidebar-logout {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-left: auto;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.btn-sidebar-logout:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
  transform: scale(1.05);
}

[data-theme="dark"] .btn-sidebar-logout:hover {
  background: rgba(220, 38, 38, 0.25);
  border-color: rgba(248, 113, 113, 0.4);
  color: #f87171;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .topbar-user-info {
    display: none;
  }
  .topbar-user-btn {
    padding: 3px;
  }
  .login-card {
    padding: 28px 20px;
  }
}

