/*
Theme Name: Prime Global BD Management Portal
Theme URI: https://example.com/
Author: Prime Global BD
Author URI: https://example.com/
Description: Prime Global BD educational agency, visa consultancy, HR and Umrah management portal (standalone JS app packaged as a WordPress theme).
Version: 1.0
Requires at least: 5.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: prime-global
*/

:root {
  --primary: #4361ee;
  --primary-dark: #3451d1;
  --primary-light: #eef2ff;
  --success: #28a745;
  --warning: #ffc107;
  --danger: #dc3545;
  --info: #0dcaf0;
  --orange: #fd7e14;
  --purple: #6f42c1;
  --bg: #f2f2f7;
  --card: #fff;
  --border: #e9ecef;
  --text: #212529;
  --text-secondary: #6c757d;
  --text-muted: #adb5bd;
  --umrah: #1e0a4c;
  --sidebar-width: 240px;
  --sidebar-collapsed: 64px;
  --shadow: 0 4px 24px rgba(0,0,0,.08);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.app-shell { display: flex; min-height: 100vh; background: var(--bg); }
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: #fff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  transition: width .2s ease, transform .2s ease;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 50;
}
.sidebar.collapsed { width: var(--sidebar-collapsed); }
.brand {
  min-height: 61px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-logo {
  width: 34px; height: 34px; border-radius: 8px; flex: 0 0 auto;
  display: grid; place-items: center; color: #fff; background: var(--primary);
  font-weight: 900; font-size: 16px;
}
.brand-copy { min-width: 0; line-height: 1.15; }
.brand-name { font-size: 14px; font-weight: 800; white-space: nowrap; }
.brand-subtitle { margin-top: 3px; font-size: 10px; color: var(--text-muted); white-space: nowrap; }
.sidebar.collapsed .brand-copy,
.sidebar.collapsed .nav-group-label,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .profile-copy,
.sidebar.collapsed .signout-label,
.sidebar.collapsed .reset-label { display: none; }
.sidebar-toggle {
  margin-left: auto; width: 26px; height: 26px; border: 1px solid var(--border);
  background: #fff; border-radius: 5px; color: var(--text-secondary); display: grid; place-items: center;
}
.sidebar-nav { flex: 1; overflow: auto; padding: 7px 0; }
.nav-group-label { padding: 10px 20px 4px; color: var(--text-muted); font-size: 10px; font-weight: 700; letter-spacing: 1px; }
.nav-item {
  width: 100%; border: 0; border-left: 3px solid transparent; background: transparent;
  padding: 9px 20px; display: flex; align-items: center; gap: 9px; color: var(--text-secondary);
  text-align: left; font-size: 13px; transition: background .12s ease, color .12s ease;
}
.nav-item:hover { background: #f8f9fa; color: var(--text); }
.nav-item.active { background: var(--primary-light); color: var(--primary); border-left-color: var(--primary); font-weight: 700; }
.nav-icon { width: 18px; text-align: center; flex: 0 0 auto; }
.nav-item.umrah-link { color: var(--purple); font-weight: 600; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 10px 8px; }
.sidebar-footer { border-top: 1px solid var(--border); padding: 10px 12px; }
.profile { display: flex; align-items: center; gap: 8px; padding: 5px 5px 10px; }
.profile-copy { min-width: 0; flex: 1; }
.profile-name { font-size: 12px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-role { font-size: 10px; color: var(--text-muted); text-transform: capitalize; }
.sidebar-footer-actions { display: grid; gap: 6px; }
.sidebar-footer button {
  width: 100%; padding: 7px 9px; border: 1px solid var(--border); border-radius: 6px;
  color: var(--text-secondary); background: #f8f9fa; display: flex; align-items: center; gap: 7px; justify-content: flex-start;
  font-size: 12px;
}
.sidebar.collapsed .sidebar-footer button { justify-content: center; }

.content-shell { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.topbar {
  min-height: 57px; padding: 11px 24px; background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; top: 0; z-index: 40;
}
.topbar-left { min-width: 0; display: flex; align-items: center; gap: 10px; }
.mobile-menu { display: none; border: 1px solid var(--border); border-radius: 6px; background: #fff; width: 34px; height: 34px; }
.page-title { margin: 0; font-size: 16px; font-weight: 700; }
.breadcrumb { margin-top: 2px; font-size: 11px; color: var(--text-muted); }
.topbar-date { font-size: 12px; color: var(--text-secondary); white-space: nowrap; }
.main-content { flex: 1; min-width: 0; overflow: auto; }
.page { padding: 20px; }

.card { background: #fff; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.card + .card { margin-top: 16px; }
.card-header {
  min-height: 61px; padding: 14px 19px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card-heading { display: flex; align-items: center; gap: 10px; min-width: 0; }
.card-icon { width: 32px; height: 32px; border-radius: 6px; display: grid; place-items: center; flex: 0 0 auto; }
.card-title { margin: 0; font-size: 14px; font-weight: 700; }
.card-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.row-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; min-width: 190px; }
.form-note { margin: -2px 0 14px; padding: 9px 11px; border-radius: 6px; background: var(--primary-light); color: var(--text-secondary); font-size: 11px; }
.card-body { padding: 16px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 16px; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 16px 19px; display: flex; align-items: center; gap: 14px; min-width: 0; }
.stat-icon { width: 52px; height: 52px; border-radius: 10px; display: grid; place-items: center; font-size: 24px; flex: 0 0 auto; }
.stat-copy { min-width: 0; }
.stat-value { font-size: 22px; line-height: 1.05; font-weight: 800; letter-spacing: -.5px; overflow-wrap: anywhere; }
.stat-label { color: var(--text-secondary); font-size: 13px; margin-top: 3px; }
.stat-sub { font-size: 11px; font-weight: 600; margin-top: 2px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(280px,1fr); gap: 16px; margin-bottom: 16px; }
.stack { display: flex; flex-direction: column; gap: 14px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead tr { background: #f8f9fa; border-bottom: 2px solid var(--border); }
th { text-align: left; padding: 10px 15px; color: var(--text-secondary); font-weight: 600; font-size: 12px; white-space: nowrap; }
td { padding: 11px 15px; vertical-align: middle; border-bottom: 1px solid var(--border); }
tbody tr:hover { background: #fafbfc; }
tbody tr:last-child td { border-bottom: 0; }
.muted { color: var(--text-muted); }
.secondary { color: var(--text-secondary); }
.small { font-size: 12px; }
.xsmall { font-size: 11px; }
.bold { font-weight: 700; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-primary { color: var(--primary); }

.badge, .tag { display: inline-block; border-radius: 4px; padding: 3px 9px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.avatar { border-radius: 50%; color: #fff; display: grid; place-items: center; font-weight: 700; flex: 0 0 auto; }
.person-cell { display: flex; align-items: center; gap: 8px; min-width: 165px; }
.person-name { font-weight: 600; font-size: 13px; }
.person-meta { color: var(--text-muted); font-size: 11px; margin-top: 2px; }
.progress { height: 5px; border-radius: 999px; background: #e9ecef; overflow: hidden; min-width: 72px; }
.progress > span { display: block; height: 100%; border-radius: inherit; }
.progress-label { margin-top: 3px; color: var(--text-muted); font-size: 11px; }

.btn {
  border-radius: 6px; border: 1px solid transparent; padding: 8px 17px; font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px; white-space: nowrap;
}
.btn:hover { filter: brightness(.98); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-sm { padding: 4px 10px; font-size: 11px; border-radius: 4px; }
.btn-soft { color: var(--primary); background: var(--primary-light); border-color: rgba(67,97,238,.2); }
.btn-success { color: var(--success); background: #e8f5e9; border-color: rgba(40,167,69,.2); }
.btn-danger { color: var(--danger); background: #ffebee; border-color: rgba(220,53,69,.2); }
.btn-muted { color: var(--text-secondary); background: #f8f9fa; border-color: var(--border); }
.btn-purple { color: var(--purple); background: #f3f0ff; border-color: rgba(111,66,193,.2); }
.filter-btn { padding: 5px 12px; border: 1px solid var(--border); border-radius: 4px; background: #fff; color: var(--text-secondary); font-size: 12px; }
.filter-btn.active { border-color: var(--primary); background: var(--primary-light); color: var(--primary); font-weight: 700; }

.toolbar { padding: 12px 15px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search-input { flex: 1 1 240px; }
.form-control {
  width: 100%; min-height: 36px; padding: 8px 11px; border: 1px solid var(--border); border-radius: 6px;
  background: #fff; color: var(--text); outline: 0;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(67,97,238,.08); }
.form-group { margin-bottom: 14px; }
.form-label { display: block; margin-bottom: 5px; color: var(--text-secondary); font-size: 12px; font-weight: 600; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); column-gap: 16px; }
.checkbox-row { display: flex; gap: 8px; align-items: center; color: var(--text-secondary); font-size: 13px; margin-bottom: 14px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 7px; }
.empty-state { padding: 40px 20px; text-align: center; color: var(--text-muted); }

.modal-backdrop { position: fixed; inset: 0; z-index: 2000; background: rgba(0,0,0,.46); display: grid; place-items: center; padding: 16px; }
.modal { width: min(540px,100%); max-height: 90vh; overflow: auto; background: #fff; border-radius: 10px; box-shadow: 0 10px 40px rgba(0,0,0,.15); }
.modal.modal-wide { width: min(620px,100%); }
.modal-header { padding: 15px 19px; border-bottom: 1px solid var(--border); background: #f8f9fa; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-title { margin: 0; font-size: 15px; }
.modal-close { border: 0; background: transparent; color: var(--text-secondary); font-size: 22px; line-height: 1; }
.modal-body { padding: 20px; }

.list-row { display: flex; align-items: center; gap: 10px; padding: 9px 15px; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: 0; }
.list-main { flex: 1; min-width: 0; }
.pipeline-grid { padding: 16px; display: grid; grid-template-columns: repeat(7,minmax(110px,1fr)); gap: 10px; }
.pipeline-card { border-radius: 6px; padding: 12px 14px; border: 1px solid transparent; }
.pipeline-count { font-size: 22px; line-height: 1; font-weight: 800; }
.pipeline-label { margin-top: 4px; font-size: 11px; font-weight: 600; }

.case-grid { padding: 16px; display: grid; gap: 14px; }
.case-card { padding: 16px; border: 1px solid var(--border); border-radius: 8px; background: #fafafa; }
.case-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 15px; }
.case-person { display: flex; gap: 12px; align-items: center; }
.meta-tags { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.steps { display: flex; align-items: flex-start; overflow-x: auto; padding-bottom: 4px; }
.step { display: flex; align-items: center; flex: 1 0 120px; }
.step-content { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.step-dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.step-label { max-width: 80px; font-size: 10px; }
.step-line { flex: 1; height: 2px; background: #e9ecef; margin: 13px 5px 0; }
.note { margin-top: 10px; padding: 7px 10px; border-left: 3px solid var(--primary); border-radius: 4px; background: #f8f9fa; color: var(--text-secondary); font-size: 12px; }

.onboarding-list { padding: 16px; display: grid; gap: 12px; }
.onboarding-card { padding: 16px; border: 1px solid var(--border); border-radius: 8px; background: #fafafa; }
.onboarding-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.step-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.step-toggle { border: 1px solid var(--border); background: #fff; color: var(--text-secondary); border-radius: 4px; padding: 5px 11px; font-size: 11px; font-weight: 600; }
.step-toggle.done { border-color: var(--success); color: var(--success); background: #e8f5e9; }

.package-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.package-card { background: #fff; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.package-header { background: var(--umrah); color: #fff; padding: 14px 16px; display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.package-price { color: #c4b5fd; font-size: 18px; font-weight: 800; }
.package-body { padding: 14px; }
.package-row { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; }

.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--bg); }
.login-wrap { width: min(400px,100%); }
.login-card { overflow: hidden; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); }
.login-hero { padding: 28px 28px 20px; text-align: center; background: var(--primary); color: #fff; }
.login-hero.umrah { background: var(--umrah); }
.login-logo { width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 12px; background: rgba(255,255,255,.15); display: grid; place-items: center; font-size: 24px; font-weight: 900; }
.login-name { font-size: 20px; font-weight: 800; }
.login-subtitle { margin-top: 4px; color: rgba(255,255,255,.7); font-size: 12px; }
.login-body { padding: 24px; }
.login-heading { font-size: 15px; font-weight: 700; margin-bottom: 16px; }
.alert { padding: 9px 12px; border-radius: 6px; margin-bottom: 14px; font-size: 13px; }
.alert-danger { color: var(--danger); background: #ffebee; border: 1px solid rgba(220,53,69,.2); }
.credentials { white-space: pre-line; margin-top: 16px; padding: 12px; border-left: 3px solid var(--border); border-radius: 6px; background: #f8f9fa; color: var(--text-muted); font-size: 11px; line-height: 1.8; }
.login-switch { margin-top: 12px; text-align: center; }
.login-switch button { border: 0; background: transparent; color: var(--primary); font-size: 12px; text-decoration: underline; }

.umrah-shell { display: flex; min-height: 100vh; background: var(--bg); }
.umrah-sidebar { width: 220px; min-height: 100vh; height: 100vh; position: sticky; top: 0; background: var(--umrah); display: flex; flex-direction: column; flex: 0 0 auto; }
.umrah-brand { padding: 14px 20px; border-bottom: 1px solid rgba(255,255,255,.08); }
.umrah-brand-name { color: #fff; font-size: 14px; font-weight: 800; }
.umrah-brand-sub { margin-top: 2px; color: rgba(255,255,255,.35); font-size: 10px; }
.umrah-nav { flex: 1; padding: 8px 0; }
.umrah-nav button { width: 100%; padding: 9px 20px; display: flex; align-items: center; gap: 9px; border: 0; border-left: 3px solid transparent; background: transparent; color: rgba(255,255,255,.48); text-align: left; font-size: 13px; }
.umrah-nav button.active { background: rgba(167,139,250,.2); color: #c4b5fd; border-left-color: #a78bfa; font-weight: 700; }
.umrah-footer { padding: 10px 12px; border-top: 1px solid rgba(255,255,255,.08); }
.umrah-footer button { width: 100%; padding: 8px 10px; border-radius: 6px; border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.06); color: rgba(255,255,255,.5); text-align: left; }
.umrah-content { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.umrah-topbar { min-height: 57px; background: #fff; border-bottom: 1px solid var(--border); padding: 11px 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; top: 0; z-index: 40; }
.umrah-topbar h1 { margin: 0; color: var(--umrah); font-size: 16px; }

.toast-region { position: fixed; right: 18px; bottom: 18px; z-index: 3000; display: grid; gap: 8px; pointer-events: none; }
.toast { min-width: 220px; max-width: 360px; padding: 11px 14px; border-radius: 7px; background: #212529; color: #fff; box-shadow: var(--shadow); animation: toast-in .18s ease; font-size: 13px; }
.toast.success { background: #1f7a34; }
.toast.error { background: #a61e2b; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.mobile-overlay { display: none; }

@media (max-width: 1120px) {
  .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .pipeline-grid { grid-template-columns: repeat(4,minmax(110px,1fr)); }
  .package-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 820px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); width: min(280px,86vw); }
  .sidebar.mobile-open { transform: translateX(0); }
  .sidebar.collapsed { width: min(280px,86vw); }
  .sidebar.collapsed .brand-copy,
  .sidebar.collapsed .nav-group-label,
  .sidebar.collapsed .nav-label,
  .sidebar.collapsed .profile-copy,
  .sidebar.collapsed .signout-label,
  .sidebar.collapsed .reset-label { display: block; }
  .sidebar.collapsed .nav-item { justify-content: flex-start; padding: 9px 20px; }
  .sidebar-toggle { display: none; }
  .mobile-menu { display: grid; place-items: center; }
  .mobile-overlay { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(0,0,0,.35); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .umrah-sidebar { width: 68px; }
  .umrah-brand-sub, .umrah-brand-name span, .umrah-nav .label, .umrah-footer .label { display: none; }
  .umrah-brand { padding: 16px 10px; text-align: center; }
  .umrah-nav button { justify-content: center; padding: 11px 8px; }
  .umrah-footer button { text-align: center; }
}
@media (max-width: 620px) {
  .page { padding: 12px; }
  .topbar, .umrah-topbar { padding: 10px 12px; }
  .topbar-date { display: none; }
  .stats-grid { grid-template-columns: 1fr; gap: 10px; }
  .pipeline-grid { grid-template-columns: repeat(2,minmax(0,1fr)); padding: 12px; }
  .form-grid { grid-template-columns: 1fr; }
  .card-header { align-items: flex-start; flex-direction: column; }
  .card-actions { width: 100%; justify-content: flex-start; }
  .package-grid { grid-template-columns: 1fr; }
  .umrah-sidebar { width: 56px; }
  .umrah-topbar h1 { font-size: 14px; }
}
