/* ==========================================================================
   Pewny Lokal - Panel Inzyniera (Modernized)
   ========================================================================== */

:root {
  --color-primary: #1585cc;
  --color-primary-hover: #0d6eaa;
  --color-primary-light: rgba(21, 133, 204, 0.1);
  --color-accent: #c51076;
  --color-accent-hover: #a80d65;
  --color-bg: #f3f4f6;
  --color-surface: #ffffff;
  --color-surface-hover: #f9fafb;
  --color-surface-alt: #f6f9fc;
  --color-text: #111827;
  --color-text-secondary: #4b5563;
  --color-text-muted: #9ca3af;
  --color-border: #e5e7eb;
  --color-border-light: #f2f2f2;
  --color-success: #10b981;
  --color-success-text: #065f46;
  --color-warning: #f59e0b;
  --color-warning-bg: #fff3cd;
  --color-warning-text: #856404;
  --color-danger: #ef4444;
  --color-danger-text: #991b1b;
  --color-danger-bg: rgba(239, 68, 68, 0.1);
  --color-info: #3b82f6;

  --font-family-base: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-family-heading: var(--font-family-base);

  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

  --header-height: 72px;
  --sidebar-width: 250px;
  --bottom-nav-height: calc(60px + env(safe-area-inset-bottom, 0px));
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #111827;
    --color-surface: #1f2937;
    --color-surface-hover: #374151;
    --color-surface-alt: #1e293b;
    --color-text: #f9fafb;
    --color-text-secondary: #d1d5db;
    --color-text-muted: #9ca3af;
    --color-border: #374151;
    --color-border-light: #2d3748;
    --color-primary-light: rgba(21, 133, 204, 0.2);
    --color-danger-text: #fca5a5;
    --color-danger-bg: rgba(239, 68, 68, 0.15);
    --color-success-text: #6ee7b7;
    --color-warning-bg: rgba(245, 158, 11, 0.15);
    --color-warning-text: #fcd34d;
  }
}

/* --- Base --- */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-family-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--color-primary);
  color: #fff;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-heading);
  color: var(--color-text);
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 0.75em;
}

h1 { font-size: clamp(1.5rem, 4vw, 2.25rem); }
h2 { font-size: clamp(1.25rem, 3vw, 1.875rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

p {
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
  margin-bottom: 1rem;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover {
  color: var(--color-primary-hover);
}

hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: 1.5rem 0;
}

::placeholder {
  color: var(--color-text-muted) !important;
}

/* --- Utilities --- */
.text-muted { color: var(--color-text-muted) !important; }
.text-primary { color: var(--color-primary) !important; }
.text-danger { color: var(--color-danger) !important; }
.bg-surface { background-color: var(--color-surface); }
.small { font-size: 0.875rem; }

/* --- Wizytowka (contact cards) --- */
.wizytowka-link {
  text-decoration: none;
  color: var(--color-text);
  display: block;
}
.wizytowka-link:hover {
  color: var(--color-text);
  text-decoration: none;
}

.pan001 {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 0.75rem;
  transition: box-shadow 0.2s ease;
}
.pan001:hover {
  box-shadow: var(--shadow-md);
}

@media (min-width: 768px) {
  .pan001 { height: 220px; }
}

.pan001 h3 {
  margin-bottom: 0.75rem;
  font-size: 1rem;
  color: var(--color-text);
}
.pan001 p {
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
  line-height: 1.5;
  font-style: italic;
  color: var(--color-text-secondary);
}
.pan001 strong {
  color: var(--color-text);
}

.pan_card {
  width: 100%;
  padding: 0 15px;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}

.wizytowka-avatar {
  width: 100%;
  max-width: 100%;
  border-radius: 50%;
}

/* --- Material Symbols --- */
.material-symbols-rounded {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
  font-size: 24px;
  line-height: 1;
  color: inherit;
}

/* --- Page & section titles --- */
.page-title {
  color: var(--color-text);
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  font-weight: 600;
  font-family: var(--font-family-heading);
}

.section-title {
  color: var(--color-text);
  font-weight: 700;
  font-family: var(--font-family-heading);
  margin-bottom: 1rem;
}

/* --- Buttons --- */
.btn, .btn-sm, .btn-lg {
  min-height: 44px;
  border-radius: var(--radius-md);
  transition: background-color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
}

a.btn-sm {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
}

.btn-primary {
  background-color: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
  color: #fff !important;
}
.btn-primary:hover, .btn-primary:active, .btn-primary:focus {
  background-color: var(--color-primary-hover) !important;
  border-color: var(--color-primary-hover) !important;
}

.btn-accent {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff !important;
  transition: background-color 0.2s ease;
}
.btn-accent:hover {
  background-color: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
  color: #fff !important;
}

.btn-magic {
  color: var(--color-primary);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  border-radius: var(--radius-md);
  display: inline-block;
  margin-top: 10px;
  transition: all 0.2s ease;
}
.btn-magic:hover {
  background: var(--color-surface-hover);
  box-shadow: var(--shadow-md);
  color: var(--color-primary-hover);
}

/* --- Forms --- */
.form-control {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
  min-height: 44px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-control:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
  outline: none;
}

a:focus,
button:focus-visible,
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--color-primary-hover) !important;
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* --- Sidebar navigation --- */
.mainMenu {
  background-color: var(--color-surface);
  border-right: 1px solid var(--color-border);
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 50;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transition: transform 0.3s ease;
}
.mainMenu::-webkit-scrollbar { width: 4px; }
.mainMenu::-webkit-scrollbar-track { background: transparent; }
.mainMenu::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 4px; }

.menu-logo {
  display: block;
  padding: 1.5rem 1rem;
  border-bottom: 1px solid var(--color-border);
}
.menu-logo img { max-width: 130px; height: auto; }

.menu-link {
  padding: 0;
  transition: background 0.2s ease, color 0.2s ease;
  border-left: 3px solid transparent;
}
.menu-link:hover {
  background: var(--color-surface-hover);
}
.menu-link > a {
  text-decoration: none;
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  gap: 0.75rem;
  color: var(--color-text-secondary);
  font-weight: 500;
  border-left: 3px solid transparent;
}
.menu-link .material-symbols-rounded {
  font-size: 22px;
  color: inherit;
  flex-shrink: 0;
}
.menu-label {
  font-size: 14px;
  font-weight: 500;
  color: inherit;
  font-family: var(--font-family-base);
}

.menu-link:hover .material-symbols-rounded,
.menu-link:hover .menu-label {
  color: var(--color-primary);
}
.menu-link > a.active .material-symbols-rounded,
.menu-link > a.active .menu-label {
  color: var(--color-primary);
}
.menu-link > a.active {
  color: var(--color-primary);
  background-color: var(--color-primary-light);
  border-left-color: var(--color-primary);
}
.menu-link:has(> a.active) {
  border-left: 3px solid var(--color-primary);
  background: var(--color-primary-light);
}

/* --- Menu overlay --- */
.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.menu-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* --- Main layout --- */
.mainBox {
  background-color: var(--color-bg);
  min-height: 100vh;
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
}

@media (max-width: 990px) {
  .mainMenu {
    transform: translateX(-100%);
  }
  .mainMenu.open {
    transform: translateX(0);
  }
  .mainBox {
    padding-top: 16px;
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  }
  .container-fluid {
    padding-left: 16px;
    padding-right: 16px;
  }
  .chat-footer {
    bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  }
  .report-action-bar {
    bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  }
}

@media (min-width: 991px) {
  .mainMenu {
    width: 200px;
  }
  .mainBox {
    left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
  }
}

/* --- Menu bottom items --- */
.menu-link-logout {
  position: absolute;
  bottom: 40px;
  left: 0;
  width: 100%;
  border-top: 1px solid var(--color-border);
}
.menu-copyright {
  position: absolute;
  bottom: 8px;
  left: 16px;
  width: calc(100% - 32px);
  color: var(--color-text-muted);
  font-size: 0.75em;
  font-family: var(--font-family-base);
}

/* --- Stat cards --- */
.stat-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  height: 100%;
}
.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.stat-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
}
.stat-card-icon .material-symbols-rounded {
  font-size: 24px;
  color: #fff;
}
.stat-card-icon-blue { background-color: var(--color-primary); }
.stat-card-icon-accent { background-color: var(--color-accent); }
.stat-card-icon-orange { background-color: var(--color-warning); }

.stat-card h3 {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: 0.25rem;
}
.stat-number {
  color: var(--color-text);
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  font-weight: 700;
  display: block;
  font-family: var(--font-family-heading);
  line-height: 1.2;
}
.stat-number-danger {
  color: var(--color-danger);
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  font-weight: 700;
  display: block;
  font-family: var(--font-family-heading);
  line-height: 1.2;
}

/* --- Link with arrow animation --- */
.link-arrow {
  display: inline-flex;
  align-items: center;
  font-size: 0.875rem;
  font-weight: 500;
  margin-top: 8px;
  color: var(--color-primary);
}
.link-arrow::after {
  content: ' \2192';
  margin-left: 4px;
  transition: margin-left 0.2s ease;
}
.link-arrow:hover::after {
  margin-left: 8px;
}

/* --- Alerts / komunikaty --- */
.uwaga {
  position: relative;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--color-danger-text);
  background-color: var(--color-danger-bg);
  border-color: rgba(239, 68, 68, 0.2);
  width: 100%;
}
@media (min-width: 768px) {
  .uwaga { width: 60%; }
}

.komunikat {
  color: var(--color-text);
  background-color: var(--color-surface);
  position: relative;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius-md);
  width: 100%;
}
@media (min-width: 768px) {
  .komunikat { width: 60%; }
}

.komunikat-h, .uwaga-h {
  color: var(--color-text);
  font-weight: 700;
}
.komunikat-data, .uwaga-data {
  float: right;
  font-family: var(--font-family-base);
  font-size: 0.85rem;
  color: var(--color-text-muted);
}
.komunikat-tresc, .uwaga-tresc {
  font-weight: 400;
  color: var(--color-text-secondary);
}

/* --- Guzik classes (legacy components) --- */
.guzik01 {
  text-decoration: none !important;
}

.guzik02 {
  color: var(--color-text);
  font-weight: 500;
  font-size: 0.875rem;
  margin-bottom: 0;
}

.guzik03 {
  border-left: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
  border-radius: 0;
}

.guzik04 {
  background-color: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: none;
  box-sizing: border-box;
  color: var(--color-text);
  display: block;
  font-size: 1rem;
  height: 3rem;
  padding: 0 1rem;
  width: 100%;
  -webkit-appearance: none;
  transition: border-color 0.2s ease;
}
.guzik04:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.guzik05 {
  color: var(--color-text-secondary);
  font-weight: 400;
  font-size: 0.875rem;
  margin-bottom: 0;
}

.guzik06 {
  font-size: 1.5rem;
  line-height: 2rem;
  margin: 2rem 0 0.5rem;
  color: var(--color-text);
  font-weight: 600;
  font-family: var(--font-family-heading);
}

.guzik07 {
  font-size: 1.13rem;
  line-height: 2rem;
  margin: 2rem 0 0.5rem;
  color: var(--color-text);
  font-weight: 300;
}

.guzik08 {
  margin-top: 48px;
}
@media (max-width: 576px) {
  .guzik08 { margin-top: 24px; }
}

.guzik09 {
  background-color: var(--color-surface);
  color: var(--color-text);
  width: 100%;
  padding: 16px;
  text-align: center;
  vertical-align: middle;
  display: inline-block;
  text-decoration: none !important;
  font-size: 14px;
  font-weight: 300;
}

.guzik10 {
  color: var(--color-warning-text);
  background-color: var(--color-warning-bg);
  border-color: var(--color-warning);
}

.guzik11 {
  border: solid 1px var(--color-primary);
  background: var(--color-primary);
  color: white !important;
  text-decoration: none !important;
  font-size: 0.9rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-weight: 500;
  gap: 6px;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}
.guzik11:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
}
.guzik11 .material-symbols-rounded {
  font-size: 18px;
  color: #fff;
}

.guzik12 {
  font-size: 0.9rem;
  font-family: var(--font-family-base);
  color: var(--color-text-secondary);
}

/* --- Cards --- */
.card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.card-header {
  background: var(--color-surface);
  transition: background 0.15s ease;
  border-top: 1px solid var(--color-border);
}
.card-header:hover {
  background: var(--color-surface-hover);
}

.card-body {
  background: var(--color-surface-alt);
  font-size: 0.875rem;
  padding: 24px;
}
@media (max-width: 576px) {
  .card-body { padding: 16px; }
}

/* --- Contact card --- */
.contact-card {
  background: var(--color-surface-alt);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 12px;
  height: 100%;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease;
}
.contact-card:hover {
  box-shadow: var(--shadow-md);
}
.contact-card .material-symbols-rounded {
  font-size: 16px;
  margin-right: 4px;
  vertical-align: middle;
  color: var(--color-text-muted);
}
@media (max-width: 576px) {
  .contact-card .row { flex-direction: column; text-align: center; }
  .contact-card img { max-width: 80px; margin: 0 auto 10px; }
}

/* --- Settings card --- */
.settings-card {
  background: var(--color-surface-alt);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 12px;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}
@media (max-width: 576px) {
  .settings-card .material-symbols-rounded { font-size: 2.5rem !important; }
}

/* Status colors for settings */
.status-error { color: var(--color-danger) !important; }
.status-success { color: var(--color-success-text) !important; }

/* --- Unread / highlighted items --- */
.unread {
  border: 2px solid var(--color-primary);
  margin-bottom: 16px;
  width: 100%;
  height: 100%;
  text-align: center;
  vertical-align: middle;
  display: inline-block;
  text-decoration: none !important;
  border-radius: var(--radius-lg);
  font-size: 14px;
  font-weight: 300;
}

.highlighted {
  border: 2px solid var(--color-accent);
  margin-bottom: 16px;
  width: 100%;
  padding: 20px 0;
  text-align: center;
  vertical-align: middle;
  display: inline-block;
  text-decoration: none !important;
  border-radius: var(--radius-lg);
  font-size: 14px;
  font-weight: 300;
}

a.fill-div {
  display: flex;
  height: 100%;
  width: 100%;
  text-decoration: none;
  align-items: center;
  justify-content: center;
}

/* --- Tables --- */
#customers {
  border-collapse: collapse;
}
#customers th,
.table thead th {
  background: var(--color-surface-alt);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 1px;
  color: var(--color-text-secondary);
  font-family: var(--font-family-base);
  border-bottom: 2px solid var(--color-border);
}
#customers td,
#customers th,
.table td,
.table th {
  padding: 12px 16px;
  vertical-align: middle;
  color: var(--color-text);
}
#customers tr:nth-child(even) {
  background-color: var(--color-surface-alt);
}
#customers tr:hover,
.table-hover tbody tr:hover {
  background-color: var(--color-surface-alt);
  transition: background-color 0.15s ease;
}

/* --- Table responsive wrapper --- */
.table-responsive-custom {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
@media (min-width: 576px) {
  .table-responsive-custom { display: inline-table; overflow-x: visible; }
}

/* --- Mobile cards for tables --- */
.mobile-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, transform 0.15s ease;
}
.mobile-card:hover {
  box-shadow: var(--shadow-md);
}
.mobile-card-label {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  font-weight: 500;
  text-transform: uppercase;
  margin-bottom: 2px;
  font-family: var(--font-family-base);
  letter-spacing: 1px;
}
.mobile-card-value {
  font-size: 0.9rem;
  color: var(--color-text);
  margin-bottom: 12px;
}
.mobile-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border-light);
}

/* --- Chat layout --- */
.chat-header {
  position: fixed;
  top: 0;
  left: 0;
  height: var(--header-height);
  background: var(--color-surface);
  z-index: 2;
  width: 100%;
  padding: 16px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
}
.chat-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  background: var(--color-surface);
  z-index: 2;
  width: 100%;
  padding: 12px 16px;
  border-top: 1px solid var(--color-border);
}
@media (min-width: 991px) {
  .chat-header, .chat-footer {
    left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
  }
}

/* --- Report bottom bar --- */
.report-action-bar {
  position: fixed;
  right: 0;
  bottom: 0;
  text-align: right;
  padding: 12px 16px;
  width: 100%;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  z-index: 2;
}
@media (min-width: 991px) {
  .report-action-bar {
    left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
  }
}

/* --- Login page responsive --- */
.login-overlay-msg {
  text-align: center;
  padding: 20vh 16px;
  background: var(--color-surface);
  z-index: 1000;
  width: 100vw;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  display: none;
}
.login-overlay-msg h1 {
  color: var(--color-text);
  font-size: clamp(1.2rem, 5vw, 3rem);
}
.login-overlay-msg h2 {
  color: var(--color-text-secondary);
  font-size: clamp(1rem, 3vw, 2rem);
  max-width: 600px;
  margin: 10px auto 0;
}

/* --- Application entry --- */
@media (max-width: 576px) {
  .app-chevron { display: none; }
}

/* --- Mobile Bottom Nav --- */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  z-index: 100;
  justify-content: space-around;
  align-items: stretch;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--color-text-muted);
  padding: 6px 0;
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
.bottom-nav-item:hover,
.bottom-nav-item:focus {
  text-decoration: none;
  color: var(--color-primary);
  outline: none;
}
.bottom-nav-item .material-symbols-rounded {
  font-size: 24px;
  margin-bottom: 2px;
  color: inherit;
  transition: font-variation-settings 0.2s ease;
}

.bottom-nav-label {
  font-size: 10px;
  font-weight: 500;
  font-family: var(--font-family-base);
  letter-spacing: 0.2px;
  color: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.bottom-nav-item.active {
  color: var(--color-primary);
}
.bottom-nav-item.active .material-symbols-rounded {
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
.bottom-nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 3px;
  background: var(--color-primary);
  border-radius: 0 0 3px 3px;
}

@media (max-width: 990px) {
  .bottom-nav {
    display: flex;
  }
}

/* --- FAQ ask card --- */
.faq-ask-card {
  background-color: var(--color-primary-light);
  border-color: var(--color-border);
}

/* --- Empty table/list message --- */
.empty-table-msg {
  font-style: italic;
  text-align: center;
  color: var(--color-text-muted);
}

/* ==========================================================================
   Dark Mode - Bootstrap overrides
   ========================================================================== */
@media (prefers-color-scheme: dark) {
  .bg-light {
    background-color: var(--color-surface-hover) !important;
  }

  .alert-danger {
    background-color: var(--color-danger-bg);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--color-danger-text);
  }

  .alert-success {
    background-color: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--color-success-text);
  }

  .alert-warning {
    background-color: var(--color-warning-bg);
    border-color: rgba(245, 158, 11, 0.3);
    color: var(--color-warning-text);
  }

  .alert-info {
    background-color: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
    color: #93c5fd;
  }

  .badge-warning {
    background-color: var(--color-warning) !important;
    color: #000 !important;
  }
  .badge-danger {
    background-color: var(--color-danger) !important;
    color: #fff !important;
  }
  .badge-secondary {
    background-color: var(--color-surface-hover) !important;
    color: var(--color-text-secondary) !important;
  }

  .table-striped tbody tr:nth-of-type(odd) {
    background-color: var(--color-surface-hover);
  }
  .table-bordered {
    border-color: var(--color-border);
  }
  .table-bordered td, .table-bordered th {
    border-color: var(--color-border);
  }

  .list-group-item {
    background-color: var(--color-surface);
    border-color: var(--color-border);
    color: var(--color-text);
  }

  .btn-link {
    color: var(--color-primary);
  }
  .btn-link:hover {
    color: var(--color-primary-hover);
  }

  .card {
    background-color: var(--color-surface);
    border-color: var(--color-border);
  }

  img {
    opacity: 0.9;
  }

}
