﻿:root {
    --vms-primary: #6366f1;
    --vms-primary-dark: #4f46e5;
    --vms-primary-soft: #eef2ff;
    --vms-primary-2: #8b5cf6;
    --vms-sidebar-bg: #0f172a;
    --vms-sidebar-fg: #94a3b8;
    --vms-sidebar-fg-hover: #e2e8f0;
    --vms-content-bg: #f6f7fb;
    --vms-card-bg: #ffffff;
    --vms-border: #eceef3;
    --vms-text: #1e293b;
    --vms-text-muted: #64748b;
    --vms-shadow: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06);
    --vms-shadow-md: 0 4px 12px rgba(16,24,40,.08);
    --vms-radius: 14px;
}

* { box-sizing: border-box; }

html { font-size: 15px; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--vms-content-bg);
    color: var(--vms-text);
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.01em;
}

a { text-decoration: none; }

/* ---------- Shell ---------- */
.vms-shell { display: flex; min-height: 100vh; }

.vms-sidebar {
    width: 256px;
    background: var(--vms-sidebar-bg);
    color: var(--vms-sidebar-fg);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #334155 transparent;
}
.vms-sidebar::-webkit-scrollbar { width: 6px; }
.vms-sidebar::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }

.vms-brand {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: 1.35rem 1.4rem;
    font-weight: 700;
    font-size: 1.2rem;
    color: #fff;
}
.vms-logo {
    background: linear-gradient(135deg, var(--vms-primary), var(--vms-primary-2));
    color: #fff;
    width: 38px; height: 38px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: .95rem;
    box-shadow: 0 4px 12px rgba(99,102,241,.4);
}
.vms-brand-text { color: #fff; letter-spacing: -0.02em; }

.vms-nav { padding: .5rem .75rem 2rem; display: flex; flex-direction: column; }

.vms-section {
    text-transform: uppercase;
    font-size: .66rem;
    font-weight: 600;
    letter-spacing: .1em;
    color: #475569;
    padding: 1.1rem .85rem .4rem;
}

.vms-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem .85rem;
    margin: .12rem 0;
    color: var(--vms-sidebar-fg);
    border-radius: 10px;
    font-size: .9rem;
    font-weight: 500;
    transition: background .15s, color .15s;
    position: relative;
}
.vms-link svg { flex-shrink: 0; opacity: .85; }
.vms-link:hover { background: rgba(148,163,184,.1); color: var(--vms-sidebar-fg-hover); }
.vms-link.active {
    background: linear-gradient(135deg, var(--vms-primary), var(--vms-primary-dark));
    color: #fff;
    box-shadow: 0 6px 16px rgba(99,102,241,.35);
}
.vms-link.active svg { opacity: 1; }

/* ---------- Main ---------- */
.vms-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.vms-topbar {
    height: 66px;
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--vms-border);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 20;
}
.vms-burger { display: none; background: none; border: none; color: var(--vms-text); padding: .3rem; }

.vms-search {
    display: flex; align-items: center; gap: .5rem;
    background: var(--vms-content-bg);
    border: 1px solid var(--vms-border);
    border-radius: 10px;
    padding: .5rem .85rem;
    color: var(--vms-text-muted);
    width: 300px; max-width: 40vw;
}
.vms-search input { border: none; background: transparent; outline: none; font-size: .9rem; width: 100%; color: var(--vms-text); }

.vms-top-actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.vms-icon-btn {
    width: 40px; height: 40px; border-radius: 10px;
    border: 1px solid var(--vms-border); background: #fff; color: var(--vms-text-muted);
    display: inline-flex; align-items: center; justify-content: center;
    position: relative; transition: background .15s, color .15s;
}
.vms-icon-btn:hover { background: var(--vms-primary-soft); color: var(--vms-primary); }
.vms-icon-btn .dot { position: absolute; top: 9px; right: 10px; width: 7px; height: 7px; border-radius: 50%; background: #ef4444; border: 2px solid #fff; }

.vms-user { display: flex; align-items: center; gap: .6rem; background: none; border: none; color: var(--vms-text); padding: .25rem .35rem; border-radius: 10px; }
.vms-user:hover { background: var(--vms-content-bg); }
.vms-avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: linear-gradient(135deg, var(--vms-primary), var(--vms-primary-2)); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .9rem;
}
.vms-user-meta { text-align: left; line-height: 1.15; }
.vms-user-meta .n { font-size: .85rem; font-weight: 600; }
.vms-user-meta .r { font-size: .72rem; color: var(--vms-text-muted); }

.vms-content { padding: 1.75rem; flex: 1; max-width: 1400px; width: 100%; }

/* ---------- Page header ---------- */
.vms-page-head {
    display: flex; align-items: flex-end; justify-content: space-between;
    margin-bottom: 1.5rem; flex-wrap: wrap; gap: .75rem;
}
.vms-page-head h1 { font-size: 1.55rem; font-weight: 700; margin: 0; letter-spacing: -0.02em; }
.vms-breadcrumb { font-size: .82rem; color: var(--vms-text-muted); margin-top: .2rem; }

/* ---------- Cards ---------- */
.vms-card {
    background: var(--vms-card-bg);
    border: 1px solid var(--vms-border);
    border-radius: var(--vms-radius);
    box-shadow: var(--vms-shadow);
}
.vms-card-body { padding: 1.4rem; }

/* ---------- Stat tiles ---------- */
.vms-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 1.1rem; margin-bottom: 1.6rem; }
.vms-stat {
    background: var(--vms-card-bg); border: 1px solid var(--vms-border); border-radius: var(--vms-radius);
    padding: 1.3rem 1.4rem; display: flex; align-items: center; gap: 1.1rem;
    box-shadow: var(--vms-shadow); transition: transform .15s, box-shadow .15s;
}
.vms-stat:hover { transform: translateY(-2px); box-shadow: var(--vms-shadow-md); }
.vms-stat-ico {
    width: 52px; height: 52px; border-radius: 13px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; flex-shrink: 0;
}
.vms-stat .v { font-size: 1.75rem; font-weight: 700; line-height: 1; letter-spacing: -0.03em; }
.vms-stat .l { color: var(--vms-text-muted); font-size: .84rem; margin-top: .4rem; font-weight: 500; }

/* ---------- Card header (table toolbar) ---------- */
.vms-card-head {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 1.1rem 1.4rem; border-bottom: 1px solid var(--vms-border); flex-wrap: wrap;
}
.vms-card-head .title { font-size: 1rem; font-weight: 700; display: flex; align-items: center; gap: .55rem; }
.vms-card-head .count {
    background: var(--vms-primary-soft); color: var(--vms-primary);
    font-size: .72rem; font-weight: 700; padding: .15rem .55rem; border-radius: 20px;
}
.vms-card-search { display: flex; align-items: center; gap: .5rem; background: var(--vms-content-bg);
    border: 1px solid var(--vms-border); border-radius: 10px; padding: .35rem .7rem; color: var(--vms-text-muted); }
.vms-card-search input { border: none; background: transparent; outline: none; font-size: .88rem; width: 200px; color: var(--vms-text); }

/* Small table avatar */
.vms-avatar-sm {
    width: 36px; height: 36px; border-radius: 50%; color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .78rem; flex-shrink: 0; letter-spacing: .01em;
}
.vms-cell-user { display: flex; align-items: center; gap: .65rem; }
.vms-cell-user .nm { font-weight: 600; line-height: 1.15; }
.vms-cell-user .sub { font-size: .78rem; color: var(--vms-text-muted); }

/* Icon action buttons */
.vms-actions { display: inline-flex; gap: .3rem; justify-content: flex-end; }
.vms-act {
    width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--vms-border);
    background: #fff; color: var(--vms-text-muted); display: inline-flex; align-items: center; justify-content: center;
    transition: all .13s; padding: 0;
}
.vms-act:hover { color: #fff; }
.vms-act.view:hover { background: #64748b; border-color: #64748b; }
.vms-act.edit:hover { background: var(--vms-primary); border-color: var(--vms-primary); }
.vms-act.del:hover  { background: #dc2626; border-color: #dc2626; }

/* ---------- Tables ---------- */
.table { margin-bottom: 0; }
.table thead th {
    border-top: none; border-bottom: 1px solid var(--vms-border);
    font-size: .72rem; text-transform: uppercase; letter-spacing: .05em;
    color: var(--vms-text-muted); font-weight: 600; padding: .75rem 1rem;
}
.table td { vertical-align: middle; padding: .85rem 1rem; border-color: var(--vms-border); color: var(--vms-text); }
.table tbody tr { transition: background .12s; }
.table-hover tbody tr:hover { background: var(--vms-primary-soft); }

/* ---------- Badges / status pills ---------- */
.badge-status {
    font-weight: 600; font-size: .72rem; padding: .35em .7em;
    border-radius: 20px; letter-spacing: .01em;
}
.bg-success-subtle { background: #dcfce7 !important; }
.bg-warning-subtle { background: #fef3c7 !important; }
.bg-danger-subtle  { background: #fee2e2 !important; }
.bg-secondary-subtle { background: #f1f5f9 !important; }
.bg-primary-subtle { background: var(--vms-primary-soft) !important; }
.text-success { color: #16a34a !important; }
.text-warning { color: #b45309 !important; }
.text-danger  { color: #dc2626 !important; }
.text-primary { color: var(--vms-primary) !important; }

/* ---------- Buttons ---------- */
.btn { font-weight: 600; font-size: .875rem; border-radius: 10px; padding: .5rem 1rem; display: inline-flex; align-items: center; gap: .4rem; }
.btn-sm { padding: .35rem .7rem; font-size: .8rem; border-radius: 8px; }
.btn-primary { background: var(--vms-primary); border-color: var(--vms-primary); box-shadow: 0 4px 12px rgba(99,102,241,.28); }
.btn-primary:hover { background: var(--vms-primary-dark); border-color: var(--vms-primary-dark); }
.btn-outline-primary { color: var(--vms-primary); border-color: #d7dbf5; }
.btn-outline-primary:hover { background: var(--vms-primary); border-color: var(--vms-primary); color: #fff; }
.btn-outline-secondary { color: var(--vms-text-muted); border-color: var(--vms-border); }
.btn-outline-secondary:hover { background: #f1f5f9; color: var(--vms-text); border-color: var(--vms-border); }
.btn-outline-danger { color: #dc2626; border-color: #f7d4d4; }
.btn-outline-danger:hover { background: #dc2626; border-color: #dc2626; }
.btn-success { background: #16a34a; border-color: #16a34a; }
.btn-warning { background: #f59e0b; border-color: #f59e0b; color: #fff; }
.btn-warning:hover { color: #fff; background: #d97706; border-color: #d97706; }
.btn-link { color: var(--vms-text-muted); }

/* ---------- Forms ---------- */
.form-label { font-weight: 600; font-size: .82rem; color: #334155; margin-bottom: .35rem; }
.form-control, .form-select {
    border-radius: 10px; border-color: var(--vms-border); padding: .55rem .8rem; font-size: .9rem;
    background-color: #fff;
}
.form-control:focus, .form-select:focus { border-color: var(--vms-primary); box-shadow: 0 0 0 3px rgba(99,102,241,.15); }

/* ---------- Themed time picker (replaces the native <input type=time> popup) ---------- */
.vms-time { position: relative; }
.vms-time-display {
    display: flex; align-items: center; justify-content: space-between; width: 100%;
    text-align: left; cursor: pointer; color: var(--vms-text); background-color: #fff;
}
.vms-time-display:hover { border-color: #cbd5e1; }
.vms-time.open .vms-time-display { border-color: var(--vms-primary); box-shadow: 0 0 0 3px rgba(99,102,241,.15); }
.vms-time-display .vms-time-text:empty::before { content: 'Select time'; color: #94a3b8; }
.vms-time-display::after {
    content: ''; width: 8px; height: 8px; border-right: 2px solid #94a3b8; border-bottom: 2px solid #94a3b8;
    transform: rotate(45deg); margin-left: .5rem; flex: none; transition: transform .15s;
}
.vms-time.open .vms-time-display::after { transform: rotate(-135deg); }
.vms-time-display.disabled { background: #f1f5f9; cursor: not-allowed; opacity: .7; }

.vms-time-panel {
    display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 1050; width: 210px;
    background: #fff; border: 1px solid var(--vms-border); border-radius: 12px; box-shadow: var(--vms-shadow-md);
    padding: .5rem;
}
.vms-time.open .vms-time-panel { display: block; }
.vms-time-cols { display: flex; gap: .35rem; }
.vms-time-col {
    flex: 1; max-height: 176px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px;
    scrollbar-width: thin;
}
.vms-time-col-ampm { overflow: visible; justify-content: center; }
.vms-time-opt, .vms-time-ampm {
    border: none; background: transparent; border-radius: 8px; padding: .4rem 0; font-size: .85rem;
    font-variant-numeric: tabular-nums; color: var(--vms-text); cursor: pointer; text-align: center;
}
.vms-time-opt:hover, .vms-time-ampm:hover { background: var(--vms-primary-soft); }
.vms-time-opt.active, .vms-time-ampm.active { background: var(--vms-primary); color: #fff; font-weight: 600; }
.vms-time-ampm { display: block; width: 100%; margin-bottom: 4px; padding: .5rem 0; }
.vms-time-actions {
    display: flex; justify-content: space-between; align-items: center; margin-top: .5rem;
    padding-top: .5rem; border-top: 1px solid var(--vms-border);
}
.vms-time-actions button {
    border: none; background: transparent; font-size: .8rem; font-weight: 600; color: var(--vms-primary);
    cursor: pointer; padding: .3rem .5rem; border-radius: 6px;
}
.vms-time-actions button:hover { background: var(--vms-primary-soft); }
.vms-time-actions .vms-time-done { background: var(--vms-primary); color: #fff; }
.vms-time-actions .vms-time-done:hover { background: var(--vms-primary-dark); }
.form-check-input:checked { background-color: var(--vms-primary); border-color: var(--vms-primary); }
.form-check-input:focus { box-shadow: 0 0 0 3px rgba(99,102,241,.15); border-color: var(--vms-primary); }

.dropdown-menu { border: 1px solid var(--vms-border); border-radius: 12px; box-shadow: var(--vms-shadow-md); padding: .4rem; }
.dropdown-item { border-radius: 8px; font-size: .88rem; padding: .5rem .7rem; }
.dropdown-item:hover { background: var(--vms-primary-soft); color: var(--vms-primary); }

.alert { border-radius: 12px; border: none; font-size: .9rem; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-danger { background: #fee2e2; color: #991b1b; }

dl.row dt { color: var(--vms-text-muted); font-weight: 600; font-size: .85rem; }
dl.row dd { font-weight: 500; }

code { color: var(--vms-primary); background: var(--vms-primary-soft); padding: .1rem .4rem; border-radius: 6px; font-size: .82rem; }

/* ---------- Auth ---------- */
.vms-auth-body {
    min-height: 100vh; display: flex; align-items: stretch;
    background: var(--vms-content-bg);
}
.vms-auth-split { display: flex; width: 100%; }
.vms-auth-visual {
    flex: 1;
    background: linear-gradient(150deg, var(--vms-primary-dark) 0%, var(--vms-primary) 50%, var(--vms-primary-2) 100%);
    color: #fff; padding: 3.5rem; display: flex; flex-direction: column; justify-content: space-between;
    position: relative; overflow: hidden;
}
.vms-auth-visual::after {
    content: ''; position: absolute; width: 460px; height: 460px; border-radius: 50%;
    background: rgba(255,255,255,.08); right: -140px; bottom: -160px;
}
.vms-auth-visual::before {
    content: ''; position: absolute; width: 260px; height: 260px; border-radius: 50%;
    background: rgba(255,255,255,.07); left: -100px; top: -80px;
}
.vms-auth-visual .headline { font-size: 2rem; font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; position: relative; }
.vms-auth-visual .sub { opacity: .85; margin-top: 1rem; font-size: 1rem; max-width: 380px; position: relative; }
.vms-auth-visual .feat { display: flex; align-items: center; gap: .6rem; margin-top: .8rem; opacity: .95; position: relative; }
.vms-auth-form-pane { flex: 1; display: flex; align-items: center; justify-content: center; padding: 2rem; }
.vms-auth-card { width: 100%; max-width: 380px; }

/* ---------- Phone-first check-in ---------- */
.vms-phone-lookup { display:flex; gap:.6rem; }
.vms-phone-lookup input { font-size:1.15rem; letter-spacing:.02em; }
.vms-phone-lookup .btn { white-space:nowrap; }
.vms-return-banner {
    display:flex; align-items:center; gap:.9rem; margin-top:1rem; padding:.9rem 1.1rem;
    background:#dcfce7; border:1px solid #bbf7d0; border-radius:12px;
}
.vms-return-banner .vms-photo-thumb { width:46px; height:46px; }
.vms-return-banner #rbName { color:#166534; }
.vms-return-banner #rbMeta { color:#15803d; }
.vms-new-banner {
    display:flex; align-items:center; gap:.5rem; margin-top:1rem; padding:.8rem 1.1rem;
    background:var(--vms-primary-soft); border:1px solid #e0e3f8; border-radius:12px;
    color:var(--vms-primary); font-weight:500; font-size:.9rem;
}
@media (max-width:520px){ .vms-phone-lookup { flex-direction:column; } }

/* ---------- Plant / safety ---------- */
.vms-safety-box { background:#fff8ec; border:1px solid #fde9c8; border-radius:12px; padding:1rem 1.1rem; }
.vms-ppe-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:.5rem; }
.vms-ppe-item { display:flex; align-items:center; gap:.5rem; background:#fff; border:1px solid var(--vms-border); border-radius:9px; padding:.5rem .7rem; font-size:.88rem; cursor:pointer; }
.vms-ppe-item input:checked + span { font-weight:600; color:var(--vms-primary); }
.vms-norm-list { margin:0; padding-left:1.1rem; font-size:.86rem; color:#7a5b1e; }
.vms-norm-list li { margin-bottom:.3rem; }
.badge-factory { background:#fde9c8 !important; color:#b45309 !important; }
.badge-ppe { background:#e0f2fe !important; color:#0369a1 !important; font-weight:600; }
.vms-ppe-chips { display:flex; flex-wrap:wrap; gap:.35rem; }

/* ---------- Accessory / material rows at check-in ---------- */
.vms-matrows { display:flex; flex-direction:column; gap:.5rem; }
.vms-matrow { display:grid; grid-template-columns: 2.2fr .7fr .7fr 1.2fr 1.4fr auto; gap:.5rem; align-items:center; }
.vms-matrow .form-control, .vms-matrow .form-select { font-size:.85rem; padding:.4rem .6rem; }
.vms-matdel { flex-shrink:0; font-size:1.15rem; line-height:1; border-color:var(--vms-border); }
@media (max-width:820px){ .vms-matrow { grid-template-columns:1fr 1fr; } }

/* ---------- Photo capture ---------- */
.vms-photo { max-width: 320px; }
.vms-photo-stage {
    width: 100%; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden;
    background: #0f172a; position: relative; display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--vms-border);
}
.vms-photo-video, .vms-photo-preview { width: 100%; height: 100%; object-fit: cover; }
.vms-photo-placeholder { position: absolute; color: #64748b; text-align: center; }
.vms-photo-controls { display: flex; gap: .4rem; margin-top: .6rem; flex-wrap: wrap; }

/* Photo thumb in tables / details */
.vms-photo-thumb { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid #fff; box-shadow: var(--vms-shadow); }
.vms-photo-lg { width: 130px; height: 130px; border-radius: 14px; object-fit: cover; box-shadow: var(--vms-shadow-md); }

/* ---------- Visitor badge (printable) ---------- */
.vms-badge {
    width: var(--badge-w, 90mm); margin: 0 auto; background: #fff; border-radius: 18px; overflow: hidden;
    box-shadow: var(--vms-shadow-md); border: 1px solid var(--vms-border);
}
.vms-badge-head {
    background: linear-gradient(135deg, var(--vms-primary), var(--vms-primary-2)); color: #fff;
    padding: 1rem 1.25rem; display: flex; align-items: center; gap: .6rem; font-weight: 700;
}
.vms-badge-head .vms-logo { background: rgba(255,255,255,.2); box-shadow: none; }
.vms-badge-body { padding: 1.5rem; text-align: center; }
.vms-badge-photo { width: 120px; height: 120px; border-radius: 14px; object-fit: cover; margin: 0 auto .9rem; box-shadow: var(--vms-shadow); }
.vms-badge-name { font-size: 1.35rem; font-weight: 700; }
.vms-badge-type { display: inline-block; background: var(--vms-primary-soft); color: var(--vms-primary); font-weight: 600; font-size: .78rem; padding: .2rem .7rem; border-radius: 20px; margin-top: .35rem; }
.vms-badge-meta { text-align: left; margin: 1.1rem 0; font-size: .88rem; }
.vms-badge-meta div { display: flex; justify-content: space-between; padding: .3rem 0; border-bottom: 1px dashed var(--vms-border); }
.vms-badge-meta span:first-child { color: var(--vms-text-muted); }
.vms-badge-qr { width: 150px; height: 150px; margin: .5rem auto 0; }
.vms-badge-foot { text-align: center; font-size: .72rem; color: var(--vms-text-muted); padding-bottom: 1.25rem; }

/* Compact print stock (CR80 credit-card size) needs everything scaled down to fit. */
.vms-badge[data-badge-size="cr80"] { border-radius: 10px; }
.vms-badge[data-badge-size="cr80"] .vms-badge-head { padding: .5rem .7rem; gap: .4rem; font-size: .78rem; }
.vms-badge[data-badge-size="cr80"] .vms-badge-body { padding: .6rem; }
.vms-badge[data-badge-size="cr80"] .vms-badge-photo { width: 52px; height: 52px; border-radius: 8px; margin-bottom: .4rem; }
.vms-badge[data-badge-size="cr80"] .vms-avatar-sm { width: 40px; height: 40px; font-size: .85rem; margin-bottom: .4rem; }
.vms-badge[data-badge-size="cr80"] .vms-badge-name { font-size: .88rem; }
.vms-badge[data-badge-size="cr80"] .vms-badge-type { font-size: .62rem; padding: .1rem .5rem; }
.vms-badge[data-badge-size="cr80"] .vms-badge-meta { font-size: .62rem; margin: .5rem 0; }
.vms-badge[data-badge-size="cr80"] .vms-badge-meta div { padding: .15rem 0; }
.vms-badge[data-badge-size="cr80"] .vms-badge-qr { width: 64px; height: 64px; }
.vms-badge[data-badge-size="cr80"] .vms-badge-foot { font-size: .55rem; padding-bottom: .5rem; }

.vms-badge[data-badge-size="large"] .vms-badge-photo { width: 150px; height: 150px; }
.vms-badge[data-badge-size="large"] .vms-badge-qr { width: 190px; height: 190px; }

.vms-print-head { display:none; }
@media print {
    .vms-print-head { display:block !important; margin-bottom:1rem; }
    .vms-print-head h2 { font-size:16pt; font-weight:800; margin:0 0 .25rem; }
    .vms-print-head div { font-size:9pt; color:#333; }
    .table { font-size:9pt; }
    .table thead th { background:#eee !important; -webkit-print-color-adjust:exact; }
    .vms-card { border:none !important; box-shadow:none !important; }
    .vms-sidebar, .vms-topbar, .vms-page-head, .vms-noprint { display: none !important; }
    .vms-content, body, .vms-shell { background: #fff !important; padding: 0 !important; }
    .vms-badge { box-shadow: none; border: 1px solid #ccc; }
}

/* ---------- QuickPass-style kiosk ---------- */
.qp-body { --qp-navy:#1b2a6b; --qp-blue:#2f4bd6; --qp-soft:#eef1ff; --qp-ink:#1e2a55;
    min-height:100vh; background:
        radial-gradient(1200px 500px at 80% -10%, #eef1ff 0%, rgba(238,241,255,0) 60%),
        linear-gradient(180deg,#fbfcff 0%, #f4f6fd 100%);
    color:var(--qp-ink); display:flex; flex-direction:column; position:relative; overflow-x:hidden; }
.qp-body::before { content:''; position:absolute; inset:0; pointer-events:none;
    background-image:linear-gradient(115deg, transparent 49.7%, #e6e9f7 49.7%, #e6e9f7 50%, transparent 50.3%),
                     linear-gradient(65deg, transparent 49.8%, #e9ecf9 49.8%, #e9ecf9 50%, transparent 50.2%);
    background-size:520px 520px, 380px 380px; opacity:.5; }
.qp-nav { display:flex; align-items:center; justify-content:space-between; padding:1.1rem 2.5rem;
    background:rgba(255,255,255,.9); backdrop-filter:blur(6px); position:relative; z-index:2; }
.qp-brand { display:flex; align-items:center; gap:.55rem; font-weight:800; font-size:1.35rem; color:var(--qp-navy); text-decoration:none; }
.qp-brand .qp-logo { width:34px; height:34px; border-radius:9px; background:linear-gradient(135deg,var(--qp-navy),var(--qp-blue)); color:#fff; display:inline-flex; align-items:center; justify-content:center; font-size:.85rem; font-weight:800; }
.qp-nav-links { display:flex; align-items:center; gap:2rem; }
.qp-nav-links a { color:var(--qp-ink); font-weight:600; font-size:.95rem; text-decoration:none; opacity:.85; }
.qp-nav-links a:hover, .qp-nav-links a.active { color:var(--qp-navy); opacity:1; }
.qp-login { background:linear-gradient(135deg,var(--qp-navy),var(--qp-blue)); color:#fff !important; padding:.6rem 1.5rem; border-radius:30px; box-shadow:0 8px 20px rgba(27,42,107,.28); }

.qp-main { flex:1; display:flex; align-items:center; position:relative; z-index:1; padding:2rem 2.5rem 3rem; }
.qp-hero { display:grid; grid-template-columns:1fr 1fr; gap:3rem; align-items:center; width:100%; max-width:1200px; margin:0 auto; }
.qp-badge { display:inline-flex; align-items:center; gap:.4rem; background:var(--qp-soft); color:var(--qp-blue);
    font-size:.72rem; font-weight:700; letter-spacing:.08em; text-transform:uppercase; padding:.45rem .9rem; border-radius:30px; }
.qp-title { font-size:3rem; line-height:1.08; font-weight:800; color:var(--qp-navy); letter-spacing:-.02em; margin:1.1rem 0 .9rem; }
.qp-sub { color:#6b7280; font-size:1.05rem; max-width:440px; margin-bottom:1.8rem; }
.qp-field-label { font-size:.72rem; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--qp-navy); display:block; margin-bottom:.5rem; }
.qp-search { display:flex; align-items:center; gap:.7rem; background:#fff; border:1px solid #e3e7f5; border-radius:16px;
    padding:1rem 1.25rem; box-shadow:0 10px 30px rgba(27,42,107,.06); max-width:460px; }
.qp-search svg { color:#9aa3c2; flex-shrink:0; }
.qp-search input { border:none; outline:none; font-size:1.05rem; width:100%; background:transparent; color:var(--qp-ink); }
.qp-actions { display:flex; gap:1rem; margin-top:1.6rem; }
.qp-btn { border:none; border-radius:30px; padding:.9rem 1.6rem; font-weight:700; font-size:1rem; display:inline-flex; align-items:center; gap:.6rem; cursor:pointer; text-decoration:none; }
.qp-btn-cancel { background:#fff; color:var(--qp-ink); border:1px solid #e3e7f5; }
.qp-btn-cancel:hover { background:#f4f6fd; }
.qp-btn-continue { background:linear-gradient(135deg,var(--qp-navy),var(--qp-blue)); color:#fff; box-shadow:0 12px 26px rgba(27,42,107,.28); }
.qp-btn-continue:hover { filter:brightness(1.06); color:#fff; }
.qp-btn-continue .arrow { width:26px; height:26px; border-radius:50%; background:rgba(255,255,255,.22); display:inline-flex; align-items:center; justify-content:center; }
.qp-choice { display:flex; flex-direction:column; gap:1rem; max-width:460px; }
.qp-choice-btn { display:flex; align-items:center; gap:1rem; background:#fff; border:1px solid #e3e7f5; border-radius:18px; padding:1.3rem 1.5rem; text-decoration:none; color:var(--qp-ink); box-shadow:0 10px 30px rgba(27,42,107,.05); transition:all .15s; }
.qp-choice-btn:hover { transform:translateY(-3px); border-color:var(--qp-blue); box-shadow:0 16px 36px rgba(27,42,107,.12); }
.qp-choice-btn .ic { width:54px; height:54px; border-radius:14px; background:var(--qp-soft); color:var(--qp-blue); display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; }
.qp-choice-btn .t { font-weight:700; font-size:1.1rem; color:var(--qp-navy); }
.qp-choice-btn .d { font-size:.88rem; color:#6b7280; }
.qp-choice-btn .go { margin-left:auto; color:var(--qp-blue); }
.qp-error { background:#fee2e2; color:#b91c1c; border-radius:12px; padding:.7rem 1rem; font-size:.9rem; margin-bottom:1rem; max-width:460px; }
.qp-illus-wrap { display:flex; justify-content:center; }

/* Landing page: portal lookup hint + feature row */
.qp-hint { font-size:.8rem; color:#8b93ad; margin-top:.5rem; }
.qp-hint code { background:#eef1ff; color:var(--qp-blue); padding:.1rem .35rem; border-radius:5px; }
.qp-featurerow {
    display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr));
    gap:.7rem; margin-top:2rem; max-width:520px;
}
.qp-feature { display:flex; align-items:center; gap:.6rem; }
.qp-feature .fi {
    width:36px; height:36px; border-radius:10px; flex-shrink:0;
    background:#eef1ff; color:var(--qp-blue);
    display:inline-flex; align-items:center; justify-content:center;
}
.qp-feature strong { display:block; font-size:.85rem; color:var(--qp-navy); }
.qp-feature span:last-child { font-size:.76rem; color:#8b93ad; }

/* Self-registration QR panel (kiosk landing) */
.qp-selfreg { display:flex; justify-content:center; }
.qp-selfreg-card {
    background:#fff; border:1px solid #e3e7f5; border-radius:20px; padding:1.8rem;
    box-shadow:0 18px 45px rgba(27,42,107,.10); text-align:center; max-width:360px;
}
.qp-selfreg-card h2 { font-size:1.35rem; font-weight:800; color:var(--qp-navy); margin:0 0 .4rem; }
.qp-selfreg-card p { font-size:.88rem; color:#6b7280; margin-bottom:1.1rem; }
.qp-qr { width:210px; height:210px; image-rendering:pixelated; border:1px solid #eef1ff; border-radius:12px; padding:.5rem; background:#fff; }
.qp-selfreg-url { font-size:.72rem; color:#9aa3c2; margin-top:.7rem; word-break:break-all; }
.qp-selfreg-warn {
    display:flex; gap:.5rem; text-align:left; margin-top:.9rem;
    background:#fff8ec; border:1px solid #fde9c8; color:#92610a;
    border-radius:10px; padding:.6rem .8rem; font-size:.78rem;
}
.qp-selfreg-note {
    display:flex; gap:.5rem; text-align:left; margin-top:.9rem;
    background:#f0fdf4; border:1px solid #bbf7d0; color:#15803d;
    border-radius:10px; padding:.6rem .8rem; font-size:.78rem;
}
@media (max-width:900px){ .qp-selfreg { order:-1; } }

.qp-card { background:#fff; border-radius:22px; box-shadow:0 25px 60px rgba(27,42,107,.14); padding:2.5rem; width:100%; max-width:520px; }

@media (max-width:900px) {
    .qp-hero { grid-template-columns:1fr; gap:1.5rem; }
    .qp-illus-wrap { order:-1; }
    .qp-title { font-size:2.2rem; }
    .qp-nav { padding:1rem 1.25rem; }
    .qp-main { padding:1.5rem 1.25rem 2.5rem; }
    .qp-nav-links { display:none; }
}

/* Phones: the kiosk form must never scroll sideways. */
@media (max-width:560px) {
    .qp-body { overflow-x:hidden; }
    .qp-main { padding:1rem .75rem 2rem; }
    .qp-card { padding:1.25rem; border-radius:16px; }
    .qp-title { font-size:1.65rem; }
    .qp-search { padding:.75rem .9rem; }
    .qp-actions { flex-direction:column-reverse; }
    .qp-actions .qp-btn { width:100%; justify-content:center; }
    /* accessory rows stack instead of forcing a wide grid */
    .vms-matrow { grid-template-columns:1fr; }
    .vms-matrow .vms-matdel { width:100%; }
    .vms-photo { max-width:100%; }
    .row > [class*="col-"] { min-width:0; }
    input, select, textarea { max-width:100%; }
}

/* ---------- Public kiosk (legacy) ---------- */
.vms-kiosk-body { min-height: 100vh; background: linear-gradient(150deg, var(--vms-primary-dark), var(--vms-primary-2)); display: flex; flex-direction: column; }
.vms-kiosk-top { padding: 1.5rem 2rem; color: #fff; }
.vms-kiosk-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 2rem; }
.vms-kiosk-card { background: #fff; border-radius: 22px; box-shadow: 0 25px 60px rgba(0,0,0,.28); width: 100%; max-width: 560px; padding: 2.5rem; }
.vms-kiosk-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.vms-choice-btn {
    border: 2px solid var(--vms-border); border-radius: 16px; padding: 1.8rem 1rem; text-align: center;
    color: var(--vms-text); transition: all .15s; cursor: pointer; background: #fff;
}
.vms-choice-btn:hover { border-color: var(--vms-primary); background: var(--vms-primary-soft); transform: translateY(-3px); }
.vms-choice-btn .ico { width: 60px; height: 60px; border-radius: 16px; background: var(--vms-primary-soft); color: var(--vms-primary); display: inline-flex; align-items: center; justify-content: center; margin-bottom: .8rem; }
.vms-choice-btn .t { font-weight: 700; font-size: 1.05rem; }
.vms-choice-btn .d { font-size: .82rem; color: var(--vms-text-muted); margin-top: .25rem; }

@media (max-width: 520px) { .vms-kiosk-choice { grid-template-columns: 1fr; } }

/* Login demo hint (kiosk-style pages) */
/* ---------- Public landing page: sections below the hero ---------- */
.qp-page { width:100%; max-width:1200px; margin:0 auto; }
.qp-section { padding:5rem 0 0; }
.qp-section-head { text-align:center; max-width:640px; margin:0 auto 3rem; }
.qp-eyebrow { display:inline-block; color:var(--qp-blue); font-weight:800; font-size:.76rem;
    letter-spacing:.12em; text-transform:uppercase; margin-bottom:.7rem; }
.qp-section-head h2 { font-size:2rem; font-weight:800; color:var(--qp-navy); letter-spacing:-.02em; margin:0; }

.qp-steps { display:grid; grid-template-columns:repeat(3,1fr); gap:1.75rem; }
.qp-step { background:#fff; border:1px solid #e3e7f5; border-radius:20px; padding:2rem 1.75rem;
    box-shadow:0 10px 30px rgba(27,42,107,.05); position:relative; }
.qp-step-no { width:44px; height:44px; border-radius:50%; display:flex; align-items:center; justify-content:center;
    background:linear-gradient(135deg,var(--qp-navy),var(--qp-blue)); color:#fff; font-weight:800; font-size:1.15rem;
    margin-bottom:1.1rem; box-shadow:0 8px 18px rgba(27,42,107,.28); }
.qp-step h3 { font-size:1.2rem; font-weight:800; color:var(--qp-navy); margin:0 0 .5rem; }
.qp-step p { font-size:.92rem; color:#6b7280; margin:0; line-height:1.55; }

.qp-cap-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:1.5rem; }
.qp-cap-card { background:#fff; border:1px solid #e3e7f5; border-radius:18px; padding:1.6rem;
    transition:transform .15s, box-shadow .15s; }
.qp-cap-card:hover { transform:translateY(-3px); box-shadow:0 16px 36px rgba(27,42,107,.1); border-color:#d5ddf6; }
.qp-cap-card .ic { width:46px; height:46px; border-radius:13px; background:var(--qp-soft); color:var(--qp-blue);
    display:inline-flex; align-items:center; justify-content:center; margin-bottom:1rem; }
.qp-cap-card h3 { font-size:1.02rem; font-weight:700; color:var(--qp-navy); margin:0 0 .4rem; }
.qp-cap-card p { font-size:.86rem; color:#6b7280; margin:0; line-height:1.5; }

.qp-cta { text-align:center; background:linear-gradient(135deg,var(--qp-navy),var(--qp-blue)); border-radius:28px;
    padding:3.2rem 2rem; color:#fff; margin-top:5rem; box-shadow:0 25px 60px rgba(27,42,107,.25); }
.qp-cta h2 { font-size:1.7rem; font-weight:800; margin:0 0 .6rem; }
.qp-cta p { color:#c7d1ff; margin:0 0 1.6rem; font-size:.98rem; }
.qp-cta .qp-search { max-width:420px; margin:0 auto; }

.qp-footer { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:1rem;
    padding:2.5rem 0 3rem; margin-top:2rem; border-top:1px solid #e3e7f5; font-size:.85rem; color:#9aa3c2; }
.qp-footer a { color:var(--qp-navy); font-weight:600; text-decoration:none; }
.qp-footer a:hover { color:var(--qp-blue); }

@media (max-width:900px) {
    .qp-steps, .qp-cap-grid { grid-template-columns:1fr; }
    .qp-section { padding-top:3.5rem; }
    .qp-section-head h2 { font-size:1.6rem; }
}

/* ---------- Theme presets (set via <html data-theme="â€¦">) ---------- */
[data-theme="corporate"] { --vms-primary:#2f4bd6; --vms-primary-dark:#1b2a6b; --vms-primary-soft:#eef1ff; --vms-primary-2:#4f6ae8;
    --vms-sidebar-bg:#101a3d; --vms-content-bg:#f4f6fd; }
[data-theme="violet"]  { --vms-primary:#8b5cf6; --vms-primary-dark:#7c3aed; --vms-primary-soft:#f5f3ff; --vms-primary-2:#a855f7; }
[data-theme="emerald"] { --vms-primary:#10b981; --vms-primary-dark:#059669; --vms-primary-soft:#ecfdf5; --vms-primary-2:#34d399; }
[data-theme="ocean"]   { --vms-primary:#0ea5e9; --vms-primary-dark:#0284c7; --vms-primary-soft:#f0f9ff; --vms-primary-2:#38bdf8; }
[data-theme="rose"]    { --vms-primary:#f43f5e; --vms-primary-dark:#e11d48; --vms-primary-soft:#fff1f2; --vms-primary-2:#fb7185; }
[data-theme="amber"]   { --vms-primary:#f59e0b; --vms-primary-dark:#d97706; --vms-primary-soft:#fffbeb; --vms-primary-2:#fbbf24; }
[data-theme="slate"]   { --vms-primary:#475569; --vms-primary-dark:#334155; --vms-primary-soft:#f1f5f9; --vms-primary-2:#64748b; }

/* Light sidebar variant */
[data-sidebar="light"] .vms-sidebar { background:#fff; border-right:1px solid var(--vms-border); }
[data-sidebar="light"] .vms-brand-text { color:#111827; }
[data-sidebar="light"] .vms-section { color:#94a3b8; }
[data-sidebar="light"] .vms-link { color:#475569; }
[data-sidebar="light"] .vms-link:hover { background:var(--vms-primary-soft); color:var(--vms-primary); }
[data-sidebar="light"] .vms-sidebar::-webkit-scrollbar-thumb { background:#cbd5e1; }

/* ---------- Theme swatch picker ---------- */
.vms-theme-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:.9rem; }
.vms-theme-opt { position:relative; cursor:pointer; }
.vms-theme-opt input { position:absolute; opacity:0; }
.vms-theme-card {
    border:2px solid var(--vms-border); border-radius:14px; padding:1rem; transition:all .15s; background:#fff;
}
.vms-theme-opt input:checked + .vms-theme-card { border-color:var(--swatch); box-shadow:0 0 0 3px color-mix(in srgb, var(--swatch) 22%, transparent); }
.vms-theme-swatch { height:38px; border-radius:9px; background:linear-gradient(135deg, var(--swatch), var(--swatch2)); margin-bottom:.6rem; }
.vms-theme-name { font-weight:600; font-size:.88rem; display:flex; align-items:center; gap:.35rem; }
.vms-theme-opt input:checked + .vms-theme-card .vms-theme-name::after { content:'âœ“'; color:var(--swatch); font-weight:800; }

/* ---------- Fancy form pages ---------- */
.vms-form-card { background:#fff; border:1px solid var(--vms-border); border-radius:var(--vms-radius); box-shadow:var(--vms-shadow); overflow:hidden; }
.vms-form-hero {
    background:linear-gradient(120deg, var(--vms-primary), var(--vms-primary-2)); color:#fff;
    padding:1.4rem 1.6rem; display:flex; align-items:center; gap:1rem;
}
.vms-form-hero .fh-ico { width:52px; height:52px; border-radius:13px; background:rgba(255,255,255,.2); display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.vms-form-hero h1 { font-size:1.25rem; font-weight:700; margin:0; }
.vms-form-hero .sub { opacity:.9; font-size:.85rem; margin-top:.15rem; }
.vms-form-body { padding:1.6rem; }
.vms-form-section { margin-bottom:1.6rem; }
.vms-form-section:last-child { margin-bottom:0; }
.vms-form-section-title {
    font-size:.72rem; text-transform:uppercase; letter-spacing:.06em; font-weight:700; color:var(--vms-primary);
    display:flex; align-items:center; gap:.45rem; margin-bottom:.9rem; padding-bottom:.5rem; border-bottom:1px solid var(--vms-border);
}
.vms-form-actions {
    display:flex; gap:.6rem; justify-content:flex-end; padding:1.1rem 1.6rem; border-top:1px solid var(--vms-border); background:#fbfbfe;
}
.vms-tips { background:var(--vms-primary-soft); border-radius:12px; padding:1.1rem 1.25rem; font-size:.86rem; }
.vms-tips h3 { font-size:.9rem; font-weight:700; margin:0 0 .5rem; display:flex; align-items:center; gap:.4rem; }
.vms-tips ul { margin:0; padding-left:1.1rem; color:var(--vms-text-muted); }
.vms-tips li { margin-bottom:.35rem; }

/* Logo dropzone */
.vms-logo-drop {
    border:2px dashed #d7dbf0; border-radius:14px; min-height:150px; padding:1rem;
    display:flex; align-items:center; justify-content:center; cursor:pointer; color:var(--vms-primary);
    transition:all .15s; background:#fbfbff; text-align:center;
}
.vms-logo-drop:hover, .vms-logo-drop.drag { border-color:var(--vms-primary); background:var(--vms-primary-soft); }
.vms-logo-drop img { max-width:120px; max-height:120px; border-radius:12px; object-fit:cover; }

/* Branding live preview */
.vms-preview-panel { background:linear-gradient(160deg,#f7f8fd,#eef1fb); border:1px solid var(--vms-border); border-radius:var(--vms-radius); padding:1.4rem; height:100%; }
.vms-preview-label { font-size:.7rem; text-transform:uppercase; letter-spacing:.08em; font-weight:700; color:var(--vms-text-muted); margin-bottom:1rem; }
.vms-prev-logo { width:38px; height:38px; border-radius:11px; background:linear-gradient(135deg,var(--vms-primary),var(--vms-primary-2)); color:#fff; display:inline-flex; align-items:center; justify-content:center; font-weight:800; font-size:.85rem; flex-shrink:0; }
.vms-prev-logo.sm { width:26px; height:26px; border-radius:7px; font-size:.7rem; }
.vms-prev-logo-img { width:38px; height:38px; border-radius:11px; object-fit:cover; flex-shrink:0; }
.vms-prev-logo-img.sm { width:26px; height:26px; border-radius:7px; }
.vms-prev-name { font-weight:700; color:#fff; }
.vms-prev-name.dark { color:var(--vms-text); }
.vms-prev-sidebar { display:flex; align-items:center; gap:.65rem; background:var(--vms-sidebar-bg); border-radius:12px; padding:.9rem 1.1rem; margin-bottom:1rem; }
.vms-prev-badge { background:#fff; border:1px solid var(--vms-border); border-radius:14px; overflow:hidden; margin-bottom:1rem; box-shadow:var(--vms-shadow); }
.vms-prev-badge-head { background:linear-gradient(135deg,var(--vms-primary),var(--vms-primary-2)); color:#fff; padding:.6rem .9rem; display:flex; align-items:center; gap:.5rem; font-weight:700; font-size:.9rem; }
.vms-prev-badge-body { padding:1rem; text-align:center; }
.vms-prev-avatar { width:48px; height:48px; border-radius:50%; background:linear-gradient(135deg,var(--vms-primary),var(--vms-primary-2)); color:#fff; display:inline-flex; align-items:center; justify-content:center; font-weight:700; margin-bottom:.4rem; }
.vms-prev-login { display:flex; align-items:center; gap:.65rem; background:#fff; border:1px solid var(--vms-border); border-radius:12px; padding:.9rem 1.1rem; }

/* =====================================================================
   ENTERPRISE CONSOLE REFINEMENT
   Denser layout, collapsible nav, restrained colour, richer tables.
   ===================================================================== */

/* ---- Collapsible sidebar groups ---- */
.vms-navgroup { border: none; }
.vms-navgroup > summary {
    list-style: none; cursor: pointer;
    display: flex; align-items: center; gap: .6rem;
    padding: .5rem .85rem; margin: .1rem 0;
    font-size: .74rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
    color: #64748b; border-radius: 8px; user-select: none;
}
.vms-navgroup > summary::-webkit-details-marker { display: none; }
.vms-navgroup > summary:hover { color: #cbd5e1; background: rgba(148,163,184,.07); }
.vms-navgroup > summary .chev { margin-left: auto; transition: transform .15s; opacity: .6; }
.vms-navgroup[open] > summary .chev { transform: rotate(90deg); }
.vms-navgroup[open] > summary { color: #94a3b8; }
.vms-navgroup .vms-link { padding-left: 1.6rem; font-size: .875rem; }
[data-sidebar="light"] .vms-navgroup > summary { color: #94a3b8; }
[data-sidebar="light"] .vms-navgroup > summary:hover { color: var(--vms-primary); background: var(--vms-primary-soft); }

.vms-sidebar { width: 236px; }
.vms-link { padding: .48rem .85rem; margin: .06rem 0; }
.vms-nav { padding: .4rem .6rem 2rem; }

/* ---- Page container: cap width so content isn't marooned ---- */
.vms-content { padding: 1.4rem 1.6rem; max-width: 1320px; }

/* ---- KPI strip (compact, replaces oversized tiles on list pages) ---- */
.vms-kpi {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0; margin-bottom: 1.1rem;
    background: #fff; border: 1px solid var(--vms-border); border-radius: 12px; overflow: hidden;
}
.vms-kpi > div { padding: .85rem 1.1rem; border-right: 1px solid var(--vms-border); }
.vms-kpi > div:last-child { border-right: none; }
.vms-kpi .k { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--vms-text-muted); font-weight: 600; }
.vms-kpi .v { font-size: 1.4rem; font-weight: 700; line-height: 1.15; margin-top: .15rem; letter-spacing: -.02em; }
.vms-kpi .v small { font-size: .8rem; font-weight: 600; color: var(--vms-text-muted); margin-left: .25rem; }

/* ---- Harmonised stat tiles: one accent, neutral surface ---- */
.vms-stats { gap: .9rem; margin-bottom: 1.2rem; }
.vms-stat { padding: 1rem 1.1rem; gap: .9rem; border-radius: 12px; }
.vms-stat-ico {
    width: 42px; height: 42px; border-radius: 10px;
    background: var(--vms-primary-soft) !important; color: var(--vms-primary) !important;
}
.vms-stat .v { font-size: 1.5rem; }
.vms-stat .l { font-size: .8rem; margin-top: .25rem; }
/* semantic variants â€” colour only where it carries meaning */
.vms-stat-ico.ok   { background: #dcfce7 !important; color: #16a34a !important; }
.vms-stat-ico.warn { background: #fef3c7 !important; color: #b45309 !important; }
.vms-stat-ico.info { background: #e0f2fe !important; color: #0369a1 !important; }

/* ---- Table toolbar + denser rows ---- */
.vms-card-head { padding: .85rem 1.1rem; }
.vms-card-head .title { font-size: .95rem; }
.vms-toolbar { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.vms-toolbar .form-select, .vms-toolbar .form-control { font-size: .85rem; padding: .38rem .65rem; }

.table thead th {
    position: sticky; top: 0; z-index: 2;
    background: #f8fafc; padding: .6rem 1.1rem; font-size: .7rem;
    border-bottom: 1px solid var(--vms-border);
}
.table td { padding: .65rem 1.1rem; font-size: .89rem; }
.table tbody tr:nth-child(even) td { background: #fcfcfe; }
.table-hover tbody tr:hover td { background: var(--vms-primary-soft); }
.vms-avatar-sm { width: 30px; height: 30px; font-size: .7rem; }
.vms-cell-user { gap: .55rem; }
.vms-cell-user .nm { font-size: .89rem; }
.vms-cell-user .sub { font-size: .74rem; }
.vms-act { width: 30px; height: 30px; border-radius: 7px; }
.badge-status { font-size: .68rem; padding: .28em .6em; }

/* Table footer: record count / pagination */
.vms-table-foot {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: .65rem 1.1rem; border-top: 1px solid var(--vms-border);
    font-size: .8rem; color: var(--vms-text-muted); background: #fcfcfe;
}

/* Compact page header */
.vms-page-head { margin-bottom: 1.1rem; }
.vms-page-head h1 { font-size: 1.3rem; }
.vms-breadcrumb { font-size: .78rem; }

/* Platform-admin impersonation banner */
.vms-impersonation-bar {
    display:flex; align-items:center; gap:.6rem; margin-bottom:1.25rem;
    background:#fff8ec; border:1px solid #fde9c8; color:#92610a;
    border-radius:12px; padding:.7rem 1.1rem; font-size:.88rem;
}
.vms-impersonation-bar a { color:#92610a; font-weight:700; text-decoration:underline; }

/* Tabs */
.vms-tabs { display:flex; gap:.35rem; border-bottom:1px solid var(--vms-border); margin-bottom:1.5rem; flex-wrap:wrap; }
.vms-tab {
    padding:.6rem 1.1rem; border:none; background:none; color:var(--vms-text-muted); font-weight:600; font-size:.9rem;
    border-bottom:2px solid transparent; margin-bottom:-1px; display:flex; align-items:center; gap:.45rem;
}
.vms-tab:hover { color:var(--vms-primary); }
.vms-tab.active { color:var(--vms-primary); border-bottom-color:var(--vms-primary); }

/* ---------- Responsive ---------- */
@media (max-width: 992px) {
    .vms-auth-visual { display: none; }
}
@media (max-width: 900px) {
    .vms-sidebar { position: fixed; left: -270px; z-index: 40; transition: left .2s; box-shadow: var(--vms-shadow-md); }
    .vms-sidebar.open { left: 0; }
    .vms-burger { display: inline-flex; }
    .vms-search { display: none; }
    .vms-content { padding: 1.1rem; }
}

/* Template HTML editor */
.vms-code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size:.8rem; line-height:1.5; tab-size:2; }
