/*
 * Makaan Lo — brand stylesheet (Phase 4 layouts)
 *
 * ONE file, NO build step, NO external font or CDN dependency.
 * Linked from every layout as /css/app.css. System font stacks only,
 * so the site still renders offline. The stack includes Urdu-script
 * fonts (Noto Nastaliq Urdu / Noto Naskh Arabic) so Urdu text renders
 * wherever the device has them installed.
 *
 * Brand: royal blue #1E3A8A + black + white. No Zameen green anywhere.
 */

:root {
    --brand: #1E3A8A;
    --brand-dark: #172F6E;
    --brand-light: #DBEAFE;
    --brand-soft: #EFF4FF;
    --ink: #111827;
    --ink-soft: #374151;
    --muted: #6B7280;
    --line: #E5E7EB;
    --bg: #F6F7F9;
    --card: #FFFFFF;
    --ok: #166534;
    --ok-bg: #DCFCE7;
    --err: #991B1B;
    --err-bg: #FEE2E2;
    --warn: #92400E;
    --warn-bg: #FEF3C7;
    --info: #1E3A8A;
    --info-bg: #DBEAFE;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(17, 24, 39, .08);
    --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    --font-ur: "Noto Nastaliq Urdu", "Noto Naskh Arabic", "Jameel Noori Nastaleeq", "Segoe UI", Tahoma, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--bg);
}
[lang="ur"], .ur { font-family: var(--font-ur); line-height: 1.9; }
img { max-width: 100%; height: auto; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.25; margin: 0 0 .5rem; }
p { margin: 0 0 .75rem; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- shared helpers ---------- */
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.page { max-width: 1200px; margin: 0 auto; padding: 24px 16px 48px; }
.page-title { font-size: 24px; font-weight: 800; margin-bottom: 4px; }
.page-sub { color: var(--muted); margin-bottom: 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mt { margin-top: 16px; }
.grid { display: grid; gap: 16px; }
.grid-2 { display: grid; gap: 16px; grid-template-columns: repeat(2, 1fr); }
.grid-3 { display: grid; gap: 16px; grid-template-columns: repeat(3, 1fr); }
.grid-4 { display: grid; gap: 16px; grid-template-columns: repeat(4, 1fr); }

/* ---------- buttons ---------- */
.btn {
    display: inline-block; border: 1px solid transparent; border-radius: 8px;
    padding: 9px 16px; font-weight: 700; font-size: 14px; line-height: 1.2;
    background: var(--brand); color: #fff; text-align: center; white-space: nowrap;
}
.btn:hover { background: var(--brand-dark); text-decoration: none; }
.btn-outline { background: #fff; color: var(--brand); border-color: var(--brand); }
.btn-outline:hover { background: var(--brand-soft); }
.btn-ghost { background: transparent; color: var(--ink-soft); border-color: var(--line); }
.btn-ghost:hover { background: #F3F4F6; }
.btn-sm { padding: 6px 10px; font-size: 13px; }
.btn-block { display: block; width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- forms ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 5px; }
.input, .select, .textarea {
    width: 100%; padding: 9px 12px; border: 1px solid #D1D5DB; border-radius: 8px;
    background: #fff; font-size: 14px;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); outline: 2px solid var(--brand-light); }
.form-error { color: var(--err); font-size: 13px; margin-top: 4px; }

/* ---------- website header / footer ---------- */
.site-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.site-header-inner { display: flex; align-items: center; gap: 20px; max-width: 1200px; margin: 0 auto; padding: 10px 16px; }
.site-logo img { display: block; height: 44px; width: auto; }
.site-logo .logo-fallback { font-size: 22px; font-weight: 800; color: var(--brand); }
.site-nav { display: flex; align-items: center; gap: 4px; flex: 1; flex-wrap: wrap; }
.site-nav > a, .site-nav .nav-drop-btn {
    padding: 8px 10px; border-radius: 8px; font-weight: 600; font-size: 14px;
    color: var(--ink); cursor: pointer; background: none; border: 0; font-family: inherit;
}
.site-nav > a:hover, .site-nav .nav-drop-btn:hover, .site-nav .nav-drop:hover .nav-drop-btn { background: var(--brand-soft); text-decoration: none; }
.site-nav .nav-drop { position: relative; }
.site-nav .nav-drop-btn::after { content: " ▾"; font-size: 11px; color: var(--muted); }
.site-nav .nav-menu {
    display: none; position: absolute; top: 100%; left: 0; min-width: 220px; z-index: 60;
    background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(17, 24, 39, .14);
    padding: 6px;
}
.site-nav .nav-drop:hover .nav-menu, .site-nav .nav-drop:focus-within .nav-menu { display: block; }
.site-nav .nav-menu-wide { min-width: 620px; }
.site-nav .nav-drop:hover .nav-menu-wide, .site-nav .nav-drop:focus-within .nav-menu-wide { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 12px; }
/* Tap toggle (mobile JS): mirrors the hover rules so a tap opens/closes the menu. */
.site-nav .nav-drop.nav-open > .nav-menu { display: block; }
.site-nav .nav-drop.nav-open > .nav-menu-wide { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 12px; }
/* Hamburger (mobile only — shown in the ≤820px rules below, like the demo's "☰ Menu"). */
.nav-toggle { display: none; padding: 8px 10px; border-radius: 8px; font-weight: 700; font-size: 14px; color: var(--ink); cursor: pointer; background: none; border: 1px solid var(--line); font-family: inherit; white-space: nowrap; }
.nav-toggle:hover { background: var(--brand-soft); }
.site-nav .nav-menu-wide .nav-col { min-width: 0; }
.site-nav .nav-menu h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 10px 2px; margin: 0; }
.site-nav .nav-menu a { display: block; padding: 7px 10px; border-radius: 6px; color: var(--ink); font-size: 14px; }
.site-nav .nav-menu a:hover { background: var(--brand-soft); text-decoration: none; }
.site-header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.site-footer { background: #111827; color: #D1D5DB; margin-top: 40px; }
.site-footer a { color: #D1D5DB; }
.site-footer a:hover { color: #fff; }
.site-footer-inner { max-width: 1200px; margin: 0 auto; padding: 36px 16px 20px; display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; }
.site-footer h4 { color: #fff; font-size: 14px; margin-bottom: 10px; }
.site-footer li { margin-bottom: 6px; font-size: 14px; }
.site-footer .foot-brand p { font-size: 14px; }
.site-footer-bottom { border-top: 1px solid #374151; padding: 14px 16px; text-align: center; font-size: 13px; color: #9CA3AF; }

/* ---------- hero / search ---------- */
.hero { background: var(--brand); color: #fff; padding: 44px 0 36px; }
.hero h1 { color: #fff; font-size: 28px; }
.hero p { color: #DBEAFE; }
.hero .wrap > p { max-width: 640px; }
.search-bar { background: #fff; color: var(--ink); border-radius: 12px; padding: 12px; box-shadow: 0 8px 24px rgba(17, 24, 39, .18); margin-top: 20px; }
.search-bar form { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.search-bar .input, .search-bar .select { width: 100%; }
.search-bar .btn { width: 100%; }

/* ---------- listing card ---------- */
.listing-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.listing-card-media { display: block; aspect-ratio: 16 / 10; background: #E5E7EB; overflow: hidden; }
.listing-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.listing-card-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; background: #E5E7EB; text-align: center; padding: 12px; }
.listing-card-body { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.listing-card-price { font-size: 19px; font-weight: 800; color: var(--brand); }
.listing-card-title { font-size: 15px; font-weight: 700; color: var(--ink); }
.listing-card-title a { color: var(--ink); }
.listing-card-meta { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--brand-light); color: var(--brand); }
.badge-hot { background: #FEE2E2; color: #991B1B; }
.badge-superhot { background: #FEF3C7; color: #92400E; }
.badge-verified { background: #DCFCE7; color: #166534; }

/* ---------- package card ---------- */
.package-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; display: flex; flex-direction: column; }
.package-card-featured { border: 2px solid var(--brand); }
.package-card-name { font-size: 18px; font-weight: 800; }
.package-card-price { font-size: 26px; font-weight: 800; color: var(--brand); margin: 6px 0 2px; }
.package-card-price small { font-size: 13px; font-weight: 600; color: var(--muted); }
.package-card ul { margin: 12px 0 16px; display: grid; gap: 6px; font-size: 14px; }
.package-card ul li::before { content: "✓ "; color: var(--brand); font-weight: 700; }
.package-card .btn { margin-top: auto; }

/* ---------- pagination ---------- */
.pagination { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 20px 0; }
.pagination a, .pagination span { display: inline-block; min-width: 36px; text-align: center; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font-size: 14px; font-weight: 600; }
.pagination a:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.pagination .current { background: var(--brand); border-color: var(--brand); color: #fff; }
.pagination .disabled { color: var(--muted); background: #F9FAFB; }
.pagination .gap { border: 0; background: transparent; }
.pagination-info { font-size: 13px; color: var(--muted); margin-bottom: 4px; }

/* ---------- alerts / empty state ---------- */
.alert { border-radius: 8px; padding: 12px 14px; margin-bottom: 16px; font-size: 14px; border: 1px solid transparent; }
.alert-success { background: var(--ok-bg); color: var(--ok); border-color: #86EFAC; }
.alert-error { background: var(--err-bg); color: var(--err); border-color: #FCA5A5; }
.alert-warning { background: var(--warn-bg); color: var(--warn); border-color: #FCD34D; }
.alert-info { background: var(--info-bg); color: var(--info); border-color: #93C5FD; }
.empty-state { text-align: center; padding: 48px 20px; background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); }
.empty-state h3 { color: var(--ink-soft); }
.empty-state .btn { margin-top: 12px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.table th { background: #F9FAFB; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.table tr:last-child td { border-bottom: 0; }

/* ---------- KPI cards (portal dashboard) ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.kpi-label { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
.kpi-value { font-size: 26px; font-weight: 800; color: var(--ink); margin-top: 4px; }
.kpi-sub { font-size: 13px; color: var(--muted); }

/* ---------- portal shell (CRMS dashboard, full-window) ---------- */
.portal-shell { display: flex; min-height: 100vh; background: var(--bg); }
.portal-sidebar { width: 248px; flex: 0 0 248px; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.portal-brand { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.portal-brand img { height: 36px; width: auto; }
.portal-brand b { font-size: 17px; color: var(--brand); }
.portal-brand small { display: block; font-size: 10px; letter-spacing: .12em; color: var(--muted); font-weight: 700; }
.portal-collapse { margin-left: auto; border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 2px 8px; font-size: 14px; color: var(--muted); }
.portal-nav { flex: 1; padding: 10px 10px 16px; overflow-y: auto; }
.portal-nav h5 { font-size: 11px; letter-spacing: .08em; color: var(--muted); margin: 16px 8px 6px; }
.portal-nav h5:first-child { margin-top: 4px; }
.portal-nav a { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; color: var(--ink-soft); font-size: 14px; }
.portal-nav a:hover { background: var(--brand-soft); color: var(--brand); text-decoration: none; }
.portal-nav a.active { background: var(--brand); color: #fff; font-weight: 700; }
.portal-nav .nav-group summary { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; color: var(--ink-soft); font-size: 14px; cursor: pointer; list-style: none; }
.portal-nav .nav-group summary::-webkit-details-marker { display: none; }
.portal-nav .nav-group summary:hover { background: var(--brand-soft); color: var(--brand); }
.portal-nav .nav-group summary::after { content: "›"; margin-left: auto; color: var(--muted); }
.portal-nav .nav-group[open ] summary::after { transform: rotate(90deg); }
.portal-nav .nav-sub { padding-left: 14px; }
.portal-nav .nav-sub a { font-size: 13px; padding: 5px 10px; }
.portal-sidefoot { border-top: 1px solid var(--line); padding: 12px 16px; display: flex; align-items: center; gap: 10px; font-size: 13px; }
.portal-sidefoot b { display: block; font-size: 13px; }
.portal-sidefoot span { color: var(--muted); font-size: 12px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; flex: 0 0 36px; }
.portal-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.portal-topbar { display: flex; align-items: center; gap: 10px; background: #fff; border-bottom: 1px solid var(--line); padding: 10px 20px; position: sticky; top: 0; z-index: 40; flex-wrap: wrap; }
.portal-search { flex: 1 1 220px; max-width: 420px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: #F9FAFB; }
.portal-search input { border: 0; background: transparent; padding: 8px 0; width: 100%; }
.portal-search input:focus { outline: none; }
.portal-topbar .tbtn { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 8px 12px; font-size: 13px; font-weight: 700; color: var(--ink-soft); white-space: nowrap; }
.portal-topbar .tbtn:hover { border-color: var(--brand); color: var(--brand); }
.portal-topbar .tbtn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.portal-topbar .tbtn-primary:hover { background: var(--brand-dark); color: #fff; }
.portal-user { position: relative; margin-left: auto; }
.portal-user > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.portal-user > summary::-webkit-details-marker { display: none; }
.portal-user-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 200px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(17, 24, 39, .14); padding: 6px; z-index: 60; }
.portal-user-menu a, .portal-user-menu button { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 6px; color: var(--ink); font-size: 14px; background: none; border: 0; }
.portal-user-menu a:hover, .portal-user-menu button:hover { background: var(--brand-soft); text-decoration: none; }
.portal-user-menu .menu-head { padding: 8px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.portal-user-menu .menu-head b { display: block; }
.portal-user-menu .menu-head span { font-size: 12px; color: var(--muted); }
.portal-content { padding: 20px; flex: 1; width: 100%; }
.portal-content > .page-head { margin-bottom: 16px; }
.portal-content > .page-head h1 { font-size: 22px; font-weight: 800; margin: 0; }

/* collapsed rail: icons only */
.portal-shell.rail .portal-sidebar { width: 64px; flex-basis: 64px; }
.portal-shell.rail .portal-brand b, .portal-shell.rail .portal-brand small,
.portal-shell.rail .portal-nav h5, .portal-shell.rail .portal-nav a span,
.portal-shell.rail .portal-nav .nav-group summary,
.portal-shell.rail .portal-sidefoot div { display: none; }
.portal-shell.rail .portal-nav a { justify-content: center; padding: 9px 0; }
.portal-shell.rail .portal-nav .nav-sub { display: none !important; }
.portal-shell.rail .portal-brand { justify-content: center; padding: 14px 0; }
.portal-shell.rail .portal-collapse { display: none; }
.portal-shell.rail .portal-sidefoot { justify-content: center; padding: 12px 0; }

/* ---------- guest (login) shell ---------- */
.guest-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; background: var(--bg); }
.guest-logo img { height: 56px; width: auto; }
.guest-logo { margin-bottom: 20px; text-align: center; }
.guest-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 28px 24px; }
.guest-card h1 { font-size: 20px; text-align: center; }
.guest-foot { margin-top: 16px; text-align: center; font-size: 13px; color: var(--muted); }

/* ---------- responsive ---------- */
@media (max-width: 1020px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .kpis { grid-template-columns: repeat(2, 1fr); }
    .site-footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
    .portal-shell { flex-direction: column; }
    .portal-sidebar { width: 100%; flex: none; height: auto; position: static; border-right: 0; border-bottom: 1px solid var(--line); }
    .portal-nav { display: flex; flex-wrap: wrap; gap: 2px; }
    .portal-nav h5 { display: none; }
    .portal-nav a { width: auto; white-space: nowrap; }
    .portal-nav .nav-sub { display: none !important; }
    .portal-sidefoot { display: none; }
    .portal-brand { padding: 10px 16px; }
    .portal-content { padding: 16px 14px; }
    .portal-topbar { padding: 10px 14px; }
    .site-header-inner { flex-wrap: wrap; gap: 8px; }
    .nav-toggle { display: inline-flex; align-items: center; }
    .site-nav { display: none; order: 3; flex-basis: 100%; flex-direction: column; align-items: stretch; gap: 2px; }
    .site-header.nav-open .site-nav { display: flex; }
    /* Mobile nav panel must scroll inside the viewport: the sticky header
       + a long open menu (Buy has 20+ items) otherwise covers the whole
       screen and the items below the fold are unreachable. */
    .site-header.nav-open .site-nav { max-height: calc(100vh - 110px); max-height: calc(100dvh - 110px); overflow-y: auto; }
    .site-nav .nav-drop { width: 100%; }
    .site-nav > a, .site-nav .nav-drop-btn { width: 100%; text-align: left; }
    .site-nav .nav-menu, .site-nav .nav-menu-wide { position: static; min-width: 0; width: 100%; max-width: 100%; box-shadow: none; border: 0; padding: 0 0 0 8px; }
    /* On touch, hover/focus must not open menus — the tap toggle owns open/close. */
    .site-nav .nav-drop:hover .nav-menu, .site-nav .nav-drop:focus-within .nav-menu { display: none; }
    .site-nav .nav-drop:hover .nav-menu-wide, .site-nav .nav-drop:focus-within .nav-menu-wide { display: none; }
    .site-nav .nav-drop.nav-open > .nav-menu { display: block; }
    .site-nav .nav-drop.nav-open > .nav-menu-wide { display: block; }
    .hero h1 { font-size: 22px; }
    .grid-2, .grid-3, .grid-4, .kpis { grid-template-columns: 1fr; }
    .site-footer-inner { grid-template-columns: 1fr; }
    .search-bar form { grid-template-columns: 1fr; }
    .search-bar .input, .search-bar .select, .search-bar .btn { width: 100%; flex: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* Portal audit items 13–16 — dashboard widgets, charts, notifications,
   role preview, role tabs, gallery. */
.donutwrap { text-align: center; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--brand-soft); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: 12.5px; color: var(--ink-soft); }
.chip i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.gaugebox { display: flex; align-items: center; gap: 12px; }
.gaugebox .gv { font-size: 30px; font-weight: 700; color: var(--ink); line-height: 1; }
.pipe { display: flex; flex-direction: column; gap: 8px; }
.pstage { border-radius: 8px; color: #fff; padding: 8px 12px; font-weight: 600; white-space: nowrap; }
.pstage.p1 { background: #2b7bbb; }
.pstage.p2 { background: #12957a; }
.pstage.p3 { background: #e8762d; }
.pstage.p4 { background: #1E3A8A; }
.rolebar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.badge-warn { background: #FEF3C7; border: 1px solid #F59E0B; color: #92400E; border-radius: 999px; padding: 2px 10px; font-size: 12.5px; font-weight: 600; }
.roletabs { display: flex; flex-wrap: wrap; gap: 6px; }
.rtab { border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; color: var(--ink-soft); background: var(--card); }
.rtab.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.rolematrix { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 10px 0; }
.rolecheck { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; }
.portal-notif { position: relative; }
.notif-bell { display: inline-flex; align-items: center; gap: 6px; }
.notif-badge { background: #d92d20; color: #fff; border-radius: 999px; min-width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; padding: 0 5px; }
.portal-notif-panel { position: absolute; right: 0; top: calc(100% + 8px); width: 340px; max-width: 86vw; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(17, 24, 39, .18); z-index: 60; padding: 8px; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.linkbtn { background: none; border: 0; color: var(--brand); cursor: pointer; font-size: 13px; padding: 0; }
.notif-item { display: block; padding: 10px 8px; border-bottom: 1px solid var(--line); color: var(--ink); }
.notif-item:last-child { border-bottom: 0; }
.notif-item b { display: block; font-size: 13.5px; }
.notif-item span { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.notif-item time { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.notif-empty { padding: 14px 8px; color: var(--muted); margin: 0; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.gallery-item { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card); }
.gallery-item img { width: 100%; height: 160px; object-fit: cover; display: block; }
.gallery-missing { height: 160px; display: flex; align-items: center; justify-content: center; color: var(--muted); background: var(--bg); }
.gallery-meta { padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.gallery-meta span { color: var(--muted); font-size: 12.5px; }

/* Dark theme (audit item 15) — variable overrides; the portal already
   paints from these variables, so one switch recolors everything. */
html[data-theme="dark"] {
    --brand: #7aa2ff;
    --brand-dark: #5b8cff;
    --brand-light: #1f2a44;
    --brand-soft: #1f2a44;
    --ink: #e5e7eb;
    --ink-soft: #cbd5e1;
    --muted: #94a3b8;
    --line: #334155;
    --bg: #0f172a;
    --card: #1e293b;
    color-scheme: dark;
}
html[data-theme="dark"] .portal-sidebar { background: #1e293b; }
html[data-theme="dark"] .portal-topbar { background: #1e293b; }
html[data-theme="dark"] input, html[data-theme="dark"] select, html[data-theme="dark"] textarea { background: #0f172a; color: #e5e7eb; border-color: #334155; }
html[data-theme="dark"] .table th, html[data-theme="dark"] .table td { border-color: #334155; }
html[data-theme="dark"] .badge-warn { background: #451a03; color: #fcd34d; border-color: #92400e; }
@media (max-width: 700px) { .portal-notif-panel { position: fixed; left: 12px; right: 12px; width: auto; } }
