/* nStorage Custom Styles & Micro-interactions */
:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: #f8fafc;
  color: #1e293b;
}

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

/* Transitions */
.transition-smooth {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Pulsing badge for Quick Edit mode */
@keyframes pulse-amber {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.5);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(245, 158, 11, 0);
  }
}

.quick-edit-active {
  animation: pulse-amber 2s infinite;
}

/* Toast container */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 400px;
  padding: 0.875rem 1.25rem;
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
  font-weight: 500;
  animation: slideIn 0.3s ease-out forwards;
}

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

.toast-success {
  background-color: #065f46;
  color: #ecfdf5;
}

.toast-error {
  background-color: #991b1b;
  color: #fef2f2;
}

.toast-info {
  background-color: #1e40af;
  color: #eff6ff;
}

.toast-warning {
  background-color: #92400e;
  color: #fffbeb;
}

/* Quick edit amount controls */
.stepper-btn {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem;
  font-weight: bold;
  user-select: none;
}

/* Item image preview thumbnail */
.item-thumb {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 0.375rem;
  background-color: #e2e8f0;
}

/* Modal Backdrop */
.modal-backdrop {
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(2px);
}

/* ======================================================== */
/* SSL & Network Mode High-Contrast Cards & Buttons        */
/* ======================================================== */

/* High-contrast unselected state */
.ssl-mode-card {
  border: 2px solid #64748b !important; /* Dark, crisp slate-500 border */
  background-color: #f8fafc !important;
  border-radius: 0.875rem !important;
  padding: 1.25rem !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1) !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  height: 100% !important;
}

.ssl-mode-card:hover {
  border-color: #1e293b !important;
  background-color: #f1f5f9 !important;
  box-shadow: 0 4px 8px -1px rgba(0, 0, 0, 0.15) !important;
  transform: translateY(-1px);
}

/* High-contrast active Intranet state */
.ssl-mode-card.active-intranet {
  border: 3px solid #1d4ed8 !important; /* Bold primary blue border */
  background-color: #eff6ff !important;
  box-shadow: 0 4px 14px -2px rgba(29, 78, 216, 0.35) !important;
  outline: 2px solid #93c5fd !important;
  outline-offset: 1px !important;
}

/* High-contrast active Internet state */
.ssl-mode-card.active-internet {
  border: 3px solid #4338ca !important; /* Bold primary indigo border */
  background-color: #eef2ff !important;
  box-shadow: 0 4px 14px -2px rgba(67, 56, 202, 0.35) !important;
  outline: 2px solid #a5b4fc !important;
  outline-offset: 1px !important;
}

/* Request Let's Encrypt SSL Button: High-visibility Emerald Green */
.btn-ssl-request {
  background-color: #059669 !important;
  color: #ffffff !important;
  border: 2px solid #047857 !important;
  border-radius: 0.5rem !important;
  padding: 0.625rem 1.125rem !important;
  font-weight: 700 !important;
  font-size: 0.75rem !important;
  box-shadow: 0 2px 5px rgba(5, 150, 105, 0.4) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  cursor: pointer !important;
  transition: all 0.15s ease-in-out !important;
}

.btn-ssl-request:hover:not(:disabled) {
  background-color: #047857 !important;
  border-color: #065f46 !important;
  box-shadow: 0 4px 8px rgba(5, 150, 105, 0.5) !important;
  transform: translateY(-1px);
}

.btn-ssl-request:disabled {
  opacity: 0.65 !important;
  cursor: not-allowed !important;
}

/* Save & Apply Mode Button */
.btn-ssl-save {
  background-color: #1d4ed8 !important;
  color: #ffffff !important;
  border: 2px solid #1e40af !important;
  border-radius: 0.5rem !important;
  padding: 0.625rem 1.25rem !important;
  font-weight: 700 !important;
  font-size: 0.75rem !important;
  box-shadow: 0 2px 5px rgba(29, 78, 216, 0.35) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  cursor: pointer !important;
  transition: all 0.15s ease-in-out !important;
}

.btn-ssl-save:hover:not(:disabled) {
  background-color: #1e40af !important;
  transform: translateY(-1px);
}

/* Renewal Dry-Run Button */
.btn-ssl-renew {
  background-color: #ffffff !important;
  color: #1e293b !important;
  border: 2px solid #64748b !important;
  border-radius: 0.5rem !important;
  padding: 0.625rem 1rem !important;
  font-weight: 700 !important;
  font-size: 0.75rem !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.375rem !important;
  cursor: pointer !important;
  transition: all 0.15s ease-in-out !important;
}

.btn-ssl-renew:hover:not(:disabled) {
  background-color: #f1f5f9 !important;
  border-color: #1e293b !important;
}

/* ======================================================== */
/* System-Wide Themes: Light & Dark Specifications          */
/* ======================================================== */

/* --- 1. Login Screen Light Mode --- */
#login-screen.theme-light,
body.light-theme #login-screen {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #f1f5f9 100%) !important;
  color: #0f172a !important;
  min-height: 100vh !important;
}
#login-screen.theme-light .login-brand-title,
body.light-theme #login-screen .login-brand-title {
  color: #0f172a !important;
}
#login-screen.theme-light .login-brand-subtitle,
body.light-theme #login-screen .login-brand-subtitle {
  color: #2563eb !important;
}
#login-screen.theme-light .login-brand-desc,
body.light-theme #login-screen .login-brand-desc {
  color: #475569 !important;
}
#login-screen.theme-light .login-card,
body.light-theme #login-screen .login-card {
  background-color: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04) !important;
  color: #0f172a !important;
}
#login-screen.theme-light .login-label,
body.light-theme #login-screen .login-label {
  color: #334155 !important;
  font-weight: 700 !important;
}
#login-screen.theme-light .login-input,
body.light-theme #login-screen .login-input {
  width: 100% !important;
  background-color: #f8fafc !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 0.75rem !important;
  padding: 0.625rem 1rem 0.625rem 2.5rem !important;
  font-size: 0.875rem !important;
  color: #0f172a !important;
}
#login-screen.theme-light .login-input:focus,
body.light-theme #login-screen .login-input:focus {
  outline: none !important;
  border-color: #2563eb !important;
  background-color: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2) !important;
}
#login-screen.theme-light .login-input::placeholder,
body.light-theme #login-screen .login-input::placeholder {
  color: #94a3b8 !important;
}
#login-screen.theme-light .login-demo-roles,
body.light-theme #login-screen .login-demo-roles {
  border-color: #e2e8f0 !important;
}
#login-screen.theme-light .login-demo-title,
body.light-theme #login-screen .login-demo-title {
  color: #64748b !important;
}
#login-screen.theme-light .btn-demo-admin,
body.light-theme #login-screen .btn-demo-admin {
  background-color: #faf5ff !important;
  border: 1.5px solid #d8b4fe !important;
}
#login-screen.theme-light .btn-demo-admin:hover,
body.light-theme #login-screen .btn-demo-admin:hover {
  background-color: #f3e8ff !important;
  border-color: #c084fc !important;
}
#login-screen.theme-light .btn-demo-admin-title,
body.light-theme #login-screen .btn-demo-admin-title {
  color: #7e22ce !important;
}
#login-screen.theme-light .btn-demo-admin-sub,
body.light-theme #login-screen .btn-demo-admin-sub {
  color: #9333ea !important;
}
#login-screen.theme-light .btn-demo-staff,
body.light-theme #login-screen .btn-demo-staff {
  background-color: #eff6ff !important;
  border: 1.5px solid #93c5fd !important;
}
#login-screen.theme-light .btn-demo-staff:hover,
body.light-theme #login-screen .btn-demo-staff:hover {
  background-color: #dbeafe !important;
  border-color: #60a5fa !important;
}
#login-screen.theme-light .btn-demo-staff-title,
body.light-theme #login-screen .btn-demo-staff-title {
  color: #1d4ed8 !important;
}
#login-screen.theme-light .btn-demo-staff-sub,
body.light-theme #login-screen .btn-demo-staff-sub {
  color: #2563eb !important;
}
#login-screen.theme-light .btn-demo-guest,
body.light-theme #login-screen .btn-demo-guest {
  background-color: #f8fafc !important;
  border: 1.5px solid #cbd5e1 !important;
}
#login-screen.theme-light .btn-demo-guest:hover,
body.light-theme #login-screen .btn-demo-guest:hover {
  background-color: #f1f5f9 !important;
  border-color: #94a3b8 !important;
}
#login-screen.theme-light .btn-demo-guest-title,
body.light-theme #login-screen .btn-demo-guest-title {
  color: #334155 !important;
}
#login-screen.theme-light .btn-demo-guest-sub,
body.light-theme #login-screen .btn-demo-guest-sub {
  color: #64748b !important;
}
#login-screen.theme-light .login-footer-security,
body.light-theme #login-screen .login-footer-security {
  color: #64748b !important;
}
#login-screen.theme-light #login-error-alert,
body.light-theme #login-screen #login-error-alert {
  background-color: #fef2f2 !important;
  border: 1px solid #fca5a5 !important;
  color: #991b1b !important;
}

/* --- 2. Login Screen Dark Mode --- */
#login-screen.theme-dark,
body.dark-theme #login-screen {
  background: linear-gradient(135deg, #0f172a 0%, #0a192f 50%, #0f172a 100%) !important;
  color: #ffffff !important;
  min-height: 100vh !important;
}
#login-screen.theme-dark .login-brand-title,
body.dark-theme #login-screen .login-brand-title {
  color: #ffffff !important;
}
#login-screen.theme-dark .login-brand-subtitle,
body.dark-theme #login-screen .login-brand-subtitle {
  color: #60a5fa !important;
}
#login-screen.theme-dark .login-brand-desc,
body.dark-theme #login-screen .login-brand-desc {
  color: #94a3b8 !important;
}
#login-screen.theme-dark .login-card,
body.dark-theme #login-screen .login-card {
  background-color: rgba(30, 41, 59, 0.95) !important;
  border: 1px solid rgba(71, 85, 105, 0.7) !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
  color: #ffffff !important;
}
#login-screen.theme-dark .login-label,
body.dark-theme #login-screen .login-label {
  color: #cbd5e1 !important;
  font-weight: 700 !important;
}
#login-screen.theme-dark .login-input,
body.dark-theme #login-screen .login-input {
  width: 100% !important;
  background-color: rgba(15, 23, 42, 0.85) !important;
  border: 1px solid #475569 !important;
  border-radius: 0.75rem !important;
  padding: 0.625rem 1rem 0.625rem 2.5rem !important;
  font-size: 0.875rem !important;
  color: #ffffff !important;
}
#login-screen.theme-dark .login-input:focus,
body.dark-theme #login-screen .login-input:focus {
  outline: none !important;
  border-color: #3b82f6 !important;
  background-color: rgba(15, 23, 42, 0.95) !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35) !important;
}
#login-screen.theme-dark .login-input::placeholder,
body.dark-theme #login-screen .login-input::placeholder {
  color: #64748b !important;
}
#login-screen.theme-dark .login-demo-roles,
body.dark-theme #login-screen .login-demo-roles {
  border-color: rgba(71, 85, 105, 0.6) !important;
}
#login-screen.theme-dark .login-demo-title,
body.dark-theme #login-screen .login-demo-title {
  color: #94a3b8 !important;
}
#login-screen.theme-dark .btn-demo-admin,
body.dark-theme #login-screen .btn-demo-admin {
  background-color: rgba(88, 28, 135, 0.45) !important;
  border: 1px solid rgba(168, 85, 247, 0.45) !important;
}
#login-screen.theme-dark .btn-demo-admin:hover,
body.dark-theme #login-screen .btn-demo-admin:hover {
  background-color: rgba(88, 28, 135, 0.75) !important;
  border-color: rgba(168, 85, 247, 0.75) !important;
}
#login-screen.theme-dark .btn-demo-admin-title,
body.dark-theme #login-screen .btn-demo-admin-title {
  color: #d8b4fe !important;
}
#login-screen.theme-dark .btn-demo-admin-sub,
body.dark-theme #login-screen .btn-demo-admin-sub {
  color: rgba(192, 132, 252, 0.8) !important;
}
#login-screen.theme-dark .btn-demo-staff,
body.dark-theme #login-screen .btn-demo-staff {
  background-color: rgba(23, 37, 84, 0.5) !important;
  border: 1px solid rgba(59, 130, 246, 0.45) !important;
}
#login-screen.theme-dark .btn-demo-staff:hover,
body.dark-theme #login-screen .btn-demo-staff:hover {
  background-color: rgba(23, 37, 84, 0.8) !important;
  border-color: rgba(59, 130, 246, 0.75) !important;
}
#login-screen.theme-dark .btn-demo-staff-title,
body.dark-theme #login-screen .btn-demo-staff-title {
  color: #93c5fd !important;
}
#login-screen.theme-dark .btn-demo-staff-sub,
body.dark-theme #login-screen .btn-demo-staff-sub {
  color: rgba(147, 197, 253, 0.8) !important;
}
#login-screen.theme-dark .btn-demo-guest,
body.dark-theme #login-screen .btn-demo-guest {
  background-color: rgba(15, 23, 42, 0.8) !important;
  border: 1px solid rgba(71, 85, 105, 0.6) !important;
}
#login-screen.theme-dark .btn-demo-guest:hover,
body.dark-theme #login-screen .btn-demo-guest:hover {
  background-color: rgba(30, 41, 59, 0.95) !important;
  border-color: rgba(100, 116, 139, 0.85) !important;
}
#login-screen.theme-dark .btn-demo-guest-title,
body.dark-theme #login-screen .btn-demo-guest-title {
  color: #cbd5e1 !important;
}
#login-screen.theme-dark .btn-demo-guest-sub,
body.dark-theme #login-screen .btn-demo-guest-sub {
  color: #94a3b8 !important;
}
#login-screen.theme-dark .login-footer-security,
body.dark-theme #login-screen .login-footer-security {
  color: #94a3b8 !important;
}
#login-screen.theme-dark #login-error-alert,
body.dark-theme #login-screen #login-error-alert {
  background-color: rgba(69, 10, 10, 0.85) !important;
  border: 1px solid rgba(239, 68, 68, 0.5) !important;
  color: #fca5a5 !important;
}

/* Shared login button & logo */
.login-brand-logo {
  background: linear-gradient(135deg, #3b82f6 0%, #4f46e5 100%) !important;
  border: 1px solid rgba(96, 165, 250, 0.4) !important;
  box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.4) !important;
}
.login-submit-btn {
  width: 100% !important;
  padding: 0.75rem 1.5rem !important;
  background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%) !important;
  color: #ffffff !important;
  border: 1px solid #3b82f6 !important;
  border-radius: 0.75rem !important;
  font-size: 0.875rem !important;
  font-weight: 700 !important;
  box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.35) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}
.login-submit-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #1d4ed8 0%, #4338ca 100%) !important;
  box-shadow: 0 12px 20px -3px rgba(37, 99, 235, 0.5) !important;
  transform: translateY(-1px);
}
.btn-demo-role {
  border-radius: 0.5rem !important;
  padding: 0.5rem 0.25rem !important;
  text-align: center !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}
.btn-demo-role:hover {
  transform: translateY(-1px);
}

/* ======================================================== */
/* App Shell - Dark Theme Overrides                         */
/* ======================================================== */
body.dark-theme {
  background-color: #0f172a !important;
  color: #f1f5f9 !important;
}
body.dark-theme #app-shell {
  background-color: #0f172a !important;
  color: #f1f5f9 !important;
}
body.dark-theme header {
  background-color: #1e293b !important;
  border-color: #334155 !important;
}
body.dark-theme header h1 {
  color: #f8fafc !important;
}
body.dark-theme nav {
  border-color: #334155 !important;
}
body.dark-theme nav button[data-tab] {
  color: #94a3b8 !important;
}
body.dark-theme nav button[data-tab]:hover {
  color: #f1f5f9 !important;
}
body.dark-theme nav button[data-tab].text-blue-600 {
  color: #60a5fa !important;
  border-color: #3b82f6 !important;
}
body.dark-theme footer {
  background-color: #1e293b !important;
  border-color: #334155 !important;
  color: #94a3b8 !important;
}
body.dark-theme .bg-white {
  background-color: #1e293b !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}
body.dark-theme .bg-gray-50 {
  background-color: #0f172a !important;
  color: #cbd5e1 !important;
}
body.dark-theme .bg-gray-100 {
  background-color: #334155 !important;
  color: #e2e8f0 !important;
}
body.dark-theme .border-gray-100,
body.dark-theme .border-gray-200,
body.dark-theme .border-gray-300 {
  border-color: #334155 !important;
}
body.dark-theme .divide-gray-100 > * + *,
body.dark-theme .divide-gray-200 > * + * {
  border-color: #334155 !important;
}
body.dark-theme .text-gray-900 {
  color: #f8fafc !important;
}
body.dark-theme .text-gray-800 {
  color: #f1f5f9 !important;
}
body.dark-theme .text-gray-700 {
  color: #e2e8f0 !important;
}
body.dark-theme .text-gray-600 {
  color: #cbd5e1 !important;
}
body.dark-theme .text-gray-500 {
  color: #94a3b8 !important;
}
body.dark-theme .text-gray-400 {
  color: #64748b !important;
}

/* Form controls in Dark Theme */
body.dark-theme input:not([type="checkbox"]):not([type="radio"]),
body.dark-theme select,
body.dark-theme textarea {
  background-color: #0f172a !important;
  border-color: #475569 !important;
  color: #f8fafc !important;
}
body.dark-theme input::placeholder,
body.dark-theme textarea::placeholder {
  color: #64748b !important;
}

/* Search bar in dark mode */
body.dark-theme #global-search-input {
  background-color: #0f172a !important;
  border-color: #475569 !important;
  color: #f8fafc !important;
}

/* Modals in Dark Theme */
body.dark-theme .modal-backdrop > div {
  background-color: #1e293b !important;
  border: 1px solid #334155 !important;
  color: #f1f5f9 !important;
}
body.dark-theme .modal-backdrop .bg-gray-50 {
  background-color: #0f172a !important;
  border-color: #334155 !important;
}

/* Tables in Dark Theme */
body.dark-theme thead th {
  background-color: #0f172a !important;
  color: #94a3b8 !important;
  border-color: #334155 !important;
}
body.dark-theme tbody tr {
  border-color: #334155 !important;
}
body.dark-theme tbody tr:hover td {
  background-color: #273549 !important;
}

/* ======================================================== */
/* Admin Theme Mode Selection Cards                         */
/* ======================================================== */
.theme-mode-card {
  cursor: pointer;
  position: relative;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2.5px solid #cbd5e1 !important;
  border-radius: 1rem !important;
  padding: 1.5rem !important;
  background-color: #ffffff;
}
.theme-mode-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.12) !important;
}
/* Active Forced Light */
.theme-mode-card.active-light {
  border: 3px solid #2563eb !important;
  background-color: #f0f9ff !important;
  box-shadow: 0 6px 18px -2px rgba(37, 99, 235, 0.3) !important;
  outline: 2px solid #93c5fd !important;
  outline-offset: 1px !important;
}
/* Active Forced Dark */
.theme-mode-card.active-dark {
  border: 3px solid #6366f1 !important;
  background-color: #eef2ff !important;
  box-shadow: 0 6px 18px -2px rgba(99, 102, 241, 0.35) !important;
  outline: 2px solid #a5b4fc !important;
  outline-offset: 1px !important;
}
/* Active Follow Client System */
.theme-mode-card.active-auto {
  border: 3px solid #059669 !important;
  background-color: #ecfdf5 !important;
  box-shadow: 0 6px 18px -2px rgba(5, 150, 105, 0.3) !important;
  outline: 2px solid #6ee7b7 !important;
  outline-offset: 1px !important;
}

/* Theme cards in Dark Shell */
body.dark-theme .theme-mode-card {
  background-color: #1e293b !important;
  border-color: #475569 !important;
}
body.dark-theme .theme-mode-card.active-light {
  background-color: #172554 !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 6px 18px -2px rgba(59, 130, 246, 0.4) !important;
}
body.dark-theme .theme-mode-card.active-dark {
  background-color: #1e1b4b !important;
  border-color: #818cf8 !important;
  box-shadow: 0 6px 18px -2px rgba(129, 140, 248, 0.45) !important;
}
body.dark-theme .theme-mode-card.active-auto {
  background-color: #064e3b !important;
  border-color: #10b981 !important;
  box-shadow: 0 6px 18px -2px rgba(16, 185, 129, 0.4) !important;
}

/* Save Theme Button */
.btn-theme-save {
  background-color: #2563eb !important;
  color: #ffffff !important;
  border: 2px solid #1d4ed8 !important;
  border-radius: 0.5rem !important;
  padding: 0.625rem 1.25rem !important;
  font-weight: 700 !important;
  font-size: 0.8125rem !important;
  box-shadow: 0 2px 5px rgba(37, 99, 235, 0.35) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  cursor: pointer !important;
  transition: all 0.15s ease-in-out !important;
}
.btn-theme-save:hover:not(:disabled) {
  background-color: #1d4ed8 !important;
  transform: translateY(-1px);
}

/* ======================================================== */
/* Database Operations: Export, Import & Reset              */
/* ======================================================== */
.btn-db-export {
  background-color: #059669 !important;
  color: #ffffff !important;
  border: 2px solid #047857 !important;
  border-radius: 0.5rem !important;
  padding: 0.625rem 1.25rem !important;
  font-weight: 700 !important;
  font-size: 0.8125rem !important;
  box-shadow: 0 2px 5px rgba(5, 150, 105, 0.35) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  cursor: pointer !important;
  transition: all 0.15s ease-in-out !important;
}
.btn-db-export:hover:not(:disabled) {
  background-color: #047857 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(5, 150, 105, 0.45) !important;
}

.btn-db-import {
  background-color: #2563eb !important;
  color: #ffffff !important;
  border: 2px solid #1d4ed8 !important;
  border-radius: 0.5rem !important;
  padding: 0.625rem 1.25rem !important;
  font-weight: 700 !important;
  font-size: 0.8125rem !important;
  box-shadow: 0 2px 5px rgba(37, 99, 235, 0.35) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  cursor: pointer !important;
  transition: all 0.15s ease-in-out !important;
}
.btn-db-import:hover:not(:disabled) {
  background-color: #1d4ed8 !important;
  transform: translateY(-1px);
}
.btn-db-import:disabled {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
}

.btn-db-reset {
  background-color: #dc2626 !important;
  color: #ffffff !important;
  border: 2px solid #b91c1c !important;
  border-radius: 0.5rem !important;
  padding: 0.625rem 1.25rem !important;
  font-weight: 700 !important;
  font-size: 0.8125rem !important;
  box-shadow: 0 2px 5px rgba(220, 38, 38, 0.35) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  cursor: pointer !important;
  transition: all 0.15s ease-in-out !important;
}
.btn-db-reset:hover:not(:disabled) {
  background-color: #b91c1c !important;
  transform: translateY(-1px);
}

.import-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: 0.75rem;
  padding: 1.5rem;
  text-align: center;
  background-color: #f8fafc;
  cursor: pointer;
  transition: all 0.2s ease;
}
.import-dropzone:hover, .import-dropzone.dragover {
  border-color: #2563eb;
  background-color: #eff6ff;
}
body.dark-theme .import-dropzone {
  border-color: #475569;
  background-color: #0f172a;
}
body.dark-theme .import-dropzone:hover, body.dark-theme .import-dropzone.dragover {
  border-color: #3b82f6;
  background-color: #1e293b;
}

.danger-zone-box {
  border: 2px solid #fca5a5 !important;
  background-color: #fff5f5 !important;
}
body.dark-theme .danger-zone-box {
  border-color: #991b1b !important;
  background-color: #450a0a !important;
}

/* ======================================================== */
/* REGIONAL & INTERNATIONALISATION CARDS & STYLES           */
/* ======================================================== */
.regional-choice-card {
  cursor: pointer;
  position: relative;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid #cbd5e1 !important;
  border-radius: 0.875rem !important;
  padding: 1.125rem !important;
  background-color: #ffffff;
}
.regional-choice-card:hover {
  transform: translateY(-2px);
  border-color: #94a3b8 !important;
  box-shadow: 0 6px 14px -3px rgba(0, 0, 0, 0.1) !important;
}
.regional-choice-card.active {
  border: 2.5px solid #2563eb !important;
  background-color: #f0f9ff !important;
  box-shadow: 0 4px 14px -2px rgba(37, 99, 235, 0.25) !important;
  outline: 2px solid #93c5fd !important;
  outline-offset: 1px !important;
}

body.dark-theme .regional-choice-card {
  background-color: #1e293b !important;
  border-color: #475569 !important;
}
body.dark-theme .regional-choice-card:hover {
  border-color: #64748b !important;
  background-color: #243044 !important;
}
body.dark-theme .regional-choice-card.active {
  background-color: #172554 !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 4px 14px -2px rgba(59, 130, 246, 0.35) !important;
  outline: 2px solid #60a5fa !important;
}

/* Regional Save Button */
.btn-regional-save {
  background-color: #2563eb !important;
  color: #ffffff !important;
  border: 2px solid #1d4ed8 !important;
  border-radius: 0.5rem !important;
  padding: 0.625rem 1.25rem !important;
  font-weight: 700 !important;
  font-size: 0.8125rem !important;
  box-shadow: 0 2px 5px rgba(37, 99, 235, 0.35) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  cursor: pointer !important;
  transition: all 0.15s ease-in-out !important;
}
.btn-regional-save:hover {
  background-color: #1d4ed8 !important;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.5) !important;
  transform: translateY(-1px);
}

/* Language Selector Widget (Navbar & Login) */
.lang-selector-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.625rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  background-color: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
}
.lang-selector-btn:hover {
  background-color: #e2e8f0;
  border-color: #94a3b8;
}
body.dark-theme .lang-selector-btn {
  background-color: #1e293b;
  border-color: #475569;
  color: #e2e8f0;
}
body.dark-theme .lang-selector-btn:hover {
  background-color: #334155;
  border-color: #64748b;
}

.lang-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: left;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: background-color 0.15s ease;
  color: #1e293b;
}
.lang-menu-item:hover {
  background-color: #f1f5f9;
}
.lang-menu-item.active {
  background-color: #eff6ff;
  color: #2563eb;
  font-weight: 700;
}
body.dark-theme .lang-menu-item {
  color: #e2e8f0;
}
body.dark-theme .lang-menu-item:hover {
  background-color: #334155;
}
body.dark-theme .lang-menu-item.active {
  background-color: #1e3a8a;
  color: #93c5fd;
}

/* User Settings Language Selection Cards */
.user-lang-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 2px solid #e2e8f0;
  background-color: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
}
.user-lang-card:hover {
  border-color: #94a3b8;
  background-color: #f8fafc;
  transform: translateY(-1px);
}
.user-lang-card.active {
  border-color: #2563eb !important;
  background-color: #eff6ff !important;
  box-shadow: 0 2px 8px -1px rgba(37, 99, 235, 0.25) !important;
}
body.dark-theme .user-lang-card {
  background-color: #1e293b;
  border-color: #475569;
  color: #f1f5f9;
}
body.dark-theme .user-lang-card:hover {
  background-color: #243044;
  border-color: #64748b;
}
body.dark-theme .user-lang-card.active {
  background-color: #172554 !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 2px 8px -1px rgba(59, 130, 246, 0.35) !important;
}

/* ========================================================================== */
/* Mobile Portrait View & Touch Controls                                      */
/* ========================================================================== */
.no-scrollbar::-webkit-scrollbar {
  display: none !important;
}
.no-scrollbar {
  -ms-overflow-style: none !important;
  scrollbar-width: none !important;
}

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

.animate-slide-up {
  animation: slideUpDrawer 0.24s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.mobile-item-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.mobile-item-card:active {
  transform: scale(0.99);
}

.mobile-stepper-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 0.625rem;
  font-weight: 700;
  font-size: 1.125rem;
  line-height: 1;
  user-select: none;
  touch-action: manipulation;
  transition: all 0.12s ease-in-out;
}
.mobile-stepper-btn:active {
  transform: scale(0.92);
}

.mobile-storage-pill {
  transition: all 0.15s ease-in-out;
  flex-shrink: 0;
  user-select: none;
  touch-action: manipulation;
}
.mobile-storage-pill:active {
  transform: scale(0.95);
}

body.dark-theme #mobile-app-shell {
  background-color: #0f172a;
  color: #f1f5f9;
}
body.dark-theme #mobile-app-shell header {
  background-color: rgba(15, 23, 42, 0.95);
  border-color: #334155;
}
body.dark-theme #mobile-app-shell header .border-t {
  border-color: #334155;
  background-color: rgba(15, 23, 42, 0.9);
}
body.dark-theme #mobile-search-input {
  background-color: #1e293b;
  color: #f1f5f9;
  border-color: #475569;
}
body.dark-theme .mobile-item-card {
  background-color: #1e293b;
  border-color: #334155;
}
body.dark-theme #mobile-menu-drawer > div {
  background-color: #1e293b;
  color: #f1f5f9;
}
body.dark-theme #mobile-menu-drawer button.bg-slate-50 {
  background-color: #334155;
  color: #f1f5f9;
  border-color: #475569;
}

