@import url('https://fonts.googleapis.com/css2?family=Hind+Siliguri:wght@400;500;600;700&family=Inter:wght@400;500;600;700;800&display=swap');
:root{--bg:#f5f7fb;--panel:#fff;--text:#172033;--muted:#7b8498;--line:#e8ecf3;--green:#177c57;--green-dark:#116746;--green-soft:#e8f6ef;--blue:#477be0;--amber:#b7791f;--red:#c74646;--shadow:0 8px 24px rgba(24,39,75,.045)}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font-family:'Hind Siliguri','Inter',sans-serif;font-size:14px}a{color:inherit;text-decoration:none}button,input,select,textarea{font:inherit}button{cursor:pointer}.app-shell{min-height:100vh;display:flex}.sidebar{width:248px;background:#102b24;color:#d5e7df;padding:24px 15px 16px;display:flex;flex-direction:column;flex-shrink:0}.brand{display:flex;align-items:center;gap:11px;padding:0 10px 27px;color:#fff}.brand-mark{width:43px;height:43px;border-radius:13px;background:linear-gradient(135deg,#2db47a,#13774e);display:inline-flex;align-items:center;justify-content:center;color:#fff;font-weight:800;font-family:Inter,sans-serif;letter-spacing:-1px;flex-shrink:0}.brand b,.brand small{display:block}.brand b{font-size:16px}.brand small{font-size:11px;color:#9eb9ae}.sidebar nav{display:grid;gap:5px}.sidebar nav a{display:flex;align-items:center;gap:13px;padding:12px 13px;border-radius:10px;color:#b4c9c0;font-size:14px;transition:.15s}.sidebar nav a:hover,.sidebar nav a.active{background:#1d493a;color:#fff}.sidebar nav a.active{box-shadow:inset 3px 0 #48ce8e}.sidebar-bottom{margin-top:auto;border-top:1px solid #315044;padding:18px 5px 0;display:flex;align-items:center;gap:10px}.admin-avatar{width:34px;height:34px;border-radius:50%;background:#e2f6e9;color:#176a47;display:grid;place-items:center;font-weight:700}.sidebar-bottom b,.sidebar-bottom small{display:block}.sidebar-bottom b{font-size:12px;color:#fff}.sidebar-bottom small{font-size:11px;color:#8eaa9e}.logout{margin-left:auto;font-size:21px}.main-area{min-width:0;flex:1;display:flex;flex-direction:column}.topbar{min-height:104px;background:#fff;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;align-items:center;padding:22px 34px;gap:18px}.eyebrow{font:700 10px Inter,sans-serif;letter-spacing:1.4px;color:#8a96a9}.topbar h1{font-size:25px;line-height:1.3;margin:5px 0 0;font-weight:700}.topbar-right{display:flex;align-items:center;gap:18px}.today{font-size:12px;color:var(--muted)}.content{padding:27px 34px 35px;flex:1;max-width:1600px;width:100%;margin:0 auto}.footer{text-align:center;color:#a0a8b7;font-size:11px;padding:15px;border-top:1px solid var(--line)}.btn{border:1px solid transparent;border-radius:9px;padding:10px 15px;display:inline-flex;align-items:center;justify-content:center;gap:7px;font-weight:600;font-size:13px;white-space:nowrap;transition:.15s}.btn.primary{background:var(--green);color:#fff}.btn.primary:hover{background:var(--green-dark)}.btn.secondary{background:#fff;border-color:#dfe5ed;color:#465167}.btn.secondary:hover{border-color:#9caaae;background:#f9fbfa}.btn.ghost{background:#f3f6f8;color:#596477}.btn.small{font-size:11px;padding:6px 9px;border-radius:7px}.btn.large{padding:13px 15px}.btn.full{width:100%}.btn:disabled{opacity:.5;cursor:not-allowed}.muted{color:var(--muted);margin:4px 0}.tiny{font-size:11px}.welcome-row,.section-heading{display:flex;justify-content:space-between;align-items:center;gap:15px;margin-bottom:20px}.welcome-row h2,.section-heading h2{font-size:19px;margin:0 0 3px}.stats-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin:0 0 32px}.stat-card{background:#fff;border:1px solid var(--line);border-radius:14px;padding:19px;box-shadow:var(--shadow);min-width:0}.stat-icon{width:37px;height:37px;border-radius:11px;display:grid;place-items:center;font-weight:700;font-size:19px;margin-bottom:14px}.stat-icon.green{background:#e6f6ed;color:#1a8b5d}.stat-icon.blue{background:#eaf0ff;color:#477be0}.stat-icon.amber{background:#fff3dc;color:#b7791f}.stat-icon.violet{background:#f0eaff;color:#8255c8}.stat-card>span{display:block;color:#6f7a8e;font-size:12px}.stat-card strong{display:block;font:700 clamp(18px,2vw,25px) Inter,sans-serif;letter-spacing:-.8px;margin:8px 0;overflow-wrap:anywhere}.stat-card small{display:block;color:#8a94a6;font-size:11px}.text-link{color:#187a56;font-weight:600}.text-link:hover{text-decoration:underline}.panel{background:#fff;border:1px solid var(--line);border-radius:13px;box-shadow:var(--shadow);min-width:0}.table-panel{overflow:hidden}.table-wrap{width:100%;overflow:auto}table{width:100%;border-collapse:collapse;white-space:nowrap}th{background:#f8fafc;color:#7a8598;text-align:left;font-size:11px;font-weight:600;padding:13px 16px;border-bottom:1px solid var(--line)}td{padding:13px 16px;border-bottom:1px solid #edf0f5;font-size:12px;color:#4a5568}tbody tr:last-child td{border-bottom:0}tbody tr:hover{background:#fbfdfc}td b{color:#202b3d;font-weight:600}.table-sub{display:block;color:#98a0af;font-size:10px;margin-top:3px;white-space:normal}.status{display:inline-flex;border-radius:20px;padding:4px 9px;font-size:10px;font-weight:600}.status.paid{background:#e5f7ec;color:#178151}.status.unpaid{background:#fff0ed;color:#c24a40}.status.partial{background:#fff5df;color:#a76a13}.icon-link{font-size:11px;color:#187a56;font-weight:600}.empty{text-align:center;padding:35px;color:#8b95a6}.two-column{display:grid;grid-template-columns:minmax(280px,.8fr) minmax(0,1.5fr);gap:18px;align-items:start}.form-panel{padding:22px}.panel-title{padding:19px 22px;border-bottom:1px solid var(--line)}.form-panel .panel-title{padding:0 0 20px;margin-bottom:20px}.panel-title h2{margin:0;font-size:16px}.panel-title p{font-size:11px}.count-pill{display:inline-flex;vertical-align:middle;background:#e8f6ef;color:#177c57;border-radius:20px;padding:2px 8px;font:600 11px Inter,sans-serif}.stack{display:grid;gap:15px}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px}.form-grid h3{font-size:13px;margin:5px 0 0;color:#2c394c}.span-2{grid-column:span 2}label{display:grid;gap:7px;color:#4b5669;font-size:12px;font-weight:600}input,select,textarea{width:100%;border:1px solid #dfe5ed;background:#fff;color:#263246;border-radius:8px;padding:10px 11px;outline:none;min-width:0;font-size:12px;font-weight:400}textarea{resize:vertical}input:focus,select:focus,textarea:focus{border-color:#3b9b75;box-shadow:0 0 0 3px rgba(35,150,100,.1)}.actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.actions form{margin:0}.filter-panel{padding:17px;margin-bottom:18px}.filter-grid{display:flex;align-items:end;gap:12px;flex-wrap:wrap}.filter-grid label{flex:1;min-width:125px}.filter-grid .grow{flex:2}.list-summary{display:flex;justify-content:space-between;gap:10px;color:#7b8498;font-size:12px;margin:0 0 13px}.list-summary b{color:#29354a}.invoice-layout{display:grid;grid-template-columns:minmax(0,1fr) 290px;gap:18px;align-items:start}.main-form-column{display:grid;gap:17px}.invoice-layout .form-panel{padding:22px}.invoice-layout .panel-title{display:flex;align-items:center;gap:12px}.invoice-layout .panel-title>div{flex:1}.invoice-layout .panel-title h2{font-size:15px}.step{width:34px;height:34px;border-radius:10px;background:#e7f5ed;color:#177c57;display:grid;place-items:center;font:700 12px Inter,sans-serif;flex-shrink:0}.service-line{display:grid;grid-template-columns:minmax(160px,2fr) 75px minmax(100px,1fr) 92px 28px;gap:10px;align-items:end;padding:13px 0;border-bottom:1px solid #eef1f5}.service-line:first-child{padding-top:0}.service-line:last-child{border-bottom:0}.service-line label{font-size:10px}.line-total{padding-bottom:11px}.line-total small,.line-total b{display:block}.line-total small{font-size:10px;color:#8a95a5}.line-total b{font:600 12px Inter,sans-serif;margin-top:4px}.remove-line{height:34px;width:28px;border:0;border-radius:7px;background:#fff0ed;color:#c24a40;font-size:21px;line-height:1}.summary-panel{padding:20px;position:sticky;top:15px}.summary-head{display:flex;justify-content:space-between;font:700 10px Inter,sans-serif;letter-spacing:.6px;color:#5e6b7e;padding-bottom:18px;border-bottom:1px solid var(--line);margin-bottom:8px}.live-dot{font:500 10px 'Hind Siliguri';letter-spacing:0;color:#168253}.summary-row{display:flex;justify-content:space-between;gap:8px;padding:12px 0;font-size:12px;color:#7d8798}.summary-row b{font:600 12px Inter,sans-serif;color:#374257}.total-row{border-top:1px dashed #dce3e9;margin-top:5px;padding-top:17px}.total-row strong{font:700 19px Inter,sans-serif;color:#167b53}.due-row{background:#fff8e9;margin:6px -10px 15px;padding:12px 10px;border-radius:8px;color:#946219}.due-row strong{font:700 14px Inter,sans-serif;color:#946219}.summary-note{font-size:10px;line-height:1.6;color:#929bad;margin:15px 0}.summary-panel .btn{margin-top:8px}.settings-layout{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(260px,.8fr);gap:18px;align-items:start}.info-panel{padding:22px}.info-panel h2{font-size:16px}.info-panel ul{padding-left:20px;color:#657084;font-size:12px;line-height:1.9}.report-range{font-size:12px;color:#798499;margin:0 0 15px}.report-range b{color:#354156}.alert{border:1px solid #dce8e1;background:#eff9f3;color:#256c4a;padding:12px 14px;border-radius:9px;font-size:12px;margin-bottom:15px}.alert.danger{background:#fff0ed;border-color:#ffd5ce;color:#a83930}.alert.warning{background:#fff7e6;border-color:#f6e2ae;color:#91621a}.alert a{text-decoration:underline;font-weight:700}.print-toolbar{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:18px}.invoice-paper{max-width:850px;margin:0 auto;background:#fff;border:1px solid #e6e9ef;box-shadow:0 10px 35px rgba(20,30,50,.07);padding:42px 48px;color:#202938;font-size:12px}.receipt-header{text-align:center;border-bottom:2px solid #197a55;padding-bottom:18px;margin-bottom:22px}.receipt-header h2{font-size:24px;color:#176b49;margin:0 0 5px}.receipt-header p{margin:3px 0;color:#606b7a}.receipt-title{font-size:15px;font-weight:700;letter-spacing:.7px;margin-top:15px}.shop-logo{max-width:85px;max-height:65px;object-fit:contain}.receipt-meta{display:grid;grid-template-columns:1fr 1fr;gap:25px;margin-bottom:22px}.receipt-meta span,.receipt-meta b{display:block}.receipt-meta span{font-size:10px;color:#7c8798;margin:8px 0 2px}.receipt-meta b{font-size:12px;color:#253145;font-weight:600;overflow-wrap:anywhere}.receipt-items{white-space:normal;margin-bottom:18px}.receipt-items th{background:#f3f7f5;color:#435548;border-bottom:1px solid #dfe8e2}.receipt-items th,.receipt-items td{padding:12px 10px}.receipt-items td{border-bottom:1px solid #e8edf0}.receipt-items td small{display:block;font-size:10px;color:#7f8a9a;margin-top:3px}.receipt-totals{width:min(310px,100%);margin-left:auto}.receipt-totals>div{display:flex;justify-content:space-between;gap:12px;padding:7px 0;color:#667184}.receipt-totals b{font-weight:600;color:#2d3749}.receipt-totals .grand{border-top:1px solid #dfe6e3;margin-top:4px;padding-top:12px;color:#176b49}.receipt-totals .grand strong{font:700 19px Inter,sans-serif;color:#176b49}.receipt-totals .due{background:#fff7e6;border-radius:6px;padding:9px;margin-top:5px;color:#946219}.receipt-totals .due b{color:#946219}.receipt-notes{margin-top:20px;padding:12px;background:#f8fafb;border-radius:6px}.amount-words{text-align:center;margin-top:22px;color:#687588}.signatures{display:grid;grid-template-columns:1fr 1fr;gap:50px;margin-top:55px}.signatures div{border-top:1px solid #aeb8c3;padding-top:8px;text-align:center;font-size:10px;color:#6c7686}.receipt-footer{text-align:center;margin-top:28px;color:#176b49;font-weight:600}.thermal-paper{max-width:360px;padding:20px 16px;font-family:Arial,'Hind Siliguri',sans-serif;font-size:11px}.thermal-paper .receipt-header h2{font-size:18px}.thermal-paper .receipt-title{font-size:12px}.thermal-paper .receipt-meta{grid-template-columns:1fr;gap:6px}.thermal-paper .receipt-meta>div{display:grid;grid-template-columns:100px 1fr;gap:2px 8px}.thermal-paper .receipt-meta span{margin:3px 0}.thermal-paper .receipt-items th,.thermal-paper .receipt-items td{padding:7px 4px;font-size:9px}.thermal-paper .receipt-items th:nth-child(1),.thermal-paper .receipt-items td:nth-child(1){display:none}.thermal-paper .receipt-items th:nth-child(4),.thermal-paper .receipt-items td:nth-child(4){display:none}.thermal-paper .receipt-totals{width:100%}.thermal-paper .signatures{gap:15px;margin-top:35px}.auth-page{min-height:100vh;display:grid;place-items:center;padding:24px;background:radial-gradient(circle at top left,#e1f5e9,transparent 35%),#f5f7fb}.auth-card{width:min(100%,410px);padding:35px;background:#fff;border:1px solid var(--line);border-radius:18px;box-shadow:0 15px 50px rgba(28,52,42,.1);text-align:center}.auth-card.wide{width:min(100%,650px)}.auth-card>.brand-mark{margin:0 auto 16px}.auth-card h1{font-size:23px;margin:0}.auth-card>.muted{margin:8px 0 24px}.auth-card .stack{text-align:left}.auth-card .tiny{margin-top:18px}.auth-card .form-grid{text-align:left}.auth-card .alert{text-align:left}.auth-card .btn{margin-top:5px}
@media(max-width:1150px){.sidebar{width:215px}.content{padding:24px 22px}.topbar{padding:20px 22px}.stats-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.invoice-layout{grid-template-columns:minmax(0,1fr) 260px}.service-line{grid-template-columns:minmax(130px,2fr) 65px minmax(90px,1fr) 75px 25px;gap:7px}}
@media(max-width:850px){.sidebar{width:70px;padding:18px 8px}.brand{padding:0 5px 24px}.brand>span:last-child,.sidebar nav a span,.sidebar-bottom>div:not(.admin-avatar),.logout{display:none}.brand-mark{width:42px;height:42px}.sidebar nav a{justify-content:center;padding:13px 4px;font-size:19px}.sidebar-bottom{justify-content:center;padding-top:15px}.topbar h1{font-size:21px}.today{display:none}.invoice-layout{grid-template-columns:1fr}.summary-panel{position:static;order:-1}.two-column,.settings-layout{grid-template-columns:1fr}.service-line{grid-template-columns:minmax(0,1fr) 70px 100px 70px 25px}.service-line .service-select{grid-column:span 2}}
@media(max-width:560px){.sidebar{width:54px}.content{padding:18px 12px}.topbar{padding:17px 13px;min-height:82px}.topbar .btn{font-size:0;padding:10px}.topbar .btn:after{content:'+';font-size:18px}.topbar h1{font-size:18px}.eyebrow{font-size:8px}.stats-grid{gap:9px}.stat-card{padding:13px}.stat-card strong{font-size:18px}.stat-icon{width:32px;height:32px;margin-bottom:9px}.welcome-row{align-items:flex-start}.welcome-row h2{font-size:16px}.welcome-row .btn{font-size:11px;padding:9px}.section-heading h2{font-size:16px}.filter-grid{align-items:stretch}.filter-grid label{min-width:calc(50% - 8px)}.filter-grid .btn{flex:1}.list-summary{flex-direction:column}.form-grid{grid-template-columns:1fr}.span-2{grid-column:span 1}.form-panel{padding:16px}.invoice-layout .form-panel{padding:15px}.invoice-layout .panel-title{flex-wrap:wrap}.invoice-layout .panel-title>.btn{margin-left:46px}.service-line{grid-template-columns:minmax(0,1fr) 64px 28px;gap:8px}.service-line .service-select{grid-column:span 2}.service-line label:nth-child(3){grid-column:span 2}.line-total{grid-column:1/3;display:flex;align-items:center;gap:8px;padding:0}.line-total b{margin:0}.remove-line{grid-column:3;grid-row:2;align-self:center}.invoice-paper{padding:24px 17px}.receipt-meta{gap:12px}.receipt-items th,.receipt-items td{padding:8px 5px;font-size:10px}.receipt-items td:nth-child(4),.receipt-items th:nth-child(4){display:none}.print-toolbar{align-items:stretch;flex-direction:column}.print-toolbar .actions{justify-content:flex-end}.auth-card{padding:25px 18px}.auth-card .form-grid{grid-template-columns:1fr}.auth-card .span-2{grid-column:span 1}}
@media print{@page{size:A4;margin:12mm}body{background:#fff!important;color:#000!important;font-size:10pt}.sidebar,.topbar,.footer,.no-print{display:none!important}.app-shell,.main-area,.content{display:block!important;width:100%!important;max-width:none!important;margin:0!important;padding:0!important;background:#fff!important}.invoice-paper{max-width:none;margin:0;padding:0;border:0;box-shadow:none;font-size:10pt}.receipt-header h2{font-size:20pt}.receipt-items th,.receipt-items td{padding:8px}.thermal-paper{width:100%;max-width:none;padding:0;font-size:9pt}.thermal-paper .receipt-header h2{font-size:15pt}.thermal-paper .receipt-items th,.thermal-paper .receipt-items td{font-size:8pt;padding:5px 2px}.thermal-paper .receipt-meta{grid-template-columns:1fr}.thermal-paper .receipt-meta>div{grid-template-columns:90px 1fr}.thermal-paper .signatures{margin-top:25px}.receipt-header,.receipt-meta,.receipt-items,.receipt-totals,.receipt-notes,.signatures{break-inside:avoid}a{color:inherit;text-decoration:none}}

/* Logo upload and shared brand mark */
.brand-logo-img{max-width:100%;max-height:100%;object-fit:contain;border-radius:10px}.shop-logo{display:block;margin:0 auto 10px;max-width:150px;max-height:90px;object-fit:contain}.logo-upload-box{border:1px dashed #cbded2;background:#fbfefc;border-radius:12px;padding:16px;display:grid;gap:12px}.current-logo{display:flex;align-items:center;gap:12px;color:#607568;font-size:12px}.current-logo img{max-width:140px;max-height:85px;object-fit:contain;background:#fff;border:1px solid #e3ece6;border-radius:8px;padding:8px}.check-label{display:flex;align-items:center;gap:8px}.check-label input{width:auto}
@media print{.shop-logo{max-width:130px;max-height:75px}}

/* Separate compact brand mark and favicon preview from the full business logo */
.sidebar .brand-mark{overflow:hidden;flex:0 0 43px;width:43px;height:43px}
.sidebar .brand-logo-img{display:block;width:100%;height:100%;max-width:43px;max-height:43px;object-fit:contain;padding:3px;background:#fff;border-radius:9px}
.current-logo img{max-width:140px;max-height:85px}


/* FIX: Full business logo replaces the name, while favicon remains separate. */
.site-brand-logo{display:block!important;width:auto!important;height:auto!important;max-width:250px!important;max-height:54px!important;object-fit:contain!important;flex:0 1 auto!important;background:transparent!important;border:0!important;padding:0!important;margin:0!important;}
.nav .brand{min-width:0!important;max-width:290px!important;overflow:hidden!important;flex:0 1 auto!important;}
.nav .brand-has-logo{gap:0!important;}
.nav .brand-has-logo>span:not(.brandmark){display:none!important;}
.sidebar .brand-mark-wide{display:flex!important;align-items:center!important;justify-content:flex-start!important;width:100%!important;max-width:164px!important;height:56px!important;flex:0 1 164px!important;overflow:hidden!important;background:transparent!important;border-radius:0!important;padding:0!important;}
.sidebar .brand-mark-wide .brand-logo-img{display:block!important;width:100%!important;height:100%!important;max-width:164px!important;max-height:56px!important;object-fit:contain!important;object-position:left center!important;padding:0!important;margin:0!important;border:0!important;border-radius:0!important;background:transparent!important;}
.sidebar .brand.brand-has-logo{display:flex!important;align-items:center!important;width:100%!important;max-width:100%!important;min-width:0!important;overflow:hidden!important;padding:0 5px 24px!important;gap:0!important;}
.current-logo img{display:block!important;width:auto!important;height:auto!important;max-width:220px!important;max-height:100px!important;object-fit:contain!important;}
.shop-logo{display:block!important;width:auto!important;height:auto!important;max-width:180px!important;max-height:80px!important;object-fit:contain!important;}
@media(max-width:680px){.site-brand-logo{max-width:170px!important;max-height:46px!important}.nav .brand{max-width:190px!important}.sidebar .brand-mark-wide{max-width:145px!important;max-height:50px!important}.sidebar .brand-mark-wide .brand-logo-img{max-width:145px!important;max-height:50px!important}}

/* Public homepage: prevent oversized uploaded logo from covering header or content. */
html,body{max-width:100%;overflow-x:hidden}
.nav .brand{display:flex!important;align-items:center!important;gap:10px!important;max-width:min(290px,45vw)!important;min-width:0!important;overflow:hidden!important}
.nav .brand img,.nav .brand .site-brand-logo,.nav img[src*="uploads/"]{position:static!important;display:block!important;width:auto!important;height:auto!important;max-width:240px!important;max-height:54px!important;object-fit:contain!important;transform:none!important}
@media(max-width:680px){.nav .brand{max-width:44vw!important}.nav .brand img,.nav .brand .site-brand-logo,.nav img[src*="uploads/"]{max-width:145px!important;max-height:42px!important}}
