/* ───────────────── SAFE PeopleSphere design system ───────────────── */
:root {
    --primary: #2f6fd6; --primary-600: #2459b3; --accent: #c8102e;
    --ink: #0f172a; --ink-2: #334155; --muted: #64748b; --line: #e6eaf2;
    --bg: #f4f6fb; --card: #ffffff; --side: #0d1a3a; --side-2: #13244d; --side-text: #b8c4e0;
    --radius: 16px; --shadow: 0 1px 2px rgba(16,24,40,.04), 0 6px 24px rgba(16,24,40,.06);
    --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
html, body { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 14px; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-600); }
.btn { border-radius: 10px; font-weight: 600; font-size: 13.5px; padding: .5rem .95rem; }
.btn-sm { padding: .3rem .6rem; font-size: 12.5px; border-radius: 8px; }
.btn-primary { background: var(--primary); border-color: var(--primary); box-shadow: 0 4px 14px rgba(47,111,214,.25); }
.btn-primary:hover, .btn-primary:focus { background: var(--primary-600); border-color: var(--primary-600); }
.btn-light { background: #fff; border: 1px solid var(--line); color: var(--ink-2); }
.btn-light:hover { background: #f8fafc; border-color: #d5dbe7; }
.btn-light.active { background: #eef3fd; border-color: var(--primary); color: var(--primary); }
.form-control, .form-select { border-radius: 10px; border-color: #dbe1ec; padding: .55rem .8rem; font-size: 14px; }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(47,111,214,.12); }
.form-label { font-weight: 600; font-size: 12.5px; color: var(--ink-2); margin-bottom: .3rem; }
.form-control-sm, .form-select-sm { padding: .3rem .55rem; font-size: 12.5px; }

/* ── Shell ── */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 264px; background: linear-gradient(180deg, var(--side) 0%, #0a1430 100%); color: var(--side-text); position: fixed; inset: 0 auto 0 0; z-index: 1030; display: flex; flex-direction: column; transition: transform .25s; }
[dir=rtl] .sidebar { inset: 0 0 0 auto; }
.brand { padding: 16px 18px; display: flex; align-items: center; gap: 10px; }
.brand-logo { background: #fff; border-radius: 12px; padding: 7px 10px; display: flex; align-items: center; width: 100%; }
.brand-logo img { height: 30px; max-width: 100%; object-fit: contain; }
.brand-product { padding: 0 20px 10px; font-weight: 800; letter-spacing: .2px; color: #fff; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.brand-product small { display: block; font-weight: 500; color: #8ea0c8; font-size: 11px; letter-spacing: .3px; }
.side-scroll { overflow-y: auto; flex: 1; padding: 4px 12px 20px; scrollbar-width: thin; scrollbar-color: #2b3b66 transparent; }
.side-section { text-transform: uppercase; font-size: 10.5px; letter-spacing: 1.2px; color: #6f81ab; padding: 16px 10px 6px; font-weight: 700; }
.side-link { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 10px; color: var(--side-text); font-weight: 500; font-size: 13.5px; margin-bottom: 1px; }
.side-link i { font-size: 16px; width: 20px; text-align: center; color: #8ea0c8; }
.side-link:hover { background: var(--side-2); color: #fff; }
.side-link.active { background: linear-gradient(90deg, rgba(47,111,214,.35), rgba(47,111,214,.08)); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.side-link.active i { color: #fff; }
.side-foot { padding: 12px 18px; font-size: 11px; color: #6f81ab; border-top: 1px solid #1b2a52; }
.main { flex: 1; margin-left: 264px; min-width: 0; }
[dir=rtl] .main { margin-left: 0; margin-right: 264px; }
.topbar { height: 64px; background: rgba(255,255,255,.85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: 12px; padding: 0 24px; }
.global-search { position: relative; flex: 1; max-width: 520px; }
.global-search input { padding-left: 38px; background: #f3f5fa; border-color: transparent; }
[dir=rtl] .global-search input { padding-left: .8rem; padding-right: 38px; }
.global-search > i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
[dir=rtl] .global-search > i { left: auto; right: 13px; }
.search-results { position: absolute; top: 110%; left: 0; right: 0; background: #fff; border-radius: 12px; box-shadow: 0 12px 40px rgba(16,24,40,.16); display: none; max-height: 420px; overflow: auto; z-index: 50; }
.search-results a { display: flex; gap: 10px; align-items: center; padding: 9px 14px; color: var(--ink); border-bottom: 1px solid #f1f4f9; }
.search-results a:hover { background: #f6f8fd; }
.top-icon { width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-2); position: relative; border: 1px solid var(--line); background: #fff; }
.top-icon:hover { background: #f6f8fd; }
.top-icon .dot-count { position: absolute; top: -4px; right: -4px; background: var(--accent); color: #fff; font-size: 10px; border-radius: 10px; padding: 1px 5px; font-weight: 700; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 4px 10px 4px 4px; border-radius: 30px; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.user-chip small { display: block; color: var(--muted); font-size: 11px; line-height: 1.1; }
.content { padding: 24px 28px 48px; max-width: 1600px; }
.notif-menu { width: 360px; max-height: 460px; overflow: auto; }
.notif-item { padding: 10px 14px; border-bottom: 1px solid #f1f4f9; display: block; color: var(--ink); }
.notif-item.unread { background: #f3f7ff; }
.burger { display: none; }
@media (max-width: 991px) {
    .sidebar { transform: translateX(-100%); } .sidebar.open { transform: none; }
    [dir=rtl] .sidebar { transform: translateX(100%); } [dir=rtl] .sidebar.open { transform: none; }
    .main, [dir=rtl] .main { margin: 0; } .burger { display: inline-flex; } .content { padding: 16px; } .user-chip span { display: none; }
}

/* ── Page building blocks ── */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-title { font-size: 24px; font-weight: 800; letter-spacing: -.3px; margin: 0; }
.page-sub { color: var(--muted); margin-top: 3px; }
.back-link { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.card-x { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid rgba(230,234,242,.7); }
.card-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card-head h6, .card-title-x { font-weight: 700; margin: 0 0 10px; font-size: 14.5px; }
.card-head h6 { margin: 0; }
.form-section { font-weight: 700; font-size: 15px; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px dashed var(--line); }
.empty { text-align: center; color: var(--muted); padding: 30px !important; }
.clickable { cursor: pointer; }
.code { font-family: ui-monospace, Consolas, monospace; font-size: 12px; background: #0d1a3a; color: #cfe0ff; padding: 12px 14px; border-radius: 10px; white-space: pre-wrap; display: block; }
span.code { display: inline; padding: 1px 6px; background: #eef2fa; color: var(--ink-2); }
.secret { filter: blur(4px); cursor: pointer; } .secret.show { filter: none; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; }

.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.kpi { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; display: flex; gap: 14px; align-items: center; position: relative; overflow: hidden; border: 1px solid rgba(230,234,242,.7); }
.kpi::after { content: ""; position: absolute; right: -30px; top: -30px; width: 100px; height: 100px; border-radius: 50%; background: var(--c); opacity: .07; }
.kpi > i { width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 21px; color: var(--c); background: color-mix(in srgb, var(--c) 12%, white); flex-shrink: 0; }
.kpi b { display: block; font-size: 22px; font-weight: 800; letter-spacing: -.4px; line-height: 1.15; }
.kpi span { color: var(--muted); font-size: 12.5px; font-weight: 500; }
a.kpi { color: inherit; } a.kpi:hover { transform: translateY(-2px); transition: .2s; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 6px 13px; border-radius: 30px; background: #fff; border: 1px solid var(--line); color: var(--ink-2); font-weight: 600; font-size: 12.5px; }
.chip b { margin-left: 4px; color: var(--muted); }
.chip.active { background: var(--primary); color: #fff; border-color: var(--primary); } .chip.active b { color: #dbe7ff; }
.input-icon { position: relative; } .input-icon i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); } .input-icon input { padding-left: 34px; }

.badge-soft { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 700; letter-spacing: .2px; white-space: nowrap; }
.badge-soft.success { background: #e7f8ee; color: #15803d; } .badge-soft.danger { background: #fdecee; color: #be123c; }
.badge-soft.warning { background: #fff6e0; color: #b45309; } .badge-soft.info { background: #e8f1fe; color: #1d4ed8; }
.badge-soft.muted { background: #eef1f6; color: #475569; } .badge-soft.primary { background: #e8f0fd; color: var(--primary); }

.table-x { margin: 0; }
.table-x thead th { background: #f8fafd; color: var(--muted); font-weight: 700; font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; border-bottom: 1px solid var(--line); padding: 11px 14px; white-space: nowrap; }
.table-x td { padding: 11px 14px; vertical-align: middle; border-color: #f0f3f8; }
.table-x tbody tr:hover { background: #fafbfe; }
.card-x > .table-x thead th:first-child, .card-x .table-responsive > .table-x thead th:first-child { border-top-left-radius: var(--radius); }

.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 13px; object-fit: cover; flex-shrink: 0; }
.avatar-lg { width: 52px; height: 52px; font-size: 17px; } .avatar-xl { width: 96px; height: 96px; font-size: 30px; }
.avatar.ring { box-shadow: 0 0 0 5px #fff, 0 6px 20px rgba(0,0,0,.15); }

.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; margin: 0; } .kv dt { color: var(--muted); font-weight: 500; } .kv dd { margin: 0; font-weight: 600; }
.kv-3 { grid-template-columns: repeat(3, 140px 1fr); } .kv-sm { grid-template-columns: 90px 1fr; font-size: 12.5px; gap: 3px 10px; }
@media (max-width: 1200px) { .kv-3 { grid-template-columns: 150px 1fr; } }

/* ── Employees ── */
.emp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.emp-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; color: var(--ink); display: flex; flex-direction: column; gap: 3px; border: 1px solid transparent; transition: .2s; }
.emp-card:hover { border-color: #cfdcf6; transform: translateY(-3px); color: var(--ink); box-shadow: 0 12px 30px rgba(47,111,214,.12); }
.emp-card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.emp-name { font-weight: 700; font-size: 15px; } .emp-role { color: var(--primary); font-weight: 600; font-size: 12.5px; margin-bottom: 6px; }
.emp-meta { color: var(--muted); font-size: 12.5px; } .emp-foot { display: flex; justify-content: space-between; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 12px; color: var(--muted); font-weight: 600; }
.profile-hero { overflow: hidden; }
.profile-cover { height: 110px; background: radial-gradient(circle at 20% 20%, rgba(255,255,255,.25), transparent 40%), linear-gradient(120deg, var(--primary), #6a3fd6 55%, var(--accent)); }
.profile-body { display: flex; gap: 20px; padding: 0 24px 20px; align-items: flex-end; margin-top: -42px; flex-wrap: wrap; }
.profile-body h2 { font-size: 22px; font-weight: 800; }
.nav-tabs-x { display: flex; gap: 4px; list-style: none; padding: 4px; margin: 0 0 16px; background: #fff; border-radius: 12px; box-shadow: var(--shadow); width: fit-content; flex-wrap: wrap; }
.nav-tabs-x button { border: 0; background: transparent; padding: 8px 16px; border-radius: 9px; font-weight: 600; color: var(--muted); }
.nav-tabs-x button.active { background: var(--primary); color: #fff; }
.nav-tabs-x .count { background: rgba(0,0,0,.08); border-radius: 10px; padding: 0 7px; font-size: 11px; margin-left: 4px; }
.nav-pills .nav-link { color: var(--ink-2); font-weight: 600; border-radius: 10px; } .nav-pills .nav-link i { margin-right: 6px; }
.nav-pills .nav-link.active { background: #eef3fd; color: var(--primary); }

.org-wrap { overflow: auto; }
.org-tree, .org-tree ul { list-style: none; padding-left: 28px; position: relative; margin: 0; }
.org-tree { padding-left: 0; }
.org-tree li { position: relative; padding: 6px 0 6px 18px; }
.org-tree ul li::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; border-left: 2px solid #dbe3f3; }
.org-tree ul li::after { content: ""; position: absolute; left: 0; top: 30px; width: 18px; border-top: 2px solid #dbe3f3; }
.org-tree ul li:last-child::before { height: 30px; }
.org-node { display: inline-flex; gap: 10px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 8px 14px 8px 8px; color: var(--ink); box-shadow: var(--shadow); position: relative; }
.org-node small { display: block; font-size: 11.5px; color: var(--muted); } .org-node:hover { border-color: var(--primary); }
.org-count { position: absolute; right: -9px; top: -9px; background: var(--accent); color: #fff; border-radius: 10px; font-size: 10px; padding: 1px 6px; font-weight: 700; }

/* ── Attendance ── */
.register { font-size: 12px; } .register th, .register td { text-align: center; padding: 6px 4px !important; }
.register th.we { color: var(--accent); } .register .sticky-col { position: sticky; left: 0; background: #fff; text-align: left; min-width: 190px; z-index: 1; }
.cell { font-weight: 700; } .s-present { color: #15803d; background: #eefbf3; } .s-absent { color: #be123c; background: #fdf0f2; }
.s-halfday { color: #b45309; background: #fff7e6; } .s-leave { color: #6d28d9; background: #f3efff; } .s-holiday { color: #0369a1; background: #e9f6fd; }
.s-weeklyoff { color: #94a3b8; background: #f6f7fa; } .s-notmarked { color: #94a3b8; } .cell.late { box-shadow: inset 0 -3px 0 #f59e0b; }
.feed { max-height: 520px; overflow: auto; } .feed-item { display: flex; gap: 10px; align-items: center; padding: 10px 16px; border-bottom: 1px solid #f1f4f9; }
.live-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #16a34a; margin-right: 6px; box-shadow: 0 0 0 0 rgba(22,163,74,.6); animation: pulse 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(22,163,74,0); } 100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); } }
.punch-card { padding: 26px; text-align: center; background: linear-gradient(160deg, #0d1a3a, #1d3a7a 60%, #2f6fd6); color: #fff; border: 0; }
.punch-clock { font-size: 46px; font-weight: 800; letter-spacing: 1px; font-variant-numeric: tabular-nums; }
.punch-date { opacity: .85; font-weight: 600; }
.punch-map { height: 190px; border-radius: 14px; margin: 16px 0 10px; overflow: hidden; }
.loc-status { font-size: 13px; padding: 6px 12px; border-radius: 20px; background: rgba(255,255,255,.12); display: inline-block; }
.loc-status.ok { background: rgba(22,163,74,.35); } .loc-status.bad { background: rgba(200,16,46,.55); } .loc-status.warn { background: rgba(245,158,11,.45); }
.punch-btn { margin: 18px auto 10px; width: 150px; height: 150px; border-radius: 50%; border: 0; color: #fff; font-weight: 800; font-size: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    background: radial-gradient(circle at 30% 30%, #4ade80, #16a34a); box-shadow: 0 0 0 10px rgba(255,255,255,.08), 0 0 0 20px rgba(255,255,255,.04), 0 18px 40px rgba(0,0,0,.35); transition: .2s; }
.punch-btn i { font-size: 42px; } .punch-btn.out { background: radial-gradient(circle at 30% 30%, #fb7185, #c8102e); }
.punch-btn:hover:not(:disabled) { transform: scale(1.04); } .punch-btn:disabled { opacity: .6; }
.today-punches { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.tp { background: rgba(255,255,255,.14); padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; } .tp.in { box-shadow: inset 3px 0 0 #4ade80; } .tp.out { box-shadow: inset 3px 0 0 #fb7185; }
#cam { width: 100%; border-radius: 12px; margin-top: 10px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-h { text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.cal-d { border-radius: 10px; min-height: 62px; padding: 6px 8px; background: #f7f9fc; position: relative; font-size: 12px; }
.cal-d small { display: block; font-size: 10.5px; opacity: .85; } .cal-d.today { outline: 2px solid var(--primary); }
.late-ico { position: absolute; right: 6px; top: 6px; color: #f59e0b; }
.legend { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin: 0 4px 0 10px; }
.device-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.device.inactive { opacity: .6; } .device-ico { width: 42px; height: 42px; border-radius: 12px; background: #eef3fd; color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 22px; }
.status-dot { width: 11px; height: 11px; border-radius: 50%; } .status-dot.on { background: #16a34a; box-shadow: 0 0 0 4px #dcfce7; } .status-dot.off { background: #cbd5e1; }
.list-row { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-bottom: 1px solid #f1f4f9; cursor: pointer; } .list-row:hover { background: #fafbfe; }

/* ── Leave / Payroll / Recruitment / Performance ── */
.balance-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.balance { padding: 16px; border-top: 4px solid var(--c); } .balance .code { font-size: 11px; font-weight: 800; color: var(--c); background: none; padding: 0; display: inline; }
.balance-num { font-size: 28px; font-weight: 800; margin: 6px 0; } .balance-num small { font-size: 14px; color: var(--muted); font-weight: 600; }
.paper { background: #fff; max-width: 860px; margin: 0 auto; padding: 48px 56px; box-shadow: 0 10px 40px rgba(16,24,40,.12); border-radius: 6px; min-height: 1000px; }
.paper-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 14px; border-bottom: 3px solid var(--primary); }
.paper-head::after { content: ""; } .payslip { min-height: auto; }
.net-box { display: flex; justify-content: space-between; align-items: center; background: linear-gradient(120deg, var(--primary), #6a3fd6); color: #fff; padding: 16px 22px; border-radius: 12px; }
.slip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.slip-card { display: flex; gap: 14px; align-items: center; padding: 14px; color: var(--ink); } .slip-card:hover { color: var(--ink); border-color: var(--primary); }
.slip-month { width: 58px; height: 58px; border-radius: 14px; background: #eef3fd; color: var(--primary); font-weight: 800; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 16px; }
.slip-month small { font-size: 11px; font-weight: 600; color: var(--muted); }
.job-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.funnel { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.f-step { background: #f4f7fd; border-radius: 8px; text-align: center; padding: 6px 2px; } .f-step b { display: block; font-size: 17px; } .f-step span { font-size: 10px; color: var(--muted); font-weight: 600; }
.kanban { display: grid; grid-template-columns: repeat(6, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 10px; }
.kanban-col { background: #eef1f7; border-radius: 14px; padding: 10px; min-height: 420px; transition: .15s; } .kanban-col.over { background: #dfe8fb; outline: 2px dashed var(--primary); }
.kanban-head { display: flex; justify-content: space-between; font-weight: 700; padding: 4px 6px 10px; } .kanban-head .count { background: #fff; border-radius: 10px; padding: 0 8px; font-size: 12px; }
.kanban-card { background: #fff; border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.06); cursor: grab; } .kanban-card.dragging { opacity: .5; }
.careers-hero { background: linear-gradient(120deg, #0d1a3a, var(--primary)); color: #fff; padding: 56px 20px 70px; text-align: center; }
.careers-logo { background: #fff; padding: 10px 16px; border-radius: 12px; height: 64px; margin-bottom: 18px; }

/* ── Dashboard ── */
.hero { border-radius: 20px; padding: 26px 28px; color: #fff; position: relative; overflow: hidden; background: radial-gradient(circle at 85% 20%, rgba(200,16,46,.55), transparent 35%), radial-gradient(circle at 10% 110%, rgba(124,58,237,.5), transparent 40%), linear-gradient(120deg, #0d1a3a, #1e3f8a 60%, var(--primary)); }
.hero h2 { font-weight: 800; font-size: 26px; letter-spacing: -.4px; } .hero .sub { opacity: .85; }
.hero-actions .btn { background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.2); backdrop-filter: blur(4px); }
.hero-actions .btn:hover { background: rgba(255,255,255,.25); }
.mod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.mod-tile { background: #fff; border-radius: 16px; padding: 16px; color: var(--ink); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; border: 1px solid transparent; transition: .2s; position: relative; overflow: hidden; }
.mod-tile::before { content: ""; position: absolute; inset: auto -20px -40px auto; width: 90px; height: 90px; border-radius: 50%; background: var(--c); opacity: .08; }
.mod-tile:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--c) 40%, white); color: var(--ink); }
.mod-tile i { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; color: #fff; background: var(--c); }
.mod-tile b { font-size: 13.5px; } .mod-tile small { color: var(--muted); font-size: 11.5px; line-height: 1.3; }
.mini-list .row-i { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f1f4f9; }
.mini-list .row-i:last-child { border-bottom: 0; }
.ann { border-left: 3px solid var(--primary); padding: 6px 12px; margin-bottom: 10px; background: #f8faff; border-radius: 0 10px 10px 0; }
.ann.High, .ann.Urgent { border-color: var(--accent); background: #fff6f7; }

/* ── Builders ── */
.builder { display: grid; grid-template-columns: 300px 1fr; gap: 16px; }
@media (max-width: 1100px) { .builder { grid-template-columns: 1fr; } }
.palette-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px dashed #cbd5e1; margin-bottom: 8px; cursor: grab; background: #fff; font-weight: 600; }
.palette-item i { width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; color: #fff; }
#drawflow { height: calc(100vh - 230px); min-height: 520px; background-color: #f7f9fd; background-image: radial-gradient(#d8e0ef 1px, transparent 1px); background-size: 22px 22px; border-radius: var(--radius); position: relative; }
#drawflow .drawflow .drawflow-node { background: #fff; border: 2px solid #e2e8f3; border-radius: 14px; padding: 0; width: 210px; box-shadow: 0 6px 18px rgba(16,24,40,.08); color: var(--ink); }
#drawflow .drawflow .drawflow-node.selected { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(47,111,214,.15); background: #fff; }
#drawflow .drawflow .drawflow-node .input, #drawflow .drawflow .drawflow-node .output { width: 16px; height: 16px; border: 3px solid #fff; background: var(--primary); box-shadow: 0 0 0 1px #cbd5e1; }
#drawflow .drawflow .drawflow-node .outputs .output:nth-child(2) { background: var(--accent); }
#drawflow .drawflow .connection .main-path { stroke: #7b93c6; stroke-width: 3px; }
#drawflow .drawflow .connection .main-path:hover, #drawflow .drawflow .connection .main-path.selected { stroke: var(--accent); }
.wf-node { display: flex; flex-direction: column; } .wf-node-head { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 12px 12px 0 0; color: #fff; font-weight: 700; font-size: 12.5px; }
.wf-node-body { padding: 8px 12px; font-size: 12px; color: var(--muted); min-height: 34px; }
.wf-node.current .wf-node-head { animation: glow 1.4s infinite; } @keyframes glow { 50% { filter: brightness(1.25); } }
.wf-legend span { font-size: 11px; margin-right: 10px; } .wf-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; }
.field-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; background: #eef3fd; color: var(--primary); border-radius: 20px; font-size: 12px; font-weight: 600; margin: 3px; cursor: pointer; border: 1px solid transparent; }
.field-pill.on { background: var(--primary); color: #fff; }
.grid-stack { min-height: 400px; }
.grid-stack-item-content { background: #fff; border-radius: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden !important; inset: 6px !important; }
.widget-head { padding: 10px 14px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); font-size: 13px; }
.widget-body { flex: 1; padding: 10px; position: relative; min-height: 0; overflow: auto; }
.widget-kpi { display: flex; flex-direction: column; justify-content: center; height: 100%; padding: 0 10px; } .widget-kpi b { font-size: 36px; font-weight: 800; }
.tox-tinymce { border-radius: 12px !important; }
.placeholder-list { max-height: calc(100vh - 260px); overflow: auto; }
.placeholder-list button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 5px 8px; border-radius: 8px; font-size: 12.5px; }
.placeholder-list button:hover { background: #eef3fd; color: var(--primary); }
.placeholder-list code { font-size: 11px; color: var(--accent); }

/* ── Toasts ── */
.toast-host { position: fixed; top: 76px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
[dir=rtl] .toast-host { right: auto; left: 20px; }
.toast-x { background: #0d1a3a; color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: 0 12px 30px rgba(0,0,0,.25); min-width: 280px; max-width: 420px; display: flex; gap: 10px; align-items: flex-start; animation: slidein .25s; font-weight: 500; }
.toast-x.success i { color: #4ade80; } .toast-x.error i { color: #fb7185; }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } }

/* ── Auth ── */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; background: #fff; }
.auth-art { position: relative; overflow: hidden; color: #fff; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between;
    background: radial-gradient(circle at 80% 15%, rgba(200,16,46,.65), transparent 32%), radial-gradient(circle at 10% 90%, rgba(124,58,237,.55), transparent 38%), linear-gradient(140deg, #08132e 0%, #13306e 55%, #2f6fd6 100%); }
.auth-art::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.12) 1px, transparent 1px); background-size: 26px 26px; mask-image: linear-gradient(180deg, #000, transparent 85%); }
.auth-art > * { position: relative; }
.auth-logo { background: #fff; border-radius: 14px; padding: 10px 16px; display: inline-flex; } .auth-logo img { height: 44px; }
.auth-art h1 { font-size: 44px; font-weight: 800; letter-spacing: -1px; line-height: 1.1; margin: 28px 0 14px; }
.auth-art h1 span { background: linear-gradient(90deg, #fff, #ffb4c0); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-art p.lead { opacity: .85; max-width: 520px; font-size: 16px; }
.auth-features { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 560px; margin-top: 28px; }
.auth-features div { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); padding: 12px 14px; border-radius: 14px; backdrop-filter: blur(6px); font-weight: 600; font-size: 13px; display: flex; gap: 10px; align-items: center; }
.auth-features i { font-size: 18px; color: #ffd1d8; }
.floating { position: absolute; right: 60px; top: 46%; background: rgba(255,255,255,.95); color: var(--ink); border-radius: 16px; padding: 14px 16px; box-shadow: 0 20px 50px rgba(0,0,0,.35); width: 240px; animation: float 5s ease-in-out infinite; }
.floating.two { top: 66%; right: 150px; animation-delay: -2.5s; width: 220px; }
@keyframes float { 50% { transform: translateY(-12px); } }
@media (max-width: 1400px) { .floating { display: none; } }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px; background: linear-gradient(180deg, #fff, #f7f9fd); }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h2 { font-weight: 800; font-size: 30px; letter-spacing: -.5px; }
.auth-card .form-control { padding: .8rem 1rem; border-radius: 12px; }
.auth-card .btn-primary { padding: .8rem; border-radius: 12px; font-size: 15px; background: linear-gradient(90deg, var(--primary), #6a3fd6); border: 0; }
.pw-wrap { position: relative; } .pw-wrap button { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--muted); }
.demo-users { font-size: 12px; background: #f4f7fd; border-radius: 12px; padding: 10px 14px; }
.demo-users button { border: 0; background: #fff; border-radius: 8px; padding: 3px 9px; margin: 3px 3px 0 0; font-size: 12px; font-weight: 600; color: var(--primary); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
@media (max-width: 991px) { .auth { grid-template-columns: 1fr; } .auth-art { display: none; } }

@media print {
    .sidebar, .topbar, .no-print, .toast-host { display: none !important; }
    .main { margin: 0 !important; } .content { padding: 0; } body { background: #fff; }
    .paper { box-shadow: none; padding: 0; min-height: auto; }
}

/* ── Policy documents ── */
.policy-doc { font-size: 15px; line-height: 1.7; max-width: 900px; }
.policy-doc h2 { font-size: 17px; font-weight: 700; color: #1e3a8a; margin: 26px 0 10px; }
.policy-doc table { border-collapse: collapse; margin: 10px 0; } .policy-doc td, .policy-doc th { border: 1px solid var(--line); padding: 6px 10px; }
@media print { .sidebar, .topbar, .back-link, .col-xl-3 { display: none !important; } .main { margin: 0 !important; } .policy-doc { box-shadow: none; border: 0; } }