/* =====================================================
   SICTADAU — Modern Professional UI
   Designed for clarity: 45+ users, high contrast
   ===================================================== */

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

:root {
  /* ── Brand palette ── */
  --primary:        #1d4ed8;      /* vivid blue */
  --primary-light:  #3b82f6;
  --primary-dark:   #1e3a8a;
  --primary-glow:   rgba(29,78,216,.15);

  --success:        #16a34a;
  --success-bg:     #dcfce7;
  --warning:        #d97706;
  --warning-bg:     #fef9c3;
  --danger:         #dc2626;
  --danger-bg:      #fee2e2;
  --info:           #0284c7;
  --info-bg:        #e0f2fe;

  /* ── Surfaces ── */
  --body-bg:        #eef2f7;
  --card-bg:        #ffffff;
  --sidebar-bg:     #0f172a;
  --sidebar-hover:  rgba(255,255,255,.08);
  --sidebar-active: #1d4ed8;
  --topbar-bg:      #ffffff;
  --border:         #d1d5db;
  --border-light:   #e5e7eb;

  /* ── Text — bright & readable ── */
  --text-primary:   #0f172a;      /* near-black for headings */
  --text-body:      #1e293b;      /* dark for all body text */
  --text-muted:     #475569;      /* readable slate, not faded */
  --text-on-dark:   #f1f5f9;

  /* ── Sizing ── */
  --sidebar-w:      270px;
  --topbar-h:       64px;
  --radius-sm:      8px;
  --radius-md:      12px;
  --radius-lg:      18px;
  --radius-xl:      24px;

  /* ── Shadows ── */
  --shadow-xs:  0 1px 3px rgba(0,0,0,.06);
  --shadow-sm:  0 2px 8px rgba(0,0,0,.08);
  --shadow-md:  0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:  0 8px 30px rgba(0,0,0,.12);
  --shadow-xl:  0 20px 60px rgba(0,0,0,.16);

  --transition: all .2s cubic-bezier(.4,0,.2,1);
}

/* =====================================================
   RESET & BASE
   ===================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  background: var(--body-bg);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;            /* ↑ larger base for 45+ readability */
  line-height: 1.65;
  color: var(--text-body);
  -webkit-font-smoothing: antialiased;
}

h1,h2,h3,h4,h5,h6 {
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: .5rem;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }

/* =====================================================
   LAYOUT
   ===================================================== */
.wrapper {
  display: flex;
  min-height: 100vh;
}

/* =====================================================
   SIDEBAR
   ===================================================== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  min-height: 100vh;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  z-index: 999;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.15) transparent;
  box-shadow: 4px 0 24px rgba(0,0,0,.18);
}
.sidebar::-webkit-scrollbar { width: 5px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 10px; }

/* Header */
.sidebar-header {
  padding: 1.5rem 1.25rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: .875rem;
}
.sidebar-logo {
  width: 46px;
  height: 46px;
  object-fit: contain;
  border-radius: 10px;
  background: rgba(255,255,255,.1);
  padding: 4px;
}
.brand-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: .04em;
  line-height: 1.2;
}
.brand-sub {
  font-size: .65rem;
  color: rgba(255,255,255,.5);
  line-height: 1.3;
  display: block;
  margin-top: 2px;
}

/* Nav items */
.sidebar .nav {
  padding: 1rem .75rem;
  flex: 1;
}
.sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: .875rem;
  color: rgba(255,255,255,.72);
  padding: .75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-weight: 500;
  transition: var(--transition);
  margin-bottom: .2rem;
  position: relative;
}
.sidebar .nav-link i {
  font-size: 1.15rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}
.sidebar .nav-link:hover {
  background: var(--sidebar-hover);
  color: #ffffff;
  padding-left: 1.25rem;
}
.sidebar .nav-link.active {
  background: var(--sidebar-active);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(29,78,216,.45);
}
.sidebar .nav-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 4px; height: 60%;
  background: #93c5fd;
  border-radius: 0 4px 4px 0;
}

/* Section label */
.nav-section-label {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: rgba(255,255,255,.35);
  padding: .9rem 1rem .4rem;
  display: block;
}

/* ── Television mode — green sidebar ── */
body[data-medium="Television"] {
  --sidebar-bg:     #0a1f12;
  --sidebar-hover:  rgba(255,255,255,.07);
  --sidebar-active: #16a34a;
}
body[data-medium="Television"] .sidebar .nav-link.active {
  box-shadow: 0 4px 14px rgba(22,163,74,.4);
}
body[data-medium="Television"] .sidebar .nav-link.active::before {
  background: #86efac;
}
body[data-medium="Television"] .medium-pill-active {
  background: rgba(134,239,172,.2) !important;
  color: #86efac !important;
}

/* Medium switcher */
.medium-switcher {
  padding: 10px 14px 14px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.medium-switcher-label {
  font-size: 9px;
  color: rgba(255,255,255,.4);
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 8px;
  font-weight: 600;
}
.medium-switcher-track {
  display: flex;
  background: rgba(0,0,0,.3);
  border-radius: 8px;
  padding: 3px;
  gap: 3px;
}
.medium-pill {
  flex: 1;
  background: transparent;
  color: rgba(255,255,255,.45);
  border: none;
  border-radius: 6px;
  padding: 6px 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  line-height: 1;
  white-space: nowrap;
}
.medium-pill i { font-size: 12px; }
.medium-pill:hover { color: rgba(255,255,255,.8); background: rgba(255,255,255,.08); }
.medium-pill-active {
  background: rgba(255,255,255,.18) !important;
  color: #fff !important;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}

/* Footer */
.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 1rem .75rem;
}
.user-card {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .625rem .75rem;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.06);
  margin-bottom: .625rem;
}
.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1rem; font-weight: 700;
  flex-shrink: 0;
}
.user-name {
  font-size: .875rem;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}
.user-role {
  font-size: .7rem;
  color: rgba(255,255,255,.45);
  text-transform: capitalize;
}
.sidebar-footer .btn {
  font-size: .8rem;
  padding: .45rem .75rem;
}

/* =====================================================
   TOPBAR
   ===================================================== */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.topbar {
  height: var(--topbar-h);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border-light);
  box-shadow: var(--shadow-xs);
  display: flex;
  align-items: center;
  padding: 0 2rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar .breadcrumb { margin: 0; padding: 0; background: transparent; }
.topbar .breadcrumb-item { font-size: .9rem; color: var(--text-muted); }
.topbar .breadcrumb-item.active { color: var(--text-primary); font-weight: 600; }
.topbar .breadcrumb-item a { color: var(--primary); }
.topbar .breadcrumb-item+.breadcrumb-item::before { color: #94a3b8; }

.topbar-date {
  margin-left: auto;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--body-bg);
  padding: .375rem .875rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  white-space: nowrap;
}

/* =====================================================
   MAIN CONTENT AREA
   ===================================================== */
main.container-fluid { padding: 1.75rem 2rem; }

/* =====================================================
   ALERTS / FLASH
   ===================================================== */
.alert {
  padding: .875rem 1.25rem;
  border-radius: var(--radius-md);
  border: none;
  border-left: 5px solid;
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .95rem;
  font-weight: 500;
  margin-bottom: 1rem;
}
.alert i { font-size: 1.1rem; flex-shrink: 0; }
.alert-success  { background: var(--success-bg);  border-color: var(--success);  color: #14532d; }
.alert-danger   { background: var(--danger-bg);   border-color: var(--danger);   color: #7f1d1d; }
.alert-warning  { background: var(--warning-bg);  border-color: var(--warning);  color: #78350f; }
.alert-info     { background: var(--info-bg);     border-color: var(--info);     color: #0c4a6e; }
.alert .btn-close { margin-left: auto; }

/* =====================================================
   CARDS
   ===================================================== */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  transition: var(--transition);
  overflow: hidden;
}
.card:hover { box-shadow: var(--shadow-sm); }

.card-header {
  background: #f8fafc;
  border-bottom: 1px solid var(--border-light);
  padding: 1.1rem 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-body { padding: 1.5rem; }
.card-footer {
  background: #f8fafc;
  border-top: 1px solid var(--border-light);
  padding: .875rem 1.5rem;
}

/* Accent-top card variant */
.card-accent {
  border-top: 4px solid var(--primary);
}
.card-accent.accent-green  { border-top-color: var(--success); }
.card-accent.accent-amber  { border-top-color: var(--warning); }
.card-accent.accent-red    { border-top-color: var(--danger); }

/* ── Stat cards ── */
.stat-card {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  overflow: hidden;
  position: relative;
}
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.stat-card .card-body {
  padding: 1.5rem;
}

.icon-box {
  width: 56px; height: 56px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -.02em;
}
.stat-label {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  margin-top: .4rem;
}

/* =====================================================
   PAGE HEADERS
   ===================================================== */
.page-heading {
  margin-bottom: 1.5rem;
}
.page-heading h4 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
}
.page-heading .sub {
  font-size: .9rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: .2rem;
}

/* =====================================================
   FILTER BAR
   ===================================================== */
.filter-bar {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-xs);
}
.filter-bar .form-control,
.filter-bar .form-select {
  font-size: .9rem;
  border-radius: var(--radius-sm);
  border-color: var(--border);
  color: var(--text-body);
  height: 38px;
  padding: .45rem .875rem;
}
.filter-bar .form-control:focus,
.filter-bar .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.filter-hint {
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: .5rem;
}

/* =====================================================
   TABLES
   ===================================================== */
.table-card {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.table {
  margin: 0;
  font-size: .9rem;          /* base; cells override where needed */
  color: var(--text-body);
}

.table > :not(caption) > * > * {
  padding: .875rem 1.1rem;
  vertical-align: middle;
  border-color: var(--border-light);
}

.table thead th {
  background: #f1f5f9;
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-primary);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  padding: .875rem 1.1rem !important;
}

.table tbody tr {
  border-bottom: 1px solid var(--border-light);
  transition: background .12s;
}
.table tbody tr:hover { background: #f8faff; }
.table tbody td { color: var(--text-body); }

/* DataTables stripe override */
.table tbody tr.table-light {
  background: #f8fafc !important;
}

/* =====================================================
   BADGES
   ===================================================== */
.badge {
  padding: .38rem .8rem;
  border-radius: 6px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .03em;
  white-space: nowrap;
  display: inline-block;
}
.badge-active    { background: #bbf7d0; color: #14532d; }
.badge-expired   { background: #fecaca; color: #7f1d1d; }
.badge-cancelled { background: #e5e7eb; color: #374151; }
.badge-pending   { background: #fde68a; color: #78350f; }
.badge-paid      { background: #bbf7d0; color: #14532d; }
.badge-completed { background: #bfdbfe; color: #1e3a8a; }

/* Bootstrap badge overrides */
.badge.bg-danger  { background-color: #fecaca !important; color: #7f1d1d !important; }
.badge.bg-success { background-color: #bbf7d0 !important; color: #14532d !important; }

/* =====================================================
   FORMS
   ===================================================== */
.form-label {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: .4rem;
  display: block;
}
.form-label .required { color: var(--danger); }

.form-control,
.form-select {
  display: block;
  width: 100%;
  padding: .65rem 1rem;
  font-size: .95rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text-body);
  transition: var(--transition);
  font-family: inherit;
  line-height: 1.5;
}
.form-control:focus,
.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  outline: none;
}
.form-control::placeholder { color: #94a3b8; }
.form-control:disabled, .form-select:disabled {
  background: #f1f5f9; color: #94a3b8; cursor: not-allowed;
}
.form-control-sm, .form-select-sm {
  padding: .4rem .75rem;
  font-size: .875rem;
}

.form-section-title {
  font-size: .8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--primary);
  border-bottom: 2px solid var(--primary-glow);
  padding-bottom: .625rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.form-text { font-size: .82rem; color: var(--text-muted); margin-top: .25rem; }

/* Input group */
.input-group .input-group-text {
  background: #f1f5f9;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  font-size: .95rem;
}
.input-group .form-control {
  border-left: none;
}
.input-group .form-control:focus {
  box-shadow: none;
  border-color: var(--primary);
}
.input-group:focus-within .input-group-text {
  border-color: var(--primary);
}

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .6rem 1.25rem;
  font-size: .9rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  line-height: 1.4;
  letter-spacing: .01em;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 3px 10px rgba(29,78,216,.3);
}
.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  box-shadow: 0 5px 16px rgba(29,78,216,.4);
  color: #fff;
  transform: translateY(-1px);
}
.btn-primary:active { transform: none; }

.btn-success {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
  box-shadow: 0 3px 10px rgba(22,163,74,.3);
}
.btn-success:hover {
  background: #15803d;
  border-color: #15803d;
  color: #fff;
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
  box-shadow: 0 3px 10px rgba(220,38,38,.25);
}
.btn-danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #fff;
  transform: translateY(-1px);
}

.btn-outline-primary {
  color: var(--primary);
  border-color: var(--primary);
  background: transparent;
}
.btn-outline-primary:hover {
  background: var(--primary);
  color: #fff;
}

.btn-outline-secondary {
  color: var(--text-body);
  border-color: var(--border);
  background: #fff;
}
.btn-outline-secondary:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: var(--text-primary);
}

.btn-outline-danger {
  color: var(--danger);
  border-color: var(--danger);
  background: transparent;
}
.btn-outline-danger:hover {
  background: var(--danger);
  color: #fff;
}

.btn-sm  { padding: .45rem .875rem; font-size: .82rem; }
.btn-xs  { padding: .3rem .65rem;   font-size: .75rem; border-radius: 6px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }

/* =====================================================
   BREADCRUMB
   ===================================================== */
.breadcrumb { --bs-breadcrumb-divider-color: #94a3b8; }
.breadcrumb-item { font-size: .875rem; }
.breadcrumb-item a { color: var(--primary); font-weight: 500; }
.breadcrumb-item.active { color: var(--text-primary); font-weight: 600; }

/* =====================================================
   MEMBER PHOTOS
   ===================================================== */
.member-photo {
  width: 38px; height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}
.member-photo-placeholder {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #dbeafe, #ede9fe);
  display: flex; align-items: center; justify-content: center;
  color: var(--primary);
  font-size: 1rem;
}

/* =====================================================
   AUTH PAGE
   ===================================================== */
.auth-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #1d4ed8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.auth-card {
  background: #fff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 430px;
  padding: 2.5rem 2.25rem 2rem;
}
.auth-logo {
  width: 72px; height: 72px;
  object-fit: contain;
  display: block;
  margin: 0 auto 1rem;
}
.auth-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: .25rem;
}
.auth-subtitle {
  font-size: .875rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 1.75rem;
  line-height: 1.5;
}
.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: .72rem;
  color: #94a3b8;
}

/* =====================================================
   MODALS
   ===================================================== */
.modal-content {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
}
.modal-header {
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  border-bottom: 1px solid var(--border-light);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 1.25rem 1.5rem;
}
.modal-title {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text-primary);
}
.modal-body { padding: 1.5rem; }
.modal-footer {
  background: #f8fafc;
  border-top: 1px solid var(--border-light);
  padding: 1rem 1.5rem;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* =====================================================
   UTILITIES — bright text overrides for 45+ contrast
   ===================================================== */
.text-muted    { color: var(--text-muted) !important; }   /* #475569 — readable */
.text-success  { color: #15803d !important; }
.text-danger   { color: #dc2626 !important; }
.text-warning  { color: #b45309 !important; }
.text-info     { color: #0369a1 !important; }
.text-primary  { color: var(--primary) !important; }

.fw-medium   { font-weight: 500; }
.fw-semibold { font-weight: 600; }
.fw-bold     { font-weight: 700; }
.fw-extrabold{ font-weight: 800; }

.small { font-size: .875rem; }

/* =====================================================
   DATATABLE OVERRIDES
   ===================================================== */
div.dataTables_wrapper { position: relative; }

/* Wrapper padding */
div.dataTables_wrapper div.row:first-child { padding: .875rem 1rem .5rem; }
div.dataTables_wrapper div.row:last-child  { padding: .5rem 1rem .875rem; }

/* Buttons row */
div.dt-buttons { display: flex; gap: .375rem; flex-wrap: wrap; }
div.dt-buttons .btn,
div.dt-buttons button {
  background: var(--primary) !important;
  color: #fff !important;
  border: none !important;
  border-radius: var(--radius-sm) !important;
  font-size: .8rem !important;
  font-weight: 600 !important;
  padding: .4rem .875rem !important;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: none !important;
}
div.dt-buttons .btn:hover,
div.dt-buttons button:hover {
  background: var(--primary-dark) !important;
  transform: none !important;
}
/* Export CSV button — outline style */
div.dt-buttons button.btn-outline-secondary,
div.dt-buttons .btn-outline-secondary {
  background: #fff !important;
  color: var(--text-body) !important;
  border: 1.5px solid var(--border) !important;
  box-shadow: none !important;
}
div.dt-buttons button.btn-outline-secondary:hover {
  background: #f1f5f9 !important;
}

/* Length menu */
div.dataTables_wrapper div.dataTables_length { padding: 0; }
div.dataTables_wrapper div.dataTables_length label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: .4rem;
  margin: 0;
}
div.dataTables_wrapper div.dataTables_length select {
  display: inline-block;
  width: auto;
  padding: .35rem 1.75rem .35rem .625rem;
  font-size: .82rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-body);
  background: #fff;
  cursor: pointer;
  margin: 0 .25rem;
}
div.dataTables_wrapper div.dataTables_length select:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 2px var(--primary-glow);
}

/* Info text */
div.dataTables_wrapper div.dataTables_info {
  font-size: .83rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0;
}

/* Processing overlay */
div.dataTables_processing {
  background: rgba(255,255,255,.9) !important;
  border: none !important;
  border-radius: var(--radius-sm) !important;
  box-shadow: var(--shadow-md) !important;
  font-size: .875rem !important;
  color: var(--primary) !important;
  font-weight: 600 !important;
  padding: .75rem 1.5rem !important;
}

/* Pagination */
div.dataTables_wrapper div.dataTables_paginate { padding: 0; margin: 0; }
div.dataTables_wrapper .pagination { margin: 0; gap: 3px; flex-wrap: wrap; }
div.dataTables_wrapper .pagination .page-item .page-link {
  border-radius: 7px !important;
  font-size: .82rem;
  font-weight: 600;
  padding: .38rem .75rem;
  color: var(--primary);
  border-color: var(--border);
  min-width: 36px;
  text-align: center;
  line-height: 1.4;
  transition: var(--transition);
}
div.dataTables_wrapper .pagination .page-item.active .page-link {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(29,78,216,.35);
}
div.dataTables_wrapper .pagination .page-item .page-link:hover {
  background: #eff6ff;
  border-color: var(--primary);
  color: var(--primary-dark);
}
div.dataTables_wrapper .pagination .page-item.disabled .page-link {
  color: #cbd5e1;
  pointer-events: none;
}

/* =====================================================
   FOOTER
   ===================================================== */
footer {
  background: #fff;
  border-top: 1px solid var(--border-light);
  color: var(--text-muted);
  font-size: .75rem;
  font-weight: 500;
  padding: .75rem 1rem;
  text-align: center;
}

/* =====================================================
   EMPTY STATE
   ===================================================== */
.empty-state { text-align: center; padding: 3rem 1rem; }
.empty-state-icon { font-size: 2.75rem; color: #cbd5e1; margin-bottom: .875rem; }
.empty-state-title { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); margin-bottom: .4rem; }
.empty-state-text { color: var(--text-muted); font-size: .9rem; }

/* =====================================================
   SELECT2 OVERRIDES
   ===================================================== */
.select2-container--bootstrap-5 .select2-selection {
  border: 1.5px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  min-height: 42px !important;
  font-size: .95rem !important;
}
.select2-container--bootstrap-5 .select2-selection:focus,
.select2-container--bootstrap-5.select2-container--focus .select2-selection {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px var(--primary-glow) !important;
}

/* =====================================================
   PRINT
   ===================================================== */
@media print {
  /* hide chrome */
  .no-print, .sidebar, .topbar, .filter-bar,
  .actions, .btn, .modal { display: none !important; }

  /* Bootstrap print utilities — must be explicit to override d-none */
  .d-print-none  { display: none !important; }
  .d-print-block { display: block !important; }
  .d-none        { display: none !important; }

  /* unlock layout constraints so content can flow across pages */
  html, body { background: #fff !important; height: auto !important; overflow: visible !important; }
  .wrapper       { display: block !important; min-height: auto !important; height: auto !important; }
  .main-content  { margin: 0 !important; padding: 0 !important; min-height: auto !important;
                   height: auto !important; overflow: visible !important; }
  .topbar        { display: none !important; }

  /* card / typography cleanup */
  .card { box-shadow: none !important; border: 1px solid #ddd !important; }
  body { font-size: 12px; }
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 991px) {
  :root { --sidebar-w: 240px; }
}
@media (max-width: 768px) {
  :root { --topbar-h: 56px; }
  .sidebar {
    position: fixed; left: 0; top: 0;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 1050;
  }
  .sidebar.show { transform: translateX(0); }
  main.container-fluid { padding: 1.25rem 1rem; }
  .stat-value { font-size: 1.6rem; }
  .topbar { padding: 0 1rem; }
  .topbar-date { display: none; }
}
@media (max-width: 576px) {
  main.container-fluid { padding: 1rem .875rem; }
  .card-body { padding: 1.125rem; }
  .table > :not(caption) > * > * { padding: .65rem .75rem; }
}
