/* ====================================================================== */
/*  Ofaami Enterprise Dashboard — Components                              */
/*  Ported from the HTML reference (html/assets/css/components.css)       */
/* ====================================================================== */

/* -------------------------------------------------------------- page UI */
.page-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-title h1 { font-size: var(--fz-20); margin: 0; display: flex; align-items: center; gap: 10px; }
.page-title h1 .mi { color: var(--primary); font-size: 24px; }
.page-title .sub { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.crumbs { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-muted); margin-bottom: 14px; }
.crumbs a { color: var(--text-muted); }
.crumbs a:hover { color: var(--primary); }
.crumbs .sep { color: var(--text-faint); font-size: 10px; }

.notice { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--r-12); background: var(--primary-soft); border: 1px solid var(--border); font-size: 12px; color: var(--primary-darker); margin-bottom: 16px; }
.notice .mi { font-size: 17px; }
.notice .link { margin-left: auto; font-weight: 600; color: var(--primary); text-decoration: underline; }

/* ---------------------------------------------------------------- cards */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-14); box-shadow: var(--shadow-sm); }
.card-header { padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-header h3, .card-header h4, .card-header h5 { margin: 0; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.card-header .accent { color: var(--text-muted); font-size: 11px; font-weight: 600; }
.card-body { padding: 18px; }
.card-body.pad-14 { padding: 14px; }

/* accent top line */
.card.accent::before { content: ""; display: block; height: 3.5px; border-radius: var(--r-14) var(--r-14) 0 0; background: var(--primary-gradient); }
.card.accent-success::before { background: linear-gradient(90deg, #1D9E75, #57C9A3); }
.card.accent-warning::before { background: linear-gradient(90deg, #E2A000, #FFCB52); }
.card.accent-danger::before { background: linear-gradient(90deg, #E24B4A, #FF8B8A); }

/* ------------------------------------------------------------ metric KPI */
.metric-card { position: relative; overflow: hidden; padding: 16px 18px; }
.metric-card .mc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.metric-card .mc-label { font-size: 10px; font-weight: 600; letter-spacing: 1.1px; text-transform: uppercase; color: var(--text-muted); }
.metric-card .mc-tip { color: var(--text-faint); }
.metric-card .mc-value { font-size: 20px; font-weight: 700; color: var(--text); margin: 6px 0 4px; line-height: 1.15; white-space: nowrap; }
.metric-card .mc-value small { font-size: 11px; font-weight: 600; color: var(--text-faint); }
.metric-card .mc-foot { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-muted); }
.metric-card .mc-icon { width: 42px; height: 42px; border-radius: var(--r-12); display: flex; align-items: center; justify-content: center; font-size: 20px; flex: 0 0 auto; }
.metric-card .watermark { position: absolute; right: -14px; bottom: -16px; font-size: 84px; opacity: .05; color: var(--primary); transform: rotate(-12deg); }
.mc-icon.p { background: var(--primary-soft); color: var(--primary); }
.mc-icon.g { background: var(--success-soft); color: var(--success); }
.mc-icon.w { background: var(--warning-soft); color: var(--warning-dark); }
.mc-icon.r { background: var(--danger-soft); color: var(--danger); }
.mc-icon.gold { background: var(--gold-soft); color: var(--gold-dark); }
.mc-icon.info { background: var(--info-soft); color: var(--info); }

.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 700; border-radius: var(--r-full); padding: 1px 7px; }
.delta.up { color: var(--success-dark); background: var(--success-soft); }
.delta.down { color: var(--danger-dark); background: var(--danger-soft); }
.delta.flat { color: var(--text-muted); background: var(--primary-soft); }

/* ------------------------------------------------------------ chart card */
.chart-card .chart-head { padding: 14px 18px 4px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.chart-card .chart-head h3 { font-size: 14px; margin: 0; }
.chart-card .chart-head .legend-desc { font-size: 11px; color: var(--text-muted); }
.chart-slot { padding: 8px 14px 14px; height: 280px; overflow: hidden; }
.chart-slot.tall { height: 340px; }
.chart-slot.sm { height: 220px; overflow: hidden; }

.chart-legend { display: flex; align-items: center; gap: 14px; font-size: 11px; color: var(--text-muted); flex-wrap: wrap; }
.chart-legend li { display: flex; align-items: center; gap: 6px; }
.chart-legend .swatch { width: 9px; height: 9px; border-radius: 3px; }

/* ---------------------------------------------------------- table card */
.table-card .tc-toolbar { padding: 14px 18px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border-bottom: 1px solid var(--border); }
.table-card .tc-toolbar .grow { flex: 1; }
.table-card .tc-body { overflow-x: auto; }
.table-card .tc-footer { padding: 12px 18px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--text-muted); }

.table { width: 100%; border-collapse: collapse; font-size: var(--fz-12); }
.table thead th {
    text-align: left; white-space: nowrap;
    font-size: 9.5px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
    color: var(--text-muted); background: var(--primary-p50);
    padding: 10px 14px; border-bottom: 1px solid var(--border-strong);
}
.table tbody td { padding: 11px 14px; border-bottom: 1px solid var(--border); color: var(--text-2); vertical-align: middle; }
.table tbody tr { transition: background .12s ease; }
.table tbody tr:hover { background: var(--primary-p50); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .center { text-align: center; }
.table .strong { color: var(--text); font-weight: 600; }
.table .muted { color: var(--text-muted); }
.table .link-cell { color: var(--primary); font-weight: 600; }
.tcell-main { display: flex; align-items: center; gap: 10px; }
.tcell-main .meta { line-height: 1.2; }
.tcell-main .meta strong { display: block; font-size: 12.5px; color: var(--text); font-weight: 600; }
.tcell-main .meta small { font-size: 10.5px; color: var(--text-muted); }

/* -------------------------------------------------------------- badges */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 700; letter-spacing: .4px; text-transform: capitalize; border-radius: var(--r-full); padding: 3px 10px; line-height: 1.55; white-space: nowrap; }
.badge .mi { font-size: 12px; }
.badge.p { color: var(--primary-dark); background: var(--primary-soft); }
.badge.g { color: var(--success-dark); background: var(--success-soft); }
.badge.w { color: var(--warning-dark); background: var(--warning-soft); }
.badge.r { color: var(--danger-dark); background: var(--danger-soft); }
.badge.gold { color: var(--gold-dark); background: var(--gold-soft); }
.badge.slate { color: var(--text-muted); background: var(--primary-p50); }
.badge.grad { color: #fff; background: var(--primary-gradient); }
.badge.grad-gold { color: #0F0F23; background: linear-gradient(90deg,#F5C842,#F7D873); }
.badge-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* --------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: 12.5px; font-weight: 600; border-radius: var(--r-10); padding: 8px 14px; border: 1px solid transparent; cursor: pointer; line-height: 1.3; transition: all .15s ease; white-space: nowrap; }
.btn .mi { font-size: 16px; }
.btn-sm { padding: 5px 10px; font-size: 11.5px; border-radius: var(--r-8); }
.btn-sm .mi { font-size: 14px; }
.btn-lg { padding: 11px 20px; font-size: 13.5px; border-radius: var(--r-12); }
.btn-icon { padding: 8px; }
.btn-icon.btn-sm { padding: 5px; }

.btn-p { background: var(--primary-gradient); color: #fff; box-shadow: var(--shadow-purple); }
.btn-p:hover { color: #fff; filter: brightness(1.06); box-shadow: 0 12px 26px rgba(108,79,232,.36); }
.btn-p:active { transform: translateY(1px); }

.btn-o { background: transparent; border-color: var(--primary-mid); color: var(--primary-dark); }
.btn-o:hover { background: var(--primary-soft); color: var(--primary-dark); }

.btn-g { background: var(--success); color: #fff; }
.btn-g:hover { background: var(--success-dark); color: #fff; }

.btn-r { background: transparent; border-color: rgba(226,75,74,.4); color: var(--danger); }
.btn-r:hover { background: var(--danger-soft); color: var(--danger-dark); }

.btn-slate { background: var(--primary-soft); border-color: var(--border-strong); color: var(--text-2); }
.btn-slate:hover { background: var(--primary-p50); color: var(--primary-dark); }

.btn-white { background: #fff; border-color: var(--border-strong); color: var(--text-2); }
.btn-white:hover { color: var(--primary); border-color: var(--primary-mid); }

.btn-gold { background: linear-gradient(90deg, #F5C842, #F7D873); color: #0F0F23; }
.btn-gold:hover { color: #0F0F23; filter: brightness(1.04); }

.btn-pure { background: transparent; color: var(--primary); }
.btn-pure:hover { background: var(--primary-soft); }

[disabled].btn, .btn.disabled { opacity: .55; pointer-events: none; }

/* --------------------------------------------------------- avatar group */
.avatar { width: 34px; height: 34px; border-radius: var(--r-full); overflow: hidden; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.sm { width: 28px; height: 28px; }
.avatar.lg { width: 44px; height: 44px; }
.avatar.xl { width: 64px; height: 64px; }
.avatar.rounded { border-radius: var(--r-10); }
.avatar .initials { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #fff; background: var(--primary-gradient); }
.avatar-group { display: flex; align-items: center; }
.avatar-group .avatar { border: 2px solid #fff; margin-left: -8px; }
.avatar-group .avatar:first-child { margin-left: 0; }
.avatar-group .more { width: 34px; height: 34px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; margin-left: -8px; }

/* ------------------------------------------------------------ pagination */
.pagination { display: flex; align-items: center; gap: 4px; }
.pagination .pg { min-width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: var(--r-8); font-size: 11.5px; color: var(--text-2); border: 1px solid var(--border); background: var(--bg-card); cursor: pointer; }
.pagination .pg:hover { border-color: var(--primary-mid); color: var(--primary); }
.pagination .pg.active { background: var(--primary-gradient); color: #fff; border-color: transparent; box-shadow: var(--shadow-purple); }
.pagination .pg.disabled { opacity: .45; pointer-events: none; }

/* --------------------------------------------------------------- tabs */
.tabs { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.tabs .tab { padding: 9px 14px; font-size: 12px; font-weight: 600; color: var(--text-muted); border-radius: var(--r-10) var(--r-10) 0 0; cursor: pointer; display: flex; align-items: center; gap: 7px; position: relative; }
.tabs .tab:hover { color: var(--primary); }
.tabs .tab.active { color: var(--primary-dark); }
.tabs .tab.active::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2.5px; border-radius: 3px 3px 0 0; background: var(--primary-gradient); }
.tabs .tab .count { font-size: 9.5px; background: var(--primary-soft); color: var(--primary); border-radius: var(--r-full); padding: 0 6px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 11px; font-weight: 600; color: var(--text-2); background: var(--primary-p50); border: 1px solid var(--border); padding: 3px 10px; border-radius: var(--r-full); cursor: pointer; }
.tag:hover { color: var(--primary); border-color: var(--primary-mid); }
.tag.active { background: var(--primary-gradient); color: #fff; border-color: transparent; }

/* -------------------------------------------------------- status dot row */
.as-status { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.as-status .sdot { width: 8px; height: 8px; border-radius: 50%; }
.as-status .sdot.p { background: var(--primary); }
.as-status .sdot.g { background: var(--success); }
.as-status .sdot.w { background: var(--warning); }
.as-status .sdot.r { background: var(--danger); }
.as-status .sdot.slate { background: var(--text-faint); }

/* ------------------------------------------------------------- timeline */
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: var(--border-strong); border-radius: 2px; }
.timeline .tl-item { position: relative; padding: 0 0 18px; }
.timeline .tl-item:last-child { padding-bottom: 0; }
.timeline .tl-item .tl-dot { position: absolute; left: -22px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--bg-card); border: 2px solid var(--primary); display: flex; align-items: center; justify-content: center; }
.timeline .tl-item .tl-dot .mi { font-size: 9px; color: var(--primary); }
.timeline .tl-item .tl-dot.g { border-color: var(--success); }
.timeline .tl-item .tl-dot.g .mi { color: var(--success); }
.timeline .tl-item .tl-dot.r { border-color: var(--danger); }
.timeline .tl-item .tl-dot.r .mi { color: var(--danger); }
.timeline .tl-item .tl-dot.w { border-color: var(--warning); }
.timeline .tl-item .tl-dot.w .mi { color: var(--warning-dark); }
.timeline .tl-time { font-size: 10px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .6px; }
.timeline .tl-title { font-size: 12.5px; color: var(--text); font-weight: 600; margin: 2px 0 1px; }
.timeline .tl-desc { font-size: 11.5px; color: var(--text-muted); }

/* ------------------------------------------------------------ progress */
.progress { height: 6px; background: var(--primary-p50); border-radius: var(--r-full); overflow: hidden; }
.progress .bar { height: 100%; border-radius: var(--r-full); background: var(--primary-gradient); }
.progress .bar.g { background: linear-gradient(90deg,#1D9E75,#57C9A3); }
.progress .bar.w { background: linear-gradient(90deg,#E2A000,#FFCB52); }
.progress .bar.gold { background: linear-gradient(90deg,#F5C842,#F7D873); }

/* ----------------------------------------------------- activity / list */
.act-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.act-row:last-child { border-bottom: 0; }
.act-row .act-icon { width: 38px; height: 38px; border-radius: var(--r-10); display: flex; align-items: center; justify-content: center; font-size: 17px; flex: 0 0 auto; }
.act-row .act-body { flex: 1; min-width: 0; }
.act-row .act-title { font-size: 12.5px; color: var(--text); font-weight: 600; }
.act-row .act-desc { font-size: 11px; color: var(--text-muted); }
.act-row .act-side { text-align: right; flex: 0 0 auto; }

.leader-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.leader-row .rank { width: 26px; height: 26px; border-radius: var(--r-8); background: var(--primary-soft); color: var(--primary); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.leader-row.rank-1 .rank { background: linear-gradient(90deg,#F5C842,#F7D873); color: #0F0F23; }
.leader-row.rank-2 .rank { background: linear-gradient(90deg,#CBD5E1,#E2E8F0); color: #334155; }
.leader-row.rank-3 .rank { background: linear-gradient(90deg,#D9A66B,#EDC9A1); color: #4A2E12; }
.leader-row .lr-body { flex: 1; min-width: 0; }
.leader-row .lr-name { font-size: 12.5px; font-weight: 600; color: var(--text); }
.leader-row .lr-sub { font-size: 10.5px; color: var(--text-muted); }
.leader-row .lr-val { font-size: 12px; font-weight: 700; color: var(--text); }

/* -------------------------------------------------------- progress list */
.pl-row { margin-bottom: 14px; }
.pl-row:last-child { margin-bottom: 0; }
.pl-row .pl-top { display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; margin-bottom: 5px; }
.pl-row .pl-top strong { color: var(--text); font-weight: 600; }
.pl-row .pl-top span { color: var(--text-muted); }

/* ------------------------------------------------------------- stat rows */
.donut-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; }
.donut-row .swatch { width: 10px; height: 10px; border-radius: 4px; flex: 0 0 auto; }
.donut-row .dr-name { flex: 1; font-size: 12px; color: var(--text-2); }
.donut-row .dr-val { font-size: 12px; font-weight: 700; color: var(--text); }
.donut-row .dr-pct { font-size: 10.5px; color: var(--text-muted); width: 38px; text-align: right; }

/* ----------------------------------------------------------------- grid */
.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.g-6 { grid-template-columns: repeat(6, minmax(0,1fr)); }
.gt-8 { grid-template-columns: 8fr 4fr; }
.gt-7-5 { grid-template-columns: 7fr 5fr; }
.gt-2 { grid-template-columns: 2fr 1fr; }
.gt-3-1 { grid-template-columns: 3fr 1fr; }
.cols-13 { display: grid; grid-template-columns: repeat(12, minmax(0,1fr)); gap: 16px; }
.c-span-3 { grid-column: span 3; } .c-span-4 { grid-column: span 4; }
.c-span-5 { grid-column: span 5; } .c-span-6 { grid-column: span 6; }
.c-span-7 { grid-column: span 7; } .c-span-8 { grid-column: span 8; }
.c-span-9 { grid-column: span 9; } .c-span-12 { grid-column: span 12; }

/* ------------------------------------------------------------ empty state */
.empty-state { text-align: center; padding: 46px 20px; }
.empty-state .es-icon { width: 74px; height: 74px; margin: 0 auto 14px; border-radius: var(--r-18); background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 34px; }
.empty-state h4 { font-size: 15px; margin-bottom: 6px; }
.empty-state p { font-size: 12px; color: var(--text-muted); max-width: 330px; margin: 0 auto 14px; }

/* --------------------------------------------------------------- skeleton */
.skeleton { position: relative; overflow: hidden; background: var(--primary-p50); border-radius: var(--r-8); }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent); animation: shimmer 1.4s infinite; }
@keyframes shimmer { 100% { transform: translateX(100%); } }

/* --------------------------------------------------------------- modal */
.modal-card { width: 100%; max-width: 560px; background: var(--bg-card); border-radius: var(--r-18); box-shadow: var(--shadow-lg); animation: modalIn .22s ease; }
.modal-card.wide { max-width: 760px; }
.modal-card .modal-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-card .modal-head h3 { margin: 0; font-size: 15px; }
.modal-card .modal-body { padding: 20px; }
.modal-card .modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
@keyframes modalIn { from { transform: translateY(14px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }

/* --------------------------------------------------------------- drawer */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 400px; max-width: 92vw; background: var(--bg-card); z-index: 1080; box-shadow: var(--shadow-lg); transform: translateX(100%); transition: transform .28s ease; display: flex; flex-direction: column; }
.drawer.open { transform: none; }
.drawer .drawer-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.drawer .drawer-head h3 { margin: 0; font-size: 15px; }
.drawer .drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px; }
.drawer .drawer-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ---------------------------------------------------------------- toast */
.toast-stack { position: fixed; top: 18px; right: 18px; z-index: 1100; display: flex; flex-direction: column; gap: 10px; }
.toast { display: flex; align-items: flex-start; gap: 10px; min-width: 300px; max-width: 380px; background: var(--bg-card); border-radius: var(--r-14); box-shadow: var(--shadow-lg); padding: 12px 14px; border: 1px solid var(--border); border-left: 3px solid var(--primary); animation: toastIn .25s ease; }
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast .t-icon { font-size: 18px; color: var(--primary); }
.toast.success .t-icon { color: var(--success); } .toast.error .t-icon { color: var(--danger); } .toast.warning .t-icon { color: var(--warning); }
.toast .t-body { flex: 1; }
.toast .t-title { font-size: 12.5px; font-weight: 600; color: var(--text); }
.toast .t-msg { font-size: 11.5px; color: var(--text-muted); }
@keyframes toastIn { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }

/* -------------------------------------------------------- misc utilities */
.mt-0{margin-top:0}.mt-1{margin-top:4px}.mt-2{margin-top:8px}.mt-3{margin-top:12px}.mt-4{margin-top:16px}.mt-5{margin-top:20px}
.mb-0{margin-bottom:0}.mb-1{margin-bottom:4px}.mb-2{margin-bottom:8px}.mb-3{margin-bottom:12px}.mb-4{margin-bottom:16px}.mb-5{margin-bottom:20px}
.ml-auto{margin-left:auto}.mx-auto{margin-left:auto;margin-right:auto}
.d-flex{display:flex}.align-center{align-items:center}.justify-between{justify-content:space-between}.gap-1{gap:4px}.gap-2{gap:8px}.gap-3{gap:12px}.gap-4{gap:16px}.gap-5{gap:20px}
.flex-wrap{flex-wrap:wrap}.flex-1{flex:1;min-width:0}.shrink-0{flex-shrink:0}
.text-muted{color:var(--text-muted)}.text-faint{color:var(--text-faint)}.text-primary{color:var(--primary)}.text-success{color:var(--success)}.text-danger{color:var(--danger)}.text-warning{color:var(--warning-dark)}
.fw-6{font-weight:600}.fw-7{font-weight:700}.fz-9{font-size:9px}.fz-10{font-size:10px}.fz-11{font-size:11px}.fz-12{font-size:12px}.fz-13{font-size:13px}.fz-14{font-size:14px}
.text-end{text-align:right}.text-center{text-align:center}
.nowrap{white-space:nowrap}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hide{display:none !important}.show{display:inline-block}
.divider{height:1px;background:var(--border);margin:16px 0}

.tooltip-row { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; padding:9px 0; border-bottom:1px dashed var(--border); font-size:12px; }
.tooltip-row:last-child{border-bottom:0}
.tooltip-row dt { color:var(--text-muted); }
.tooltip-row dd { margin:0; color:var(--text); font-weight:600; text-align:right; }

/* ====================================================================== */
/*  Page-level supplements (from the reference 41-page library build)     */
/* ====================================================================== */

/* tables inside cards */
.table-card { overflow: hidden; }
.table-card .card-header { border-bottom: 1px solid var(--border); }
.table-scroll { overflow-x: auto; }
.tc-status { font-size: 11.5px; color: var(--text-muted); }
.pad-16 { padding: 16px; }
.py-5 { padding-top: 20px; padding-bottom: 20px; }
.flex-column { flex-direction: column; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, Menlo, monospace; font-size: 11.5px; }

/* buttons */
.btn-w { background: #FFF3CD; color: #7a4d00; border-color: transparent; }
.btn-w:hover { background: #FFE7A8; }
.btn-danger { background: var(--danger); color: #fff; border-color: transparent; }
.btn-danger:hover { background: #c93e3d; }
.btn-block { width: 100%; display: flex; justify-content: center; }
.btn-link { color: var(--primary); font-weight: 600; font-size: 12px; display: inline-flex; align-items: center; gap: 5px; }
.btn-link:hover { text-decoration: underline; }

/* alerts & helper text */
.alert { display: flex; align-items: flex-start; gap: 9px; padding: 11px 13px; border-radius: var(--r-12); font-size: 12.5px; line-height: 1.45; border: 1px solid transparent; }
.note-alert { background: var(--primary-soft); border-color: var(--border); color: var(--primary-darker); }
.note-alert code { background: rgba(108,79,232,.1); padding: 1px 5px; border-radius: 6px; }
.hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* metric card info dot / hover tooltip */
.has-note .note { cursor: help; color: var(--text-faint); font-size: 13px; }
.has-note { position: relative; }
.tooltip-note { display: none; position: absolute; right: 26px; top: 14px; }
.has-note:hover .tooltip-note { display: inline-block; }

/* message centre */
.msg-layout { display: grid; grid-template-columns: 300px 1fr; min-height: 460px; }
.msg-list { border-right: 1px solid var(--border); padding: 8px; }
.msg-item { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--r-12); cursor: pointer; }
.msg-item:hover { background: var(--primary-soft); }
.msg-item.active { background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); }
.msg-meta { flex: 1; min-width: 0; }
.msg-name { font-size: 12.5px; font-weight: 700; }
.msg-sub { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-time { font-size: 10px; color: var(--text-faint); white-space: nowrap; }
.msg-thread { display: flex; flex-direction: column; }
.msg-thread-head { padding: 13px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.msg-thread-body { flex: 1; padding: 18px; display: flex; flex-direction: column; gap: 12px; overflow: auto; }
.msg-thread-foot { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; gap: 10px; align-items: flex-end; }
.msg-thread-foot .textarea { flex: 1; }
.bubble { max-width: 70%; padding: 10px 13px; border-radius: var(--r-14); font-size: 12.5px; line-height: 1.5; }
.bubble p { margin: 0 0 4px; }
.bubble.in { background: var(--primary-soft); border-bottom-left-radius: 4px; align-self: flex-start; }
.bubble.out { background: var(--primary); color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }
.bubble.out small { color: rgba(255,255,255,.7); }

/* pricing cards */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.pricing-card { border: 1px solid var(--border); border-radius: var(--r-14); padding: 20px 18px; background: var(--bg-card); }
.pricing-card.current { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); position: relative; }
.pc-toggle { position: absolute; top: -9px; right: 12px; }
.pricing-card h3 { margin: 0 0 4px; font-size: 15px; }
.pc-price { font-size: 22px; font-weight: 800; margin: 6px 0 10px; }
.pc-price span { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.pc-feats { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 7px; }
.pc-feats li { font-size: 12px; display: flex; gap: 7px; align-items: center; color: var(--text); }
.pc-feats .ti-check { color: var(--success); }
.btn-p.btn-block { width: 100%; justify-content: center; }

/* gallery / media */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.gallery-grid.two-col { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.gal-card { border: 1px solid var(--border); border-radius: var(--r-12); overflow: hidden; background: var(--bg-card); }
.gal-band { display: flex; align-items: center; justify-content: center; }
.gal-body { padding: 9px 11px; font-size: 11.5px; }
.gal-body strong { display: block; font-size: 12px; }

/* gateway cards */
.gateway-card { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border: 1px solid var(--border); border-radius: var(--r-12); background: var(--bg-card); }
.gateway-card strong { font-size: 13px; }
.gateway-card .muted { font-size: 11px; }
.gw-ic { width: 38px; height: 38px; border-radius: var(--r-10); display: inline-flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.gw-ic.p { background: var(--primary-soft); color: var(--primary); }
.gw-ic.g { background: var(--success-soft); color: var(--success); }
.gw-ic.w { background: #FFF3CD; color: #B37E00; }
.gw-ic.slate { background: #EEF2F7; color: #64748b; }
.gw-ic.r { background: var(--danger-soft); color: var(--danger); }

/* review cards */
.review-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.review-card { padding: 14px; }
.rev-head { display: flex; align-items: center; gap: 10px; }
.rev-head .avatar { flex-shrink: 0; }

/* avatar & inline status text */
.as-status { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; color: var(--text); }
.center .as-status { justify-content: center; }

/* session rows */
.session-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px dashed var(--border); font-size: 12.5px; }
.session-row:last-child { border-bottom: 0; }
.s-ic { width: 34px; height: 34px; border-radius: var(--r-10); display: inline-flex; align-items: center; justify-content: center; font-size: 16px; background: var(--primary-soft); color: var(--primary); flex-shrink: 0; }
.s-ic.p { background: var(--primary-soft); color: var(--primary); }
.s-ic.g { background: var(--success-soft); color: var(--success); }
.s-ic.slate { background: #EEF2F7; color: #64748b; }
.s-ic.r { background: var(--danger-soft); color: var(--danger); }
.s-ic.info { background: #E8F3FF; color: #2E7CCF; }
.s-ic.w { background: #FFF3CD; color: #B37E00; }

/* promotions discount rows */
.discount-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--border); }
.discount-row:last-child { border-bottom: 0; }
.d-flag { min-width: 52px; text-align: center; font-weight: 700; }
.d-info { flex: 1; }
.d-info strong { font-size: 13px; display: block; }
.d-info .muted { font-size: 11.5px; }

/* verification documents list */
.verify-list { display: grid; gap: 10px; }
.act-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.act-row:last-child { border-bottom: 0; }
.act-icon { width: 36px; height: 36px; border-radius: var(--r-10); display: inline-flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.act-icon.p { background: var(--primary-soft); color: var(--primary); }
.act-icon.g { background: var(--success-soft); color: var(--success); }
.act-icon.w { background: #FFF3CD; color: #B37E00; }
.act-icon.slate { background: #EEF2F7; color: #64748b; }
.act-icon.info { background: #E8F3FF; color: #2E7CCF; }
.act-icon.r { background: var(--danger-soft); color: var(--danger); }
.act-icon.gold { background: #FFF6D9; color: #C89B00; }
.act-body { flex: 1; min-width: 0; }
.act-title { font-size: 12.5px; font-weight: 600; line-height: 1.35; }
.act-desc { font-size: 11px; color: var(--text-muted); }

/* rich text editor placeholder */
.editor-slot { border: 1px dashed var(--border); border-radius: var(--r-12); background: var(--bg-page); min-height: 90px; padding: 14px; font-size: 12px; color: var(--text-faint); }

/* permissions & zone price small grids */
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.zone-price-grid { display: grid; grid-template-columns: repeat(4, auto 1fr); gap: 8px 10px; align-items: center; font-size: 12px; }
.checks.v { flex-direction: column; align-items: flex-start; }

/* report runner */
.report-runner { padding: 16px 18px; }

/* search tile (analytics keyword chips) */
.search-tile { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: var(--primary-soft); font-size: 11.5px; font-weight: 600; color: var(--primary-darker); }

/* pricing highlight helper used on detail-by-detail cards */
.current { border-color: var(--primary) !important; }

@media (max-width: 1199.98px){
  .g-4{grid-template-columns:repeat(2,minmax(0,1fr))}
  .g-6{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media (max-width: 991.98px){
  .gt-8,.gt-7-5,.gt-2,.gt-3-1{grid-template-columns:1fr}
}
@media (max-width: 767.98px){
  .g-2,.g-3,.g-4{grid-template-columns:1fr}
  .cols-13{grid-template-columns:1fr}
  .c-span-3,.c-span-4,.c-span-5,.c-span-6,.c-span-7,.c-span-8,.c-span-9,.c-span-12{grid-column:span 1}
  .g-6{grid-template-columns:repeat(2,minmax(0,1fr))}
  .page{padding:16px 14px 32px}
}

/* ---------------------------------------------------------------- forms */
.field { margin-bottom: 14px; }
.field label { display: flex; justify-content: space-between; align-items: center; font-size: 11px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; letter-spacing: .3px; }
.field label .req { color: var(--danger); }
.input, .select, .textarea {
    width: 100%; font-family: inherit; font-size: 12.5px; color: var(--text);
    background: var(--surface-input); border: 1px solid var(--border-strong);
    border-radius: var(--r-10); padding: 8px 12px; outline: 0; transition: all .15s ease;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(108,79,232,.12); background: #fff; }
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }
.textarea { resize: vertical; min-height: 84px; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; padding-right: 32px; cursor: pointer; }
.input-group { display: flex; align-items: center; gap: 8px; }
.input-group .input, .input-group .select { flex: 1; }
.seg { display: inline-flex; align-items: center; background: var(--primary-p50); border: 1px solid var(--border); border-radius: var(--r-10); padding: 3px; gap: 2px; }
.seg .seg-btn { border: 0; background: transparent; padding: 6px 13px; font-size: 12px; font-weight: 600; color: var(--text-muted); border-radius: var(--r-8); cursor: pointer; }
.seg .seg-btn.active { background: var(--bg-card); color: var(--primary-dark); box-shadow: var(--shadow-sm); }
.search-input-wrap { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; background: var(--surface-input); border: 1px solid var(--border-strong); border-radius: var(--r-10); color: var(--text-muted); min-width: 220px; }
.search-input-wrap:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(108,79,232,.10); }
.search-input-wrap .mi { font-size: 16px; }
.search-input-wrap input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 12.5px; }
.switch { position: relative; width: 36px; height: 20px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; background: var(--border-strong); border-radius: var(--r-full); cursor: pointer; transition: background .2s ease; }
.switch .track::after { content: ""; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s ease; }
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(16px); }
.radio-label { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-2); cursor: pointer; }
.checks { display: flex; flex-wrap: wrap; gap: 10px; }
.check-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border: 1px solid var(--border-strong); border-radius: var(--r-full); font-size: 11.5px; color: var(--text-2); cursor: pointer; background: var(--surface-input); transition: all .15s; }
.check-chip input { display: none; }
.check-chip:has(input:checked) { background: var(--primary-soft); border-color: var(--primary-mid); color: var(--primary-dark); font-weight: 600; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }