/* =========================================================================
   PSmaax admin theme. Loaded after the vendor CSS, so it restyles every
   admin page without changing their structure.
   ========================================================================= */
:root {
  --psm-brand: #0A6FD1;
  --psm-brand-dark: #0757a6;
  --psm-brand-soft: #e8f1fc;
  --psm-ink: #111827;
  --psm-text: #374151;
  --psm-muted: #6b7280;
  --psm-line: #e5e7eb;
  --psm-bg: #f4f6fb;
  --psm-card: #ffffff;
  --psm-radius: 12px;
  --psm-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --psm-shadow-lg: 0 10px 30px rgba(16, 24, 40, .08);
  --psm-font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, Roboto, Arial, sans-serif;
}

body, .page-content, .btn, .form-control, .form-select, .table, .dropdown-menu, input, select, textarea {
  font-family: var(--psm-font) !important;
}
body { color: var(--psm-text); font-size: 14px; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { color: var(--psm-ink); font-weight: 600; }
a { color: var(--psm-brand); }
a:hover { color: var(--psm-brand-dark); }

/* ---- Page background & content width ---- */
.page-content-wrapper { background: var(--psm-bg) !important; }
.page-content { padding: 1.5rem 1.75rem 2.5rem !important; }

/* ---- Top header ---- */
.clx-navigation-type-top .page-header {
  background: linear-gradient(90deg, #0b2b55 0%, var(--psm-brand) 100%) !important;
  box-shadow: 0 2px 10px rgba(10, 111, 209, .18);
}
.page-header .page-logo-text { font-weight: 700; letter-spacing: .2px; }

/* ---- Top navigation bar ---- */
.clx-navigation-type-top .page-sidebar {
  background: #fff !important;
  border-bottom: 1px solid var(--psm-line);
  box-shadow: 0 1px 0 rgba(16, 24, 40, .03);
}
.clx-navigation-type-top .page-sidebar .primary-nav .nav-menu > li > a {
  color: var(--psm-text) !important;
  border-radius: 8px;
  margin: 4px 2px;
  transition: background .15s, color .15s;
}
.clx-navigation-type-top .page-sidebar .primary-nav .nav-menu > li > a > .nav-link-text { font-weight: 600 !important; }
.clx-navigation-type-top .page-sidebar .primary-nav .nav-menu > li:hover > a,
.clx-navigation-type-top .page-sidebar .primary-nav .nav-menu > li.active > a {
  color: var(--psm-brand) !important;
  background: var(--psm-brand-soft) !important;
}
.clx-navigation-type-top .page-sidebar .primary-nav .nav-menu > li > ul {
  border-radius: 0 0 12px 12px !important;
  box-shadow: var(--psm-shadow-lg) !important;
  border: 1px solid var(--psm-line);
  padding: 6px !important;
}
.clx-navigation-type-top .page-sidebar .primary-nav .nav-menu > li > ul li a {
  border-radius: 8px;
  color: var(--psm-text) !important;
  padding: 8px 12px !important;
}
.clx-navigation-type-top .page-sidebar .primary-nav .nav-menu > li > ul li a:hover {
  background: var(--psm-brand-soft) !important;
  color: var(--psm-brand) !important;
}

/* ---- Cards / panels ---- */
.panel, .card {
  border: 1px solid var(--psm-line) !important;
  border-radius: var(--psm-radius) !important;
  box-shadow: var(--psm-shadow) !important;
  background: var(--psm-card);
}
.panel-hdr {
  border-bottom: 1px solid var(--psm-line) !important;
  background: transparent !important;
  min-height: 3.25rem;
  border-radius: var(--psm-radius) var(--psm-radius) 0 0;
}
.panel-hdr h2, .card-header h2, .card-title { font-size: 15px !important; font-weight: 600 !important; color: var(--psm-ink) !important; }
.subheader-title { font-weight: 700 !important; color: var(--psm-ink) !important; }
.subheader-title small { color: var(--psm-muted) !important; font-weight: 400; }

/* ---- Buttons ---- */
.btn { border-radius: 8px !important; font-weight: 500; box-shadow: none !important; }
.btn-primary { background: var(--psm-brand) !important; border-color: var(--psm-brand) !important; }
.btn-primary:hover, .btn-primary:focus { background: var(--psm-brand-dark) !important; border-color: var(--psm-brand-dark) !important; }
.btn-outline-primary { color: var(--psm-brand) !important; border-color: #b9d3f2 !important; }
.btn-outline-primary:hover { background: var(--psm-brand-soft) !important; color: var(--psm-brand-dark) !important; }
.btn-xs, .btn-sm { border-radius: 6px !important; }

/* ---- Forms ---- */
.form-control, .form-select, .select2-container--default .select2-selection--single, .select2-container--default .select2-selection--multiple {
  border-radius: 8px !important;
  border-color: #d6dbe4 !important;
}
.form-control:focus, .form-select:focus {
  border-color: var(--psm-brand) !important;
  box-shadow: 0 0 0 3px rgba(10, 111, 209, .15) !important;
}
label, .form-label { font-weight: 500; color: var(--psm-ink); }

/* ---- Tables ---- */
.table { color: var(--psm-text); }
.table > thead th, .table thead th {
  background: #f8fafc !important;
  color: var(--psm-muted) !important;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .3px;
  border-bottom: 1px solid var(--psm-line) !important;
  border-top: 0 !important;
}
.table td, .table th { vertical-align: middle; border-color: #eef1f5 !important; }
.table-striped > tbody > tr:nth-of-type(odd) > * { background: #fbfcfe !important; --bs-table-accent-bg: transparent; }
.table-hover > tbody > tr:hover > *, .table tbody tr:hover > * { background: #f3f8fe !important; }
.table-bordered, .table-bordered td, .table-bordered th { border-color: #eef1f5 !important; }

/* DataTables */
.dataTables_wrapper .dataTables_filter input {
  border-radius: 8px !important;
  border: 1px solid #d6dbe4 !important;
  padding: 6px 12px !important;
}
.page-item .page-link { border-radius: 8px !important; margin: 0 2px; border-color: var(--psm-line); color: var(--psm-text); }
.page-item.active .page-link { background: var(--psm-brand) !important; border-color: var(--psm-brand) !important; color: #fff !important; }

/* ---- Badges ---- */
.badge { border-radius: 999px !important; font-weight: 600; padding: .38em .75em; }

/* ---- Alerts ---- */
.alert { border-radius: 10px !important; border: 1px solid transparent; }
.alert-warning { background: #fff8e6; border-color: #fde7a7; color: #7a4b00; }
.alert-info { background: #eaf4ff; border-color: #c4defa; color: #0b4a8a; }
.alert-success { background: #ecfdf3; border-color: #b7ebc9; color: #0f5b2f; }
.alert-danger { background: #fef2f2; border-color: #fbcaca; color: #8a1c1c; }

/* ---- Modals & dropdowns ---- */
.modal-content { border-radius: 14px !important; border: 0 !important; box-shadow: var(--psm-shadow-lg) !important; }
.dropdown-menu { border-radius: 10px !important; border: 1px solid var(--psm-line) !important; box-shadow: var(--psm-shadow-lg) !important; padding: 6px !important; }
.dropdown-item { border-radius: 6px; }
.dropdown-item:hover { background: var(--psm-brand-soft); color: var(--psm-brand-dark); }

/* =========================================================================
   Dashboard
   ========================================================================= */
.psm-dash .psm-h1 { font-size: 22px; font-weight: 700; color: var(--psm-ink); }
.psm-kpi {
  display: block; height: 100%;
  background: #fff; border: 1px solid var(--psm-line); border-radius: var(--psm-radius);
  box-shadow: var(--psm-shadow); padding: 16px 18px; color: var(--psm-ink) !important;
  text-decoration: none !important; transition: transform .12s, box-shadow .12s;
  border-top: 3px solid var(--psm-brand);
}
.psm-kpi:hover { transform: translateY(-2px); box-shadow: var(--psm-shadow-lg); }
.psm-kpi-danger { border-top-color: #dc2626; }
.psm-kpi-success { border-top-color: #16a34a; }
.psm-kpi-label { font-size: 12px; color: var(--psm-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.psm-kpi-label i { margin-right: 4px; }
.psm-kpi-value { font-size: 22px; font-weight: 700; margin-top: 6px; line-height: 1.25; }
.psm-kpi-value small { font-size: 13px; font-weight: 500; color: var(--psm-muted); }
.psm-kpi-sub { font-size: 12px; color: var(--psm-muted); margin-top: 4px; }

.psm-card { background: #fff; border: 1px solid var(--psm-line); border-radius: var(--psm-radius); box-shadow: var(--psm-shadow); padding: 18px; }
.psm-card-hdr { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.psm-card-hdr h2 { font-size: 15px; font-weight: 600; margin: 0; color: var(--psm-ink); display: flex; align-items: center; gap: 8px; }
.psm-link { font-size: 13px; font-weight: 600; }
.psm-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.psm-dot-red { background: #dc2626; } .psm-dot-amber { background: #f59e0b; } .psm-dot-blue { background: var(--psm-brand); } .psm-dot-purple { background: #7c3aed; }
.psm-table thead th { background: transparent !important; padding-top: 6px; padding-bottom: 6px; }
.psm-table td { padding-top: 10px; padding-bottom: 10px; }
.psm-empty { color: var(--psm-muted); padding: 28px 8px; text-align: center; }
.psm-empty i { font-size: 18px; margin-right: 6px; color: #16a34a; }

.psm-shortcuts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.psm-shortcuts a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 14px 6px; border-radius: 10px; background: #f8fafc; border: 1px solid #eef1f5;
  color: var(--psm-text) !important; text-decoration: none !important; font-size: 12px; font-weight: 600; text-align: center;
  transition: background .15s, color .15s;
}
.psm-shortcuts a i { font-size: 20px; color: var(--psm-brand); }
.psm-shortcuts a:hover { background: var(--psm-brand-soft); color: var(--psm-brand-dark) !important; }

@media (max-width: 575px) {
  .page-content { padding: 1rem .75rem 2rem !important; }
  .psm-shortcuts { grid-template-columns: repeat(2, 1fr); }
  .psm-kpi-value { font-size: 18px; }
}

/* 1.9: menu toggle button in brand colours (was pink) */
.page-header .header-btn[data-action="toggle"],
.page-header .header-btn[data-action="toggle"]:hover {
  background: rgba(255,255,255,.15) !important; background-image: none !important;
  border: 1px solid rgba(255,255,255,.35) !important; color: #fff !important; box-shadow: none !important;
}
.page-header .header-btn[data-action="toggle"] i, .page-header .header-btn[data-action="toggle"] span { color: #fff !important; }

/* 1.13: selected toggle buttons (btn-check) readable */
.btn-check:checked + .btn-outline-primary, .btn-check:checked + .btn-outline-primary:hover { background: var(--psm-brand) !important; border-color: var(--psm-brand) !important; color: #fff !important; }
.btn-check:checked + .btn-outline-primary i { color: #fff !important; }
