:root {
  --uoh: #990000;
  --uoh-dark: #700000;
  --uoh-darker: #4d0000;
  --uoh-light: #fbeaea;
  --bs-primary: #990000;
  --bs-primary-rgb: 153, 0, 0;
  --bs-link-color: #990000;
  --bs-link-color-rgb: 153, 0, 0;
  --bs-link-hover-color: #700000;
  --bs-link-hover-color-rgb: 112, 0, 0;
  --sidebar-w: 255px;
}
body { background: #f5f3f3; font-size: .925rem; color: #2b2b2b; }
.btn-primary {
  --bs-btn-bg: #990000; --bs-btn-border-color: #990000; --bs-btn-hover-bg: #7a0000; --bs-btn-hover-border-color: #700000;
  --bs-btn-active-bg: #700000; --bs-btn-active-border-color: #660000; --bs-btn-disabled-bg: #990000; --bs-btn-disabled-border-color: #990000;
}
.btn-outline-primary {
  --bs-btn-color: #990000; --bs-btn-border-color: #990000; --bs-btn-hover-bg: #990000; --bs-btn-hover-border-color: #990000;
  --bs-btn-active-bg: #700000; --bs-btn-active-border-color: #700000;
}
.text-bg-primary { background-color: #990000 !important; }
.form-control:focus, .form-select:focus { border-color: #b33; box-shadow: 0 0 0 .2rem rgba(153, 0, 0, .15); }
.form-check-input:checked { background-color: #990000; border-color: #990000; }
.page-item.active .page-link { background: #990000; border-color: #990000; }
.page-link { color: #990000; }

/* ---------- layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w); background: var(--uoh); color: #fff;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 1040;
}
.sidebar .brand { display: flex; align-items: center; gap: .6rem; padding: 1rem 1.1rem; color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255, 255, 255, .15); }
.sidebar .brand .logo { width: 38px; height: 38px; border-radius: 10px; background: #fff; color: var(--uoh); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; overflow: hidden; flex: 0 0 38px; }
.sidebar .brand .logo img { width: 100%; height: 100%; object-fit: cover; }
.sidebar .brand b { display: block; line-height: 1.15; font-size: .95rem; }
.sidebar .brand small { opacity: .75; font-size: .72rem; }
.sidebar .nav-title { padding: .9rem 1.1rem .3rem; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .55); }
.sidebar .nav-link { color: rgba(255, 255, 255, .88); padding: .5rem 1.1rem; display: flex; align-items: center; gap: .7rem; border-inline-start: 3px solid transparent; font-size: .9rem; }
.sidebar .nav-link i { width: 1.15rem; text-align: center; opacity: .9; }
.sidebar .nav-link:hover { background: rgba(255, 255, 255, .09); color: #fff; }
.sidebar .nav-link.active { background: rgba(0, 0, 0, .22); color: #fff; border-inline-start-color: #fff; font-weight: 600; }
.sidebar .nav-link .badge { margin-inline-start: auto; background: #fff; color: var(--uoh); }
.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.topbar { background: #fff; border-bottom: 1px solid #e6dede; padding: .55rem 1.25rem; display: flex; align-items: center; gap: .75rem; position: sticky; top: 0; z-index: 1030; }
.topbar h1 { font-size: 1.1rem; margin: 0; font-weight: 600; color: var(--uoh-dark); }
.content { padding: 1.25rem; flex: 1; }
.sidebar-toggle { display: none; }
@media (max-width: 991.98px) {
  .sidebar { position: fixed; inset-inline-start: 0; transform: translateX(-100%); transition: transform .2s; }
  [dir=rtl] .sidebar { transform: translateX(100%); }
  .sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .4); }
  .sidebar-toggle { display: inline-block; }
  .content { padding: .85rem; }
}

/* ---------- cards and tables ---------- */
.card { border: 1px solid #ebe3e3; border-radius: .7rem; box-shadow: 0 1px 2px rgba(60, 0, 0, .04); }
.card-header { background: #fff; border-bottom: 1px solid #f0e8e8; font-weight: 600; }
.table > :not(caption) > * > * { padding: .55rem .7rem; }
.table thead th { background: #faf5f5; color: #5a2a2a; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; border-bottom: 2px solid #ecdede; white-space: nowrap; }
.table-hover > tbody > tr:hover > * { background: #fdf6f6; }
.kpi { display: flex; align-items: center; gap: .9rem; padding: 1rem; }
.kpi .ico { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; background: var(--uoh-light); color: var(--uoh); flex: 0 0 46px; }
.kpi .val { font-size: 1.4rem; font-weight: 700; line-height: 1.1; }
.kpi .lbl { color: #777; font-size: .78rem; }
a.kpi-link { color: inherit; text-decoration: none; display: block; }
a.kpi-link:hover .card { border-color: var(--uoh); }
.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; }
.toolbar .grow { flex: 1; }
.form-label { font-weight: 500; font-size: .84rem; margin-bottom: .25rem; }
.req::after { content: " *"; color: var(--uoh); }
.help { font-size: .75rem; color: #888; }
.select-filter { margin-bottom: .25rem; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--uoh-light); color: var(--uoh); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }

/* status pipeline */
.pipeline { display: flex; flex-wrap: wrap; gap: .35rem; }
.pipeline .step { padding: .3rem .7rem; border-radius: 2rem; background: #eee; font-size: .78rem; color: #666; }
.pipeline .step.done { background: #e6f4ea; color: #1e6b34; }
.pipeline .step.now { background: var(--uoh); color: #fff; font-weight: 600; }

/* inspection */
.insp-row td { vertical-align: middle; }
.sig-pad { border: 1px dashed #b88; border-radius: .5rem; background: #fff; touch-action: none; width: 100%; height: 160px; }

/* ---------- auth / public ---------- */
.auth-bg { background: #990000; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem;
  background-image: radial-gradient(circle at 20% 20%, #b30000 0, transparent 45%), radial-gradient(circle at 80% 80%, #700000 0, transparent 45%); }
.auth-card { width: 100%; max-width: 430px; background: #fff; border-radius: 1rem; padding: 2rem; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.auth-card .logo { width: 64px; height: 64px; border-radius: 16px; background: var(--uoh); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.7rem; margin: 0 auto .8rem; overflow: hidden; }
.auth-card .logo img { width: 100%; height: 100%; object-fit: cover; }
.hero { background: #990000; color: #fff; padding: 5rem 0 4rem; background-image: radial-gradient(circle at 15% 10%, #b80000 0, transparent 40%), radial-gradient(circle at 90% 90%, #6a0000 0, transparent 45%); }
.hero h1 { font-weight: 800; font-size: 2.6rem; }
.pub-nav { background: #990000; }
.feature-ico { width: 54px; height: 54px; border-radius: 14px; background: var(--uoh-light); color: var(--uoh); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; margin-bottom: .8rem; }
.plan-card.featured { border: 2px solid var(--uoh); transform: translateY(-6px); }

/* portal */
.portal-nav { background: var(--uoh); }
.portal-nav .nav-link { color: rgba(255, 255, 255, .85); }
.portal-nav .nav-link.active, .portal-nav .nav-link:hover { color: #fff; }
.veh-card { border-inline-start: 4px solid var(--uoh); }

/* ---------- print ---------- */
.doc { background: #fff; max-width: 860px; margin: 0 auto; padding: 2rem; border: 1px solid #e5dada; border-radius: .5rem; }
.doc h2 { color: var(--uoh); }
.doc .head { border-bottom: 3px solid var(--uoh); padding-bottom: .8rem; margin-bottom: 1rem; }
@media print {
  body { background: #fff; font-size: 11pt; }
  .sidebar, .topbar, .no-print, .alert, footer { display: none !important; }
  .content { padding: 0; }
  .doc { border: 0; padding: 0; max-width: 100%; }
  .card { box-shadow: none; border: 1px solid #ccc; }
  a { color: inherit; text-decoration: none; }
}
[dir=rtl] body { font-family: 'Noto Nastaliq Urdu', 'Segoe UI', Tahoma, sans-serif; }
