/* ==========================================================================
   Ranker ERP — UI
   ========================================================================== */
:root {
    --bg: #f4f5fb;
    --surface: #ffffff;
    --surface-2: #f2f4fa;
    --surface-3: #e9ecf5;
    --text: #0f172a;
    --muted: #64748b;
    --faint: #94a3b8;
    --border: #e5e8f1;
    --brand: #5b5bf6;
    --brand-2: #22c1ee;
    --brand-soft: #ecebff;
    --green: #10b981; --green-soft: #e3f8f0;
    --red: #f43f5e;   --red-soft: #ffe8ec;
    --amber: #f59e0b; --amber-soft: #fff3dc;
    --blue: #3b82f6;  --blue-soft: #e6efff;
    --sidebar: #0d1224;
    --sidebar-2: #151b33;
    --sidebar-text: #a6afcb;
    --radius: 18px;
    --radius-sm: 12px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 6px 24px -8px rgba(15, 23, 42, .08);
    --shadow-lg: 0 2px 4px rgba(15, 23, 42, .04), 0 22px 48px -16px rgba(15, 23, 42, .18);
    --ease: cubic-bezier(.2, .8, .2, 1);
    color-scheme: light;
}
[data-theme="dark"] {
    --bg: #0a0e1a;
    --surface: #111729;
    --surface-2: #161d33;
    --surface-3: #1d2540;
    --text: #e8ebf5;
    --muted: #8a94b3;
    --faint: #5f6a8a;
    --border: #212a45;
    --brand-soft: #23245a;
    --green-soft: #0f3529; --red-soft: #3d1621; --amber-soft: #3b2c0e; --blue-soft: #15284f;
    --sidebar: #070a14;
    --sidebar-2: #0f1426;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px -10px rgba(0, 0, 0, .5);
    --shadow-lg: 0 24px 60px -18px rgba(0, 0, 0, .7);
    color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 14px; line-height: 1.5; color: var(--text); background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: color-mix(in srgb, var(--brand) 80%, var(--text)); }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.02em; }
.num, .tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: .8rem; }
.hidden { display: none !important; }
::selection { background: color-mix(in srgb, var(--brand) 30%, transparent); }

/* ---------------------------------------------------------------- Shell */
.app { display: flex; min-height: 100vh; }
.sidebar {
    position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 50;
    background: radial-gradient(400px 260px at 0 0, rgba(91, 91, 246, .22), transparent 70%), linear-gradient(180deg, var(--sidebar), var(--sidebar-2));
    color: var(--sidebar-text); display: flex; flex-direction: column; transition: transform .35s var(--ease);
    border-right: 1px solid rgba(255, 255, 255, .04);
}
.side-brand { display: flex; align-items: center; gap: 12px; padding: 22px 22px 18px; color: #fff; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1.05rem; color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 8px 24px -6px rgba(91, 91, 246, .7); flex: 0 0 auto; overflow: hidden; }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.brand-name { font-weight: 800; font-size: 1.08rem; line-height: 1.15; }
.brand-sub { font-size: .72rem; color: var(--sidebar-text); font-weight: 500; }
.nav { flex: 1; overflow-y: auto; padding: 8px 14px 18px; }
.nav-label { font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: #5d6787; font-weight: 700; padding: 16px 12px 8px; }
.nav a {
    position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin: 2px 0; border-radius: 11px;
    color: var(--sidebar-text); font-weight: 600; font-size: .9rem; transition: background .2s, color .2s, transform .2s var(--ease);
}
.nav a i { width: 20px; text-align: center; font-size: .95rem; opacity: .85; }
.nav a:hover { background: rgba(255, 255, 255, .05); color: #fff; transform: translateX(2px); }
.nav a.active { color: #fff; background: linear-gradient(90deg, rgba(91, 91, 246, .32), rgba(91, 91, 246, .08)); }
.nav a.active::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: linear-gradient(var(--brand), var(--brand-2)); }
.nav a .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pc, var(--brand)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pc, var(--brand)) 25%, transparent); margin: 0 6px; flex: 0 0 auto; }
.nav a .txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav .sub a { padding: 7px 12px 7px 16px; font-size: .84rem; font-weight: 500; }
.nav .new-btn { margin: 6px 0 4px; justify-content: center; border: 1px dashed rgba(255, 255, 255, .16); color: #dfe3f5; }
.nav .new-btn:hover { border-color: var(--brand-2); background: rgba(34, 193, 238, .08); }
.side-foot { padding: 14px 18px 18px; border-top: 1px solid rgba(255, 255, 255, .05); display: flex; align-items: center; gap: 10px; }
.side-foot .who { min-width: 0; flex: 1; }
.side-foot .who b { display: block; color: #fff; font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot .who span { font-size: .72rem; }

.main { flex: 1; margin-left: 260px; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 12px; padding: 14px 28px;
    background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(160%) blur(14px);
    border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}
.topbar .crumb { font-weight: 700; font-size: 1rem; }
.topbar .crumb small { display: block; font-weight: 500; color: var(--muted); font-size: .75rem; }
.topbar .spacer { flex: 1; }
.icon-btn {
    width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--muted);
    display: inline-grid; place-items: center; cursor: pointer; transition: all .2s var(--ease); font-size: .95rem; flex: 0 0 auto;
}
.icon-btn:hover { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); transform: translateY(-1px); }
.icon-btn.sm { width: 32px; height: 32px; border-radius: 9px; font-size: .8rem; }
.icon-btn.plain { border-color: transparent; background: transparent; }
.icon-btn.danger:hover { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, var(--border)); }
.menu-btn { display: none; }
.content { padding: 26px 28px 60px; max-width: 1480px; width: 100%; }

/* Avatars */
.avatar { width: 38px; height: 38px; border-radius: 12px; display: inline-grid; place-items: center; font-weight: 700; font-size: .85rem; color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-2)); flex: 0 0 auto; object-fit: cover; }
.avatar.lg { width: 96px; height: 96px; border-radius: 28px; font-size: 2rem; }
.avatar.sm { width: 30px; height: 30px; border-radius: 9px; font-size: .72rem; }

/* Dropdown */
.dropdown { position: relative; }
.dropdown-menu {
    position: absolute; right: 0; top: calc(100% + 8px); min-width: 210px; background: var(--surface); border: 1px solid var(--border);
    border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; opacity: 0; transform: translateY(-6px) scale(.98); pointer-events: none;
    transition: all .18s var(--ease); z-index: 60;
}
.dropdown.open .dropdown-menu { opacity: 1; transform: none; pointer-events: auto; }
.dropdown-menu a, .dropdown-menu button { display: flex; gap: 10px; align-items: center; width: 100%; padding: 9px 12px; border-radius: 9px; color: var(--text);
    background: none; border: 0; font: inherit; font-weight: 500; cursor: pointer; text-align: left; }
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--surface-2); }
.dropdown-menu .head { padding: 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }

/* ---------------------------------------------------------------- Page header */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: 1.65rem; font-weight: 800; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.title-row { display: flex; align-items: center; gap: 14px; }

/* ---------------------------------------------------------------- Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 12px; border: 1px solid transparent;
    font: inherit; font-weight: 700; font-size: .88rem; cursor: pointer; transition: all .2s var(--ease); white-space: nowrap; line-height: 1.2;
}
.btn-primary { color: #fff; background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 60%, var(--brand-2))); box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--brand) 80%, transparent); }
.btn-primary:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 12px 26px -8px color-mix(in srgb, var(--brand) 90%, transparent); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); }
.btn-success { color: #fff; background: linear-gradient(135deg, #10b981, #0ea5a4); box-shadow: 0 8px 20px -10px rgba(16, 185, 129, .9); }
.btn-success:hover { color: #fff; transform: translateY(-1px); }
.btn-danger { color: var(--red); background: var(--red-soft); }
.btn-danger:hover { color: #fff; background: var(--red); }
.btn-sm { padding: 7px 12px; font-size: .8rem; border-radius: 10px; }
.btn[disabled] { opacity: .6; pointer-events: none; }
.spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: rot .7s linear infinite; display: inline-block; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- Cards & grid */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h3 { font-size: .98rem; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.card-head h3 .ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: .8rem; background: var(--brand-soft); color: var(--brand); }
.card-body { padding: 18px 20px; }
.grid { display: grid; gap: 18px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.mb { margin-bottom: 18px; }
.mt { margin-top: 18px; }

/* KPI */
.kpi { position: relative; overflow: hidden; padding: 20px 22px; }
.kpi .k-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.kpi .k-label { font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: var(--muted); }
.kpi .k-value { font-size: 1.85rem; font-weight: 800; letter-spacing: -.03em; margin-top: 6px; line-height: 1.1; white-space: nowrap; }
.kpi .k-sub { margin-top: 10px; font-size: .78rem; color: var(--muted); display: flex; gap: 6px 12px; flex-wrap: wrap; align-items: center; }
.kpi .k-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 1.1rem; background: var(--kc-soft); color: var(--kc); flex: 0 0 auto; }
.kpi::after { content: ""; position: absolute; right: -40px; bottom: -60px; width: 160px; height: 160px; border-radius: 50%; background: var(--kc); opacity: .06; }
.kpi.sales  { --kc: var(--blue);  --kc-soft: var(--blue-soft); }
.kpi.exp    { --kc: var(--red);   --kc-soft: var(--red-soft); }
.kpi.profit { --kc: var(--green); --kc-soft: var(--green-soft); }
.kpi.loss   { --kc: var(--red);   --kc-soft: var(--red-soft); }
.kpi.warn   { --kc: var(--amber); --kc-soft: var(--amber-soft); }
.kpi.kbrand { --kc: var(--brand); --kc-soft: var(--brand-soft); }
.kpi.sales .k-value { color: var(--blue); } .kpi.exp .k-value, .kpi.loss .k-value { color: var(--red); } .kpi.profit .k-value { color: var(--green); }
.delta { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: .72rem; padding: 3px 8px; border-radius: 20px; }
.delta.up { background: var(--green-soft); color: var(--green); }
.delta.down { background: var(--red-soft); color: var(--red); }
.delta.flat { background: var(--surface-2); color: var(--muted); }

/* ---------------------------------------------------------------- Product cards (dashboard) */
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.pcard {
    --pc: var(--brand);
    position: relative; display: block; color: var(--text); padding: 22px; border-radius: 22px; background: var(--surface);
    border: 1px solid var(--border); box-shadow: var(--shadow); overflow: hidden; isolation: isolate;
    transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s;
}
.pcard::before {   /* coloured glow */
    content: ""; position: absolute; inset: -1px -1px auto -1px; height: 120px; z-index: -1;
    background: radial-gradient(380px 120px at 0 0, color-mix(in srgb, var(--pc) 22%, transparent), transparent 70%);
}
.pcard::after {    /* animated border on hover */
    content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; z-index: -1; opacity: 0; transition: opacity .35s;
    background: conic-gradient(from var(--ang, 0deg), var(--pc), transparent 30%, transparent 70%, var(--pc));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
    animation: spinb 4s linear infinite;
}
@property --ang { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
@keyframes spinb { to { --ang: 360deg; } }
.pcard:hover { transform: translateY(-6px); box-shadow: 0 26px 50px -22px color-mix(in srgb, var(--pc) 55%, transparent); color: var(--text); }
.pcard:hover::after { opacity: 1; }
.pcard .p-top { display: flex; align-items: center; gap: 14px; }
.p-icon {
    width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; color: #fff; font-size: 1.35rem; flex: 0 0 auto;
    background: linear-gradient(135deg, var(--pc), color-mix(in srgb, var(--pc) 55%, #fff));
    box-shadow: 0 12px 24px -10px var(--pc);
}
.pcard .p-icon { animation: floaty 4.5s ease-in-out infinite; animation-delay: calc(var(--i, 0) * .4s); }
@keyframes floaty { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-5px) rotate(-3deg); } }
.p-icon.sm { width: 36px; height: 36px; border-radius: 11px; font-size: .9rem; box-shadow: none; }
.p-icon.md { width: 46px; height: 46px; border-radius: 14px; font-size: 1.1rem; }
.pcard .p-name { font-weight: 800; font-size: 1.02rem; line-height: 1.25; }
.pcard .p-type { font-size: .72rem; font-weight: 700; color: var(--pc); text-transform: uppercase; letter-spacing: .08em; }
.pcard .p-stats { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: 22px; }
.pcard .p-big { font-size: 2.3rem; font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.pcard .p-big-label { font-size: .8rem; color: var(--muted); font-weight: 600; margin-top: 6px; }
.pcard .p-money { text-align: right; }
.pcard .p-money b { display: block; font-size: 1.15rem; font-weight: 800; color: var(--pc); white-space: nowrap; }
.pcard .p-money span { font-size: .74rem; color: var(--muted); font-weight: 600; }
.pcard .p-foot { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--border); display: flex; justify-content: space-between; gap: 8px; font-size: .78rem; color: var(--muted); }
.pcard .p-foot b { color: var(--text); }
.bar { height: 7px; border-radius: 10px; background: var(--surface-3); overflow: hidden; margin-top: 10px; }
.bar > span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--pc, var(--brand)), color-mix(in srgb, var(--pc, var(--brand)) 50%, #fff)); transition: width 1.4s var(--ease); }
.pcard.add { display: grid; place-items: center; text-align: center; border: 2px dashed var(--border); background: transparent; box-shadow: none; min-height: 210px; color: var(--muted); cursor: pointer; }
.pcard.add:hover { border-color: var(--brand); color: var(--brand); }
.pcard.add::after, .pcard.add::before { display: none; }
.pcard.add .plus { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 10px; background: var(--brand-soft); color: var(--brand); font-size: 1.2rem; transition: transform .4s var(--ease); }
.pcard.add:hover .plus { transform: rotate(90deg) scale(1.08); }

/* ---------------------------------------------------------------- Tables */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
.t th { text-align: left; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 11px 16px; background: var(--surface-2); white-space: nowrap; }
.t td { padding: 13px 16px; border-top: 1px solid var(--border); vertical-align: middle; }
.t tr.link { cursor: pointer; transition: background .15s; }
.t tr.link:hover td { background: var(--surface-2); }
.t .r { text-align: right; }
.t .c { text-align: center; }
.t tfoot td { font-weight: 800; background: var(--surface-2); }
.t .name { font-weight: 700; color: var(--text); }
.t .name:hover { color: var(--brand); }
.t .sub { font-size: .76rem; color: var(--muted); }
.in { color: var(--green); font-weight: 700; }
.out { color: var(--red); font-weight: 700; }

/* Pills */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 30px; font-size: .74rem; font-weight: 700; white-space: nowrap; line-height: 1.3; border: 0; font-family: inherit; }
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.amber { background: var(--amber-soft); color: #c27803; }
[data-theme="dark"] .pill.amber { color: #fbbf24; }
.pill.blue { background: var(--blue-soft); color: var(--blue); }
.pill.brand { background: var(--brand-soft); color: var(--brand); }
.pill.gray { background: var(--surface-2); color: var(--muted); }
button.pill { cursor: pointer; }
.pay-btn { cursor: pointer; border: 1.5px dashed var(--red); color: var(--red); background: transparent; padding: 4px 11px; border-radius: 30px; font: inherit; font-size: .74rem; font-weight: 700; transition: all .2s; }
.pay-btn:hover { background: var(--red); color: #fff; border-style: solid; }

/* Segmented tabs */
.seg { display: inline-flex; padding: 4px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.seg a, .seg button { padding: 7px 14px; border-radius: 9px; font-weight: 700; font-size: .82rem; color: var(--muted); border: 0; background: none; cursor: pointer; font-family: inherit; }
.seg .on { background: var(--surface); color: var(--brand); box-shadow: var(--shadow); }

/* Month picker */
.month-nav { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.month-nav a { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: var(--muted); }
.month-nav a:hover { background: var(--surface-2); color: var(--brand); }
.month-nav input { border: 0; background: transparent; color: var(--text); font: inherit; font-weight: 700; width: 148px; padding: 4px; }
.month-nav input:focus { outline: none; }

/* ---------------------------------------------------------------- Forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: .78rem; font-weight: 700; color: var(--muted); }
.input, select.input, textarea.input {
    width: 100%; padding: 10px 13px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
    font: inherit; transition: border-color .2s, box-shadow .2s;
}
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent); }
textarea.input { resize: vertical; min-height: 70px; }
.input.sm { padding: 7px 11px; font-size: .84rem; border-radius: 10px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-section { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 800; color: var(--brand); grid-column: 1 / -1; margin-top: 6px; }
.choices { display: flex; flex-wrap: wrap; gap: 6px; }
.choice { width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; display: grid; place-items: center; transition: all .15s; }
.choice.on { border-color: var(--brand); color: #fff; background: var(--brand); }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--border); cursor: pointer; }
.swatch.on { box-shadow: 0 0 0 2px var(--text); }
.type-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.type-pick label { border: 1.5px solid var(--border); border-radius: 14px; padding: 12px 14px; cursor: pointer; display: flex; gap: 10px; align-items: flex-start; transition: all .2s; }
.type-pick label b { display: block; font-size: .9rem; color: var(--text); }
.type-pick label span { font-size: .76rem; color: var(--muted); font-weight: 500; }
.type-pick input { margin-top: 4px; accent-color: var(--brand); }
.type-pick label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.type-pick label:has(input:disabled) { opacity: .6; cursor: not-allowed; }

/* ---------------------------------------------------------------- Modal */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; visibility: hidden; }
.modal .backdrop { position: absolute; inset: 0; background: rgba(8, 11, 24, .55); backdrop-filter: blur(4px); opacity: 0; transition: opacity .25s; }
.modal .dialog {
    position: relative; width: 100%; max-width: 560px; max-height: calc(100vh - 40px); display: flex; flex-direction: column;
    background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-lg); border: 1px solid var(--border);
    transform: translateY(24px) scale(.97); opacity: 0; transition: all .3s var(--ease);
}
.modal.lg .dialog { max-width: 820px; }
.modal.open { visibility: visible; }
.modal.open .backdrop { opacity: 1; }
.modal.open .dialog { transform: none; opacity: 1; }
.modal .m-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal .m-head h3 { font-size: 1.08rem; font-weight: 800; }
.modal .m-head p { margin: 2px 0 0; font-size: .8rem; color: var(--muted); }
.modal .m-body { padding: 20px 22px; overflow-y: auto; }
.modal .m-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.modal .m-foot .left { margin-right: auto; }

/* Toasts */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px; background: var(--text); color: var(--bg); font-weight: 600; box-shadow: var(--shadow-lg);
    animation: toastIn .35s var(--ease); max-width: 360px; }
.toast i { color: var(--green); }
.toast.err i { color: var(--red); }
@keyframes toastIn { from { transform: translateY(16px); opacity: 0; } }

/* ---------------------------------------------------------------- Lists */
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--border); }
.list-item:first-child { border-top: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; color: var(--text); }
.list-item .meta { font-size: .76rem; color: var(--muted); }
.cat-row { margin-bottom: 14px; }
.cat-row:last-child { margin-bottom: 0; }
.cat-row .top { display: flex; justify-content: space-between; gap: 8px; font-size: .86rem; font-weight: 600; }
.cat-row .bar { margin-top: 7px; height: 8px; }
.empty { text-align: center; padding: 46px 20px; color: var(--muted); }
.empty .e-icon { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; margin: 0 auto 14px; background: var(--brand-soft); color: var(--brand); font-size: 1.5rem; }
.empty b { display: block; color: var(--text); font-size: 1rem; margin-bottom: 4px; }

/* Day groups (expenses) */
.day-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 20px; background: var(--surface-2); font-weight: 700; font-size: .84rem; border-top: 1px solid var(--border); }
.day-head .d { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); margin-right: 10px; font-weight: 800; }

/* Month tiles (client) & ticks (grid) */
.months { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.mtile { position: relative; text-align: left; border: 1.5px solid var(--border); border-radius: 16px; padding: 14px; background: var(--surface); color: var(--text); font: inherit; transition: all .25s var(--ease); }
button.mtile { cursor: pointer; }
button.mtile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.mtile .mn { font-weight: 800; }
.mtile .ms { margin-top: 10px; font-size: .76rem; font-weight: 700; }
.mtile .ma { font-size: .74rem; color: var(--muted); margin-top: 2px; }
.mtile .mc { position: absolute; top: 12px; right: 12px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .7rem; }
.mtile.paid { background: var(--green-soft); border-color: transparent; }
.mtile.paid .ms { color: var(--green); } .mtile.paid .mc { background: var(--green); color: #fff; animation: pop .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 50ms + .2s); }
.mtile.owed { border-style: dashed; border-color: color-mix(in srgb, var(--red) 70%, transparent); background: color-mix(in srgb, var(--red) 4%, var(--surface)); }
.mtile.owed .ms { color: var(--red); } .mtile.owed .mc { border: 2px solid var(--red); }
.mtile.na { opacity: .5; } .mtile.na .ms { color: var(--muted); }
.mtile.now { box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 35%, transparent); }
@keyframes pop { from { transform: scale(0); } 60% { transform: scale(1.25); } }
.ticks th, .ticks td { text-align: center; padding: 9px 4px !important; }
.ticks th:first-child, .ticks td:first-child { text-align: left; padding-left: 18px !important; position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 200px; }
.ticks thead th:first-child { background: var(--surface-2); }
.tick { width: 30px; height: 30px; border-radius: 9px; border: 1.5px solid var(--border); background: var(--surface); display: inline-grid; place-items: center; font-size: .72rem; color: transparent; padding: 0; transition: transform .15s; }
button.tick { cursor: pointer; } button.tick:hover { transform: scale(1.12); }
.tick.paid { background: var(--green); border-color: var(--green); color: #fff; }
.tick.due { border-style: dashed; border-color: var(--red); }
.tick.na { background: var(--surface-2); border-color: transparent; }

/* Detail lists */
.dl { display: grid; grid-template-columns: 140px 1fr; gap: 11px 14px; margin: 0; font-size: .88rem; }
.dl dt { color: var(--muted); font-weight: 600; }
.dl dd { margin: 0; font-weight: 600; word-break: break-word; }

/* Profile hero */
.hero { position: relative; overflow: hidden; border-radius: 24px; padding: 26px; color: #fff; margin-bottom: 18px;
    background: radial-gradient(500px 220px at 85% -20%, rgba(255, 255, 255, .25), transparent 60%), linear-gradient(120deg, var(--pc, var(--brand)), color-mix(in srgb, var(--pc, var(--brand)) 45%, #0ea5e9)); }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%; border: 40px solid rgba(255, 255, 255, .08); }
.hero .h-row { position: relative; z-index: 1; display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.hero .avatar.lg { background: rgba(255, 255, 255, .2); border: 3px solid rgba(255, 255, 255, .5); }
.hero h1 { font-size: 1.7rem; font-weight: 800; }
.hero .h-meta { display: flex; gap: 6px 16px; flex-wrap: wrap; margin-top: 6px; opacity: .92; font-weight: 500; font-size: .86rem; }
.hero .h-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.hero .btn-ghost { background: rgba(255, 255, 255, .16); color: #fff; border-color: rgba(255, 255, 255, .25); }
.hero .btn-ghost:hover { background: rgba(255, 255, 255, .26); color: #fff; }
.hero .btn-white { background: #fff; color: var(--pc, var(--brand)); }

/* Employee cards */
.emp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.ecard { display: block; color: var(--text); padding: 20px; text-align: center; transition: transform .3s var(--ease), box-shadow .3s; }
.ecard:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); color: var(--text); }
.ecard .avatar { width: 72px; height: 72px; border-radius: 22px; font-size: 1.4rem; margin: 0 auto 12px; }
.ecard .en { font-weight: 800; font-size: 1rem; }
.ecard .ed { color: var(--muted); font-size: .82rem; }
.ecard .ef { display: flex; justify-content: space-between; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); font-size: .78rem; color: var(--muted); }
.ecard .ef b { color: var(--text); }

/* Login */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--bg); }
.auth-art { position: relative; overflow: hidden; padding: 48px; color: #fff; display: flex; flex-direction: column; justify-content: space-between;
    background: radial-gradient(600px 400px at 20% 10%, rgba(34, 193, 238, .45), transparent 60%), radial-gradient(700px 500px at 90% 90%, rgba(91, 91, 246, .7), transparent 60%), #0b1020; }
.auth-art h2 { font-size: 2.6rem; font-weight: 800; line-height: 1.1; max-width: 460px; }
.auth-art p { color: #b7c0e0; max-width: 420px; font-size: 1rem; }
.orb { position: absolute; border-radius: 50%; filter: blur(2px); opacity: .9; animation: drift 14s ease-in-out infinite; }
.orb.a { width: 120px; height: 120px; right: 16%; top: 22%; background: linear-gradient(135deg, #6366f1, #22d3ee); }
.orb.b { width: 70px; height: 70px; right: 38%; bottom: 26%; background: linear-gradient(135deg, #f59e0b, #f43f5e); animation-delay: -5s; }
.orb.c { width: 40px; height: 40px; left: 18%; bottom: 18%; background: linear-gradient(135deg, #10b981, #22d3ee); animation-delay: -9s; }
@keyframes drift { 0%, 100% { transform: translate(0, 0); } 33% { transform: translate(20px, -26px); } 66% { transform: translate(-16px, 14px); } }
.float-card { position: absolute; right: 10%; top: 48%; background: rgba(255, 255, 255, .1); backdrop-filter: blur(12px); border: 1px solid rgba(255, 255, 255, .18); border-radius: 18px; padding: 16px 18px; width: 230px; animation: drift 10s ease-in-out infinite; }
.float-card small { color: #cbd3ef; } .float-card b { display: block; font-size: 1.5rem; }
.auth-form { display: grid; place-items: center; padding: 40px 24px; }
.auth-form .box { width: 100%; max-width: 380px; }
.auth-form h1 { font-size: 1.8rem; font-weight: 800; }
.auth-form .stack { display: flex; flex-direction: column; gap: 16px; margin-top: 26px; }
.alert { padding: 11px 14px; border-radius: 12px; font-weight: 600; font-size: .86rem; }
.alert.err { background: var(--red-soft); color: var(--red); }
.alert.info { background: var(--brand-soft); color: var(--brand); }

/* ---------------------------------------------------------------- Motion */
.reveal { opacity: 0; transform: translateY(14px); animation: rise .6s var(--ease) forwards; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes rise { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
    .reveal { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------- Responsive */
@media (max-width: 1200px) { .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-main { grid-template-columns: 1fr; } }
@media (max-width: 992px) {
    .sidebar { transform: translateX(-100%); box-shadow: 30px 0 60px rgba(0, 0, 0, .3); }
    body.nav-open .sidebar { transform: none; }
    body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 45; }
    .main { margin-left: 0; }
    .menu-btn { display: inline-grid; }
    .g-3 { grid-template-columns: 1fr; }
    .auth { grid-template-columns: 1fr; } .auth-art { display: none; }
}
@media (max-width: 640px) {
    .content { padding: 18px 16px 50px; }
    .topbar { padding: 12px 16px; }
    .g-2, .g-4, .form-grid, .form-grid.g3 { grid-template-columns: 1fr; }
    .page-head h1 { font-size: 1.35rem; }
    .kpi .k-value { font-size: 1.5rem; }
    .dl { grid-template-columns: 1fr; gap: 2px; } .dl dd { margin-bottom: 10px; }
    .hero .h-actions { margin-left: 0; }
    .modal { padding: 0; place-items: end center; } .modal .dialog { border-radius: 22px 22px 0 0; max-height: 92vh; }
}

/* keep money and short labels on one line */
.num, .t td.r, .cat-row .top b { white-space: nowrap; }
.nowrap { white-space: nowrap; }
.g-wide { grid-template-columns: minmax(0, 3fr) minmax(260px, 1fr); }
@media (max-width: 1200px) { .g-wide { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- Sidebar groups */
.nav > a, .nav-parent { margin-top: 4px; }
.nav-parent {
    width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 11px; border: 0; background: none; cursor: pointer;
    color: var(--sidebar-text); font: inherit; font-weight: 600; font-size: .9rem; text-align: left; transition: background .2s, color .2s;
}
.nav-parent i:first-child { width: 20px; text-align: center; font-size: .95rem; opacity: .85; }
.nav-parent:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.nav-parent.has-active { color: #fff; }
.nav-parent .caret { margin-left: auto; font-size: .7rem; opacity: .6; transition: transform .3s var(--ease); }
.nav-group.open .nav-parent .caret { transform: rotate(180deg); }
.nav-children { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s var(--ease); }
.nav-children > div { overflow: hidden; padding-left: 14px; margin-left: 21px; border-left: 1px solid rgba(255, 255, 255, .08); }
.nav-group.open .nav-children { grid-template-rows: 1fr; }
.nav-children a { padding: 8px 12px; font-size: .86rem; }
.nav-children a.active::before { left: -15px; }
.nav-children a.sub-link { padding: 6px 12px 6px 14px; font-size: .8rem; font-weight: 500; }
.nav-children a.sub-link .dot { margin: 0 4px 0 2px; }
.nav-children a.new-link { color: #8fa0d8; }
.nav-children a.new-link i { font-size: .72rem; }
.nav-badge { margin-left: auto; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 20px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-size: .7rem; font-weight: 800; display: grid; place-items: center; }

/* ---------------------------------------------------------------- Projects */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.proj { --pc: var(--brand); display: block; color: var(--text); padding: 20px; position: relative; overflow: hidden; transition: transform .3s var(--ease), box-shadow .3s; }
.proj::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 4px; background: linear-gradient(90deg, var(--pc), color-mix(in srgb, var(--pc) 40%, #fff)); }
.proj:hover { transform: translateY(-5px); box-shadow: 0 22px 44px -20px color-mix(in srgb, var(--pc) 60%, transparent); color: var(--text); }
.proj .pj-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.proj .pj-name { font-weight: 800; font-size: 1.05rem; line-height: 1.3; }
.proj .pj-client { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.proj .pj-desc { font-size: .84rem; color: var(--muted); margin: 12px 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.proj .pj-prog { display: flex; justify-content: space-between; font-size: .78rem; font-weight: 700; margin-top: 18px; }
.proj .pj-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); font-size: .78rem; color: var(--muted); }
.ring { --p: 0; --pc: var(--brand); width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto;
    background: conic-gradient(var(--pc) calc(var(--p) * 1%), var(--surface-3) 0); position: relative; font-size: .74rem; font-weight: 800; }
.ring::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--surface); }
.ring span { position: relative; }
.stack { display: flex; }
.stack .avatar { width: 26px; height: 26px; border-radius: 50%; font-size: .62rem; border: 2px solid var(--surface); margin-left: -7px; }
.stack .avatar:first-child { margin-left: 0; }

/* ---------------------------------------------------------------- Kanban */
.board { display: grid; grid-template-columns: repeat(4, minmax(250px, 1fr)); gap: 16px; overflow-x: auto; padding-bottom: 6px; align-items: start; }
.col { background: var(--surface-2); border: 1px solid var(--border); border-radius: 18px; padding: 12px; min-height: 160px; transition: background .2s, border-color .2s; }
.col.over { background: color-mix(in srgb, var(--cc) 10%, var(--surface-2)); border-color: var(--cc); border-style: dashed; }
.col-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 12px; font-weight: 800; font-size: .86rem; }
.col-head .cdot { width: 10px; height: 10px; border-radius: 50%; background: var(--cc); display: inline-block; margin-right: 8px; box-shadow: 0 0 0 4px color-mix(in srgb, var(--cc) 20%, transparent); }
.col-head .count { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 1px 9px; font-size: .74rem; color: var(--muted); }
.col-body { display: flex; flex-direction: column; gap: 10px; min-height: 60px; }
.tcard { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 13px 14px; box-shadow: var(--shadow); cursor: pointer; transition: transform .2s var(--ease), box-shadow .2s, opacity .2s; position: relative; }
.tcard[draggable="true"] { cursor: grab; }
.tcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.tcard.dragging { opacity: .45; transform: rotate(2deg); }
.tcard .tc-proj { font-size: .7rem; font-weight: 700; color: var(--pc, var(--brand)); display: flex; gap: 6px; align-items: center; text-transform: uppercase; letter-spacing: .04em; }
.tcard .tc-proj::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--pc, var(--brand)); }
.tcard .tc-title { font-weight: 700; margin-top: 6px; line-height: 1.35; }
.tcard.done .tc-title { text-decoration: line-through; color: var(--muted); }
.tcard .tc-foot { display: flex; align-items: center; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.tcard .tc-foot .avatar { width: 24px; height: 24px; border-radius: 50%; font-size: .6rem; margin-left: auto; }
.duetag { font-size: .72rem; font-weight: 700; color: var(--muted); display: inline-flex; gap: 4px; align-items: center; }
.duetag.late { color: var(--red); }
.duetag.soon { color: #c27803; }
.prio { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.prio-low { background: #94a3b8; } .prio-medium { background: var(--blue); } .prio-high { background: var(--amber); } .prio-urgent { background: var(--red); }
.col-add { width: 100%; margin-top: 10px; padding: 9px; border-radius: 12px; border: 1.5px dashed var(--border); background: transparent; color: var(--muted); font: inherit; font-weight: 700; font-size: .8rem; cursor: pointer; }
.col-add:hover { border-color: var(--cc); color: var(--cc); }
@media (max-width: 992px) { .board { grid-template-columns: repeat(4, 270px); } }

/* ---------------------------------------------------------------- Daily work */
.points { display: flex; flex-direction: column; gap: 10px; }
.point-row { display: flex; align-items: center; gap: 10px; animation: rise .35s var(--ease); }
.point-row .pn { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: .78rem; background: var(--brand-soft); color: var(--brand); flex: 0 0 auto; }
.timeline { padding: 6px 0; }
.tl-item { display: flex; gap: 14px; padding: 12px 20px; color: var(--text); border-top: 1px solid var(--border); transition: background .15s; }
.tl-item:first-child { border-top: 0; }
a.tl-item:hover, .tl-item.on { background: var(--surface-2); color: var(--text); }
.tl-date { width: 46px; flex: 0 0 auto; text-align: center; border-radius: 12px; background: var(--brand-soft); color: var(--brand); padding: 6px 0; height: fit-content; }
.tl-date b { display: block; font-size: 1.1rem; line-height: 1.1; }
.tl-date span { font-size: .66rem; font-weight: 700; text-transform: uppercase; }
.tl-body { flex: 1; min-width: 0; }
.tl-head { font-weight: 700; display: flex; justify-content: space-between; gap: 8px; font-size: .88rem; }
.tl-head .faint { font-size: .74rem; font-weight: 600; }
.tl-body ul { margin: 6px 0 0; padding-left: 18px; font-size: .84rem; color: var(--muted); }
.wpoints { margin: 12px 0 0; padding-left: 20px; font-size: .87rem; }
.wpoints li { padding: 3px 0; }
.wpoints li::marker { color: var(--brand); font-weight: 800; }
.work-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.wcard { padding: 18px; }
.wcard.missing { border-style: dashed; box-shadow: none; }
.wc-head { display: flex; align-items: center; gap: 12px; }

/* ---------------------------------------------------------------- Instructions */
.instr { padding: 18px 20px; border-top: 1px solid var(--border); display: flex; gap: 14px; }
.instr:first-child { border-top: 0; }
.instr .i-icon { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; flex: 0 0 auto; background: var(--brand-soft); color: var(--brand); }
.instr.urgent .i-icon { background: var(--red-soft); color: var(--red); }
.instr.important .i-icon { background: var(--amber-soft); color: var(--amber); }
.instr.done { opacity: .65; }
.instr .i-title { font-weight: 800; font-size: .98rem; }
.instr .i-body { margin: 6px 0 0; white-space: pre-wrap; font-size: .88rem; color: var(--text); }
.instr .i-meta { font-size: .76rem; color: var(--muted); margin-top: 8px; display: flex; gap: 6px 12px; flex-wrap: wrap; align-items: center; }
.instr .i-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.ack-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.nav-badge.red { background: linear-gradient(135deg, #f43f5e, #f97316); }
.mod-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mod { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 13px; cursor: pointer; transition: all .2s; }
.mod input { accent-color: var(--brand); width: 16px; height: 16px; }
.mod b { display: block; font-size: .86rem; color: var(--text); }
.mod small { display: block; font-size: .72rem; color: var(--muted); font-weight: 500; }
.mod:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
@media (max-width: 640px) { .mod-grid { grid-template-columns: 1fr; } }

/* ==========================================================================
   Compact, professional type scale (v1.2)
   ========================================================================== */
body { font-size: 13px; }
.side-brand { padding: 20px 20px 16px; flex-direction: column; align-items: flex-start; gap: 8px; }
.brand-logo { width: 178px; height: auto; display: block; filter: drop-shadow(0 6px 18px rgba(34, 193, 238, .18)); }
.brand-tag { font-size: .62rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: #7dd3fc; background: rgba(34, 193, 238, .1); border: 1px solid rgba(34, 193, 238, .25); padding: 2px 8px; border-radius: 20px; }
.nav a, .nav-parent { font-size: .82rem; padding: 8px 11px; }
.nav-children a { font-size: .8rem; padding: 7px 11px; }
.nav a i, .nav-parent i:first-child { font-size: .85rem; }
.side-foot .who b { font-size: .8rem; }
.topbar { padding: 10px 26px; }
.topbar .crumb { font-size: .9rem; }
.icon-btn { width: 36px; height: 36px; font-size: .85rem; border-radius: 10px; }
.content { padding: 22px 26px 50px; }

.page-head { margin-bottom: 18px; }
.page-head h1 { font-size: 1.32rem; font-weight: 700; }
.page-head p { font-size: .84rem; }
.btn { padding: 8px 14px; font-size: .8rem; border-radius: 10px; font-weight: 600; }
.btn-sm { padding: 6px 10px; font-size: .74rem; }
.card { border-radius: 14px; }
.card-head { padding: 13px 18px; }
.card-head h3 { font-size: .86rem; font-weight: 700; }
.card-head h3 .ic { width: 26px; height: 26px; font-size: .72rem; border-radius: 8px; }
.card-body { padding: 16px 18px; }

.kpi { padding: 16px 18px; }
.kpi .k-label { font-size: .66rem; letter-spacing: .07em; }
.kpi .k-value { font-size: 1.38rem; font-weight: 700; margin-top: 4px; }
.kpi .k-sub { font-size: .72rem; margin-top: 8px; }
.kpi .k-icon { width: 36px; height: 36px; border-radius: 10px; font-size: .88rem; }

.products-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.pcard { padding: 18px; border-radius: 16px; }
.p-icon { width: 42px; height: 42px; border-radius: 12px; font-size: 1.05rem; }
.p-icon.sm { width: 30px; height: 30px; border-radius: 9px; font-size: .76rem; }
.pcard .p-top { gap: 12px; }
.pcard .p-name { font-size: .9rem; font-weight: 700; }
.pcard .p-type { font-size: .62rem; }
.pcard .p-stats { margin-top: 16px; }
.pcard .p-big { font-size: 1.6rem; font-weight: 700; }
.pcard .p-big-label { font-size: .72rem; margin-top: 4px; }
.pcard .p-money b { font-size: .98rem; font-weight: 700; }
.pcard .p-money span { font-size: .68rem; }
.pcard .p-foot { font-size: .72rem; margin-top: 14px; padding-top: 11px; }
.pcard p.small { font-size: .74rem; }
.pcard.add { min-height: 180px; }
.pcard.add .plus { width: 44px; height: 44px; font-size: 1rem; }

.t th { font-size: .64rem; padding: 9px 14px; }
.t td { padding: 10px 14px; font-size: .8rem; }
.t .sub { font-size: .7rem; }
.pill { font-size: .68rem; padding: 3px 9px; }
.pay-btn { font-size: .68rem; }
.seg a, .seg button { font-size: .76rem; padding: 6px 12px; }
.month-nav input { font-size: .82rem; width: 136px; }
.month-nav a { width: 28px; height: 28px; }
.input, select.input, textarea.input { padding: 8px 11px; font-size: .82rem; border-radius: 9px; }
.field label { font-size: .72rem; }
.modal .m-head h3 { font-size: .98rem; }
.modal .dialog { border-radius: 16px; }
.list-item { padding: 10px 18px; }
.list-item .title { font-size: .84rem; }
.list-item .meta { font-size: .72rem; }
.cat-row .top { font-size: .8rem; }
.hero { padding: 22px; border-radius: 18px; }
.hero h1 { font-size: 1.35rem; }
.hero .h-meta { font-size: .78rem; }
.avatar.lg { width: 76px; height: 76px; border-radius: 22px; font-size: 1.6rem; }
.dl { font-size: .82rem; }
.mtile { padding: 12px; border-radius: 13px; }
.mtile .mn { font-size: .86rem; }
.ecard .avatar { width: 60px; height: 60px; border-radius: 18px; font-size: 1.15rem; }
.ecard .en { font-size: .9rem; }
.ecard .ed { font-size: .76rem; }
.proj .pj-name { font-size: .92rem; font-weight: 700; }
.proj .pj-desc { font-size: .78rem; }
.tcard .tc-title { font-size: .82rem; font-weight: 600; }
.col-head { font-size: .8rem; }
.tl-head { font-size: .82rem; }
.tl-body ul, .wpoints { font-size: .8rem; }
.instr .i-title { font-size: .88rem; }
.instr .i-body { font-size: .82rem; }
.toast { font-size: .82rem; }
@media (max-width: 640px) { .kpi .k-value { font-size: 1.2rem; } .page-head h1 { font-size: 1.15rem; } }

/* ==========================================================================
   Login — Ranker Solutions software house
   ========================================================================== */
.lg-body { background: var(--bg); }
.lg-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(380px, 1fr); }
.lg-art { position: relative; overflow: hidden; color: #e6f6fb; padding: 34px 44px; display: flex; flex-direction: column; gap: 22px;
    background: radial-gradient(900px 500px at 15% -10%, rgba(34, 193, 238, .22), transparent 60%), radial-gradient(700px 500px at 110% 110%, rgba(91, 91, 246, .35), transparent 60%), #05080f; }
.lg-grid { position: absolute; inset: 0; opacity: .5; pointer-events: none;
    background-image: linear-gradient(rgba(94, 214, 240, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(94, 214, 240, .07) 1px, transparent 1px);
    background-size: 44px 44px; mask-image: radial-gradient(ellipse at 50% 40%, #000 30%, transparent 75%); animation: gridMove 18s linear infinite; }
@keyframes gridMove { to { background-position: 44px 44px, 44px 44px; } }
.lg-glow { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; pointer-events: none; animation: drift 16s ease-in-out infinite; }
.lg-glow.g1 { width: 300px; height: 300px; background: #22c1ee; top: 18%; right: 8%; }
.lg-glow.g2 { width: 260px; height: 260px; background: #5b5bf6; bottom: 6%; left: 10%; animation-delay: -7s; }
.lg-top { position: relative; z-index: 2; }
.lg-logo { width: 230px; height: auto; display: block; filter: drop-shadow(0 8px 30px rgba(34, 193, 238, .25)); animation: rise .8s var(--ease) both; }

.lg-stage { position: relative; z-index: 2; flex: 1; min-height: 300px; display: grid; place-items: center; }
.lg-editor { width: min(520px, 92%); border-radius: 14px; background: rgba(10, 16, 30, .82); border: 1px solid rgba(94, 214, 240, .18); backdrop-filter: blur(10px);
    box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .03) inset; overflow: hidden; animation: rise .9s .15s var(--ease) both, floaty 7s 1s ease-in-out infinite; }
.ed-bar { display: flex; align-items: center; gap: 7px; padding: 10px 14px; background: rgba(255, 255, 255, .03); border-bottom: 1px solid rgba(255, 255, 255, .06); font-size: .72rem; color: #8ba3b8; }
.ed-bar span { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; } .ed-bar span:nth-child(2) { background: #febc2e; } .ed-bar span:nth-child(3) { background: #28c840; margin-right: 8px; }
.ed-bar b { color: #d5e6f0; font-weight: 600; margin-right: auto; }
.ed-code { margin: 0; padding: 14px 16px; min-height: 190px; font: 12.5px/1.7 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace; color: #cfe3ee; white-space: pre; overflow: hidden; }
.ed-code .ln { display: inline-block; width: 22px; color: #3d5266; user-select: none; }
.ed-code k { color: #c792ea; } .ed-code c { color: #5ed6f0; } .ed-code f { color: #82aaff; } .ed-code v { color: #f78c6c; } .ed-code s { color: #c3e88d; text-decoration: none; } .ed-code m { color: #5c7080; font-style: italic; }
.ed-code .caret { display: inline-block; width: 7px; height: 15px; background: #5ed6f0; vertical-align: -2px; margin-left: 1px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.ed-status { display: flex; gap: 14px; padding: 8px 14px; font-size: .68rem; color: #8ba3b8; border-top: 1px solid rgba(255, 255, 255, .06); background: rgba(34, 193, 238, .06); }
.ed-status .ok { color: #4ade80; } .ed-status .cur { margin-left: auto; }
.lg-bars { position: absolute; left: 4%; bottom: 4%; display: flex; align-items: flex-end; gap: 7px; height: 110px; }
.lg-bars span { width: 22px; height: var(--h); border-radius: 6px; background: linear-gradient(180deg, #5ed6f0, rgba(34, 193, 238, .25)); transform-origin: bottom; animation: grow 2.6s var(--ease) infinite alternate; }
.lg-bars span:nth-child(2) { animation-delay: .25s; } .lg-bars span:nth-child(3) { animation-delay: .5s; }
.lg-bars i { color: #5ed6f0; font-size: 1.6rem; margin-left: 4px; align-self: flex-start; animation: floaty 2.6s ease-in-out infinite; }
@keyframes grow { from { transform: scaleY(.35); } to { transform: scaleY(1); } }
.chip { position: absolute; display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 30px; font-size: .74rem; font-weight: 600; color: #dff6fc;
    background: rgba(13, 22, 40, .75); border: 1px solid rgba(94, 214, 240, .22); backdrop-filter: blur(8px); box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .6); animation: drift 12s ease-in-out infinite; }
.chip i { color: #5ed6f0; }
.chip.c1 { top: 4%; left: 8%; } .chip.c2 { top: 12%; right: 4%; animation-delay: -3s; } .chip.c3 { bottom: 14%; right: 9%; animation-delay: -6s; }
.chip.c4 { top: 46%; left: 0; animation-delay: -8s; } .chip.c5 { bottom: 2%; left: 42%; animation-delay: -4s; }

.lg-copy { position: relative; z-index: 2; animation: rise .9s .3s var(--ease) both; }
.lg-kicker { display: inline-flex; gap: 8px; align-items: center; font-size: .7rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #5ed6f0; }
.lg-copy h2 { font-size: 1.75rem; line-height: 1.2; font-weight: 800; margin: 8px 0 14px; color: #fff; max-width: 520px; }
.lg-copy h2 span { background: linear-gradient(90deg, #5ed6f0, #8b9cff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lg-services { display: flex; flex-wrap: wrap; gap: 7px; }
.lg-services span { font-size: .72rem; font-weight: 600; padding: 5px 10px; border-radius: 20px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .08); color: #c4d6e2; }
.lg-services i { color: #5ed6f0; margin-right: 4px; }
.lg-contact { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 16px; font-size: .76rem; }
.lg-contact a, .lg-contact span { color: #8ba3b8; } .lg-contact a:hover { color: #5ed6f0; } .lg-contact i { color: #5ed6f0; margin-right: 5px; }

.lg-form { display: grid; place-items: center; padding: 40px 28px; }
.lg-box { width: 100%; max-width: 360px; animation: rise .7s .1s var(--ease) both; }
.lg-icon { width: 54px; height: 54px; padding: 9px; border-radius: 15px; background: #0b1020; box-shadow: 0 12px 30px -10px rgba(34, 193, 238, .6); }
.lg-box h1 { font-size: 1.35rem; font-weight: 800; margin-top: 0; }
.lg-box > p { margin: 4px 0 0; font-size: .84rem; }
.lg-fields { display: flex; flex-direction: column; gap: 14px; margin-top: 22px; }
.in-ic { position: relative; }
.in-ic > i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: .8rem; pointer-events: none; }
.in-ic .input { padding: 11px 40px 11px 36px; font-size: .86rem; }
.in-ic .eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--faint); width: 32px; height: 32px; border-radius: 8px; cursor: pointer; }
.in-ic .eye:hover { color: var(--brand); background: var(--surface-2); }
.caps { margin-top: 6px; font-size: .72rem; font-weight: 600; color: #c27803; }
.lg-btn { padding: 12px; font-size: .86rem; margin-top: 4px; }
.lock-timer { margin-top: 6px; font-size: .78rem; font-weight: 600; }
.lock-timer b { font-family: 'JetBrains Mono', monospace; font-size: .9rem; }
.lg-secure { margin-top: 18px; font-size: .72rem; color: var(--muted); display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.lg-secure i { color: var(--green); }
.lg-foot { margin-top: 22px; font-size: .7rem; color: var(--faint); text-align: center; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 992px) {
    .lg-wrap { grid-template-columns: 1fr; }
    .lg-art { padding: 24px; min-height: auto; }
    .lg-stage, .lg-copy .lg-services, .lg-contact { display: none; }
    .lg-copy h2 { font-size: 1.2rem; margin-bottom: 0; }
    .lg-logo { width: 170px; }
}
/* v1.2 fixes */
.lg-bars { left: auto; right: 5%; bottom: 3%; height: 96px; }
.chip.c3 { right: auto; left: 5%; bottom: 8%; }
.chip.c5 { left: 38%; bottom: 1%; }
.products-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.pcard .p-foot > span { white-space: nowrap; }
.pcard .p-foot { flex-wrap: wrap; row-gap: 4px; }

/* ---------------------------------------------------------------- Quotations */
.q-mods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.q-mod { border: 1px solid var(--border); border-radius: 12px; padding: 10px; background: var(--surface-2); }
.q-mod-h { display: flex; gap: 6px; margin-bottom: 8px; }
.q-mod-h .input { font-weight: 700; }
.q-mod textarea { font-size: .78rem; line-height: 1.5; }
.q-rows { display: flex; flex-direction: column; gap: 10px; }
.q-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.q-row-main { display: flex; flex-direction: column; gap: 6px; }
.q-amt { width: 130px; text-align: right; font-variant-numeric: tabular-nums; }
.q-totals { margin-top: 14px; margin-left: auto; max-width: 380px; display: flex; flex-direction: column; gap: 8px; }
.q-totals > div { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: .84rem; }
.q-totals .grand { padding-top: 10px; border-top: 2px solid var(--brand-2); font-weight: 800; font-size: .95rem; }
.q-side { position: sticky; top: 76px; }
.q-sum { background: linear-gradient(135deg, #0b1020, #13203d); color: #e6f6fb; border: 0; }
.q-sum .muted { color: #8ba3b8; }
.q-big { font-size: 1.7rem; font-weight: 800; color: #5ed6f0; letter-spacing: -.02em; margin: 2px 0 4px; }
@media (max-width: 900px) { .q-mods { grid-template-columns: 1fr; } .q-row { grid-template-columns: 1fr; } .q-amt { width: 100%; } .q-side { position: static; } }

/* ---------- Daily work: project per point ---------- */
.point-head { display: grid; grid-template-columns: 28px 260px 1fr 30px; gap: 10px; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 6px; }
.point-row .psel { flex: 0 0 230px; width: 230px; }
.point-row .psel:invalid, .point-row .psel option[value=""] { color: var(--muted); }
.ptag { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px 1px 6px; border-radius: 999px; font-size: .68rem; font-weight: 700; background: var(--surface-2, rgba(99,102,241,.08)); border: 1px solid var(--border); color: var(--text); white-space: nowrap; vertical-align: 1px; margin-right: 4px; max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
.ptag i { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }
a.ptag:hover { border-color: var(--brand); color: var(--brand); }
.ptag.gen { color: var(--muted); }
.plist { list-style: none; padding: 0; margin: 6px 0 0; }
.plist li { padding: 3px 0; }
.note-box { padding: 10px 14px; border-radius: 12px; background: var(--brand-soft); color: var(--text); font-size: .8rem; }
.note-box a { font-weight: 700; }
.mb-s { margin-bottom: 12px; }
@media (max-width: 720px) {
    .point-head { display: none; }
    .point-row { flex-wrap: wrap; }
    .point-row .psel { flex: 1 1 calc(100% - 80px); width: auto; }
    .point-row input.input { flex: 1 1 100%; order: 5; }
}
/* project work feed */
.pw-day { padding: 14px 20px; border-top: 1px solid var(--border); display: grid; grid-template-columns: 76px 1fr; gap: 14px; }
.pw-day:first-child { border-top: 0; }
.pw-date b { display: block; font-size: 1.15rem; font-weight: 800; line-height: 1; }
.pw-date span { font-size: .7rem; color: var(--muted); font-weight: 700; text-transform: uppercase; white-space: nowrap; }
.pw-person { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; }
.pw-person + .pw-person { border-top: 1px dashed var(--border); }
.pw-person .avatar { width: 30px; height: 30px; font-size: .7rem; flex: 0 0 auto; }
.pw-person .who { font-weight: 700; font-size: .82rem; }
.pw-person ul { margin: 2px 0 0; padding-left: 18px; font-size: .82rem; }
.pw-person ul li { padding: 1px 0; }
.pj-count { text-align: center; min-width: 52px; }
.pj-count b { display: block; font-size: 1.25rem; font-weight: 800; color: var(--pc, var(--brand)); line-height: 1.1; }
.pj-count span { font-size: .62rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.contrib { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.contrib + .contrib { border-top: 1px solid var(--border); }
.contrib .avatar { width: 30px; height: 30px; font-size: .7rem; }
.contrib .bar { flex: 1; height: 6px; margin: 0; }

/* Back button in the top bar */
.topbar .back-btn { width: auto; padding: 0 12px 0 10px; gap: 7px; display: inline-flex; align-items: center; font-size: .78rem; font-weight: 700; color: var(--text); text-decoration: none; margin-right: 4px; }
.topbar .back-btn:hover { color: var(--brand); }
@media (max-width: 640px) { .topbar .back-btn span { display: none; } .topbar .back-btn { padding: 0; width: 38px; justify-content: center; } }

/* My projects (Daily Work) */
.myproj { padding: 4px 16px 12px; }
.mp-row { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-top: 1px solid var(--border); }
.mp-row:first-child { border-top: 0; }
.mp-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--pc); flex: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--pc) 18%, transparent); }
.mp-name { font-weight: 700; font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-row.done .mp-name { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 50%, transparent); }
.mp-row .btn { flex: none; }

/* ---------- Minimal dashboard ---------- */
.dash-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.dash-head h1 { margin: 0; font-size: 1.25rem; font-weight: 800; letter-spacing: -.01em; }
.dash-head p { margin: 3px 0 0; color: var(--muted); font-size: .8rem; }
.dash-head p a { color: inherit; } .dash-head p a:hover { color: var(--brand); }
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin-bottom: 16px; }
.qbtn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); color: var(--text); font-size: .76rem; font-weight: 700; text-decoration: none; white-space: nowrap; transition: transform .15s, border-color .15s, box-shadow .15s; }
.qbtn i { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font-size: .78rem; color: var(--qc); background: color-mix(in srgb, var(--qc) 13%, transparent); }
.qbtn:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--qc) 45%, var(--border)); box-shadow: 0 6px 16px -10px var(--qc); color: var(--text); }
.strip { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 16px; padding: 0; overflow: hidden; }
.strip .st { padding: 14px 18px; border-left: 1px solid var(--border); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.strip .st:first-child { border-left: 0; }
.st-l { font-size: .68rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.strip b { font-size: 1.2rem; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; }
.st-s { font-size: .72rem; color: var(--muted); min-height: 20px; }
.st-s .delta { font-size: .7rem; }
.ptiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 10px; }
.ptile { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; color: var(--text); text-decoration: none; position: relative; overflow: hidden; transition: transform .15s, border-color .15s; }
.ptile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--pc); }
.ptile:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--pc) 40%, var(--border)); color: var(--text); }
.pt-body { flex: 1; min-width: 0; }
.pt-name { font-weight: 700; font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-meta { font-size: .74rem; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-meta b { color: var(--text); }
.pt-go { color: var(--faint, var(--muted)); font-size: .7rem; }
@media (max-width: 760px) { .strip { grid-template-columns: 1fr 1fr; } .strip .st:nth-child(3) { border-left: 0; } .strip .st:nth-child(n+3) { border-top: 1px solid var(--border); } .qbtn span { font-size: .74rem; } }
.strip a.st { color: inherit; text-decoration: none; transition: background .15s; }
.strip a.st:hover { background: color-mix(in srgb, var(--brand) 5%, transparent); }
.st-go { font-size: .6rem; opacity: 0; transform: translateX(-4px); transition: opacity .15s, transform .15s; margin-left: 2px; }
.strip a.st:hover .st-go { opacity: 1; transform: none; }
.strip:not(.links) .st-go { display: none; }

/* ---------- Sidebar search ---------- */
.side-search { position: relative; margin: 6px 14px 10px; }
.side-search > i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: .75rem; color: rgba(255, 255, 255, .45); pointer-events: none; }
.side-search input { width: 100%; height: 36px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .06); color: #fff; padding: 0 34px 0 32px; font: inherit; font-size: .8rem; outline: none; transition: border-color .15s, background .15s; }
.side-search input::placeholder { color: rgba(255, 255, 255, .45); }
.side-search input:focus { border-color: rgba(99, 102, 241, .8); background: rgba(255, 255, 255, .1); }
.side-search input::-webkit-search-cancel-button { display: none; }
.side-search kbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font: 600 .65rem/1 inherit; color: rgba(255, 255, 255, .5); border: 1px solid rgba(255, 255, 255, .18); border-radius: 5px; padding: 3px 6px; pointer-events: none; }
.side-search input:focus ~ kbd { display: none; }
.ss-results { position: absolute; z-index: 60; left: 0; top: calc(100% + 6px); width: 340px; max-width: calc(100vw - 28px); max-height: min(70vh, 520px); overflow: auto; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 24px 60px -18px rgba(15, 23, 42, .45); padding: 6px; }
.ss-g { font-size: .64rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); padding: 9px 10px 4px; }
.ss-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 9px; color: var(--text); text-decoration: none; }
.ss-item i { width: 26px; height: 26px; flex: none; border-radius: 8px; display: grid; place-items: center; font-size: .72rem; color: var(--brand); background: color-mix(in srgb, var(--brand) 11%, transparent); }
.ss-item span { min-width: 0; display: flex; flex-direction: column; }
.ss-item b { font-size: .8rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-item small { font-size: .7rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-item:hover, .ss-item.on { background: color-mix(in srgb, var(--brand) 9%, transparent); color: var(--text); }
.ss-all { border-top: 1px solid var(--border); margin-top: 4px; border-radius: 0 0 9px 9px; }
.ss-empty { padding: 14px 10px; font-size: .78rem; color: var(--muted); text-align: center; }
body.nav-collapsed .side-search { display: none; }

/* ---------- Employee profile ---------- */
.ehero { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; margin-bottom: 16px; }
.eh-cover { height: 86px; background: radial-gradient(420px 160px at 85% -20%, rgba(255, 255, 255, .25), transparent 70%), linear-gradient(120deg, var(--brand), var(--brand-2, #3b82f6)); }
.eh-row { display: flex; align-items: flex-start; gap: 18px; padding: 0 22px 18px; margin-top: -40px; flex-wrap: wrap; position: relative; }
.eh-avatar { width: 92px; height: 92px; flex: none; border-radius: 24px; border: 4px solid var(--surface); background: linear-gradient(135deg, var(--brand), var(--brand-2, #3b82f6)); color: #fff; display: grid; place-items: center; font-size: 1.7rem; font-weight: 800; object-fit: cover; box-shadow: 0 12px 26px -12px rgba(15, 23, 42, .45); }
.eh-main { flex: 1; min-width: 220px; padding-top: 50px; }
.eh-main h1 { margin: 0; font-size: 1.3rem; font-weight: 800; letter-spacing: -.01em; }
.eh-sub { color: var(--muted); font-size: .82rem; font-weight: 600; margin-top: 2px; }
.eh-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.eh-chips .pill { font-size: .68rem; }
.eh-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding-top: 52px; }
.sal-bars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; align-items: end; }
.sb { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.sb-v { font-size: .58rem; font-weight: 700; color: var(--muted); height: 12px; white-space: nowrap; }
.sb-bar { width: 100%; max-width: 30px; height: 110px; background: var(--surface-2); border-radius: 7px; display: flex; align-items: flex-end; overflow: hidden; }
.sb-bar span { width: 100%; border-radius: 7px; background: var(--amber); transition: height .8s var(--ease); }
.sb.full .sb-bar span { background: var(--green); }
.sb.future { opacity: .45; }
.sb-m { font-size: .64rem; font-weight: 700; color: var(--muted); }
.pf-sec { font-size: .66rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); margin: 16px 0 9px; }
.pf-sec:first-child { margin-top: 0; }
.pf-note { margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); white-space: pre-wrap; font-size: .82rem; }
.card-head .linkish { background: none; border: 0; color: var(--brand); font: inherit; font-size: .76rem; font-weight: 700; cursor: pointer; }
.strip .st .bar { display: block; }
@media (max-width: 640px) { .eh-row { margin-top: -34px; } .eh-main { padding-top: 0; flex-basis: 100%; } .eh-actions { padding-top: 0; } .eh-avatar { width: 76px; height: 76px; font-size: 1.4rem; } .sb-v { display: none; } }

/* client page */
.months { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; }
.mtile { display: block; width: 100%; min-height: 92px; }
.mtile .ms { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.mtile .ma { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eh-avatar.icon { font-size: 2rem; background: linear-gradient(135deg, var(--pc, var(--brand)), color-mix(in srgb, var(--pc, var(--brand)) 60%, #fff)); }
.ehero.tinted .eh-cover { background: radial-gradient(420px 160px at 85% -20%, rgba(255, 255, 255, .3), transparent 70%), linear-gradient(120deg, var(--pc, var(--brand)), color-mix(in srgb, var(--pc, var(--brand)) 55%, #22c1ee)); }
.mtile .mn { padding-right: 28px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eh-chips .pill { white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; }

/* Product card actions */
.p-foot .pc-actions { display: inline-flex; align-items: center; gap: 8px; }
.pc-open { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 10px; font-size: .76rem; font-weight: 700; color: #fff; text-decoration: none;
    background: linear-gradient(135deg, var(--pc, var(--brand)), color-mix(in srgb, var(--pc, var(--brand)) 70%, #000)); box-shadow: 0 6px 14px -8px var(--pc, var(--brand)); transition: transform .15s, box-shadow .15s; }
.pc-open i { font-size: .68rem; transition: transform .15s; }
.pc-open:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 10px 20px -10px var(--pc, var(--brand)); }
.pc-open:hover i { transform: translateX(3px); }
.pc-del { width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: .76rem; cursor: pointer; transition: all .15s; }
.pc-del:hover { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, var(--border)); background: var(--red-soft); }
.pcard .p-foot { align-items: center; }

/* Employee cards */
.ecard { display: flex; flex-direction: column; }
.ecard:hover { transform: translateY(-3px); }
.ecard .ec-top { display: block; color: var(--text); text-decoration: none; }
.ecard .ec-top:hover .en { color: var(--brand); }
.ec-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; margin-top: 10px; }
.ecard .ef { margin-top: auto; }
.ec-tags + .ef { margin-top: 14px; }
.ec-actions { display: flex; gap: 6px; margin-top: 14px; }
.ec-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; border-radius: 10px; font-size: .76rem; font-weight: 700; text-decoration: none; border: 1px solid var(--border); background: var(--surface); color: var(--muted); transition: all .15s; }
.ec-btn.primary { flex: 1; color: #fff; border: 0; background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 65%, #3b82f6)); box-shadow: 0 6px 14px -9px var(--brand); }
.ec-btn.primary:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 10px 18px -10px var(--brand); }
.ec-btn.icon { width: 34px; flex: none; }
.ec-btn.icon:hover { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); background: var(--brand-soft); }
.ec-btn.wa:hover { color: #16a34a; border-color: rgba(34, 197, 94, .45); background: rgba(34, 197, 94, .1); }
.mod-chips { display: flex; flex-wrap: wrap; gap: 4px; max-width: 250px; }
.mod-chips .pill { font-size: .66rem; padding: 3px 8px; gap: 5px; }

/* ---------- Attendance ---------- */
.att-list { padding: 4px 0; }
.att-row { display: grid; grid-template-columns: 30px minmax(140px, 1fr) 62px 62px 62px 108px 30px; gap: 12px; align-items: center; padding: 10px 18px; border-top: 1px solid var(--border); }
.att-row:first-child { border-top: 0; }
.ar-who { min-width: 0; } .ar-who .title { font-weight: 700; font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.ar-time span { display: block; font-size: .6rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.ar-time b { font-size: .84rem; font-variant-numeric: tabular-nums; }
.ar-st { justify-self: start; }
@media (max-width: 760px) { .att-row { grid-template-columns: 30px 1fr auto 30px; } .att-row .ar-time { display: none; } }
.dev-row { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--border); margin-bottom: 8px; flex-wrap: wrap; }
details.setup { margin-top: 6px; }
details.setup summary { cursor: pointer; font-weight: 700; color: var(--brand); font-size: .78rem; }
details.setup ol { padding-left: 18px; margin: 10px 0; line-height: 1.6; }
details.setup code { background: var(--surface-2); padding: 1px 6px; border-radius: 5px; font-size: .76rem; }
.punch-feed { max-height: 340px; overflow: auto; padding: 4px 0 8px; }
.pf-row { display: grid; grid-template-columns: 48px 1fr auto; gap: 10px; padding: 6px 18px; font-size: .8rem; align-items: center; }
.pf-row b { color: var(--brand); }
.day-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.day-pick label { cursor: pointer; } .day-pick input { display: none; }
.day-pick span { display: inline-block; padding: 7px 12px; border-radius: 9px; border: 1px solid var(--border); font-size: .78rem; font-weight: 700; color: var(--muted); }
.day-pick input:checked + span { background: var(--brand-soft); color: var(--brand); border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); }

/* status chips (register + legend) */
.ac { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; font: 700 .62rem/1 inherit; border: 0; padding: 0; background: var(--surface-2); color: var(--muted); }
button.ac { cursor: pointer; transition: transform .12s; } button.ac:hover { transform: scale(1.18); box-shadow: 0 4px 10px -4px rgba(0, 0, 0, .3); }
.ac.P { background: var(--green-soft); color: var(--green); }
.ac.L, .ac.HD { background: var(--amber-soft); color: #c27803; }
.ac.A { background: var(--red-soft); color: var(--red); }
.ac.LV { background: var(--blue-soft); color: var(--blue); }
.ac.H { background: var(--surface-3, var(--surface-2)); color: var(--text); }
.ac.OFF { background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 3px, transparent 3px, transparent 6px); }
.ac.manual { box-shadow: inset 0 0 0 1.5px currentColor; }
.att-legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: .7rem; color: var(--muted); font-weight: 600; }
.att-legend span { display: inline-flex; align-items: center; gap: 5px; } .att-legend .ac { width: 14px; height: 14px; border-radius: 4px; }
.att-reg th, .att-reg td { padding: 6px 2px !important; text-align: center; }
.att-reg th { font-size: .62rem; } .att-reg th span { display: block; font-size: .7rem; color: var(--text); } .att-reg th small { font-size: .56rem; color: var(--muted); font-weight: 600; }
.att-reg th.off { opacity: .55; } .att-reg th.today span { color: #fff; background: var(--brand); border-radius: 6px; padding: 1px 4px; display: inline-block; }
.att-reg .nm { text-align: left !important; padding-left: 18px !important; position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 170px; white-space: nowrap; }
.att-reg thead .nm { background: var(--surface-2); }
.att-reg .tt { font-weight: 800; font-size: .76rem; min-width: 30px; }
/* one-person calendar */
.att-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 8px; margin-bottom: 14px; }
.att-sum div { background: var(--surface-2); border-radius: 12px; padding: 9px 12px; }
.att-sum b { display: block; font-size: 1.1rem; font-weight: 800; } .att-sum span { font-size: .66rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.att-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.att-cal .ah { font-size: .64rem; font-weight: 800; color: var(--muted); text-align: center; text-transform: uppercase; letter-spacing: .06em; padding-bottom: 2px; }
.att-cal .ad { min-height: 64px; border-radius: 11px; padding: 6px 8px; background: var(--surface-2); position: relative; border: 1px solid transparent; }
.att-cal .ad.blank { background: none; }
.att-cal .dn { font-weight: 800; font-size: .78rem; }
.att-cal .io { display: block; font-size: .64rem; font-weight: 700; margin-top: 4px; line-height: 1.35; font-variant-numeric: tabular-nums; }
.att-cal .s-P { background: var(--green-soft); color: var(--green); }
.att-cal .s-L, .att-cal .s-HD { background: var(--amber-soft); color: #c27803; }
.att-cal .s-A { background: var(--red-soft); color: var(--red); }
.att-cal .s-LV { background: var(--blue-soft); color: var(--blue); }
.att-cal .s-OFF, .att-cal .s-H { background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 4px, transparent 4px, transparent 8px); color: var(--muted); }
.att-cal .s-none { opacity: .5; }
.att-cal .today { border-color: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 25%, transparent); }
.att-cal.compact { gap: 4px; } .att-cal.compact .ad { min-height: 0; aspect-ratio: 1; display: grid; place-items: center; padding: 0; border-radius: 8px; } .att-cal.compact .dn { font-size: .68rem; }
.att-reg .ac { width: 21px; height: 21px; font-size: .58rem; border-radius: 6px; }
.att-reg th, .att-reg td { padding: 5px 1px !important; }
.att-reg .nm { min-width: 150px; }
/* outside click on a form window: small shake instead of closing */
.modal .dialog.nudge { animation: nudge .38s ease; }
@keyframes nudge { 0%, 100% { translate: 0; } 20% { translate: -7px; } 40% { translate: 6px; } 60% { translate: -4px; } 80% { translate: 2px; } }

/* ---------- Instruction alert pop-up ---------- */
.icon-btn.bell { position: relative; }
.bell-n { position: absolute; top: -4px; right: -4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--red); color: #fff; font-size: .6rem; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--surface); }
.bell-n[hidden] { display: none; }
.ialert { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 20px; }
.ialert[hidden] { display: none; }
.ia-back { position: absolute; inset: 0; background: rgba(8, 11, 24, .6); backdrop-filter: blur(5px); animation: iaFade .25s ease; }
.ia-card { position: relative; width: 100%; max-width: 480px; background: var(--surface); color: var(--text); border-radius: 20px; padding: 22px 24px 18px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .55); border-top: 5px solid var(--brand); animation: iaPop .45s cubic-bezier(.2, 1.4, .4, 1); }
.ia-card.p-important { border-top-color: var(--amber); } .ia-card.p-urgent { border-top-color: var(--red); }
.ia-top { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.ia-ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 1.15rem; background: var(--brand-soft); color: var(--brand); animation: iaRing 1.2s ease 0.3s 2; }
.p-important .ia-ic { background: var(--amber-soft); color: #c27803; } .p-urgent .ia-ic { background: var(--red-soft); color: var(--red); }
.ia-lbl { font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
.p-important .ia-lbl { color: #c27803; } .p-urgent .ia-lbl { color: var(--red); }
.ia-from { font-size: .78rem; color: var(--muted); margin-top: 2px; }
.ia-card h3 { margin: 0 0 8px; font-size: 1.12rem; font-weight: 800; line-height: 1.35; }
.ia-card p { margin: 0; font-size: .86rem; color: var(--muted); line-height: 1.55; max-height: 220px; overflow: auto; }
.ia-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.ia-perm { display: block; width: 100%; margin-top: 12px; padding: 8px; border: 1px dashed var(--border); border-radius: 10px; background: none; color: var(--brand); font: 600 .74rem inherit; cursor: pointer; }
.ia-perm:hover { background: var(--brand-soft); }
@keyframes iaFade { from { opacity: 0; } }
@keyframes iaPop { from { opacity: 0; transform: translateY(24px) scale(.94); } }
@keyframes iaRing { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(-14deg); } 30% { transform: rotate(12deg); } 45% { transform: rotate(-8deg); } 60% { transform: rotate(5deg); } }
@media (max-width: 520px) { .ia-actions .btn { flex: 1; justify-content: center; } }

/* "Turn on notifications" ask card */
.push-ask { position: fixed; right: 20px; bottom: 20px; z-index: 250; width: min(380px, calc(100vw - 32px)); display: grid; grid-template-columns: 42px 1fr; gap: 12px; align-items: start;
    background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 16px; padding: 16px; box-shadow: 0 24px 60px -18px rgba(15, 23, 42, .45); animation: iaPop .45s cubic-bezier(.2, 1.4, .4, 1); transition: opacity .3s, transform .3s; }
.push-ask.out { opacity: 0; transform: translateY(16px); }
.pa-ic { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-size: 1.05rem; animation: iaRing 1.2s ease .6s 2; }
.pa-t b { display: block; font-size: .9rem; } .pa-t span { font-size: .78rem; color: var(--muted); line-height: 1.45; }
.pa-b { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; }
[hidden] { display: none !important; }
.pc-incharge { margin-top: 10px; font-size: .74rem; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.pc-incharge b { color: var(--text); }
.who-c { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.who-c b { font-size: .82rem; }
.wa-btn { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; background: #22c55e; color: #fff; font-size: .95rem; box-shadow: 0 6px 14px -8px #16a34a; transition: transform .15s; }
.wa-btn:hover { color: #fff; transform: scale(1.1); }
.who-c { min-width: 170px; } #clientTable td { vertical-align: middle; }

/* Instruction recipients picker */
.to-pick { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.tp-top { display: flex; gap: 8px; align-items: center; padding: 8px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.tp-top .input { flex: 1; }
.tp-all input, .tp-person input { display: none; }
.tp-all span { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); font-size: .78rem; font-weight: 700; cursor: pointer; white-space: nowrap; color: var(--muted); }
.tp-all input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.tp-list { max-height: 220px; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px; padding: 8px; }
.tp-person { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 10px; cursor: pointer; border: 1px solid transparent; }
.tp-person:hover { background: var(--surface-2); }
.tp-n { flex: 1; min-width: 0; font-size: .8rem; font-weight: 700; display: flex; flex-direction: column; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-n small { font-size: .66rem; color: var(--muted); font-weight: 600; }
.tp-tick { font-size: .7rem; color: transparent; width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--border); display: grid; place-items: center; flex: none; }
.tp-person:has(input:checked) { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 35%, transparent); }
.tp-person:has(input:checked) .tp-tick { background: var(--brand); border-color: var(--brand); color: #fff; }

/* Bulk edit grid */
.bulk-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 3; }
.bulk-t td { padding: 5px 6px !important; }
.bulk-t .input.sm { height: 32px; font-size: .78rem; padding: 0 8px; }
.bulk-t tr.dirty td:first-child { box-shadow: inset 3px 0 0 var(--amber); }
.bulk-t .input.changed { border-color: var(--amber); background: color-mix(in srgb, var(--amber) 9%, var(--surface)); }

/* ---------- Expense proofs ---------- */
.proof-drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px; border: 1.5px dashed var(--border); border-radius: 12px; cursor: pointer; text-align: center; color: var(--muted); transition: all .15s; }
.proof-drop:hover, .proof-drop.over { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.proof-drop input { display: none; }
.proof-drop i { font-size: 1.3rem; color: var(--brand); }
.proof-drop span { font-size: .8rem; } .proof-drop b { color: var(--brand); } .proof-drop small { font-size: .68rem; }
.proof-new, .proof-existing { display: grid; gap: 6px; margin-top: 8px; }
.proof-existing { margin: 0 0 8px; }
.pf { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.pf-th { width: 40px; height: 40px; flex: none; border-radius: 8px; overflow: hidden; display: grid; place-items: center; background: var(--surface-2); color: var(--red); border: 0; padding: 0; cursor: pointer; font-size: 1.1rem; }
.pf-th img { width: 100%; height: 100%; object-fit: cover; }
.pf-n { flex: 1; min-width: 0; font-size: .78rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; flex-direction: column; }
.pf-n small { color: var(--muted); font-weight: 500; font-size: .68rem; }
.proof-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--brand); font: 700 .72rem inherit; cursor: pointer; flex: none; }
.proof-chip:hover { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 35%, var(--border)); }
.pv { position: fixed; inset: 0; z-index: 280; display: grid; place-items: center; padding: 18px; }
.pv-back { position: absolute; inset: 0; background: rgba(8, 11, 24, .82); }
.pv-box { position: relative; width: min(1000px, 100%); height: min(88vh, 900px); background: var(--surface); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .6); }
.pv-head { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.pv-head b { font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40%; }
.pv-stage { flex: 1; min-height: 0; position: relative; display: grid; place-items: center; background: repeating-conic-gradient(var(--surface-2) 0% 25%, var(--surface) 0% 50%) 50% / 22px 22px; }
.pv-stage > div { width: 100%; height: 100%; display: grid; place-items: center; }
.pv-stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pv-stage iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.pv-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(15, 23, 42, .6); color: #fff; cursor: pointer; z-index: 2; }
.pv-nav.prev { left: 12px; } .pv-nav.next { right: 12px; } .pv-nav:hover { background: var(--brand); }
.pv-thumbs { display: flex; gap: 6px; padding: 8px 12px; border-top: 1px solid var(--border); overflow-x: auto; }
.pv-thumbs:empty { display: none; }
.pv-thumbs button { width: 54px; height: 54px; flex: none; border-radius: 8px; overflow: hidden; border: 2px solid transparent; padding: 0; background: var(--surface-2); color: var(--red); cursor: pointer; }
.pv-thumbs button.on { border-color: var(--brand); } .pv-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.pv-stage { overflow: hidden; }
.pv-stage > div { position: absolute; inset: 0; padding: 14px; }
.pv-stage img { max-width: 100%; max-height: 100%; width: auto; height: auto; box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .35); }
.pv-stage iframe { position: absolute; inset: 0; }
.pv-stage > div { display: flex; align-items: center; justify-content: center; } .pv-stage img { min-width: 0; min-height: 0; object-fit: contain; }
.course-sum { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: .8rem; } .course-sum i { color: var(--brand); margin-right: 4px; }
/* period picker */
.per-nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.per-range { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 5px 6px; }
.per-range .input.sm { height: 32px; width: auto; }

/* ---------- client fee history timeline ---------- */
.feetl{padding:6px 20px 16px}
.fee-row{position:relative;display:flex;align-items:center;gap:12px;padding:12px 0 12px 26px}
.fee-row::before{content:"";position:absolute;left:6px;top:0;bottom:0;width:2px;background:var(--border)}
.fee-row:first-child::before{top:50%}
.fee-row:last-child::before{bottom:50%}
.fee-row:only-child::before{display:none}
.fee-dot{position:absolute;left:0;top:50%;width:14px;height:14px;margin-top:-7px;border-radius:50%;background:var(--surface);border:3px solid var(--border)}
.fee-row.now .fee-dot{border-color:var(--brand);background:var(--brand);box-shadow:0 0 0 4px color-mix(in srgb,var(--brand) 20%,transparent)}
.fee-row.next .fee-dot{border-color:var(--amber);border-style:dashed}
.fee-row.old{opacity:.72}
.fee-main{flex:1;min-width:0;display:flex;flex-wrap:wrap;align-items:center;gap:6px 8px}
.fee-main .sub{flex-basis:100%;font-size:.78rem;color:var(--muted)}
.fee-main .pill.sm{font-size:.68rem;padding:2px 8px}
.card.mt{margin-top:18px}

/* ---------- daily work screenshots ---------- */
.wshots { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.wshot { width: 84px; height: 60px; padding: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface-2); cursor: zoom-in; display: grid; place-items: center; color: var(--red); font-size: 1.3rem; transition: transform .15s, box-shadow .15s; }
.wshot:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(15, 23, 42, .12); border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); }
.wshot img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.proof-drop kbd { font: 700 .68rem inherit; padding: 1px 5px; border-radius: 4px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }

/* ==========================================================================
   v17 — dialogs always fit the screen (E16), tasks, accountability
   ========================================================================== */
/* Dialogs: never taller than the screen; the middle scrolls, title and Send/Cancel stay visible */
.modal .dialog { max-height: 90vh; max-height: 90dvh; overflow: hidden; }
.modal .dialog > form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; max-height: inherit; }
.modal .m-head, .modal .m-foot { flex: none; }
.modal .m-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.modal .m-foot { background: var(--surface); border-radius: 0 0 22px 22px; }
.modal .dialog :focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; }
.modal .tp-list { max-height: min(220px, 32vh); }
.tp-person:focus-within, .tp-all:focus-within span { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 1px; }
@media (max-width: 640px) { .modal .dialog { max-height: 92vh; max-height: 92dvh; } .modal .m-foot { border-radius: 0; padding-bottom: max(16px, env(safe-area-inset-bottom)); } }

.alert.warn { background: var(--amber-soft); color: #9a5b00; }
[data-theme="dark"] .alert.warn { color: #fbbf24; }
.alert a { color: inherit; text-decoration: underline; font-weight: 800; }
.alert.ok { background: var(--green-soft); color: var(--green); }

/* tasks */
.tk-filters { padding: 12px 16px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.tk-filters .input.sm { width: auto; max-width: 100%; }
.board.b5 { grid-template-columns: repeat(5, minmax(180px, 1fr)); gap: 12px; }
@media (max-width: 1200px) { .board.b5 { grid-template-columns: repeat(5, 250px); } }
a.tcard { display: block; text-decoration: none; }
.tcard.esc { border-color: color-mix(in srgb, var(--red) 45%, var(--border)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 12%, transparent), var(--shadow); }
.tk-steps { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.tk-steps li { font-size: .7rem; font-weight: 700; padding: 4px 10px; border-radius: 20px; background: var(--surface-2); color: var(--faint); }
.tk-steps li.past { color: var(--green); background: var(--green-soft); }
.tk-steps li.now { color: #fff; background: var(--cc, var(--brand)); }
.tk-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.tk-proof { margin-top: 18px; padding: 16px; border: 1px dashed color-mix(in srgb, var(--green) 50%, var(--border)); border-radius: 14px; background: color-mix(in srgb, var(--green) 4%, var(--surface)); }
.tk-proof h4 { font-size: .92rem; font-weight: 800; margin: 0; display: flex; gap: 8px; align-items: center; }
.tk-proof h4 i { color: var(--green); }
.tk-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .88rem; line-height: 1.55; }
.tk-history { list-style: none; margin: 0; padding: 8px 20px 14px; }
.tk-history li { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.tk-history li:first-child { border-top: 0; }
.tk-history .ev-ic { width: 30px; height: 30px; flex: none; border-radius: 9px; display: grid; place-items: center; font-size: .75rem; background: var(--surface-2); color: var(--muted); }
.tk-history .ev-escalation .ev-ic { background: var(--red-soft); color: var(--red); }
.tk-history .ev-status .ev-ic { background: var(--brand-soft); color: var(--brand); }
.tk-history .ev-comment .ev-ic { background: var(--blue-soft); color: var(--blue); }
.tk-history .ev-head { display: flex; gap: 4px 10px; flex-wrap: wrap; align-items: baseline; font-size: .84rem; }
.tk-history .ev-head time { margin-left: auto; font-size: .74rem; }
.tk-facts { display: grid; gap: 10px; font-size: .84rem; }
.tk-facts > div { display: flex; justify-content: space-between; gap: 12px; }
.tk-facts span { color: var(--muted); }
.tk-facts b { text-align: right; }

/* daily work compliance grid */
.cgrid th, .cgrid td { text-align: center; padding: 8px 6px; white-space: nowrap; }
.cgrid th:first-child, .cgrid td:first-child { text-align: left; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.cgrid .c { display: inline-flex; gap: 2px; font-size: .72rem; }
.cgrid .c i { width: 20px; height: 20px; border-radius: 6px; display: inline-grid; place-items: center; font-style: normal; font-weight: 800; }
.cgrid .c .y { background: var(--green-soft); color: var(--green); }
.cgrid .c .n { background: var(--red-soft); color: var(--red); }
.cgrid .c .l { background: var(--amber-soft); color: #c27803; }
.cgrid .c .x { background: var(--surface-2); color: var(--faint); }
.cgrid tr.zero td { background: color-mix(in srgb, var(--red) 6%, var(--surface)); }
.rate { font-weight: 800; }
.rate.good { color: var(--green); } .rate.bad { color: var(--red); } .rate.mid { color: #c27803; }

/* accountability report */
.acc-list { list-style: none; margin: 0; padding: 0; }
.acc-list li { display: flex; gap: 10px; align-items: center; padding: 10px 20px; border-top: 1px solid var(--border); font-size: .86rem; }
.acc-list li:first-child { border-top: 0; }
.acc-list .grow { flex: 1; min-width: 0; }
.acc-list .grow a, .acc-list .grow b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.age-bars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.age-bars a { padding: 12px; border-radius: 12px; background: var(--surface-2); color: inherit; text-align: center; }
.age-bars b { display: block; font-size: 1.5rem; font-weight: 800; }
.age-bars a.hot b { color: var(--red); }
.rag { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex: none; }
.rag.R { background: var(--red); } .rag.A { background: var(--amber); } .rag.G { background: var(--green); }
@media print {
  .sidebar, .topbar, .no-print, .push-ask, .ialert, .toasts { display: none !important; }
  .main { margin: 0 !important; } .content { padding: 0 !important; } .card { box-shadow: none; break-inside: avoid; }
  body { background: #fff; }
}
/* the Send-to checkboxes stay reachable by keyboard (Tab + Space) */
.tp-all, .tp-person { position: relative; }
.tp-all input, .tp-person input { display: block; position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.nav-badge.amber { background: var(--amber); }
.dw-banner { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 12px 16px; border-radius: 14px; margin-bottom: 18px; background: var(--amber-soft); color: #8a5300; font-weight: 600; font-size: .86rem; }
.dw-banner.red { background: var(--red-soft); color: var(--red); }
[data-theme="dark"] .dw-banner { color: #fbbf24; } [data-theme="dark"] .dw-banner.red { color: #fca5a5; }
.dw-banner .btn { margin-left: auto; }
.cgrid-key { font-style: normal; display: inline-grid; width: 18px; height: 18px; border-radius: 5px; place-items: center; font-weight: 800; font-size: .66rem; vertical-align: middle; }
.cgrid-key.y { background: var(--green-soft); color: var(--green); } .cgrid-key.n { background: var(--red-soft); color: var(--red); } .cgrid-key.l { background: var(--amber-soft); color: #c27803; }
.ia-card { max-height: 92vh; overflow: auto; }
.ia-note { margin: 10px 0 0 !important; font-size: .74rem !important; color: var(--faint) !important; max-height: none !important; }
.draft-note { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 9px 12px; border-radius: 10px; background: var(--amber-soft); color: #8a5300; font-size: .8rem; font-weight: 600; margin-bottom: 12px; }
[data-theme="dark"] .draft-note { color: #fbbf24; }
.draft-note button { margin-left: auto; }
@media (max-width: 640px) {
  #workForm .btn-primary[type=submit] { width: 100%; justify-content: center; padding: 14px; }
}

.acc-list .grow > span { display: block; }
.tk-onbehalf summary { cursor: pointer; font-weight: 700; font-size: .84rem; color: var(--muted); margin-top: 14px; }

/* daily work: numbered points inside one box */
.point-row { align-items: flex-start; }
.point-row .pn, .point-row .icon-btn { margin-top: 6px; }
textarea.wtext { flex: 1; min-height: 42px; resize: none; overflow: hidden; line-height: 1.5; font-family: inherit; }
.wtxt, .wpoints li, .pw-person ul li { white-space: pre-line; }

/* daily work: the ERP's own project picker */
.pbox { position: relative; flex: 0 0 260px; width: 260px; }
.pbox .pname { width: 100%; padding-left: 36px; padding-right: 34px; flex: none; }
.pbox-ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: .82rem; pointer-events: none; }
.pbox-car { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; display: grid; place-items: center; border-radius: 7px; color: var(--muted); font-size: .7rem; cursor: pointer; transition: transform .2s, background .15s; }
.pbox-car:hover { background: var(--surface-2); }
.pbox.open .pbox-car { transform: translateY(-50%) rotate(180deg); color: var(--brand); }
.pbox.open .pbox-ic, .pbox:focus-within .pbox-ic { color: var(--brand); }
.pmenu { position: fixed; z-index: 120; max-height: 300px; overflow: auto; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 18px 40px -12px rgba(15, 23, 42, .28), 0 2px 6px rgba(15, 23, 42, .06); animation: pmIn .14s ease-out; overscroll-behavior: contain; }
@keyframes pmIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.pm-head { padding: 6px 10px 4px; font-size: .66rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.pm-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.pm-item.on { background: var(--brand-soft); }
.pm-item + .pm-item { margin-top: 1px; }
.pm-dot { width: 26px; height: 26px; flex: none; border-radius: 8px; position: relative; box-shadow: inset 0 0 0 9px var(--surface); border: 1px solid var(--border); }
.pm-dot.gen, .pm-dot.add { display: grid; place-items: center; box-shadow: none; background: var(--surface-2); color: var(--muted); font-size: .7rem; }
.pm-dot.add { background: var(--amber-soft); color: #c27803; border-color: transparent; }
.pm-t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.pm-t b { font-size: .84rem; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-t small { font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-t mark { background: color-mix(in srgb, var(--amber) 35%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.pm-item:has(.pm-dot.gen) { border-top: 1px solid var(--border); border-radius: 0 0 10px 10px; margin-top: 4px; padding-top: 10px; }
.pm-item.on:has(.pm-dot.gen) { border-radius: 10px; }
.pm-ck { color: var(--brand); font-size: .78rem; }
@media (max-width: 640px) { .pbox { flex: 1 1 calc(100% - 80px); width: auto; } }
.pbox.other .pbox-ic::before { content: "\f303"; }
.pbox.other .pname { border-color: color-mix(in srgb, var(--amber) 55%, var(--border)); }

/* task page: simple steps */
.tk-done-when { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--green-soft); font-size: .88rem; }
.tk-done-when > i { color: var(--green); margin-top: 3px; }
.tk-what .card-body > .tk-text:only-child { margin: 0; }
.tk-start { text-align: center; padding: 30px 20px 26px; }
.tk-start h3 { font-size: 1.15rem; font-weight: 800; margin: 12px 0 6px; }
.tk-start p { color: var(--muted); margin: 0 auto 16px; max-width: 460px; font-size: .9rem; }
.tk-big-ic { --cc: var(--brand); width: 60px; height: 60px; border-radius: 18px; display: inline-grid; place-items: center; font-size: 1.4rem; color: var(--cc); background: color-mix(in srgb, var(--cc) 14%, transparent); }
.btn-lg { padding: 13px 26px; font-size: .95rem; border-radius: 14px; }
.tk-link { background: none; border: 0; color: var(--muted); font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; padding: 6px 8px; border-radius: 8px; display: inline-flex; gap: 6px; align-items: center; }
.tk-link:hover { color: var(--brand); background: var(--surface-2); }
.tk-start .tk-link { margin-top: 10px; }
.tk-submit { padding: 20px; }
.tk-submit h3 { font-size: 1.02rem; font-weight: 800; margin: 0 0 14px; display: flex; gap: 8px; align-items: center; }
.tk-submit h3 i { color: var(--green); }
.tk-submit .proof-drop { margin-top: 12px; }
.tk-submit-foot { display: flex; align-items: center; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.tk-submit-foot .btn { margin-left: auto; }
.tk-hist > summary { list-style: none; cursor: pointer; }
.tk-hist > summary::-webkit-details-marker { display: none; }
.tk-hist:not([open]) > summary { border-bottom: 0; }
@media (max-width: 640px) { .tk-submit-foot .btn { width: 100%; justify-content: center; } }

/* daily work: my tasks */
.wt-box { margin-top: 18px; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.wt-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-weight: 800; font-size: .86rem; }
.wt-head i { color: var(--brand); margin-right: 4px; }
.wt-head small { font-weight: 500; color: var(--muted); font-size: .74rem; }
.wt-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 14px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--border); }
.wt-row:first-of-type { border-top: 0; }
.wt-info { min-width: 0; display: flex; flex-direction: column; }
.wt-info a { font-weight: 700; color: var(--text); font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wt-info small { color: var(--muted); font-size: .72rem; }
.wt-seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.wt-seg label { position: relative; cursor: pointer; }
.wt-seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.wt-seg span { display: inline-flex; gap: 5px; align-items: center; padding: 6px 10px; border-radius: 8px; font-size: .76rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.wt-seg input:checked + span { background: var(--surface); color: var(--brand); box-shadow: var(--shadow); }
.wt-seg .fin input:checked + span { background: var(--green); color: #fff; }
.wt-seg input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); }
.wt-note { grid-column: 1 / -1; min-height: 0; }
@media (max-width: 640px) { .wt-row { grid-template-columns: 1fr; } .wt-seg { width: 100%; } .wt-seg label { flex: 1; } .wt-seg span { justify-content: center; width: 100%; } }

/* projects: completed but being updated */
.pj-upd { margin: 14px -20px -20px; padding: 9px 20px; background: var(--amber-soft); color: #8a5300; font-size: .78rem; border-top: 1px solid color-mix(in srgb, var(--amber) 30%, transparent); border-radius: 0 0 var(--radius) var(--radius); display: flex; gap: 6px; align-items: center; }
[data-theme="dark"] .pj-upd { color: #fbbf24; }
.pj-upd-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--amber); display: inline-block; flex: none; box-shadow: 0 0 0 0 color-mix(in srgb, var(--amber) 60%, transparent); animation: updPulse 1.6s infinite; }
@keyframes updPulse { 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .pj-upd-dot { animation: none; } }
.pj-sec { font-size: 1rem; font-weight: 800; margin: 26px 0 12px; display: flex; gap: 8px; align-items: center; }
.pj-sec .faint { font-weight: 500; font-size: .84rem; }
.pm-sep { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 10px; }
.pm-dot.done { opacity: .55; }

/* bank details with copy buttons */
.bank-card { border: 1px solid var(--border); border-radius: 14px; padding: 6px; display: grid; gap: 2px; }
.bk-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; padding: 8px 10px; border-radius: 10px; }
.bk-item .bk-l { grid-column: 1 / -1; }
.bk-item:hover { background: var(--surface-2); }
.bk-l { font-size: .76rem; color: var(--muted); font-weight: 600; }
.bk-l i { width: 16px; color: var(--brand); }
.bk-v { font-weight: 800; font-size: .95rem; overflow-wrap: anywhere; letter-spacing: .01em; }
.bk-copy { border: 1px solid var(--border); background: var(--surface); color: var(--muted); border-radius: 8px; padding: 5px 10px; font: inherit; font-size: .74rem; font-weight: 700; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.bk-copy:hover { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); }
.bk-copy.copied, .bk-all.copied { color: var(--green); border-color: var(--green); }
.bk-all { margin: 6px 4px 4px; justify-self: start; }

/* ---------- Passwords (private vault) ---------- */
.vault-lock { max-width: 460px; margin: 40px auto; padding: 34px 30px; text-align: center; }
.vault-lock .vl-icon { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; margin: 0 auto 14px; background: var(--brand-soft); color: var(--brand); font-size: 1.5rem; }
.vault-lock h1 { font-size: 1.35rem; font-weight: 800; margin: 0 0 6px; }
.vault-lock p { color: var(--muted); margin: 0 0 20px; }
.vault-lock .vl-form { text-align: left; }
.vault-lock .vl-form label { display: block; font-size: .82rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.vault-lock .vl-row { display: flex; gap: 8px; }
.vault-lock .vl-row .input { flex: 1; }
.vault-lock .vl-foot { margin-top: 18px; font-size: .8rem; color: var(--faint); }
.vault { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: start; }
.vault-folders { padding: 10px; }
.vault-folders .vf-head { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); padding: 6px 10px 8px; }
.vault-folders .vf { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; background: none; border-radius: 10px; color: var(--text); font: inherit; font-size: .9rem; cursor: pointer; text-align: left; }
.vault-folders .vf span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vault-folders .vf i { color: var(--faint); width: 16px; }
.vault-folders .vf b { font-size: .75rem; font-weight: 600; color: var(--muted); }
.vault-folders .vf:hover { background: var(--hover, rgba(99,102,241,.06)); }
.vault-folders .vf.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.vault-folders .vf.on i { color: var(--brand); }
.vault-search { position: relative; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.vault-search i { position: absolute; left: 29px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.vault-search .input { padding-left: 38px; }
.vi { display: grid; grid-template-columns: 40px minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.vi:last-of-type { border-bottom: 0; }
.vi.hidden { display: none; }
.vi-av { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-weight: 800; }
.vi-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vi-folder { font-size: .68rem; margin-left: 4px; vertical-align: middle; }
.vi-url { font-size: .8rem; color: var(--muted); text-decoration: none; }
.vi-url:hover { color: var(--brand); }
.vi-url i { font-size: .65rem; }
.vi-field small { display: block; font-size: .7rem; color: var(--faint); margin-bottom: 2px; }
.vi-val { display: flex; align-items: center; gap: 4px; min-width: 0; }
.vi-val > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .88rem; }
.vi-pw { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .02em; }
.vi-btn { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 8px; background: var(--card, #fff); color: var(--muted); cursor: pointer; font-size: .8rem; }
.vi-btn:hover, .vi-btn.on { color: var(--brand); border-color: var(--brand); }
.vi-acts { display: flex; gap: 6px; }
.vi-notes { grid-column: 2 / -1; white-space: pre-wrap; font-size: .85rem; background: var(--brand-soft); border-radius: 10px; padding: 10px 12px; }
.vi-notes.hidden { display: none; }
.vm-pw { display: flex; gap: 6px; align-items: center; }
.vm-pw .input { flex: 1; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.vm-pw .vi-btn { width: 38px; height: 38px; }
@media (max-width: 900px) {
  .vault { grid-template-columns: 1fr; }
  .vault-folders { display: flex; gap: 6px; overflow-x: auto; padding: 8px; }
  .vault-folders .vf-head { display: none; }
  .vault-folders .vf { width: auto; flex: none; }
  .vi { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .vi-field { grid-column: 2 / -1; }
}
.vault-share { display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin-bottom: 16px; }
.vault-share .vs-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.vault-share.on .vs-ic { background: var(--green-soft); color: var(--green); }
.vault-share .vs-t { flex: 1; min-width: 0; }
.vault-share .vs-t b { display: block; }
.vault-share .vs-t span { font-size: .85rem; color: var(--muted); }
.vi.shared .vi-av { background: var(--blue-soft, #e0f2fe); color: var(--blue, #0284c7); }
.vp-list { max-height: 46vh; overflow: auto; border: 1px solid var(--border); border-radius: 12px; }
.vp-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--border); cursor: pointer; }
.vp-row:last-child { border-bottom: 0; }
.vp-row.hidden { display: none; }
.vp-row:hover { background: var(--brand-soft); }
.vp-row .vp-n { flex: 1; }
.vp-row input { width: 16px; height: 16px; accent-color: var(--brand); }
.vi-title { white-space: normal; overflow: visible; line-height: 1.45; }
.vi-title .vi-folder { white-space: nowrap; }
