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

:root {
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --bg-body: #f8fafc;
  --bg-surface: #ffffff;
  --bg-sidebar: #0f172a;
  --bg-sidebar-hover: #1e293b;
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;
  
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --primary-glow: rgba(79, 70, 229, 0.25);
  
  --secondary: #64748b;
  --secondary-light: #f1f5f9;
  --success: #10b981;
  --success-hover: #059669;
  --success-light: #ecfdf5;
  --success-glow: rgba(16, 185, 129, 0.25);
  --warning: #f59e0b;
  --warning-hover: #d97706;
  --warning-light: #fffbeb;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --danger-light: #fef2f2;
  --danger-glow: rgba(239, 68, 68, 0.25);
  --info: #0ea5e9;
  --info-hover: #0284c7;
  --info-light: #f0f9ff;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 2px 4px -1px rgba(0, 0, 0, 0.06), 0 1px 2px -1px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.06);

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

* {
  box-sizing: border-box;
}

/* Custom Slim Scrollbar */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ==========================================================================
   GLOBAL SUBTLE & TRANSPARENT PLACEHOLDERS
   ========================================================================== */
::placeholder {
  color: #94a3b8 !important;
  opacity: 0.45 !important;
  font-weight: 400 !important;
}
::-webkit-input-placeholder {
  color: #94a3b8 !important;
  opacity: 0.45 !important;
  font-weight: 400 !important;
}
::-moz-placeholder {
  color: #94a3b8 !important;
  opacity: 0.45 !important;
  font-weight: 400 !important;
}
:-ms-input-placeholder {
  color: #94a3b8 !important;
  opacity: 0.45 !important;
  font-weight: 400 !important;
}
.form-control::placeholder,
.form-input::placeholder,
input::placeholder,
textarea::placeholder,
.dataTables_filter input::placeholder {
  color: #94a3b8 !important;
  opacity: 0.45 !important;
  font-weight: 400 !important;
}

body {
  font-family: var(--font-main) !important;
  background-color: var(--bg-body) !important;
  color: var(--text-main) !important;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ==========================================================================
   BUTTONS OVERHAUL (MODERN & SLEEK)
   ========================================================================== */
.btn {
  font-family: var(--font-main) !important;
  font-weight: 600 !important;
  border-radius: var(--radius-md) !important;
  padding: 9px 18px !important;
  font-size: 0.92rem !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1) !important;
  border: 1.5px solid transparent !important;
  cursor: pointer !important;
  box-shadow: var(--shadow-sm);
  text-decoration: none !important;
  line-height: 1.4 !important;
  touch-action: manipulation;
}

.btn:hover {
  transform: translateY(-1.5px);
  box-shadow: var(--shadow-md);
}

.btn:active {
  transform: translateY(0.5px);
  box-shadow: var(--shadow-xs);
}

.btn:focus, .btn:focus-visible {
  outline: none !important;
}

/* Primary Button */
.btn-primary {
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%) !important;
  border-color: #4338ca !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.28) !important;
}
.btn-primary:hover {
  background: linear-gradient(135deg, #4338ca 0%, #3730a3 100%) !important;
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4) !important;
}
.btn-primary:focus {
  box-shadow: 0 0 0 4px var(--primary-glow) !important;
}

/* Success Button */
.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  border-color: #059669 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.28) !important;
}
.btn-success:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4) !important;
}
.btn-success:focus {
  box-shadow: 0 0 0 4px var(--success-glow) !important;
}

/* Danger Button */
.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
  border-color: #dc2626 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.28) !important;
}
.btn-danger:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4) !important;
}
.btn-danger:focus {
  box-shadow: 0 0 0 4px var(--danger-glow) !important;
}

/* Warning Button */
.btn-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  border-color: #d97706 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.28) !important;
}
.btn-warning:hover {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
  color: #ffffff !important;
}

/* Info Button */
.btn-info {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%) !important;
  border-color: #0284c7 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.28) !important;
}
.btn-info:hover {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
}

/* Secondary & Light Buttons */
.btn-secondary {
  background: #64748b !important;
  border-color: #475569 !important;
  color: #ffffff !important;
}
.btn-secondary:hover {
  background: #475569 !important;
}

.btn-light {
  background: #f8fafc !important;
  border-color: var(--border-color) !important;
  color: var(--text-main) !important;
}
.btn-light:hover {
  background: #e2e8f0 !important;
  border-color: #cbd5e1 !important;
}

/* Outline Buttons */
.btn-outline-primary {
  background: transparent !important;
  border: 1.5px solid var(--primary) !important;
  color: var(--primary) !important;
  box-shadow: none !important;
}
.btn-outline-primary:hover {
  background: var(--primary) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.28) !important;
}

.btn-outline-success {
  background: transparent !important;
  border: 1.5px solid var(--success) !important;
  color: var(--success) !important;
  box-shadow: none !important;
}
.btn-outline-success:hover {
  background: var(--success) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.28) !important;
}

.btn-outline-danger {
  background: transparent !important;
  border: 1.5px solid var(--danger) !important;
  color: var(--danger) !important;
  box-shadow: none !important;
}
.btn-outline-danger:hover {
  background: var(--danger) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.28) !important;
}

.btn-outline-warning {
  background: transparent !important;
  border: 1.5px solid var(--warning) !important;
  color: var(--warning) !important;
  box-shadow: none !important;
}
.btn-outline-warning:hover {
  background: var(--warning) !important;
  color: #ffffff !important;
}

/* Button Sizing */
.btn-sm {
  padding: 6px 14px !important;
  font-size: 0.82rem !important;
  border-radius: var(--radius-sm) !important;
  gap: 6px !important;
}

.btn-lg {
  padding: 12px 24px !important;
  font-size: 1.05rem !important;
  border-radius: var(--radius-lg) !important;
}

.btn-rounded, .btn.rounded-pill {
  border-radius: var(--radius-full) !important;
}

/* Button Groups */
.btn-group {
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: inline-flex;
}
.btn-group .btn {
  border-radius: 0 !important;
  margin-left: -1px;
}
.btn-group .btn:first-child {
  border-top-left-radius: var(--radius-md) !important;
  border-bottom-left-radius: var(--radius-md) !important;
}
.btn-group .btn:last-child {
  border-top-right-radius: var(--radius-md) !important;
  border-bottom-right-radius: var(--radius-md) !important;
}

/* ==========================================================================
   DATATABLES & SEARCH CONTROLS OVERHAUL
   ========================================================================== */
.dataTables_wrapper {
  padding: 8px 0;
}

.dataTables_wrapper .row:first-child {
  margin-bottom: 18px;
  align-items: center;
}

/* Search Box Container & Input */
.dataTables_filter {
  text-align: right;
}

.dataTables_filter label {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin-bottom: 0 !important;
  font-weight: 600 !important;
  font-size: 0.88rem !important;
  color: var(--text-muted) !important;
  position: relative !important;
}

.dataTables_filter input {
  height: 44px !important;
  padding: 8px 16px !important;
  border: 1.5px solid var(--border-color) !important;
  border-radius: var(--radius-full) !important;
  background: #ffffff !important;
  font-family: inherit !important;
  font-size: 0.9rem !important;
  font-weight: 600 !important;
  color: var(--text-main) !important;
  outline: none !important;
  transition: all 0.2s ease !important;
  box-shadow: var(--shadow-xs) !important;
  min-width: 240px !important;
}

.dataTables_filter input:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 4px var(--primary-glow) !important;
  background: #ffffff !important;
  min-width: 260px !important;
}

/* Length Select */
.dataTables_length label {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin-bottom: 0 !important;
  font-weight: 600 !important;
  font-size: 0.88rem !important;
  color: var(--text-muted) !important;
}

.dataTables_length select {
  height: 40px !important;
  padding: 6px 14px !important;
  border: 1.5px solid var(--border-color) !important;
  border-radius: var(--radius-md) !important;
  background-color: #ffffff !important;
  font-family: inherit !important;
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  color: var(--text-main) !important;
  outline: none !important;
  transition: border-color 0.2s !important;
  cursor: pointer !important;
}

.dataTables_length select:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px var(--primary-glow) !important;
}

/* Info & Pagination */
.dataTables_info {
  font-size: 0.88rem !important;
  color: var(--text-muted) !important;
  font-weight: 500 !important;
  padding-top: 14px !important;
}

.dataTables_paginate {
  text-align: right;
  padding-top: 10px !important;
}

.dataTables_paginate .pagination {
  margin: 0 !important;
  display: inline-flex !important;
  gap: 4px !important;
  list-style: none !important;
}

/* Reset <li> to eliminate double border and card-in-card bug on DataTables */
.dataTables_paginate .pagination li,
.dataTables_paginate .pagination li.paginate_button,
.dataTables_paginate .pagination li.page-item,
.dataTables_wrapper .dataTables_paginate ul.pagination li {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
  display: inline-flex !important;
}

.dataTables_paginate .page-item .page-link,
.dataTables_wrapper .dataTables_paginate .paginate_button:not(li) {
  min-width: 38px;
  height: 38px;
  padding: 0 12px !important;
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  color: var(--text-main) !important;
  background: #ffffff !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-md) !important;
  text-decoration: none !important;
  transition: all 0.2s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}

.dataTables_paginate .page-item .page-link:hover,
.dataTables_wrapper .dataTables_paginate .paginate_button:not(li):hover {
  background: #f1f5f9 !important;
  color: var(--primary) !important;
  border-color: #cbd5e1 !important;
}

.dataTables_paginate .page-item.active .page-link,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:not(li) {
  background: linear-gradient(135deg, var(--primary) 0%, #3730a3 100%) !important;
  color: #ffffff !important;
  border-color: var(--primary) !important;
  box-shadow: 0 3px 10px rgba(79, 70, 229, 0.35) !important;
}

.dataTables_paginate .page-item.disabled .page-link,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:not(li) {
  opacity: 0.45 !important;
  cursor: not-allowed !important;
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
  color: var(--text-muted) !important;
  box-shadow: none !important;
}

/* ==========================================================================
   FORMS & INPUT CONTROLS
   ========================================================================== */
.form-control {
  height: 48px !important;
  padding: 10px 16px !important;
  font-size: 0.95rem !important;
  font-weight: 500 !important;
  font-family: inherit !important;
  color: var(--text-main) !important;
  background-color: #ffffff !important;
  border: 1.5px solid var(--border-color) !important;
  border-radius: var(--radius-md);
  transition: all 0.2s ease !important;
  outline: none !important;
  box-shadow: none !important;
}

.form-control:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 4px var(--primary-glow) !important;
  background-color: #ffffff !important;
}

/* ==========================================================================
   INPUT GROUPS & PREPEND / APPEND ADDONS (SEAMLESS MODERN DESIGN)
   ========================================================================== */
.input-group {
  position: relative;
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  width: 100%;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

/* Base Input Group Text (Icon / Label Addon) */
.input-group-text {
  height: 48px !important;
  padding: 0 16px !important;
  font-size: 0.95rem !important;
  font-weight: 500 !important;
  color: #64748b !important;
  background-color: #f8fafc !important;
  border: 1.5px solid var(--border-color) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 48px !important;
  box-sizing: border-box !important;
  transition: all 0.2s ease !important;
  outline: none !important;
}

.input-group-text i {
  font-size: 1rem;
  color: #64748b;
  transition: color 0.2s ease;
}

/* Prepend Styling: Left corners rounded, Right corners FLAT */
.input-group-prepend {
  display: flex;
  margin-right: 0 !important;
}

.input-group-prepend .input-group-text,
.input-group-prepend .btn {
  border-top-left-radius: var(--radius-md) !important;
  border-bottom-left-radius: var(--radius-md) !important;
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}

/* Seamless blend when border-right-0 is on prepend */
.input-group-prepend .input-group-text.border-right-0,
.input-group-prepend .border-right-0 {
  border-right: none !important;
  background-color: #ffffff !important;
  padding-right: 6px !important;
}

/* Append Styling: Left corners FLAT, Right corners rounded */
.input-group-append {
  display: flex;
  margin-left: 0 !important;
}

.input-group-append .input-group-text,
.input-group-append .btn {
  border-top-right-radius: var(--radius-md) !important;
  border-bottom-right-radius: var(--radius-md) !important;
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
}

/* Seamless blend when border-left-0 is on append */
.input-group-append .input-group-text.border-left-0,
.input-group-append .border-left-0 {
  border-left: none !important;
  background-color: #ffffff !important;
  padding-left: 6px !important;
}

/* Form controls inside input-group */
.input-group > .form-control {
  position: relative;
  flex: 1 1 auto;
  width: 1%;
  min-width: 0;
  margin-bottom: 0;
  height: 48px !important;
  box-sizing: border-box !important;
}

/* Preceded by prepend -> Left corners 0 */
.input-group > .input-group-prepend ~ .form-control,
.input-group > .form-control:not(:first-child) {
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
}

/* Followed by append -> Right corners 0 */
.input-group > .form-control:not(:last-child) {
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}

/* Border removal classes inside input-group */
.input-group > .form-control.border-left-0,
.input-group > .border-left-0 {
  border-left: none !important;
  padding-left: 10px !important;
}

.input-group > .form-control.border-right-0,
.input-group > .border-right-0 {
  border-right: none !important;
  padding-right: 10px !important;
}

/* Unified Focus Effect on the Whole Group */
.input-group:focus-within {
  border-radius: var(--radius-md);
  box-shadow: 0 0 0 4px var(--primary-glow) !important;
}

.input-group:focus-within .input-group-text {
  border-color: var(--primary) !important;
  color: var(--primary) !important;
  background-color: #ffffff !important;
}

.input-group:focus-within .input-group-text i {
  color: var(--primary) !important;
}

.input-group:focus-within .form-control {
  border-color: var(--primary) !important;
  box-shadow: none !important;
  background-color: #ffffff !important;
}

/* Password toggle button inside input-group */
button.input-group-text {
  cursor: pointer;
}
button.input-group-text:hover i {
  color: var(--primary) !important;
}

textarea.form-control {
  height: auto !important;
  min-height: 100px;
  line-height: 1.6;
}

label {
  font-size: 0.88rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
  letter-spacing: 0.2px;
}

.form-control-file {
  background: #f8fafc;
  border: 1.5px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  width: 100%;
  cursor: pointer;
  display: block;
  font-size: 0.88rem;
  color: var(--text-muted);
  transition: border-color 0.2s, background-color 0.2s;
}

.form-control-file:hover {
  border-color: var(--primary);
  background: #f1f5f9;
}

.custom-file {
  height: auto !important;
}

/* ==========================================================================
   DROPDOWNS & TOOLTIPS
   ========================================================================== */
.dropdown-menu {
  border-radius: var(--radius-lg) !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: var(--shadow-xl) !important;
  padding: 8px !important;
  background: #ffffff !important;
  animation: dropdownFadeIn 0.15s ease-out;
  min-width: 180px;
}

@keyframes dropdownFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.dropdown-item {
  border-radius: var(--radius-sm) !important;
  padding: 10px 14px !important;
  font-size: 0.9rem !important;
  font-weight: 600 !important;
  color: var(--text-main) !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  transition: all 0.15s ease !important;
}

.dropdown-item:hover {
  background-color: #f1f5f9 !important;
  color: var(--primary) !important;
  transform: translateX(3px);
}

.dropdown-item.text-danger:hover {
  background-color: var(--danger-light) !important;
  color: var(--danger) !important;
}

/* ==========================================================================
   AUTHENTICATION & LOGIN PAGES (STATIC LOCKED VIEWPORT)
   ========================================================================== */
html.auth-html {
  height: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden !important;
  overscroll-behavior: none !important;
}

body.auth-page {
  height: 100%;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden !important;
  overscroll-behavior: none !important;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  touch-action: manipulation;
}

.auth-wrapper {
  width: 100%;
  height: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.18), transparent 45%),
              radial-gradient(circle at 80% 80%, rgba(16, 185, 129, 0.15), transparent 45%),
              linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
  padding: 20px 16px;
  box-sizing: border-box;
  position: relative;
  overflow: hidden !important;
  overscroll-behavior: none !important;
}

.auth-wrapper::before {
  content: "";
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.25), transparent 70%);
  top: -150px;
  left: -150px;
  border-radius: 50%;
  pointer-events: none;
  animation: pulseGlow 8s ease-in-out infinite alternate;
}

.auth-wrapper::after {
  content: "";
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.2), transparent 70%);
  bottom: -100px;
  right: -100px;
  border-radius: 50%;
  pointer-events: none;
  animation: pulseGlow 10s ease-in-out infinite alternate-reverse;
}

@keyframes pulseGlow {
  0% { transform: scale(1) translate(0, 0); opacity: 0.7; }
  100% { transform: scale(1.15) translate(30px, 30px); opacity: 1; }
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-2xl);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  padding: 40px 36px;
  position: relative;
  z-index: 10;
  transition: transform 0.3s ease;
}

.auth-card-dark {
  background: rgba(30, 41, 59, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.auth-brand {
  text-align: center;
  margin-bottom: 28px;
}

.auth-brand img {
  max-height: 70px;
  object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.auth-badge-student {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(79, 70, 229, 0.2);
}

.auth-badge-admin {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.auth-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 6px 0;
  letter-spacing: -0.5px;
}

.auth-card-dark .auth-title {
  color: #ffffff;
}

.auth-subtitle {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin: 0;
}

.auth-card-dark .auth-subtitle {
  color: #94a3b8;
}

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

.form-group-modern label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.form-group-modern.text-center label,
.form-group-modern label.text-center {
  text-align: center !important;
}

.auth-card-dark .form-group-modern label {
  color: #cbd5e1;
}

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

.input-icon-wrap i {
  position: absolute;
  left: 16px;
  color: #94a3b8;
  font-size: 1.1rem;
  pointer-events: none;
  transition: color 0.2s;
}

.input-icon-wrap .toggle-pwd {
  position: absolute;
  right: 14px;
  left: auto;
  color: #94a3b8;
  cursor: pointer;
  pointer-events: auto !important;
  z-index: 10;
  padding: 8px;
  user-select: none;
  -webkit-user-select: none;
  font-size: 1.15rem;
}

.input-icon-wrap .toggle-pwd:hover {
  color: #818cf8;
}

.form-control-modern {
  width: 100%;
  height: 54px;
  padding: 12px 16px 12px 48px;
  font-size: 1.05rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-main);
  background: #f8fafc;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  outline: none;
}

.form-control-modern:focus {
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.auth-card-dark .form-control-modern {
  background: rgba(15, 23, 42, 0.7);
  border-color: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.auth-card-dark .form-control-modern:focus {
  background: rgba(15, 23, 42, 0.95);
  border-color: var(--primary);
}

.form-control-voter-id {
  font-size: 1.4rem !important;
  letter-spacing: 3px !important;
  text-transform: uppercase !important;
  text-align: center !important;
  padding-left: 16px !important;
  padding-right: 16px !important;
  height: 64px !important;
  font-weight: 800 !important;
}

.btn-modern {
  width: 100%;
  height: 54px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1.02rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none !important;
}

.btn-primary-gradient {
  background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

.btn-primary-gradient:hover {
  background: linear-gradient(135deg, #4338ca 0%, #312e81 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(79, 70, 229, 0.45);
}

.btn-success-gradient {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.btn-success-gradient:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(16, 185, 129, 0.45);
}

/* ========================================================
   MODERN FLOATING TOAST NOTIFICATIONS (Top-Right Floating)
   ======================================================== */
.toast-notification-area {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
  max-width: 440px;
  width: calc(100% - 48px);
}

.alert-modern,
.admin-page-content > .alert-dismissible {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999999;
  min-width: 320px;
  max-width: 440px;
  margin-bottom: 0;
  border-radius: 14px;
  padding: 14px 18px;
  padding-right: 42px;
  font-size: 0.92rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid transparent;
  box-shadow: 0 14px 34px -8px rgba(0, 0, 0, 0.16), 0 8px 16px -4px rgba(0, 0, 0, 0.08);
  pointer-events: auto;
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards,
             toastAutoDismiss 0.5s cubic-bezier(0.16, 1, 0.3, 1) 3.8s forwards;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease, max-height 0.35s ease, margin 0.35s ease;
}

/* When placed inside the stacking container */
.toast-notification-area .alert-modern,
.toast-notification-area .alert-dismissible {
  position: relative;
  top: auto;
  right: auto;
  width: 100%;
}

.alert-modern i {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.alert-modern div {
  flex-grow: 1;
  word-break: break-word;
  line-height: 1.45;
}

/* Close button inside toast */
.alert-modern .alert-close-btn,
.alert-modern .close,
.admin-page-content > .alert-dismissible .close {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  font-size: 1.35rem;
  line-height: 1;
  color: inherit;
  opacity: 0.55;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: opacity 0.2s, transform 0.2s;
  outline: none;
  box-shadow: none;
}

.alert-modern .alert-close-btn:hover,
.alert-modern .close:hover,
.admin-page-content > .alert-dismissible .close:hover {
  opacity: 1;
  transform: translateY(-50%) scale(1.18);
}

/* Progress bar at the bottom of toast */
.alert-modern::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: currentColor;
  opacity: 0.35;
  animation: toastProgressBar 3.8s linear forwards;
}

/* Hover pause */
.alert-modern:hover,
.alert-modern.toast-paused {
  animation-play-state: paused !important;
}

.alert-modern:hover::after,
.alert-modern.toast-paused::after {
  animation-play-state: paused !important;
}

/* Dismiss / Closing state */
.alert-modern.toast-closing {
  transform: translateX(120%) !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Animations */
@keyframes toastSlideIn {
  from {
    transform: translateX(120%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes toastAutoDismiss {
  0% {
    transform: translateX(0);
    opacity: 1;
    max-height: 200px;
    margin-bottom: 0;
    padding-top: 14px;
    padding-bottom: 14px;
    visibility: visible;
  }
  80% {
    transform: translateX(120%);
    opacity: 0;
    max-height: 200px;
    margin-bottom: 0;
    padding-top: 14px;
    padding-bottom: 14px;
    visibility: hidden;
  }
  100% {
    transform: translateX(120%);
    opacity: 0;
    max-height: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-width: 0;
    visibility: hidden;
    pointer-events: none;
  }
}

@keyframes toastProgressBar {
  from { width: 100%; }
  to { width: 0%; }
}

/* Modern Toast Colors */
.alert-modern-success {
  background: #ecfdf5 !important;
  color: #065f46 !important;
  border-color: #a7f3d0 !important;
}

.alert-modern-danger {
  background: #fef2f2 !important;
  color: #991b1b !important;
  border-color: #fecaca !important;
}

.alert-modern-warning {
  background: #fffbeb !important;
  color: #92400e !important;
  border-color: #fde68a !important;
}

.alert-modern-info {
  background: #eff6ff !important;
  color: #1e40af !important;
  border-color: #bfdbfe !important;
}

/* Mobile Responsive */
@media (max-width: 576px) {
  .toast-notification-area,
  .alert-modern,
  .admin-page-content > .alert-dismissible {
    top: 16px;
    right: 16px;
    left: 16px;
    width: auto;
    min-width: auto;
    max-width: none;
  }
}

.auth-footer-nav {
  margin-top: 24px;
  text-align: center;
  border-top: 1px solid var(--border-color);
  padding-top: 18px;
}

.auth-card-dark .auth-footer-nav {
  border-color: rgba(255, 255, 255, 0.1);
}

.auth-footer-nav a {
  color: var(--primary);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  transition: color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.auth-card-dark .auth-footer-nav a {
  color: #818cf8;
}

.auth-footer-nav a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   STUDENT VOTING BOOTH (BILIK SUARA)
   ========================================================================== */
.voting-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 20px 60px 20px;
}

.voting-header {
  background: #ffffff;
  border-radius: var(--radius-xl);
  padding: 18px 24px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.voting-header-top {
  display: flex;
  align-items: center;
  min-width: 0;
}

.voting-header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.voting-header-brand img {
  height: 48px;
  max-width: 52px;
  object-fit: contain;
  flex-shrink: 0;
}

.voting-brand-text {
  min-width: 0;
}

.voting-brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  line-height: 1.25;
  letter-spacing: -0.2px;
}

.voting-brand-subtitle {
  font-size: 0.82rem;
  color: #64748b;
  display: block;
}

.voting-header-user {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.voting-voter-pill {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: #f8fafc;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

.voting-voter-avatar {
  width: 38px;
  height: 38px;
  min-width: 38px;
  background: linear-gradient(135deg, var(--primary), #818cf8);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25);
  flex-shrink: 0;
}

.voting-voter-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.voting-voter-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.voting-voter-meta {
  font-size: 0.78rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.voting-voter-meta .meta-dot {
  margin: 0 4px;
  color: #cbd5e1;
}

.btn-voting-logout {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fef2f2;
  color: #dc2626;
  border: 1.5px solid #fecaca;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.88rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none !important;
  box-shadow: 0 1px 3px rgba(220, 38, 38, 0.08);
  cursor: pointer;
  white-space: nowrap;
}

.btn-voting-logout:hover {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.28);
}

.btn-voting-logout i {
  font-size: 0.95rem;
  transition: transform 0.2s ease;
}

.btn-voting-logout:hover i {
  transform: translateX(2px);
}

.voting-instruction-banner {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  color: #ffffff;
  border-radius: var(--radius-2xl);
  padding: 32px 36px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.voting-instruction-banner::after {
  content: "\f0a6";
  font-family: "FontAwesome";
  position: absolute;
  right: 20px;
  bottom: -20px;
  font-size: 9rem;
  color: rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

.candidate-card {
  background: #ffffff;
  border-radius: var(--radius-2xl);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}

.candidate-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl), 0 0 20px rgba(79, 70, 229, 0.15);
  border-color: rgba(79, 70, 229, 0.4);
}

.candidate-card-header {
  background: #0f172a;
  color: #ffffff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.candidate-number-badge {
  background: var(--primary);
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 800;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.5);
}

.candidate-name-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.candidate-img-wrap {
  width: 100%;
  aspect-ratio: 1 / 1.415;
  background: #f8fafc;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border-light);
}

.candidate-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transition: transform 0.4s ease;
}

.candidate-card:hover .candidate-img-wrap img {
  transform: scale(1.04);
}

.candidate-card-body {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.candidate-card-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

/* ==========================================================================
   ADMIN & DASHBOARD LAYOUT
   ========================================================================== */
.admin-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  width: 100%;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sidebar-backdrop.show {
  display: block !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

@media (min-width: 992px) {
  .sidebar-backdrop,
  .sidebar-backdrop.show {
    display: none !important;
    pointer-events: none !important;
    visibility: hidden !important;
  }
}

.modern-sidebar {
  width: 270px;
  min-width: 270px;
  height: 100vh;
  max-height: 100vh;
  position: sticky;
  top: 0;
  background: var(--bg-sidebar);
  color: #94a3b8;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1), left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 999;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.admin-layout.sidebar-collapsed .modern-sidebar {
  margin-left: -270px;
}

.sidebar-header {
  padding: 20px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.sidebar-header img {
  max-height: 40px;
  object-fit: contain;
}

.sidebar-menu {
  padding: 16px 12px 60px 12px;
  flex: 1 1 auto;
  overflow-y: auto !important;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  list-style: none;
  margin: 0;
}

.sidebar-menu::-webkit-scrollbar {
  width: 5px;
}
.sidebar-menu::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
}
.sidebar-menu::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 4px;
}
.sidebar-menu::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.5);
}

.sidebar-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #475569;
  padding: 12px 14px 6px 14px;
}

.sidebar-item {
  margin-bottom: 4px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: #cbd5e1;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none !important;
  transition: all 0.2s ease;
}

.sidebar-link i {
  font-size: 1.15rem;
  width: 22px;
  text-align: center;
  color: #64748b;
  transition: color 0.2s ease;
}

.sidebar-link:hover {
  background: var(--bg-sidebar-hover);
  color: #ffffff;
}

.sidebar-link:hover i {
  color: var(--primary-light);
}

.sidebar-link.active {
  background: linear-gradient(135deg, var(--primary) 0%, #3730a3 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

.sidebar-link.active i {
  color: #ffffff;
}

.main-content-wrapper {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background-color: var(--bg-body);
}

.modern-topbar {
  height: 68px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.03);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.topbar-left h5 {
  font-size: 1.1rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  letter-spacing: -0.2px;
}

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

.admin-page-content {
  padding: 24px;
  flex-grow: 1;
  min-width: 0;
}

/* ==========================================================================
   STAT CARDS & WIDGETS (REFINED & HARMONIOUS)
   ========================================================================== */
.stat-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  min-height: 112px;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 20px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  border-color: #cbd5e1;
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3.5px;
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
}

.stat-primary::before { background: linear-gradient(90deg, #4f46e5, #6366f1); }
.stat-success::before { background: linear-gradient(90deg, #10b981, #34d399); }
.stat-warning::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.stat-danger::before { background: linear-gradient(90deg, #ef4444, #f87171); }
.stat-info::before { background: linear-gradient(90deg, #0ea5e9, #38bdf8); }

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
  margin-left: 14px;
  transition: transform 0.2s ease;
}

.stat-card:hover .stat-icon {
  transform: scale(1.08);
}

.stat-primary .stat-icon { background: var(--primary-light); color: var(--primary); }
.stat-success .stat-icon { background: var(--success-light); color: var(--success); }
.stat-warning .stat-icon { background: var(--warning-light); color: var(--warning); }
.stat-danger .stat-icon { background: var(--danger-light); color: var(--danger); }
.stat-info .stat-icon { background: var(--info-light); color: var(--info); }

.stat-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
  letter-spacing: -0.5px;
}

.stat-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ==========================================================================
   TOPBAR USER PILL & PROFILE SYSTEM
   ========================================================================== */
.topbar-right .dropdown {
  position: relative !important;
}

.topbar-right .dropdown-menu,
.modern-topbar .dropdown-menu {
  position: absolute !important;
  top: 100% !important;
  right: 0 !important;
  left: auto !important;
  margin-top: 6px !important;
  transform: none !important;
  z-index: 1060 !important;
}

.topbar-user-btn {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 4px 14px 4px 6px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-main);
  box-shadow: var(--shadow-xs);
}

.topbar-user-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  box-shadow: var(--shadow-sm);
  color: var(--primary);
}

.topbar-user-avatar {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid #e0e7ff;
}

.profile-avatar-container {
  position: relative;
  display: inline-block;
  margin: 0 auto;
}

.profile-avatar-img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #ffffff;
  box-shadow: var(--shadow-md);
  background: #f1f5f9;
}

.profile-avatar-upload-badge {
  position: absolute;
  bottom: 2px;
  right: 2px;
  background: var(--primary);
  color: #ffffff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  border: 3px solid #ffffff;
  transition: all 0.2s ease;
}

.profile-avatar-upload-badge:hover {
  background: var(--primary-hover);
  transform: scale(1.1);
}

.password-toggle-wrapper {
  position: relative;
}

.password-toggle-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  font-size: 0.95rem;
  z-index: 5;
}

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

/* ==========================================================================
   QUICK ACTION SHORTCUT CARDS
   ========================================================================== */
.quick-action-card {
  display: flex;
  align-items: center;
  padding: 16px 18px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  text-decoration: none !important;
  color: var(--text-main);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  height: 100%;
}

.quick-action-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  border-color: #cbd5e1;
  color: var(--text-main);
}

.quick-action-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-right: 14px;
  transition: transform 0.2s ease;
}

.quick-action-card:hover .quick-action-icon {
  transform: scale(1.08);
}

.quick-action-icon.primary { background: var(--primary-light); color: var(--primary); }
.quick-action-icon.success { background: var(--success-light); color: var(--success); }
.quick-action-icon.info { background: var(--info-light); color: var(--info); }
.quick-action-icon.warning { background: var(--warning-light); color: var(--warning); }
.quick-action-icon.dark { background: #f1f5f9; color: #475569; }

.quick-action-content {
  flex-grow: 1;
  min-width: 0;
}

.quick-action-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2px;
  line-height: 1.2;
}

.quick-action-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-action-arrow {
  color: #cbd5e1;
  font-size: 0.85rem;
  margin-left: 8px;
  transition: transform 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}

.quick-action-card:hover .quick-action-arrow {
  color: var(--primary);
  transform: translateX(3px);
}



/* ==========================================================================
   MODERN PANELS, TABLES & BADGES
   ========================================================================== */
.card-modern {
  background: #ffffff;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  margin-bottom: 28px;
  overflow: hidden;
}

.card-modern-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: #ffffff;
}

.card-modern-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-modern-body {
  padding: 24px;
}

.table-responsive {
  -webkit-overflow-scrolling: touch;
}

.table-modern {
  width: 100% !important;
  border-collapse: separate;
  border-spacing: 0;
}

.table-modern thead th {
  background: #f8fafc !important;
  color: #475569 !important;
  font-size: 0.8rem !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  padding: 14px 18px !important;
  border-top: 1px solid var(--border-color) !important;
  border-bottom: 1px solid var(--border-color) !important;
  white-space: nowrap;
}

.table-modern tbody td {
  padding: 14px 18px !important;
  vertical-align: middle !important;
  border-bottom: 1px solid var(--border-light) !important;
  font-size: 0.92rem !important;
  color: var(--text-main) !important;
}

.table-modern tbody tr:hover td {
  background-color: #f8fafc !important;
}

.badge-pill-modern {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.badge-pill-success {
  background: var(--success-light);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-pill-danger {
  background: var(--danger-light);
  color: #b91c1c;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.badge-pill-warning {
  background: var(--warning-light);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge-pill-info {
  background: var(--info-light);
  color: #0369a1;
  border: 1px solid rgba(14, 165, 233, 0.25);
}

.badge-pill-secondary {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid var(--border-color);
}

/* ==========================================================================
   DATATABLES OVERHAUL & SEARCH BOX EMBEDDED ICON
   ========================================================================== */
div.dataTables_wrapper {
  padding: 0 !important;
}

div.dataTables_wrapper div.dataTables_length,
div.dataTables_wrapper div.dataTables_filter {
  margin-bottom: 18px !important;
}

div.dataTables_wrapper div.dataTables_filter {
  text-align: right !important;
}

div.dataTables_wrapper div.dataTables_filter label {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  margin-bottom: 0 !important;
  width: 100% !important;
  max-width: 340px !important;
  color: transparent !important;
  font-size: 0 !important;
}

div.dataTables_wrapper div.dataTables_filter label::before {
  content: "\f002" !important;
  font-family: "FontAwesome" !important;
  position: absolute !important;
  left: 15px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  font-size: 0.92rem !important;
  color: #94a3b8 !important;
  pointer-events: none !important;
  z-index: 3 !important;
  line-height: 1 !important;
  transition: color 0.2s ease !important;
}

div.dataTables_wrapper div.dataTables_filter label:focus-within::before {
  color: var(--primary) !important;
}

div.dataTables_wrapper div.dataTables_filter input,
div.dataTables_wrapper div.dataTables_filter label input {
  height: 42px !important;
  padding: 8px 18px 8px 40px !important;
  border-radius: var(--radius-full) !important;
  border: 1.5px solid var(--border-color) !important;
  background-color: #ffffff !important;
  font-size: 0.88rem !important;
  font-weight: 500 !important;
  color: var(--text-main) !important;
  box-shadow: var(--shadow-xs) !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  margin: 0 !important;
  width: 100% !important;
  display: block !important;
}

div.dataTables_wrapper div.dataTables_filter input:focus,
div.dataTables_wrapper div.dataTables_filter label input:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3.5px var(--primary-glow) !important;
  background-color: #ffffff !important;
  outline: none !important;
}

div.dataTables_wrapper div.dataTables_length label {
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  color: var(--text-muted) !important;
  display: inline-flex !important;
  align-items: center !important;
  margin-bottom: 0 !important;
}

div.dataTables_wrapper div.dataTables_length select {
  height: 40px !important;
  border-radius: var(--radius-md) !important;
  border: 1.5px solid var(--border-color) !important;
  padding: 4px 14px !important;
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  color: var(--text-main) !important;
  background-color: #ffffff !important;
  margin: 0 8px !important;
  outline: none !important;
  transition: all 0.2s ease !important;
}

div.dataTables_wrapper div.dataTables_length select:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px var(--primary-glow) !important;
}

div.dataTables_wrapper div.dataTables_info {
  font-size: 0.88rem !important;
  color: var(--text-muted) !important;
  font-weight: 500 !important;
  padding-top: 14px !important;
}

div.dataTables_wrapper div.dataTables_paginate {
  padding-top: 10px !important;
}

/* Reset <li> completely to prevent double box / card-in-card bug */
div.dataTables_wrapper div.dataTables_paginate ul.pagination li,
div.dataTables_wrapper div.dataTables_paginate ul.pagination li.paginate_button,
div.dataTables_wrapper div.dataTables_paginate ul.pagination li.page-item {
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
  display: inline-flex !important;
}

div.dataTables_wrapper div.dataTables_paginate ul.pagination {
  gap: 4px !important;
  justify-content: flex-end !important;
  margin: 0 !important;
  list-style: none !important;
}

div.dataTables_wrapper div.dataTables_paginate ul.pagination .page-item .page-link {
  min-width: 38px !important;
  height: 38px !important;
  padding: 0 12px !important;
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  color: var(--text-main) !important;
  background: #ffffff !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-md) !important;
  text-decoration: none !important;
  transition: all 0.2s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}

div.dataTables_wrapper div.dataTables_paginate ul.pagination .page-item.active .page-link {
  background: linear-gradient(135deg, var(--primary) 0%, #3730a3 100%) !important;
  border-color: var(--primary) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.35) !important;
}

div.dataTables_wrapper div.dataTables_paginate ul.pagination .page-item.disabled .page-link {
  opacity: 0.45 !important;
  cursor: not-allowed !important;
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
  color: var(--text-muted) !important;
  box-shadow: none !important;
}

div.dataTables_wrapper div.dataTables_paginate ul.pagination .page-item:not(.active):not(.disabled) .page-link:hover {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: var(--primary) !important;
}

/* ==========================================================================
   MODAL MODERNIZATION
   ========================================================================== */
.modal-content-modern {
  border-radius: var(--radius-2xl) !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: var(--shadow-xl) !important;
  overflow: hidden;
  animation: modalPop 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header-modern {
  padding: 20px 24px;
  background: #0f172a;
  color: #ffffff;
  border-bottom: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header-modern .modal-title {
  color: #ffffff !important;
  font-weight: 800;
  font-size: 1.2rem;
}

.modal-header-modern .close {
  color: #ffffff !important;
  opacity: 0.8 !important;
  font-size: 1.5rem !important;
  padding: 0 !important;
  margin: 0 !important;
  background: none !important;
  border: none !important;
  cursor: pointer !important;
}

.modal-header-modern .close:hover {
  opacity: 1 !important;
}

.modal-body-modern {
  padding: 24px;
}

.modal-footer-modern {
  padding: 16px 24px;
  background: #f8fafc;
  border-top: 1px solid var(--border-color);
}

/* ==========================================================================
   COMPREHENSIVE MOBILE RESPONSIVENESS & TOUCH OPTIMIZATION
   ========================================================================== */

/* Tablets & Small Laptops (< 992px) */
@media (max-width: 991.98px) {
  .modern-sidebar {
    position: fixed !important;
    top: 0 !important;
    left: -290px !important;
    bottom: 0 !important;
    width: 280px !important;
    min-width: 280px !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100vh !important;
    box-shadow: var(--shadow-xl) !important;
    z-index: 1050 !important;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  }

  .modern-sidebar.show {
    left: 0 !important;
  }

  .sidebar-backdrop {
    z-index: 1040 !important;
  }

  .modern-topbar {
    padding: 0 16px;
    height: 62px;
    z-index: 1000 !important;
  }

  .topbar-right .dropdown {
    position: relative !important;
  }

  .topbar-left {
    gap: 12px;
  }

  .topbar-left h5 {
    font-size: 0.95rem;
  }

  .topbar-left small {
    font-size: 0.75rem;
  }

  .topbar-right {
    gap: 8px;
  }

  .topbar-user-btn {
    padding: 3px 8px 3px 4px;
    gap: 6px;
    font-size: 0.85rem;
  }

  .topbar-user-avatar {
    width: 28px;
    height: 28px;
  }

  .admin-page-content {
    padding: 18px 14px;
  }

  .stat-card {
    padding: 16px 18px;
    margin-bottom: 12px;
    min-height: 95px;
  }

  .stat-value {
    font-size: 1.55rem;
  }
}

/* Mobile Devices (< 768px) */
@media (max-width: 767.98px) {
  .modern-topbar {
    height: 58px;
    padding: 0 12px;
  }

  .topbar-left {
    gap: 10px;
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
  }

  #toggleSidebar {
    width: 36px;
    height: 36px;
    padding: 0 !important;
    font-size: 1rem;
    flex-shrink: 0;
  }

  .topbar-left h5 {
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
  }

  .topbar-left small {
    display: none !important;
  }

  .topbar-right {
    gap: 6px;
    flex-shrink: 0;
  }

  .topbar-user-btn {
    padding: 3px 8px 3px 4px;
    gap: 6px;
    font-size: 0.82rem;
  }

  .topbar-user-btn span {
    max-width: 85px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
  }

  .topbar-user-avatar {
    width: 28px;
    height: 28px;
  }

  .topbar-right .dropdown {
    position: relative !important;
  }

  .dropdown-menu-right,
  .modern-topbar .dropdown-menu {
    position: absolute !important;
    right: 0 !important;
    left: auto !important;
    top: 100% !important;
    margin-top: 6px !important;
    min-width: 190px !important;
    max-width: 90vw !important;
    z-index: 1080 !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.05) !important;
    border-radius: var(--radius-lg) !important;
    background: #ffffff !important;
    transform: none !important;
  }

  .admin-page-content {
    padding: 14px 10px;
  }

  /* Stat cards on mobile */
  .stat-card {
    padding: 14px 16px;
    margin-bottom: 10px;
    min-height: 84px;
  }

  .stat-title {
    font-size: 0.72rem;
  }

  .stat-value {
    font-size: 1.4rem;
  }

  .stat-desc {
    font-size: 0.75rem;
  }

  .stat-icon {
    width: 40px;
    height: 40px;
    font-size: 1.15rem;
    margin-left: 6px;
  }

  /* Welcome banner */
  .card-modern.p-4 {
    padding: 18px 14px !important;
  }
  .card-modern.p-4 h3 {
    font-size: 1.2rem !important;
  }
  .card-modern.p-4 .btn {
    width: 100% !important;
    margin-top: 10px;
  }

  /* Quick action cards */
  .quick-action-card {
    padding: 12px 14px;
    margin-bottom: 8px;
  }
  .quick-action-icon {
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
    margin-right: 10px;
  }
  .quick-action-title {
    font-size: 0.88rem;
  }
  .quick-action-subtitle {
    font-size: 0.75rem;
  }

  /* Card modern body & header */
  .card-modern {
    margin-bottom: 18px;
    border-radius: var(--radius-lg);
  }

  .card-modern-header {
    padding: 14px 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .card-modern-title {
    font-size: 1rem;
  }

  .card-modern-header .d-flex {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
  }

  .card-modern-header .btn {
    flex: 1 1 auto;
    margin-left: 0 !important;
    font-size: 0.82rem !important;
    padding: 8px 12px !important;
    text-align: center;
    justify-content: center;
    white-space: nowrap;
  }

  .card-modern-body {
    padding: 14px;
  }

  /* Auth cards on mobile */
  .auth-card {
    padding: 24px 20px;
    border-radius: var(--radius-xl);
    max-width: 380px;
    box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.4);
  }

  .auth-brand {
    margin-bottom: 20px;
  }

  .auth-brand img {
    max-height: 65px;
  }

  .auth-title {
    font-size: 1.2rem;
    line-height: 1.25;
  }

  .auth-subtitle {
    font-size: 0.78rem;
    margin-top: 4px;
    margin-bottom: 0;
  }

  .form-control-voter-id {
    font-size: 1.15rem !important;
    height: 50px !important;
    letter-spacing: 2px !important;
  }

  /* Voting booth on mobile */
  .voting-container {
    padding: 12px 8px 36px 8px;
  }

  .voting-header {
    padding: 12px 14px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    border-radius: var(--radius-lg);
    margin-bottom: 18px;
  }

  .voting-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 10px;
  }

  .voting-header-brand {
    gap: 10px;
    min-width: 0;
    flex: 1 1 auto;
  }

  .voting-header-brand img {
    height: 38px;
    max-width: 42px;
  }

  .voting-brand-title {
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .voting-brand-subtitle {
    font-size: 0.72rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .btn-voting-logout-mobile {
    padding: 6px 12px !important;
    font-size: 0.78rem !important;
    gap: 5px !important;
    border-radius: 999px !important;
    flex-shrink: 0;
  }

  .btn-voting-logout-mobile i {
    font-size: 0.82rem !important;
  }

  .voting-header-user {
    width: 100%;
    display: flex;
  }

  .voting-voter-pill {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 12px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid var(--border-color);
  }

  .voting-voter-avatar {
    width: 34px;
    height: 34px;
    min-width: 34px;
    font-size: 0.85rem;
  }

  .voting-voter-info {
    min-width: 0;
    flex: 1;
  }

  .voting-voter-name {
    font-size: 0.85rem;
    font-weight: 700;
  }

  .voting-voter-meta {
    font-size: 0.72rem;
  }

  .voting-instruction-banner {
    padding: 18px 14px;
    border-radius: var(--radius-lg);
  }

  .voting-instruction-banner h2 {
    font-size: 1.2rem;
  }

  .candidate-img-wrap {
    height: auto !important;
    aspect-ratio: 1 / 1.415 !important;
  }

  /* DataTables toolbar mobile stacking */
  .dataTables_wrapper .dataTables_length,
  .dataTables_wrapper .dataTables_filter {
    text-align: left !important;
    width: 100%;
    margin-bottom: 10px;
  }

  .dataTables_wrapper .dataTables_filter input {
    width: 100% !important;
    min-width: 0 !important;
    margin-left: 0 !important;
  }

  /* DataTables info & pagination for tablets & mobile */
  .dataTables_wrapper .dataTables_info {
    text-align: center !important;
    width: 100% !important;
    font-size: 0.84rem !important;
    padding-top: 10px !important;
    margin-bottom: 8px !important;
  }

  .dataTables_wrapper .dataTables_paginate {
    text-align: center !important;
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 6px 0 10px 0 !important;
  }

  .dataTables_wrapper .dataTables_paginate .pagination {
    display: inline-flex !important;
    flex-wrap: nowrap !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 4px !important;
    margin: 0 auto !important;
    padding: 2px !important;
    list-style: none !important;
  }

  .dataTables_wrapper .dataTables_paginate ul.pagination li,
  .dataTables_wrapper .dataTables_paginate ul.pagination li.paginate_button,
  .dataTables_wrapper .dataTables_paginate ul.pagination li.page-item {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    display: inline-flex !important;
  }

  .dataTables_wrapper .dataTables_paginate ul.pagination .page-item .page-link {
    min-width: 34px !important;
    height: 34px !important;
    padding: 0 8px !important;
    font-size: 0.84rem !important;
    border-radius: 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
    margin: 0 !important;
  }

  .table-responsive {
    border-radius: var(--radius-md);
  }

  .table-modern thead th,
  .table-modern tbody td {
    padding: 10px 12px !important;
    font-size: 0.85rem !important;
  }
}

/* Extra Small Phones (< 576px) */
@media (max-width: 575.98px) {
  .modern-topbar {
    height: 54px;
    padding: 0 10px;
  }

  .topbar-left h5 {
    font-size: 0.85rem;
    max-width: 160px;
  }

  .topbar-user-btn {
    padding: 2px;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    justify-content: center;
  }

  .topbar-user-btn span {
    display: none !important;
  }

  .topbar-user-btn::after {
    display: none !important;
  }

  .btn {
    font-size: 0.82rem !important;
    padding: 7px 12px !important;
  }

  .btn-modern {
    height: 46px;
    font-size: 0.92rem;
  }

  .stat-card {
    padding: 12px 14px;
    min-height: 78px;
  }

  .stat-title {
    font-size: 0.68rem;
  }

  .stat-value {
    font-size: 1.3rem;
  }

  .stat-desc {
    font-size: 0.72rem;
  }

  .stat-icon {
    width: 36px;
    height: 36px;
    font-size: 1.05rem;
    border-radius: 10px;
    margin-left: 4px;
  }

  .modal-dialog {
    margin: 8px;
  }

  .modal-body-modern {
    padding: 14px;
  }

  .modal-header-modern {
    padding: 14px 16px;
  }

  .modal-footer-modern {
    padding: 12px 16px;
  }

  .candidate-img-wrap {
    height: 200px;
  }

  .voting-voter-pill {
    padding: 4px 8px;
  }

  /* Ultra-compact DataTables pagination for mobile phones (< 576px) */
  .dataTables_wrapper .dataTables_info {
    font-size: 0.8rem !important;
    padding-top: 8px !important;
    margin-bottom: 6px !important;
    text-align: center !important;
  }

  .dataTables_wrapper .dataTables_paginate {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 4px 0 8px 0 !important;
    width: 100% !important;
  }

  .dataTables_wrapper .dataTables_paginate ul.pagination {
    display: inline-flex !important;
    flex-wrap: nowrap !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 3px !important;
    margin: 0 auto !important;
    padding: 2px !important;
  }

  .dataTables_wrapper .dataTables_paginate ul.pagination li,
  .dataTables_wrapper .dataTables_paginate ul.pagination li.paginate_button,
  .dataTables_wrapper .dataTables_paginate ul.pagination li.page-item {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
  }

  .dataTables_wrapper .dataTables_paginate ul.pagination .page-item .page-link {
    min-width: 32px !important;
    height: 32px !important;
    padding: 0 6px !important;
    font-size: 0.8rem !important;
    border-radius: 7px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
  }
}

/* ==========================================================================
   SUMMERNOTE CUSTOM STYLES
   ========================================================================== */
.note-editor.note-frame {
  border: 1.5px solid var(--border-color) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: none !important;
  overflow: hidden;
  background: #ffffff;
}

.note-editor.note-frame:focus-within {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12) !important;
}

.note-editor.note-frame .note-toolbar {
  background: #f8fafc !important;
  border-bottom: 1px solid var(--border-color) !important;
  padding: 6px 8px !important;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.note-editor.note-frame .note-btn {
  background: #ffffff !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-sm) !important;
  color: #334155 !important;
  padding: 5px 9px !important;
  font-size: 0.82rem !important;
  font-weight: 600;
  transition: all 0.2s ease;
}

.note-editor.note-frame .note-btn:hover,
.note-editor.note-frame .note-btn.active {
  background: var(--primary-light) !important;
  color: var(--primary) !important;
  border-color: var(--primary) !important;
}

.note-editor.note-frame .note-editing-area .note-editable {
  font-size: 0.92rem;
  color: var(--text-main);
  line-height: 1.6;
  padding: 12px 14px;
  background: #ffffff;
  min-height: 120px;
}

.rich-content ul, 
.rich-content ol {
  padding-left: 20px;
  margin-bottom: 8px;
}

.rich-content p {
  margin-bottom: 8px;
}

.rich-content p:last-child,
.rich-content ul:last-child,
.rich-content ol:last-child {
  margin-bottom: 0;
}

/* Auth screen height adaptivity (landscape / short viewport) */
@media (max-height: 620px) {
  .auth-card {
    padding: 16px 18px !important;
  }
  .auth-brand {
    margin-bottom: 12px !important;
  }
  .auth-brand img {
    max-height: 48px !important;
  }
  .auth-title {
    font-size: 1.05rem !important;
  }
  .auth-subtitle {
    font-size: 0.72rem !important;
  }
  .form-group-modern {
    margin-bottom: 10px !important;
  }
}

@media (max-height: 420px) {
  html.auth-html,
  body.auth-page {
    position: static !important;
    overflow-y: auto !important;
  }
  .auth-wrapper {
    height: auto !important;
    min-height: 100vh !important;
    overflow-y: auto !important;
  }
}
