/* ============================================================
   MIT Consulting - Modern Design System
   ============================================================ */

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

/* ── Design Tokens ─────────────────────────────────────────── */
:root {
  --primary:         #2563eb;
  --primary-dark:    #1d4ed8;
  --primary-light:   #3b82f6;
  --primary-glow:    rgba(37,99,235,.15);

  --sidebar-bg:      #0f172a;
  --sidebar-hover:   rgba(255,255,255,.07);
  --sidebar-active:  rgba(37,99,235,.25);
  --sidebar-text:    rgba(255,255,255,.65);
  --sidebar-text-active: #fff;
  --sidebar-border:  rgba(255,255,255,.06);
  --sidebar-width:   240px;

  --topbar-bg:       #ffffff;
  --topbar-h:        64px;
  --topbar-shadow:   0 1px 0 #e2e8f0;

  --body-bg:         #f8fafc;
  --card-bg:         #ffffff;
  --text:            #0f172a;
  --text-muted:      #64748b;
  --border:          #e2e8f0;

  --shadow-xs:       0 1px 2px rgba(0,0,0,.05);
  --shadow-sm:       0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:       0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.05);
  --shadow-lg:       0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.05);
  --shadow-xl:       0 20px 25px -5px rgba(0,0,0,.08), 0 8px 10px -6px rgba(0,0,0,.05);

  --radius-sm:       6px;
  --radius-md:       10px;
  --radius-lg:       14px;
  --radius-xl:       20px;
  --radius-full:     9999px;

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

/* ── Base ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { font-size: 15px; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--body-bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ════════════════════════════════════════════════════════════
   SIDEBAR
   ════════════════════════════════════════════════════════════ */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 1040;
  padding: 0;
  transition: var(--transition);
  overflow: hidden;
}

/* Sidebar brand logo area */
.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--topbar-h);
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--sidebar-border);
  background: rgba(255,255,255,.04);
  flex-shrink: 0;
}

.sidebar-brand img {
  max-height: 38px;
  width: auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: .9;
}

/* Navigation */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1rem 0;
}

.sidebar-section-label {
  font-size: .65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(255,255,255,.3);
  padding: .5rem 1.25rem .25rem;
  margin-top: .5rem;
}

.sidebar .nav-item { padding: 0 .75rem; margin-bottom: 2px; }

.sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem 1rem;
  color: var(--sidebar-text);
  font-size: .875rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.sidebar .nav-link i,
.sidebar .nav-link svg {
  width: 18px;
  font-size: 1rem;
  flex-shrink: 0;
  opacity: .8;
}

.sidebar .nav-link:hover {
  background: var(--sidebar-hover);
  color: #fff;
  text-decoration: none;
}

.sidebar .nav-link:hover i { opacity: 1; }

.sidebar .nav-link.active {
  background: var(--sidebar-active);
  color: var(--sidebar-text-active);
  box-shadow: inset 3px 0 0 var(--primary-light);
}

.sidebar .nav-link.active i { opacity: 1; }

/* Sidebar footer */
.sidebar-footer {
  padding: .75rem;
  border-top: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

/* Sidebar sticky (override old) */
.sidebar-sticky { display: contents; }

/* ════════════════════════════════════════════════════════════
   TOPBAR / NAVBAR
   ════════════════════════════════════════════════════════════ */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: var(--topbar-h);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.75rem;
  z-index: 1030;
  gap: 1rem;
}

.topbar-left {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 1rem;
}

.topbar-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .8rem;
  color: var(--text-muted);
  margin: 0;
  list-style: none;
  padding: 0;
}

.topbar-breadcrumb li + li::before {
  content: '/';
  margin-right: .35rem;
  opacity: .5;
}

.topbar-breadcrumb a { color: var(--text-muted); text-decoration: none; }
.topbar-breadcrumb a:hover { color: var(--primary); }

.topbar-right {
  display: flex;
  align-items: center;
  gap: .5rem;
}

/* Topbar user avatar button */
.topbar-user-btn {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .4rem .75rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.topbar-user-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  text-decoration: none;
}

.topbar-user-btn img {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.topbar-user-btn .user-name {
  font-size: .825rem;
  font-weight: 500;
  color: var(--text);
}

/* Topbar icon button */
.topbar-icon-btn {
  width: 38px; height: 38px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.topbar-icon-btn:hover { background: #f1f5f9; color: var(--text); }

/* Old navbar overrides (keep Bootstrap nav working) */
.navbar.fixed-top {
  position: fixed !important;
  top: 0; left: var(--sidebar-width); right: 0;
  height: var(--topbar-h);
  background: var(--topbar-bg) !important;
  border-bottom: 1px solid var(--border);
  padding: 0 1.75rem;
  box-shadow: none;
  z-index: 1030;
}

.navbar-brand-wrapper { display: none !important; }

.navbar .page-header {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.navbar .breadcrumb {
  background: transparent;
  padding: 0;
  margin-left: .5rem;
  font-size: .8rem;
}

.navbar .breadcrumb-item a { color: var(--text-muted); text-decoration: none; }
.navbar .breadcrumb-item.active { color: var(--text-muted); }
.navbar .breadcrumb-item + .breadcrumb-item::before { color: var(--border); }

.navbar .navbar-nav .nav-link { padding: .4rem .5rem; }

/* ════════════════════════════════════════════════════════════
   MAIN CONTENT AREA
   ════════════════════════════════════════════════════════════ */
.content-page {
  margin-left: var(--sidebar-width);
  padding-top: var(--topbar-h);
  min-height: 100vh;
}

.content-page main {
  padding: 1.75rem 2rem;
}

/* Override old Bootstrap layout */
.container-fluid > .row > .content-page {
  width: calc(100% - var(--sidebar-width));
}

/* ════════════════════════════════════════════════════════════
   CARDS
   ════════════════════════════════════════════════════════════ */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  background: transparent;
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h4, .card-header h5, .card-header h6 {
  margin: 0;
  font-weight: 600;
  font-size: .925rem;
  color: var(--text);
}

.card-body { padding: 1.25rem; }

/* Stat cards */
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.1rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

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

.stat-icon.blue   { background: rgba(37,99,235,.1);  color: var(--primary); }
.stat-icon.green  { background: rgba(16,185,129,.1); color: #10b981; }
.stat-icon.orange { background: rgba(245,158,11,.1); color: #f59e0b; }
.stat-icon.red    { background: rgba(239,68,68,.1);  color: #ef4444; }

.stat-info .label {
  font-size: .75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: .2rem;
}

.stat-info .value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

/* ════════════════════════════════════════════════════════════
   FORMS
   ════════════════════════════════════════════════════════════ */
.form-control {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: .5rem .875rem;
  font-size: .875rem;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: var(--transition);
  height: auto;
  line-height: 1.6;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  outline: none;
}

.form-control::placeholder { color: #94a3b8; }

.form-control-lg {
  padding: .75rem 1rem;
  font-size: .95rem;
  border-radius: var(--radius-md);
}

label {
  font-size: .8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: .35rem;
  display: block;
}

.form-group { margin-bottom: 1.1rem; }

/* Input icon wrapper */
.input-icon {
  position: relative;
}
.input-icon i {
  position: absolute;
  left: .875rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: .9rem;
  pointer-events: none;
}
.input-icon .form-control { padding-left: 2.5rem; }

/* Checkbox */
.custom-control-label { font-size: .85rem; color: var(--text); font-weight: 400; cursor: pointer; }
.custom-control-input:checked ~ .custom-control-label::before { background: var(--primary); border-color: var(--primary); }

/* ════════════════════════════════════════════════════════════
   BUTTONS
   ════════════════════════════════════════════════════════════ */
.btn {
  font-family: inherit;
  font-size: .875rem;
  font-weight: 500;
  padding: .5rem 1.1rem;
  border-radius: var(--radius-md);
  transition: var(--transition);
  border: 1.5px solid transparent;
  line-height: 1.5;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}

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

.btn-primary:hover, .btn-primary:focus {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #fff;
  box-shadow: 0 4px 12px rgba(37,99,235,.35);
  transform: translateY(-1px);
}

.btn-primary:active { transform: translateY(0); box-shadow: none; }

.btn-lg {
  padding: .7rem 1.5rem;
  font-size: .95rem;
  border-radius: var(--radius-md);
}

.btn-block { width: 100%; justify-content: center; }

.btn-outline-secondary {
  border-color: var(--border);
  color: var(--text-muted);
  background: transparent;
}

.btn-outline-secondary:hover {
  background: #f1f5f9;
  color: var(--text);
  border-color: #cbd5e1;
}

.btn-light {
  background: #f1f5f9;
  border-color: #f1f5f9;
  color: var(--text);
}

.btn-light:hover { background: #e2e8f0; border-color: #e2e8f0; }

/* ════════════════════════════════════════════════════════════
   TABLES
   ════════════════════════════════════════════════════════════ */
.table {
  font-size: .875rem;
  color: var(--text);
}

.table thead th {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  border-top: none;
  padding: .75rem 1rem;
  background: #f8fafc;
}

.table tbody td {
  padding: .875rem 1rem;
  vertical-align: middle;
  border-color: var(--border);
  color: var(--text);
}

.table tbody tr {
  transition: background .15s;
}

.table tbody tr:hover { background: #f8fafc; }

/* ════════════════════════════════════════════════════════════
   BADGES
   ════════════════════════════════════════════════════════════ */
.badge {
  font-size: .7rem;
  font-weight: 600;
  padding: .3em .65em;
  border-radius: var(--radius-full);
  letter-spacing: .03em;
}

.badge-success  { background: rgba(16,185,129,.12); color: #059669; }
.badge-danger   { background: rgba(239,68,68,.12);  color: #dc2626; }
.badge-warning  { background: rgba(245,158,11,.12); color: #d97706; }
.badge-info     { background: rgba(6,182,212,.12);  color: #0891b2; }
.badge-primary  { background: rgba(37,99,235,.12);  color: #1d4ed8; }
.badge-secondary{ background: rgba(100,116,139,.12);color: #475569; }

/* ════════════════════════════════════════════════════════════
   MODALS
   ════════════════════════════════════════════════════════════ */
.modal-content {
  border: none;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.modal-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.modal-body { padding: 1.5rem; }

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  background: #f8fafc;
}

/* ════════════════════════════════════════════════════════════
   ALERTS
   ════════════════════════════════════════════════════════════ */
.alert {
  border-radius: var(--radius-md);
  border: none;
  padding: .9rem 1.1rem;
  font-size: .875rem;
  display: flex;
  align-items: flex-start;
  gap: .6rem;
}

.alert-success  { background: rgba(16,185,129,.1);  color: #065f46; }
.alert-danger   { background: rgba(239,68,68,.1);   color: #991b1b; }
.alert-warning  { background: rgba(245,158,11,.1);  color: #92400e; }
.alert-info     { background: rgba(6,182,212,.1);   color: #164e63; }

/* ════════════════════════════════════════════════════════════
   DROPDOWN
   ════════════════════════════════════════════════════════════ */
.dropdown-menu {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: .5rem;
  font-size: .875rem;
  min-width: 180px;
}

.dropdown-item {
  border-radius: var(--radius-sm);
  padding: .5rem .875rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: .6rem;
  transition: var(--transition);
}

.dropdown-item:hover { background: #f1f5f9; color: var(--text); }
.dropdown-item i { width: 16px; color: var(--text-muted); font-size: .875rem; }
.dropdown-divider { margin: .35rem 0; border-color: var(--border); }

/* ════════════════════════════════════════════════════════════
   PAGE HEADERS
   ════════════════════════════════════════════════════════════ */
.page-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: .25rem;
}

.page-subtitle {
  font-size: .875rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* Section header */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

/* ════════════════════════════════════════════════════════════
   NOTIFICATIONS / STATUS
   ════════════════════════════════════════════════════════════ */
#docHide {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  color: #fff !important;
  border-radius: var(--radius-md) !important;
  padding: .75rem 1.25rem !important;
  font-weight: 500;
  font-size: .875rem;
  box-shadow: 0 4px 12px rgba(16,185,129,.35);
  width: auto !important;
  max-width: 400px;
  margin: 1rem auto !important;
  text-align: center;
}

#docHide p { margin: 0; color: #fff; }

/* ════════════════════════════════════════════════════════════
   FILE UPLOAD INPUTS
   ════════════════════════════════════════════════════════════ */
input[type="file"].form-control {
  padding: .4rem .875rem;
  cursor: pointer;
}

/* ════════════════════════════════════════════════════════════
   SELECT2 OVERRIDES
   ════════════════════════════════════════════════════════════ */
.select2-container--default .select2-selection--single {
  height: auto;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: .45rem .875rem;
  font-family: inherit;
  font-size: .875rem;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 1.6;
  padding: 0;
  color: var(--text);
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 100%;
}

.select2-container--default.select2-container--focus .select2-selection--single {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.select2-dropdown {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

/* ════════════════════════════════════════════════════════════
   AUTH LAYOUT
   ════════════════════════════════════════════════════════════ */
body.auth-page {
  background: var(--body-bg);
  min-height: 100vh;
  display: flex;
  align-items: stretch;
}

.auth-wrapper {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* Left panel – decorative */
.auth-panel-left {
  flex: 0 0 40%;
  background: linear-gradient(155deg, #0f172a 0%, #1e3a8a 50%, #1d4ed8 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  position: relative;
  overflow: hidden;
}

.auth-panel-left::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.auth-panel-left .brand {
  text-align: center;
  z-index: 1;
}

.auth-panel-left .brand img {
  max-width: 180px;
  filter: brightness(0) invert(1);
  opacity: .9;
  margin-bottom: 2rem;
}

.auth-panel-left .tagline {
  color: rgba(255,255,255,.8);
  font-size: 1.15rem;
  font-weight: 500;
  text-align: center;
  line-height: 1.7;
}

.auth-panel-left .tagline strong {
  color: #fff;
  font-weight: 700;
  display: block;
  font-size: 1.5rem;
  margin-bottom: .5rem;
}

.auth-dots {
  display: flex;
  gap: .5rem;
  margin-top: 2.5rem;
}

.auth-dots span {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.3);
}

.auth-dots span.active { background: #fff; width: 24px; border-radius: 4px; }

/* Right panel – form */
.auth-panel-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: #fff;
}

.auth-form-box {
  width: 100%;
  max-width: 400px;
}

.auth-form-box .auth-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: .35rem;
}

.auth-form-box .auth-subtitle {
  font-size: .9rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 1.25rem 0;
  color: var(--text-muted);
  font-size: .8rem;
}

.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-footer-link {
  text-align: center;
  margin-top: 1.5rem;
  font-size: .875rem;
  color: var(--text-muted);
}

.auth-footer-link a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

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

.forgot-link {
  font-size: .825rem;
  color: var(--text-muted);
  text-decoration: none;
  display: inline-block;
  margin-top: .5rem;
}

.forgot-link:hover { color: var(--primary); }

/* ════════════════════════════════════════════════════════════
   ACTION BUTTONS (btn-icon, btn-rounded)
   ════════════════════════════════════════════════════════════ */
.btn-icon {
  width: 34px; height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--text-muted);
  font-size: .875rem;
  transition: var(--transition);
  cursor: pointer;
  text-decoration: none;
}

.btn-icon:hover { background: #f1f5f9; color: var(--text); text-decoration: none; }
.btn-icon.edit:hover  { background: rgba(37,99,235,.08); color: var(--primary); border-color: var(--primary-light); }
.btn-icon:hover .fa-trash { color: #ef4444; }
.btn-icon:hover .fa-edit  { color: var(--primary); }

.btn-rounded {
  border-radius: var(--radius-full) !important;
  padding: .45rem 1.25rem !important;
}

/* Light border bottom */
.border-bottom-light { border-bottom: 1px solid var(--border) !important; }

/* Input solid */
.input-solid {
  background: #f8fafc;
  border-color: var(--border);
}
.input-solid:focus {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Input group modern */
.input-group .form-control {
  border-right: none;
  border-radius: var(--radius-md) 0 0 var(--radius-md) !important;
}
.input-group-append .btn {
  border: 1.5px solid var(--border);
  border-left: none;
  border-radius: 0 var(--radius-md) var(--radius-md) 0 !important;
  background: #f8fafc;
  color: var(--text-muted);
}
.input-group-append .btn:hover { background: #f1f5f9; color: var(--text); }

/* Search bar */
.custom-search-form { max-width: 320px; }

/* min-width helpers */
.min-width-80  { min-width: 80px; }
.min-width-100 { min-width: 100px; }
.min-width-150 { min-width: 150px; }
.min-width-200 { min-width: 200px; }

/* ════════════════════════════════════════════════════════════
   PERMISSIONS CHECKBOXES
   ════════════════════════════════════════════════════════════ */
.permission-table th { text-align: center; vertical-align: middle; }
.permission-table th:first-child { text-align: left; }

.custom-control-input:checked ~ .custom-control-label::before {
  background-color: var(--primary);
  border-color: var(--primary);
}

/* Save permissions sticky footer */
.save-bar {
  position: sticky;
  bottom: 0;
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 1rem 1.25rem;
  margin: 0 -1.25rem -1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 -4px 12px rgba(0,0,0,.05);
}

/* ════════════════════════════════════════════════════════════
   PAGINATION
   ════════════════════════════════════════════════════════════ */
.pagination .page-link {
  border-color: var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  margin: 0 2px;
  font-size: .825rem;
  padding: .4rem .7rem;
}

.pagination .page-item.active .page-link {
  background: var(--primary);
  border-color: var(--primary);
}

/* ════════════════════════════════════════════════════════════
   UTILITY OVERRIDES
   ════════════════════════════════════════════════════════════ */
.text-primary { color: var(--primary) !important; }
.bg-primary   { background: var(--primary) !important; }
.border       { border-color: var(--border) !important; }

.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow    { box-shadow: var(--shadow-md) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }

.rounded-xl { border-radius: var(--radius-xl) !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }
.rounded-md { border-radius: var(--radius-md) !important; }

/* ════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════ */

/* ════════════════════════════════════════════════════════════
   IMPORT / EXPORT PAGE  (v3 — sans Bootstrap rows)
   ════════════════════════════════════════════════════════════ */

/* Grille 2 colonnes, sans marges négatives Bootstrap */
.ie-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}
@media (max-width: 767px) { .ie-grid-2 { grid-template-columns: 1fr; } }

/* Stat mini-cards */
.ie-stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: .9rem 1.1rem;
  display: flex;
  align-items: center;
  gap: .85rem;
}
.ie-stat-icon {
  width: 42px; height: 42px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.ie-stat-value { font-size: 1.25rem; font-weight: 700; color: var(--text); line-height: 1; }
.ie-stat-label { font-size: .73rem; color: var(--text-muted); margin-top: .2rem; }

/* ── Lignes export ── */
.ie-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .6rem .85rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: #fff;
  text-decoration: none;
  transition: var(--transition);
}
.ie-row:hover           { background: #f8fafc; text-decoration: none; }
.ie-row-featured        { border-color: rgba(37,99,235,.3); background: rgba(37,99,235,.03); }
.ie-row-featured:hover  { background: rgba(37,99,235,.06); }

.ie-row-left  { display: flex; align-items: center; gap: .65rem; min-width: 0; flex: 1; }
.ie-row-icon  {
  width: 34px; height: 34px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem; flex-shrink: 0;
}
.ie-row-title { font-weight: 600; font-size: .875rem; color: var(--text); }
.ie-row-sub   { font-size: .72rem; color: var(--text-muted); margin-top: .1rem; }

.ie-row-btn {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .3rem .75rem; font-size: .78rem; font-weight: 600;
  border-radius: var(--radius-full); border: 1.5px solid;
  white-space: nowrap; flex-shrink: 0; transition: var(--transition);
}

/* Séparateur "ou par type" */
.ie-sep {
  text-align: center; font-size: .72rem; color: var(--text-muted);
  position: relative; padding: .5rem 0; margin: .25rem 0;
}
.ie-sep::before, .ie-sep::after {
  content: ''; position: absolute; top: 50%; height: 1px;
  background: var(--border); width: 45%;
}
.ie-sep::before { left: 0; }
.ie-sep::after  { right: 0; }

/* ── Cartes import ── */
.ie-import-card {
  border: 1.5px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; background: var(--card-bg);
  display: flex; flex-direction: column;
}
.ie-import-head {
  display: flex; align-items: center; gap: .65rem;
  padding: .8rem 1rem; background: #fafbfc;
  border-top: 3px solid;
}
.ie-import-icon {
  width: 34px; height: 34px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem; flex-shrink: 0;
}
.ie-import-title { font-weight: 700; font-size: .875rem; color: var(--text); }
.ie-import-fmt   { font-size: .72rem; color: var(--text-muted); margin-top: .1rem; }
.ie-import-fmt code {
  background: #e2e8f0; padding: .05rem .3rem;
  border-radius: 3px; font-size: .7rem;
}
.ie-import-body  { padding: 1rem; flex: 1; }
.ie-import-desc  { font-size: .8rem; color: var(--text-muted); margin-bottom: .85rem; }

/* Bouton modèle */
.ie-tpl-btn {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .25rem .65rem; font-size: .73rem; font-weight: 600;
  color: #059669; background: rgba(16,185,129,.1);
  border: 1.5px solid rgba(16,185,129,.3);
  border-radius: var(--radius-full); white-space: nowrap;
  text-decoration: none; transition: var(--transition); flex-shrink: 0;
}
.ie-tpl-btn:hover { background: #059669; color: #fff; border-color: #059669; text-decoration: none; }

/* Zone dépôt */
.ie-dz {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: .4rem; width: 100%; min-height: 86px;
  border: 2px dashed var(--border); border-radius: var(--radius-lg);
  cursor: pointer; text-align: center; padding: .9rem 1rem;
  background: #fafbfc; transition: var(--transition); margin: 0;
}
.ie-dz:hover, .ie-dz.dz-over { border-color: var(--primary); background: rgba(37,99,235,.03); }
.ie-dz.dz-over { border-style: solid; }

.ie-dz-icon { font-size: 1.5rem; color: #94a3b8; }
.ie-dz-text { font-size: .78rem; color: var(--text-muted); line-height: 1.5; }

/* masquer l'input file mais garder accessible */
.ie-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* Aperçu */
.ie-pv { display: none; margin-top: .5rem; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.ie-pv-table { width: 100%; font-size: .75rem; border-collapse: collapse; margin: 0; }
.ie-pv-h th { background: #f1f5f9; font-weight: 700; color: var(--text); padding: .3rem .5rem; border-bottom: 1px solid var(--border); }
.ie-pv-table td { padding: .28rem .5rem; border-bottom: 1px solid #f8fafc; color: var(--text); }
.ie-pv-more { font-size: .72rem; color: var(--text-muted); padding: .3rem .5rem; margin: 0; }

/* Bouton soumettre */
.ie-submit {
  display: flex; align-items: center; justify-content: center;
  width: 100%; margin-top: .75rem; padding: .5rem 1rem;
  font-size: .875rem; font-weight: 600; color: #fff;
  border: none; border-radius: var(--radius-md);
  cursor: pointer; transition: var(--transition);
}
.ie-submit:hover { opacity: .88; transform: translateY(-1px); }

/* Utilitaires */
.gap-2 { gap: .5rem; }

/* ════════════════════════════════════════════════════════════
   SETTINGS PAGES
   ════════════════════════════════════════════════════════════ */

/* Onglets de navigation settings */
.settings-tabs {
  display: flex;
  gap: .5rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}

.settings-tab {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .6rem 1.1rem;
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  transition: var(--transition);
}

.settings-tab:hover {
  color: var(--text);
  background: #f8fafc;
  text-decoration: none;
}

.settings-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: transparent;
}

/* Lignes avec switch */
.settings-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .25rem 0;
}

.settings-switch-label {
  font-weight: 500;
  font-size: .9rem;
  color: var(--text);
}

.settings-switch-desc {
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: .15rem;
}

.settings-divider {
  border-top: 1px solid var(--border);
  margin: 1rem 0;
}

.settings-label {
  font-weight: 500;
  font-size: .85rem;
  color: var(--text);
  margin-bottom: .4rem;
}

/* Card sauvegarde sticky */
.settings-save-card {
  position: sticky;
  top: calc(var(--topbar-height) + 1rem);
}

/* Toggle switch */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  margin: 0;
}

.switch input { opacity: 0; width: 0; height: 0; }

.switch-slider {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 34px;
  cursor: pointer;
  transition: .25s;
}

.switch-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: .25s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

.switch input:checked + .switch-slider { background: var(--primary); }
.switch input:checked + .switch-slider::before { transform: translateX(20px); }

/* Settings group */
.settings-group > * + * { }

/* ════════════════════════════════════════════════════════════
   UTILITIES
   ════════════════════════════════════════════════════════════ */
.font-weight-500 { font-weight: 500 !important; }
.font-weight-600 { font-weight: 600 !important; }
.text-muted { color: var(--text-muted) !important; }

@media (max-width: 768px) {
  :root { --sidebar-width: 0px; }

  .sidebar {
    transform: translateX(-240px);
    width: 240px;
  }

  .sidebar.show {
    transform: translateX(0);
    --sidebar-width: 240px;
  }

  .topbar, .navbar.fixed-top { left: 0; }
  .content-page { margin-left: 0; }

  .auth-panel-left { display: none; }
  .auth-panel-right { padding: 1.5rem; }
}
