/* ==========================================================================
   Preline UI Inspired Design System
   Modern Enterprise Realtime CRUD Dashboard
   ========================================================================== */

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

:root {
  /* 6 Color Themes - Default Indigo */
  --color-primary: #4f46e5;
  --color-primary-hover: #4338ca;
  --color-primary-light: rgba(79, 70, 229, 0.12);
  --color-primary-ring: rgba(79, 70, 229, 0.28);
  --color-primary-border: rgba(79, 70, 229, 0.3);

  /* Semantic Status Colors */
  --success-bg: rgba(16, 185, 129, 0.12);
  --success-text: #059669;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --warning-text: #d97706;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --danger-text: #dc2626;
  --info-bg: rgba(6, 182, 212, 0.12);
  --info-text: #0891b2;

  /* Typography & Sizing */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --sidebar-width: 260px;
  --header-height: 68px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  /* Light Mode (Default) */
  --bg-body: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-subtle: #f1f5f9;
  --bg-surface-hover: #f8fafc;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border-color: #e2e8f0;
  --border-subtle: #f1f5f9;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.07);
  --shadow-lg: 0 10px 25px -5px rgb(0 0 0 / 0.08), 0 8px 10px -6px rgb(0 0 0 / 0.04);
  --backdrop-blur: rgba(255, 255, 255, 0.85);
  --modal-backdrop: rgba(15, 23, 42, 0.5);
}

/* 6 Dynamic Color Palettes */
html[data-color="indigo"] {
  --color-primary: #4f46e5;
  --color-primary-hover: #4338ca;
  --color-primary-light: rgba(79, 70, 229, 0.12);
  --color-primary-ring: rgba(79, 70, 229, 0.28);
  --color-primary-border: rgba(79, 70, 229, 0.3);
}

html[data-color="emerald"] {
  --color-primary: #059669;
  --color-primary-hover: #047857;
  --color-primary-light: rgba(5, 150, 105, 0.12);
  --color-primary-ring: rgba(5, 150, 105, 0.28);
  --color-primary-border: rgba(5, 150, 105, 0.3);
}

html[data-color="violet"] {
  --color-primary: #7c3aed;
  --color-primary-hover: #6d28d9;
  --color-primary-light: rgba(124, 58, 237, 0.12);
  --color-primary-ring: rgba(124, 58, 237, 0.28);
  --color-primary-border: rgba(124, 58, 237, 0.3);
}

html[data-color="rose"] {
  --color-primary: #e11d48;
  --color-primary-hover: #be123c;
  --color-primary-light: rgba(225, 29, 72, 0.12);
  --color-primary-ring: rgba(225, 29, 72, 0.28);
  --color-primary-border: rgba(225, 29, 72, 0.3);
}

html[data-color="amber"] {
  --color-primary: #d97706;
  --color-primary-hover: #b45309;
  --color-primary-light: rgba(217, 119, 6, 0.12);
  --color-primary-ring: rgba(217, 119, 6, 0.28);
  --color-primary-border: rgba(217, 119, 6, 0.3);
}

html[data-color="cyan"] {
  --color-primary: #0891b2;
  --color-primary-hover: #0e7490;
  --color-primary-light: rgba(8, 145, 178, 0.12);
  --color-primary-ring: rgba(8, 145, 178, 0.28);
  --color-primary-border: rgba(8, 145, 178, 0.3);
}

/* Dark Mode Overrides */
html[data-theme="dark"] {
  --bg-body: #0b0f19;
  --bg-surface: #111827;
  --bg-surface-subtle: #1f2937;
  --bg-surface-hover: #172033;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-color: #1f2937;
  --border-subtle: #192231;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.5);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
  --shadow-lg: 0 10px 25px -5px rgb(0 0 0 / 0.6), 0 8px 10px -6px rgb(0 0 0 / 0.5);
  --backdrop-blur: rgba(17, 24, 39, 0.85);
  --modal-backdrop: rgba(0, 0, 0, 0.7);

  --success-bg: rgba(16, 185, 129, 0.16);
  --success-text: #34d399;
  --warning-bg: rgba(245, 158, 11, 0.16);
  --warning-text: #fbbf24;
  --danger-bg: rgba(239, 68, 68, 0.16);
  --danger-text: #f87171;
  --info-bg: rgba(6, 182, 212, 0.16);
  --info-text: #38bdf8;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  transition: background-color 0.2s ease, color 0.2s ease;
  overflow-x: hidden;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  text-decoration: none;
  white-space: nowrap;
}
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--color-primary-ring);
}
.btn-primary {
  background-color: var(--color-primary);
  color: #ffffff;
  border-color: var(--color-primary);
}
.btn-primary:hover {
  background-color: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
}
.btn-secondary {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-color);
}
.btn-secondary:hover {
  background-color: var(--bg-surface-subtle);
  border-color: var(--border-color);
}
.btn-danger {
  background-color: var(--danger-bg);
  color: var(--danger-text);
  border-color: transparent;
}
.btn-danger:hover {
  background-color: #ef4444;
  color: #ffffff;
}
.btn-icon {
  padding: 0.55rem;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.btn-icon:hover {
  background-color: var(--bg-surface-subtle);
  color: var(--text-primary);
}
.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
}

/* Inputs & Form Elements */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: 1rem;
}
.input-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
}
.input-field {
  width: 100%;
  font-family: inherit;
  font-size: 0.875rem;
  padding: 0.6rem 0.875rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--bg-surface);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input-field:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-ring);
}
.input-field::placeholder {
  color: var(--text-muted);
}
.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}
.input-with-icon .input-icon {
  position: absolute;
  left: 0.75rem;
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
}
.input-with-icon .input-field {
  padding-left: 2.25rem;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.625rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
}
.badge-success { background: var(--success-bg); color: var(--success-text); }
.badge-warning { background: var(--warning-bg); color: var(--warning-text); }
.badge-danger { background: var(--danger-bg); color: var(--danger-text); }
.badge-info { background: var(--info-bg); color: var(--info-text); }
.badge-primary { background: var(--color-primary-light); color: var(--color-primary); }
.badge-neutral { background: var(--bg-surface-subtle); color: var(--text-secondary); border: 1px solid var(--border-color); }

/* ==========================================================================
   App Layout: Sidebar & Header
   ========================================================================== */

.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-surface);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 40;
  transition: transform 0.25s ease-in-out;
}

.sidebar-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}
.sidebar-logo {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar-brand-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}
.sidebar-brand-subtitle {
  font-size: 0.6875rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-nav {
  padding: 1.25rem 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  overflow-y: auto;
}
.nav-section-title {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.75rem 0.75rem 0.35rem;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.875rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}
.nav-item:hover {
  background-color: var(--bg-surface-subtle);
  color: var(--text-primary);
}
.nav-item.active {
  background-color: var(--color-primary-light);
  color: var(--color-primary);
  font-weight: 600;
  border-color: var(--color-primary-border);
}
.nav-item svg {
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.user-pill {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  border-radius: var(--radius-md);
  background: var(--bg-surface-subtle);
}
.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.8125rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.user-info {
  flex: 1;
  min-width: 0;
}
.user-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-role {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

/* Live Connection Indicator */
.realtime-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-subtle);
}
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #10b981;
  position: relative;
}
.pulse-dot::after {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: #10b981;
  opacity: 0.4;
  animation: pulse-ring 1.8s infinite;
}
@keyframes pulse-ring {
  0% { transform: scale(0.6); opacity: 0.8; }
  100% { transform: scale(1.6); opacity: 0; }
}

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

/* Top Header */
.top-header {
  height: var(--header-height);
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 30;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.page-header-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
}
.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Color Scheme Swatches Popover */
.color-picker-dropdown {
  position: relative;
}
.color-swatch-list {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  z-index: 50;
  min-width: 170px;
}
.color-swatch {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.color-swatch:hover {
  transform: scale(1.08);
}
.color-swatch.active {
  border-color: var(--text-primary);
  color: #ffffff;
}
.swatch-indigo { background-color: #4f46e5; }
.swatch-emerald { background-color: #059669; }
.swatch-violet { background-color: #7c3aed; }
.swatch-rose { background-color: #e11d48; }
.swatch-amber { background-color: #d97706; }
.swatch-cyan { background-color: #0891b2; }

/* Content Views */
.content-body {
  padding: 1.75rem;
  flex: 1;
}
.view-section {
  display: none;
}
.view-section.active {
  display: block;
}

/* ==========================================================================
   Cards & Preline UI Components
   ========================================================================== */

.card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: border-color 0.15s ease;
}
.card-header {
  padding: 1.125rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}
.card-subtitle {
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.card-body {
  padding: 1.5rem;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}
.stat-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-info {
  flex: 1;
}
.stat-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
}
.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
  margin-top: 0.2rem;
}

/* ==========================================================================
   Data Table (10+ Columns, Preline UI Style)
   ========================================================================== */

.table-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.filter-left {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  flex: 1;
}
.table-search-box {
  min-width: 260px;
  max-width: 360px;
}
.filter-select {
  font-family: inherit;
  font-size: 0.875rem;
  padding: 0.55rem 0.875rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--bg-surface);
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
}
.filter-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-ring);
}

.table-container {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}
.data-table th {
  background-color: var(--bg-surface-subtle);
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
  user-select: none;
}
.data-table th.sortable {
  cursor: pointer;
  transition: color 0.15s ease;
}
.data-table th.sortable:hover {
  color: var(--color-primary);
}
.th-content {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.data-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  vertical-align: middle;
  white-space: nowrap;
}
.data-table tbody tr {
  transition: background-color 0.15s ease;
}
.data-table tbody tr:hover {
  background-color: var(--bg-surface-hover);
}
.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* Realtime Row Highlight Animation */
@keyframes highlight-row {
  0% { background-color: var(--color-primary-light); }
  100% { background-color: transparent; }
}
.row-highlight {
  animation: highlight-row 2.5s ease-out;
}

/* Table Avatar & Text Cell */
.user-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.cell-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.8125rem;
  flex-shrink: 0;
}
.cell-name {
  font-weight: 600;
  color: var(--text-primary);
}
.cell-nik {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: monospace;
}

/* Table Actions Cell */
.actions-cell {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Pagination Footer */
.table-pagination-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
}
.pagination-info {
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.page-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.page-btn:hover:not(:disabled) {
  background: var(--bg-surface-subtle);
  border-color: var(--color-primary);
}
.page-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #ffffff;
}
.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ==========================================================================
   Modals
   ========================================================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--modal-backdrop);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.open {
  display: flex;
  animation: fadeIn 0.2s ease-out;
}
.modal-dialog {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}
.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
}
.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  background-color: var(--bg-surface-subtle);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
.form-full {
  grid-column: span 2;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideUp {
  from { transform: translateY(16px) scale(0.98); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

/* ==========================================================================
   Password Strength Meter
   ========================================================================== */

.strength-meter-bar {
  height: 6px;
  width: 100%;
  background: var(--border-color);
  border-radius: var(--radius-full);
  margin-top: 0.5rem;
  overflow: hidden;
}
.strength-progress {
  height: 100%;
  width: 0%;
  transition: width 0.3s ease, background-color 0.3s ease;
}
.strength-label {
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 0.25rem;
}

/* ==========================================================================
   Toast Notification System
   ========================================================================== */

.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  min-width: 320px;
  max-width: 420px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-md);
  padding: 0.875rem 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  animation: slideLeft 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}
.toast-icon {
  flex-shrink: 0;
  margin-top: 2px;
}
.toast-content {
  flex: 1;
}
.toast-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-primary);
}
.toast-msg {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 2px;
}
.toast-close {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
}
.toast-close:hover {
  color: var(--text-primary);
}

@keyframes slideLeft {
  from { transform: translateX(50px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   Login View Page
   ========================================================================== */

.login-view-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: var(--bg-body);
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2.25rem;
}
.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 2rem;
}
.login-brand .sidebar-logo {
  width: 52px;
  height: 52px;
  margin-bottom: 0.75rem;
}
.login-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
}
.login-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* Quick Fill Demo Box */
.demo-credentials-box {
  margin-top: 1.25rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-surface-subtle);
  border: 1px dashed var(--border-color);
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   Responsive & Mobile Friendly
   ========================================================================== */

.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 35;
}

.mobile-menu-btn {
  display: none;
}

@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .mobile-overlay.open {
    display: block;
  }
  .main-wrapper {
    margin-left: 0;
  }
  .mobile-menu-btn {
    display: inline-flex;
  }
}

@media (max-width: 640px) {
  .content-body {
    padding: 1rem;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-full {
    grid-column: span 1;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .table-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-left {
    flex-direction: column;
    align-items: stretch;
  }
  .table-search-box {
    max-width: 100%;
    min-width: 100%;
  }
  .table-pagination-bar {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  .pagination-controls {
    justify-content: center;
  }
}
