/* ============================================================
   CMS Modern Theme (2026 refresh)
   - Keeps Bootstrap 4 + jQuery backend flow untouched
   - Loaded AFTER style.css + custom.css to reskin the panel
   - Preserves all JS hooks: #overlayer, .loader-overlay,
     .overlay-dark-sidebar, .sidebar(.collapsed/.sidebar-collapse),
     .contents(.expanded), .dropdown-custom(.active),
     .sidebar_nav a.active, .has-child.open, .ajax-priority, etc.
   ============================================================ */

:root {
  --cm-primary: #00893c;
  --cm-primary-dark: #006e30;
  --cm-primary-soft: #e7f4ec;
  --cm-accent: #f7971c;
  --cm-bg: #f1f5f9;
  --cm-surface: #ffffff;
  --cm-border: #e2e8f0;
  --cm-border-strong: #cbd5e1;
  --cm-text: #0f172a;
  --cm-text-muted: #64748b;
  --cm-text-faint: #94a3b8;
  --cm-sidebar-bg: #1f357d;
  --cm-sidebar-bg-2: #14245c;
  --cm-sidebar-text: #cbd5e1;
  --cm-sidebar-active: #ffffff;
  --cm-danger: #dc2626;
  --cm-success: #16a34a;
  --cm-warning: #d97706;
  --cm-radius: 12px;
  --cm-radius-sm: 8px;
  --cm-shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .07);
  --cm-shadow-lg: 0 12px 32px rgba(15, 23, 42, .14);
  --cm-topbar-h: 64px;
  --cm-sidebar-w: 264px;
  --cm-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ---------- base ---------- */
body {
  font-family: var(--cm-font) !important;
  background: var(--cm-bg) !important;
  color: var(--cm-text) !important;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

body.overlayScroll { overflow: hidden; }

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

::selection { background: var(--cm-primary); color: #fff; }

/* ---------- legacy utility shims (only ones still used by Blade views) ---------- */
.color-primary { color: var(--cm-primary) !important; }
.fs-16 { font-size: 16px !important; }
.mb-20 { margin-bottom: 1rem !important; }
.mb-15 { margin-bottom: .75rem !important; }
.mr-15 { margin-right: .75rem !important; }
.box-shadow-none { box-shadow: none !important; }

/* ---------- app shell ---------- */
.cm-app { min-height: 100vh; }

.cm-topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  height: var(--cm-topbar-h);
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--cm-border);
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  gap: 1rem;
}

.cm-topbar .sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--cm-border);
  background: #fff;
  transition: all .2s ease;
}
.cm-topbar .sidebar-toggle:hover { border-color: var(--cm-primary); background: var(--cm-primary-soft); }
.cm-topbar .sidebar-toggle img,
.cm-topbar .sidebar-toggle svg { width: 20px; height: 20px; }

.cm-brand img { height: 36px; width: auto; }
.cm-brand .cm-brand-fallback {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -.02em;
  color: var(--cm-text);
}
.cm-brand .cm-brand-fallback span { color: var(--cm-primary); }

.cm-topbar-spacer { flex: 1; }

.cm-topbar .navbar-right__menu {
  display: flex;
  align-items: center;
  gap: .5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* dropdown (kept compatible with .dropdown-custom JS) */
.dropdown-custom { position: relative; }
.dropdown-custom .nav-item-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--cm-border);
  background: #fff;
  color: var(--cm-text-muted);
  transition: all .2s ease;
  overflow: hidden;
}
.dropdown-custom .nav-item-toggle:hover { border-color: var(--cm-primary); color: var(--cm-primary); }
.dropdown-custom .nav-item-toggle img { width: 100%; height: 100%; object-fit: cover; }
.dropdown-custom .nav-item-toggle svg { width: 18px; height: 18px; }

.dropdown-custom .dropdown-wrapper {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 280px;
  background: #fff;
  border: 1px solid var(--cm-border);
  border-radius: var(--cm-radius);
  box-shadow: var(--cm-shadow-lg);
  padding: .5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: all .18s ease;
  z-index: 1050;
}
.dropdown-custom.active .dropdown-wrapper {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.dropdown-custom .dropdown-wrapper__title {
  font-size: .8rem;
  font-weight: 700;
  padding: .5rem .75rem;
  margin: 0;
}
.dropdown-custom .dropdown-wrapper a {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .55rem .75rem;
  border-radius: 8px;
  color: var(--cm-text);
  font-size: .875rem;
}
.dropdown-custom .dropdown-wrapper a:hover { background: var(--cm-primary-soft); text-decoration: none; }

.nav-author__info {
  display: flex;
  gap: .75rem;
  align-items: center;
  padding: .75rem;
  border-bottom: 1px solid var(--cm-border);
  margin-bottom: .5rem;
}
.nav-author__info .author-img img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.nav-author__info h6 { margin: 0; font-size: .9rem; font-weight: 700; }
.nav-author__info span { font-size: .75rem; color: var(--cm-text-muted); }
.nav-author__options ul { list-style: none; margin: 0 0 .25rem; padding: 0; }
.nav-author__signout {
  display: flex !important;
  color: var(--cm-danger) !important;
  font-weight: 600 !important;
  border-top: 1px solid var(--cm-border);
  margin-top: .25rem;
  border-radius: 0 0 8px 8px !important;
}

/* ---------- body / sidebar / content ---------- */
.cm-body {
  display: flex;
  align-items: stretch;
  min-height: calc(100vh - var(--cm-topbar-h));
  overflow-x: clip;
}

/* `display: contents` dissolves the wrapper so `.sidebar` itself is the flex
   item: open = in-flow 264px column beside content; `.collapsed` slides it
   fully away and `.contents` (flex:1) takes the full width. This also
   neutralizes the legacy `position: fixed` on `.sidebar-wrapper`. */
aside.sidebar-wrapper { display: contents; }

.sidebar {
  width: var(--cm-sidebar-w);
  flex-shrink: 0;
  align-self: flex-start;
  background: linear-gradient(180deg, var(--cm-sidebar-bg) 0%, var(--cm-sidebar-bg-2) 100%);
  color: var(--cm-sidebar-text);
  min-height: calc(100vh - var(--cm-topbar-h));
  position: sticky;
  top: var(--cm-topbar-h);
  height: calc(100vh - var(--cm-topbar-h));
  overflow-y: auto;
  overflow-x: hidden;
  transition: margin .25s ease, width .25s ease;
  border-right: 1px solid rgba(255, 255, 255, .06);
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .15); border-radius: 4px; }

/* NOTE: only `.collapsed` hides the sidebar. `.sidebar-collapse` is the
   default marker class present on load (legacy JS toggles both), so it
   must NOT hide anything or the sidebar can never be shown. */
.sidebar.collapsed {
  margin-left: calc(var(--cm-sidebar-w) * -1);
}
/* Guard: legacy `.sidebar.collapsed` sets width:76px at higher specificity —
   that would under-shift the slide-away and drag content left. */
.cm-body .sidebar.collapsed { width: var(--cm-sidebar-w); }

.sidebar__menu-group { padding: 1rem .75rem 2rem; }

.sidebar_nav { list-style: none; margin: 0; padding: 0; }

.sidebar_nav .menu-title {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: #64748b;
  padding: .5rem .75rem .75rem;
}
.sidebar_nav .menu-title span { color: inherit; }

.sidebar_nav > li { margin-bottom: 2px; }

.sidebar_nav > li > a {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .65rem .8rem;
  border-radius: 10px;
  color: var(--cm-sidebar-text);
  font-size: .875rem;
  font-weight: 500;
  text-decoration: none;
  transition: all .15s ease;
  position: relative;
}
.sidebar_nav > li > a:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }
.sidebar_nav > li > a.active {
  background: var(--cm-primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 137, 60, .45);
}
.sidebar_nav > li > a .nav-icon,
.sidebar_nav > li > a svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar_nav .menu-text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar_nav .toggle-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  position: relative;
}
.sidebar_nav .toggle-icon::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform .2s ease;
  opacity: .7;
}
.sidebar_nav li.has-child.open > a .toggle-icon::after { transform: rotate(225deg); }

.sidebar_nav li.has-child > ul {
  list-style: none;
  margin: .25rem 0 .5rem;
  padding: 0 0 0 .5rem;
  border-left: 1px solid rgba(255, 255, 255, .1);
  margin-left: 1.4rem;
}
.sidebar_nav li.has-child > ul a {
  display: flex;
  align-items: center;
  padding: .5rem .75rem;
  border-radius: 8px;
  color: #94a3b8;
  font-size: .83rem;
  text-decoration: none;
}
.sidebar_nav li.has-child > ul a:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.sidebar_nav li.has-child > ul a.active { color: #fff; background: rgba(0, 137, 60, .35); }
.sidebar_nav li.has-child ul ul { margin-left: .75rem; }

.contents {
  flex: 1;
  min-width: 0;
  padding: 1.5rem;
  transition: all .25s ease;
}
/* padding-left reset needed: legacy `.contents.expanded` sets padding-left:93px at higher specificity */
.contents.expanded { margin-left: 0; padding-left: 1.5rem; }

.overlay-dark-sidebar {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .5);
  z-index: 1020;
  opacity: 0;
  visibility: hidden;
  transition: all .25s ease;
}
/* Overlay only exists on mobile — on desktop the toggle just hides the
   sidebar and the overlay must never block content. */
@media (max-width: 991px) {
  .overlay-dark-sidebar.show { opacity: 1; visibility: visible; }
}

/* ---------- preloader (same IDs as legacy) ---------- */
#overlayer {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, .75);
  backdrop-filter: blur(3px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}
#overlayer .loader-overlay { display: flex; }
#overlayer .atbd-spin-dots { display: flex; gap: 8px; }
#overlayer .spin-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--cm-primary);
  animation: cm-bounce 1s infinite ease-in-out;
}
#overlayer .spin-dot:nth-child(2) { animation-delay: .15s; }
#overlayer .spin-dot:nth-child(3) { animation-delay: .3s; }
#overlayer .spin-dot:nth-child(4) { animation-delay: .45s; }
@keyframes cm-bounce {
  0%, 100% { transform: translateY(0); opacity: .5; }
  50% { transform: translateY(-10px); opacity: 1; }
}

/* ---------- cards / page header ---------- */
.card {
  border: 1px solid var(--cm-border) !important;
  border-radius: var(--cm-radius) !important;
  box-shadow: var(--cm-shadow) !important;
  background: var(--cm-surface);
}
.card-header {
  background: transparent !important;
  border-bottom: 1px solid var(--cm-border) !important;
  padding: 1rem 1.25rem !important;
  font-weight: 700;
}
.card-body { padding: 1.25rem !important; }

.cm-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.cm-page-header h1,
.cm-page-header h2,
.cm-page-header .cm-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -.02em;
  margin: 0;
  color: var(--cm-text);
}
.cm-page-header .cm-subtitle { color: var(--cm-text-muted); font-size: .85rem; margin: .25rem 0 0; }
.cm-page-header .cm-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

.breadcrumb-main { margin-bottom: 1.25rem; }
.breadcrumb-main .breadcrumb-title {
  font-size: 1.35rem !important;
  font-weight: 800 !important;
  letter-spacing: -.02em;
  margin: 0;
  text-transform: none !important;
}

/* ---------- buttons ---------- */
.btn { border-radius: 9px; font-weight: 600 !important; font-size: .85rem !important; padding: .55rem 1.1rem !important; transition: all .15s ease !important; }
.btn-sm { padding: .35rem .75rem !important; font-size: .78rem !important; }
.btn-primary { background: var(--cm-primary) !important; border-color: var(--cm-primary) !important; }
.btn-primary:hover { background: var(--cm-primary-dark) !important; border-color: var(--cm-primary-dark) !important; box-shadow: 0 4px 12px rgba(0, 137, 60, .35); }
.btn-secondary { background: #f1f5f9 !important; border-color: var(--cm-border) !important; color: var(--cm-text) !important; }
.btn-secondary:hover { background: #e2e8f0 !important; }
.btn-danger { background: var(--cm-danger) !important; border-color: var(--cm-danger) !important; }
.btn-light { background: #f8fafc !important; border-color: var(--cm-border) !important; color: var(--cm-text) !important; }
.btn-default.btn-squared { border-radius: 9px !important; }

/* ---------- forms ---------- */
.form-group, .custom-form-group { margin-bottom: 1rem; }
.form-group label, .custom-form-group label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--cm-text);
  margin-bottom: .4rem;
  display: inline-block;
}
label.required::after, label.mandatory::after { content: " *"; color: var(--cm-danger); }

.form-control {
  border: 1px solid var(--cm-border-strong) !important;
  border-radius: 9px;
  padding: .6rem .85rem !important;
  font-size: .875rem !important;
  color: var(--cm-text) !important;
  background: #fff !important;
  transition: border-color .15s ease, box-shadow .15s ease !important;
}
.form-control:focus {
  border-color: var(--cm-primary) !important;
  box-shadow: 0 0 0 3px rgba(0, 137, 60, .15) !important;
  outline: none !important;
}
.form-control-lg { font-size: .95rem !important; padding: .7rem 1rem !important; }

select.form-control.select2 + .select2-container,
.select2-container { width: 100% !important; }
.select2-container .select2-selection--single,
.select2-container .select2-selection--multiple {
  border: 1px solid var(--cm-border-strong) !important;
  border-radius: 9px !important;
  min-height: 42px !important;
  padding: .3rem .5rem !important;
}
.select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 32px !important; }

textarea.form-control { min-height: 110px; resize: vertical; }

.form-check, .checkbox-theme-default, .custom-checkbox { display: flex; align-items: center; gap: .5rem; }
.checkbox-container .custom-checkbox, .radio-container .custom-checkbox { margin-bottom: .4rem; }

/* yes/no switch (legacy .switch.switch-component hooks kept) */
.switch.switch-component { width: 64px !important; height: 32px !important; }
.switch.switch-component .slider { background-color: #cbd5e1 !important; border-radius: 999px !important; }
.switch.switch-component .slider:before { height: 24px !important; width: 24px !important; }
.switch.switch-component input:checked + .slider { background-color: var(--cm-success) !important; }
.switch.switch-component input:checked + .slider:before { transform: translateX(32px) !important; }
.switch.switch-component .slider:after { font-size: 9px !important; font-weight: 700; }

/* tabs (legacy autocrud-tabs / atbd-tab compat) */
.autocrud-tabs, .atbd-tab { margin-bottom: 1rem; }
.autocrud-tabs .nav-tabs, .atbd-tab .nav-tabs { border-bottom: 2px solid var(--cm-border); gap: .25rem; }
.autocrud-tabs .nav-link, .atbd-tab .nav-link {
  border: none !important;
  border-radius: 9px 9px 0 0 !important;
  color: var(--cm-text-muted) !important;
  font-weight: 600;
  font-size: .82rem;
  padding: .65rem 1.1rem !important;
}
.autocrud-tabs .nav-link.active, .atbd-tab .nav-link.active {
  color: var(--cm-primary) !important;
  background: var(--cm-primary-soft) !important;
  box-shadow: inset 0 -2px 0 var(--cm-primary);
}

/* input groups */
.input-group-text { background: #f8fafc !important; border-color: var(--cm-border-strong) !important; font-size: .8rem !important; color: var(--cm-text-muted) !important; }
.input-group .btn {height: 42px; line-height: 42px; padding-top: 0!important; padding-bottom: 0!important;}

/* ---------- tables / datatables ---------- */
.datatable-holder { border-radius: var(--cm-radius); overflow: hidden; background: #fff; }
.datatable-holder .table { margin-bottom: 0 !important; }

table.dataTable, .table {
  width: 100% !important;
  font-size: .85rem;
  color: var(--cm-text);
}
table.dataTable thead th, .table thead th {
  background: #f8fafc !important;
  color: var(--cm-text-muted) !important;
  font-size: .72rem !important;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 700 !important;
  border-bottom: 1px solid var(--cm-border) !important;
  padding: .8rem 1rem !important;
  white-space: nowrap;
}
table.dataTable tbody td, .table tbody td { padding: .8rem 1rem !important; border-top: 1px solid #f1f5f9 !important; vertical-align: middle !important; }
table.dataTable tbody tr:hover td, .table tbody tr:hover td { background: #f8fafc !important; }

.dataTables_wrapper .dataTables_filter input {
  border: 1px solid var(--cm-border-strong) !important;
  border-radius: 9px !important;
  padding: .45rem .8rem !important;
  margin-left: .5rem;
}
.dataTables_wrapper .dataTables_length select {
  border: 1px solid var(--cm-border-strong) !important;
  border-radius: 8px !important;
  padding: .3rem .5rem !important;
}
.dataTables_wrapper .dataTables_info { color: var(--cm-text-muted) !important; font-size: .8rem !important; padding-top: 1rem !important; }
.dataTables_wrapper .dataTables_paginate { padding-top: 1rem !important; }
.dataTables_wrapper .dataTables_paginate a.paginate_button {
  border: 1px solid var(--cm-border) !important;
  border-radius: 8px !important;
  padding: .35rem .7rem !important;
  margin-left: .3rem !important;
  color: var(--cm-text) !important;
  background: #fff !important;
  font-size: .8rem;
}
.dataTables_wrapper .dataTables_paginate a.paginate_button.current {
  background: var(--cm-primary) !important;
  border-color: var(--cm-primary) !important;
  color: #fff !important;
  width: auto !important;
  border-radius: 8px !important;
}
.dataTables_wrapper .dataTables_paginate a.paginate_button.disabled { opacity: .4 !important; }

.batchbox {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--cm-radius-sm);
  padding: .75rem 1rem;
  margin-bottom: 1rem;
}
.batchbox hr { display: none; }

/* privilege table */
.table-privilege td { vertical-align: middle !important; }
.priviledge-check label {
  background: #f1f5f9 !important;
  border: 1px solid var(--cm-border);
  padding: .3rem .6rem !important;
  border-radius: 8px !important;
  font-size: .78rem;
  cursor: pointer;
  display: inline-flex;
  gap: .4rem;
  align-items: center;
}
.priviledge-check.active label { background: var(--cm-primary) !important; border-color: var(--cm-primary) !important; color: #fff !important; }

/* ---------- image upload: thumbnail format ---------- */
.image-thumb-box { display: flex; flex-direction: column; align-items: flex-start; gap: .5rem; }
.custom-input[data-plugin="image"] .image-preview {
    width: 160px;
    height: 120px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--cm-border-strong);
    background: #f8fafc;
    transition: border-color .15s ease;
}
.custom-input[data-plugin="image"] .image-preview img { width: 100%; height: 100%; object-fit: cover; }
/* empty state: dashed dropzone look, dimmed placeholder icon */
.custom-input[data-plugin="image"]:not([has-image]) .image-preview { border-style: dashed; }
.custom-input[data-plugin="image"]:not([has-image]) .image-preview img { object-fit: contain; padding: 1.4rem; opacity: .4; }
.custom-input[data-plugin="image"] .image-preview:hover { border-color: var(--cm-primary); }
/* round × remove button, top-right of the thumbnail */
.image-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 26px;
    height: 26px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(15, 23, 42, .65);
    color: #fff;
    font-size: 16px;
    line-height: 1;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .15s ease;
}
.image-remove:hover { background: var(--cm-danger); }
.image-upload-trigger svg { width: 14px; height: 14px; margin-right: .25rem; }
.image-hint { font-size: .75rem; }

.custom-input[data-plugin="file"] .file-preview { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }

/* ---------- modals ---------- */
.modal-content { border: none !important; border-radius: 16px !important; box-shadow: var(--cm-shadow-lg) !important; }
.modal-header { border-bottom: 1px solid var(--cm-border) !important; padding: 1rem 1.25rem !important; }
.modal-header h5, .modal-header .modal-title { font-weight: 700; font-size: 1rem; margin: 0; }
.modal-body { padding: 1.25rem !important; }
.modal-footer { border-top: 1px solid var(--cm-border) !important; }

/* ---------- footer ---------- */
.footer-wrapper {
  border-top: 1px solid var(--cm-border);
  background: #fff;
  padding: 1rem 1.5rem;
  margin: 1.5rem -1.5rem -1.5rem;
  color: var(--cm-text-muted);
  font-size: .8rem;
}
.footer-wrapper p { margin: 0; }
.footer-menu ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 1rem; justify-content: flex-end; }

/* ---------- auth ---------- */
.cm-auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.cm-auth-card {
  width: 100%;
  max-width: 460px;
  background: #fff;
  border: 1px solid var(--cm-border);
  border-radius: 20px;
  box-shadow: var(--cm-shadow-lg);
  overflow: hidden;
}
.cm-auth-card .cm-auth-body { padding: 2rem; }
.cm-auth-logo { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.5rem; }
.cm-auth-logo img { height: 44px; }
.cm-auth-card h1 { font-size: 1.4rem; font-weight: 800; letter-spacing: -.02em; margin: 0 0 .25rem; }
.cm-auth-card .cm-auth-sub { color: var(--cm-text-muted); font-size: .875rem; margin-bottom: 1.5rem; }
.cm-auth-card .btn-primary { width: 100%; padding: .7rem !important; font-size: .9rem !important; }

/* ---------- header extras: notifications, language, mobile search ---------- */
.nav-notification__single { padding: .5rem .75rem; border-radius: 8px; gap: .6rem; }
.nav-notification__single:hover { background: var(--cm-primary-soft); }
.nav-notification__type {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--cm-primary-soft); color: var(--cm-primary);
}
.nav-notification__type svg { width: 16px; height: 16px; }
.time-posted { font-size: .72rem; }
.dropdown-custom .dropdown-wrapper--small { min-width: 190px; }
.dropdown-custom .dropdown-wrapper__more {
  justify-content: center; font-weight: 600; color: var(--cm-primary) !important;
  border-top: 1px solid var(--cm-border); margin-top: .25rem;
}
.lang-dropdown .nav-item-toggle {width: 25px; height: 25px;}
.navbar-right__mobileAction { display: flex; align-items: center; gap: .5rem; }
.btn-search, .btn-author-action {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--cm-border); color: var(--cm-text-muted); background: #fff;
}
.mobile-search, .mobile-author-actions { display: none; }
.mobile-search.show {
  display: block; padding: .75rem 1rem; background: #fff;
  border-bottom: 1px solid var(--cm-border);
}
.mobile-search .search-form { display: flex; align-items: center; gap: .5rem; }

/* ---------- setting tabs ---------- */
.ps-tab .nav-link {
  border-radius: 9px !important;
  color: var(--cm-text-muted) !important;
  font-weight: 600;
  font-size: .83rem;
  padding: .6rem .9rem !important;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.ps-tab .nav-link.active { background: var(--cm-primary-soft) !important; color: var(--cm-primary) !important; }
.ps-tab .nav-link svg { width: 15px; height: 15px; }

/* ---------- alerts / toastr tweaks ---------- */
.alert { border-radius: 10px !important; font-size: .85rem; }
#toast-container > div { border-radius: 12px !important; box-shadow: var(--cm-shadow-lg) !important; font-family: var(--cm-font) !important; }

/* ---------- dashboard ---------- */
.cm-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.cm-stat-card { padding: 1.25rem; display: flex; gap: 1rem; align-items: center; }
.cm-stat-icon {
  width: 48px; height: 48px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--cm-primary-soft); color: var(--cm-primary);
  flex-shrink: 0;
}
.cm-stat-icon svg { width: 22px; height: 22px; }
.cm-stat-card .cm-stat-value { font-size: 1.4rem; font-weight: 800; margin: 0; }
.cm-stat-card .cm-stat-label { color: var(--cm-text-muted); font-size: .78rem; margin: 0; }

/* ---------- responsive ---------- */
@media (max-width: 991px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: var(--cm-topbar-h);
    z-index: 1040;
    box-shadow: var(--cm-shadow-lg);
  }
  .sidebar.collapsed { margin-left: calc(var(--cm-sidebar-w) * -1); }
  .contents { padding: 1rem; }
  .contents.expanded { padding-left: 1rem; }
}

@media (max-width: 767px) {
  .datatable-holder { overflow-x: auto !important; }
  .cm-page-header h1, .cm-page-header h2 { font-size: 1.15rem; }
  .cm-topbar { padding: 0 .75rem; }
  .hide-on-mobile { display: none !important; }
}

/* ============================================================
   Legacy style.css overrides — same selectors as the old theme
   (equal specificity + later file = modern theme wins).
   Without these, old rules for sidebar links, submenu and
   `.contents.expanded` padding would bleed through.
   ============================================================ */
.sidebar__menu-group ul.sidebar_nav { margin: 0; }
.sidebar__menu-group ul.sidebar_nav li.menu-title span { color: #8ea0c2; padding: .5rem .75rem; margin-bottom: .25rem; }
.sidebar__menu-group ul.sidebar_nav li > a { color: var(--cm-sidebar-text); padding: .65rem .8rem; border-radius: 10px; font-weight: 500; }
.sidebar__menu-group ul.sidebar_nav li > a:hover { color: #fff; }
.sidebar__menu-group ul.sidebar_nav li > a.active { color: #fff; }
.sidebar__menu-group ul.sidebar_nav li > a .nav-icon { color: inherit; margin-right: 0; width: 18px; }
.sidebar__menu-group ul.sidebar_nav li > a .toggle-icon { margin-left: 0; }
.sidebar__menu-group ul.sidebar_nav li > a .toggle-icon:before { display: none; }
.sidebar__menu-group ul.sidebar_nav li ul { padding: 0 0 0 .5rem; }
.sidebar__menu-group ul.sidebar_nav li ul li > a:hover,
.sidebar__menu-group ul.sidebar_nav li ul li > a.active { background-color: rgba(255, 255, 255, .07); }
