/* ============================================================
   RMB CONNECT - Official Rotary Means Business Theme
   Primary Blue #1D428A | Gold #FDB913 | White text on blue
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Outfit:wght@500;600;700;800&display=swap');

:root {
  --rmb-primary: #1d428a;
  --rmb-primary-dark: #132f66;
  --rmb-primary-mid: #2654a8;
  --rmb-primary-light: #2a56a3;
  --rmb-secondary: #fdb913;
  --rmb-secondary-dark: #e5a50a;
  --rmb-secondary-soft: rgba(253, 185, 19, 0.18);
  --rmb-bg: #132f66;
  --rmb-card: #1d428a;
  --rmb-text: #ffffff;
  --rmb-text-muted: rgba(255, 255, 255, 0.78);
  --rmb-border: rgba(255, 255, 255, 0.28);
  --rmb-sidebar: #0e2148;
  --rmb-sidebar-text: #ffffff;
  --rmb-sidebar-active: #1d428a;
  --rmb-radius: 15px;
  --rmb-shadow: 0 4px 24px rgba(14, 33, 72, 0.35);
  --rmb-shadow-lg: 0 12px 40px rgba(14, 33, 72, 0.45);
  --rmb-success: #22c55e;
  --rmb-danger: #f87171;
  --rmb-warning: #fdb913;
  --rmb-info: #7eb6ff;
  --sidebar-width: 260px;
  --sidebar-collapsed: 78px;
  --navbar-height: 64px;
  --bottom-nav-height: 64px;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --font-display: 'Outfit', var(--font-body);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"],
[data-theme="light"] {
  --rmb-bg: #132f66;
  --rmb-card: #1d428a;
  --rmb-text: #ffffff;
  --rmb-text-muted: rgba(255, 255, 255, 0.78);
  --rmb-border: rgba(255, 255, 255, 0.28);
  --rmb-sidebar: #0e2148;
  --rmb-primary-light: #2a56a3;
  --rmb-secondary-soft: rgba(253, 185, 19, 0.18);
  --rmb-shadow: 0 4px 24px rgba(14, 33, 72, 0.35);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background:
    radial-gradient(ellipse at 10% 0%, rgba(253, 185, 19, 0.16), transparent 42%),
    radial-gradient(ellipse at 90% 100%, rgba(29, 66, 138, 0.9), transparent 55%),
    linear-gradient(160deg, #1d428a 0%, #132f66 55%, #0e2148 100%);
  color: var(--rmb-text);
  margin: 0;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .display-font {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--rmb-secondary);
}

p, span, label, td, th, li, small, .form-label, .subtitle {
  color: inherit;
}

a { color: var(--rmb-secondary); text-decoration: none; }
a:hover { color: #ffe08a; }

/* ---------- Layout ---------- */
.app-wrapper { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #0e2148 0%, #1d428a 60%, #2654a8 100%);
  color: var(--rmb-sidebar-text);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 1040;
  transition: width var(--transition), transform var(--transition);
  overflow-y: auto;
  overflow-x: hidden;
  border-right: 2px solid rgba(253, 185, 19, 0.45);
}

.sidebar.collapsed { width: var(--sidebar-collapsed); }

.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  min-height: var(--navbar-height);
}

.sidebar-brand .brand-mark,
.sidebar-brand .brand-logo {
  width: 48px; height: 48px; border-radius: 50%;
  background: #1d428a;
  display: grid; place-items: center;
  color: var(--rmb-secondary); font-family: var(--font-display); font-weight: 800;
  flex-shrink: 0; box-shadow: 0 0 0 2px #fff, 0 0 0 3px #111, 0 4px 12px rgba(0,0,0,0.25);
  object-fit: contain;
}
.sidebar-brand .brand-logo {
  background: #1d428a;
  border: none;
  padding: 2px;
}
.sidebar.collapsed .brand-logo { width: 42px; height: 42px; }

.sidebar-brand .brand-text { line-height: 1.15; white-space: nowrap; }
.sidebar-brand .brand-text strong {
  display: block; color: #fff; font-size: 1.05rem; font-family: var(--font-display);
}
.sidebar-brand .brand-text small { color: var(--rmb-secondary); font-size: 0.7rem; font-weight: 700; }

.sidebar.collapsed .brand-text,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-section-title { display: none; }

.sidebar-nav { padding: 1rem 0.75rem 2rem; }

.nav-section-title {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--rmb-secondary); padding: 0.75rem 0.85rem 0.35rem; font-weight: 700;
}

.sidebar-nav .nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 0.7rem 0.85rem; margin-bottom: 2px;
  border-radius: 12px; color: #ffffff;
  transition: all var(--transition); font-weight: 500; font-size: 0.92rem;
}

.sidebar-nav .nav-link i {
  width: 22px; text-align: center; font-size: 1.05rem; opacity: 0.95; color: var(--rmb-secondary);
}

.sidebar-nav .nav-link:hover {
  background: rgba(253, 185, 19, 0.16); color: #fff;
}

.sidebar-nav .nav-link.active {
  background: linear-gradient(90deg, rgba(253, 185, 19, 0.28), rgba(38, 84, 168, 0.65));
  color: #fff;
  box-shadow: inset 3px 0 0 var(--rmb-secondary), 0 4px 14px rgba(0, 0, 0, 0.2);
}
.sidebar-nav .nav-link.active i { color: var(--rmb-secondary); }

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-width: 0;
  transition: margin-left var(--transition);
  padding-bottom: calc(var(--bottom-nav-height) + 1rem);
}

.sidebar.collapsed ~ .main-content,
.app-wrapper.sidebar-collapsed .main-content { margin-left: var(--sidebar-collapsed); }

.top-navbar {
  height: var(--navbar-height);
  background: rgba(29, 66, 138, 0.96);
  border-bottom: 2px solid var(--rmb-secondary);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.25rem; position: sticky; top: 0; z-index: 1030;
  backdrop-filter: blur(12px);
  color: #fff;
}
.top-navbar strong { color: #fff; }
.top-navbar .text-muted, .top-navbar .text-secondary { color: rgba(255,255,255,0.78) !important; }
.top-navbar .btn-link { color: #fff !important; }
.top-navbar .user-menu-btn { color: #fff !important; }
.top-navbar .user-menu-name {
  color: #fff !important;
  font-weight: 700;
}
.top-navbar .user-menu-role {
  color: var(--rmb-secondary) !important;
  display: block;
  font-weight: 600;
}

.page-content { padding: 1.25rem; }

.page-header {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem;
}

.page-header h1 {
  font-size: 1.55rem; margin: 0; color: var(--rmb-secondary);
}

.page-header .subtitle { color: var(--rmb-text-muted); font-size: 0.9rem; margin: 0.2rem 0 0; }

/* ---------- Cards ---------- */
.rmb-card {
  background: linear-gradient(180deg, #244fa0 0%, #1d428a 100%);
  border-radius: var(--rmb-radius);
  box-shadow: var(--rmb-shadow);
  border: 1px solid rgba(255, 255, 255, 0.28);
  padding: 1.25rem;
  color: #fff;
  transition: transform var(--transition), box-shadow var(--transition);
}

.rmb-card:hover { box-shadow: var(--rmb-shadow-lg), 0 0 0 1px rgba(253, 185, 19, 0.35); }

.stat-card {
  position: relative; overflow: visible;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem;
  min-height: 110px;
  height: 100%;
}

.stat-card > div:first-child {
  min-width: 0;
  flex: 1;
}

.stat-card .stat-icon {
  width: 44px; height: 44px; border-radius: 14px;
  display: grid; place-items: center; font-size: 1.1rem; flex-shrink: 0;
}

.stat-card .stat-value {
  font-family: var(--font-display); font-size: 1.55rem; font-weight: 700;
  line-height: 1.15; margin: 0.15rem 0; color: var(--rmb-secondary);
  word-break: break-word;
}

.stat-card .stat-label {
  color: rgba(255,255,255,0.85); font-size: 0.8rem; font-weight: 600;
  line-height: 1.25;
}

.stat-card.primary .stat-icon { background: rgba(253, 185, 19, 0.2); color: var(--rmb-secondary); }
.stat-card.warning .stat-icon { background: var(--rmb-secondary-soft); color: var(--rmb-secondary); }
.stat-card.success .stat-icon { background: rgba(34, 197, 94, 0.2); color: #86efac; }
.stat-card.danger .stat-icon { background: rgba(248, 113, 113, 0.2); color: #fca5a5; }
.stat-card.info .stat-icon { background: rgba(255, 255, 255, 0.15); color: #fff; }

/* ---------- Buttons ---------- */
.btn-rmb {
  background: linear-gradient(135deg, #fdb913, #ffd24d);
  border: none; color: #1d428a; border-radius: 12px;
  padding: 0.55rem 1.15rem; font-weight: 700;
  box-shadow: 0 4px 14px rgba(253, 185, 19, 0.35);
  transition: all var(--transition);
}

.btn-rmb:hover {
  background: linear-gradient(135deg, #ffd24d, #fdb913);
  color: #132f66; transform: translateY(-1px);
}

.btn-secondary-rmb {
  background: linear-gradient(135deg, #2654a8, #1d428a);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff; border-radius: 12px;
  padding: 0.55rem 1.15rem; font-weight: 700;
}

.btn-secondary-rmb:hover { color: var(--rmb-secondary); filter: brightness(1.05); }

.btn-outline-rmb {
  border: 1.5px solid var(--rmb-secondary); color: var(--rmb-secondary);
  background: transparent; border-radius: 12px; font-weight: 600;
}

.btn-outline-rmb:hover {
  background: var(--rmb-secondary); color: #1d428a;
}

/* ---------- Forms ---------- */
.form-control, .form-select {
  border-radius: 12px; border-color: rgba(255,255,255,0.35);
  padding: 0.65rem 0.9rem;
  background: #132f66; color: #fff;
}

.form-control::placeholder { color: rgba(255,255,255,0.55); opacity: 1; }

.form-control:focus, .form-select:focus {
  border-color: var(--rmb-secondary);
  box-shadow: 0 0 0 3px rgba(253, 185, 19, 0.25);
  background: #132f66; color: #fff;
}

.form-select option { background: #1d428a; color: #fff; }

.form-label {
  font-weight: 600; font-size: 0.875rem; margin-bottom: 0.35rem;
  color: var(--rmb-secondary);
}

/* ---------- Tables ---------- */
.table-rmb { width: 100%; margin: 0; }
.table-rmb thead th {
  background: linear-gradient(180deg, #132f66, #1d428a);
  color: var(--rmb-secondary);
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em;
  font-weight: 700; border: none; padding: 0.85rem 1rem; white-space: nowrap;
  border-bottom: 2px solid var(--rmb-secondary) !important;
}
.table-rmb thead th:first-child { border-radius: 10px 0 0 0; }
.table-rmb thead th:last-child { border-radius: 0 10px 0 0; }
.table-rmb tbody td {
  padding: 0.9rem 1rem; vertical-align: middle;
  border-color: rgba(255, 255, 255, 0.15); color: #fff;
}
.table-rmb tbody tr:hover { background: rgba(253, 185, 19, 0.12); }

.table-responsive-cards { overflow-x: auto; }

/* ---------- Mobile card tables (skip when DataTables active) ---------- */
@media (max-width: 767.98px) {
  .table-responsive-cards:not(.dt-enabled) thead { display: none; }
  .table-responsive-cards:not(.dt-enabled) table,
  .table-responsive-cards:not(.dt-enabled) tbody,
  .table-responsive-cards:not(.dt-enabled) tr,
  .table-responsive-cards:not(.dt-enabled) td { display: block; width: 100%; }
  .table-responsive-cards:not(.dt-enabled) tr {
    background: var(--rmb-card); border: 1px solid var(--rmb-border);
    border-radius: var(--rmb-radius); margin-bottom: 0.85rem;
    padding: 0.5rem 0; box-shadow: var(--rmb-shadow);
  }
  .table-responsive-cards:not(.dt-enabled) td {
    display: flex; justify-content: space-between; align-items: center;
    gap: 1rem; border: none !important; padding: 0.55rem 1rem !important;
  }
  .table-responsive-cards:not(.dt-enabled) td::before {
    content: attr(data-label);
    font-weight: 700; font-size: 0.78rem; color: var(--rmb-text-muted);
    text-transform: uppercase;
  }
  .btn, .btn-rmb, .btn-secondary-rmb { width: 100%; }
  .page-header .btn { width: auto; }
  .dataTables_wrapper .btn { width: auto; }
  .btn-group-mobile .btn { width: 100%; margin-bottom: 0.5rem; }
}

/* ---------- Auth ---------- */
.auth-page {
  min-height: 100vh;
  display: grid; place-items: center;
  background:
    radial-gradient(ellipse at 15% 15%, rgba(253, 185, 19, 0.28), transparent 45%),
    radial-gradient(ellipse at 85% 80%, rgba(29, 66, 138, 0.55), transparent 50%),
    linear-gradient(160deg, #1d428a 0%, #132f66 48%, #0e2148 100%);
  padding: 1.5rem;
}

[data-theme="dark"] .auth-page {
  background:
    radial-gradient(ellipse at 15% 15%, rgba(253, 185, 19, 0.22), transparent 45%),
    radial-gradient(ellipse at 85% 80%, rgba(29, 66, 138, 0.5), transparent 50%),
    #0e2148;
}

.auth-card {
  width: 100%; max-width: 440px;
  background: linear-gradient(180deg, #244fa0, #1d428a);
  border-radius: 20px;
  box-shadow: var(--rmb-shadow-lg);
  padding: 2.25rem 2rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  animation: fadeUp 0.5s ease;
  color: #fff;
}
.auth-card h1, .auth-card h2, .auth-card h3, .auth-card .auth-title {
  color: var(--rmb-secondary) !important;
}

.auth-logo {
  width: 64px; height: 64px; border-radius: 18px;
  background: linear-gradient(135deg, var(--rmb-secondary), #ffd24d);
  display: grid; place-items: center; color: #1d428a;
  font-family: var(--font-display); font-size: 1.5rem; font-weight: 800;
  margin: 0 auto 1rem; box-shadow: 0 8px 24px rgba(253, 185, 19, 0.35);
}
.auth-logo-img {
  display: block;
  width: 96px; height: 96px;
  object-fit: contain;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: #1d428a;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px #111, 0 8px 24px rgba(0, 0, 0, 0.35);
  padding: 4px;
}

/* ---------- Bottom Nav (Mobile) ---------- */
.bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--bottom-nav-height);
  background: #1d428a;
  border-top: 2px solid var(--rmb-secondary);
  z-index: 1050;
  padding: 0.35rem 0.5rem calc(0.35rem + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 20px rgba(14, 33, 72, 0.4);
  align-items: stretch;
}

.bottom-nav a,
.bottom-nav .bottom-nav-submit {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 2px; color: rgba(255,255,255,0.85);
  font-size: 0.65rem; font-weight: 600; border-radius: 10px; padding: 0.35rem;
  background: transparent; border: none; font-family: inherit; cursor: pointer;
  text-decoration: none;
}

.bottom-nav a i,
.bottom-nav .bottom-nav-submit i { font-size: 1.15rem; color: var(--rmb-secondary); }

.bottom-nav a.active,
.bottom-nav .bottom-nav-submit.active {
  color: #fff;
  background: rgba(253, 185, 19, 0.18);
  box-shadow: inset 0 -3px 0 var(--rmb-secondary);
}

.bottom-nav-submit-fab {
  width: 44px; height: 44px; margin-top: -22px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #fdb913, #ffd24d);
  color: #1d428a;
  box-shadow: 0 4px 14px rgba(253, 185, 19, 0.45);
  border: 3px solid #1d428a;
}
.bottom-nav-submit-fab i { font-size: 1.2rem !important; color: #1d428a !important; }
.bottom-nav-submit.open .bottom-nav-submit-fab {
  background: #ffd24d;
  transform: rotate(45deg);
}

/* Submit submenu sheet */
.submit-menu-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1055;
}
.submit-menu-overlay[hidden],
.submit-menu[hidden] { display: none !important; }

.submit-menu {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 1060;
  background: linear-gradient(180deg, #244fa0, #1d428a 55%, #132f66);
  border-radius: 22px 22px 0 0;
  border-top: 2px solid var(--rmb-secondary);
  padding: 0.75rem 1rem calc(1rem + env(safe-area-inset-bottom) + var(--bottom-nav-height));
  box-shadow: 0 -12px 40px rgba(14, 33, 72, 0.5);
  animation: submitSheetUp 0.22s ease;
}
@keyframes submitSheetUp {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.submit-menu-handle {
  width: 42px; height: 4px; border-radius: 999px;
  background: rgba(245, 197, 24, 0.35);
  margin: 0.15rem auto 0.85rem;
}
.submit-menu-title {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--rmb-secondary);
  text-align: center;
  margin-bottom: 1rem;
  font-size: 1.05rem;
}
.submit-menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.submit-menu-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  padding: 1rem 0.75rem;
  border-radius: 14px;
  background: rgba(14, 33, 72, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  text-align: center;
}
.submit-menu-item:hover,
.submit-menu-item:active {
  background: rgba(253, 185, 19, 0.2);
  border-color: var(--rmb-secondary);
  color: #fff;
}
.submit-menu-icon {
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(253, 185, 19, 0.2);
  color: var(--rmb-secondary);
  font-size: 1.2rem;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.35);
}
.submit-menu-close {
  display: block;
  width: 100%;
  margin-top: 1rem;
  padding: 0.7rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: transparent;
  color: #fff;
  font-weight: 600;
  font-family: inherit;
}

@media (min-width: 992px) {
  .submit-menu,
  .submit-menu-overlay { display: none !important; }
}

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 1.5rem; }
.timeline::before {
  content: ''; position: absolute; left: 7px; top: 0; bottom: 0;
  width: 2px; background: var(--rmb-border);
}
.timeline-item { position: relative; padding-bottom: 1.25rem; }
.timeline-item::before {
  content: ''; position: absolute; left: -1.5rem; top: 4px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--rmb-secondary); border: 2px solid var(--rmb-card);
  box-shadow: 0 0 0 2px var(--rmb-secondary);
}

/* ---------- Skeleton ---------- */
.skeleton {
  background: linear-gradient(90deg, var(--rmb-border) 25%, var(--rmb-bg) 50%, var(--rmb-border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite; border-radius: 8px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.fade-in { animation: fadeIn 0.4s ease; }
.fade-up { animation: fadeUp 0.45s ease; }

/* ---------- Avatar ---------- */
.avatar {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover;
  background: var(--rmb-primary-light); border: 2px solid var(--rmb-border);
}
.avatar-sm { width: 32px; height: 32px; }
.avatar-lg { width: 72px; height: 72px; }
.avatar-xl { width: 120px; height: 120px; }

.member-chip {
  display: inline-flex; align-items: center; gap: 0.5rem;
}

/* ---------- Badges & misc ---------- */
.badge { font-weight: 600; border-radius: 8px; padding: 0.4em 0.65em; }
.notif-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--rmb-danger);
  position: absolute; top: 8px; right: 8px;
}
.dropdown-menu {
  border-radius: 14px; border-color: rgba(255, 255, 255, 0.3);
  box-shadow: var(--rmb-shadow-lg); background: #1d428a;
}
.dropdown-item { color: #fff; border-radius: 8px; margin: 2px 6px; width: auto; }
.dropdown-item:hover { background: rgba(253, 185, 19, 0.2); color: #fff; }

.empty-state {
  text-align: center; padding: 2.5rem 1rem; color: var(--rmb-text-muted);
}
.empty-state i { font-size: 2.5rem; margin-bottom: 0.75rem; opacity: 0.55; color: var(--rmb-secondary); }

.progress { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.2); }
.progress-bar { background: linear-gradient(90deg, #1d428a, var(--rmb-secondary)); border-radius: 999px; }

.theme-toggle {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.35);
  background: #132f66; color: var(--rmb-secondary); display: grid; place-items: center;
  cursor: pointer; transition: all var(--transition);
}
.theme-toggle:hover { border-color: var(--rmb-secondary); color: #ffd24d; }

.sidebar-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  z-index: 1035;
}
.sidebar-overlay.show { display: block; }

/* Chart container */
.chart-box { position: relative; height: 280px; }

/* Profile section tabs — high contrast on RMB blue */
.profile-tabs {
  gap: 0.5rem;
  padding: 0.5rem;
  background: rgba(14, 33, 72, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 14px;
}
.profile-tabs .nav-item { flex-shrink: 0; }
.profile-tabs .nav-link {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
  border-radius: 10px !important;
  font-weight: 700;
  padding: 0.55rem 0.9rem;
  white-space: nowrap;
}
.profile-tabs .nav-link i { color: var(--rmb-secondary); }
.profile-tabs .nav-link:hover {
  background: rgba(253, 185, 19, 0.22) !important;
  border-color: var(--rmb-secondary) !important;
  color: #fff !important;
}
.profile-tabs .nav-link.active {
  background: linear-gradient(135deg, #fdb913, #ffd24d) !important;
  border-color: #fdb913 !important;
  color: #1d428a !important;
  box-shadow: 0 4px 12px rgba(253, 185, 19, 0.35);
}
.profile-tabs .nav-link.active i { color: #1d428a; }

/* Generic Bootstrap pills on themed pages */
.nav-pills:not(.profile-tabs) .nav-link {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-weight: 600;
}
.nav-pills:not(.profile-tabs) .nav-link.active {
  background: var(--rmb-secondary) !important;
  color: #1d428a !important;
  border-color: var(--rmb-secondary);
}

/* Dashboard quick shortcuts */
.dash-shortcut {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 1rem;
  border-radius: 14px;
  background: rgba(14, 33, 72, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  text-decoration: none;
  height: 100%;
  transition: all var(--transition);
}
.dash-shortcut:hover {
  background: rgba(253, 185, 19, 0.18);
  border-color: var(--rmb-secondary);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(14, 33, 72, 0.3);
}
.dash-shortcut-icon {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(253, 185, 19, 0.2);
  color: var(--rmb-secondary);
  font-size: 1.15rem;
  margin-bottom: 0.25rem;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.3);
}
.dash-shortcut-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--rmb-secondary);
}
.dash-shortcut-hint {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.78);
}
.dash-shortcut:hover .dash-shortcut-icon {
  background: var(--rmb-secondary);
  color: #1d428a;
}

/* DataTables overrides */
table.dataTable { border-collapse: collapse !important; width: 100% !important; }
.dataTables_wrapper { margin-top: 0.25rem; }
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
  color: var(--rmb-text-muted);
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  border-radius: 10px; border: 1px solid var(--rmb-border);
  background: var(--rmb-card); color: var(--rmb-text); padding: 0.4rem 0.7rem;
}
.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus {
  border-color: var(--rmb-secondary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(245, 197, 24, 0.2);
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: 8px !important;
  border: 1px solid transparent !important;
  margin: 0 2px !important;
  color: var(--rmb-secondary) !important;
  background: transparent !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: var(--rmb-secondary) !important;
  color: #1d428a !important;
  border-color: var(--rmb-secondary) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: var(--rmb-secondary-soft) !important;
  color: #fff !important;
  border-color: var(--rmb-secondary) !important;
}
.php-pagination { display: none !important; }
.badge.bg-primary { background-color: #132f66 !important; color: #fdb913 !important; }
.badge.bg-warning { background-color: var(--rmb-secondary) !important; color: #1d428a !important; }
.badge.bg-secondary { background-color: #2654a8 !important; color: #fff !important; }
.text-primary { color: var(--rmb-secondary) !important; }
.text-muted { color: var(--rmb-text-muted) !important; }
.bg-primary { background-color: #1d428a !important; }
.bg-light { background-color: #2654a8 !important; color: #fff !important; }
.border, .border-bottom, .border-top { border-color: rgba(255, 255, 255, 0.25) !important; }
.modal-content {
  background: #1d428a; color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}
.modal-header, .modal-footer { border-color: rgba(255, 255, 255, 0.2) !important; }
.modal-title { color: var(--rmb-secondary) !important; }
.btn-close { filter: invert(1) brightness(2); }
.list-group-item {
  background: #1d428a; color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}
.list-group-item.active {
  background: rgba(253, 185, 19, 0.22); color: #fff;
  border-color: var(--rmb-secondary);
}
.table { --bs-table-bg: transparent; --bs-table-color: var(--rmb-text); color: var(--rmb-text); }
.alert-info { background: rgba(29, 66, 138, 0.55); border-color: #2654a8; color: #fff; }
.alert-light { background: rgba(19, 47, 102, 0.85); border-color: rgba(255, 255, 255, 0.25); color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width) !important;
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-content {
    margin-left: 0 !important;
    /* Clear bottom nav + raised Submit FAB so last cards (e.g. Attendance) stay visible */
    padding-bottom: calc(var(--bottom-nav-height) + 2.75rem + env(safe-area-inset-bottom)) !important;
  }
  .bottom-nav { display: flex; }
  .page-content {
    padding: 1rem;
    padding-bottom: 1.25rem;
  }
  .stat-card {
    min-height: 104px;
    padding: 1rem !important;
  }
  .stat-card .stat-value { font-size: 1.35rem; }
  .stat-card .stat-label { font-size: 0.74rem; }
  .stat-card .stat-icon { width: 38px; height: 38px; font-size: 1rem; }
}

@media (min-width: 992px) {
  .main-content { padding-bottom: 1rem; }
}

/* Print */
@media print {
  .sidebar, .top-navbar, .bottom-nav, .no-print { display: none !important; }
  .main-content { margin: 0 !important; }
  .rmb-card { box-shadow: none; border: 1px solid #ccc; }
}
