/* ============================================================
   CISMinna Modern Theme — Bootstrap 5.3
   Challenge Schools Minna — Admin Portal
   Color Palette: Purple / Violet (matching school branding)
   ============================================================ */

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

/* ============================================================
   ROOT VARIABLES — Purple School Theme
   ============================================================ */
:root {
  /* Core purple palette */
  --purple-900:  #4a148c;
  --purple-800:  #6a1b9a;
  --purple-700:  #7b1fa2;
  --purple-600:  #8e24aa;
  --purple-500:  #9c27b0;
  --purple-400:  #ab47bc;
  --purple-300:  #ce93d8;
  --purple-200:  #e1bee7;
  --purple-100:  #f3e5f5;
  --purple-50:   #faf0ff;

  /* Sidebar */
  --sidebar-bg:        linear-gradient(180deg, #4a148c 0%, #7b1fa2 50%, #9c27b0 100%);
  --sidebar-width:     260px;
  --sidebar-text:      rgba(255,255,255,0.88);
  --sidebar-text-hover:#ffffff;
  --sidebar-hover-bg:  rgba(255,255,255,0.14);
  --sidebar-active-bg: rgba(255,255,255,0.22);
  --sidebar-border:    rgba(255,255,255,0.1);

  /* Top nav & layout */
  --topnav-height: 60px;

  /* Semantic colors */
  --primary:       #8e24aa;
  --primary-dark:  #6a1b9a;
  --primary-light: #ce93d8;
  --accent:        #e040fb;
  --success:       #2e7d32;
  --danger:        #c62828;
  --warning:       #e65100;
  --info:          #0277bd;

  /* Backgrounds */
  --body-bg:       #f7f0fa;
  --card-bg:       #ffffff;

  /* Shadows & radii */
  --card-shadow:   0 2px 20px rgba(106,27,154,0.08);
  --card-radius:   12px;

  /* Text */
  --text-main:     #1a0a2e;
  --text-muted:    #7a6b8a;
  --border-color:  #e8d8f0;

  /* Misc */
  --font:          'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition:    all 0.25s ease;
}

/* ============================================================
   GLOBAL RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background-color: var(--body-bg);
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* ============================================================
   LAYOUT
   ============================================================ */
.container.body { padding: 0; }

.main_container {
  display: block;
  min-height: 100vh;
}

/* ============================================================
   SIDEBAR — Narrow icon+label (default) / Wide row (body.nav-md)
   ============================================================ */
:root {
  --sidebar-narrow: 75px;
}

.left_col {
  width: var(--sidebar-narrow);
  min-width: var(--sidebar-narrow);
  background: var(--sidebar-bg);
  min-height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: visible;
  height: 100vh;
  box-shadow: 4px 0 24px rgba(74,20,140,0.25);
  transition: width 0.25s ease;
}

.left_col.scroll-view {
  position: relative !important; /* override position:fixed from .left_col */
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

.left_col::-webkit-scrollbar { width: 4px; }
.left_col::-webkit-scrollbar-track { background: transparent; }
.left_col::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }

/* Brand */
.nav_title {
  padding: 14px 8px;
  border-bottom: 1px solid var(--sidebar-border);
  background: rgba(0,0,0,0.15);
  display: flex;
  justify-content: center;
}

.site_title {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff !important;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  white-space: nowrap;
}

.site_title i {
  width: 38px;
  height: 38px;
  min-width: 38px;
  background: rgba(255,255,255,0.18);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  border: 1px solid rgba(255,255,255,0.2);
}

.site_title span { display: none; }  /* hidden in narrow mode */

/* Profile */
.profile {
  padding: 14px 8px;
  border-bottom: 1px solid var(--sidebar-border);
  text-align: center;
}

.profile_pic .profile_img {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.35);
  object-fit: cover;
  box-shadow: 0 4px 14px rgba(0,0,0,0.2);
}

.profile_info { display: none; }  /* hidden in narrow mode */

.profile_info h2 {
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  margin: 0 0 4px;
}

.profile_info p,
.profile_info small,
.profile_info span {
  font-size: 12px;
  color: rgba(255,255,255,0.72);
  display: block;
}

/* Menu */
.main_menu_side { padding: 6px 0; flex: 1; overflow: visible; display: flex; flex-direction: column; }
.menu_section { padding: 0; overflow: visible; flex: 1; display: flex; flex-direction: column; }

.side-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  overflow: visible;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Narrow mode: icon above, label below */
.side-menu > li {
  margin: 2px 4px;
  position: relative;
}

.side-menu > li > a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 4px;
  color: var(--sidebar-text);
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
  text-align: center;
}

.side-menu > li > a:hover,
.side-menu > li.active > a {
  background: var(--sidebar-hover-bg);
  color: #ffffff;
}

.side-menu > li > a i {
  font-size: 20px;
  width: auto;
  opacity: 0.9;
  flex-shrink: 0;
}

.nav-label {
  font-size: 9.5px;
  font-weight: 500;
  line-height: 1.25;
  width: 100%;
  overflow-wrap: break-word;
  text-align: center;
  color: inherit;
}

.side-menu > li:last-child {
  margin-top: auto;
  border-top: 1px solid var(--sidebar-border);
  padding-top: 4px;
}

/* Caret indicator on parent items */
.nav-caret {
  font-size: 9px;
  opacity: 0.65;
  transition: transform 0.2s ease;
  display: block;
  text-align: center;
}

.side-menu > li.active > a .nav-caret {
  transform: rotate(90deg);
  opacity: 1;
}

/* Flyout child menu — fixed position to escape overflow:hidden on scroll-view */
.child_menu {
  list-style: none;
  padding: 8px 0;
  margin: 0;
  background: var(--purple-800);
  border-radius: 0 10px 10px 0;
  display: none;
  position: fixed;
  left: var(--sidebar-narrow);
  top: 0; /* updated by JS on open */
  min-width: 175px;
  z-index: 1100;
  box-shadow: 4px 4px 20px rgba(0,0,0,0.35);
}

.side-menu > li.active > .child_menu { display: block; }

.child_menu li a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  color: rgba(255,255,255,0.85) !important;
  font-size: 13px;
  transition: var(--transition);
  white-space: nowrap;
}

.child_menu li a::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  flex-shrink: 0;
}

.child_menu li a:hover {
  color: #fff !important;
  background: rgba(255,255,255,0.12);
}

.child_menu li a:hover::before { background: #e040fb; }

.child_menu li a small {
  font-size: 10px;
  background: rgba(255,255,255,0.15);
  padding: 1px 7px;
  border-radius: 10px;
  margin-left: auto;
  color: rgba(255,255,255,0.8);
  white-space: nowrap;
}

/* Force sidebar text white — Bootstrap 5 .nav overrides */
.side-menu a,
.side-menu a:hover,
.side-menu a:focus,
.side-menu a:visited { color: var(--sidebar-text) !important; }
.side-menu > li > a:hover { color: #ffffff !important; }

/* ============================================================
   WIDE SIDEBAR — body.nav-md (hamburger expanded)
   ============================================================ */
body.nav-md .left_col {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  overflow-x: hidden;
}

body.nav-md .site_title span { display: inline; }
body.nav-md .nav_title { justify-content: flex-start; padding: 20px 20px 16px; }

body.nav-md .profile { padding: 20px; }
body.nav-md .profile_pic .profile_img { width: 66px; height: 66px; margin-bottom: 10px; }
body.nav-md .profile_info { display: block; }

body.nav-md .side-menu > li { margin: 2px 10px; }

body.nav-md .side-menu > li > a {
  flex-direction: row;
  padding: 11px 14px;
  gap: 11px;
  text-align: left;
}

body.nav-md .side-menu > li > a i { font-size: 15px; width: 20px; }
body.nav-md .nav-label { font-size: 13.5px; max-width: none; word-break: normal; overflow-wrap: normal; flex: 1; }
body.nav-md .nav-caret { display: inline; font-size: 12px; margin-left: auto; }
body.nav-md .side-menu > li.active > a .nav-caret { transform: rotate(90deg); }

/* Wide mode: child menu is accordion (static), jQuery animates it */
body.nav-md .child_menu {
  position: static !important;
  border-radius: 8px;
  padding: 4px 0 6px 16px;
  margin: 2px 0 4px;
  background: rgba(0,0,0,0.12);
  box-shadow: none;
  min-width: 0;
  white-space: normal;
}

body.nav-md .side-menu > li.active > .child_menu { display: none; } /* jQuery controls this */

/* ============================================================
   TOP NAV
   ============================================================ */
.top_nav {
  position: fixed;
  top: 0;
  left: var(--sidebar-narrow);
  right: 0;
  height: var(--topnav-height);
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 2px 12px rgba(106,27,154,0.07);
  z-index: 999;
  display: flex;
  align-items: center;
}

.nav_menu {
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 14px;
  width: 100%;
  min-width: 0;
}

.nav_menu nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.nav.toggle #menu_toggle {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--purple-100);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--primary);
  font-size: 15px;
  transition: var(--transition);
}

.nav.toggle #menu_toggle:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.nav_menu nav h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--primary-dark);
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.btn-outline-danger {
  border-color: #e57373;
  color: #c62828;
  font-size: 13px;
}

.btn-outline-danger:hover { background: #c62828; border-color: #c62828; color: #fff; }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.right_col {
  margin-left: var(--sidebar-narrow);
  margin-top: var(--topnav-height);
  padding: 24px;
  min-height: calc(100vh - var(--topnav-height));
  flex: 1;
}

/* ============================================================
   PANELS / CARDS
   ============================================================ */
.x_panel {
  background: var(--card-bg);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border-color);
  margin-bottom: 24px;
  overflow: visible; /* allow table-responsive scrollbars to show */
}

/* Clip just the top corners so table header bg respects border-radius */
.x_title { border-radius: var(--card-radius) var(--card-radius) 0 0; }

/* Horizontal scroll for wide tables */
.x_content { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.x_title {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
}

.x_title h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary-dark);
  margin: 0;
}

.x_content { padding: 20px; }

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  background: #ffffff;
  border-top: 2px solid var(--purple-300);
  padding: 12px 24px;
  margin-left: var(--sidebar-narrow);
  font-size: 12px;
  color: var(--text-muted);
  text-align: right;
  display: block;
}

footer a { color: var(--primary); }
footer a:hover { color: var(--primary-dark); }

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.form-control, .form-select {
  border-radius: 8px;
  border: 1.5px solid var(--border-color);
  font-size: 13.5px;
  padding: 9px 14px;
  color: var(--text-main);
  transition: var(--transition);
  background: var(--purple-50);
}
label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 5px;
  display: inline-block;
}

.form-control:focus, .form-select:focus {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(142,36,170,0.12);
  outline: none;
}

.form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 6px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  padding: 8px 18px;
  transition: var(--transition);
  letter-spacing: 0.3px;
}
.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
  border-radius: 6px;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(142,36,170,0.35);
}

.btn-success:hover  { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(46,125,50,0.3); }
.btn-danger:hover   { transform: translateY(-1px); }
.btn-warning:hover  { transform: translateY(-1px); }
.btn-info:hover     { transform: translateY(-1px); }

/* ============================================================
   TABLES / DATATABLES
   ============================================================ */
.table {
  font-size: 13.5px;
  color: var(--text-main);
}

.table thead th {
  background: linear-gradient(90deg, var(--purple-100), var(--purple-50));
  color: var(--primary-dark);
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-bottom: 2px solid var(--purple-200);
  padding: 11px 14px;
}

.table td {
  padding: 10px 14px;
  vertical-align: middle;
  border-color: var(--border-color);
}

.table tbody tr:hover { background: var(--purple-50); }
.table-striped > tbody > tr:nth-of-type(odd) > * { background-color: rgba(243,229,245,0.35); }

.dataTables_wrapper .dataTables_filter input {
  border-radius: 8px;
  border: 1.5px solid var(--border-color);
  padding: 6px 12px;
  font-size: 13px;
}

.dataTables_wrapper .dataTables_filter input:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(142,36,170,0.1);
}

/* ============================================================
   ALERTS / MESSAGES
   ============================================================ */
.alert {
  border-radius: 10px;
  border: none;
  font-size: 13.5px;
  padding: 12px 16px;
}

.alert-danger  { background: #fce4ec; color: #880e4f;  border-left: 4px solid #e91e63; }
.alert-success { background: #e8f5e9; color: #1b5e20;  border-left: 4px solid #43a047; }
.alert-warning { background: #fff8e1; color: #e65100;  border-left: 4px solid #ff8f00; }
.alert-info    { background: var(--purple-100); color: var(--primary-dark); border-left: 4px solid var(--primary); }

/* ============================================================
   DASHBOARD FEATURE CARDS
   ============================================================ */
.feature-card {
  background: var(--card-bg);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border-color);
  padding: 22px 20px;
  transition: var(--transition);
  height: 100%;
  overflow: hidden;
  overflow-wrap: break-word;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 32px rgba(106,27,154,0.15);
  border-color: var(--purple-300);
}

.feature-card .icon-wrap {
  width: 50px;
  height: 50px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 14px;
}

.feature-card h6 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 5px;
}

.feature-card p {
  font-size: 12.5px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header-wrap {
  background: #fff;
  border-left: 5px solid var(--primary);
  border-radius: var(--card-radius);
  padding: 16px 22px;
  margin-bottom: 22px;
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.page-header-wrap h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-dark);
  margin: 0 0 3px;
}

.page-header-wrap small {
  color: var(--text-muted);
  font-size: 13px;
}

/* ============================================================
   ICON COLOR VARIANTS
   ============================================================ */
.bg-purple-soft  { background: var(--purple-100);  color: var(--primary-dark); }
.bg-violet-soft  { background: #ede7f6;             color: #4527a0; }
.bg-pink-soft    { background: #fce4ec;             color: #ad1457; }
.bg-deep-soft    { background: #e8eaf6;             color: #283593; }
.bg-teal-soft    { background: #e0f7fa;             color: #00838f; }
.bg-green-soft   { background: #e8f5e9;             color: #2e7d32; }
.bg-amber-soft   { background: #fff8e1;             color: #e65100; }
.bg-blue-soft    { background: #e3f2fd;             color: #1565c0; }
.bg-red-soft     { background: #fce4ec;             color: #c62828; }
.bg-orange-soft  { background: #fff3e0;             color: #bf360c; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
body.login-page {
  background: linear-gradient(135deg, #4a148c 0%, #7b1fa2 40%, #9c27b0 70%, #ce93d8 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

/* Decorative circles */
body.login-page::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -15%;
  width: 65vw;
  height: 65vw;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
  pointer-events: none;
}

body.login-page::after {
  content: '';
  position: absolute;
  bottom: -25%;
  left: -10%;
  width: 45vw;
  height: 45vw;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
  pointer-events: none;
}

.login-container {
  width: 100%;
  max-width: 430px;
  position: relative;
  z-index: 1;
}

.login-card {
  background: #ffffff;
  border-radius: 22px;
  padding: 42px 40px 34px;
  box-shadow: 0 30px 70px rgba(74,20,140,0.28);
}

.login-logo {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, #6a1b9a, #e040fb);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 0 10px 28px rgba(142,36,170,0.4);
}

.login-logo i { font-size: 30px; color: #fff; }

.login-card h1 {
  font-size: 21px;
  font-weight: 700;
  color: var(--primary-dark);
  text-align: center;
  margin: 0 0 4px;
}

.login-card .login-subtitle {
  text-align: center;
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 28px;
}

/* Input groups */
.login-input-group {
  position: relative;
  margin-bottom: 14px;
}

.login-input-group .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary);
  font-size: 14px;
  z-index: 2;
}

.login-input-group .form-control {
  padding-left: 42px;
  height: 48px;
  border-radius: 10px;
  font-size: 14px;
  border: 1.5px solid var(--border-color);
  background: var(--purple-50);
  color: var(--text-main);
  transition: var(--transition);
}

.login-input-group .form-control:focus {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(142,36,170,0.12);
}

.login-input-group .form-control::placeholder { color: #b39dbe; }

/* Login button */
.btn-login {
  width: 100%;
  height: 50px;
  background: linear-gradient(135deg, #6a1b9a, #9c27b0, #e040fb);
  background-size: 200% auto;
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 6px 20px rgba(142,36,170,0.4);
  margin-top: 10px;
}

.btn-login:hover {
  background-position: right center;
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(142,36,170,0.5);
  color: #fff;
}

.btn-login:active { transform: translateY(0); }

/* Login footer */
.login-footer {
  text-align: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.8;
}

.login-footer a { color: var(--primary); font-weight: 500; }
.login-footer a:hover { color: var(--primary-dark); }

/* Login error */
.login-alert {
  border-radius: 10px;
  font-size: 13px;
  padding: 10px 14px;
  margin-bottom: 16px;
  border: none;
  background: #fce4ec;
  color: #880e4f;
  border-left: 4px solid #e91e63;
}

/* ============================================================
   UTILITIES
   ============================================================ */
.pull-right { float: right !important; }
.pull-left  { float: left !important; }
.clearfix::after { content: ''; display: table; clear: both; }
.text-primary { color: var(--primary) !important; }
.bg-primary   { background: var(--primary) !important; }

/* ============================================================
   SIDEBAR OVERLAY (mobile)
   ============================================================ */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(74,20,140,0.4);
  backdrop-filter: blur(2px);
  z-index: 999;
}

.sidebar-overlay.active { display: block; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
/* ============================================================
   RESPONSIVE FORM GRID
   (col-md-6 fields go side-by-side on desktop without .row wrapper)
   ============================================================ */
.x_content form {
  display: flex;
  flex-wrap: wrap;
  margin-left: -8px;
  margin-right: -8px;
}
.x_content form > .form-group,
.x_content form > [class*="col-"] {
  padding-left: 8px;
  padding-right: 8px;
  padding-bottom: 12px;
  box-sizing: border-box;
}
/* Full-width items that aren't columns */
.x_content form > p,
.x_content form > label,
.x_content form > .input-group,
.x_content form > .alert {
  width: 100%;
  padding-left: 8px;
  padding-right: 8px;
  padding-bottom: 8px;
}

@media (max-width: 767.98px) {
  /* Target only the outer sidebar shell — NOT the inner .left_col.scroll-view */
  #sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease, width 0.25s ease;
  }
  #sidebar.sidebar-open {
    transform: translateX(0);
    width: var(--sidebar-width) !important;
    min-width: var(--sidebar-width) !important;
  }
  .top_nav   { left: 0 !important; }
  .right_col { margin-left: 0 !important; padding: 16px; }
  footer     { margin-left: 0 !important; text-align: center; }
  body.nav-md .top_nav   { left: 0 !important; }
  body.nav-md .right_col { margin-left: 0 !important; }

  .page-header-wrap { padding: 12px 14px; border-left-width: 4px; }
  .page-header-wrap h2 { font-size: 16px; }
  .page-header-wrap small { font-size: 12px; }
  .x_title { padding: 12px 16px; }
  .x_content { padding: 16px; }
  .x_title h2 { font-size: 14px; }

  /* Force all form cols to full width on mobile */
  .x_content form > .form-group,
  .x_content form > [class*="col-"] { width: 100% !important; }
}

@media (max-width: 576px) {
  .right_col { padding: 12px; }
  .login-card { padding: 28px 22px; }
  .login-card h1 { font-size: 19px; }
  .feature-card { padding: 16px 14px; }
}

/* ============================================================
   NAV-MD — Wide sidebar (hamburger expands from narrow default)
   ============================================================ */
body.nav-md .top_nav   { left: var(--sidebar-width); transition: left 0.25s ease; }
body.nav-md .right_col { margin-left: var(--sidebar-width); transition: margin-left 0.25s ease; }
body.nav-md footer     { margin-left: var(--sidebar-width); }

/* ============================================================
   PAGE HEADER WIDTH FIX
   ============================================================ */
.page-header-wrap { width: 100%; box-sizing: border-box; }

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  .left_col, .top_nav { display: none !important; }
  .right_col { margin: 0 !important; padding: 0 !important; }
  .x_panel { box-shadow: none !important; border: 1px solid #ddd !important; }
}
