/* ==========================================================================
   EaseBill Accounting ERP - Premium Design System & Stylesheet
   ========================================================================== */

:root {
    --bg-main: #0B1120;
    --bg-surface: #131E35;
    --bg-card: #18233C;
    --bg-card-hover: #1E2D4C;
    --bg-sidebar: #0D1629;
    --bg-topbar: #0F1A30;

    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-focus: rgba(59, 130, 246, 0.5);

    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;

    --primary: #3B82F6;
    --primary-hover: #2563EB;
    --primary-glow: rgba(59, 130, 246, 0.25);

    --success: #10B981;
    --success-hover: #059669;
    --success-bg: rgba(16, 185, 129, 0.12);

    --warning: #F59E0B;
    --warning-bg: rgba(245, 158, 11, 0.12);

    --danger: #EF4444;
    --danger-hover: #DC2626;
    --danger-bg: rgba(239, 68, 68, 0.12);

    --info: #06B6D4;
    --info-bg: rgba(6, 182, 212, 0.12);

    --purple: #8B5CF6;
    --purple-bg: rgba(139, 92, 246, 0.12);

    --sidebar-width: 270px;
    --topbar-height: 70px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.35);
    --shadow-glow: 0 0 25px rgba(59, 130, 246, 0.15);

    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

/* Light Theme Variables */
[data-theme="light"],
body.theme-light {
    --bg-main: #F1F5F9;
    --bg-surface: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-card-hover: #F8FAFC;
    --bg-sidebar: #FFFFFF;
    --bg-topbar: #FFFFFF;

    --border-color: #E2E8F0;
    --border-color-focus: rgba(37, 99, 235, 0.4);

    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #64748B;

    --primary: #2563EB;
    --primary-hover: #1D4ED8;
    --primary-glow: rgba(37, 99, 235, 0.15);

    --success: #10B981;
    --success-hover: #059669;
    --success-bg: rgba(16, 185, 129, 0.1);

    --warning: #F59E0B;
    --warning-bg: rgba(245, 158, 11, 0.1);

    --danger: #EF4444;
    --danger-hover: #DC2626;
    --danger-bg: rgba(239, 68, 68, 0.1);

    --info: #0284C7;
    --info-bg: rgba(2, 132, 199, 0.1);

    --purple: #7C3AED;
    --purple-bg: rgba(124, 58, 237, 0.1);

    --shadow-card: 0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.12);
}

/* Base Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: var(--font-sans);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Monospace text */
.font-mono { font-family: var(--font-mono); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-extrabold { font-weight: 800; }

/* Utilities */
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.text-info { color: var(--info) !important; }
.text-purple { color: var(--purple) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-right { text-align: right !important; }
.text-center { text-align: center !important; }
.text-sm { font-size: 13px !important; }
.text-xs { font-size: 11px !important; }
.text-lg { font-size: 18px !important; }
.text-xl { font-size: 20px !important; }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 14px; }
.mt-4 { margin-top: 20px; }
.mt-5 { margin-top: 28px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 14px; }
.mb-4 { margin-bottom: 20px; }
.ml-1 { margin-left: 4px; }
.ml-2 { margin-left: 8px; }
.mr-1 { margin-right: 4px; }
.mr-2 { margin-right: 8px; }
.p-0 { padding: 0 !important; }
.p-3 { padding: 14px !important; }
.p-4 { padding: 20px !important; }
.p-5 { padding: 28px !important; }
.py-3 { padding-top: 12px; padding-bottom: 12px; }
.py-4 { padding-top: 18px; padding-bottom: 18px; }

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* App Layout Structure */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: transform 0.3s ease;
    overflow-y: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.sidebar::-webkit-scrollbar { width: 0; height: 0; }

.sidebar-brand {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #3B82F6 0%, #1D4ED8 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

.brand-title {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.5px;
    display: block;
    background: linear-gradient(90deg, #FFFFFF, #93C5FD);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-subtitle {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    display: block;
}

.sidebar-menu {
    padding: 10px 14px 16px;
    flex: 1;
}

/* Collapsible sidebar groups */
.menu-group {
    border-bottom: 1px solid transparent;
}

.menu-group-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    border: 0;
    background: transparent;
    color: #FFFFFF;
    font: inherit;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.7px;
    text-align: left;
    cursor: pointer;
    border-radius: var(--radius-sm);
}

.menu-group-toggle:hover,
.menu-group.is-active-group .menu-group-toggle {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.035);
}

.menu-group-toggle > span i,
.menu-group-chevron { color: #93C5FD; }

.menu-group-toggle > span {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.menu-group-toggle > span i { width: 14px; text-align: center; }
.menu-group-chevron { font-size: 10px; transition: transform 0.2s ease; }
.menu-group.is-open .menu-group-chevron { transform: rotate(180deg); }

.menu-group-content {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    transition: grid-template-rows 0.22s ease, opacity 0.18s ease;
}

.menu-group-content > .nav-list { overflow: hidden; }
.menu-group.is-open .menu-group-content { grid-template-rows: 1fr; opacity: 1; }
.menu-group .nav-list { padding: 2px 0 7px; }

.badge-money-in { background: rgba(16,185,129,0.15); color: #10B981; border-color: rgba(16,185,129,0.3); }
.badge-money-out { background: rgba(239,68,68,0.15); color: #EF4444; border-color: rgba(239,68,68,0.3); }
.badge-config { background: rgba(139,92,246,0.2); color: #8B5CF6; border-color: rgba(139,92,246,0.3); }

.menu-section {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 14px 12px 6px 12px;
}

.nav-list {
    list-style: none;
}

.nav-item {
    margin-bottom: 3px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 9px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-link i {
    font-size: 15px;
    width: 20px;
    text-align: center;
    transition: transform 0.2s ease;
}

.nav-link > span:not(.nav-badge) {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
}

.nav-link:hover i {
    transform: scale(1.1);
}

.nav-link.active {
    color: #FFFFFF;
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.25) 0%, rgba(59, 130, 246, 0.1) 100%);
    border-left: 3px solid var(--primary);
    font-weight: 600;
}

.nav-link.active i {
    color: var(--primary);
}

.nav-badge {
    margin-left: auto;
    flex: 0 0 auto;
    font-size: 9px;
    font-weight: 700;
    background: rgba(59, 130, 246, 0.2);
    color: #93C5FD;
    padding: 2px 5px;
    border-radius: 10px;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8B5CF6, #3B82F6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
}

.user-info {
    overflow: hidden;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    display: block;
}

.user-role {
    font-size: 11px;
    color: var(--text-muted);
    display: block;
}

/* Main Wrapper */
.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

/* Desktop collapse: remove the wrapper margin as the sidebar leaves the viewport. */
body.sidebar-collapsed .sidebar { transform: translateX(-100%); }
body.sidebar-collapsed .main-wrapper { margin-left: 0; }

/* Route transition indicator */
.page-loader {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(11, 17, 32, 0.48);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    backdrop-filter: blur(2px);
}

.page-loader[hidden] { display: none; }
.page-loader-spinner {
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: easebill-spin 0.7s linear infinite;
}

@keyframes easebill-spin { to { transform: rotate(360deg); } }

/* Authentication */
.auth-page { min-height: 100vh; overflow-x: hidden; background: radial-gradient(circle at 2% 0%, #1A447E 0%, #101C31 33%, #0B1426 72%); color: #F8FAFC; font-family: var(--font-sans); }
.auth-shell { min-height: calc(100vh - 62px); display: flex; align-items: center; justify-content: center; gap: clamp(48px, 8vw, 125px); padding: 38px 28px 20px; }
.auth-showcase { width: min(42vw, 355px); min-width: 310px; }
.finance-board { position: relative; height: 448px; padding: 31px 25px 18px; overflow: hidden; border: 7px solid #86D6F2; border-radius: 13px; background: linear-gradient(140deg, #173E74 0%, #112B51 58%, #102444 100%); box-shadow: 0 18px 48px rgba(0,0,0,.45), inset 0 0 60px rgba(77, 164, 255, .13); transform: perspective(800px) rotateY(-3deg); }
.finance-board::before { content:""; position:absolute; inset:0; background:linear-gradient(120deg, transparent 42%, rgba(255,255,255,.07) 42.3%, transparent 43%); pointer-events:none; }
.finance-board-header { display:flex; gap:8px; }.finance-board-header span { width:22px; height:4px; border-radius:5px; background:#4D89DB; }
.finance-board h2 { margin:10px 0 0; font-size:24px; letter-spacing:-1px; color:#fff; }.finance-board h2 em { color:#9DDAFF; font-style:normal; }.finance-board > p { margin:0 0 25px; color:#B4C1D5; font-size:11px; }
.finance-widgets { display:flex; gap:10px; }.mini-widget { width:50%; height:96px; padding:9px; border:1px solid rgba(255,255,255,.13); border-radius:6px; background:rgba(8,20,41,.54); }.mini-widget b, .invoice-widget b, .transaction-widget b { display:block; font-size:8px; color:#EAF4FF; }.bar-chart { height:58px; display:flex; align-items:end; justify-content:space-between; padding:8px 4px 0; border-bottom:1px solid rgba(176,215,255,.25); }.bar-chart i { display:block; width:8px; background:linear-gradient(#55B7EF,#2B5B9E); }.bar-chart i:nth-child(1){height:22px}.bar-chart i:nth-child(2){height:35px}.bar-chart i:nth-child(3){height:18px}.bar-chart i:nth-child(4){height:49px}.bar-chart i:nth-child(5){height:32px}.donut-chart { width:48px; height:48px; margin:10px auto; border-radius:50%; background:conic-gradient(#F06A5D 0 32%, #F2C45F 32% 48%, #347EC9 48% 74%, #7D97C1 74%); position:relative; }.donut-chart::after { content:""; position:absolute; inset:13px; border-radius:50%; background:#152D52; }
.invoice-widget { width:148px; margin-top:10px; padding:10px; border:1px solid rgba(255,255,255,.12); border-radius:6px; background:rgba(8,20,41,.56); }.invoice-widget div { display:flex; justify-content:space-between; align-items:center; margin-top:7px; padding:5px; border-radius:4px; background:#F7FAFF; color:#263857; font-size:7px; }.invoice-widget i { color:#357BD1; font-size:13px; vertical-align:middle; }.invoice-widget strong { font-size:9px; }.invoice-widget small { display:block; text-align:center; padding-top:7px; font-size:7px; color:#BBD1ED; }
.transaction-widget { position:absolute; bottom:16px; left:25px; width:196px; min-height:89px; padding:10px; border:1px solid rgba(255,255,255,.12); border-radius:6px; background:rgba(8,20,41,.6); }.transaction-widget > span { position:absolute; top:10px; right:10px; font-size:7px; color:#5CA2E5; }.transaction-widget p { display:flex; justify-content:space-between; margin:7px 0 0; color:#AFC2D8; font-size:7px; }.transaction-widget strong { color:#62C5AA; font-weight:500; }
.coin-stack { position:absolute; right:23px; bottom:54px; width:68px; height:125px; }.coin-stack i { position:absolute; width:62px; height:20px; border:5px solid #A3D1F0; border-radius:50%; background:linear-gradient(90deg,#2B5A93,#4075AA,#204A80); box-shadow:0 10px 0 -4px #7DAFD3; }.coin-stack i:nth-child(1){bottom:0}.coin-stack i:nth-child(2){bottom:25px}.coin-stack i:nth-child(3){bottom:50px}.coin-stack i:nth-child(4){bottom:75px}.finance-arrow { position:absolute; right:-13px; top:215px; width:34px; height:34px; display:grid; place-items:center; border-radius:8px; background:#337CD8; box-shadow:0 5px 14px rgba(0,0,0,.35); font-size:22px; }
.auth-card { width:min(100%, 330px); padding:21px; border:1px solid rgba(150,185,230,.24); border-radius:9px; background:linear-gradient(145deg, rgba(30,53,84,.96), rgba(23,43,71,.96)); box-shadow:0 18px 45px rgba(0,0,0,.32); }.auth-card-wide { width:min(100%, 410px); max-height:calc(100vh - 90px); overflow-y:auto; }
.auth-brand { display:flex; align-items:center; gap:9px; margin-bottom:21px; }.auth-brand .brand-icon { width:29px; height:29px; border-radius:7px; font-size:13px; }.auth-brand strong,.auth-brand span{display:block}.auth-brand strong{font-size:12px}.auth-brand span{color:#7F91AB;font-size:7px;text-transform:uppercase;letter-spacing:.45px}.auth-card h1{margin:0 0 4px;font-size:18px;letter-spacing:-.5px}.auth-card>p{margin:0 0 18px;color:#A6B4C9;font-size:10px}.auth-form{display:grid;gap:10px}.auth-form label{display:grid;gap:4px;color:#AFC0D3;font-size:8px;font-weight:600}.auth-form small{color:#7085A0;font-weight:500}.auth-form input{width:100%;height:25px;border:1px solid #152843;border-radius:4px;background:#081326;color:#F8FAFC;padding:6px 8px;font-size:10px;outline:none}.auth-form input:focus{border-color:#4285E8;box-shadow:0 0 0 2px rgba(59,130,246,.2)}.auth-submit{width:100%;justify-content:center;margin-top:3px;padding:7px;font-size:10px;background:linear-gradient(90deg,#438AF2,#2D6CDF);box-shadow:0 4px 12px rgba(37,99,235,.26)}.auth-error{margin-bottom:12px;border:1px solid rgba(239,68,68,.45);color:#FCA5A5;background:var(--danger-bg);padding:8px 9px;border-radius:4px;font-size:10px}.auth-switch{text-align:center;margin:15px 0 0!important;font-size:8px!important}.auth-switch a{color:#93C5FD;font-weight:700;text-decoration:none}
.auth-footer { min-height:42px; display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:18px; padding:0 20px 14px; color:#8897AA; font-size:9px; }.auth-footer a { color:inherit; text-decoration:none; }.auth-footer span { width:100%; text-align:center; font-size:8px; }
/* The login artwork and form are intentionally larger on desktop displays. */
@media (min-width: 1000px) {
    .auth-shell { gap: 130px; }
    .auth-showcase { width: 444px; min-width: 444px; height: 560px; }
    .auth-showcase .finance-board { width: 355px; margin: 0 auto; transform: perspective(800px) rotateY(-3deg) scale(1.25); transform-origin: center; }
    .auth-card,
    .auth-card-wide { width: 355px; min-height: 448px; margin: 42px; display: flex; flex-direction: column; transform: scale(1.25); }
    .auth-card .auth-switch { margin-top: auto !important; }
    .auth-card-wide .auth-form { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 12px; }
    .auth-card-wide .auth-submit { grid-column: 1 / -1; }
}
@media (max-width: 760px) { .auth-shell { min-height:100vh; padding:26px 18px; }.auth-showcase { display:none; }.auth-card { width:min(100%, 410px); }.auth-footer { display:none; } }

/* Light marketing authentication pages */
.auth-page-light { min-height:100vh; background:radial-gradient(circle at 8% 10%, #DDEEFF 0, #F3F9FD 29%, #F8FBFE 68%); color:#10203B; }
.auth-layout { width:min(100% - 48px, 1405px); min-height:100vh; margin:auto; display:grid; grid-template-columns:minmax(0, 1.55fr) 480px; gap:108px; align-items:center; }
.auth-page-light .auth-hero { max-width:810px; }.auth-page-light .auth-hero h1 { margin:0 0 24px; color:#111B34; font-size:58px; line-height:1.12; letter-spacing:-2.6px; font-weight:800; }.auth-page-light .auth-hero h1 span { color:#0877D1; }.auth-page-light .hero-copy { max-width:760px; margin:0; color:#547096; font-size:18px; line-height:1.7; }.auth-page-light .hero-highlight { margin:18px 0 24px; color:#0070C9; font-size:16px; font-weight:700; line-height:1.5; }.auth-page-light .hero-small { max-width:700px; color:#4C678B; font-size:14px; line-height:1.65; }
.hero-perks { display:grid; grid-template-columns:repeat(4, 1fr); gap:8px; margin:27px 0; padding:17px 16px; border:1px solid #D7E8F6; border-radius:15px; background:rgba(255,255,255,.72); box-shadow:0 10px 28px rgba(74,119,155,.08); }.hero-perks span { display:flex; align-items:center; gap:9px; color:#153156; font-size:13px; font-weight:600; }.hero-perks i { width:27px; height:27px; display:grid; place-items:center; border-radius:8px; color:#0877D1; background:#E3F2FF; }
.auth-page-light .auth-hero hr { border:0; border-top:1px solid #DCE8F2; margin:26px 0 12px; }.auth-page-light .auth-hero h2 { margin:0 0 17px; color:#12213B; font-size:18px; }.hero-list,.hero-ticks { display:grid; gap:13px; padding:0; margin:0; list-style:none; }.hero-list li { color:#5A7192; font-size:15px; }.hero-list b { color:#10213C; }.hero-list i { display:inline-grid; place-items:center; width:22px; height:22px; margin-right:9px; border-radius:50%; color:#1687DD; background:#DDF0FF; font-size:11px; }.hero-stats { display:grid; grid-template-columns:repeat(4,1fr); gap:0; margin-top:29px; padding:16px; border:1px solid #BFE0FA; border-radius:14px; background:#E9F6FF; }.hero-stats span { padding:0 16px; border-right:1px solid #BEDCEF; color:#537291; font-size:12px; }.hero-stats span:last-child { border:0; }.hero-stats b { display:block; color:#12213B; font-size:18px; }
.hero-inline-stats { display:flex; flex-wrap:wrap; gap:13px; margin:25px 0; color:#0577D4; font-size:14px; font-weight:600; }.hero-inline-stats i { width:1px; background:#B7CFE5; }.hero-ticks { margin-top:29px; color:#4D6788; font-size:17px; }.hero-ticks li::before { content:'✓'; margin-right:10px; color:#0076D2; font-weight:800; }
.auth-page-light .auth-card { box-sizing:border-box; width:480px; min-height:0; margin:0; padding:33px; transform:none; border:0; border-radius:16px; background:#FFF; color:#12213B; box-shadow:0 23px 50px rgba(55,92,126,.15); }.auth-page-light .auth-register-card { width:500px; }.auth-page-light .auth-card-top { display:flex; justify-content:space-between; gap:18px; align-items:start; margin-bottom:24px; }.auth-page-light .auth-card h2 { margin:0 0 7px; color:#071B38; font-size:22px; letter-spacing:-.5px; }.auth-page-light .auth-card-top p { margin:0; color:#617694; font-size:13px; line-height:1.5; }.auth-mark { width:42px; height:42px; display:grid; place-items:center; border-radius:50%; color:#FFF; background:linear-gradient(135deg,#147FD8,#0554A7); font-weight:800; font-size:13px; transform:skew(-8deg); }
.auth-page-light .auth-form { display:grid; gap:17px; }.auth-page-light .auth-register-form { grid-template-columns:repeat(2,minmax(0,1fr)); column-gap:15px; gap:13px; }.auth-page-light .auth-register-form .wide { grid-column:1 / -1; }.auth-page-light .auth-form label { display:grid; gap:8px; color:#172946; font-size:13px; font-weight:600; }.auth-page-light .auth-form small { color:#506A8C; font-weight:500; }.auth-page-light .input-wrap { display:flex; align-items:center; gap:11px; height:45px; padding:0 12px; border:1px solid #D9E1EA; border-radius:10px; background:#FFF; }.auth-page-light .input-wrap:focus-within { border-color:#1685DF; box-shadow:0 0 0 3px rgba(22,133,223,.12); }.auth-page-light .input-wrap i { color:#8A9AB0; font-size:14px; }.auth-page-light .auth-form input:not([type=checkbox]) { width:100%; height:auto; padding:0; border:0; border-radius:0; background:transparent; color:#14233A; font-size:14px; box-shadow:none; }.auth-page-light .auth-form input::placeholder { color:#9AA8BC; }.auth-page-light .terms { display:block!important; color:#526B8A!important; font-size:12px!important; font-weight:500!important; }.auth-page-light .terms input { accent-color:#147EDA; margin:0 8px 0 0; vertical-align:middle; }.auth-page-light .terms a,.auth-page-light .auth-card-bottom a { color:#0074D0; font-weight:700; text-decoration:none; }.auth-primary { width:100%; height:45px; border:0; border-radius:11px; color:#FFF; background:#117BC5; box-shadow:0 9px 15px rgba(15,122,196,.18); cursor:pointer; font:700 14px var(--font-sans); }.auth-primary:hover { background:#0869B2; }.auth-page-light .auth-card-bottom { margin-top:20px; padding-top:18px; border-top:1px solid #E8EDF2; color:#667C99; font-size:12px; text-align:center; }.auth-page-light .auth-error { margin-bottom:18px; font-size:12px; }
@media (max-width:1100px) { .auth-layout { grid-template-columns:1fr 430px; gap:45px; }.auth-page-light .auth-hero h1 { font-size:46px; }.hero-perks { grid-template-columns:repeat(2,1fr); }.hero-stats { grid-template-columns:repeat(2,1fr); }.hero-stats span:nth-child(2) { border-right:0; } }
@media (max-width:800px) { .auth-layout { width:min(100% - 32px, 520px); display:block; padding:38px 0; }.auth-page-light .auth-hero { margin-bottom:35px; }.auth-page-light .auth-hero h1 { font-size:38px; }.auth-page-light .auth-card,.auth-page-light .auth-register-card { width:100%; padding:25px; }.hero-stats { display:none; } }
@media (max-width:500px) { .auth-page-light .auth-hero h1 { font-size:33px; letter-spacing:-1.5px; }.hero-perks { grid-template-columns:1fr; }.auth-page-light .auth-register-form { grid-template-columns:1fr; }.auth-page-light .auth-register-form .wide { grid-column:auto; } }

/* EaseBill brand palette for the light authentication layout. */
.auth-page-light { background:radial-gradient(circle at 8% 10%, #DCEBFF 0, #EEF5FF 29%, #F5F9FF 68%); color:#0B1120; }
.auth-page-light .auth-hero h1 { color:#0B1120; }

/* Keep sidebar headers visible in the white application theme. */
[data-theme="light"] .menu-group-toggle,
[data-theme="light"] .menu-group-toggle:hover,
[data-theme="light"] .menu-group.is-active-group .menu-group-toggle { color:#0F172A; }
[data-theme="light"] .menu-group-toggle > span i,
[data-theme="light"] .menu-group-chevron { color:#2563EB; }

/* Authentication follows the same selected EaseBill dark palette. */
[data-theme="dark"] .auth-page-light { background:radial-gradient(circle at 8% 8%, #172D52 0, #0B1120 42%, #080E1B 100%); color:#F8FAFC; }
[data-theme="dark"] .auth-page-light .auth-hero h1 { color:#F8FAFC; }
[data-theme="dark"] .auth-page-light .auth-hero h2,
[data-theme="dark"] .auth-page-light .hero-list b { color:#F8FAFC; }
[data-theme="dark"] .auth-page-light .hero-copy,
[data-theme="dark"] .auth-page-light .hero-small,
[data-theme="dark"] .auth-page-light .hero-list li { color:#94A3B8; }
[data-theme="dark"] .auth-page-light .auth-hero hr { border-top-color:rgba(255,255,255,.12); }
[data-theme="dark"] .auth-page-light .hero-perks { border-color:rgba(255,255,255,.11); background:#131E35; box-shadow:none; }
[data-theme="dark"] .auth-page-light .hero-perks span { color:#E2E8F0; }
[data-theme="dark"] .auth-page-light .hero-perks i { color:#60A5FA; background:rgba(59,130,246,.18); }
[data-theme="dark"] .auth-page-light .hero-list i { color:#60A5FA; background:rgba(59,130,246,.18); }
[data-theme="dark"] .auth-page-light .hero-stats { border-color:rgba(59,130,246,.32); background:#131E35; }
[data-theme="dark"] .auth-page-light .hero-stats span { border-color:rgba(255,255,255,.1); color:#94A3B8; }
[data-theme="dark"] .auth-page-light .hero-stats b { color:#F8FAFC; }
[data-theme="dark"] .auth-page-light .hero-inline-stats,
[data-theme="dark"] .auth-page-light .hero-highlight,
[data-theme="dark"] .auth-page-light .hero-ticks li::before { color:#60A5FA; }
[data-theme="dark"] .auth-page-light .hero-ticks { color:#CBD5E1; }
[data-theme="dark"] .auth-page-light .auth-card { background:#18233C; color:#F8FAFC; border:1px solid rgba(255,255,255,.1); box-shadow:0 23px 50px rgba(0,0,0,.35); }
[data-theme="dark"] .auth-page-light .auth-card h2 { color:#F8FAFC; }
[data-theme="dark"] .auth-page-light .auth-card-top p,
[data-theme="dark"] .auth-page-light .auth-form label,
[data-theme="dark"] .auth-page-light .terms,
[data-theme="dark"] .auth-page-light .auth-card-bottom { color:#94A3B8!important; }
[data-theme="dark"] .auth-page-light .input-wrap { background:#0B1120; border-color:rgba(255,255,255,.1); }
[data-theme="dark"] .auth-page-light .auth-form input:not([type=checkbox]) { color:#F8FAFC; }
[data-theme="dark"] .auth-page-light .auth-card-bottom { border-top-color:rgba(255,255,255,.1); }

/* Keep agreement checkboxes compact and aligned with their text. */
.auth-page-light .auth-form label.terms {
    display:flex !important;
    align-items:center;
    gap:8px;
    line-height:1.35;
}
.auth-page-light .auth-form label.terms input[type="checkbox"] {
    appearance:auto;
    -webkit-appearance:checkbox;
    flex:0 0 16px;
    width:16px;
    height:16px;
    min-height:16px;
    margin:0 !important;
    padding:0;
}
.auth-mark img { display:block; width:100%; height:100%; border-radius:inherit; }

/* Prevent browser autofill from replacing EaseBill input colors. */
[data-theme="dark"] .auth-page-light .auth-form input:-webkit-autofill,
[data-theme="dark"] .auth-page-light .auth-form input:-webkit-autofill:hover,
[data-theme="dark"] .auth-page-light .auth-form input:-webkit-autofill:focus {
    -webkit-text-fill-color:#F8FAFC;
    -webkit-box-shadow:0 0 0 1000px #0B1120 inset;
    box-shadow:0 0 0 1000px #0B1120 inset;
    caret-color:#F8FAFC;
    transition:background-color 9999s ease-out 0s;
}

[data-theme="light"] .auth-page-light .auth-form input:-webkit-autofill,
[data-theme="light"] .auth-page-light .auth-form input:-webkit-autofill:hover,
[data-theme="light"] .auth-page-light .auth-form input:-webkit-autofill:focus {
    -webkit-text-fill-color:#14233A;
    -webkit-box-shadow:0 0 0 1000px #FFFFFF inset;
    box-shadow:0 0 0 1000px #FFFFFF inset;
    caret-color:#14233A;
}

/* Topbar */
.topbar {
    height: var(--topbar-height);
    background-color: var(--bg-topbar);
    border-bottom: 1px solid var(--border-color);
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 90;
    backdrop-filter: blur(12px);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.company-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
    padding: 6px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.fy-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #60A5FA;
    background: rgba(59, 130, 246, 0.12);
    padding: 5px 12px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.topbar-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-left: 4px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
}

.topbar-logout:hover { color: var(--danger); background: var(--danger-bg); }

.status-indicator {
    width: 8px;
    height: 8px;
    background-color: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--success);
}

/* Content Body */
.content-body {
    flex: 1;
    padding: 28px;
}

/* Page Header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-title {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.page-desc {
    font-size: 13.5px;
    color: var(--text-muted);
    margin-top: 2px;
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Cards */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    margin-bottom: 24px;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    display: block;
    margin-top: 2px;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.1);
}

/* KPI Stat Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-card);
    transition: transform 0.2s ease, border-color 0.2s ease;
    position: relative;
    overflow: hidden;
}

.kpi-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.16);
}

.kpi-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.kpi-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: var(--text-muted);
}

.kpi-icon-box {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.kpi-value {
    font-size: 26px;
    font-weight: 800;
    font-family: var(--font-mono);
    line-height: 1.2;
    margin-bottom: 10px;
}

.kpi-footer {
    font-size: 12px;
    color: var(--text-muted);
}

/* Shortcut Boxes */
.shortcut-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.shortcut-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.shortcut-box:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-2px);
}

.shortcut-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.shortcut-info strong {
    display: block;
    font-size: 13.5px;
}

.shortcut-info span {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
}

.accounting-compliance-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-md);
}

.compliance-icon {
    font-size: 20px;
}

.compliance-text strong {
    display: block;
    font-size: 13px;
    color: var(--success);
}

.compliance-text span {
    display: block;
    font-size: 11.5px;
    color: var(--text-secondary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: var(--radius-md);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.btn-primary:disabled {
    background: #334155;
    color: #64748B;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}

.btn-success {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.04);
}

.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: var(--radius-sm); }
.btn-xs { padding: 4px 8px; font-size: 11px; border-radius: var(--radius-sm); }
.btn-lg { padding: 12px 24px; font-size: 15px; border-radius: var(--radius-md); }
.btn-block { width: 100%; }

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.badge-primary { background: rgba(59, 130, 246, 0.2); color: #93C5FD; border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-success { background: rgba(16, 185, 129, 0.2); color: #6EE7B7; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-danger { background: rgba(239, 68, 68, 0.2); color: #FCA5A5; border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-warning { background: rgba(245, 158, 11, 0.2); color: #FCD34D; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-info { background: rgba(6, 182, 212, 0.2); color: #67E8F9; border: 1px solid rgba(6, 182, 212, 0.3); }
.badge-purple { background: rgba(139, 92, 246, 0.2); color: #C4B5FD; border: 1px solid rgba(139, 92, 246, 0.3); }
.badge-secondary { background: rgba(255, 255, 255, 0.08); color: var(--text-secondary); }
.badge-outline { background: transparent; border: 1px solid var(--border-color); color: var(--text-secondary); }

/* Background Subtles */
.bg-success-subtle { background: rgba(16, 185, 129, 0.15); }
.bg-danger-subtle { background: rgba(239, 68, 68, 0.15); }
.bg-primary-subtle { background: rgba(59, 130, 246, 0.15); }
.bg-warning-subtle { background: rgba(245, 158, 11, 0.15); }
.bg-info-subtle { background: rgba(6, 182, 212, 0.15); }
.bg-purple-subtle { background: rgba(139, 92, 246, 0.15); }

/* Tables */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    text-align: left;
}

.data-table th {
    padding: 12px 16px;
    font-weight: 700;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    background-color: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background-color 0.15s ease;
}

.data-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.table-total-row td {
    font-weight: 700;
    border-top: 2px solid var(--border-color);
    border-bottom: none;
    padding: 14px 16px;
}

/* Forms */
.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
}

.form-group {
    margin-bottom: 16px;
    flex: 1;
}

.col-4 { flex: 0 0 calc(33.333% - 11px); }
.col-6 { flex: 0 0 calc(50% - 8px); }
.col-8 { flex: 0 0 calc(66.666% - 5px); }

.form-label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    background-color: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 9px 13px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394A3B8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11.5l-5-5h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

select.form-control option {
    background-color: var(--bg-card);
    color: var(--text-primary);
}

.search-box {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    font-size: 13px;
}

.form-control-search {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 7px 14px 7px 34px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    width: 280px;
}

.form-control-search:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Alerts */
.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border-radius: var(--radius-md);
    font-size: 13.5px;
    margin-bottom: 20px;
    position: relative;
}

.alert-success { background: rgba(16, 185, 129, 0.12); border: 1px solid rgba(16, 185, 129, 0.25); color: #6EE7B7; }
.alert-danger { background: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.25); color: #FCA5A5; }
.alert-warning { background: rgba(245, 158, 11, 0.12); border: 1px solid rgba(245, 158, 11, 0.25); color: #FCD34D; }

.alert-close {
    background: transparent;
    border: none;
    color: inherit;
    font-size: 18px;
    cursor: pointer;
    margin-left: auto;
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.filter-tab {
    padding: 7px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.filter-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.filter-tab.active {
    background: var(--primary);
    color: #FFFFFF;
    border-color: var(--primary);
}

/* Dropdown Menu */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    padding: 6px;
    display: none;
    z-index: 1000;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    font-size: 13px;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.07);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 6px 0;
}

/* Billing Summary Box */
.summary-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 14px;
}

/* Reports Hub Grid */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.report-card {
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.report-card:hover {
    transform: translateY(-4px);
    border-color: rgba(59, 130, 246, 0.4);
}

.report-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.report-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
}

.report-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 6px;
    line-height: 1.5;
}

/* Dashboard Grids */
.dashboard-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 20px;
}

/* Footer */
.main-footer {
    height: 50px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-topbar);
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
}

/* ==========================================================================
   Light Mode Component Overrides
   ========================================================================== */
/* Light Mode Sidebar Overrides */
[data-theme="light"] .sidebar {
    background-color: #FFFFFF !important;
    border-right: 1px solid #E2E8F0 !important;
}

[data-theme="light"] .sidebar-brand {
    border-bottom: 1px solid #E2E8F0 !important;
}

[data-theme="light"] .brand-title {
    background: linear-gradient(90deg, #0F172A, #2563EB) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

[data-theme="light"] .brand-subtitle {
    color: #64748B !important;
}

[data-theme="light"] .menu-section {
    color: #94A3B8 !important;
}

[data-theme="light"] .nav-link {
    color: #475569 !important;
}

[data-theme="light"] .nav-link i {
    color: #64748B !important;
}

[data-theme="light"] .nav-link:hover {
    color: #0F172A !important;
    background-color: #F1F5F9 !important;
}

[data-theme="light"] .nav-link:hover i {
    color: #2563EB !important;
}

[data-theme="light"] .nav-link.active {
    color: #2563EB !important;
    background: rgba(37, 99, 235, 0.08) !important;
    border-left: 3px solid #2563EB !important;
}

[data-theme="light"] .nav-link.active i {
    color: #2563EB !important;
}

[data-theme="light"] .nav-badge {
    background: rgba(37, 99, 235, 0.1) !important;
    color: #2563EB !important;
}

[data-theme="light"] .sidebar-footer {
    background: #F8FAFC !important;
    border-top: 1px solid #E2E8F0 !important;
}

[data-theme="light"] .sidebar-user .user-name {
    color: #0F172A !important;
}

[data-theme="light"] .sidebar-user .user-role {
    color: #64748B !important;
}

[data-theme="light"] .topbar {
    background-color: #FFFFFF;
    border-bottom: 1px solid #E2E8F0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .company-badge,
[data-theme="light"] .user-pill {
    background: #F8FAFC;
    border-color: #E2E8F0;
    color: #0F172A;
}

[data-theme="light"] .fy-badge {
    background: rgba(37, 99, 235, 0.08);
    border-color: rgba(37, 99, 235, 0.2);
    color: #2563EB;
}

[data-theme="light"] .form-control,
[data-theme="light"] .form-control-search {
    background-color: #FFFFFF;
    border-color: #CBD5E1;
    color: #0F172A;
}

[data-theme="light"] .form-control::placeholder,
[data-theme="light"] .form-control-search::placeholder {
    color: #94A3B8;
}

[data-theme="light"] .form-control:focus,
[data-theme="light"] .form-control-search:focus {
    background-color: #FFFFFF;
    border-color: var(--primary);
}

[data-theme="light"] select.form-control option {
    background-color: #FFFFFF;
    color: #0F172A;
}

[data-theme="light"] .data-table th {
    background-color: #F8FAFC;
    color: #475569;
    border-bottom: 1px solid #E2E8F0;
}

[data-theme="light"] .data-table td {
    border-bottom: 1px solid #E2E8F0;
    color: #1E293B;
}

[data-theme="light"] .data-table tbody tr:hover {
    background-color: #F8FAFC;
}

[data-theme="light"] .btn-secondary {
    background: #F1F5F9;
    color: #1E293B;
    border: 1px solid #CBD5E1;
}

[data-theme="light"] .btn-secondary:hover {
    background: #E2E8F0;
    color: #0F172A;
}

[data-theme="light"] .btn-outline {
    border-color: #CBD5E1;
    color: #475569;
}

[data-theme="light"] .btn-outline:hover {
    background: #F1F5F9;
    color: #0F172A;
    border-color: #94A3B8;
}

[data-theme="light"] .btn-icon {
    color: #64748B;
}

[data-theme="light"] .btn-icon:hover {
    background: #F1F5F9;
    color: #0F172A;
}

[data-theme="light"] .shortcut-box {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    color: #0F172A;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .shortcut-box:hover {
    background: #F8FAFC;
    border-color: rgba(37, 99, 235, 0.3);
}

[data-theme="light"] .badge-secondary {
    background: #E2E8F0;
    color: #334155;
}

[data-theme="light"] .badge-outline {
    border-color: #CBD5E1;
    color: #475569;
}

[data-theme="light"] .card-footer {
    background: #F8FAFC;
    border-top: 1px solid #E2E8F0;
}

[data-theme="light"] .main-footer {
    background: #FFFFFF;
    border-top: 1px solid #E2E8F0;
    color: #64748B;
}

[data-theme="light"] .filter-tab {
    color: #64748B;
    border-bottom-color: transparent;
}

[data-theme="light"] .filter-tab:hover {
    color: #0F172A;
}

[data-theme="light"] .filter-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

[data-theme="light"] .dropdown-menu {
    background-color: #FFFFFF;
    border-color: #E2E8F0;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .dropdown-item {
    color: #334155;
}

[data-theme="light"] .dropdown-item:hover {
    background-color: #F8FAFC;
    color: #0F172A;
}

[data-theme="light"] .dropdown-header {
    color: #64748B;
}

[data-theme="light"] .dropdown-divider {
    border-top-color: #E2E8F0;
}

[data-theme="light"] .doc-link-section {
    background: rgba(37, 99, 235, 0.04) !important;
    border-color: rgba(37, 99, 235, 0.18) !important;
}

[data-theme="light"] .doc-pill {
    background: #FFFFFF !important;
    border-color: #CBD5E1 !important;
    color: #475569 !important;
}

[data-theme="light"] .doc-pill:hover {
    border-color: var(--primary) !important;
    color: #0F172A !important;
}

[data-theme="light"] .doc-pill.active {
    background: #2563EB !important;
    border-color: #2563EB !important;
    color: #FFFFFF !important;
}

[data-theme="light"] .doc-selector option {
    background-color: #FFFFFF !important;
    color: #0F172A !important;
}

[data-theme="light"] .table-total-row td {
    border-top: 2px solid #E2E8F0;
}

/* ==========================================================================
   Print Stylesheet
   ========================================================================== */
@media print {
    body, html {
        background: #FFFFFF !important;
        color: #000000 !important;
    }

    .sidebar, .topbar, .main-footer, .no-print, .btn, .page-header .page-actions, .filter-tabs, .filter-form {
        display: none !important;
    }

    .main-wrapper {
        margin-left: 0 !important;
    }

    .content-body {
        padding: 0 !important;
    }

    .card {
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
    }

    .voucher-printable, .invoice-printable {
        max-width: 100% !important;
        padding: 0 !important;
    }

    .voucher-meta-box {
        background: #F8FAFC !important;
        border: 1px solid #E2E8F0 !important;
    }
    .voucher-meta-box * {
        color: #334155 !important;
    }

    .data-table th, .data-table td {
        color: #000000 !important;
        border-color: #CCCCCC !important;
    }
}

/* ---------- Tax & GST / extended master forms ---------- */
.col-2 { flex: 0 0 calc(16.666% - 14px); }
.col-3 { flex: 0 0 calc(25% - 12px); }
.col-5 { flex: 0 0 calc(41.666% - 10px); }
.col-7 { flex: 0 0 calc(58.333% - 7px); }
.col-9 { flex: 0 0 calc(75% - 4px); }
.col-12 { flex: 0 0 100%; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.tax-layout { display: grid; grid-template-columns: minmax(340px, 440px) minmax(0, 1fr); gap: 20px; align-items: start; }
.form-section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--primary); margin: 8px 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--border-color); }
.form-section-title small { text-transform: none; letter-spacing: 0; font-weight: 500; }
.check-group { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; }
.check-group.form-control { min-height: 42px; height: auto; }
.check-group label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; color: var(--text-secondary); font-size: 13px; }
.form-control-sm { padding: 6px 8px; font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.row-muted td { opacity: .5; }
.tax-map-row { border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 12px 14px; margin-bottom: 10px; background: rgba(255,255,255,.015); transition: border-color .15s, background .15s; }
.tax-map-row.is-on { border-color: var(--border-color-focus); background: var(--primary-glow); }
.tax-map-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; cursor: pointer; }
.tax-map-ledgers { display: none; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 12px; margin-top: 12px; }
.tax-map-row.is-on .tax-map-ledgers { display: grid; }
.tax-map-ledgers .form-group { margin-bottom: 8px; }
@media (max-width: 1100px) {
    .tax-layout, .grid-2 { grid-template-columns: 1fr; }
    .tax-map-ledgers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
    .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9 { flex: 0 0 100%; }
    .tax-map-ledgers { grid-template-columns: 1fr; }
}
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ==========================================================================
   Sidebar — module navigation (pill style)
   ========================================================================== */
.sidebar-modern { --sb-bg: #1E2638; --sb-text: #C3CCDA; --sb-muted: #8A96AB; --sb-hover: rgba(255,255,255,.06); --sb-accent: #3B82F6; --sb-accent-text: #FFFFFF; background: var(--sb-bg); }
.sidebar-modern .sidebar-brand { border-bottom-color: rgba(255,255,255,.06); }
.sb-menu { padding: 10px 10px 14px; display: flex; flex-direction: column; gap: 2px; }
.sb-link {
    width: 100%; display: flex; align-items: center; gap: 11px;
    padding: 8px 12px; border: 0; border-radius: 10px; background: transparent;
    color: var(--sb-text); font: inherit; font-size: 13.5px; font-weight: 600; letter-spacing: .1px;
    text-decoration: none; text-align: left; cursor: pointer;
    transition: background .18s ease, color .18s ease;
}
.sb-link:hover { background: var(--sb-hover); color: #FFFFFF; }
.sb-icon { width: 18px; font-size: 15px; text-align: center; color: var(--sb-muted); transition: color .18s ease; }
.sb-link:hover .sb-icon { color: #FFFFFF; }
.sb-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-chevron { font-size: 10px; color: var(--sb-muted); transition: transform .2s ease; }
.sb-group.is-open > .sb-link .sb-chevron { transform: rotate(90deg); }

/* Active: top-level page = solid pill; group containing the page = tinted */
.sb-link.is-active { background: var(--sb-accent); color: var(--sb-accent-text); box-shadow: 0 6px 16px rgba(59,130,246,.30); }
.sb-link.is-active .sb-icon { color: var(--sb-accent-text); }
.sb-group.is-active-group > .sb-link { color: #FFFFFF; background: rgba(59,130,246,.12); }
.sb-group.is-active-group > .sb-link .sb-icon,
.sb-group.is-active-group > .sb-link .sb-chevron { color: var(--sb-accent); }

/* Sub menu with a guide line */
.sb-sub { list-style: none; margin: 0 0 0 20px; padding: 0 0 0 12px; border-left: 1px solid rgba(255,255,255,.09); overflow: hidden; min-height: 0; }
.sb-sub li:first-child { margin-top: 2px; }
.sb-sub li:last-child { margin-bottom: 4px; }
.sb-sub-link {
    position: relative; display: block; padding: 6px 10px; border-radius: 7px;
    color: var(--sb-muted); font-size: 13px; font-weight: 500; text-decoration: none;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background .15s, color .15s;
}
.sb-sub-link:hover { color: #FFFFFF; background: var(--sb-hover); }
.sb-sub-link.is-active { color: #FFFFFF; background: rgba(59,130,246,.18); font-weight: 600; }
.sb-sub-link.is-active::before { content: ""; position: absolute; left: -13px; top: 6px; bottom: 6px; width: 2px; border-radius: 2px; background: var(--sb-accent); }

/* Light theme */
[data-theme="light"] .sidebar-modern { --sb-bg: #FFFFFF; --sb-text: #334155; --sb-muted: #64748B; --sb-hover: #F1F5F9; --sb-accent: #2563EB; background: var(--sb-bg) !important; }
[data-theme="light"] .sb-link:hover, [data-theme="light"] .sb-sub-link:hover { color: #0F172A; }
[data-theme="light"] .sb-link:hover .sb-icon { color: #0F172A; }
[data-theme="light"] .sb-link.is-active, [data-theme="light"] .sb-link.is-active:hover { color: #FFFFFF; }
[data-theme="light"] .sb-link.is-active .sb-icon { color: #FFFFFF; }
[data-theme="light"] .sb-group.is-active-group > .sb-link { color: #0F172A; background: rgba(37,99,235,.08); }
[data-theme="light"] .sb-sub { border-left-color: #E2E8F0; }
[data-theme="light"] .sb-sub-link.is-active { color: #1D4ED8; background: rgba(37,99,235,.10); }

/* ==========================================================================
   Row actions — first column of every table
   ========================================================================== */
.data-table th.col-actions, .data-table td.col-actions { width: 1%; white-space: nowrap; padding-left: 12px; padding-right: 8px; }
.row-actions { display: inline-flex; align-items: center; gap: 4px; }
.row-actions .act-form { display: inline; margin: 0; }
.act-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border-color);
    background: rgba(255,255,255,.03); color: var(--text-secondary); font-size: 12.5px;
    cursor: pointer; text-decoration: none; transition: background .15s, color .15s, border-color .15s, transform .1s;
}
.act-btn:hover { color: #fff; background: var(--primary); border-color: var(--primary); }
.act-btn:active { transform: scale(.94); }
.act-btn.act-danger:hover { background: var(--danger); border-color: var(--danger); }
.act-btn.act-success:hover { background: var(--success); border-color: var(--success); }
.act-btn.act-warning:hover { background: var(--warning); border-color: var(--warning); color: #111; }
.act-btn.is-disabled { opacity: .35; cursor: not-allowed; }
.act-btn.is-disabled:hover { background: rgba(255,255,255,.03); color: var(--text-secondary); border-color: var(--border-color); }
[data-theme="light"] .act-btn { background: #F8FAFC; border-color: #E2E8F0; color: #475569; }
[data-theme="light"] .act-btn:hover { color: #fff; }
tr.row-inactive td:not(.col-actions) { opacity: .55; }
input.code-auto { background: rgba(59,130,246,.08) !important; color: var(--primary) !important; font-weight: 700; cursor: default; }
.numbering-group td { background: rgba(59,130,246,.06); font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--primary); padding: 8px 14px !important; }
.numbering-table td { vertical-align: middle; }
.numbering-table .form-control-sm { min-width: 0; }
select.is-invalid { border-color: var(--danger) !important; }
.numbering-table select.s-year { min-width: 120px; }
.numbering-table select.s-sep { min-width: 110px; }
.numbering-table select.s-reset { min-width: 170px; }
.form-group small a, .form-group .text-muted a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }

/* Row action menu (⋮) */
.row-menu { position: relative; display: inline-block; }
.row-menu-btn {
    width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border-color);
    background: rgba(255,255,255,.03); color: var(--text-secondary); cursor: pointer; font-size: 14px;
    display: inline-flex; align-items: center; justify-content: center; transition: background .15s, color .15s, border-color .15s;
}
.row-menu-btn:hover, .row-menu-btn[aria-expanded="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }
.row-menu-list {
    position: fixed; z-index: 1000; min-width: 210px; padding: 6px;
    background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0,0,0,.45); display: flex; flex-direction: column; gap: 2px;
}
.row-menu-list[hidden] { display: none; }
.row-menu-form { margin: 0; display: block; }
.row-menu-item {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 7px;
    background: transparent; color: var(--text-secondary); font: inherit; font-size: 13px; font-weight: 500;
    text-align: left; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.row-menu-item > i { width: 16px; text-align: center; color: var(--text-muted); }
.row-menu-item:hover, .row-menu-item:focus-visible { background: rgba(59,130,246,.14); color: var(--text-primary); outline: none; }
.row-menu-item:hover > i { color: var(--primary); }
.row-menu-item.rm-success > i { color: var(--success); }
.row-menu-item.rm-warning > i { color: var(--warning); }
.row-menu-item.rm-danger, .row-menu-item.rm-danger > i { color: var(--danger); }
.row-menu-item.rm-danger:hover { background: var(--danger-bg); color: var(--danger); }
.row-menu-item.is-disabled { opacity: .45; cursor: not-allowed; }
.row-menu-item.is-disabled:hover { background: transparent; color: var(--text-secondary); }
.row-menu-item small { display: block; font-size: 10.5px; color: var(--text-muted); }
.row-menu-divider { height: 1px; background: var(--border-color); margin: 4px 2px; }
[data-theme="light"] .row-menu-list { background: #fff; border-color: #E2E8F0; box-shadow: 0 12px 28px rgba(15,23,42,.14); }
[data-theme="light"] .row-menu-btn { background: #F8FAFC; border-color: #E2E8F0; color: #475569; }
[data-theme="light"] .row-menu-btn:hover, [data-theme="light"] .row-menu-btn[aria-expanded="true"] { color: #fff; }
.row-menu-list { background: #1B2740; }
[data-theme="light"] .row-menu-list { background: #FFFFFF; }

/* Settings: full-width two-column card layout */
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.settings-grid > .card:first-child { grid-column: 1 / -1; }
@media (max-width: 1000px) { .settings-grid { grid-template-columns: 1fr; } }
.settings-grid > .card { margin: 0; }

/* Simple Receipt / Payment form */
.simple-voucher .step-no { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 12px; font-weight: 700; margin-right: 6px; }
.outstanding-box { min-height: 42px; display: flex; align-items: center; padding: 8px 14px; border-radius: 8px; border: 1px dashed var(--border-color); color: var(--text-muted); font-size: 13px; }
.outstanding-box.has-due { border-style: solid; border-color: rgba(245,158,11,.4); background: var(--warning-bg); color: var(--text-primary); }
.outstanding-box.has-due strong { color: var(--warning); margin-right: 4px; }
.outstanding-box.is-clear { border-style: solid; border-color: rgba(16,185,129,.35); background: var(--success-bg); color: var(--text-secondary); }
.choice-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.choice-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--border-color); background: rgba(255,255,255,.02); cursor: pointer; transition: border-color .15s, background .15s; }
.choice-card input { margin-top: 4px; accent-color: var(--primary); }
.choice-card strong { display: block; color: var(--text-primary); font-size: 14px; }
.choice-card small { display: block; color: var(--text-muted); font-size: 12px; margin-top: 2px; }
.choice-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: rgba(59,130,246,.12); color: var(--primary); flex: 0 0 auto; }
.choice-card:has(input:checked) { border-color: var(--primary); background: rgba(59,130,246,.08); box-shadow: 0 0 0 1px var(--primary) inset; }
.doc-list { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto; }
.doc-row { display: grid; grid-template-columns: 22px 1.2fr 1.2fr 1fr auto; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border-color); cursor: pointer; font-size: 13px; }
.doc-row:hover { background: rgba(255,255,255,.03); }
.doc-row.is-selected { border-color: var(--success); background: var(--success-bg); }
.doc-row input { accent-color: var(--success); }
.doc-row .doc-no { font-weight: 700; color: var(--primary); }
.doc-row .doc-bal { font-weight: 700; color: var(--warning); text-align: right; font-family: var(--font-mono, monospace); }
.doc-empty { padding: 14px; border-radius: 10px; border: 1px dashed var(--border-color); color: var(--text-muted); font-size: 13px; }
.amount-input { font-size: 18px !important; font-weight: 700; }
.more-options { margin-top: 4px; }
.more-options > summary { cursor: pointer; color: var(--text-secondary); font-size: 13px; font-weight: 600; list-style: none; }
.more-options > summary::-webkit-details-marker { display: none; }
@media (max-width: 760px) { .choice-cards { grid-template-columns: 1fr; } .doc-row { grid-template-columns: 22px 1fr auto; } .doc-row .doc-date, .doc-row .doc-total { display: none; } }

/* ---------- Stock movements ---------- */
.mv-filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; align-items: end; }
.mv-filters .form-group { margin: 0; }
.mv-filters label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; }
.mv-buttons { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 640px) { .mv-filters { grid-template-columns: 1fr; } }
.mv-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
@media (max-width: 900px) { .mv-summary { grid-template-columns: repeat(2, 1fr); } }
.mv-stat { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; border-left: 4px solid #64748B; }
.mv-stat.mv-in { border-left-color: #10B981; }
.mv-stat.mv-out { border-left-color: #EF4444; }
.mv-stat.mv-close { border-left-color: #3B82F6; }
.mv-stat-label { font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--text-muted); }
.mv-stat-value { font-size: 22px; font-weight: 800; font-family: var(--font-mono); }
.mv-stat-value small { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.mv-stat-sub { font-size: 12px; color: var(--text-muted); }
.mv-table td { vertical-align: top; }
.mv-table .nowrap { white-space: nowrap; }
.mv-item-link, .stock-link { color: inherit; text-decoration: none; border-bottom: 1px dashed currentColor; }
.mv-item-link:hover, .stock-link:hover { color: var(--primary, #3B82F6); }
.mv-doc-link { color: #60A5FA; font-weight: 600; text-decoration: none; white-space: nowrap; }
.mv-doc-link:hover { text-decoration: underline; }
[data-theme="light"] .mv-doc-link { color: #2563EB; }
.mv-table td.text-right { white-space: nowrap; }

/* ---------- Company bank accounts ---------- */
.bank-summary { display: flex; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.bank-summary > div { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 12px 18px; display: flex; flex-direction: column; gap: 2px; min-width: 200px; }
.bank-summary strong { font-size: 20px; font-family: var(--font-mono); }
.bank-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; }
@media (max-width: 480px) { .bank-grid { grid-template-columns: 1fr; } }
.bank-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 18px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow-card); }
.bank-card.is-inactive { opacity: .6; }
.bank-card-head { display: flex; gap: 12px; align-items: flex-start; }
.bank-logo { width: 42px; height: 42px; border-radius: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px; color: #fff; background: linear-gradient(135deg, #3B82F6, #6366F1); }
.bank-title { flex: 1; min-width: 0; }
.bank-title h3 { margin: 0 0 6px; font-size: 16px; font-weight: 700; color: var(--text-primary); }
.bank-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.bank-number { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-radius: var(--radius-md); background: rgba(148, 163, 184, .08); border: 1px dashed var(--border-color); }
.bank-number span { font-size: 17px; letter-spacing: 1.5px; font-weight: 700; flex: 1; color: var(--text-primary); }
.icon-btn { background: transparent; border: 0; color: var(--text-muted); cursor: pointer; padding: 4px 6px; border-radius: 6px; font-size: 13px; }
.icon-btn:hover { color: var(--text-primary); background: rgba(148, 163, 184, .15); }
.bank-details { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 0; }
.bank-details dt { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); font-weight: 600; }
.bank-details dd { margin: 2px 0 0; font-size: 13px; color: var(--text-primary); word-break: break-word; }
.bank-card-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; padding-top: 12px; border-top: 1px solid var(--border-color); margin-top: auto; }
.bank-card-foot > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bank-card-foot strong { font-size: 17px; }
.bank-ledger-link { color: #60A5FA; font-size: 13px; text-decoration: none; }
.bank-ledger-link:hover { text-decoration: underline; }
[data-theme="light"] .bank-ledger-link { color: #2563EB; }
.empty-state-bank { text-align: center; padding: 48px 20px; }
.empty-state-bank > i { font-size: 40px; color: var(--text-muted); margin-bottom: 12px; }
.empty-state-bank p { max-width: 520px; margin: 8px auto 18px; }
.choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 700px) { .choice-row { grid-template-columns: 1fr; } }
.choice-pill { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border-color); border-radius: var(--radius-md); cursor: pointer; }
.choice-pill:has(input:checked) { border-color: var(--primary); background: rgba(59, 130, 246, .08); }
.choice-pill input { margin-top: 3px; }
.choice-pill span { display: flex; flex-direction: column; gap: 2px; }
.choice-pill strong { color: var(--text-primary); font-size: 14px; }
.choice-pill small { color: var(--text-muted); font-size: 12px; }
.bank-print { margin-top: 16px; padding: 12px 14px; border: 1px solid var(--border-color); border-radius: var(--radius-md); font-size: 13px; }
.bank-print h4 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); }
.bank-print dl { display: grid; grid-template-columns: max-content 1fr; gap: 3px 14px; margin: 0; }
.bank-print dt { color: var(--text-muted); }
.bank-print dd { margin: 0; font-weight: 600; }
.alert-info { background: rgba(59, 130, 246, 0.12); border: 1px solid rgba(59, 130, 246, 0.25); color: #93C5FD; }
[data-theme="light"] .alert-info { color: #1D4ED8; }
.bank-card-foot strong { white-space: nowrap; }

/* ======================= Security / gateway / accounting additions ======================= */
.auth-notice { margin-bottom: 16px; padding: 10px 12px; border-radius: 8px; font-size: 13px; background: #EFF6FF; color: #1D4ED8; border: 1px solid #BFDBFE; }
.auth-notice-warn { background: #FFFBEB; color: #92400E; border-color: #FDE68A; }
.auth-notice code { font-size: 12px; }
.auth-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 12px; flex-wrap: wrap; }
.auth-row a, .link-btn { color: #0074D0; font-weight: 700; text-decoration: none; background: none; border: 0; cursor: pointer; font: inherit; font-weight: 700; padding: 0; }
.link-btn:disabled { color: #9AA8BC; cursor: not-allowed; }
.auth-row .text-muted { color: #526B8A; }
.auth-layout-single { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px 16px; grid-template-columns: none; }
.auth-card-narrow { width: 100%; max-width: 460px; }
.auth-help { margin-top: 16px; font-size: 12px; color: #667C99; }
.otp-wrap input { letter-spacing: 8px; font-size: 22px !important; font-weight: 700; font-family: var(--font-mono); }
.inline-form { display: inline; margin: 0; }
.mt-3 { margin-top: 12px; }

.gateway-page { min-height: 100vh; background: var(--bg-main); color: var(--text-primary); }
.gateway-top { background: var(--bg-topbar, var(--bg-card)); }
.gateway-head h1 { color: var(--text-primary); }
.gateway-theme { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border-color); background: var(--bg-card); color: var(--text-secondary); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.gateway-theme:hover { color: var(--primary); border-color: var(--primary); }
.gateway-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 24px; border-bottom: 1px solid var(--border-color); flex-wrap: wrap; }
.gateway-brand { display: flex; align-items: center; gap: 8px; font-size: 18px; }
.gateway-brand img { width: 28px; height: 28px; }
.gateway-brand span { color: var(--text-muted); font-size: 13px; text-transform: uppercase; letter-spacing: 1px; }
.gateway-user { display: flex; align-items: center; gap: 10px; font-size: 13px; flex-wrap: wrap; }
.gateway-main { max-width: 1100px; margin: 0 auto; padding: 28px 16px 48px; }
.gateway-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.gateway-head h1 { margin: 0 0 4px; font-size: 26px; }
.gateway-empty { text-align: center; padding: 48px 16px; }
.gateway-empty > i { font-size: 44px; color: var(--primary); margin-bottom: 10px; }
.company-list tbody tr { cursor: pointer; outline: none; }
.company-list tbody tr.is-selected { background: rgba(59, 130, 246, .14); box-shadow: inset 3px 0 0 var(--primary); }
.company-switch { text-decoration: none; color: inherit; gap: 8px; }
.company-switch:hover { border-color: var(--primary); }
.role-badge { font-size: 10px; padding: 2px 6px; }
.user-pill-name { color: inherit; text-decoration: none; }

.filter-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filter-row .form-group { margin: 0; min-width: 150px; }
.filter-row .form-group.grow { flex: 1 1 260px; }
.filter-row .form-label { font-size: 12px; margin-bottom: 4px; }
.filter-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }
.strike { text-decoration: line-through; }
.is-cancelled { position: relative; }
.is-cancelled::after { content: 'CANCELLED'; position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%) rotate(-18deg); font-size: 64px; font-weight: 900;
    color: rgba(239, 68, 68, .18); letter-spacing: 8px; pointer-events: none; }
.cancel-box { border: 1px dashed rgba(239, 68, 68, .5); border-radius: var(--radius-lg); padding: 12px 16px; background: rgba(239, 68, 68, .04); }
.cancel-box summary { cursor: pointer; color: #EF4444; font-weight: 700; }
.pl-4 { padding-left: 24px; }

.report-group-title { font-size: 13px; text-transform: uppercase; letter-spacing: .8px; color: var(--text-muted); margin: 22px 0 10px; }
.report-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.report-tile { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-lg); background: var(--bg-card); border: 1px solid var(--border-color);
    text-decoration: none; color: var(--text-primary); transition: border-color .15s, transform .15s; }
.report-tile:hover { border-color: var(--primary); transform: translateY(-2px); }
.report-tile > i { font-size: 18px; color: var(--primary); width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: 8px; background: rgba(59, 130, 246, .12); flex-shrink: 0; }
.report-tile span { display: flex; flex-direction: column; gap: 3px; }
.report-tile small { color: var(--text-muted); font-size: 12px; line-height: 1.4; }

.gstr-summary, .reco-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
@media (max-width: 900px) { .gstr-summary, .reco-summary { grid-template-columns: repeat(2, 1fr); } }
.gstr-summary > div, .reco-summary > div { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 12px 16px; display: flex; flex-direction: column; gap: 3px; }
.gstr-summary span, .reco-summary span { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); font-weight: 700; }
.gstr-summary strong, .reco-summary strong { font-size: 20px; font-family: var(--font-mono); }
.gstr-summary small, .reco-summary small { color: var(--text-muted); font-size: 12px; }
.reco-final { border-color: var(--primary) !important; }

.statement-head { display: flex; justify-content: space-between; gap: 16px; border-bottom: 2px solid var(--border-color); padding-bottom: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.statement-head h2 { margin: 0; font-size: 20px; }
.statement-head h3 { margin: 0; color: var(--primary); font-size: 15px; letter-spacing: 1px; }
.note-doc-head { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 900px) { .note-doc-head { grid-template-columns: repeat(2, 1fr); } }
.note-doc-head > div { display: flex; flex-direction: column; gap: 2px; }
.col-input { width: 170px; }
.daybook .db-head td { border-top: 2px solid var(--border-color); background: rgba(148, 163, 184, .05); }
.daybook .db-line td { border-top: 0; padding-top: 4px; padding-bottom: 4px; font-size: 13px; }
.security-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.security-list i { width: 20px; }
.pdf-dropdown { position: relative; display: inline-block; }
.pdf-dropdown .dropdown-menu { right: 0; left: auto; min-width: 240px; }

@media print {
    .filter-row, .cancel-box, .report-tiles { display: none !important; }
}
.gateway-logo { width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #3B82F6, #6366F1); color: #fff; font-size: 14px; }
.otp-wrap input::placeholder { letter-spacing: normal; font-size: 14px; font-weight: 500; font-family: var(--font-sans); }
/* Readable links inside tables and reports */
.content-body .data-table a:not(.btn):not(.row-menu-item):not(.badge), .statement-card a, .content-body .text-sm a, .page-desc a { color: #60A5FA; text-decoration: none; }
.content-body .data-table a:not(.btn):not(.row-menu-item):not(.badge):hover { text-decoration: underline; }
[data-theme="light"] .content-body .data-table a:not(.btn):not(.row-menu-item):not(.badge), [data-theme="light"] .statement-card a, [data-theme="light"] .page-desc a { color: #2563EB; }
.data-table td.text-right, .data-table th.text-right, .data-table tfoot th { white-space: nowrap; }

/* ---------- Import masters ---------- */
.import-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.import-tab { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border-color); background: var(--bg-card); color: var(--text-secondary); text-decoration: none; font-size: 13px; font-weight: 600; display: inline-flex; gap: 8px; align-items: center; }
.import-tab.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.import-steps { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 1000px) { .import-steps { grid-template-columns: 1fr; } }
.step-no { display: inline-flex; width: 24px; height: 24px; border-radius: 50%; background: var(--primary); color: #fff; align-items: center; justify-content: center; font-size: 12px; margin-right: 6px; }
.import-drop { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 28px 16px; border: 2px dashed var(--border-color); border-radius: var(--radius-lg); cursor: pointer; text-align: center; color: var(--text-muted); }
.import-drop:hover { border-color: var(--primary); color: var(--text-primary); }
.import-drop i { font-size: 30px; color: var(--primary); }
.import-drop input { max-width: 260px; font-size: 12px; }
.import-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 700px) { .import-stats { grid-template-columns: repeat(2, 1fr); } }
.import-stats > div { border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 10px 14px; display: flex; flex-direction: column; }
.import-stats strong { font-size: 24px; font-family: var(--font-mono); }
.import-stats span { font-size: 12px; color: var(--text-muted); }
.import-cols td, .import-cols th { padding-top: 6px; padding-bottom: 6px; }

/* ==========================================================================
   Tables: one line per row (numbers, codes, dates never break), long text may wrap
   ========================================================================== */
.chart-container { position: relative; height: 280px; width: 100%; }
/* Keep wide tables inside their card (scroll sideways there) instead of stretching the whole page */
.main-wrapper, .content-body { min-width: 0; }
.content-body > * { max-width: 100%; }
.dashboard-grid-2 > *, .grid-2 > *, .two-col > * { min-width: 0; }
.data-table th { white-space: nowrap; }
.data-table td { white-space: nowrap; }
.data-table td.wrap, .data-table td.text-sm, .data-table td.text-muted, .data-table td[colspan] { white-space: normal; }
/* Entry grids (invoice / bill / order / journal lines): fields stack inside their cell, never run into the next column */
form .data-table td, .data-table td:has(input:not([type=hidden]), select, textarea) { white-space: normal; }
form .data-table td > .form-control, form .data-table td > select.form-control { display: block; width: 100%; max-width: 100%; }
.data-table td.wrap { min-width: 180px; }
.table-responsive { -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.table-responsive::-webkit-scrollbar { height: 8px; }
.table-responsive::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, .35); border-radius: 8px; }
.data-table tbody tr:nth-child(even) { background-color: rgba(255, 255, 255, 0.012); }
[data-theme="light"] .data-table tbody tr:nth-child(even) { background-color: rgba(15, 23, 42, 0.018); }

/* ==========================================================================
   Laptop screens (1366 / 1280 px and 125–150% Windows scaling): compact density
   ========================================================================== */
@media (max-width: 1536px), (max-height: 820px) {
    :root { --sidebar-width: 236px; --topbar-height: 58px; }
    .sidebar-brand { padding: 14px 18px; }
    .brand-icon { width: 34px; height: 34px; font-size: 17px; }
    .sb-menu { padding: 8px 8px 12px; }
    .sb-link { padding: 7px 10px; font-size: 13px; gap: 10px; }
    .sb-sub { margin-left: 18px; }
    .sb-sub-link { padding: 5px 9px; font-size: 12.5px; }
    .sidebar-footer { padding: 10px 16px; }

    .topbar { padding: 0 20px; }
    .content-body { padding: 18px 22px; }
    .main-footer { height: 40px; padding: 0 22px; }
    .page-header { margin-bottom: 16px; gap: 12px; }
    .page-title { font-size: 21px; }
    .page-desc { font-size: 12.5px; }

    .card { margin-bottom: 16px; }
    .card-header { padding: 12px 16px; }
    .card-title { font-size: 15px; }
    .card-body { padding: 16px; }

    .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
    .kpi-card { padding: 14px 16px; }
    .kpi-header { margin-bottom: 8px; }
    .kpi-icon-box { width: 30px; height: 30px; font-size: 14px; }
    .kpi-value { font-size: 22px; margin-bottom: 6px; }
    .dashboard-grid-2 { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 16px; }
    .chart-container { height: 250px; }

    .data-table { font-size: 13px; }
    .data-table th { padding: 9px 10px; font-size: 11px; letter-spacing: .4px; }
    .data-table td { padding: 8px 10px; }
    .data-table td.truncate { max-width: 210px !important; }
    .row-menu-btn { width: 28px; height: 28px; font-size: 13px; }
    .table-total-row td { padding: 9px 12px; }

    .btn { padding: 8px 14px; font-size: 13px; }
    .form-group { margin-bottom: 12px; }
    .form-label { font-size: 12px; margin-bottom: 4px; }
    .form-control { padding: 7px 11px; font-size: 13px; }
}

/* Short screens (768 px tall laptops): sidebar user box takes room from the menu */
@media (max-height: 720px) {
    .sidebar-footer { display: none; }
    .content-body { padding-top: 14px; }
}

/* ==========================================================================
   Small laptops / tablets: sidebar slides over the page
   ========================================================================== */
.sidebar-backdrop { display: none; }
@media (max-width: 1100px) {
    .sidebar { transform: translateX(-100%); box-shadow: none; z-index: 120; }
    .main-wrapper, body.sidebar-collapsed .main-wrapper { margin-left: 0; }
    body.sidebar-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .45); }
    body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 110; background: rgba(2, 6, 23, .55); }
    .dashboard-grid-2 { grid-template-columns: 1fr; }
    .fy-badge { display: none; }
}

@media (max-width: 760px) {
    .topbar { padding: 0 12px; gap: 8px; }
    .topbar-left, .topbar-right { gap: 8px; }
    .company-badge .company-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    #quickAddBtn span, #quickAddBtn .fa-chevron-down, .user-pill-name, .role-badge { display: none; }
    .content-body { padding: 14px 12px; }
    .page-header { flex-direction: column; align-items: stretch; }
    .page-actions { flex-wrap: wrap; }
    .page-actions .btn { flex: 1 1 auto; justify-content: center; }
    .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .kpi-value { font-size: 18px; }
    .dashboard-grid-2 { grid-template-columns: minmax(0, 1fr); }
    .card-body { padding: 12px; }
    .data-table th, .data-table td { padding: 8px 10px; }
    .main-footer { display: none; }
}
@media (max-width: 420px) { .kpi-grid { grid-template-columns: 1fr; } }

/* Invoice / bill totals panel: label shrinks and wraps, the amount box keeps its size inside the card */
.summary-line { gap: 12px; }
.summary-line > span { flex: 1 1 auto; min-width: 0; }
.summary-line > .form-control, .summary-line > select.form-control { flex: 0 0 auto; width: min(130px, 48%) !important; }
.summary-line > select.form-control { width: min(220px, 60%) !important; }

/* Light theme: readable status tags (Paid, Unpaid, Active, Owner …) on white */
[data-theme="light"] .badge-primary { background: #DBEAFE; color: #1D4ED8; border-color: #BFDBFE; }
[data-theme="light"] .badge-success { background: #D1FAE5; color: #047857; border-color: #A7F3D0; }
[data-theme="light"] .badge-danger  { background: #FEE2E2; color: #B91C1C; border-color: #FECACA; }
[data-theme="light"] .badge-warning { background: #FEF3C7; color: #B45309; border-color: #FDE68A; }
[data-theme="light"] .badge-info    { background: #CFFAFE; color: #0E7490; border-color: #A5F3FC; }
[data-theme="light"] .badge-purple,
[data-theme="light"] .badge-config  { background: #EDE9FE; color: #6D28D9; border-color: #DDD6FE; }

/* Light theme: filter tabs (Chart of Accounts, Settings, Tax) — selected tab is solid blue with white text */
[data-theme="light"] .filter-tab { background: #FFFFFF; border: 1px solid #E2E8F0; color: #475569; }
[data-theme="light"] .filter-tab:hover { background: #F1F5F9; color: #0F172A; }
[data-theme="light"] .filter-tab.active { background: var(--primary); border-color: var(--primary); color: #FFFFFF; }

/* Auto-Posting Ledgers (JE mapping) — plain-language overview */
.section-title { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.posting-status { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: var(--radius-lg); border: 1px solid; flex-wrap: wrap; }
.posting-status > i { font-size: 22px; }
.posting-status > div { flex: 1 1 320px; display: flex; flex-direction: column; gap: 2px; }
.posting-status.is-ok { border-color: rgba(16,185,129,.35); background: rgba(16,185,129,.08); }
.posting-status.is-ok > i { color: var(--success); }
.posting-status.is-missing { border-color: rgba(245,158,11,.4); background: rgba(245,158,11,.08); }
.posting-status.is-missing > i { color: var(--warning); }
.posting-note { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: var(--radius-md); background: rgba(59,130,246,.08); border: 1px solid rgba(59,130,246,.25); font-size: 13px; }
.posting-note > i { color: var(--primary); margin-top: 3px; }
.posting-examples { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.posting-example { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 14px 16px; }
.posting-example-head { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 4px; }
.posting-example-head i { color: var(--primary); }
.posting-lines { width: 100%; border-collapse: collapse; font-size: 13px; }
.posting-lines td { padding: 6px 4px; border-top: 1px solid var(--border-color); vertical-align: top; }
.posting-lines td:first-child { width: 38px; }
.posting-lines td:last-child { white-space: nowrap; width: 70px; }
.posting-lines .debit-pill, .posting-lines .credit-pill { font-size: 10px; padding: 2px 6px; }
.advanced-mapping { border: 1px solid var(--border-color); border-radius: var(--radius-lg); background: var(--bg-card); margin-bottom: 24px; }
.advanced-mapping > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; cursor: pointer; list-style: none; flex-wrap: wrap; }
.advanced-mapping > summary::-webkit-details-marker { display: none; }
.advanced-mapping > summary #btnSaveAll { display: none; }
.advanced-mapping[open] > summary { border-bottom: 1px solid var(--border-color); }
.advanced-mapping[open] > summary #btnSaveAll { display: inline-flex; }
.advanced-mapping-body { padding: 16px; }

/* Busy button while a form is being saved */
.btn.is-busy { pointer-events: none; opacity: .85; }
.btn.is-busy::before { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: easebill-spin .7s linear infinite; }
.btn.is-busy > i { display: none; }
.auth-primary.is-busy { pointer-events: none; opacity: .85; }
.auth-primary.is-busy::after { content: ""; width: 14px; height: 14px; margin-left: 8px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; vertical-align: -2px; animation: easebill-spin .7s linear infinite; }
.order-hint { margin: -6px 0 16px; font-size: 12.5px; color: var(--text-muted); display: flex; gap: 6px; align-items: center; }
.order-hint i { color: var(--primary); }

/* Skeleton placeholders while a page or table is loading */
:root { --skel-a: rgba(148, 163, 184, .10); --skel-b: rgba(148, 163, 184, .22); }
[data-theme="light"] { --skel-a: #E8EDF3; --skel-b: #F5F7FA; }
.skeleton { display: inline-block; max-width: 100%; border-radius: 6px; vertical-align: middle;
    background: linear-gradient(90deg, var(--skel-a) 25%, var(--skel-b) 37%, var(--skel-a) 63%); background-size: 400% 100%; animation: skeleton-shine 1.3s ease infinite; }
@keyframes skeleton-shine { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.skeleton-row td { padding-top: 14px; padding-bottom: 14px; }
.skeleton-page .page-header { align-items: center; }
body.is-loading { cursor: progress; }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

/* Installable app (PWA) */
.install-app-btn[hidden] { display: none !important; }
.install-app-btn { gap: 6px; }
@media (max-width: 900px) { .topbar .install-app-btn span { display: none; } }
/* Installed app window / Android app: no browser chrome, so use the safe area at the top */
.is-installed-app body { padding-top: env(safe-area-inset-top, 0); }

/* ==========================================================================
   Phone layout (≤ 760px): no sideways page scroll, compact header,
   lists and line items as cards, reports scroll inside their card
   ========================================================================== */
@media (max-width: 760px) {
    html, body { overflow-x: clip; }
    .main-wrapper, .content-body { min-width: 0; max-width: 100vw; }
    .content-body { padding: 12px 10px 24px; }

    /* Top bar: menu · company · + · theme · sign out */
    .topbar { padding: 0 8px; gap: 6px; height: 56px; }
    .topbar-left { gap: 6px; min-width: 0; flex: 1 1 auto; }
    .topbar-right { gap: 4px; flex: 0 0 auto; }
    .topbar .btn-icon { width: 34px; height: 34px; }
    .company-badge { min-width: 0; padding: 6px 10px; font-size: 13px; }
    .company-badge .company-name { max-width: none; min-width: 0; flex: 1 1 auto; }
    .user-pill { padding: 2px; gap: 0; border: 0; background: transparent; }
    .user-pill .status-indicator { display: none; }
    .topbar-logout { width: 34px; height: 34px; }
    #quickAddBtn { padding: 7px 11px; }
    .dropdown-menu { max-width: calc(100vw - 16px); }

    /* Page title and buttons */
    .page-header { gap: 10px; margin-bottom: 14px; }
    .page-title { font-size: 20px; line-height: 1.25; }
    .page-desc { font-size: 12.5px; }
    .page-actions { gap: 8px; }
    .page-actions .btn, .page-actions > a, .page-actions > button { min-height: 40px; }
    .page-actions .dropdown, .page-actions .pdf-dropdown { flex: 1 1 auto; display: flex; }
    .page-actions .dropdown > .btn, .page-actions .pdf-dropdown > .btn { flex: 1 1 auto; }

    /* Tabs: one swipeable row */
    .filter-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -2px; margin-right: -10px; padding-right: 10px; }
    .filter-tabs::-webkit-scrollbar { display: none; }
    .filter-tab { flex: 0 0 auto; white-space: nowrap; padding: 7px 12px; font-size: 12.5px; }

    /* Cards */
    .card { margin-bottom: 14px; border-radius: 12px; }
    .card-header { padding: 12px; gap: 8px; }
    .card-header > * { min-width: 0; }
    .card-body, .card-body.p-3, .card-body.p-4, .card-body.p-5 { padding: 12px !important; }
    .search-box { display: flex; width: 100%; }
    .form-control-search { width: 100%; font-size: 16px; }

    /* Forms: full-width fields, 16px text so phones do not zoom in */
    .content-body input:not([type=checkbox]):not([type=radio]), .content-body select, .content-body textarea { max-width: 100%; font-size: 16px; }
    .content-body .form-control[style*="width"], .content-body select[style*="width"], .content-body input[style*="width"] { width: 100% !important; }
    .content-body .form-actions .btn { flex: 1 1 auto; justify-content: center; min-height: 42px; }
    /* Filter rows written as one flexible line: label + field pairs, then the buttons */
    .content-body form [style*="display: flex"], .content-body form [style*="display:flex"] { flex-wrap: wrap !important; gap: 8px 10px !important; }
    .content-body form [style*="display: flex"] > label, .content-body form [style*="display:flex"] > label { flex: 0 0 auto; min-width: 48px; margin: 0 !important; }
    .content-body form [style*="display: flex"] > .form-control, .content-body form [style*="display: flex"] > select, .content-body form [style*="display: flex"] > input,
    .content-body form [style*="display:flex"] > .form-control, .content-body form [style*="display:flex"] > select, .content-body form [style*="display:flex"] > input { flex: 1 1 58%; min-width: 0; width: auto !important; }
    .content-body form [style*="display: flex"] > .btn, .content-body form [style*="display:flex"] > .btn { flex: 1 1 auto; justify-content: center; min-height: 40px; }

    /* Printed-document layouts (invoice, quotation, order, voucher): side-by-side blocks stack */
    .content-body .card-body div[style*="space-between"]:not(.summary-line) { flex-wrap: wrap; gap: 14px; }
    .content-body .card-body div[style*="space-between"]:not(.summary-line) > div { flex: 1 1 240px; min-width: 0; max-width: 100%; }
    .content-body .card-body div[style*="space-between"]:not(.summary-line) > div[style*="width"] { width: auto !important; }
    .content-body .card-body [style*="text-align: right"], .content-body .card-body [style*="text-align:right"] { overflow-wrap: anywhere; }
    table.eb-cards-editor td:has(> .btn-icon:only-child) { position: absolute; top: 6px; right: 4px; flex: none; }
    table.eb-cards-editor td:has(> .btn-icon:only-child)::before { display: none !important; }

    /* Report headings inside cards */
    .content-body .card-body h2[style*="font-size"] { font-size: 18px !important; overflow-wrap: anywhere; }
    .content-body .card-body h3[style*="font-size"] { font-size: 15px !important; overflow-wrap: anywhere; }

    /* ---- Lists (⋮ menu) and line-item editors: one card per row ---- */
    .table-responsive:has(> table.eb-cards) { overflow: visible; }
    table.eb-cards, table.eb-cards > tbody, table.eb-cards > tfoot { display: block; width: 100%; min-width: 0 !important; }
    table.eb-cards > thead { display: none; }
    table.eb-cards > tbody > tr, table.eb-cards > tfoot > tr {
        display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 12px;
        position: relative; padding: 12px 14px; border-bottom: 1px solid var(--border-color);
    }
    table.eb-cards > tbody > tr:nth-child(even) { background: rgba(255, 255, 255, .015); }
    table.eb-cards td, table.eb-cards th {
        display: block; flex: 1 1 calc(50% - 12px); min-width: 0 !important; width: auto !important; max-width: 100%;
        padding: 0 !important; border: 0 !important; text-align: left !important; white-space: normal !important; overflow-wrap: anywhere;
        font-size: 13.5px;
    }
    table.eb-cards td[data-label]:not([data-label=""])::before, table.eb-cards th[data-label]:not([data-label=""])::before {
        content: attr(data-label); display: block; margin-bottom: 2px;
        font-size: 10.5px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; color: var(--text-muted);
    }
    table.eb-cards .eb-cell-empty { display: none; }
    table.eb-cards .eb-cell-full { flex-basis: 100%; }
    table.eb-cards .eb-cell-full::before { display: none !important; }
    /* Title line: first column (and the name beside a short code) */
    table.eb-cards-list .eb-cell-primary { flex: 1 1 100%; font-size: 15px; font-weight: 600; padding-right: 38px !important; }
    table.eb-cards-list .eb-cell-primary::before { display: none !important; }
    table.eb-cards-list .eb-cell-primary:has(+ .eb-cell-title2) { flex: 0 1 auto; max-width: 45%; padding-right: 0 !important; }
    table.eb-cards-list .eb-cell-title2 { flex: 1 1 calc(100% - 160px); padding-right: 38px !important; }
    /* ⋮ menu in the card's top-right corner */
    table.eb-cards .eb-cell-actions { position: absolute; top: 9px; right: 8px; flex: none; width: auto !important; }
    table.eb-cards .eb-cell-actions::before { display: none !important; }
    table.eb-cards .row-menu-btn { width: 34px; height: 34px; }
    /* Line-item editor: item field full width, small fields two per line */
    table.eb-cards-editor > tbody > tr { padding: 12px; border: 1px solid var(--border-color); border-radius: 10px; margin: 10px; background: rgba(255, 255, 255, .02); }
    table.eb-cards-editor .eb-cell-primary { flex: 1 1 100%; padding-right: 34px !important; }
    table.eb-cards-editor td:has(.remove-item-btn), table.eb-cards-editor td:has(.remove-line), table.eb-cards-editor td:has(.btn-remove) { position: absolute; top: 6px; right: 4px; flex: none; }
    table.eb-cards-editor td:has(.remove-item-btn)::before, table.eb-cards-editor td:has(.remove-line)::before, table.eb-cards-editor td:has(.btn-remove)::before { display: none; }
    table.eb-cards-editor .form-control, table.eb-cards-editor select, table.eb-cards-editor input:not([type=checkbox]) { width: 100% !important; min-width: 0 !important; }
    table.eb-cards-editor .row-total, table.eb-cards-editor td.text-right:not(:has(input, select)) { font-size: 15px; }
    table.eb-cards > tfoot > tr { border-bottom: 0; }

    /* ---- Reports and document views: columns kept, scroll sideways inside the card ---- */
    table.eb-scroll-table th, table.eb-scroll-table td { padding: 8px 9px; font-size: 12.5px; }
    table.eb-scroll-table td.wrap { min-width: 150px; }
    /* names may wrap, amounts stay on one line */
    table.eb-scroll-table td:not(.text-right):not(.font-mono):not(.nowrap) { white-space: normal; min-width: 96px; }
    table.eb-scroll-table td:only-child { min-width: 0; }
    .table-responsive:has(> table.eb-scroll-table) {
        background:
            linear-gradient(to right, var(--bg-card) 30%, transparent) left / 24px 100% no-repeat local,
            linear-gradient(to left, var(--bg-card) 30%, transparent) right / 24px 100% no-repeat local,
            radial-gradient(farthest-side at 0 50%, rgba(0,0,0,.35), transparent) left / 10px 100% no-repeat scroll,
            radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,.35), transparent) right / 10px 100% no-repeat scroll;
    }
    /* Totals box: label on the left, small amount field on the right */
    .summary-line { font-size: 13.5px; }
    .content-body .summary-line > .form-control, .content-body .summary-line > input { flex: 0 0 120px; width: 120px !important; }
    .content-body .summary-line > select.form-control { flex: 0 1 55%; width: auto !important; }
    /* Notices: one flowing paragraph (links stay inside the sentence) */
    .content-body .alert { display: block; padding: 10px 12px; font-size: 13px; line-height: 1.5; }
    .content-body .alert > i:first-child { margin-right: 6px; }
    .content-body .alert .alert-close { position: absolute; top: 6px; right: 8px; }
}
@media (max-width: 760px) {
    /* Company list (gateway) */
    .gateway-main .company-list .company-open form, .gateway-main .company-list .company-open .btn { width: 100%; justify-content: center; min-height: 40px; }
    .gateway-main .table-responsive:has(> .company-list) { overflow: visible; }
}
@media (max-width: 380px) {
    .company-badge .fa-right-left { display: none; }
}

/* Show / hide password (eye button, added by js/password-toggle.js) */
.pw-toggle { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; margin-right: -6px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--text-muted, #8A9AB0); cursor: pointer; font-size: 15px; }
.pw-toggle:hover, .pw-toggle:focus-visible { color: var(--primary, #3B82F6); background: rgba(59, 130, 246, .1); outline: none; }
.auth-page-light .input-wrap .pw-toggle i { color: inherit; font-size: 15px; }
.pw-field { position: relative; display: block; }
.pw-field > input { padding-right: 44px !important; width: 100%; }
.pw-field > .pw-toggle { position: absolute; top: 50%; right: 10px; margin: 0; transform: translateY(-50%); }
input[data-pw-toggle]::-ms-reveal, input[data-pw-toggle]::-ms-clear { display: none; }

/* ==========================================================================
   Print preview (js/print-preview.js): A4 sheet + toolbar, like the invoice print page
   ========================================================================== */
html.pp-open, html.pp-open body { overflow: hidden; }
.pp-overlay { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; background: #E5E7EB; }
.pp-toolbar { flex: 0 0 auto; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; padding: 10px 12px; background: #111827; color: #fff; }
.pp-title { flex: 1 1 100%; text-align: center; font: 600 13px var(--font-sans); color: #CBD5E1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 900px) { .pp-title { flex: 0 1 auto; max-width: 40%; margin-right: 12px; } }
.pp-btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border: 1px solid #374151; border-radius: 6px; background: #1F2937; color: #fff; font: 600 13px var(--font-sans); cursor: pointer; }
.pp-btn:hover, .pp-btn:focus-visible { background: #374151; outline: none; }
.pp-btn.pp-green { background: #16A34A; border-color: #16A34A; }
.pp-btn.pp-green:hover { background: #15803D; }
.pp-btn:disabled { opacity: .7; cursor: progress; }
.pp-stage { flex: 1 1 auto; overflow: auto; padding: 16px 12px 40px; -webkit-overflow-scrolling: touch; }
.pp-paper {
    width: 794px;
    min-height: 1123px;
    margin: 0 auto;
    padding: 36px 40px;
    box-sizing: border-box;
    background: #ffffff !important;
    color: #0F172A !important;
    box-shadow: 0 6px 24px rgba(15, 23, 42, .18);
}
.pp-paper.pdf-export {
    box-shadow: none !important;
    margin: 0 auto !important;
    min-height: 0 !important;
    background: #ffffff !important;
    width: 794px !important;
}

/* Enforce complete light theme and crisp document colors for both preview and PDF export */
.pp-paper,
.pp-content {
    --bg-main: #FFFFFF !important;
    --bg-surface: #FFFFFF !important;
    --bg-card: #FFFFFF !important;
    --bg-card-hover: #F8FAFC !important;
    --border-color: #E2E8F0 !important;
    --border-color-focus: rgba(37, 99, 235, 0.4) !important;
    --text-primary: #0F172A !important;
    --text-secondary: #475569 !important;
    --text-muted: #64748B !important;
    --primary: #2563EB !important;
    --primary-hover: #1D4ED8 !important;
    --primary-glow: rgba(37, 99, 235, 0.15) !important;
    --success: #10B981 !important;
    --success-bg: rgba(16, 185, 129, 0.1) !important;
    --warning: #F59E0B !important;
    --danger: #EF4444 !important;
    background: #FFFFFF !important;
    color: #0F172A !important;
    color-scheme: light !important;
}

.pp-paper *,
.pp-content * {
    color-scheme: light !important;
}

.pp-paper .pp-content { padding: 0; color: #0F172A; font-size: 12.5px; }
.pp-paper .page-header, .pp-content .page-header { display: block; margin: 0 0 14px; }
.pp-paper .page-title, .pp-content .page-title { font-size: 18px; color: #0F172A; }
.pp-paper .page-desc, .pp-content .page-desc { display: none; }

.pp-paper .card,
.pp-content .card,
.pp-paper .voucher-printable,
.pp-content .voucher-printable,
.pp-paper .invoice-printable,
.pp-content .invoice-printable {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    margin-bottom: 14px;
    border-radius: 0 !important;
    overflow: visible !important;
    color: #0F172A !important;
    max-width: 100% !important;
    padding: 0 !important;
}

.pp-paper .card-header, .pp-content .card-header { padding: 6px 0; border-bottom: 1px solid #E2E8F0; }
.pp-paper .card-body, .pp-paper .card-body.p-3, .pp-paper .card-body.p-4, .pp-paper .card-body.p-5,
.pp-content .card-body, .pp-content .card-body.p-3, .pp-content .card-body.p-4, .pp-content .card-body.p-5 {
    padding: 8px 0 !important;
}

.pp-paper .voucher-meta-box,
.pp-content .voucher-meta-box {
    background: #F8FAFC !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 8px !important;
    padding: 12px 14px !important;
}
.pp-paper .voucher-meta-box *,
.pp-content .voucher-meta-box * {
    color: #475569 !important;
}
.pp-paper .voucher-meta-box strong,
.pp-content .voucher-meta-box strong {
    color: #0F172A !important;
}

.pp-paper .table-responsive, .pp-content .table-responsive { overflow: visible; background: none !important; }
.pp-paper .data-table, .pp-content .data-table {
    width: 100%;
    min-width: 0 !important;
    border: 1px solid #E2E8F0 !important;
    border-collapse: collapse !important;
}
.pp-paper .data-table th, .pp-content .data-table th {
    background: #F1F5F9 !important;
    color: #0F172A !important;
    border: 1px solid #CBD5E1 !important;
    padding: 8px 10px;
    font-size: 12px;
}
.pp-paper .data-table th, .pp-paper .data-table td,
.pp-content .data-table th, .pp-content .data-table td {
    padding: 8px 10px;
    border-color: #E2E8F0 !important;
    color: #0F172A !important;
    white-space: normal;
    font-size: 12px;
}
.pp-paper .data-table td.text-right, .pp-paper .data-table th.text-right, .pp-paper .data-table .font-mono,
.pp-content .data-table td.text-right, .pp-content .data-table th.text-right, .pp-content .data-table .font-mono {
    white-space: nowrap;
}
.pp-paper .data-table tbody tr:nth-child(even), .pp-content .data-table tbody tr:nth-child(even) { background: #FAFAFA !important; }

.pp-paper .table-total-row, .pp-content .table-total-row {
    background: rgba(16, 185, 129, 0.08) !important;
}
.pp-paper .table-total-row td, .pp-content .table-total-row td {
    border-top: 2px solid #CBD5E1 !important;
    border-bottom: 2px solid #CBD5E1 !important;
    color: #0F172A !important;
    font-weight: 800 !important;
}

.pp-paper .text-muted, .pp-content .text-muted { color: #64748B !important; }
.pp-paper .text-primary, .pp-content .text-primary { color: #2563EB !important; }
.pp-paper .text-success, .pp-content .text-success { color: #059669 !important; }
.pp-paper .voucher-doc-header, .pp-content .voucher-doc-header { border-bottom-color: #CBD5E1 !important; }
.pp-paper .voucher-stamp-row, .pp-content .voucher-stamp-row { border-top-color: #CBD5E1 !important; }
.pp-paper .voucher-stamp-row div > div, .pp-content .voucher-stamp-row div > div { border-bottom-color: #CBD5E1 !important; }

.pp-paper a, .pp-content a { color: #1D4ED8; text-decoration: none; pointer-events: none; }
.pp-paper .alert, .pp-content .alert { background: #F9FAFB !important; color: #374151 !important; border: 1px solid #E5E7EB !important; }
.pp-paper .badge, .pp-content .badge { border: 1px solid #CBD5E1; }
.pp-paper tr, .pp-paper .summary-line, .pp-content tr, .pp-content .summary-line { break-inside: avoid; page-break-inside: avoid; }

@media print {
    html.pp-open, html.pp-open body { overflow: visible !important; height: auto !important; background: #fff !important; }
    html.pp-open body > *:not(.pp-overlay) { display: none !important; }
    html.pp-open .pp-overlay { position: static; display: block; background: #fff; }
    html.pp-open .pp-toolbar { display: none !important; }
    html.pp-open .pp-stage { overflow: visible; padding: 0; }
    html.pp-open .pp-paper { width: auto; min-height: 0; padding: 0; box-shadow: none; zoom: 1 !important; }
}

/* Date / time fields: the calendar icon and the browser's date picker follow the app theme */
html { color-scheme: dark; }
html[data-theme="light"], [data-theme="light"] { color-scheme: light; }
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .75; border-radius: 4px; padding: 2px; }
input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="month"]::-webkit-calendar-picker-indicator:hover,
input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover,
input[type="time"]::-webkit-calendar-picker-indicator:hover { opacity: 1; background-color: rgba(59, 130, 246, .18); }

/* ==========================================================================
   Animated icons: a short entrance when a page opens, a small playful move on hover.
   Pure CSS on the existing Font Awesome icons; switched off for "reduce motion".
   ========================================================================== */
@keyframes eb-icon-in { 0% { opacity: 0; transform: scale(.35) rotate(-25deg); } 60% { opacity: 1; transform: scale(1.18) rotate(6deg); } 100% { opacity: 1; transform: none; } }
@keyframes eb-pop { 0%, 100% { transform: none; } 35% { transform: scale(1.28) rotate(-10deg); } 70% { transform: scale(.94) rotate(4deg); } }
@keyframes eb-turn { to { transform: rotate(90deg); } }
@keyframes eb-spin { to { transform: rotate(360deg); } }
@keyframes eb-spin-back { to { transform: rotate(-360deg); } }
@keyframes eb-nudge-r { 0%, 100% { transform: none; } 50% { transform: translateX(4px); } }
@keyframes eb-nudge-l { 0%, 100% { transform: none; } 50% { transform: translateX(-4px); } }
@keyframes eb-nudge-d { 0%, 100% { transform: none; } 30% { transform: translateY(3px); } 60% { transform: translateY(-1px); } }
@keyframes eb-nudge-u { 0%, 100% { transform: none; } 30% { transform: translateY(-3px); } 60% { transform: translateY(1px); } }
@keyframes eb-out { 0%, 100% { transform: none; } 45% { transform: translate(3px, -3px); } }
@keyframes eb-fly { 0% { transform: none; } 40% { transform: translate(6px, -6px) scale(.8); opacity: 0; } 41% { transform: translate(-6px, 6px) scale(.8); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes eb-ring { 0%, 100% { transform: none; } 20% { transform: rotate(16deg); } 40% { transform: rotate(-13deg); } 60% { transform: rotate(8deg); } 80% { transform: rotate(-4deg); } }
@keyframes eb-shake { 0%, 100% { transform: none; } 20%, 60% { transform: translateX(-2px) rotate(-6deg); } 40%, 80% { transform: translateX(2px) rotate(6deg); } }
@keyframes eb-rise { 0%, 100% { transform: none; } 45% { transform: translate(2px, -4px) scale(1.12); } }
@keyframes eb-fall { 0%, 100% { transform: none; } 45% { transform: translate(2px, 4px) scale(1.12); } }
@keyframes eb-grow { 0% { transform: scaleY(1); } 35% { transform: scaleY(.55); } 75% { transform: scaleY(1.15); } 100% { transform: scaleY(1); } }
@keyframes eb-beat { 0%, 100% { transform: none; } 25% { transform: scale(1.22); } 50% { transform: scale(.96); } 70% { transform: scale(1.1); } }

@media (prefers-reduced-motion: no-preference) {
    /* Entrance: dashboard tiles, shortcut boxes, card and page titles, report tiles */
    .kpi-icon-box > i, .shortcut-icon > i, .card-title > i:first-child, .page-title > i:first-child, .report-tile > i:first-child, .gateway-empty > i:first-child {
        animation: eb-icon-in .65s cubic-bezier(.34, 1.56, .64, 1) both;
    }
    .kpi-card:nth-child(2) .kpi-icon-box > i, .shortcut-box:nth-child(2) .shortcut-icon > i, .report-tile:nth-child(2) > i { animation-delay: .06s; }
    .kpi-card:nth-child(3) .kpi-icon-box > i, .shortcut-box:nth-child(3) .shortcut-icon > i, .report-tile:nth-child(3) > i { animation-delay: .12s; }
    .kpi-card:nth-child(4) .kpi-icon-box > i, .shortcut-box:nth-child(4) .shortcut-icon > i, .report-tile:nth-child(4) > i { animation-delay: .18s; }
    .kpi-card:nth-child(5) .kpi-icon-box > i, .report-tile:nth-child(5) > i { animation-delay: .24s; }
    .kpi-card:nth-child(6) .kpi-icon-box > i, .report-tile:nth-child(n+6) > i { animation-delay: .3s; }

    /* Hover: a little "pop" for any icon inside something you can point at, and a move that matches the icon */
    :is(.btn, .btn-icon, .sb-link, .sb-sub-link, .dropdown-item, .row-menu-item, .kpi-card, .shortcut-box, .report-tile, .company-badge, .topbar-logout, .pp-btn, .gateway-theme, .filter-tab, .import-tab, .pw-toggle):hover i:not(.sb-chevron) { animation: eb-pop .5s cubic-bezier(.34, 1.56, .64, 1); }
    :is(.btn, .btn-icon, .sb-link, .sb-sub-link, .dropdown-item, .row-menu-item, .kpi-card, .shortcut-box, .report-tile, .company-badge, .topbar-logout, .pp-btn, .gateway-theme, .filter-tab, .import-tab):hover i:not(.sb-chevron).fa-plus { animation: eb-turn .35s ease-out both; }
    :is(.btn, .btn-icon, .sb-link, .sb-sub-link, .dropdown-item, .row-menu-item, .kpi-card, .shortcut-box, .report-tile, .company-badge, .topbar-logout, .pp-btn, .gateway-theme, .filter-tab, .import-tab):hover i:not(.sb-chevron):is(.fa-arrow-left, .fa-chevron-left) { animation: eb-nudge-l .45s ease-in-out 2; }
    :is(.btn, .btn-icon, .sb-link, .sb-sub-link, .dropdown-item, .row-menu-item, .kpi-card, .shortcut-box, .report-tile, .company-badge, .topbar-logout, .pp-btn, .gateway-theme, .filter-tab, .import-tab):hover i:not(.sb-chevron):is(.fa-arrow-right, .fa-right-left, .fa-right-from-bracket, .fa-route) { animation: eb-nudge-r .45s ease-in-out 2; }
    :is(.btn, .btn-icon, .sb-link, .sb-sub-link, .dropdown-item, .row-menu-item, .kpi-card, .shortcut-box, .report-tile, .company-badge, .topbar-logout, .pp-btn, .gateway-theme, .filter-tab, .import-tab):hover i:not(.sb-chevron):is(.fa-download, .fa-file-arrow-down, .fa-circle-arrow-down, .fa-print, .fa-filter, .fa-file-csv, .fa-file-pdf, .fa-file-export, .fa-cart-arrow-down) { animation: eb-nudge-d .5s ease-in-out 2; }
    :is(.btn, .btn-icon, .sb-link, .sb-sub-link, .dropdown-item, .row-menu-item, .kpi-card, .shortcut-box, .report-tile, .company-badge, .topbar-logout, .pp-btn, .gateway-theme, .filter-tab, .import-tab):hover i:not(.sb-chevron):is(.fa-cloud-arrow-up, .fa-file-import, .fa-arrow-up) { animation: eb-nudge-u .5s ease-in-out 2; }
    :is(.btn, .btn-icon, .sb-link, .sb-sub-link, .dropdown-item, .row-menu-item, .kpi-card, .shortcut-box, .report-tile, .company-badge, .topbar-logout, .pp-btn, .gateway-theme, .filter-tab, .import-tab):hover i:not(.sb-chevron).fa-arrow-up-right-from-square { animation: eb-out .5s ease-in-out 2; }
    :is(.btn, .btn-icon, .sb-link, .sb-sub-link, .dropdown-item, .row-menu-item, .kpi-card, .shortcut-box, .report-tile, .company-badge, .topbar-logout, .pp-btn, .gateway-theme, .filter-tab, .import-tab):hover i:not(.sb-chevron).fa-paper-plane { animation: eb-fly .7s ease-in-out; }
    :is(.btn, .btn-icon, .sb-link, .sb-sub-link, .dropdown-item, .row-menu-item, .kpi-card, .shortcut-box, .report-tile, .company-badge, .topbar-logout, .pp-btn, .gateway-theme, .filter-tab, .import-tab):hover i:not(.sb-chevron):is(.fa-rotate-left, .fa-arrow-rotate-left) { animation: eb-spin-back .6s ease-in-out; }
    :is(.btn, .btn-icon, .sb-link, .sb-sub-link, .dropdown-item, .row-menu-item, .kpi-card, .shortcut-box, .report-tile, .company-badge, .topbar-logout, .pp-btn, .gateway-theme, .filter-tab, .import-tab):hover i:not(.sb-chevron):is(.fa-rotate-right, .fa-rotate, .fa-arrows-rotate, .fa-gear, .fa-sun, .fa-circle-half-stroke, .fa-sliders) { animation: eb-spin .7s ease-in-out; }
    :is(.btn, .btn-icon, .sb-link, .sb-sub-link, .dropdown-item, .row-menu-item, .kpi-card, .shortcut-box, .report-tile, .company-badge, .topbar-logout, .pp-btn, .gateway-theme, .filter-tab, .import-tab):hover i:not(.sb-chevron):is(.fa-bell, .fa-moon, .fa-scale-balanced, .fa-magnifying-glass, .fa-bolt, .fa-key, .fa-lock, .fa-unlock) { animation: eb-ring .7s ease-in-out; }
    :is(.btn, .btn-icon, .sb-link, .sb-sub-link, .dropdown-item, .row-menu-item, .kpi-card, .shortcut-box, .report-tile, .company-badge, .topbar-logout, .pp-btn, .gateway-theme, .filter-tab, .import-tab):hover i:not(.sb-chevron):is(.fa-trash-can, .fa-trash, .fa-ban, .fa-xmark, .fa-user-xmark) { animation: eb-shake .45s ease-in-out; }
    :is(.btn, .btn-icon, .sb-link, .sb-sub-link, .dropdown-item, .row-menu-item, .kpi-card, .shortcut-box, .report-tile, .company-badge, .topbar-logout, .pp-btn, .gateway-theme, .filter-tab, .import-tab):hover i:not(.sb-chevron):is(.fa-arrow-trend-up, .fa-chart-line, .fa-money-bill-trend-up) { animation: eb-rise .6s ease-in-out; }
    :is(.btn, .btn-icon, .sb-link, .sb-sub-link, .dropdown-item, .row-menu-item, .kpi-card, .shortcut-box, .report-tile, .company-badge, .topbar-logout, .pp-btn, .gateway-theme, .filter-tab, .import-tab):hover i:not(.sb-chevron).fa-arrow-trend-down { animation: eb-fall .6s ease-in-out; }
    :is(.btn, .btn-icon, .sb-link, .sb-sub-link, .dropdown-item, .row-menu-item, .kpi-card, .shortcut-box, .report-tile, .company-badge, .topbar-logout, .pp-btn, .gateway-theme, .filter-tab, .import-tab):hover i:not(.sb-chevron):is(.fa-chart-column, .fa-chart-simple, .fa-list-check) { animation: eb-grow .6s ease-in-out; transform-origin: bottom; }
    :is(.btn, .btn-icon, .sb-link, .sb-sub-link, .dropdown-item, .row-menu-item, .kpi-card, .shortcut-box, .report-tile, .company-badge, .topbar-logout, .pp-btn, .gateway-theme, .filter-tab, .import-tab):hover i:not(.sb-chevron):is(.fa-house, .fa-star, .fa-circle-check, .fa-check, .fa-check-double, .fa-floppy-disk, .fa-shield-halved, .fa-sack-dollar, .fa-coins, .fa-hand-holding-dollar) { animation: eb-beat .6s ease-in-out; }
}
@media (prefers-reduced-motion: reduce) {
    .kpi-icon-box > i, .shortcut-icon > i, .card-title > i, .page-title > i, .report-tile > i { animation: none !important; }
}

/* ==========================================================================
   Global search (top bar button + Ctrl+K panel, js/global-search.js)
   ========================================================================== */
.global-search-trigger { display: inline-flex; align-items: center; gap: 10px; min-width: 260px; height: 36px; padding: 0 8px 0 12px; border: 1px solid var(--border-color); border-radius: 10px; background: rgba(255, 255, 255, .04); color: var(--text-muted); font: 500 13px var(--font-sans); cursor: pointer; transition: border-color .15s, background .15s, color .15s; }
.global-search-trigger:hover, .global-search-trigger:focus-visible { border-color: var(--primary); color: var(--text-primary); background: var(--primary-glow); outline: none; }
.global-search-trigger .gs-trigger-text { flex: 1 1 auto; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-kbd, .gs-foot kbd { display: inline-block; padding: 1px 6px; border: 1px solid var(--border-color); border-bottom-width: 2px; border-radius: 5px; background: rgba(255, 255, 255, .05); color: var(--text-secondary); font: 600 11px var(--font-sans); }
[data-theme="light"] .global-search-trigger { background: #F8FAFC; }
@media (max-width: 1280px) { .global-search-trigger { min-width: 200px; } }
@media (max-width: 1100px) { .global-search-trigger .gs-kbd { display: none; } }
@media (max-width: 900px) {
    .global-search-trigger { min-width: 0; width: 34px; height: 34px; padding: 0; justify-content: center; border-color: transparent; background: transparent; }
    .global-search-trigger .gs-trigger-text { display: none; }
}

html.gs-open, html.gs-open body { overflow: hidden; }
.gs-overlay { position: fixed; inset: 0; z-index: 1100; display: none; align-items: flex-start; justify-content: center; padding: 10vh 16px 16px; background: rgba(2, 6, 23, .55); backdrop-filter: blur(3px); }
.gs-overlay.is-open { display: flex; animation: gs-fade .15s ease-out; }
@keyframes gs-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes gs-rise { from { opacity: 0; transform: translateY(-10px) scale(.98); } to { opacity: 1; transform: none; } }
.gs-panel { width: min(680px, 100%); max-height: min(70vh, 640px); display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--border-color); border-radius: 14px; background: var(--bg-card); box-shadow: 0 24px 60px rgba(0, 0, 0, .45); animation: gs-rise .18s ease-out; }
.gs-input-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border-color); color: var(--text-muted); }
.gs-input { flex: 1 1 auto; min-width: 0; border: 0; outline: none; background: transparent; color: var(--text-primary); font: 500 16px var(--font-sans); }
.gs-input::-webkit-search-cancel-button { display: none; }
.gs-close { flex: 0 0 auto; padding: 3px 8px; border: 1px solid var(--border-color); border-radius: 6px; background: transparent; color: var(--text-muted); font: 600 11px var(--font-sans); cursor: pointer; }
.gs-status { padding: 8px 16px 0; min-height: 26px; color: var(--text-muted); font-size: 12px; display: flex; align-items: center; gap: 8px; }
.gs-spinner { width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: easebill-spin .7s linear infinite; }
.gs-list { flex: 1 1 auto; overflow-y: auto; padding: 4px 8px 8px; overscroll-behavior: contain; }
.gs-group { padding: 10px 8px 4px; color: var(--text-muted); font-size: 10.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
.gs-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 9px; color: var(--text-primary); text-decoration: none; }
.gs-item.is-active { background: var(--primary-glow); outline: 1px solid rgba(59, 130, 246, .35); }
.gs-icon { flex: 0 0 32px; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; background: rgba(59, 130, 246, .12); color: #60A5FA; font-size: 14px; }
.gs-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.gs-title { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-code { font-family: var(--font-mono); color: #60A5FA; font-weight: 600; }
.gs-sub { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-item mark { background: rgba(250, 204, 21, .28); color: inherit; border-radius: 3px; padding: 0 1px; }
.gs-go { flex: 0 0 auto; color: var(--text-muted); opacity: 0; transition: opacity .12s, transform .12s; }
.gs-item.is-active .gs-go { opacity: 1; transform: translateX(2px); color: var(--primary); }
.gs-foot { display: flex; gap: 16px; padding: 8px 16px; border-top: 1px solid var(--border-color); color: var(--text-muted); font-size: 11.5px; }
.gs-foot kbd { margin-right: 3px; }
[data-theme="light"] .gs-code, [data-theme="light"] .gs-icon { color: #2563EB; }
@media (max-width: 760px) {
    .gs-overlay { padding: 0; align-items: stretch; }
    .gs-panel { width: 100%; max-height: none; height: 100%; border-radius: 0; border: 0; }
    .gs-foot { display: none; }
    .gs-item { padding: 10px; }
}

/* Warehouse bin locations */
.bin-generator { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: 12px; border: 1px dashed var(--border-color); border-radius: var(--radius-md); }
.bin-generator #genRack { width: 180px; } .bin-generator #genPrefix { width: 120px; } .bin-generator #genFrom, .bin-generator #genTo { width: 80px; }
.bin-table td { vertical-align: middle; }
@media (max-width: 760px) { .bin-generator > * { flex: 1 1 40%; } .bin-generator #genRack, .bin-generator #genPrefix { width: auto; } }

/* Share dialog (invoice → Share) */
.share-dialog { width: min(620px, calc(100vw - 24px)); max-height: calc(100vh - 40px); padding: 0; border: 1px solid var(--border-color); border-radius: 16px; background: var(--bg-card); color: var(--text-primary); box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
dialog:modal { margin: auto; inset: 0; }   /* the reset above removes the browser's centering of modal dialogs */
.share-dialog::backdrop { background: rgba(2, 6, 23, .6); backdrop-filter: blur(3px); }
.share-dialog[open] { animation: gs-rise .18s ease-out; }
.share-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border-color); }
.share-head h2 { margin: 0; font-size: 17px; display: flex; gap: 10px; align-items: center; }
.share-head h2 i { color: var(--primary); }
.share-tabs { display: flex; gap: 6px; padding: 12px 18px 0; }
.share-tab { flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 10px; border: 1px solid var(--border-color); border-radius: 10px; background: transparent; color: var(--text-secondary); font: 600 13.5px var(--font-sans); cursor: pointer; }
.share-tab.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.share-tab .fa-whatsapp { color: #25D366; } .share-tab.is-active .fa-whatsapp { color: #fff; }
.share-panel { padding: 16px 18px 18px; }
.share-panel .form-group { margin-bottom: 12px; }
.share-copy { display: flex; gap: 8px; }
.share-copy input { flex: 1 1 auto; min-width: 0; font-size: 12.5px; }
.share-panel .form-actions form { display: inline; margin: 0; }
.share-history { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border-color); }
.share-history-title { font-size: 11px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; }
.share-history-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 6px 0; font-size: 13px; }
.share-history-to { font-weight: 600; overflow-wrap: anywhere; }
.share-history-err { flex-basis: 100%; }
.btn-success .fa-whatsapp { font-size: 16px; }
@media (max-width: 760px) {
    .share-dialog, .share-dialog:modal { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; border: 0; }
    .share-tab { font-size: 12.5px; padding: 9px 6px; }
}

/* ---------- Payment reminders ---------- */
.reminder-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.reminder-kpis .kpi-value { font-size: 22px; }
.reminder-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 18px; margin-top: 18px; align-items: start; }
.reminder-grid > .card { margin: 0; }
.reminder-actions { display: inline-flex; gap: 6px; justify-content: flex-end; flex-wrap: nowrap; }
.reminder-table details summary { cursor: pointer; color: var(--text-muted); }
.reminder-table details[open] summary { margin-bottom: 4px; }
.switch-row { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; padding: 12px 14px; border: 1px solid var(--border-color); border-radius: var(--radius-md); background: var(--bg-input, transparent); }
.switch-row input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--primary); flex: none; }
.input-suffix { display: flex; align-items: stretch; }
.input-suffix .form-control { border-top-right-radius: 0; border-bottom-right-radius: 0; min-width: 0; }
.input-suffix span { display: flex; align-items: center; padding: 0 10px; border: 1px solid var(--border-color); border-left: 0; border-radius: 0 var(--radius-md) var(--radius-md) 0; color: var(--text-muted); font-size: 12px; background: var(--bg-card); white-space: nowrap; }
@media (max-width: 1100px) { .reminder-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .reminder-grid { grid-template-columns: 1fr; } }
@media (max-width: 768px) {
    .reminder-actions .btn span { display: none; }
    .reminder-table .rem-check { width: 18px; height: 18px; }
}

/* ---------- Dashboard insights ---------- */
.insight-mom .card-header { flex-wrap: wrap; gap: 4px 12px; }
.insight-mom-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.insight-metric { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--border-color); border-radius: var(--radius-md); color: inherit; text-decoration: none; transition: border-color .2s, transform .2s; }
.insight-metric:hover { border-color: var(--primary); transform: translateY(-2px); text-decoration: none; }
.insight-label { font-size: 12px; font-weight: 700; color: var(--text-muted); letter-spacing: .4px; text-transform: uppercase; }
.insight-value { font-size: 22px; font-weight: 800; font-family: var(--font-mono); }
.insight-change { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; }
.insight-pill { display: inline-flex; gap: 5px; align-items: center; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.insight-pill.is-good { color: var(--success); background: rgba(16, 185, 129, .14); }
.insight-pill.is-bad { color: var(--danger); background: rgba(239, 68, 68, .14); }
.insight-grid > .card { margin: 0; }
.insight-grid .card-header { flex-wrap: wrap; gap: 4px 10px; }
.insight-bar-row + .insight-bar-row { margin-top: 12px; }
.insight-bar-head { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.insight-bar-head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.insight-bar { height: 6px; border-radius: 6px; background: var(--border-color); margin: 6px 0 4px; overflow: hidden; }
.insight-bar span { display: block; height: 100%; border-radius: 6px; background: var(--primary); transform-origin: left; animation: insightGrow .8s ease-out both; }
.insight-bar.is-green span { background: var(--success); }
@keyframes insightGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .insight-bar span { animation: none; } }
.insight-stock-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border-color); font-size: 13px; }
.insight-stock-row:last-of-type { border-bottom: 0; }
.insight-suggest { font-weight: 700; font-size: 12px; color: var(--primary); background: rgba(59, 130, 246, .12); padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.insight-po-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
@media (max-width: 900px) { .insight-mom-grid { grid-template-columns: 1fr; gap: 10px; } .insight-value { font-size: 20px; } }

/* ---------- Attachments ---------- */
.attach-card .card-header { flex-wrap: wrap; gap: 4px 10px; }
.attach-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.attach-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--border-color); border-radius: var(--radius-md); }
.attach-thumb { width: 44px; height: 44px; flex: none; border-radius: 8px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: rgba(59, 130, 246, .1); }
.attach-thumb img { width: 100%; height: 100%; object-fit: cover; }
.attach-icon i { font-size: 20px; color: var(--primary); }
.attach-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.attach-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-actions { display: flex; gap: 4px; align-items: center; }
.attach-actions form { margin: 0; }
.attach-drop { position: relative; display: flex; align-items: center; gap: 14px; padding: 16px; border: 2px dashed var(--border-color); border-radius: var(--radius-md); cursor: pointer; transition: border-color .2s, background .2s; }
.attach-drop:hover, .attach-drop.is-over { border-color: var(--primary); background: rgba(59, 130, 246, .06); }
.attach-drop i { font-size: 26px; color: var(--primary); }
.attach-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.attach-drop-text { font-size: 13px; line-height: 1.5; min-width: 0; overflow-wrap: anywhere; }
.attach-form-row { display: flex; gap: 8px; margin-top: 10px; }
.attach-form-row .form-control { flex: 1; min-width: 0; }
@media (max-width: 600px) { .attach-form-row { flex-direction: column; } }

/* ---------- Barcode scanning ---------- */
.scan-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 16px; border-bottom: 1px solid var(--border-color); background: rgba(59, 130, 246, .05); }
.scan-bar > i { color: var(--primary); font-size: 18px; }
.scan-bar input { flex: 1 1 220px; max-width: 360px; font-family: var(--font-mono); }
.scan-msg { flex-basis: 100%; min-height: 0; font-size: 12px; }
.scan-msg:empty { display: none; }
.scan-input { display: flex; gap: 6px; }
.scan-input .form-control { min-width: 0; }
.item-row.scan-flash td { animation: scanFlash 1s ease-out; }
@keyframes scanFlash { from { background: rgba(16, 185, 129, .25); } to { background: transparent; } }
.scan-dialog { width: min(520px, 94vw); padding: 0; border: 0; border-radius: 16px; background: #000; color: #fff; overflow: hidden; }
.scan-dialog::backdrop { background: rgba(0, 0, 0, .7); }
.scan-video-wrap { position: relative; aspect-ratio: 4 / 3; }
.scan-video-wrap video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame { position: absolute; left: 12%; right: 12%; top: 30%; bottom: 30%; border: 3px solid rgba(255, 255, 255, .85); border-radius: 12px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .35); }
.scan-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; font-size: 14px; }
@media (max-width: 600px) { .scan-bar [data-scan-camera] span { display: none; } }

/* ---------- Bank statement import ---------- */
.stmt-upload { display: flex; gap: 12px; align-items: stretch; flex-wrap: wrap; }
.stmt-upload .attach-drop { flex: 1 1 360px; }
.stmt-upload > .btn { align-self: center; }
.stmt-tabs { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 16px 0 8px; }
.stmt-tab { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border-color); color: var(--text-secondary, inherit); text-decoration: none; font-size: 13px; font-weight: 600; }
.stmt-tab.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.stmt-tab.is-active .badge { background: rgba(255, 255, 255, .25); color: #fff; }
.stmt-tabs .ml-auto { margin-left: auto; }
.stmt-match { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 0; }
.stmt-match select { flex: 1 1 220px; max-width: 360px; min-width: 0; }
.stmt-desc { display: inline-block; max-width: 380px; overflow-wrap: anywhere; font-size: 13px; }
.stmt-none { flex: 1 1 220px; }
.stmt-table td { vertical-align: middle; }

/* ---------- GSTR-2B reconciliation ---------- */
.g2b-top { display: grid; grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr); gap: 16px; align-items: start; }
.g2b-period { display: flex; flex-direction: column; gap: 6px; }
.g2b-kpi { color: inherit; text-decoration: none; }
.g2b-kpi.is-active { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(59, 130, 246, .35); }
.g2b-kpi .kpi-header i { font-size: 18px; }
@media (max-width: 900px) { .g2b-top { grid-template-columns: 1fr; } }

/* ---------- Recurring invoices ---------- */
.rec-ends { display: flex; flex-direction: column; gap: 8px; }
.rec-ends label { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.rec-ends .form-control { width: auto; max-width: 170px; display: inline-block; }
.rec-ends input[type=number] { max-width: 90px; }

/* ---------- Approvals ---------- */
.approval-list { display: grid; gap: 10px; }
.approval-item { display: flex; justify-content: space-between; gap: 16px; align-items: center; flex-wrap: wrap; padding: 14px 16px; border: 1px solid var(--border-color); border-left: 4px solid var(--warning, #F59E0B); border-radius: var(--radius-md); }
.approval-main { display: flex; gap: 16px; align-items: flex-start; min-width: 0; flex: 1 1 380px; }
.approval-amount { font: 800 20px var(--font-mono); white-space: nowrap; }
.approval-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.approval-actions form { margin: 0; }
.approval-reject { display: flex; gap: 6px; }
.approval-reject .form-control { width: 180px; }
@media (max-width: 600px) { .approval-main { flex-direction: column; gap: 4px; } .approval-reject { flex: 1 1 100%; } .approval-reject .form-control { flex: 1; width: auto; } }

/* ---------- Page title icon (every page) ---------- */
.page-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-title > i:first-child {
    flex: none; width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
    font-size: 18px; color: var(--primary); background: rgba(59, 130, 246, .14); box-shadow: inset 0 0 0 1px rgba(59, 130, 246, .22);
}
@supports (background: color-mix(in srgb, red 10%, transparent)) {
    .page-title > i:first-child { background: color-mix(in srgb, currentColor 14%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 24%, transparent); }
}
.page-title > i.text-success:first-child { color: var(--success); }
.page-title > i.text-danger:first-child { color: var(--danger); }
.page-title > i.text-info:first-child { color: var(--info, #06B6D4); }
.page-title > i.text-warning:first-child { color: var(--warning); }
@media (max-width: 768px) { .page-title { gap: 10px; } .page-title > i:first-child { width: 34px; height: 34px; font-size: 15px; border-radius: 10px; } }
@media print { .page-title > i:first-child { display: none; } }
.scan-wait { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 14px; pointer-events: none; }
.scan-wait:empty { display: none; }
.scan-btns { display: flex; gap: 8px; flex: none; }
.scan-foot { flex-wrap: wrap; }
.scan-status { flex: 1 1 200px; }
.scan-status.text-danger { color: #FCA5A5 !important; }
.scan-photo { cursor: pointer; }
dialog.scan-dialog[open] { margin: auto; inset: 0; max-height: 94vh; }
/* Type-ahead under the scan box */
.scan-field { position: relative; flex: 1 1 260px; max-width: 460px; }
.scan-field input { width: 100%; max-width: none; }
.scan-bar input { max-width: none; }
.scan-suggest { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 60; list-style: none; margin: 0; padding: 4px; max-height: 300px; overflow: auto;
    background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-md); box-shadow: 0 12px 30px rgba(0, 0, 0, .35); }
.scan-suggest li { display: flex; gap: 10px; align-items: baseline; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.scan-suggest li.is-sel, .scan-suggest li[data-id]:hover { background: rgba(59, 130, 246, .16); }
.scan-sg-code { font-family: var(--font-mono); font-weight: 700; color: var(--primary); flex: none; }
.scan-sg-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scan-sg-bc { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); flex: none; }
.scan-sg-none { color: var(--text-muted); cursor: default; }
.card:has(.scan-bar) { overflow: visible; }

/* ---------- Scan with phone ---------- */
.scan-phone-state { font-size: 12.5px; color: var(--text-muted); display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.scan-phone-state.is-ok { color: var(--success); font-weight: 600; }
.scan-phone-state.is-bad { color: var(--danger); }
.scan-phone-state.is-wait { color: var(--warning); }
.link-btn { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; }
.phone-pair { background: var(--bg-card); color: var(--text-primary); width: min(440px, 94vw); }
.pair-body { padding: 18px 20px 6px; }
.pair-body h3 { margin: 0 0 10px; font-size: 17px; display: flex; gap: 8px; align-items: center; }
.pair-body ol { margin: 0 0 12px; padding-left: 20px; font-size: 13.5px; color: var(--text-muted); line-height: 1.6; }
.pair-qr { width: 230px; max-width: 70vw; margin: 6px auto 12px; padding: 8px; background: #fff; border-radius: 12px; }
.pair-qr svg { display: block; width: 100%; height: auto; }
.pair-link { display: flex; gap: 6px; }
.pair-link input { flex: 1; min-width: 0; font: 12px var(--font-mono); padding: 7px 9px; border-radius: 8px; border: 1px solid var(--border-color); background: var(--bg-input, transparent); color: var(--text-primary); }
.pair-wait { font-size: 13px; color: var(--warning); margin: 10px 0 4px; }
.phone-pair .scan-foot { color: var(--text-muted); font-size: 12.5px; border-top: 1px solid var(--border-color); }
@media (max-width: 600px) { .scan-bar [data-scan-phone] span { display: none; } }
/* Phone scanner button in the top bar */
.phone-scan-btn { position: relative; }
.phone-scan-btn .ps-dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: transparent; }
.phone-scan-btn.is-on { color: var(--success); }
.phone-scan-btn.is-on .ps-dot { background: var(--success); box-shadow: 0 0 0 2px var(--bg-card); animation: psPulse 2s infinite; }
.phone-scan-btn.is-wait .ps-dot { background: var(--warning); box-shadow: 0 0 0 2px var(--bg-card); }
.phone-scan-btn .ps-badge { position: absolute; top: -2px; right: -4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--danger); color: #fff; font: 700 10px/17px var(--font-sans, inherit); text-align: center; }
@keyframes psPulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .phone-scan-btn.is-on .ps-dot { animation: none; } }
.pair-ok { color: var(--success); font-size: 13.5px; margin: 0 0 10px; }
.scan-waiting { flex-basis: 100%; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; padding: 8px 10px; border-radius: 8px; background: rgba(245, 158, 11, .12); border: 1px solid rgba(245, 158, 11, .3); }
.phone-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 3000; max-width: min(520px, 92vw);
    padding: 11px 16px; border-radius: 12px; background: #0F172A; color: #F8FAFC; border: 1px solid #1E3A8A; box-shadow: 0 12px 30px rgba(0,0,0,.35); font-size: 13.5px; transition: opacity .2s, transform .2s; }
.phone-toast.is-show { opacity: 1; transform: translate(-50%, 0); }
.phone-toast.is-bad { border-color: #7F1D1D; }
/* Company badge carries the financial year (one chip instead of two) */
.company-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.company-fy { font-size: 10.5px; font-weight: 600; color: #60A5FA; letter-spacing: .2px; }
[data-theme="light"] .company-fy { color: #2563EB; }
/* Scan menu (top bar) */
.scan-menu-list { min-width: 250px; }
.scan-menu-list .dropdown-item { width: 100%; border: 0; background: none; text-align: left; font: inherit; cursor: pointer; align-items: flex-start; }
.scan-menu-list .dropdown-item > i { margin-top: 3px; width: 16px; text-align: center; }
.scan-menu-list .dropdown-item span { display: flex; flex-direction: column; gap: 1px; }
.scan-menu-list .dropdown-item b { font-weight: 600; font-size: 13px; }
.scan-menu-list .dropdown-item small { color: var(--text-muted); font-size: 11.5px; }
.scan-menu-list [hidden] { display: none !important; }
/* Top bar menu buttons: icon + small arrow, so they read as menus */
.tb-menu-btn { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 11px; border-radius: var(--radius-sm); position: relative; }
.tb-menu-btn > i:first-child { font-size: 15px; }
.tb-menu-btn .tb-caret { font-size: 9px; opacity: .75; transition: transform .2s ease; }
.tb-menu-btn[aria-expanded="true"] .tb-caret { transform: rotate(180deg); }
.phone-scan-btn.tb-menu-btn { color: var(--text-primary); }
.phone-scan-btn.tb-menu-btn.is-on { color: var(--success); border-color: rgba(16, 185, 129, .45); }
.phone-scan-btn.tb-menu-btn.is-wait { border-color: rgba(245, 158, 11, .45); }
.phone-scan-btn .ps-dot { top: 4px; right: 4px; }
@media (max-width: 768px) { .tb-menu-btn { height: 34px; padding: 0 9px; gap: 5px; } #quickAddBtn .tb-caret { display: inline-block; } }
.company-fy { white-space: nowrap; }
/* Sidebar footer: the signed-in person (opens My account) + sign out — the top bar no longer repeats them */
.sidebar-user { justify-content: space-between; gap: 8px; }
.sidebar-user-link { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; padding: 4px; margin: -4px; border-radius: var(--radius-md); color: inherit; text-decoration: none; }
.sidebar-user-link:hover { background: rgba(255, 255, 255, .06); }
.sidebar-user-link .user-avatar { position: relative; flex: none; }
.sidebar-user-link .status-dot { position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 2px var(--bg-sidebar, #111827); }
.sidebar-user-link .user-name, .sidebar-user-link .user-role { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-logout { flex: none; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); color: var(--text-muted); border: 1px solid var(--border-color); text-decoration: none; transition: all .2s; }
.sidebar-logout:hover { color: var(--danger); border-color: rgba(239, 68, 68, .5); background: rgba(239, 68, 68, .1); }
[data-theme="light"] .sidebar-user-link:hover { background: rgba(15, 23, 42, .05); }
/* Short screens: keep the footer (it has Sign out), just make it compact */
@media (max-height: 720px) {
    .sidebar-footer { display: block; padding: 8px 14px; }
    .sidebar-footer .user-avatar { width: 30px; height: 30px; }
    .sidebar-footer .user-role { display: none; }
}

/* ==========================================================================
   Teams-style navigation: icon rail (sections) + panel (pages of the section)
   ========================================================================== */
:root { --tm-rail-w: 76px; --tm-panel-w: 244px; --tm-rail-bg: #0B1120; --tm-panel-bg: #131B2E; --tm-rail-fg: #94A3B8; --tm-hover: rgba(255, 255, 255, .06); }
[data-theme="light"] { --tm-rail-bg: #EEF2F7; --tm-panel-bg: #FFFFFF; --tm-rail-fg: #475569; --tm-hover: rgba(15, 23, 42, .06); }
.sidebar.sidebar-teams { width: var(--tm-rail-w); flex-direction: row; overflow: visible; background: var(--tm-panel-bg); border-right: 1px solid var(--border-color); transition: width .22s ease, transform .3s ease; }
.sidebar.sidebar-teams.has-panel { width: calc(var(--tm-rail-w) + var(--tm-panel-w)); }
.main-wrapper { margin-left: var(--tm-rail-w); }
body.tm-panel-open .main-wrapper { margin-left: calc(var(--tm-rail-w) + var(--tm-panel-w)); }
body.sidebar-collapsed .sidebar.sidebar-teams { transform: none; }
body.sidebar-collapsed .main-wrapper { margin-left: var(--tm-rail-w); }

/* Rail */
.tm-rail { width: var(--tm-rail-w); flex: none; height: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 0; background: var(--tm-rail-bg); border-right: 1px solid var(--border-color); overflow-y: auto; scrollbar-width: none; }
.tm-rail::-webkit-scrollbar { display: none; }
.tm-brand { margin-bottom: 8px; text-decoration: none; }
.tm-brand .brand-icon { width: 40px; height: 40px; font-size: 18px; }
.tm-rail-list { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 100%; }
.tm-rail-btn { position: relative; width: 64px; min-height: 54px; padding: 7px 2px 6px; border: 0; border-radius: 10px; background: transparent; color: var(--tm-rail-fg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; text-decoration: none; font: 600 10.5px var(--font-sans); letter-spacing: .1px; transition: background .15s, color .15s; }
.tm-rail-btn i { font-size: 18px; transition: transform .15s; }
.tm-rail-btn span { line-height: 1.1; white-space: nowrap; }
.tm-rail-btn:hover { background: var(--tm-hover); color: var(--text-primary); }
.tm-rail-btn:hover i { transform: scale(1.08); }
.tm-rail-btn.is-active, .tm-rail-btn.is-open { color: var(--primary); }
.tm-rail-btn.is-active::before, .tm-rail-btn.is-open::before { content: ''; position: absolute; left: -6px; top: 12px; bottom: 12px; width: 4px; border-radius: 0 4px 4px 0; background: var(--primary); }
.tm-rail-btn.is-open { background: var(--tm-hover); }
.tm-badge { position: absolute; top: 4px; right: 12px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--danger); color: #fff; font: 700 10px/16px var(--font-sans); }
.tm-rail-foot { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 4px; padding-top: 10px; width: 100%; border-top: 1px solid var(--border-color); }
.tm-avatar { text-decoration: none; padding: 4px; border-radius: 50%; }
.tm-avatar .user-avatar { position: relative; width: 36px; height: 36px; }
.tm-avatar .status-dot { position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 2px var(--tm-rail-bg); }
.tm-avatar:hover .user-avatar { box-shadow: 0 0 0 2px var(--primary); }
.tm-logout:hover { color: var(--danger); }

/* Panel */
.tm-panel { flex: 1; min-width: 0; display: none; flex-direction: column; height: 100%; background: var(--tm-panel-bg); }
.has-panel .tm-panel { display: flex; }
.tm-panel-group { flex: 1; min-height: 0; overflow-y: auto; padding: 0 10px 12px; scrollbar-width: thin; }
.tm-panel-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; padding: 18px 6px 12px; background: var(--tm-panel-bg); }
.tm-panel-head h2 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -.3px; color: var(--text-primary); }
.tm-panel-close { width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--text-muted); cursor: pointer; }
.tm-panel-close:hover { background: var(--tm-hover); color: var(--text-primary); }
.tm-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.tm-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; color: var(--text-secondary, #CBD5E1); text-decoration: none; font-size: 13.5px; font-weight: 500; transition: background .15s, color .15s; }
.tm-item i { width: 30px; height: 30px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--tm-hover); color: var(--text-muted); font-size: 13px; }
.tm-item span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-item:hover { background: var(--tm-hover); color: var(--text-primary); }
.tm-item.is-active { background: rgba(59, 130, 246, .16); color: var(--text-primary); font-weight: 700; }
.tm-item.is-active i { background: var(--primary); color: #fff; }
.tm-item:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.tm-panel-user { padding: 12px 16px; border-top: 1px solid var(--border-color); display: flex; flex-direction: column; gap: 1px; }
.tm-panel-user .user-name { font-size: 13px; font-weight: 700; }
.tm-panel-user .user-role { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[data-theme="light"] .tm-item { color: #334155; }

/* Header like Teams: menu + back/forward · search in the middle · company and actions on the right */
.topbar.topbar-teams { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 620px) minmax(0, 1fr); gap: 16px; padding: 0 16px; }
.topbar-teams .topbar-left { gap: 2px; }
.topbar-teams .topbar-center { display: flex; justify-content: center; min-width: 0; }
.topbar-teams .topbar-center .global-search-trigger { width: 100%; min-width: 0; }
.topbar-teams .topbar-right { justify-content: flex-end; gap: 10px; min-width: 0; }
.topbar-teams .tb-nav { width: 32px; height: 32px; font-size: 13px; }
.topbar-teams .company-badge { padding: 4px 12px; }

/* Tablets / phones: the rail + panel slide in from the left */
@media (max-width: 1100px) {
    .sidebar.sidebar-teams { transform: translateX(-100%); }
    body.sidebar-open .sidebar.sidebar-teams { transform: none; }
    .main-wrapper, body.tm-panel-open .main-wrapper, body.sidebar-collapsed .main-wrapper { margin-left: 0; }
    .sidebar.sidebar-teams.has-panel { width: min(calc(var(--tm-rail-w) + var(--tm-panel-w)), 92vw); }
    .topbar.topbar-teams { grid-template-columns: auto minmax(0, 1fr) auto; }
    .topbar-teams .tb-nav { display: none; }
}
@media (max-width: 900px) {
    .topbar-teams .topbar-center { justify-content: flex-start; }
    .topbar-teams .topbar-center .global-search-trigger { width: 34px; }
}
@media (max-width: 760px) {
    .topbar.topbar-teams { gap: 6px; padding: 0 8px; }
    .topbar-teams .company-badge .fa-building { display: none; }
}
@media (max-height: 700px) {
    .tm-rail-btn { min-height: 46px; padding: 5px 2px; }
    .tm-rail-btn span { font-size: 10px; }
}
/* header: flex so the right-hand group never overlaps the search box */
.topbar.topbar-teams { display: flex; justify-content: space-between; }
.topbar-teams .topbar-left, .topbar-teams .topbar-right { flex: 0 0 auto; }
.topbar-teams .topbar-center { flex: 1 1 auto; max-width: 620px; margin: 0 auto; }
@media (max-width: 900px) { .topbar-teams .topbar-center { flex: 0 0 auto; margin: 0; } }
/* ☰ only where it is needed: on tablets / phones it opens the menu. On a laptop the rail is always there
   (click a section icon again, or « in the panel, to hide the panel). */
@media (min-width: 1101px) { .topbar-teams #sidebarToggle { display: none; } }

/* Header right like Teams: company name · avatar (account menu: account, company, help, theme, sign out) */
.tb-company { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; padding: 4px 8px; border-radius: 8px; color: var(--text-primary); text-decoration: none; min-width: 0; }
.tb-company:hover { background: var(--tm-hover); }
.tb-company-name { font-size: 14px; font-weight: 700; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-company small { font-size: 10.5px; font-weight: 600; color: #60A5FA; white-space: nowrap; }
[data-theme="light"] .tb-company small { color: #2563EB; }
.tb-avatar { position: relative; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.tb-avatar-circle { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #8B5CF6, #3B82F6); color: #fff; font: 700 13px var(--font-sans); letter-spacing: .3px; }
.tb-avatar:hover .tb-avatar-circle, .tb-avatar[aria-expanded="true"] .tb-avatar-circle { box-shadow: 0 0 0 2px var(--bg-topbar), 0 0 0 4px var(--primary); }
.tb-avatar .status-dot { position: absolute; right: 0; bottom: 0; width: 11px; height: 11px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 2px var(--bg-topbar); }
.user-menu-list { min-width: 280px; padding: 8px; }
.user-menu-list .dropdown-item small { font-size: 11.5px; }
.um-head { display: flex; gap: 12px; align-items: center; padding: 8px 8px 10px; }
.um-big { width: 44px; height: 44px; font-size: 15px; flex: none; }
.um-who { display: flex; flex-direction: column; min-width: 0; }
.um-who b { font-size: 14px; }
.um-who small { color: var(--text-muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.um-theme { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 12px; font-size: 13px; }
.um-theme > span:first-child i { width: 16px; color: var(--text-muted); margin-right: 6px; }
.um-seg { display: inline-flex; padding: 2px; border-radius: 8px; background: var(--tm-hover); }
.um-seg button { border: 0; background: transparent; color: var(--text-muted); font: 600 12px var(--font-sans); padding: 5px 10px; border-radius: 6px; cursor: pointer; display: inline-flex; gap: 5px; align-items: center; }
.um-seg button[aria-pressed="true"] { background: var(--primary); color: #fff; }
.um-logout:hover { color: var(--danger) !important; background: rgba(239, 68, 68, .1) !important; }
.user-menu-list .dropdown-item i { width: 16px; text-align: center; color: var(--text-muted); }

/* New transaction: "+ New" button in the top bar (menu opens downwards) */
.fab-wrap.tb-new { position: relative; }
.tb-new .fab { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border: 0; border-radius: 8px; background: linear-gradient(135deg, #3B82F6, #2563EB); color: #fff; font: 700 13px var(--font-sans); cursor: pointer; white-space: nowrap;
    box-shadow: 0 2px 8px rgba(37, 99, 235, .35); transition: filter .15s, box-shadow .15s; }
.tb-new .fab i { font-size: 13px; transition: transform .2s ease; }
.tb-new .fab .tb-caret { font-size: 9px; opacity: .85; margin-left: 1px; }
.tb-new .fab:hover { filter: brightness(1.08); box-shadow: 0 4px 14px rgba(37, 99, 235, .45); }
.tb-new .fab[aria-expanded="true"] .fa-plus { transform: rotate(45deg); }
.tb-new .fab-menu { top: calc(100% + 8px); bottom: auto; right: 0; left: auto; min-width: 250px; max-height: calc(100vh - 90px); overflow-y: auto; }
@media (max-width: 760px) {
    .tb-new .fab { width: 34px; padding: 0; justify-content: center; }
    .tb-new .fab span, .tb-new .fab .tb-caret { display: none !important; }
    .tb-new .fab-menu { position: fixed; top: 60px; right: 8px; left: 8px; min-width: 0; }
    .tb-company small { display: none; }
    .tb-company-name { max-width: 110px; font-size: 13px; }
}
@media print { .fab-wrap { display: none !important; } }
/* Company + avatar as one button that opens the account menu */
.tb-account { display: inline-flex; align-items: center; gap: 10px; padding: 3px 3px 3px 12px; border: 1px solid transparent; border-radius: 999px; background: transparent; color: var(--text-primary); cursor: pointer; font: inherit; transition: background .15s, border-color .15s; }
.tb-account:hover, .tb-account[aria-expanded="true"] { background: var(--tm-hover); border-color: var(--border-color); }
.tb-account .tb-company { padding: 0; }
.tb-account .tb-company:hover { background: none; }
.tb-account .tb-avatar { width: 36px; height: 36px; display: inline-flex; }
.tb-account:hover .tb-avatar-circle, .tb-account[aria-expanded="true"] .tb-avatar-circle { box-shadow: none; }
@media (max-width: 760px) { .tb-account { padding-left: 8px; gap: 6px; } }
/* account chip: background always visible, a little stronger on hover / when open */
.tb-account { background: var(--tm-hover); border-color: var(--border-color); }
.tb-account:hover, .tb-account[aria-expanded="true"] { background: rgba(255, 255, 255, .1); border-color: rgba(59, 130, 246, .45); }
[data-theme="light"] .tb-account:hover, [data-theme="light"] .tb-account[aria-expanded="true"] { background: rgba(15, 23, 42, .09); }
/* Phones / small tablets: the search icon sits with the other buttons on the right and looks like them */
@media (max-width: 900px) {
    .topbar-teams .topbar-center { margin-left: auto; margin-right: 0; flex: 0 0 auto; }
    .topbar-teams .topbar-right { margin-left: 8px; }
    .topbar-teams .global-search-trigger { width: 36px; height: 36px; border: 1px solid var(--border-color); background: rgba(255, 255, 255, .06); color: var(--text-primary); border-radius: var(--radius-sm); }
    .topbar-teams .global-search-trigger i { font-size: 15px; }
    [data-theme="light"] .topbar-teams .global-search-trigger { background: #F8FAFC; }
}
@media (max-width: 760px) {
    .topbar-teams .global-search-trigger, .topbar-teams .tb-menu-btn { height: 34px; }
    .topbar-teams .global-search-trigger { width: 34px; }
    .topbar-teams .topbar-right { margin-left: 6px; }
}
.tm-version { text-decoration: none; margin-top: auto; padding: 10px 0 2px; font: 600 10px var(--font-sans); color: var(--text-muted); letter-spacing: .3px; opacity: .8; }

/* Users & Roles: company two-step sign-in (2FA) policy */
.tfa-card { display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin-bottom: 16px; }
.tfa-icon { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--bg-input, rgba(148,163,184,.15)); color: var(--text-muted); font-size: 18px; }
.tfa-on .tfa-icon { background: rgba(16, 185, 129, .15); color: var(--success); }
.tfa-text { flex: 1; min-width: 0; }
.tfa-action { flex: none; margin: 0; }
@media (max-width: 768px) { .tfa-card { flex-wrap: wrap; } .tfa-action, .tfa-action .btn { width: 100%; } }

/* Stock → Reorder Report */
#reorderTable .reorder-level, #reorderTable .reorder-qty { width: 96px; margin-left: auto; text-align: right; }
#reorderTable .reorder-sup { min-width: 150px; max-width: 220px; }
#reorderTable tr.reorder-low td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.reorder-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--border-color); }
.reorder-po { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 768px) { #reorderTable .reorder-level, #reorderTable .reorder-qty { width: 110px; } #reorderTable .reorder-sup { max-width: none; width: 100%; } }

/* Settings → Backup & Restore */
.backup-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.backup-grid > .card { margin: 0; }
.backup-last { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: var(--radius-md); background: rgba(16, 185, 129, .12); color: var(--success); margin-bottom: 14px; font-size: 13.5px; }
.backup-last.is-old { background: rgba(245, 158, 11, .14); color: var(--warning); }
.backup-last strong { color: inherit; }
.backup-summary { width: 100%; margin-bottom: 16px; font-size: 13.5px; }
.backup-summary td { padding: 6px 0; border-bottom: 1px dashed var(--border-color); }
@media (max-width: 1000px) { .backup-grid { grid-template-columns: 1fr; } }

/* Start page for custom roles without the dashboard */
.start-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.start-card { margin: 0; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.start-head { display: flex; gap: 12px; align-items: flex-start; color: inherit; text-decoration: none; }
.start-head strong { display: block; font-size: 15px; }
.start-head small { display: block; margin-top: 2px; font-size: 12.5px; }
.start-icon { width: 40px; height: 40px; flex: none; border-radius: 10px; display: grid; place-items: center; background: rgba(37, 99, 235, .14); color: var(--primary); font-size: 17px; }
.start-foot { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: auto; }

/* Settings → Roles & Permissions */
.perm-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.perm-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; border: 1px solid var(--border-color); color: var(--text-muted); white-space: nowrap; }
.perm-chip.is-edit { border-color: rgba(16, 185, 129, .4); color: var(--success); }
.perm-chip i { font-size: 10px; }
.roles-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.roles-grid > .card { margin: 0; }
.preset-list { display: grid; gap: 8px; }
.preset-item { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--border-color); border-radius: var(--radius-md); color: inherit; text-decoration: none; }
.preset-item:hover { border-color: var(--primary); }
.builtin-row { display: flex; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px dashed var(--border-color); }
.builtin-row .badge { min-width: 86px; justify-content: center; text-align: center; }
.perm-quick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.perm-table td { vertical-align: middle; }
.perm-name { display: flex; gap: 10px; align-items: center; }
.perm-name > i { width: 32px; height: 32px; flex: none; border-radius: 8px; display: grid; place-items: center; background: rgba(37, 99, 235, .12); color: var(--primary); }
.perm-name small { display: block; font-size: 12px; }
.perm-radio { display: inline-flex; padding: 6px; cursor: pointer; }
.perm-radio input { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }
@media (max-width: 900px) { .roles-grid { grid-template-columns: 1fr; } }
@media (max-width: 768px) {
    .perm-table thead { display: none; }
    .perm-table tr { display: grid; grid-template-columns: repeat(3, 1fr); padding: 10px 0; border-bottom: 1px solid var(--border-color); }
    .perm-table td:first-child { grid-column: 1 / -1; }
    .perm-table td[data-label]:not(:first-child)::before { content: attr(data-label); display: block; font-size: 11px; color: var(--text-muted); }
}
.content-body[data-readonly="1"] a[hidden] { display: none !important; }

/* Batch / expiry / serial fields on invoice lines */
.lot-box { margin-top: 6px; padding: 8px; border: 1px dashed var(--border-color); border-radius: var(--radius-md); display: grid; gap: 6px; }
.lot-box[hidden], .lot-box [hidden] { display: none !important; }
.lot-batch { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.lot-batch .lot-no { flex: 1 1 160px; min-width: 0; }
.lot-date { display: inline-flex; align-items: center; gap: 4px; margin: 0; font-size: 11.5px; color: var(--text-muted); }
.lot-date input { width: 140px; }
.lot-serials { font-family: var(--font-mono, monospace); font-size: 12px; resize: vertical; }
.lot-info { color: var(--text-muted); } .lot-info i { font-size: 10px; }
.kpi-link { color: inherit; text-decoration: none; }
.kpi-link:hover { border-color: var(--primary); }
.batch-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.batch-filters .search-box { flex: 1 1 240px; }
.batch-filters select { width: auto; }

/* Sales → POS billing */
.pos-header { align-items: flex-start; }
.pos-today { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pos-today > span { display: flex; flex-direction: column; padding: 6px 12px; border: 1px solid var(--border-color); border-radius: var(--radius-md); background: var(--bg-card); min-width: 92px; }
.pos-today small { font-size: 11px; color: var(--text-muted); }
.pos-today b { font-family: var(--font-mono, monospace); font-size: 14px; }
.pos-settings { margin-bottom: 14px; }
.pos-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(360px, 1fr); gap: 16px; align-items: start; }
.pos-grid > .card { margin: 0; }
.pos-left { padding-bottom: 12px; }
.pos-scan { margin: 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.pos-scan .scan-field input { font-size: 15px; padding: 10px 12px; }
.pos-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; padding: 12px; max-height: calc(100vh - 290px); min-height: 260px; overflow: auto; align-content: start; }
.pos-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; text-align: left; border: 1px solid var(--border-color); border-radius: var(--radius-md); background: var(--bg-input, transparent); color: inherit; cursor: pointer; min-height: 92px; }
.pos-tile:hover, .pos-tile:focus-visible { border-color: var(--primary); outline: none; }
.pos-tile b { font-size: 13px; line-height: 1.25; }
.pos-tile small { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono, monospace); }
.pos-tile span { margin-top: auto; font-weight: 700; color: var(--primary); font-family: var(--font-mono, monospace); }
.pos-tile em { font-style: normal; font-size: 11px; color: var(--text-muted); }
.pos-right { display: flex; flex-direction: column; position: sticky; top: 70px; max-height: calc(100vh - 90px); }
.pos-cust { padding: 12px 14px 4px; }
.pos-cust .form-label { margin-bottom: 4px; }
.pos-cart-wrap { flex: 1 1 auto; overflow: auto; min-height: 140px; padding: 0 6px; }
.pos-cart { width: 100%; border-collapse: collapse; font-size: 13px; }
.pos-cart th { font-size: 11px; text-transform: uppercase; color: var(--text-muted); padding: 8px 6px; text-align: left; position: sticky; top: 0; background: var(--bg-card); }
.pos-cart td { padding: 8px 6px; border-top: 1px solid var(--border-color); vertical-align: middle; }
.pos-cart td small { display: block; font-size: 11px; }
.pos-cart .pos-price { width: 84px; margin-left: auto; }
.pos-cart .pos-sn { margin-top: 4px; }
.pos-qty { display: inline-flex; align-items: center; border: 1px solid var(--border-color); border-radius: var(--radius-md); overflow: hidden; }
.pos-qty button { width: 28px; height: 30px; border: 0; background: transparent; color: inherit; font-size: 16px; cursor: pointer; }
.pos-qty button:hover { background: rgba(37, 99, 235, .15); }
.pos-qty input { width: 46px; height: 30px; border: 0; background: transparent; color: inherit; text-align: center; -moz-appearance: textfield; }
.pos-qty input::-webkit-inner-spin-button { display: none; }
.pos-empty { text-align: center; padding: 30px 10px; }
.pos-empty i { font-size: 26px; margin-bottom: 6px; }
.pos-totals { padding: 10px 14px; border-top: 1px solid var(--border-color); display: grid; gap: 4px; font-size: 13px; }
.pos-totals > div { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pos-totals b { font-family: var(--font-mono, monospace); }
.pos-totals input { width: 110px; }
.pos-grand { font-size: 20px; padding-top: 6px; border-top: 2px solid var(--border-color); }
.pos-grand b { color: var(--primary); }
.pos-pay { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 0 14px 10px; }
.pos-mode { margin: 0; cursor: pointer; }
.pos-mode input { position: absolute; opacity: 0; pointer-events: none; }
.pos-mode span { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 4px; border: 1px solid var(--border-color); border-radius: var(--radius-md); font-size: 12px; font-weight: 600; }
.pos-mode input:checked + span { border-color: var(--primary); background: rgba(37, 99, 235, .14); color: var(--primary); }
.pos-mode input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.pos-tender { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; padding: 0 14px 10px; font-size: 13px; }
.pos-tender[hidden] { display: none; }
.pos-tender b { font-family: var(--font-mono, monospace); color: var(--success); }
.pos-note { padding: 0 14px; margin: 0 0 8px; }
.pos-actions { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--border-color); }
.pos-actions .btn-lg { flex: 1; justify-content: center; }
.pos-actions kbd, .pos-done kbd { font-size: 10px; padding: 1px 5px; border-radius: 4px; border: 1px solid currentColor; opacity: .7; }
.pos-done { border: 0; border-radius: 16px; padding: 26px 28px; width: min(440px, calc(100vw - 32px)); background: var(--bg-card); color: var(--text-main, inherit); text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.pos-done[open] { margin: auto; }
.pos-done::backdrop { background: rgba(2, 6, 23, .6); }
.pos-done-icon { font-size: 42px; color: var(--success); }
.pos-done h2 { margin: 6px 0 2px; font-size: 20px; }
.pos-done-total { font-size: 22px; font-weight: 700; font-family: var(--font-mono, monospace); margin: 4px 0; }
.pos-done-change { font-size: 16px; color: var(--warning); margin: 0 0 8px; }
.pos-done-actions { display: grid; gap: 8px; margin: 14px 0 10px; }
.pos-done-actions .btn { justify-content: center; }
.pos-print-frame { position: fixed; width: 0; height: 0; border: 0; right: 0; bottom: 0; }
@media (max-width: 1100px) {
    .pos-grid { grid-template-columns: 1fr; }
    .pos-right { position: static; max-height: none; }
    .pos-tiles { max-height: 340px; }
}
@media (max-width: 600px) {
    .pos-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pos-pay { grid-template-columns: repeat(2, 1fr); }
    .pos-cart .pos-price { width: 70px; }
    .pos-today > span { min-width: 0; flex: 1 1 40%; }
}

.xml-notes { margin: 14px 0 0; padding-left: 18px; display: grid; gap: 4px; }
.logo-field{display:flex;flex-wrap:wrap;gap:10px;align-items:center}.logo-field .form-control{flex:1 1 220px}.logo-preview{max-height:48px;max-width:160px;background:#fff;border-radius:6px;padding:4px}

/* ---------- Superadmin (platform owner) panel ---------- */
.sa-tabs { display: flex; gap: 4px; overflow-x: auto; padding: 0 20px; border-bottom: 1px solid var(--border-color); background: var(--bg-card); scrollbar-width: thin; }
.sa-tab { display: inline-flex; align-items: center; gap: 7px; padding: 12px 14px; color: var(--text-muted); text-decoration: none; font-weight: 600; font-size: 13.5px; border-bottom: 2px solid transparent; white-space: nowrap; }
.sa-tab:hover { color: var(--text-main, inherit); }
.sa-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.sa-main { max-width: 1320px; margin: 0 auto; padding: 22px 20px 60px; }
.sa-kpis { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.sa-actions { display: inline-flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; align-items: center; }
.sa-actions form { display: inline; margin: 0; }
.sa-box { border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 10px 12px; margin-top: 10px; }
.sa-box summary { cursor: pointer; }
.sa-filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-start !important; }
.sa-filter .form-control { width: auto; min-width: 140px; }
.sa-features { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 14px; margin: 6px 0; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.plan-card { margin: 0; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.plan-card.is-off { opacity: .6; }
.plan-head { display: flex; align-items: center; gap: 8px; } .plan-head h3 { margin: 0; font-size: 18px; flex: 1; }
.plan-price { font-size: 26px; font-weight: 800; color: var(--primary); } .plan-price small { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.plan-limits { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; font-size: 13px; } .plan-limits i { width: 18px; color: var(--text-muted); }
.plan-foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 8px; border-top: 1px dashed var(--border-color); }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.tpl-card { margin: 0; overflow: hidden; } .tpl-card.is-off { opacity: .6; }
.tpl-thumb { height: 300px; overflow: hidden; background: #fff; position: relative; border-bottom: 1px solid var(--border-color); }
.tpl-thumb iframe { width: 820px; height: 1160px; border: 0; transform: scale(.34); transform-origin: 0 0; pointer-events: none; }
.tpl-designer { display: grid; grid-template-columns: minmax(320px, 420px) minmax(0, 1fr); gap: 16px; align-items: start; }
.tpl-designer > .card { margin: 0; }
.tpl-sec { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--text-muted); margin: 18px 0 8px; }
.tpl-colors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tpl-color { display: flex; align-items: center; gap: 6px; font-size: 12px; margin: 0; cursor: pointer; }
.tpl-color input { width: 34px; height: 28px; padding: 0; border: 1px solid var(--border-color); border-radius: 6px; background: none; cursor: pointer; }
.tpl-preview { position: sticky; top: 12px; }
.tpl-frame-wrap { background: #e5e7eb; height: calc(100vh - 140px); min-height: 520px; overflow: auto; }
.tpl-frame-wrap iframe { width: 100%; height: 100%; border: 0; background: #fff; }
@media (max-width: 1000px) { .tpl-designer { grid-template-columns: 1fr; } .tpl-preview { position: static; } .tpl-frame-wrap { height: 70vh; } }
@media (max-width: 640px) { .sa-hide-sm { display: none; } .sa-main { padding: 16px 12px 40px; } .tpl-colors { grid-template-columns: repeat(2, 1fr); } }
/* superadmin: tabs inside one company */
.sa-subtabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 18px; padding: 4px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-md); width: fit-content; max-width: 100%; }
.sa-subtab { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: calc(var(--radius-md) - 2px); color: var(--text-muted); text-decoration: none; font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.sa-subtab:hover { color: var(--text-main, inherit); background: var(--bg-hover, rgba(127,127,127,.08)); }
.sa-subtab.active { background: var(--primary); color: #fff; }
/* superadmin: plan form */
.pf { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.pf-main { display: grid; gap: 16px; min-width: 0; }
.pf-sec { margin: 0; padding: 18px 20px; }
.pf-sec-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.pf-sec-head h2 { margin: 0; font-size: 16px; } .pf-sec-head p { margin: 2px 0 0; font-size: 12.5px; color: var(--text-muted); }
.pf-sec-head > div:nth-child(2) { flex: 1; }
.pf-num { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: rgba(59,130,246,.15); color: var(--primary); }
.pf-bulk { display: flex; gap: 6px; }
.pf-grid { display: grid; gap: 0 14px; } .pf-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .pf-span-3 { grid-column: 1 / -1; }
.pf-affix { display: flex; align-items: stretch; border: 1px solid var(--border-color); border-radius: var(--radius-md, 8px); overflow: hidden; background: var(--bg-input, transparent); }
.pf-affix .form-control { border: 0; border-radius: 0; min-width: 0; flex: 1; }
.pf-affix span { display: grid; place-items: center; padding: 0 12px; font-size: 13px; color: var(--text-muted); background: rgba(127,127,127,.08); }
.pf-limits { display: grid; gap: 10px; }
.pf-limit { display: grid; grid-template-columns: 40px minmax(0, 1fr) 120px; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border-color); border-radius: var(--radius-md, 8px); margin: 0; position: relative; }
.pf-limit-icon, .pf-feature-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: rgba(127,127,127,.1); color: var(--text-muted); font-size: 16px; }
.pf-limit-text, .pf-feature-text { display: flex; flex-direction: column; min-width: 0; } .pf-limit-text small, .pf-feature-text small { color: var(--text-muted); font-size: 12px; line-height: 1.35; }
.pf-limit-text b, .pf-feature-text b { font-size: 14px; font-weight: 600; }
.pf-limit .form-control { text-align: right; font-family: var(--font-mono, monospace); }
.pf-limit-inf { position: absolute; right: 52px; top: 50%; transform: translateY(-50%); font-size: 11px; color: var(--success, #22c55e); pointer-events: none; opacity: 0; }
.pf-limit.is-inf .pf-limit-inf { opacity: 1; }
.pf-features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pf-toggles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pf-feature { display: grid; grid-template-columns: 40px minmax(0, 1fr) 40px; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border-color); border-radius: var(--radius-md, 8px); margin: 0; cursor: pointer; transition: border-color .15s, background .15s; }
.pf-feature:hover { border-color: var(--primary); }
.pf-feature input { position: absolute; opacity: 0; pointer-events: none; }
.pf-switch { width: 38px; height: 22px; border-radius: 11px; background: rgba(127,127,127,.35); position: relative; transition: background .15s; justify-self: end; }
.pf-switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.pf-feature:has(input:checked) { border-color: var(--primary); background: rgba(59,130,246,.07); }
.pf-feature:has(input:checked) .pf-switch { background: var(--primary); }
.pf-feature:has(input:checked) .pf-switch::after { transform: translateX(16px); }
.pf-feature:has(input:checked) .pf-feature-icon { background: rgba(59,130,246,.15); color: var(--primary); }
.pf-feature:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.pf-order { display: flex; flex-direction: column; gap: 4px; } .pf-order .form-control { max-width: 140px; }
.pf-side { min-width: 0; } .pf-sticky { position: sticky; top: 16px; display: grid; gap: 12px; }
.pf-side-label { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--text-muted); }
.pf-preview { margin: 0; } .pf-preview [hidden] { display: none !important; }
.pf-save { width: 100%; justify-content: center; padding: 12px; }
@media (max-width: 1100px) { .pf { grid-template-columns: 1fr; } .pf-sticky { position: static; } }
@media (max-width: 720px) { .pf-grid-3, .pf-features, .pf-toggles { grid-template-columns: 1fr; } .pf-limit { grid-template-columns: 40px minmax(0, 1fr) 90px; } .pf-limit-inf { display: none; } .pf-bulk { display: none; } }
/* superadmin: drag-and-drop invoice designer */
.ib-page { margin: 0; height: 100vh; display: flex; flex-direction: column; overflow: hidden; background: var(--bg-body, #0b1120); }
.ib-top { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--bg-card); border-bottom: 1px solid var(--border-color); }
.ib-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; white-space: nowrap; } .ib-brand i { color: var(--primary); }
.ib-name { flex: 0 1 300px; min-width: 120px; background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 7px 10px; color: inherit; font: 600 14px inherit; font-family: inherit; }
.ib-name:hover { border-color: var(--border-color); } .ib-name:focus { outline: none; border-color: var(--primary); background: var(--bg-input, rgba(127,127,127,.06)); }
.ib-active { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; margin: 0; white-space: nowrap; }
.ib-active input, .ib-switch input { position: absolute; opacity: 0; pointer-events: none; }
.ib-active:has(input:checked) .pf-switch, .ib-switch:has(input:checked) .pf-switch { background: var(--primary); }
.ib-active:has(input:checked) .pf-switch::after, .ib-switch:has(input:checked) .pf-switch::after { transform: translateX(16px); }
.ib-active:has(input:focus-visible) .pf-switch, .ib-switch:has(input:focus-visible) .pf-switch { outline: 2px solid var(--primary); outline-offset: 2px; }
.ib-top-gap { flex: 1; }
.ib-icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border-color); background: transparent; color: inherit; cursor: pointer; text-decoration: none; flex: none; }
.ib-icon-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); } .ib-icon-btn:disabled { opacity: .35; cursor: default; }
.ib { flex: 1; display: grid; grid-template-columns: 330px minmax(0, 1fr); min-height: 0; }
.ib-panel { background: var(--bg-card); border-right: 1px solid var(--border-color); display: flex; flex-direction: column; min-height: 0; }
.ib-tabs { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--border-color); flex: none; }
.ib-tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 11px 6px; color: var(--text-muted); font: 600 13px inherit; font-family: inherit; cursor: pointer; display: flex; gap: 6px; align-items: center; justify-content: center; }
.ib-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.ib-pane { display: none; overflow-y: auto; padding: 14px; flex: 1; min-height: 0; } .ib-pane.active { display: block; }
.ib-help { font-size: 12.5px; color: var(--text-muted); margin: 0 0 10px; line-height: 1.5; }
.ib-h { font-size: 11.5px; text-transform: uppercase; letter-spacing: .7px; color: var(--text-muted); margin: 16px 0 8px; display: flex; gap: 8px; align-items: center; }
.ib-pane > .ib-h:first-child, .ib-pane > div > .ib-h:first-child { margin-top: 0; }
.ib-layouts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ib-layouts.small { grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ib-layout { display: flex; gap: 3px; height: 34px; padding: 5px; border: 1px solid var(--border-color); border-radius: 8px; background: transparent; cursor: grab; }
.ib-layout span { background: rgba(127,127,127,.3); border-radius: 3px; }
.ib-layout:hover, .ib-layout.on { border-color: var(--primary); } .ib-layout:hover span, .ib-layout.on span { background: var(--primary); opacity: .75; }
.ib-widgets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ib-widget { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 12px 4px; min-height: 76px; border: 1px solid var(--border-color); border-radius: 10px; background: transparent; color: inherit; cursor: grab; font: 500 11.5px inherit; font-family: inherit; text-align: center; line-height: 1.25; }
.ib-widget i { font-size: 17px; color: var(--text-muted); }
.ib-widget:hover { border-color: var(--primary); background: rgba(59,130,246,.07); } .ib-widget:hover i { color: var(--primary); }
.ib-widget:active, .ib-layout:active { cursor: grabbing; }
.ib-canvas { position: relative; min-width: 0; min-height: 0; background: #d1d5db; }
.ib-canvas iframe { width: 100%; height: 100%; border: 0; display: block; }
.ib-status { position: absolute; top: 10px; right: 14px; z-index: 2; font-size: 12px; padding: 4px 10px; border-radius: 999px; background: rgba(17,24,39,.75); color: #fff; pointer-events: none; }
.ib-status[hidden] { display: none; } .ib-status.bad { background: #b91c1c; }
.ib-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: 12px; font-size: 12px; }
.ib-crumbs i { font-size: 9px; color: var(--text-muted); }
.ib-crumbs button { background: none; border: 0; padding: 3px 6px; border-radius: 6px; color: var(--text-muted); cursor: pointer; font: inherit; }
.ib-crumbs button:hover { color: var(--primary); } .ib-crumbs button.on { color: var(--primary); background: rgba(59,130,246,.1); font-weight: 600; }
.ib-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 10px; }
.ib-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; } .ib-field.wide, .ib-switch { grid-column: 1 / -1; }
.ib-field > label { font-size: 12px; color: var(--text-muted); }
.ib-field textarea { resize: vertical; font-size: 12.5px; }
.ib-switch { display: flex; align-items: center; gap: 10px; font-size: 13px; cursor: pointer; margin: 0; padding: 2px 0; }
.ib-color { display: flex; align-items: center; gap: 6px; } .ib-color input[type=color] { width: 36px; height: 30px; padding: 0; border: 1px solid var(--border-color); border-radius: 6px; background: none; cursor: pointer; flex: none; }
.ib-color-val { font: 12px var(--font-mono, monospace); color: var(--text-muted); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ib-clear { background: none; border: 0; color: var(--text-muted); cursor: pointer; padding: 4px; } .ib-clear:hover { color: var(--danger, #ef4444); }
.ib-image { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; } .ib-image img { max-width: 100%; max-height: 80px; border-radius: 6px; background: #fff; padding: 4px; }
.ib-image input { font-size: 12px; max-width: 100%; }
.ib-more { margin-top: 14px; border-top: 1px solid var(--border-color); padding-top: 10px; } .ib-more summary { cursor: pointer; font-weight: 600; font-size: 13px; margin-bottom: 10px; }
.ib-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border-color); }
.ib-danger:hover { color: var(--danger, #ef4444); border-color: var(--danger, #ef4444); }
.ib-empty { text-align: center; color: var(--text-muted); padding: 30px 10px; } .ib-empty i { font-size: 28px; margin-bottom: 8px; }
.ib-modal { position: fixed; inset: 0; z-index: 100; background: rgba(2,6,23,.65); display: grid; place-items: center; padding: 20px; }
.ib-modal[hidden] { display: none; }
.ib-modal-box { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 14px; padding: 20px; width: min(1000px, 100%); max-height: calc(100vh - 40px); overflow: auto; }
.ib-modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; } .ib-modal-head h2 { margin: 0; font-size: 18px; }
.ib-presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.ib-preset { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 10px; border: 1px solid var(--border-color); border-radius: 12px; background: transparent; color: inherit; cursor: pointer; font-family: inherit; }
.ib-preset:hover, .ib-preset:focus-visible { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(59,130,246,.2); }
.ib-preset b { font-size: 14px; } .ib-preset small { color: var(--text-muted); font-size: 12px; line-height: 1.4; }
.ib-preset-thumb { display: block; height: 250px; overflow: hidden; border-radius: 8px; background: #fff; margin-bottom: 6px; position: relative; }
.ib-preset-thumb iframe { width: 820px; height: 1160px; border: 0; transform: scale(.235); transform-origin: 0 0; pointer-events: none; }
.ib-toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 120; background: #166534; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13.5px; box-shadow: 0 8px 24px rgba(0,0,0,.3); max-width: calc(100vw - 32px); }
.ib-toast.bad { background: #b91c1c; } .ib-toast[hidden] { display: none; }
@media (max-width: 860px) {
    .ib-page { height: auto; overflow: auto; }
    .ib { grid-template-columns: 1fr; } .ib-panel { border-right: 0; border-bottom: 1px solid var(--border-color); max-height: 46vh; }
    .ib-canvas { height: 80vh; } .ib-hide-sm { display: none; } .ib-top { flex-wrap: wrap; } .ib-name { flex: 1 1 140px; }
}
.ib-ghost { position: fixed; left: 0; top: 0; z-index: 200; pointer-events: none; background: #4f46e5; color: #fff; font: 600 12px var(--font-sans, Arial); padding: 6px 10px; border-radius: 8px; box-shadow: 0 8px 20px rgba(0,0,0,.35); white-space: nowrap; }
.ib-ghost[hidden] { display: none; }
body.ib-dragging, body.ib-dragging * { cursor: grabbing !important; user-select: none !important; }
.ib-widget, .ib-layout { touch-action: manipulation; user-select: none; -webkit-user-select: none; }
[data-denied] { display: none !important; }
/* role form: page-wise rights */
.rf { display: grid; gap: 14px; }
.rf > .card { margin: 0; }
.rf-quick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rf-count { margin-left: auto; }
.rf-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; } .rf-legend i { width: 14px; text-align: center; }
.rf-group { overflow: hidden; }
.rf-ghead { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border-color); flex-wrap: wrap; }
.rf-toggle { flex: 1; min-width: 220px; display: flex; align-items: center; gap: 12px; background: none; border: 0; color: inherit; text-align: left; cursor: pointer; padding: 2px 0; font: inherit; }
.rf-gicon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: rgba(59,130,246,.14); color: var(--primary); flex: none; }
.rf-group.is-off .rf-gicon { background: rgba(127,127,127,.12); color: var(--text-muted); }
.rf-gname { display: flex; flex-direction: column; } .rf-gname b { font-size: 15px; } .rf-gsum { font-size: 12px; }
.rf-chev { color: var(--text-muted); transition: transform .15s; } .rf-toggle[aria-expanded="false"] .rf-chev { transform: rotate(-90deg); }
.rf-gcols, .rf-acts { display: grid; grid-template-columns: repeat(4, 74px); gap: 6px; flex: none; }
.rf-col, .rf-act { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0; padding: 6px 4px; border-radius: 8px; border: 1px solid var(--border-color); cursor: pointer; font-size: 12px; user-select: none; }
.rf-col { border-style: dashed; font-weight: 600; }
.rf-col input, .rf-act input { margin: 0; accent-color: var(--primary); width: 15px; height: 15px; cursor: pointer; }
.rf-act:has(input:checked) { border-color: var(--primary); background: rgba(59,130,246,.1); color: var(--primary); font-weight: 600; }
.rf-act:has(input[data-act="d"]:checked) { border-color: var(--danger, #ef4444); background: rgba(239,68,68,.1); color: var(--danger, #ef4444); }
.rf-col:has(input:disabled) { opacity: .35; cursor: default; }
.rf-na { display: grid; place-items: center; color: var(--text-muted); opacity: .5; font-size: 12px; }
.rf-pages[hidden] { display: none; }
.rf-page { display: flex; align-items: center; gap: 12px; padding: 8px 14px 8px 62px; border-bottom: 1px solid var(--border-color); }
.rf-page:last-child { border-bottom: 0; }
.rf-page:hover { background: rgba(127,127,127,.05); }
.rf-pname { flex: 1; min-width: 0; font-size: 13.5px; color: var(--text-muted); } .rf-page.is-on .rf-pname { color: inherit; font-weight: 500; }
.rf-approve .card-title { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.rf-switch { margin: 10px 0 12px; }
.rf-limit { max-width: 360px; margin: 0; }
.rf-save { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; position: sticky; bottom: 0; padding: 12px 16px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-md, 10px); z-index: 5; }
.rf-save p { margin: 0; flex: 1; min-width: 220px; }
@media (max-width: 720px) {
    .rf-page { flex-direction: column; align-items: stretch; padding: 10px 14px; gap: 8px; }
    .rf-gcols, .rf-acts { grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; }
    .rf-ghead { flex-direction: column; align-items: stretch; }
    .rf-count { margin-left: 0; width: 100%; }
}
/* help bot */
.hb-open-text { margin-left: 6px; }
@media (max-width: 900px) { .hb-open-text { display: none; } }
.hb { position: fixed; right: 20px; top: 70px; bottom: 20px; width: min(400px, calc(100vw - 24px)); z-index: 1200; display: flex; flex-direction: column; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 16px; box-shadow: 0 18px 50px rgba(0,0,0,.35); overflow: hidden; }
.hb[hidden] { display: none; }
.hb-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 14px; border-bottom: 1px solid var(--border-color); background: linear-gradient(135deg, rgba(59,130,246,.16), rgba(99,102,241,.08)); }
.hb-avatar { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, #3B82F6, #6366F1); color: #fff; font-size: 17px; flex: none; }
.hb-title { flex: 1; display: flex; flex-direction: column; line-height: 1.25; } .hb-title small { color: var(--text-muted); font-size: 11.5px; }
.hb-icon { width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent; color: var(--text-muted); cursor: pointer; } .hb-icon:hover { background: rgba(127,127,127,.12); color: inherit; }
.hb-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.hb-msg { max-width: 92%; padding: 10px 12px; border-radius: 14px; font-size: 13.5px; line-height: 1.5; }
.hb-msg p { margin: 0 0 6px; } .hb-msg p:last-child { margin: 0; }
.hb-bot { align-self: flex-start; background: rgba(127,127,127,.09); border: 1px solid var(--border-color); border-top-left-radius: 4px; }
.hb-me { align-self: flex-end; background: var(--primary); color: #fff; border-top-right-radius: 4px; }
.hb-answer ol, .hb-answer ul { margin: 6px 0 0; padding-left: 20px; } .hb-answer li { margin: 3px 0; }
.hb-answer a { color: var(--primary); }
.hb-where { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.hb-sub { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--text-muted); margin: 8px 0 6px; font-weight: 700; } .hb-sub:first-child { margin-top: 0; }
.hb-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.hb-chip { border: 1px solid var(--border-color); background: var(--bg-card); color: inherit; border-radius: 999px; padding: 6px 11px; font: 500 12.5px inherit; font-family: inherit; cursor: pointer; text-align: left; line-height: 1.35; }
.hb-chip:hover, .hb-chip:focus-visible { border-color: var(--primary); color: var(--primary); outline: none; }
.hb-data .hb-chip { border-color: rgba(34,197,94,.45); } .hb-data .hb-chip:hover { color: #16a34a; border-color: #16a34a; }
.hb-cat i { opacity: .6; margin-right: 3px; }
.hb-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.hb-ask { display: flex; gap: 6px; padding: 10px; border-top: 1px solid var(--border-color); }
.hb-ask input { flex: 1; min-width: 0; border: 1px solid var(--border-color); border-radius: 10px; padding: 9px 12px; background: var(--bg-input, transparent); color: inherit; font: inherit; }
.hb-ask input:focus { outline: none; border-color: var(--primary); }
.hb-ask button { width: 40px; border: 0; border-radius: 10px; background: var(--primary); color: #fff; cursor: pointer; }
.hb-typing { display: inline-flex; gap: 4px; } .hb-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted); animation: hbDot 1s infinite ease-in-out; }
.hb-typing i:nth-child(2) { animation-delay: .15s; } .hb-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes hbDot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (max-width: 640px) { .hb { right: 8px; left: 8px; width: auto; top: 60px; bottom: 8px; } }
.toolbar .upi-pay { background: #7c3aed; border-color: #7c3aed; }
.pos-upi { display: flex; align-items: center; gap: 14px; padding: 12px; margin: 8px 0; border: 1px dashed var(--primary); border-radius: 12px; background: rgba(59,130,246,.06); }
.pos-upi[hidden] { display: none; }
.pos-upi-qr { background: #fff; padding: 6px; border-radius: 8px; flex: none; line-height: 0; } .pos-upi-qr img, .pos-upi-qr canvas { display: block; }
.pos-upi-text { display: flex; flex-direction: column; gap: 4px; } .pos-upi-text b { font-size: 15px; } .pos-upi-text small { color: var(--text-muted); font-size: 12px; line-height: 1.4; }
.perm-chip small { opacity: .7; margin-left: 2px; }
.perm-chip.is-approve { border-color: rgba(245,158,11,.5); color: #f59e0b; }
.perm-detail { margin-top: 8px; font-size: 12.5px; } .perm-detail summary { cursor: pointer; color: var(--text-muted); }
.perm-mini { margin-top: 6px; border-collapse: collapse; width: 100%; } .perm-mini td { padding: 3px 8px 3px 0; border-bottom: 1px dashed var(--border-color); vertical-align: middle; }
.perm-act { display: inline-block; font-size: 11px; padding: 1px 6px; margin: 1px 2px; border-radius: 5px; border: 1px solid var(--border-color); color: var(--text-muted); opacity: .45; text-decoration: line-through; }
.perm-act.on { opacity: 1; text-decoration: none; color: var(--primary); border-color: var(--primary); } .perm-act.on.del { color: var(--danger, #ef4444); border-color: var(--danger, #ef4444); }
.pos-wa { display: flex; gap: 8px; margin: 12px 0 4px; } .pos-wa .form-control { flex: 1; min-width: 0; }
/* Footer bar fixed at the bottom: plan status, help bot, new transaction */
:root { --ft-h: 54px; }
.main-footer.app-footer { position: fixed; bottom: 0; right: 0; left: var(--tm-rail-w); height: var(--ft-h); z-index: 900; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 18px;
    background: var(--bg-topbar); border-top: 1px solid var(--border-color); box-shadow: 0 -4px 18px rgba(0, 0, 0, .18); transition: left .22s ease; }
body.tm-panel-open .main-footer.app-footer { left: calc(var(--tm-rail-w) + var(--tm-panel-w)); }
.main-wrapper { padding-bottom: calc(var(--ft-h) + 8px); }
.app-footer .footer-left, .app-footer .footer-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ft-plan { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; text-decoration: none; border: 1px solid var(--border-color); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; }
.ft-plan:hover { border-color: var(--primary); color: var(--primary); }
.ft-plan.ft-trial { color: #0ea5e9; border-color: rgba(14, 165, 233, .45); background: rgba(14, 165, 233, .08); }
.ft-plan.ft-expired { color: #ef4444; border-color: rgba(239, 68, 68, .5); background: rgba(239, 68, 68, .1); }
.ft-plan.ft-active { color: #22c55e; border-color: rgba(34, 197, 94, .4); }
.ft-copy { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.ft-ask { height: 36px; display: inline-flex; align-items: center; gap: 7px; }
.fab-wrap.ft-new { position: relative; }
.ft-new .fab { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border: 0; border-radius: 10px; background: linear-gradient(135deg, #3B82F6, #2563EB); color: #fff; font: 700 13.5px var(--font-sans); cursor: pointer; white-space: nowrap;
    box-shadow: 0 4px 14px rgba(37, 99, 235, .4); transition: filter .15s; }
.ft-new .fab:hover { filter: brightness(1.08); }
.ft-new .fab i { font-size: 14px; transition: transform .2s ease; }
.ft-new .fab .ft-caret { font-size: 10px; opacity: .85; }
.ft-new .fab[aria-expanded="true"] .fa-plus { transform: rotate(45deg); }
.ft-new .fab-menu { top: auto; bottom: calc(100% + 10px); right: 0; left: auto; min-width: 260px; max-height: calc(100vh - 140px); overflow-y: auto; }
.hb { bottom: calc(var(--ft-h) + 10px) !important; }
.rf-save { bottom: calc(var(--ft-h) + 6px); }
@media (max-width: 1100px) { .main-footer.app-footer, body.tm-panel-open .main-footer.app-footer { left: 0; } }
@media (max-width: 760px) {
    .main-footer.app-footer { display: flex !important; padding: 0 10px; --ft-h: 56px; }
    .ft-copy { display: none; }
    .ft-plan { max-width: 46vw; font-size: 11.5px; padding: 5px 9px; }
    .ft-new .fab span { display: none; }
    .ft-new .fab { padding: 0 12px; }
    .ft-ask span { display: none; }
    .ft-new .fab-menu { position: fixed; left: 8px; right: 8px; bottom: calc(var(--ft-h) + 8px); min-width: 0; max-height: 70vh; }
}
@media print { .main-footer.app-footer { display: none !important; } .main-wrapper { padding-bottom: 0; } }
/* subscription pages */
.sub-pending { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sub-hero { display: flex; justify-content: space-between; gap: 18px; padding: 20px; margin: 0 0 22px; flex-wrap: wrap; align-items: center; }
.sub-hero.sub-trial { border-color: rgba(14, 165, 233, .45); } .sub-hero.sub-expired { border-color: rgba(239, 68, 68, .5); } .sub-hero.sub-active { border-color: rgba(34, 197, 94, .4); }
.sub-hero-main { flex: 1; min-width: 260px; display: grid; gap: 14px; }
.sub-hero-top { display: flex; gap: 14px; align-items: flex-start; }
.sub-hero-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 20px; background: rgba(59, 130, 246, .15); color: var(--primary); flex: none; }
.sub-trial .sub-hero-icon { background: rgba(14, 165, 233, .15); color: #0ea5e9; } .sub-expired .sub-hero-icon { background: rgba(239, 68, 68, .15); color: #ef4444; } .sub-active .sub-hero-icon { background: rgba(34, 197, 94, .15); color: #22c55e; }
.sub-hero-name { font-size: 20px; font-weight: 800; display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.sub-progress { height: 8px; border-radius: 99px; background: rgba(127, 127, 127, .18); overflow: hidden; } .sub-progress span { display: block; height: 100%; background: linear-gradient(90deg, #22c55e, #f59e0b 70%, #ef4444); border-radius: 99px; }
.sub-usage { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.sub-usage > div { position: relative; padding: 10px 12px; border: 1px solid var(--border-color); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; gap: 2px; }
.sub-usage span { font-size: 12px; color: var(--text-muted); } .sub-usage b { font-size: 15px; }
.sub-usage i { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--primary); }
.sub-hero-cta { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.sub-h { font-size: 16px; margin: 0 0 12px; }
.sub-plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.sub-plan { margin: 0; padding: 20px; display: flex; flex-direction: column; gap: 10px; position: relative; overflow: visible; }
.sub-plan h3 { margin: 0; font-size: 19px; }
.sub-plan.is-popular { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary), 0 10px 30px rgba(37, 99, 235, .15); }
.sub-plan.is-current { border-color: #22c55e; }
.sub-ribbon { position: absolute; top: 14px; right: 14px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 99px; }
.sub-price { font-size: 28px; font-weight: 800; color: var(--primary); } .sub-price small { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.sub-limits, .sub-feats { list-style: none; padding: 0; margin: 0; display: grid; gap: 5px; font-size: 13px; }
.sub-limits i, .sub-feats i { width: 18px; text-align: center; } .sub-limits i { color: var(--text-muted); }
.sub-feats { padding-top: 10px; border-top: 1px dashed var(--border-color); }
.sub-feats .on i { color: #22c55e; } .sub-feats .off { color: var(--text-muted); opacity: .6; } .sub-feats .off i { color: #ef4444; }
.sub-plan-foot { margin-top: auto; padding-top: 8px; display: grid; gap: 8px; justify-items: center; }
.btn-block { width: 100%; justify-content: center; }
.sub-buy { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 18px; align-items: start; }
.sub-buy > .card { margin: 0; }
.sub-line { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--border-color); }
.sub-total { font-size: 20px; font-weight: 800; border-bottom: 0; color: var(--primary); }
.sub-coupon { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border-color); }
.sub-coupon-row { display: flex; gap: 8px; } .sub-coupon-row .form-control { flex: 1; min-width: 0; }
.sub-qr-wrap { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 14px; flex-wrap: wrap; }
.sub-qr { background: #fff; padding: 8px; border-radius: 10px; line-height: 0; min-width: 186px; min-height: 186px; } .sub-qr img, .sub-qr canvas { display: block; }
.sub-bank { padding: 10px 12px; border: 1px dashed var(--border-color); border-radius: 10px; margin-bottom: 14px; }
.sub-form { margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--border-color); }
.sub-upi-btn { display: none; } @media (pointer: coarse) { .sub-upi-btn { display: inline-flex; } }
@media (max-width: 900px) { .sub-buy { grid-template-columns: 1fr; } .sub-usage { grid-template-columns: 1fr; } }
/* superadmin plan requests */
.sa-orders { display: grid; gap: 12px; }
.sa-order { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px; border: 1px solid var(--border-color); border-radius: 12px; }
.sa-order-amt { font-size: 18px; font-weight: 800; color: var(--primary); display: flex; flex-direction: column; } .sa-order-amt small { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.sa-order-act { display: flex; flex-direction: column; gap: 6px; align-items: stretch; } .sa-order-act form { margin: 0; }
.sa-order-reject { display: flex; gap: 6px; }
.coupon-plans { display: flex; flex-wrap: wrap; gap: 8px 18px; }
@media (max-width: 760px) { .sa-order { grid-template-columns: 1fr; } }

/* Subscription: monthly / yearly toggle */
.sub-h-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 12px; }
.sub-h-row .sub-h { margin: 0; }
.sub-cycle { display: inline-flex; padding: 4px; gap: 4px; border: 1px solid var(--border-color); border-radius: 99px; background: var(--bg-card, transparent); }
.sub-cycle button, .sub-cycle a { border: 0; background: transparent; color: var(--text-muted); font: inherit; font-size: 13px; font-weight: 600; padding: 7px 16px; border-radius: 99px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.sub-cycle .is-on { background: var(--primary); color: #fff; }
.sub-save { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 99px; background: rgba(16,185,129,.16); color: var(--success, #10b981); }
.sub-cycle .is-on .sub-save { background: rgba(255,255,255,.22); color: #fff; }
.sub-cycle-sm { display: flex; width: 100%; margin-bottom: 14px; }
.sub-cycle-sm a { flex: 1; justify-content: center; padding: 8px 10px; }
.sub-plans.cycle-year .sub-monthly, .sub-plans.cycle-month .sub-yearly { display: none; }
@media (max-width: 520px) { .sub-cycle-sm { flex-direction: column; border-radius: 14px; } .sub-cycle-sm a { border-radius: 10px; } }

/* ---------- Auth pages (login / register): mobile layout ----------
   On phones the short hero stays on top and the whole page is sized to fit
   one screen (no scrolling); less important copy drops out on shorter screens. */
@media (max-width: 800px) {
    .auth-page-light { min-height: 100dvh; }
    .auth-layout { width: min(100% - 28px, 520px); min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: max(14px, env(safe-area-inset-top)) 0 max(14px, env(safe-area-inset-bottom)); }
    .auth-page-light .auth-hero { max-width: none; margin: 0; padding: 0 4px; text-align: center; }
    .auth-page-light .auth-hero h1 { margin: 0 0 6px; font-size: 24px; line-height: 1.2; letter-spacing: -.6px; }
    .auth-page-light .auth-hero h1 br { display: none; }
    .auth-page-light .hero-copy { font-size: 13px; line-height: 1.5; }
    .auth-page-light .auth-hero hr,
    .auth-page-light .auth-hero h2,
    .auth-page-light .hero-list,
    .auth-page-light .hero-stats,
    .auth-page-light .hero-small,
    .auth-page-light .hero-highlight,
    .auth-page-light .hero-ticks,
    .auth-page-light .auth-register-hero .hero-copy { display: none; }
    .hero-perks { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 10px 0 0; padding: 10px; border-radius: 12px; text-align: left; }
    .hero-perks span { font-size: 12px; gap: 7px; line-height: 1.25; }
    .hero-perks i { flex: 0 0 22px; width: 22px; height: 22px; border-radius: 6px; font-size: 10px; }
    .hero-inline-stats { justify-content: center; gap: 4px 10px; margin: 6px 0 0; font-size: 12px; }

    .auth-page-light .auth-card,
    .auth-page-light .auth-register-card { width: 100%; padding: 18px 18px 16px; border-radius: 14px; }
    .auth-page-light .auth-card-top { margin-bottom: 14px; gap: 12px; align-items: center; }
    .auth-page-light .auth-card h2 { margin-bottom: 3px; font-size: 19px; line-height: 1.25; }
    .auth-page-light .auth-card-top p { font-size: 12px; line-height: 1.4; }
    .auth-mark { flex: 0 0 38px; width: 38px; height: 38px; }
    .auth-page-light .auth-form { gap: 11px; }
    .auth-page-light .auth-form label { gap: 5px; font-size: 12.5px; }
    .auth-page-light .auth-register-form { gap: 9px; column-gap: 10px; }
    .auth-page-light .auth-register-form small { font-size: 10.5px; }
    .auth-page-light .auth-register-form label:nth-of-type(4) small { display: none; }
    .auth-page-light .input-wrap { height: 44px; }
    .auth-page-light .auth-register-form .input-wrap { height: 42px; }
    /* 16px stops iOS Safari from zooming in when an input is focused */
    .auth-page-light .auth-form input:not([type=checkbox]) { font-size: 16px; min-width: 0; }
    .auth-primary { height: 46px; font-size: 15px; }
    .auth-row { row-gap: 6px; }
    .auth-page-light .auth-form label.terms { display: block !important; font-size: 12px !important; line-height: 1.5; }
    .auth-page-light .auth-form label.terms input[type="checkbox"] { display: inline-block; vertical-align: -3px; margin: 0 7px 0 0 !important; }
    .auth-page-light .auth-card-bottom { margin-top: 12px; padding-top: 12px; font-size: 13px; }
}
@media (max-width: 500px) {
    .auth-page-light .auth-register-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .auth-page-light .auth-register-form .wide { grid-column: 1 / -1; }
    .auth-row { flex-direction: column-reverse; align-items: flex-start; }
}
/* Shorter phones: trim the hero further so everything still fits on one screen */
@media (max-width: 800px) and (max-height: 760px) {
    .auth-layout { gap: 10px; }
    .auth-page-light .auth-hero h1 { font-size: 21px; }
    .auth-page-light .hero-copy { display: none; }
    .auth-page-light .auth-register-form .input-wrap { height: 40px; }
    .auth-page-light .auth-register-form small { display: none; }
    .auth-page-light .auth-register-card .auth-card-top p { display: none; }
    .auth-page-light .auth-register-card .auth-card-top { margin-bottom: 10px; }
}
@media (max-width: 800px) and (max-height: 680px) {
    .auth-page-light .auth-card-top p { display: none; }
    .auth-page-light .auth-card-top { margin-bottom: 10px; }
    .hero-perks { padding: 8px; gap: 6px; }
    .auth-page-light .auth-register-hero .hero-inline-stats { display: none; }
    .auth-page-light .auth-register-form { gap: 7px; }
    .auth-page-light .auth-register-form .input-wrap { height: 38px; }
    .auth-primary { height: 42px; }
}
@media (max-width: 359px) {
    .auth-layout { width: calc(100% - 20px); }
    .auth-page-light .auth-card,
    .auth-page-light .auth-register-card { padding: 16px 14px; }
    .hero-perks span { font-size: 11px; }
}

/* ---------- My Account ---------- */
.acct { max-width: 980px; display: grid; gap: 16px; }
.acct > .card { margin: 0; }
.acct-profile { display: flex; align-items: center; gap: 16px; padding: 18px 20px; flex-wrap: wrap; }
.acct-avatar { flex: 0 0 56px; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 20px; color: #fff; background: linear-gradient(135deg, #6366F1, #3B82F6); }
.acct-who { flex: 1 1 200px; min-width: 0; }
.acct-name { font-size: 18px; font-weight: 800; }
.acct-email { color: var(--text-muted); font-size: 13px; overflow-wrap: anywhere; }
.acct-facts { display: flex; gap: 10px; flex-wrap: wrap; }
.acct-facts > div { padding: 8px 12px; border: 1px solid var(--border-color); border-radius: 10px; display: grid; min-width: 130px; }
.acct-facts span { font-size: 11px; color: var(--text-muted); } .acct-facts b { font-size: 14px; }
.acct-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.acct-grid > .card { margin: 0; }
.acct-note { margin: 10px 0 0; }
.acct-danger { margin: 0; border-color: rgba(239, 68, 68, .35); }
.acct-danger > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 4px 12px; flex-wrap: wrap; padding: 14px 20px; }
.acct-danger > summary::-webkit-details-marker { display: none; }
.acct-danger > summary > span { color: #ef4444; font-weight: 700; }
.acct-danger > summary > small { color: var(--text-muted); flex: 1; }
.acct-chev { color: var(--text-muted); transition: transform .2s; }
.acct-danger[open] .acct-chev { transform: rotate(180deg); }
.acct-danger[open] > summary { border-bottom: 1px solid var(--border-color); }
@media (max-width: 760px) { .acct-grid { grid-template-columns: 1fr; } .acct-facts { width: 100%; } .acct-facts > div { flex: 1; } .acct-danger > summary > span { flex: 1; } .acct-danger > summary > small { order: 3; flex-basis: 100%; } }

/* ---------- Subscription: clearer current plan and plan cards ---------- */
.sub-kicker { text-transform: uppercase; letter-spacing: .5px; font-weight: 700; margin-bottom: 2px; }
.sub-time { display: grid; gap: 6px; }
.sub-time-row { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.sub-hero-cta a.text-xs { color: var(--primary); text-decoration: none; }
.sub-ribbon-cur { background: #16a34a; }
.sub-plan.is-current.is-popular { border-color: #22c55e; box-shadow: 0 0 0 1px #22c55e, 0 10px 30px rgba(34, 197, 94, .12); }
.sub-notinc { margin: 0; font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.sub-notinc b { font-weight: 600; }
.sub-plan h3 { padding-right: 110px; }
@media (max-width: 760px) { .sub-hero-cta { width: 100%; align-items: stretch; text-align: center; } }
.sub-plans-close { display: flex; justify-content: center; margin: 14px 0 6px; }
.sub-hero-cta .btn-outline { width: 100%; justify-content: center; }
.sub-inv-actions { display: inline-flex; gap: 6px; align-items: flex-start; flex-wrap: wrap; justify-content: flex-end; }
.sub-inv-mail { position: relative; }
.sub-inv-mail > summary { list-style: none; cursor: pointer; }
.sub-inv-mail > summary::-webkit-details-marker { display: none; }
.sub-inv-mail[open] { flex-basis: 100%; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.sub-inv-form { display: flex; gap: 6px; width: min(320px, 100%); }
.sub-inv-form .form-control { flex: 1; min-width: 0; height: 34px; }
@media (max-width: 760px) { .sub-inv-actions { justify-content: flex-start; } .sub-inv-mail[open] { align-items: stretch; } .sub-inv-form { width: 100%; } }

/* ---------- Day Book on phones: one card per voucher, lines with Dr / Cr amounts ---------- */
@media (max-width: 760px) {
    .table-responsive:has(> table.daybook) { overflow: visible; }
    table.daybook, table.daybook > tbody, table.daybook > tfoot { display: block; width: 100%; min-width: 0 !important; }
    table.daybook > thead { display: none; }
    table.daybook tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
    table.daybook td, table.daybook th { display: block; padding: 0 !important; border: 0 !important; white-space: normal !important; min-width: 0; }
    table.daybook tr.db-head { margin-top: 10px; padding: 12px 14px 8px; border-top: 1px solid var(--border-color); background: rgba(255, 255, 255, .025); }
    table.daybook > tbody > tr.db-head:first-child { margin-top: 0; border-top: 0; }
    /* Date, then voucher, then type, then narration — one below the other */
    table.daybook tr.db-head { flex-direction: column; align-items: flex-start; gap: 4px; }
    table.daybook tr.db-head > td { width: 100%; }
    table.daybook tr.db-head > td:nth-child(1) { font-weight: 700; font-size: 13.5px; }
    table.daybook tr.db-head > td:nth-child(2) { font-size: 14px; }
    table.daybook tr.db-head > td:nth-child(3) { width: auto; }
    table.daybook tr.db-head > td:nth-child(4) { font-size: 12px; line-height: 1.45; }
    table.daybook tr.db-line { padding: 5px 14px; font-size: 13px; flex-wrap: nowrap; }
    table.daybook tr.db-line > td:nth-child(-n+3) { display: none; }
    table.daybook tr.db-line > td:nth-child(4) { flex: 1; min-width: 0; overflow-wrap: anywhere; }
    table.daybook tr.db-line > td:nth-child(4) .pl-4 { padding-left: 14px; }
    table.daybook tr.db-line > td:nth-child(n+5) { text-align: right !important; white-space: nowrap !important; }
    table.daybook tr.db-line > td:nth-child(n+5):empty { display: none; }
    table.daybook tr.db-line > td:nth-child(5)::before, table.daybook tfoot th:nth-child(2)::before { content: 'Dr '; color: var(--text-muted); font-size: 11px; }
    table.daybook tr.db-line > td:nth-child(6)::before, table.daybook tfoot th:nth-child(3)::before { content: 'Cr '; color: var(--text-muted); font-size: 11px; }
    table.daybook tr.db-line + tr.db-head { margin-top: 12px; }
    table.daybook > tbody > tr:last-child { padding-bottom: 10px; }
    table.daybook tfoot tr { padding: 12px 14px; border-top: 2px solid var(--border-color); gap: 4px 14px; font-size: 14px; }
    table.daybook tfoot th:first-child { flex-basis: 100%; text-align: left !important; }
    table.daybook tfoot th:nth-child(n+2) { flex: 1; text-align: left !important; }
}
@media (max-width: 760px) {
    table.daybook td, table.daybook th { background: transparent !important; }
    table.daybook tfoot th:nth-child(n+2) { font-size: 14px; font-weight: 700; color: var(--text-primary); }
    /* Wide reports that scroll sideways (Stock Summary …): the first column stays in view */
    table.eb-scroll-table > tbody > tr > td:first-child, table.eb-scroll-table > thead > tr:first-child > th:first-child, table.eb-scroll-table > tfoot > tr > *:first-child {
        position: sticky; left: 0; z-index: 1; background: var(--bg-card); box-shadow: 6px 0 8px -6px rgba(0, 0, 0, .45); max-width: 130px;
    }
}

/* ---------- Notifications: bell, list page, settings ---------- */
.notif-menu { position: relative; }
.tb-bell { position: relative; width: 38px; height: 38px; font-size: 17px; }
.tb-bell-badge { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: #ef4444; color: #fff; font: 700 10.5px/18px var(--font-sans); text-align: center; box-shadow: 0 0 0 2px var(--bg-card); }
.notif-menu-list { width: min(360px, calc(100vw - 16px)); padding: 0; overflow: hidden; }
.nm-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border-color); }
.nm-head form { margin: 0; } .nm-head .link-btn { font-size: 12px; color: var(--primary); }
.nm-item { display: grid; gap: 2px; padding: 10px 14px; border-bottom: 1px solid var(--border-color); text-decoration: none; color: var(--text-primary); }
.nm-item:hover { background: rgba(59, 130, 246, .07); }
.nm-item.is-unread { box-shadow: inset 3px 0 0 var(--primary); background: rgba(59, 130, 246, .05); }
.nm-item b { font-size: 13px; } .nm-item small { color: var(--text-muted); font-size: 12px; line-height: 1.4; } .nm-item em { color: var(--text-muted); font-size: 11px; font-style: normal; }
.nm-empty { padding: 22px 14px; text-align: center; color: var(--text-muted); font-size: 13px; }
.nm-foot { display: flex; justify-content: space-between; padding: 10px 14px; font-size: 13px; }
.nm-foot a { color: var(--primary); text-decoration: none; font-weight: 600; }
.notif-tabs { display: flex; gap: 6px; margin: 0 0 12px; }
.notif-tabs a { padding: 6px 14px; border-radius: 99px; border: 1px solid var(--border-color); color: var(--text-muted); text-decoration: none; font-size: 13px; font-weight: 600; }
.notif-tabs a.is-on { background: var(--primary); border-color: var(--primary); color: #fff; }
.notif-list { overflow: hidden; }
.notif-row { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-bottom: 1px solid var(--border-color); text-decoration: none; color: var(--text-primary); }
.notif-row:last-child { border-bottom: 0; }
.notif-row:hover { background: rgba(59, 130, 246, .06); }
.notif-row.is-unread { background: rgba(59, 130, 246, .05); }
.notif-ico { flex: 0 0 36px; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: rgba(127, 127, 127, .12); }
.notif-text { flex: 1; min-width: 0; display: grid; gap: 3px; }
.notif-text b { font-size: 14px; } .notif-text small { color: var(--text-muted); font-size: 12.5px; line-height: 1.45; overflow-wrap: anywhere; } .notif-text em { color: var(--text-muted); font-size: 11.5px; font-style: normal; }
.notif-dot { flex: 0 0 9px; width: 9px; height: 9px; margin-top: 6px; border-radius: 50%; background: var(--primary); }
.notif-pager { display: flex; justify-content: center; gap: 10px; margin: 14px 0; }
.push-head { display: flex; gap: 12px; align-items: center; }
.push-head b { display: block; } .push-head small { display: block; margin-top: 2px; }
.push-ico { flex: 0 0 42px; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 18px; color: var(--primary); background: rgba(59, 130, 246, .14); }
.push-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; } .push-actions form { margin: 0; }
.notif-prefs td small { display: block; margin-top: 2px; font-size: 12px; }
.notif-prefs .np-group td { background: rgba(127, 127, 127, .08); font-size: 11.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--text-muted); padding-top: 8px; padding-bottom: 8px; }
.np-check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.np-check input { width: 18px; height: 18px; accent-color: var(--primary); }
.np-check span { display: none; font-size: 12px; color: var(--text-muted); }
@media (max-width: 760px) {
    .notif-prefs thead { display: none; }
    .notif-prefs tr:not(.np-group) { display: grid; grid-template-columns: 1fr auto auto; gap: 6px 14px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--border-color); }
    .notif-prefs tr:not(.np-group) td { padding: 0 !important; border: 0 !important; }
    .notif-prefs .np-group { display: block; } .notif-prefs .np-group td { display: block; }
    .np-check span { display: inline; }
}
@media (max-width: 760px) {
    .notif-menu-list { position: fixed; top: 58px; left: 8px; right: 8px; width: auto; max-height: calc(100dvh - 140px); overflow-y: auto; }
}
.np-own { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.np-own input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--primary); flex: 0 0 18px; }
.np-own b { display: block; } .np-own small { display: block; margin-top: 2px; }

/* Superadmin → Announcements */
.sa-bc-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.sa-bc-grid > .card { margin: 0; }
.bc-channels { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 6px; }
.bc-preview { display: grid; gap: 4px; padding: 14px; border-radius: 14px; background: rgba(127, 127, 127, .1); border: 1px solid var(--border-color); }
.bc-preview b { font-size: 14px; overflow-wrap: anywhere; } .bc-preview small { color: var(--text-muted); font-size: 12.5px; line-height: 1.45; overflow-wrap: anywhere; white-space: pre-line; }
.bc-pv-app { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; font-weight: 700; }
.bc-coupon { font-family: var(--font-mono); font-size: 12px; color: var(--primary); }
@media (max-width: 900px) { .sa-bc-grid { grid-template-columns: 1fr; } }

/* ---- Notification pop-ups (top-right; full width on phones) ---- */
.eb-toasts { position: fixed; top: 78px; right: 18px; z-index: 3000; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.eb-toast { pointer-events: auto; display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; padding: 12px 12px 12px 14px; border-radius: 12px; background: var(--bg-card); border: 1px solid var(--border-color); border-left: 3px solid var(--primary); box-shadow: 0 14px 40px rgba(0, 0, 0, .35); color: var(--text-primary); text-decoration: none; transform: translateX(calc(100% + 30px)); opacity: 0; transition: transform .3s cubic-bezier(.2, .9, .3, 1.2), opacity .3s; }
.eb-toast.is-in { transform: none; opacity: 1; }
.eb-toast.is-out { transform: translateX(calc(100% + 30px)); opacity: 0; }
.eb-toast:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.eb-toast-ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(59, 130, 246, .15); color: var(--primary); animation: eb-ring .9s ease 1; }
.eb-toast-tx { display: grid; gap: 3px; min-width: 0; }
.eb-toast-tx b { font-size: .9rem; line-height: 1.3; }
.eb-toast-tx small { color: var(--text-secondary); font-size: .8rem; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.eb-toast-x { background: none; border: 0; color: var(--text-muted); font-size: 1.3rem; line-height: 1; padding: 0 4px; cursor: pointer; }
.eb-toast-x:hover { color: var(--text-primary); }
@keyframes eb-ring { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-18deg); } 40% { transform: rotate(14deg); } 60% { transform: rotate(-8deg); } 80% { transform: rotate(4deg); } }
.np-local { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; margin-top: 12px; }
@media (max-width: 640px) {
    .eb-toasts { top: auto; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); right: 16px; left: 16px; width: auto; }
    .eb-toast, .eb-toast.is-out { transform: translateY(calc(100% + 90px)); }
    .eb-toast.is-in { transform: none; }
}
@media (prefers-reduced-motion: reduce) { .eb-toast, .eb-toast.is-out { transition: opacity .2s; transform: none; } .eb-toast-ic { animation: none; } }

/* In-app navigation: the new menu takes the old one's place without animating */
.sidebar.tm-no-anim, .sidebar.tm-no-anim * { transition: none !important; animation: none !important; }

/* ---- Searchable dropdowns (select-search.js) ---- */
.eb-sel { position: relative; max-width: 100%; vertical-align: middle; }
.eb-sel-hit { position: absolute; inset: 0; z-index: 1; cursor: pointer; }
.eb-sel:has(select:disabled) .eb-sel-hit { cursor: not-allowed; }
.eb-sel.is-open > select { border-color: var(--border-color-focus); box-shadow: 0 0 0 3px rgba(59, 130, 246, .15); }
form .data-table td > .eb-sel, .summary-line > .eb-sel { display: block; width: 100%; }
.summary-line > .eb-sel { flex: 0 0 auto; width: min(220px, 60%); }
.summary-line > .eb-sel > select.form-control { width: 100% !important; }
@media (max-width: 760px) {
    .content-body form [style*="display: flex"] > .eb-sel, .content-body form [style*="display:flex"] > .eb-sel { flex: 1 1 58%; min-width: 0; }
    .content-body .summary-line > .eb-sel { flex: 0 1 55%; width: auto; }
}
.eb-sel-panel { position: fixed; z-index: 4000; display: none; flex-direction: column; min-height: 0; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; box-shadow: 0 18px 50px rgba(0, 0, 0, .35); overflow: hidden; }
.eb-sel-panel.is-open { display: flex; }
.eb-sel-panel:focus { outline: none; }
.eb-sel-search { display: none; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--border-color); color: var(--text-muted); }
.eb-sel-panel.has-search .eb-sel-search { display: flex; }
.eb-sel-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text-primary); font: inherit; font-size: 14px; padding: 4px 0; }
.eb-sel-search input::-webkit-search-cancel-button { cursor: pointer; }
.eb-sel-list { list-style: none; margin: 0; padding: 4px; overflow-y: auto; overscroll-behavior: contain; flex: 1; min-height: 0; }
.eb-sel-list li { padding: 8px 10px; border-radius: 8px; font-size: 13.5px; line-height: 1.35; color: var(--text-primary); cursor: pointer; word-break: break-word; }
.eb-sel-list li.is-active { background: rgba(59, 130, 246, .14); }
.eb-sel-list li.is-selected { font-weight: 700; color: var(--primary); }
.eb-sel-list li.is-selected::after { content: '\2713'; float: right; margin-left: 8px; }
.eb-sel-list li.is-placeholder { color: var(--text-muted); }
.eb-sel-list li.is-disabled { opacity: .45; cursor: not-allowed; }
.eb-sel-list li.eb-sel-group { padding: 10px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--text-muted); cursor: default; }
.eb-sel-list li.eb-sel-empty { color: var(--text-muted); cursor: default; text-align: center; padding: 14px 10px; }
.eb-sel-panel.is-sheet { left: 0 !important; right: 0; bottom: 0 !important; top: auto !important; width: auto !important; max-height: 70vh !important; border-radius: 16px 16px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
.eb-sel-panel.is-sheet .eb-sel-list li { padding: 12px 12px; font-size: 15px; }
.eb-sel-panel.is-sheet .eb-sel-search input { font-size: 16px; }   /* no zoom on iPhone */

/* ---- Menu animations ---- */
.tm-rail-btn::before { content: ''; position: absolute; left: -6px; top: 12px; bottom: 12px; width: 4px; border-radius: 0 4px 4px 0; background: var(--primary); transform: scaleY(0); opacity: 0; transition: transform .25s cubic-bezier(.2, .9, .3, 1.3), opacity .2s; }
.tm-rail-btn.is-active::before, .tm-rail-btn.is-open::before { transform: scaleY(1); opacity: 1; }
.tm-rail-btn.is-open i { animation: tm-pop .4s cubic-bezier(.2, .9, .3, 1.4); }
.tm-rail-btn:active i { transform: scale(.88); }
@keyframes tm-pop { 0% { transform: scale(1); } 40% { transform: scale(1.22) rotate(-6deg); } 100% { transform: scale(1); } }
.tm-item i { transition: background .15s, color .15s, transform .2s; }
.tm-item:hover i { transform: translateX(2px) scale(1.06); }
.tm-panel-group.tm-enter .tm-panel-head { animation: tm-fade .25s ease both; }
.tm-panel-group.tm-enter .tm-items > li { animation: tm-slide .32s cubic-bezier(.2, .8, .2, 1) both; }
.tm-panel-group.tm-enter .tm-items > li:nth-child(2) { animation-delay: .03s; } .tm-panel-group.tm-enter .tm-items > li:nth-child(3) { animation-delay: .06s; }
.tm-panel-group.tm-enter .tm-items > li:nth-child(4) { animation-delay: .09s; } .tm-panel-group.tm-enter .tm-items > li:nth-child(5) { animation-delay: .12s; }
.tm-panel-group.tm-enter .tm-items > li:nth-child(6) { animation-delay: .15s; } .tm-panel-group.tm-enter .tm-items > li:nth-child(7) { animation-delay: .18s; }
.tm-panel-group.tm-enter .tm-items > li:nth-child(8) { animation-delay: .21s; } .tm-panel-group.tm-enter .tm-items > li:nth-child(n+9) { animation-delay: .24s; }
@keyframes tm-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes tm-slide { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
#sidebarToggle i { transition: transform .3s cubic-bezier(.2, .9, .3, 1.2); }
body.sidebar-collapsed #sidebarToggle i { transform: rotate(90deg); }
@media (max-width: 1100px) { body.sidebar-collapsed #sidebarToggle i { transform: none; } body.sidebar-open #sidebarToggle i { transform: rotate(90deg); } }
@media (prefers-reduced-motion: reduce) { .tm-rail-btn.is-open i, .tm-panel-group.tm-enter .tm-panel-head, .tm-panel-group.tm-enter .tm-items > li { animation: none; } }

/* ---- Dashboard: quick actions → money position → performance → activity ---- */
.dash-quick { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 6px; margin-bottom: 22px; scrollbar-width: thin; }
.dash-quick a { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 9px; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--border-color); background: var(--bg-card); color: var(--text-primary); text-decoration: none; font-weight: 600; font-size: 13.5px; transition: transform .15s, border-color .15s, background .15s; }
.dash-quick a i { font-size: 15px; }
.dash-quick a:hover { transform: translateY(-2px); border-color: var(--primary); background: var(--bg-card-hover); }
.dash-section { margin: 0 0 12px; font-size: 12px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--text-muted); }
.kpi-grid.dash-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 26px; }
a.kpi-card { color: inherit; text-decoration: none; }
a.kpi-card:hover { border-color: var(--primary); }
.kpi-card .kpi-title { text-transform: uppercase; }
.dash-pl { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--text-secondary); }
.dash-main { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 20px; align-items: stretch; }
.dash-main > .card { min-width: 0; margin: 0; }
.dash-main .insight-mom-grid { grid-template-columns: 1fr !important; gap: 10px; }
.dash-main .insight-mom .card-header { flex-direction: column; align-items: flex-start; gap: 2px; }
@media (max-width: 1200px) { .kpi-grid.dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1000px) { .dash-main { grid-template-columns: 1fr; } .dash-main .insight-mom-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important; } }
@media (max-width: 520px) { .kpi-grid.dash-kpis { grid-template-columns: 1fr 1fr; gap: 10px; } .kpi-grid.dash-kpis .kpi-value { font-size: 1.15rem; } .dash-quick a { padding: 9px 12px; } }
.dash-main > .card { display: flex; flex-direction: column; }
.dash-main > .card > .card-body { flex: 1; display: flex; flex-direction: column; }
.dash-main .chart-container { flex: 1; min-height: 300px; }
.dash-main .insight-metric { padding: 10px 14px; gap: 2px; }
.dash-main .insight-metric > .text-xs { display: none; }
.dash-main .insight-value { font-size: 20px; }

/* ---- Attach files while creating a document ---- */
.attach-drop.is-over { border-color: var(--primary); background: rgba(59, 130, 246, .08); }
.attach-picked { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.attach-picked li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border-color); border-radius: 10px; font-size: 13px; }
.attach-picked li > i { color: var(--primary); }
.attach-picked li.is-bad { border-color: var(--danger); }
.attach-picked li.is-bad small { color: var(--danger); }
.attach-picked-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-picked small { color: var(--text-muted); white-space: nowrap; }

/* ---- Superadmin: delete a suspended company ---- */
.sa-delete-card { border-color: rgba(239, 68, 68, .45); }
.sa-delete-list { margin: 8px 0 10px 18px; padding: 0; font-size: 13.5px; line-height: 1.6; color: var(--text-secondary); }
.sa-delete-actions { display: grid; gap: 14px; margin-top: 12px; }
.sa-delete-row { display: flex; gap: 10px; flex-wrap: wrap; }
.sa-delete-row .form-control { flex: 1 1 260px; }

/* ==========================================================================
   Action menus — one "Share" and one "Print" button on every page (views/partials/action-menu.php)
   Laptop / tablet: a menu under the button. Phone: a sheet from the bottom.
   ========================================================================== */
.act-menu { position: relative; display: inline-flex; }
.act-menu-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.act-menu-btn .act-caret { font-size: 10px; opacity: .8; transition: transform .2s ease; }
.act-menu-btn[aria-expanded="true"] .act-caret { transform: rotate(180deg); }
.act-menu-list { right: 0; left: auto; min-width: 290px; padding: 6px; }
.act-menu-list.act-left { left: 0; right: auto; }
.act-menu-list.act-up { top: auto; bottom: calc(100% + 8px); }
.act-sheet-head { display: none; }
.act-item { width: 100%; gap: 12px; padding: 8px 10px; border: 0; background: none; color: var(--text-primary); font: inherit; text-align: left; cursor: pointer; }
.act-item:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.act-ic { flex: 0 0 34px; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; font-size: 15px; background: rgba(59, 130, 246, .13); color: #60A5FA; }
.act-tx { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.act-tx b { font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.act-tx small { max-width: 230px; font-size: 11.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-native { display: none !important; }
html.can-share .act-native { display: flex !important; }
.act-ic.ic-wa { background: rgba(34, 197, 94, .14); color: #22C55E; }
.act-ic.ic-share { background: rgba(99, 102, 241, .16); color: #818CF8; }
.act-ic.ic-mail { background: rgba(59, 130, 246, .14); color: #60A5FA; }
.act-ic.ic-link { background: rgba(6, 182, 212, .14); color: #22D3EE; }
.act-ic.ic-pdf { background: rgba(239, 68, 68, .13); color: #F87171; }
.act-ic.ic-print { background: rgba(148, 163, 184, .16); color: #CBD5E1; }
.act-ic.ic-csv { background: rgba(16, 185, 129, .14); color: #34D399; }
[data-theme="light"] .act-ic.ic-print { color: #475569; }
[data-theme="light"] .act-ic.ic-wa { color: #16A34A; }
[data-theme="light"] .act-ic.ic-link { color: #0891B2; }
[data-theme="light"] .act-ic.ic-csv { color: #059669; }
[data-theme="light"] .act-item:hover { background: rgba(15, 23, 42, .05); }
.card:has(.act-menu) { overflow: visible; }
.act-backdrop { position: fixed; inset: 0; z-index: 1300; background: rgba(2, 6, 23, .55); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.act-backdrop.show { opacity: 1; pointer-events: auto; }
.act-toast { z-index: 3100; }
@media print { .act-menu, .bottom-nav, .bn-sheet, .act-backdrop { display: none !important; } }

/* Shared look of the phone sheets (action menus + bottom-navigation sheets) */
@media (max-width: 760px) {
    html.sheet-open, html.sheet-open body { overflow: hidden; }
    .act-menu-list {
        position: fixed; top: auto; left: 0; right: 0; bottom: 0; z-index: 1310;
        display: block; visibility: hidden; transform: translateY(105%);
        width: auto; min-width: 0; max-width: none; max-height: 82dvh; overflow-y: auto; overscroll-behavior: contain;
        padding: 0 10px calc(12px + env(safe-area-inset-bottom, 0px)); border-radius: 18px 18px 0 0; border-bottom: 0;
        box-shadow: 0 -14px 40px rgba(0, 0, 0, .45); transition: transform .24s ease, visibility .24s;
    }
    .act-menu-list.show { visibility: visible; transform: none; }
    .act-menu-list.act-up { bottom: 0; }
    .act-sheet-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 10px; margin: 0 -10px 6px; padding: 20px 14px 10px; background: var(--bg-card); border-bottom: 1px solid var(--border-color); }
    .act-sheet-head b { flex: 1; min-width: 0; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .act-grab { position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--border-color); }
    .act-close { flex: none; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: var(--tm-hover, rgba(255,255,255,.06)); color: var(--text-primary); font-size: 15px; cursor: pointer; }
    .act-item { min-height: 58px; padding: 10px 8px; border-radius: 12px; }
    .act-ic { flex-basis: 42px; width: 42px; height: 42px; border-radius: 12px; font-size: 17px; }
    .act-tx b { font-size: 15px; }
    .act-tx small { max-width: none; font-size: 12.5px; white-space: normal; }
}

/* ==========================================================================
   Page header buttons. Tablets: compact and wrapping.
   Phones: ONE compact row — main action · Share · Print · ⋯ (the rest moves into "⋯", js/app.js "page-actions overflow")
   ========================================================================== */
.pa-more { display: none; }
/* Back button ("← All invoices"): only the arrow, first in the row, on every screen */
.page-actions > .pa-back { order: -1; flex: 0 0 auto; width: 40px; min-width: 40px; height: 40px; padding: 0 !important; justify-content: center; gap: 0; }
.page-actions > .pa-back i { margin: 0 !important; font-size: 15px; }
@media (max-width: 1100px) { .page-actions > .pa-back { width: 36px; min-width: 36px; height: 36px; min-height: 36px; } }
@media (max-width: 1100px) {
    .page-actions { flex-wrap: wrap; gap: 8px; }
    .page-actions .btn, .page-actions .act-menu-btn { min-height: 36px; padding: 7px 12px; font-size: 13px; }
}
@media (min-width: 761px) and (max-width: 1100px) {
    .content-body { padding: 18px 18px 24px; }
    .page-header { align-items: flex-start; }
    .page-header > div:first-child { flex: 1 1 320px; min-width: 0; }
    .page-actions { justify-content: flex-end; }
}
@media (max-width: 760px) {
    .page-header { flex-direction: column; align-items: stretch; gap: 10px; margin-bottom: 12px; }
    .page-actions { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
    .page-actions > :not(dialog):not(script):not(style) { flex: 1 1 0; min-width: 0; }
    .page-actions > .pa-overflow { display: none !important; }
    .page-actions > .btn, .page-actions > a, .page-actions > button, .page-actions > form > .btn, .page-actions .act-menu-btn, .page-actions .dropdown > .btn {
        height: 40px; min-height: 40px; padding: 0 12px; justify-content: center; gap: 7px;
        font-size: 13.5px; white-space: nowrap; overflow: hidden; border-radius: 10px;
    }
    .page-actions > form { display: flex; }
    .page-actions > form > .btn { flex: 1 1 auto; }
    .page-actions > .pa-primary { order: 0; flex: 1 1 0; }
    .page-actions > .act-menu, .page-actions > .dropdown { order: 1; display: flex; flex: 1 1 0; }
    .page-actions > .act-menu > .act-menu-btn { flex: 1 1 auto; }
    .page-actions .act-caret { display: none; }
    .page-actions > .pa-more { order: 2; display: flex; flex: 0 0 40px; }
    .page-actions > .pa-more > .act-menu-btn { width: 40px; padding: 0; }
    .page-actions > .badge { order: 5; flex: 1 1 100%; justify-content: center; }
    .page-actions > .pa-back { order: -1; flex: 0 0 40px; width: 40px; min-width: 40px; height: 40px; }
    /* with a main action, Share and Print shrink to icon buttons so everything fits on one line */
    .page-actions:has(> .pa-primary) > .act-menu:not(.pa-more) { flex: 0 0 40px; }
    .page-actions:has(> .pa-primary) > .act-menu:not(.pa-more) > .act-menu-btn { width: 40px; padding: 0; }
    .page-actions:has(> .pa-primary) > .act-menu:not(.pa-more) > .act-menu-btn > span { display: none; }
    .page-actions:has(> .pa-primary) > .act-menu > .act-menu-btn > i:first-child { font-size: 15px; }
    /* report toolbars: Show · Share · Print in one row */
    .filter-buttons { display: flex; flex-wrap: nowrap; gap: 8px; width: 100%; }
    .filter-buttons > * { flex: 1 1 0; min-width: 0; }
    .filter-buttons > .act-menu > .act-menu-btn { flex: 1 1 auto; }
    .filter-buttons .btn, .filter-buttons .act-menu-btn { height: 40px; min-height: 40px; padding: 0 10px; justify-content: center; font-size: 13.5px; white-space: nowrap; }
    .filter-buttons .act-caret { display: none; }
}

/* ==========================================================================
   Bottom navigation (phones): Home · Sales · + New · Reports · More
   It replaces the footer bar; the footer's plan status and help bot move into "More".
   ========================================================================== */
.bottom-nav, .bn-sheet, .bn-backdrop { display: none; }
@media (max-width: 760px) {
    :root { --bn-h: 62px; }
    .main-footer.app-footer { display: none !important; }
    .main-wrapper { padding-bottom: calc(var(--bn-h) + env(safe-area-inset-bottom, 0px) + 14px); }
    .bottom-nav {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 950;
        display: flex; align-items: stretch; height: calc(var(--bn-h) + env(safe-area-inset-bottom, 0px));
        padding: 0 4px env(safe-area-inset-bottom, 0px);
        background: var(--bg-topbar); border-top: 1px solid var(--border-color); box-shadow: 0 -6px 20px rgba(0, 0, 0, .22);
    }
    .bn-item {
        position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
        border: 0; background: none; color: var(--text-muted); font: 600 10.5px var(--font-sans); letter-spacing: .2px; text-decoration: none;
        cursor: pointer; -webkit-tap-highlight-color: transparent; transition: color .15s ease;
    }
    .bn-item > i { font-size: 19px; transition: transform .15s ease; }
    .bn-item:active > i { transform: scale(.9); }
    .bn-item.is-active, .bn-item[aria-expanded="true"] { color: #60A5FA; }
    .bn-item.is-active::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: currentColor; }
    [data-theme="light"] .bn-item.is-active, [data-theme="light"] .bn-item[aria-expanded="true"] { color: #2563EB; }
    .bn-new-ic {
        width: 50px; height: 50px; margin-top: -24px; display: inline-flex; align-items: center; justify-content: center; border-radius: 16px;
        background: linear-gradient(135deg, #3B82F6, #2563EB); color: #fff;
        box-shadow: 0 6px 18px rgba(37, 99, 235, .5), 0 0 0 4px var(--bg-topbar); transition: transform .2s ease;
    }
    .bn-new-ic i { font-size: 20px; }
    .bn-new[aria-expanded="true"] .bn-new-ic { transform: rotate(45deg); }
    .bn-new .bn-label { margin-top: -1px; }
    html.kb-open .bottom-nav { display: none; }
    html.kb-open .main-wrapper { padding-bottom: 16px; }

    .bn-sheet {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 1310; display: block;
        max-height: 85dvh; overflow-y: auto; overscroll-behavior: contain;
        padding: 0 12px calc(14px + env(safe-area-inset-bottom, 0px));
        background: var(--bg-card); border: 1px solid var(--border-color); border-bottom: 0; border-radius: 18px 18px 0 0;
        box-shadow: 0 -14px 40px rgba(0, 0, 0, .45); transform: translateY(105%); transition: transform .22s ease;
    }
    .bn-sheet[hidden] { display: none; }
    .bn-sheet.show { transform: none; }
    .bn-sheet .act-sheet-head { margin: 0 -12px 8px; }
    .bn-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
    .bn-tile {
        display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 88px; padding: 12px 6px;
        border: 1px solid var(--border-color); border-radius: 14px; background: rgba(255, 255, 255, .03);
        color: var(--text-primary); font-size: 12px; font-weight: 600; line-height: 1.25; text-align: center; text-decoration: none;
        -webkit-tap-highlight-color: transparent; transition: transform .1s ease, background .15s ease;
    }
    .bn-tile i { font-size: 21px; }
    .bn-tile:active { transform: scale(.96); background: rgba(59, 130, 246, .12); }
    [data-theme="light"] .bn-tile { background: #F8FAFC; }
    .bn-list .act-item { color: var(--text-primary); }

    /* things that sat above the footer bar now sit above the bottom navigation */
    .hb { bottom: calc(var(--bn-h) + env(safe-area-inset-bottom, 0px) + 8px) !important; }
    .phone-toast, .ib-toast { bottom: calc(var(--bn-h) + env(safe-area-inset-bottom, 0px) + 14px); }
    .rf-save { bottom: calc(var(--bn-h) + env(safe-area-inset-bottom, 0px)); }
    html.kb-open .rf-save { bottom: 0; }
}
@media (max-width: 760px) and (prefers-reduced-motion: reduce) {
    .act-menu-list, .bn-sheet, .act-backdrop { transition: none; }
}

/* ==========================================================================
   Top bar menus on phones: open full width under the bar instead of running off the left edge
   ========================================================================== */
@media (max-width: 760px) {
    /* scanner: a small menu under the button (no full-width panel, no sub-lines) */
    .scan-menu-list { position: fixed; top: 58px; left: auto; right: 8px; width: max-content; min-width: 0; max-width: calc(100vw - 16px); padding: 4px; }
    .scan-menu-list .dropdown-item { min-height: 40px; padding: 8px 12px; gap: 10px; align-items: center; }
    .scan-menu-list .dropdown-item > i { margin-top: 0; }
    .scan-menu-list .dropdown-item small { display: none; }
    .scan-menu-list .dropdown-item b { font-size: 13.5px; }
    .user-menu-list { position: fixed; top: 60px; right: 8px; left: auto; width: min(330px, calc(100vw - 16px)); min-width: 0; max-height: calc(100dvh - 80px); overflow-y: auto; }
    .is-installed-app .scan-menu-list, .is-installed-app .user-menu-list, .is-installed-app .notif-menu-list { top: calc(60px + env(safe-area-inset-top, 0px)); }
}
@media (max-width: 360px) {
    .tb-account .tb-company { display: none; }
    .tb-account { padding-left: 3px; }
}

/* Touch screens: comfortable tap targets */
@media (pointer: coarse) {
    .btn-sm { min-height: 36px; }
    .dropdown-item { min-height: 42px; }
}

/* ==========================================================================
   Help bot: small floating button + panel. Phones: the panel is a full-height sheet (no gap under it)
   ========================================================================== */
.hb-fab {
    position: fixed; right: 18px; bottom: calc(var(--ft-h, 54px) + 14px); z-index: 940;
    width: 46px; height: 46px; display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: 50%; background: linear-gradient(135deg, #3B82F6, #6366F1); color: #fff; font-size: 19px; cursor: pointer;
    box-shadow: 0 8px 22px rgba(59, 130, 246, .45); transition: transform .15s ease, box-shadow .15s ease;
}
.hb-fab:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(59, 130, 246, .55); }
.hb-fab:focus-visible { outline: 3px solid rgba(96, 165, 250, .6); outline-offset: 2px; }
.hb-fab[aria-expanded="true"] { display: none; }
@media print { .hb-fab { display: none !important; } }
@media (max-width: 760px) {
    .hb-fab { right: 14px; bottom: calc(var(--bn-h, 62px) + env(safe-area-inset-bottom, 0px) + 14px); width: 44px; height: 44px; font-size: 18px; }
    html.kb-open .hb-fab, html.sheet-open .hb-fab { display: none; }
    .hb {
        top: calc(56px + env(safe-area-inset-top, 0px)); left: 0; right: 0; bottom: 0 !important; width: auto; max-height: none;
        border-radius: 18px 18px 0 0; border-bottom: 0; z-index: 1250;
    }
    .hb-ask { padding: 10px 10px calc(10px + env(safe-area-inset-bottom, 0px)); }
    .hb-ask input { font-size: 16px; }
    .hb-ask button { width: 44px; }
}

/* Dashboard on phones: no header buttons (bottom "+ New" covers them) */
@media (max-width: 760px) {
    .dash-header { margin-bottom: 14px; }
    .dash-header .page-desc { font-size: 12px; }
    .dash-header .page-actions { display: none; }
}

/* ==========================================================================
   List pages on phones: filters fold behind a "Filter" button, compact header
   ========================================================================== */
.fr-btn, .fr-bar { display: none; }
@media (max-width: 760px) {
    .page-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .fr-bar { display: flex; justify-content: flex-end; margin: -4px 0 10px; }
    .fr-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 14px; border-radius: 10px; }
    .page-actions > .fr-btn { order: 1; flex: 0 0 auto; display: inline-flex; }
    .fr-btn[aria-expanded="true"] { border-color: var(--primary); color: var(--primary); }
    .fr-count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--primary); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
    form.fr-form:not(.fr-open) { display: none; }
    form.fr-form { margin-bottom: 12px !important; animation: gs-fade .15s ease-out; }
    form.fr-form .card-body { padding: 12px !important; }
    form.fr-form .filter-row { gap: 10px; }
    form.fr-form .filter-row .form-group { flex: 1 1 calc(50% - 5px); min-width: 0; }
    form.fr-form .filter-row .form-group.grow { flex-basis: 100%; }
    form.fr-form .form-control { height: 40px; }
}

/* Phones: secondary header buttons next to a main one show just their icon; tab rows scroll edge to edge */
@media (max-width: 760px) {
    .content-body { overflow-x: clip; }
    .page-actions > .pa-icon, .page-actions > form:has(> .pa-icon) { flex: 0 0 40px; width: 40px; min-width: 40px; padding: 0 !important; }
    .page-actions .pa-icon .pa-tx { display: none; }
    .page-actions .pa-icon i { margin: 0 !important; font-size: 15px; }
    .page-actions > .pa-icon ~ .pa-primary, .page-actions > .pa-primary { flex: 1 1 0; }
    .filter-tabs { margin: 0 -10px 12px !important; padding: 0 10px 2px; gap: 6px; scroll-padding: 0 10px; scroll-snap-type: x proximity; }
    .filter-tab { scroll-snap-align: start; padding: 6px 12px; font-size: 12.5px; border-radius: 999px; }
}

/* ==========================================================================
   Phone density pass (≤ 760px): smaller cards, numbers and text on every page
   ========================================================================== */
.pos-pay-amt { font-family: var(--font-mono, monospace); }
@media (max-width: 760px) {
    body { font-size: 14px; }
    .content-body { padding: 10px 10px 18px; }
    .page-title { font-size: 18px; letter-spacing: -.3px; }
    .page-title > i:first-child { width: 30px; height: 30px; font-size: 13px; border-radius: 9px; }
    .page-desc { font-size: 12px; margin-top: 1px; }
    .page-header { margin-bottom: 10px; gap: 8px; }

    /* cards */
    .card { margin-bottom: 10px; border-radius: 12px; }
    .card-header { padding: 10px 12px; }
    .card-title { font-size: 14px; }
    .card-body, .card-body.p-3, .card-body.p-4, .card-body.p-5 { padding: 10px 12px !important; }
    .mb-4 { margin-bottom: 10px !important; }
    .dash-section { font-size: 11px; margin: 14px 0 8px; }

    /* KPI / summary tiles: two per row, compact */
    .kpi-grid, .kpi-grid.dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
    .kpi-card { padding: 10px 12px; border-radius: 12px; }
    .kpi-header { margin-bottom: 6px; }
    .kpi-title { font-size: 10px; letter-spacing: .4px; }
    .kpi-icon-box { width: 26px; height: 26px; font-size: 12px; border-radius: 8px; }
    .kpi-value, .kpi-grid.dash-kpis .kpi-value { font-size: 16px; margin-bottom: 3px; }
    .kpi-footer, .kpi-subtext { font-size: 10.5px; line-height: 1.35; }
    .dash-pl { gap: 2px; flex-direction: column; }
    .gstr-summary, .reco-summary, .mv-summary, .import-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
    .gstr-summary > div, .reco-summary > div { padding: 9px 11px; border-radius: 12px; gap: 2px; }
    .gstr-summary span, .reco-summary span, .mv-stat-label { font-size: 9.5px; letter-spacing: .4px; }
    .gstr-summary strong, .reco-summary strong, .mv-stat-value { font-size: 16px; }
    .gstr-summary small, .reco-summary small, .mv-stat-sub { font-size: 10.5px; line-height: 1.3; }
    .mv-stat { padding: 9px 11px; border-radius: 12px; }
    .bank-summary { gap: 8px; }
    .bank-summary > div { min-width: 0; flex: 1 1 calc(50% - 4px); padding: 9px 11px; }
    .bank-summary strong { font-size: 16px; }
    .report-tiles { grid-template-columns: 1fr; gap: 8px; }
    .report-tile { padding: 10px 12px; gap: 10px; }
    .report-tile > i { width: 30px; height: 30px; font-size: 15px; }
    .report-tile small { font-size: 11px; }

    /* lists shown as cards */
    table.eb-cards > tbody > tr, table.eb-cards > tfoot > tr { padding: 10px 12px; gap: 6px 10px; }
    table.eb-cards td, table.eb-cards th { font-size: 13px; }
    table.eb-cards-list .eb-cell-primary { font-size: 14px; }
    table.eb-cards td[data-label]:not([data-label=""])::before { font-size: 9.5px; }
    .badge { font-size: 10.5px; padding: 3px 8px; }

    /* forms and filter boxes */
    .form-group { margin-bottom: 10px; }
    .form-label { font-size: 11.5px; margin-bottom: 4px; }
    .content-body .form-control, .content-body select.form-control { min-height: 40px; padding-top: 7px; padding-bottom: 7px; }
    .filter-row { gap: 8px 10px; }
    .filter-row .form-group { flex: 1 1 calc(50% - 5px); min-width: 0; margin: 0; }
    .filter-row .form-label { font-size: 11px; margin-bottom: 3px; }
    .filter-row .form-control { height: 38px; min-height: 38px; }
    .filter-form { gap: 8px; }
    .search-box .form-control-search { height: 38px; }

    /* ---- POS billing ---- */
    .pos-header .page-desc { display: none; }
    .pos-today { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; width: 100%; }
    .pos-today > span { min-width: 0; padding: 6px 8px; border-radius: 10px; }
    .pos-today small { font-size: 9.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .pos-today b { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .pos-today #posSettingsBtn { grid-column: 1 / -1; height: 34px; justify-content: center; }
    .pos-grid { gap: 10px; }
    .pos-scan { padding: 8px 10px; gap: 8px; flex-wrap: nowrap; }
    .pos-scan > i { display: none; }
    .pos-scan .scan-field { flex: 1 1 auto; max-width: none; }
    .pos-scan .scan-field input { font-size: 16px; padding: 8px 10px; height: 40px; }
    .pos-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 10px; max-height: 300px; min-height: 0; }
    .pos-tile { min-height: 70px; padding: 8px 10px; border-radius: 10px; }
    .pos-tile b { font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .pos-tile small, .pos-tile em { font-size: 10.5px; }
    .pos-tile span { font-size: 13px; }
    .pos-cust { padding: 10px 12px 4px; }
    .pos-cart-wrap { min-height: 0; padding: 0 4px; }
    .pos-cart { font-size: 12.5px; }
    .pos-cart thead { display: none; }
    .pos-cart td { padding: 8px 4px; }
    .pos-cart .pos-price { width: 66px; }
    .pos-qty button { width: 30px; height: 32px; }
    .pos-qty input { width: 36px; height: 32px; }
    .pos-empty { padding: 16px 10px; font-size: 13px; }
    .pos-empty i { font-size: 20px; }
    .pos-totals { padding: 8px 12px; font-size: 12.5px; gap: 3px; }
    .pos-totals input { width: 96px; height: 34px; min-height: 34px; }
    .pos-grand { font-size: 17px; }
    .pos-pay { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding: 0 12px 8px; }
    .pos-mode span { padding: 7px 2px; font-size: 11px; }
    .pos-upi { gap: 10px; padding: 10px; margin: 6px 12px; }
    .pos-upi-qr canvas, .pos-upi-qr img { width: 96px !important; height: 96px !important; }
    .pos-tender { padding: 0 12px 8px; font-size: 12.5px; }
    .pos-tender input { height: 38px; min-height: 38px; }
    /* Pay bar sticks above the bottom navigation, with the bill total on the button */
    .pos-actions { position: sticky; bottom: calc(var(--bn-h, 62px) + env(safe-area-inset-bottom, 0px)); z-index: 5; padding: 8px 10px; gap: 8px; background: var(--bg-card); border-radius: 0 0 12px 12px; box-shadow: 0 -6px 16px rgba(0, 0, 0, .25); }
    html.kb-open .pos-actions { bottom: 0; }
    .pos-actions .btn { height: 44px; min-height: 44px; }
    .pos-actions #posClear { flex: 0 0 auto; padding: 0 12px; }
    .pos-actions .btn-lg { font-size: 14.5px; }
    .pos-actions kbd { display: none; }
    .pos-right { overflow: visible; }
    .pos-done { padding: 20px 16px; }
    .pos-done-icon { font-size: 34px; }
    .pos-done h2 { font-size: 17px; }
    .pos-done-total { font-size: 19px; }
    .pos-done kbd { display: none; }
}
@media (max-width: 760px) { .voucher-stamp-row { gap: 10px !important; flex-wrap: nowrap !important; } .voucher-stamp-row > div { flex: 1 1 0 !important; min-width: 0 !important; width: auto !important; } }
@media (max-width: 360px) {
    .pos-today { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pos-pay { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Offline bar (js/app.js) */
.eb-offline { position: fixed; top: 0; left: 0; right: 0; z-index: 3200; display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: calc(6px + env(safe-area-inset-top, 0px)) 12px 6px; background: #B45309; color: #fff; font-size: 12.5px; font-weight: 600; text-align: center; box-shadow: 0 4px 14px rgba(0,0,0,.3); }
@media print { .eb-offline { display: none !important; } }

/* ==========================================================================
   Compliance & closing pages (views/compliance)
   ========================================================================== */
.cmp-badge { display: inline-block; align-self: flex-start; margin-top: 4px; padding: 2px 8px; border-radius: 999px; font-style: normal; font-size: 11px; font-weight: 700; }
.cmp-badge.is-warn { background: rgba(239, 68, 68, .14); color: #F87171; }
.cmp-badge.is-ok { background: rgba(16, 185, 129, .14); color: #34D399; }
[data-theme="light"] .cmp-badge.is-warn { color: #DC2626; }
[data-theme="light"] .cmp-badge.is-ok { color: #059669; }
.cmp-note { margin: 4px 2px 18px; line-height: 1.5; }
.cmp-bar { width: 100%; min-width: 80px; height: 6px; border-radius: 3px; background: rgba(148, 163, 184, .2); overflow: hidden; margin-bottom: 3px; }
.cmp-bar span { display: block; height: 100%; border-radius: 3px; background: var(--primary); }
.cmp-bar.is-warn span { background: #F59E0B; }
.cmp-bar.is-bad span { background: #EF4444; }
.cmp-inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.cmp-inline .form-group { margin: 0; min-width: 200px; }
details.cmp-add > summary, details.scr-sec > summary { cursor: pointer; list-style: none; }
details.cmp-add > summary::-webkit-details-marker, details.scr-sec > summary::-webkit-details-marker { display: none; }
details.scr-sec:not(.has-rows) { opacity: .8; }
.bud-in { width: 140px !important; max-width: 140px; margin-left: auto; }
tr.bud-over td:first-child { box-shadow: inset 3px 0 0 #EF4444; }
tr.bud-near td:first-child { box-shadow: inset 3px 0 0 #F59E0B; }
.bud-save { position: sticky; bottom: calc(var(--ft-h, 54px) + 8px); z-index: 5; padding: 10px 12px; border: 1px solid var(--border-color); border-radius: 12px; background: var(--bg-card); box-shadow: 0 -6px 16px rgba(0,0,0,.2); }
/* Schedule III */
.s3-table td, .s3-table th { white-space: normal; }
.s3-sec td { font-weight: 800; letter-spacing: .4px; background: rgba(59, 130, 246, .08); }
.s3-grp td { font-weight: 700; color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; padding-top: 12px; }
.s3-total td { font-weight: 800; border-top: 2px solid var(--border-color); }
.s3-profit td { color: var(--primary); }
.s3-det > summary { cursor: pointer; padding-left: 14px; }
.s3-ledgers { margin: 8px 0 4px 14px; display: grid; gap: 4px; }
.s3-led { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(150px, 220px); gap: 10px; align-items: center; font-size: 12.5px; padding: 4px 0; border-bottom: 1px dashed var(--border-color); }
.s3-led > b { font-weight: 600; }
.s3-map { margin: 0; }
.s3-map select { height: 32px; min-height: 32px; font-size: 12px; padding: 4px 8px; }
/* Year-end checklist */
.ye-steps { list-style: none; margin: 0; padding: 6px 0; }
.ye-step { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border-color); }
.ye-step:last-child { border-bottom: 0; }
.ye-ic { flex: 0 0 32px; width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; }
.ye-step.is-ok .ye-ic { background: rgba(16, 185, 129, .15); color: #34D399; }
.ye-step.is-bad .ye-ic { background: rgba(239, 68, 68, .15); color: #F87171; }
.ye-step.is-info .ye-ic { background: rgba(59, 130, 246, .13); color: #60A5FA; }
.ye-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ye-tx small { color: var(--text-muted); font-size: 12px; line-height: 1.4; }
.ye-step form { margin: 0; }
.d-block { display: block; }
@media (max-width: 760px) {
    .s3-table th:nth-child(2), .s3-table td:nth-child(2) { display: none; }
    .s3-table td:first-child { min-width: 170px; }
    .s3-table th, .s3-table td { padding: 8px 8px; font-size: 12.5px; }
    .s3-ledgers { margin-left: 0; }
    .s3-led { grid-template-columns: minmax(0, 1fr); gap: 4px; }
    .s3-led > b { justify-self: start; }
    .ye-step { padding: 10px 12px; gap: 10px; align-items: flex-start; }
    .ye-step .btn, .ye-step form { flex: 0 0 auto; }
    .bud-in { width: 100%; }
    .bud-save { bottom: calc(var(--bn-h, 62px) + env(safe-area-inset-bottom, 0px) + 6px); }
    .cmp-inline .form-group { min-width: 0; flex: 1 1 100%; }
}

/* Signed-out alert (someone signed in to this account elsewhere) */
.so-overlay { position: fixed; inset: 0; z-index: 6000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(2, 6, 23, .7); backdrop-filter: blur(4px); }
.so-modal { width: min(420px, 100%); padding: 26px 22px 22px; border-radius: 18px; background: var(--bg-card); border: 1px solid var(--border-color); color: var(--text-primary); text-align: center; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
.so-ic { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; background: rgba(239, 68, 68, .14); color: #F87171; }
.so-modal h2 { margin: 0 0 8px; font-size: 18px; }
.so-modal p { margin: 0 0 18px; font-size: 14px; line-height: 1.5; color: var(--text-muted); }
.so-go { width: 100%; justify-content: center; min-height: 44px; }
/* Share dialog opened from the Share menu: only the chosen way (no tab row, so WhatsApp / Email are not offered twice) */
.share-dialog.is-single .share-tabs { display: none; }
/* Help-bot button stays clear of sticky bars at the bottom (POS pay bar, budget save bar) */
body:has(.pos-actions) .hb-fab, body:has(.bud-save) .hb-fab { bottom: calc(var(--ft-h, 54px) + 84px); }
@media (max-width: 760px) {
    body:has(.pos-actions) .hb-fab, body:has(.bud-save) .hb-fab { bottom: calc(var(--bn-h, 62px) + env(safe-area-inset-bottom, 0px) + 76px); }
}

