/* =====================================================================
   CRM design system — clean, professional, theme colour from Settings
   (--p* variables are injected per page from the company theme colour)
   ===================================================================== */
:root {
  --p: #0B6E99; --p-50: #eef6fa; --p-100: #dceef5; --p-200: #c2e0ec; --p-300: #8cc3da; --p-400: #4f9fc1;
  --p-600: #0a6187; --p-700: #085273; --p-800: #06425c; --p-900: #053245; --on-p: #fff;
  --bg: #f4f6f9; --card: #fff; --text: #0f172a; --text-2: #334155; --muted: #64748b; --muted-2: #94a3b8;
  --line: #e5e9f0; --line-2: #eef1f5; --danger: #dc2626; --success: #059669; --warning: #d97706;
  --radius: 12px; --radius-sm: 8px; --shadow: 0 1px 2px rgba(15,23,42,.04), 0 1px 3px rgba(15,23,42,.06);
  --shadow-lg: 0 10px 30px rgba(15,23,42,.12), 0 2px 8px rgba(15,23,42,.06);
  --sidebar-w: 252px; --topbar-h: 62px;
  --font: "Inter", ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--p); text-decoration: none; }
a:hover { color: var(--p-700); }
img { max-width: 100%; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; color: var(--text); }
p { margin: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
[hidden] { display: none !important; }
::selection { background: var(--p-100); }

/* ---------- icons ---------- */
.ic { width: 18px; height: 18px; flex: none; }
.ic-xs { width: 12px; height: 12px; flex: none; }
.ic-sm { width: 15px; height: 15px; flex: none; }
.ic-lg { width: 22px; height: 22px; flex: none; }
.ic-xl { width: 30px; height: 30px; flex: none; }

/* ---------- app shell ---------- */
.app { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 40; transition: transform .25s ease; }
.sidebar.dark { background: #0f172a; border-right-color: #0f172a; }
.sb-brand { height: var(--topbar-h); display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line-2); flex: none; }
.sidebar.dark .sb-brand { border-bottom-color: rgba(255,255,255,.06); }
.sb-logo { width: 36px; height: 36px; border-radius: 10px; background: var(--p); color: var(--on-p); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; overflow: hidden; flex: none; }
.sb-logo.img { background: #fff; border: 1px solid var(--line-2); }
.sb-logo img { width: 100%; height: 100%; object-fit: contain; }
.sb-title { min-width: 0; }
.sb-title b { display: block; font-size: 14px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-title span { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar.dark .sb-title b { color: #fff; }
.sidebar.dark .sb-title span { color: #94a3b8; }
.sb-nav { flex: 1; overflow-y: auto; padding: 10px 10px 16px; scrollbar-width: thin; }
.sb-sec { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2); padding: 14px 10px 6px; }
.sb-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--text-2); font-weight: 500; font-size: 13.5px; margin-bottom: 1px; cursor: pointer; border: 0; background: none; width: 100%; text-align: left; font-family: inherit; }
.sb-link .ic { color: var(--muted); }
.sb-link:hover { background: var(--p-50); color: var(--p-800); }
.sb-link:hover .ic { color: var(--p); }
.sb-link.active { background: var(--p); color: var(--on-p); box-shadow: 0 2px 8px color-mix(in srgb, var(--p) 30%, transparent); }
.sb-link.active .ic { color: var(--on-p); }
.sb-link .sb-badge { margin-left: auto; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: #ef4444; color: #fff; font-size: 10.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.sb-link .chev { margin-left: auto; width: 14px; height: 14px; transition: transform .2s; }
.sb-group.open > .sb-link .chev { transform: rotate(180deg); }
.sb-group.has-active > .sb-link { color: var(--p-700); background: var(--p-50); }
.sb-sub { display: none; margin: 2px 0 4px 18px; padding-left: 10px; border-left: 2px solid var(--p-100); }
.sb-group.open .sb-sub { display: block; }
.sb-sub .sb-link { font-size: 13px; padding: 6px 10px; }
.sidebar.dark .sb-link { color: #cbd5e1; }
.sidebar.dark .sb-link .ic { color: #94a3b8; }
.sidebar.dark .sb-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar.dark .sb-link.active { background: var(--p); color: var(--on-p); }
.sidebar.dark .sb-group.has-active > .sb-link { background: rgba(255,255,255,.06); color: #fff; }
.sidebar.dark .sb-sub { border-left-color: rgba(255,255,255,.1); }
.sb-foot { padding: 12px; border-top: 1px solid var(--line-2); flex: none; }
.sidebar.dark .sb-foot { border-top-color: rgba(255,255,255,.06); }
.sb-user { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; background: var(--p-50); }
.sidebar.dark .sb-user { background: rgba(255,255,255,.06); }
.sb-user b { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user div span { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar.dark .sb-user b { color: #fff; }
.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; height: var(--topbar-h); background: rgba(255,255,255,.92); backdrop-filter: saturate(180%) blur(8px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 0 24px; }
.tb-menu { display: none; }
.tb-welcome { font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-welcome b { color: var(--text); font-weight: 600; }
.tb-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.tb-icon { position: relative; width: 38px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; color: var(--text-2); border: 1px solid transparent; background: transparent; cursor: pointer; }
.tb-icon:hover { background: var(--bg); color: var(--text); }
.tb-dot { position: absolute; top: 4px; right: 4px; min-width: 17px; height: 17px; border-radius: 9px; background: #ef4444; color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 4px; border: 2px solid #fff; }
.tb-user { display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; border-radius: 12px; border: 1px solid transparent; background: none; cursor: pointer; font: inherit; color: var(--text); }
.tb-user:hover { background: var(--bg); }
.tb-user .nm { font-weight: 600; font-size: 13px; max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.content { flex: 1; padding: 24px; width: 100%; max-width: 1480px; }
.content.narrow { max-width: 980px; }
.app-foot { padding: 14px 24px; color: var(--muted-2); font-size: 12px; }
.overlay { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 35; display: none; }
.overlay.show { display: block; }

/* ---------- avatar ---------- */
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--p); color: var(--on-p); display: inline-flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 700; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatar.lg { width: 56px; height: 56px; font-size: 18px; }
.avatar.soft { background: var(--p-100); color: var(--p-700); }

/* ---------- page header ---------- */
.ph { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.ph h1 { font-size: 22px; font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; }
.ph h1 .ic { color: var(--p); width: 24px; height: 24px; }
.ph p { color: var(--muted); font-size: 13.5px; margin-top: 3px; }
.ph-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 500; margin-bottom: 10px; }
.back-link:hover { color: var(--text); }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px 0; flex-wrap: wrap; }
.card-h h3 { font-size: 15px; font-weight: 650; }
.card-h p { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.card-b { padding: 16px 18px; }
.card-b.p0 { padding: 0; }
.card-f { padding: 12px 18px; border-top: 1px solid var(--line-2); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.card + .card { margin-top: 16px; }
.grid > .card + .card, .layout-2 > .card + .card, .layout-3 > .card + .card, .layout-21 > .card + .card, .layout-12 > .card + .card, .stats > .card + .card, .row > .card + .card { margin-top: 0; }
.card.soft { background: var(--p-50); border-color: var(--p-100); box-shadow: none; }
.card.hover:hover { box-shadow: var(--shadow-lg); border-color: var(--p-200); }

/* ---------- stat cards ---------- */
.stats { display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0,1fr)); }
.stats.s3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.stats.s5 { grid-template-columns: repeat(5, minmax(0,1fr)); }
.stats.s6 { grid-template-columns: repeat(6, minmax(0,1fr)); }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; gap: 14px; align-items: flex-start; box-shadow: var(--shadow); min-width: 0; }
.stat .si { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex: none; }
.stat .si .ic { width: 22px; height: 22px; }
.stat .sl { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.stat .sv { font-size: 22px; font-weight: 750; letter-spacing: -.02em; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .ss { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat.mini { padding: 12px 14px; align-items: center; gap: 12px; }
.stat.mini .si { width: 38px; height: 38px; border-radius: 10px; }
.stat.mini .si .ic { width: 19px; height: 19px; }
.stat.mini .sv { font-size: 19px; }
.trend { display: inline-flex; align-items: center; gap: 2px; font-size: 11.5px; font-weight: 600; padding: 1px 6px; border-radius: 20px; margin-left: 6px; }
.trend.up { background: #dcfce7; color: #15803d; }
.trend.down { background: #fee2e2; color: #b91c1c; }
.c-blue { background: #dbeafe; color: #1d4ed8; } .c-green { background: #dcfce7; color: #15803d; } .c-amber { background: #fef3c7; color: #b45309; }
.c-purple { background: #ede9fe; color: #6d28d9; } .c-rose { background: #ffe4e6; color: #be123c; } .c-teal { background: #ccfbf1; color: #0f766e; }
.c-indigo { background: #e0e7ff; color: #4338ca; } .c-orange { background: #ffedd5; color: #c2410c; } .c-gray { background: #f1f5f9; color: #475569; }
.c-p { background: var(--p-100); color: var(--p-700); } .c-yellow { background: #fef9c3; color: #a16207; } .c-sky { background: #e0f2fe; color: #0369a1; } .c-pink { background: #fce7f3; color: #be185d; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px; border-radius: 10px; border: 1px solid transparent; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background .15s, border-color .15s, box-shadow .15s, color .15s; user-select: none; }
.btn:disabled, .btn.disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }
.btn-p { background: var(--p); color: var(--on-p); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.btn-p:hover { background: var(--p-600); color: var(--on-p); }
.btn-o { background: #fff; color: var(--text-2); border-color: var(--line); }
.btn-o:hover { background: #f8fafc; color: var(--text); border-color: #d6dce5; }
.btn-g { background: transparent; color: var(--text-2); }
.btn-g:hover { background: var(--bg); color: var(--text); }
.btn-soft { background: var(--p-50); color: var(--p-700); border-color: var(--p-100); }
.btn-soft:hover { background: var(--p-100); color: var(--p-800); }
.btn-d { background: #dc2626; color: #fff; }
.btn-d:hover { background: #b91c1c; color: #fff; }
.btn-do { background: #fff; color: #dc2626; border-color: #fecaca; }
.btn-do:hover { background: #fef2f2; color: #b91c1c; }
.btn-s { background: #059669; color: #fff; }
.btn-s:hover { background: #047857; color: #fff; }
.btn-wa { background: #16a34a; color: #fff; }
.btn-wa:hover { background: #15803d; color: #fff; }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; gap: 5px; }
.btn-xs { height: 26px; padding: 0 8px; font-size: 12px; border-radius: 7px; gap: 4px; }
.btn-lg { height: 46px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.btn-i { width: 34px; padding: 0; height: 34px; }
.btn-i.btn-sm { width: 30px; height: 30px; }
.btn-block { width: 100%; }
.btn .spin { width: 15px; height: 15px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--p); cursor: pointer; font-weight: 500; }
.link-btn:hover { text-decoration: underline; }

/* ---------- forms ---------- */
.f { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.f > label, .lbl { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.f > label .opt, .lbl .opt { color: var(--muted-2); font-weight: 400; }
.f > label .req { color: #dc2626; }
.hint { font-size: 11.5px; color: var(--muted); }
.in, .sel, .ta { width: 100%; height: 38px; padding: 0 11px; border: 1px solid #d8dee7; border-radius: 9px; background: #fff; font: inherit; font-size: 13.5px; color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s; }
.ta { height: auto; min-height: 76px; padding: 9px 11px; resize: vertical; line-height: 1.5; }
.sel { appearance: none; -webkit-appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m19.5 8.25-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 14px; cursor: pointer; }
.in:focus, .sel:focus, .ta:focus { border-color: var(--p); box-shadow: 0 0 0 3px var(--p-100); }
.in:disabled, .sel:disabled, .ta:disabled { background: #f8fafc; color: var(--muted); }
.in.sm, .sel.sm { height: 32px; font-size: 12.5px; border-radius: 8px; }
.in-wrap { position: relative; }
.in-wrap > .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted-2); pointer-events: none; }
.in-wrap > .in { padding-left: 36px; }
.in-wrap .in-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0,1fr)); }
.span2 { grid-column: span 2; } .span3 { grid-column: span 3; } .span-all { grid-column: 1 / -1; }
.chk { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; color: var(--text-2); user-select: none; }
.chk input, input[type=checkbox].cb { width: 16px; height: 16px; accent-color: var(--p); cursor: pointer; margin: 0; flex: none; }
.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #cbd5e1; border-radius: 22px; transition: .2s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--p); }
.switch input:checked + span::before { transform: translateX(18px); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.toggle-row:last-child { border-bottom: 0; }
.toggle-row b { font-size: 13.5px; font-weight: 600; display: block; }
.toggle-row span { font-size: 12px; color: var(--muted); }
.seg { display: inline-flex; background: #f1f5f9; border-radius: 10px; padding: 3px; gap: 2px; }
.seg button, .seg a { border: 0; background: none; padding: 6px 13px; border-radius: 8px; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg .on { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.color-dots { display: flex; flex-wrap: wrap; gap: 8px; }
.color-dot { width: 30px; height: 30px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px #d5dbe3; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: #fff; padding: 0; }
.color-dot.on { box-shadow: 0 0 0 2px #0f172a; }
.color-dot .ic { width: 14px; height: 14px; }
.upload-box { border: 2px dashed #d5dbe3; border-radius: 12px; padding: 22px; text-align: center; color: var(--muted); cursor: pointer; transition: .15s; background: #fafbfc; }
.upload-box:hover, .upload-box.drag { border-color: var(--p-300); background: var(--p-50); color: var(--p-700); }
.form-section { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding-top: 4px; grid-column: 1 / -1; border-top: 1px solid var(--line-2); padding-top: 14px; margin-top: 4px; }

/* ---------- filters bar ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters .in-wrap { flex: 1; min-width: 220px; max-width: 420px; }
.filters .sel { width: auto; min-width: 150px; }

/* ---------- tables ---------- */
.tw { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #f8fafc; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th:first-child { border-top-left-radius: var(--radius); }
.tbl th:last-child { border-top-right-radius: var(--radius); }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: #fafbfd; }
.tbl tr.sel-row td { background: var(--p-50) !important; }
.tbl tr.click { cursor: pointer; }
.tbl .r { text-align: right; } .tbl .c { text-align: center; }
.tbl .w1 { width: 1%; white-space: nowrap; }
.tbl .t-title { font-weight: 600; color: var(--text); }
.tbl .t-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.tbl .t-code { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; color: var(--p-700); }
.tbl .acts { display: flex; gap: 5px; justify-content: flex-end; }
.tbl-empty { text-align: center; padding: 50px 20px !important; color: var(--muted); }
.tbl-empty .ic { width: 36px; height: 36px; color: #cbd5e1; display: block; margin: 0 auto 10px; }
.bulk-bar { display: none; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--p-50); border: 1px solid var(--p-200); border-radius: 10px; padding: 9px 12px; margin-bottom: 12px; }
.bulk-bar.show { display: flex; }
.bulk-bar b { color: var(--p-800); font-size: 13px; margin-right: 6px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 4px 0; flex-wrap: wrap; }
.pager span { font-size: 12.5px; color: var(--muted); }
.pager .pg { display: flex; gap: 4px; align-items: center; }
.pager .pg a, .pager .pg em { min-width: 32px; height: 32px; padding: 0 9px; border: 1px solid var(--line); background: #fff; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 600; color: var(--text-2); font-style: normal; }
.pager .pg a:hover { border-color: var(--p-300); color: var(--p-700); }
.pager .pg em.cur { background: var(--p); border-color: var(--p); color: var(--on-p); }
.pager .pg .dis { opacity: .45; pointer-events: none; }

/* mobile card list alternative */
.mlist { display: none; }
.mcard { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; margin-bottom: 10px; box-shadow: var(--shadow); }
.mcard .mt { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.mcard .mt b { font-size: 14px; }
.mcard .mm { font-size: 12.5px; color: var(--muted); margin-top: 3px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.mcard .ma { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; line-height: 1.6; white-space: nowrap; }
.b-blue { background: #dbeafe; color: #1e40af; } .b-green { background: #dcfce7; color: #166534; } .b-amber { background: #fef3c7; color: #92400e; }
.b-yellow { background: #fef9c3; color: #854d0e; } .b-red { background: #fee2e2; color: #991b1b; } .b-gray { background: #f1f5f9; color: #475569; }
.b-purple { background: #ede9fe; color: #5b21b6; } .b-indigo { background: #e0e7ff; color: #3730a3; } .b-pink { background: #fce7f3; color: #9d174d; }
.b-orange { background: #ffedd5; color: #9a3412; } .b-teal { background: #ccfbf1; color: #115e59; } .b-p { background: var(--p-100); color: var(--p-800); }
.b-outline { background: #fff; border: 1px solid var(--line); color: var(--text-2); }
select.status-pill { appearance: none; -webkit-appearance: none; border: 0; border-radius: 20px; padding: 3px 24px 3px 10px; font: inherit; font-size: 11.5px; font-weight: 650; cursor: pointer; background-repeat: no-repeat; background-position: right 7px center; background-size: 11px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23334155' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m19.5 8.25-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E"); }
select.status-pill:focus { outline: 2px solid var(--p-200); }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 7px; padding: 10px 14px; border: 0; background: none; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--p-700); border-bottom-color: var(--p); }
.tab .ic { width: 16px; height: 16px; }
.tab-pane { display: none; }
.tab-pane.on { display: block; }

/* ---------- modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 100; display: none; align-items: flex-start; justify-content: center; padding: 5vh 16px; overflow-y: auto; }
.modal-bg.show { display: flex; animation: fade .15s ease; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 560px; box-shadow: 0 25px 60px rgba(0,0,0,.25); animation: pop .18s ease; margin-bottom: 5vh; }
.modal.sm { max-width: 420px; } .modal.lg { max-width: 760px; } .modal.xl { max-width: 980px; }
.modal-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 20px 4px; }
.modal-h h3 { font-size: 17px; font-weight: 700; }
.modal-x { width: 34px; height: 34px; border-radius: 9px; border: 0; background: none; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.modal-x:hover { background: var(--bg); color: var(--text); }
.modal-b { padding: 14px 20px 6px; }
.modal-f { padding: 14px 20px 18px; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; position: sticky; bottom: 0; background: #fff; border-radius: 0 0 16px 16px; z-index: 2; box-shadow: 0 -1px 0 var(--line-2); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- dropdown ---------- */
.dd { position: relative; display: inline-block; }
.dd-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 190px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 60; display: none; }
.dd.open .dd-menu { display: block; animation: pop .12s ease; }
.dd-menu.up { top: auto; bottom: calc(100% + 6px); }
.dd-item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border-radius: 8px; border: 0; background: none; font: inherit; font-size: 13.5px; color: var(--text-2); cursor: pointer; text-align: left; white-space: nowrap; }
.dd-item:hover { background: var(--bg); color: var(--text); }
.dd-item .ic { width: 16px; height: 16px; color: var(--muted); }
.dd-item.danger { color: #dc2626; } .dd-item.danger .ic { color: #dc2626; }
.dd-item.danger:hover { background: #fef2f2; }
.dd-sep { height: 1px; background: var(--line-2); margin: 5px 0; }
.dd-head { padding: 8px 10px 6px; font-size: 12px; color: var(--muted); }

/* ---------- toast ---------- */
.toasts { position: fixed; top: 16px; right: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 32px); }
.toast { min-width: 260px; max-width: 380px; background: #0f172a; color: #fff; border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow-lg); font-size: 13.5px; display: flex; gap: 10px; align-items: flex-start; animation: pop .2s ease; }
.toast b { display: block; font-weight: 600; }
.toast span { display: block; color: #cbd5e1; font-size: 12.5px; margin-top: 1px; white-space: pre-line; }
.toast.err { background: #b91c1c; } .toast.err span { color: #fee2e2; }
.toast.ok { background: #065f46; } .toast.ok span { color: #d1fae5; }
.toast .ic { margin-top: 1px; }

/* ---------- alerts / notes ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: 10px; font-size: 13px; border: 1px solid; }
.alert .ic { margin-top: 1px; }
.alert-info { background: var(--p-50); border-color: var(--p-200); color: var(--p-800); }
.alert-warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-err { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-ok { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.note { font-size: 12px; color: var(--muted); }

/* ---------- empty ---------- */
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .ei { width: 56px; height: 56px; border-radius: 50%; background: #f1f5f9; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; color: #94a3b8; }
.empty b { display: block; color: var(--text-2); font-size: 15px; margin-bottom: 4px; }

/* ---------- timeline ---------- */
.tl { position: relative; }
.tl-item { display: flex; gap: 12px; padding-bottom: 14px; position: relative; }
.tl-item::before { content: ""; position: absolute; left: 15px; top: 34px; bottom: 0; width: 2px; background: var(--line-2); }
.tl-item:last-child::before { display: none; }
.tl-dot { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; z-index: 1; }
.tl-dot .ic { width: 16px; height: 16px; }
.tl-body { flex: 1; min-width: 0; background: #f8fafc; border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 12px; }
.tl-body .tl-k { font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 3px; }
.tl-body p { font-size: 13.5px; color: var(--text); white-space: pre-line; word-break: break-word; }
.tl-body .tl-m { font-size: 11.5px; color: var(--muted); margin-top: 5px; }

/* ---------- progress / steps ---------- */
.prog { height: 8px; background: #eef2f6; border-radius: 10px; overflow: hidden; }
.prog > i { display: block; height: 100%; background: var(--p); border-radius: 10px; transition: width .4s; }
.steps-v .st { display: flex; align-items: center; gap: 12px; padding: 7px 0; position: relative; }
.steps-v .st::before { content: ""; position: absolute; left: 13px; top: 32px; height: calc(100% - 22px); width: 2px; background: var(--line); }
.steps-v .st:last-child::before { display: none; }
.steps-v .sn { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; background: #f1f5f9; color: var(--muted); flex: none; z-index: 1; }
.steps-v .st.done .sn { background: #10b981; color: #fff; }
.steps-v .st.cur .sn { background: var(--p); color: var(--on-p); box-shadow: 0 0 0 4px var(--p-100); }
.steps-v .st.done .stx { color: var(--muted); text-decoration: line-through; }
.steps-v .st.cur .stx { font-weight: 700; }

/* ---------- key-value lists ---------- */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 7px 16px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 550; text-align: right; word-break: break-word; }
.kv.left dd { text-align: left; }
.info-row { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-2); padding: 3px 0; }
.info-row .ic { color: var(--muted-2); width: 16px; height: 16px; }

/* ---------- misc utilities ---------- */
.row { display: flex; gap: 12px; align-items: center; }
.row.wrap { flex-wrap: wrap; } .row.between { justify-content: space-between; } .row.top { align-items: flex-start; } .row.end { justify-content: flex-end; }
.col { display: flex; flex-direction: column; gap: 12px; }
.stack > * + * { margin-top: 16px; }
.stack-sm > * + * { margin-top: 10px; }
.gap4 { gap: 4px; } .gap6 { gap: 6px; } .gap8 { gap: 8px; } .gap16 { gap: 16px; } .gap20 { gap: 20px; }
.grow { flex: 1; min-width: 0; } .nowrap { white-space: nowrap; } .trunc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt4 { margin-top: 4px; } .mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt20 { margin-top: 20px; } .mt24 { margin-top: 24px; } .mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; } .mb16 { margin-bottom: 16px; } .mb20 { margin-bottom: 20px; }
.muted { color: var(--muted); } .muted2 { color: var(--muted-2); } .tp { color: var(--p-700); } .tg { color: #059669; } .tr { color: #dc2626; } .ta-amber { color: #b45309; }
.xs { font-size: 11.5px; } .sm { font-size: 12.5px; } .md { font-size: 14px; } .lg { font-size: 16px; } .xl { font-size: 20px; } .xxl { font-size: 28px; }
.b6 { font-weight: 600; } .b7 { font-weight: 700; } .b8 { font-weight: 800; }
.upper { text-transform: uppercase; letter-spacing: .06em; }
.right { text-align: right; } .center { text-align: center; }
.w100 { width: 100%; }
.hide { display: none !important; }
.layout-2 { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 16px; align-items: start; }
.layout-3 { display: grid; grid-template-columns: 280px minmax(0,1fr) 330px; gap: 16px; align-items: start; }
.layout-21 { display: grid; grid-template-columns: minmax(0,2fr) minmax(0,1fr); gap: 16px; align-items: start; }
.layout-12 { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,2fr); gap: 16px; align-items: start; }
.sticky { position: sticky; top: calc(var(--topbar-h) + 16px); }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; border-radius: 20px; font-size: 12.5px; font-weight: 600; border: 1px solid var(--line); background: #fff; color: var(--text-2); cursor: pointer; }
.chip:hover { border-color: #cbd5e1; }
.chip.on { background: #0f172a; color: #fff; border-color: #0f172a; }
.copy-box { display: flex; align-items: center; gap: 8px; padding: 9px 12px; background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 10px; font-size: 12.5px; color: var(--text-2); cursor: pointer; word-break: break-all; }
.copy-box:hover { border-color: var(--p-300); background: var(--p-50); }
.code-big { font-family: ui-monospace, Menlo, monospace; font-size: 24px; font-weight: 800; letter-spacing: .06em; color: var(--p-700); text-align: center; background: var(--p-50); border: 1px solid var(--p-100); border-radius: 12px; padding: 14px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.photo-grid .ph-item { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #f1f5f9; }
.photo-grid .ph-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-grid .ph-item button { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(220,38,38,.92); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.photo-grid .ph-add { aspect-ratio: 1; border-radius: 10px; border: 2px dashed #cbd5e1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted); font-size: 11.5px; cursor: pointer; background: #fafbfc; }
.photo-grid .ph-add:hover { border-color: var(--p-300); color: var(--p-700); background: var(--p-50); }
.banner-grad { background: linear-gradient(135deg, var(--p) 0%, var(--p-800) 100%); color: var(--on-p); border-radius: 16px; padding: 22px; position: relative; overflow: hidden; }
.banner-grad::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255,255,255,.08); }
.banner-grad h2 { color: inherit; font-size: 22px; }
.banner-grad p { opacity: .85; }
.quick-link { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; color: var(--text); box-shadow: var(--shadow); transition: .15s; }
.quick-link:hover { border-color: var(--p-200); box-shadow: var(--shadow-lg); color: var(--text); }
.quick-link .qi { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex: none; background: var(--p-50); color: var(--p); }
.quick-link b { display: block; font-size: 13.5px; }
.quick-link span { display: block; font-size: 12px; color: var(--muted); }
.chart-box { position: relative; height: 260px; }
.chart-box.sm { height: 210px; }
.legend { display: flex; flex-direction: column; gap: 5px; margin-top: 10px; }
.legend div { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.legend i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.legend b { margin-left: auto; color: var(--text); }
.skel { background: linear-gradient(90deg, #eef2f6 25%, #f6f8fa 50%, #eef2f6 75%); background-size: 200% 100%; animation: skel 1.2s infinite; border-radius: 8px; }
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.slider { position: relative; height: 62px; border-radius: 16px; display: flex; align-items: center; padding: 0 6px; user-select: none; overflow: hidden; touch-action: none; }
.slider .sl-txt { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.85); font-weight: 600; font-size: 14px; pointer-events: none; }
.slider .sl-knob { width: 54px; height: 50px; border-radius: 12px; background: #fff; box-shadow: 0 4px 12px rgba(0,0,0,.2); display: flex; align-items: center; justify-content: center; z-index: 2; cursor: grab; font-size: 20px; color: #0f172a; }
.clock-big { font-size: 46px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* ---------- auth pages ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: #fff; }
.auth-side { position: relative; overflow: hidden; background: linear-gradient(150deg, var(--p) 0%, var(--p-900) 100%); color: var(--on-p); padding: 44px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-side::before { content: ""; position: absolute; width: 380px; height: 380px; border-radius: 50%; background: rgba(255,255,255,.07); top: -120px; right: -120px; }
.auth-side::after { content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%; background: rgba(255,255,255,.05); bottom: -180px; left: -140px; }
.auth-side > * { position: relative; z-index: 1; }
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-brand .sb-logo { width: 46px; height: 46px; background: #fff; }
.auth-brand b { font-size: 20px; color: inherit; }
.auth-img { border-radius: 18px; overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,.3); border: 1px solid rgba(255,255,255,.15); }
.auth-img img { display: block; width: 100%; height: 300px; object-fit: cover; }
.auth-side h1 { color: inherit; font-size: 30px; letter-spacing: -.02em; }
.auth-side .lead { opacity: .85; margin-top: 10px; font-size: 15px; }
.auth-feats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
.auth-feats div { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); border-radius: 12px; padding: 12px 14px; font-size: 13px; }
.auth-feats b { display: block; font-size: 13.5px; color: inherit; }
.auth-feats span { opacity: .8; font-size: 12px; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.auth-box { width: 100%; max-width: 410px; }
.auth-box h2 { font-size: 26px; letter-spacing: -.02em; }
.auth-box .sub { color: var(--muted); margin-top: 6px; }
.auth-m-brand { display: none; align-items: center; gap: 10px; margin-bottom: 26px; }
.auth-m-brand b { font-size: 18px; }
.public-wrap { min-height: 100vh; background: linear-gradient(160deg, var(--p-50), #fff 50%, #fff7ed); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; }
.public-card { width: 100%; max-width: 520px; }
.public-head { text-align: center; margin-bottom: 20px; }
.public-head .pill { display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); padding: 7px 14px 7px 7px; border-radius: 40px; box-shadow: var(--shadow); margin-bottom: 14px; }
.public-head .pill .sb-logo { width: 28px; height: 28px; border-radius: 50%; font-size: 11px; }
.public-head .pill b { font-size: 13.5px; }
.public-head h1 { font-size: 24px; }
.public-head p { color: var(--muted); margin-top: 6px; }

/* ---------- employee app ---------- */
.emp-hero { background: linear-gradient(140deg, var(--p) 0%, var(--p-800) 100%); color: var(--on-p); padding: 34px 18px 64px; border-radius: 0 0 28px 28px; }
.emp-hero .wrap { max-width: 560px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.emp-hero h1 { color: inherit; font-size: 25px; }
.emp-hero .k { font-size: 12px; opacity: .8; display: flex; align-items: center; gap: 6px; }
.emp-hero .g { opacity: .85; font-size: 14px; }
.emp-tiles { max-width: 560px; margin: -40px auto 0; padding: 0 16px 30px; }
.emp-tiles .card { padding: 16px; }
.tile-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 10px; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 7px; color: var(--text-2); text-align: center; font-size: 12px; font-weight: 600; line-height: 1.25; }
.tile .ti { position: relative; width: 62px; height: 62px; border-radius: 18px; display: flex; align-items: center; justify-content: center; transition: transform .15s; }
.tile:hover .ti { transform: scale(1.05); }
.tile .ti .ic { width: 27px; height: 27px; }
.tile .tb { position: absolute; top: -5px; right: -5px; min-width: 20px; height: 20px; border-radius: 10px; background: #ef4444; color: #fff; font-size: 10.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 5px; border: 2px solid #fff; }
.m-appbar { display: none; position: sticky; top: 0; z-index: 30; background: #fff; border-bottom: 1px solid var(--line); height: 56px; align-items: center; gap: 8px; padding: 0 12px; }
.m-appbar h1 { font-size: 17px; font-weight: 700; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- print ---------- */
@media print {
  .sidebar, .topbar, .no-print, .toasts, .app-foot, .m-appbar { display: none !important; }
  .main { margin: 0 !important; }
  .content { padding: 0 !important; max-width: none !important; }
  body { background: #fff !important; }
}

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .stats.s6 { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .layout-3 { grid-template-columns: 260px minmax(0,1fr); }
  .layout-3 > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .stats.s5 { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .layout-2, .layout-21, .layout-12 { grid-template-columns: minmax(0,1fr); }
  .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .g5 { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .sticky { position: static; }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .tb-menu { display: inline-flex; }
  .topbar { padding: 0 12px; }
  .content { padding: 16px 14px; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-m-brand { display: flex; }
  .layout-3 { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 680px) {
  body { font-size: 14px; }
  .ph h1 { font-size: 19px; }
  .stats, .stats.s3, .stats.s5, .stats.s6 { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
  .stat { padding: 12px; gap: 10px; }
  .stat .si { width: 36px; height: 36px; }
  .stat .sv { font-size: 18px; }
  .g2, .g3, .g4, .g5 { grid-template-columns: minmax(0,1fr); }
  .g2.keep, .g3.keep { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .span2, .span3 { grid-column: auto; }
  .filters .in-wrap { max-width: none; min-width: 100%; }
  .filters .sel { flex: 1; }
  .tb-welcome { display: none; }
  .tb-user .nm { display: none; }
  .hide-sm { display: none !important; }
  .mlist { display: block; }
  .tlist-desk { display: none; }
  .modal-bg { padding: 0; align-items: flex-end; }
  .modal { border-radius: 18px 18px 0 0; margin: 0; max-height: 92vh; overflow-y: auto; }
  .m-appbar { display: flex; }
  .emp-desk-head { display: none !important; }
  .ph-actions { width: 100%; }
}
@media (min-width: 681px) { .show-sm { display: none !important; } }

/* ---------- quotation / invoice wizard ---------- */
.df-steps { display: flex; gap: 4px; overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 6px; box-shadow: var(--shadow); margin-bottom: 16px; scrollbar-width: none; }
.df-step { display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 9px 14px; border-radius: 10px; font: inherit; font-size: 13.5px; color: var(--muted); cursor: pointer; white-space: nowrap; font-weight: 600; }
.df-step span { width: 22px; height: 22px; border-radius: 50%; background: #f1f5f9; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; }
.df-step em { font-style: normal; font-weight: 400; font-size: 10.5px; opacity: .7; }
.df-step:hover { background: #f8fafc; color: var(--text); }
.df-step.on { background: var(--p); color: var(--on-p); box-shadow: 0 2px 8px var(--p-200); }
.df-step.on span { background: #fff; color: var(--p-700); }
.df-step.done span { background: var(--p-100); color: var(--p-700); }
.df-layout { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; }
.df-layout.full { grid-template-columns: minmax(0, 1fr); }
.df-side .sticky { top: calc(var(--topbar-h) + 12px); }
.df-mini { height: 520px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #e8ecf1; position: relative; }
.df-scale { width: 800px; transform-origin: top left; pointer-events: none; }
.df-full { border: 1px solid var(--line); border-radius: 14px; background: #e8ecf1; overflow: auto; padding: 8px; min-height: 300px; }
.df-full .df-scale { margin: 0 auto; }
.df-bar { position: sticky; bottom: 0; z-index: 15; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: rgba(255,255,255,.96); backdrop-filter: blur(6px); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; box-shadow: var(--shadow-lg); }
.df-picker { position: relative; margin-bottom: 12px; }
.df-picker .in { border: 2px solid var(--p-200); height: 44px; }
.df-picker .in:focus { border-color: var(--p); }
.df-menu { position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); overflow: hidden; max-height: 360px; overflow-y: auto; }
.df-opt { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border: 0; background: none; text-align: left; font: inherit; font-size: 13.5px; cursor: pointer; border-bottom: 1px solid var(--line-2); }
.df-opt span { min-width: 0; }
.df-opt small { display: block; font-size: 11px; color: var(--muted); }
.df-opt.hi, .df-opt:hover { background: var(--p-50); }
.df-ihead { display: grid; grid-template-columns: minmax(0,1fr) 150px 100px 72px 112px; gap: 8px; padding: 0 10px 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted-2); }
.df-row { border: 1px solid var(--line); border-radius: 12px; padding: 9px 10px; margin-bottom: 8px; background: #fff; }
.df-row.pre { background: #fffbeb; border-color: #fde68a; }
.df-grid { display: grid; grid-template-columns: minmax(0,1fr) 150px 100px 72px 112px; gap: 8px; align-items: start; }
.df-qty .in { min-width: 0; flex: 1; padding-left: 8px; padding-right: 4px; }
.df-rate .in { padding-left: 8px; padding-right: 4px; }
.df-name { grid-column: auto; }
.df-qty { display: flex; gap: 4px; }
.df-qty .sel { width: 66px; flex: none; padding-left: 6px; padding-right: 18px; font-size: 12px; }


.df-gst .sel { padding-left: 6px; padding-right: 20px; font-size: 12px; background-position: right 5px center; }
.df-amt { display: flex; align-items: center; justify-content: flex-end; gap: 4px; height: 40px; font-variant-numeric: tabular-nums; }
.df-tags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; font-size: 11px; }
.df-addrow { width: 100%; border: 2px dashed var(--line); background: none; border-radius: 12px; padding: 10px; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }
.df-addrow:hover { border-color: var(--p-300); color: var(--p-700); }
.df-tot { background: #f8fafc; border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.df-gt { border-top: 1px solid var(--line); padding-top: 8px; font-size: 16px; }
.df-gt b { color: var(--p-700); }
.df-tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.df-tpl { text-align: left; border: 2px solid var(--line); background: #fff; border-radius: 12px; padding: 10px; cursor: pointer; font: inherit; }
.df-tpl b { display: block; font-size: 13px; }
.df-tpl span { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.3; }
.df-tpl.on { border-color: var(--p); box-shadow: 0 0 0 3px var(--p-100); }
.df-img { position: relative; height: 112px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #f1f5f9; }
.df-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.df-def { position: absolute; left: 6px; top: 6px; background: rgba(0,0,0,.55); color: #fff; font-size: 10px; padding: 2px 6px; border-radius: 6px; }
.df-img-b { position: absolute; inset: auto 0 0 0; display: flex; justify-content: flex-end; gap: 4px; padding: 6px; background: linear-gradient(transparent, rgba(0,0,0,.5)); }
@media (max-width: 1100px) { .df-layout { grid-template-columns: minmax(0, 1fr); } .df-side { display: none; } }
@media (max-width: 680px) {
  .df-grid { grid-template-columns: minmax(0,1.4fr) minmax(0,1fr) 68px; }
  .df-name { grid-column: 1 / -1; } .df-amt { grid-column: 1 / -1; height: auto; }
  .df-step { padding: 8px 10px; font-size: 12.5px; }
}
.df-qty .sel, .df-gst .sel { background-position: right 5px center; background-size: 11px; padding-right: 18px; }
.main .doc-bar { top: var(--topbar-h); }
