
*{box-sizing:border-box}body{margin:0;font-family:Inter,Arial,sans-serif;background:#f4f6f8;color:#18212b}
.hidden{display:none!important}.login{min-height:100vh;display:grid;place-items:center;padding:20px}.login-card{width:min(420px,100%);background:#fff;padding:28px;border-radius:16px;border:1px solid #dde4ea}
h1,h2,h3{margin-top:0}.muted{color:#687580;font-size:13px}.field{margin:12px 0}.field label{display:block;font-size:12px;color:#63717c;margin-bottom:5px}.field input,.field select,.field textarea{width:100%;padding:11px;border:1px solid #ccd5dd;border-radius:8px;font:inherit}.field textarea{min-height:88px;resize:vertical}
.btn{border:0;background:#1769c2;color:white;padding:10px 14px;border-radius:8px;cursor:pointer}.btn.secondary{background:#e8edf2;color:#23303b}
.shell{display:flex;min-height:100vh}.side{width:230px;background:#182532;color:#fff;padding:18px;position:fixed;top:0;bottom:0;height:100vh;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}.brand{font-weight:800;line-height:1.3;margin-bottom:22px}.brand small{display:block;color:#aeb8c1;font-weight:400;margin-top:4px}
.nav button{width:100%;border:0;background:transparent;color:#d8e0e6;text-align:left;padding:10px;border-radius:7px;margin:2px 0;cursor:pointer}.nav button.active,.nav button:hover{background:#2a3b4b}
main{margin-left:230px;width:calc(100% - 230px);padding:22px}.top{display:flex;align-items:center;justify-content:space-between}.cards{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin:16px 0}.card,.panel{background:white;border:1px solid #e0e6eb;border-radius:12px;padding:16px}.label{font-size:12px;color:#6c7882}.value{font-size:22px;font-weight:800;margin-top:6px}.grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.page{display:none}.page.active{display:block}
.form{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.full{grid-column:1/-1}table{width:100%;border-collapse:collapse;font-size:13px}th,td{border-bottom:1px solid #edf0f2;padding:9px;text-align:left}
.notice{background:#edf6ff;border-left:4px solid #2475c7;padding:12px;border-radius:6px;font-size:13px;margin-bottom:12px}
@media(max-width:800px){.side{position:relative;width:100%;height:auto}.shell{display:block}main{margin:0;width:100%}.cards{grid-template-columns:1fr 1fr}.grid,.form{grid-template-columns:1fr}}

.bank-suggestions{display:none;position:absolute;left:0;right:0;top:100%;z-index:50;background:#fff;border:1px solid #cbd5e1;border-radius:8px;box-shadow:0 8px 24px rgba(15,23,42,.15);max-height:260px;overflow:auto;margin-top:3px}
.bank-suggestion{padding:10px 12px;cursor:pointer;font-size:14px}
.bank-suggestion:hover,.bank-suggestion.active{background:#f1f5f9;font-weight:600}
.dashboard-cards{grid-template-columns:repeat(4,minmax(0,1fr))}.dashboard-grid{grid-template-columns:1.35fr .65fr}@media(max-width:1100px){.dashboard-cards{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:800px){.dashboard-cards,.dashboard-grid{grid-template-columns:1fr}}

@media print{.side,.top .btn,.nav{display:none!important}main{margin:0!important;width:100%!important;padding:0!important}.page{display:none!important}#reports{display:block!important}.panel,.card{break-inside:avoid;box-shadow:none}.cards{grid-template-columns:repeat(3,1fr)!important}body{background:#fff}}

/* GST invoice feature: invoice itself opens in a dedicated print window. */

/* V9.1.4 Production clarity UI */
.production-page .production-stock-cards{grid-template-columns:repeat(2,minmax(0,1fr));max-width:900px}
.production-info{background:#eef7ff;border:1px solid #a9d3f7;border-radius:10px;padding:13px 16px;margin:12px 0 14px;color:#123f70;font-size:13px;line-height:1.5}
.production-info span{margin-left:23px;color:#46627d}.production-panel{padding:16px}.opening-save-btn{background:#16a34a}.opening-stock-grid{width:100%;overflow:auto}.opening-row{display:grid;grid-template-columns:.8fr 1.45fr .9fr .9fr 1.15fr;gap:10px;align-items:center;padding:7px 10px;border-bottom:1px solid #e8edf2;min-width:850px}.opening-head{background:#eaf4ff;border-radius:7px 7px 0 0;font-size:12px;color:#273849}.opening-row input{width:100%;padding:10px;border:1px solid #ccd5dd;border-radius:7px}.auto-total{background:#eef1f4;font-weight:700}.production-date{max-width:340px}.fixed-production-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.product-production-card{border-radius:10px;padding:12px 14px}.product-production-card h3{margin:0 0 8px;font-size:18px}.rice-produced{background:#edf6ff;border:1px solid #d7eafa}.broken-produced{background:#eefaf0;border:1px solid #d7efdb}.rice-produced h3{color:#0b4d91}.broken-produced h3{color:#08752a}.prod-card-fields{display:grid;grid-template-columns:1.45fr .75fr .75fr 1fr;gap:12px;align-items:end}.prod-card-fields .field{margin:0}.prod-total-box{border-radius:8px;padding:10px 12px;background:#dceeff;min-height:62px;display:flex;flex-direction:column;justify-content:center}.broken-produced .prod-total-box{background:#d9f4df}.prod-total-box span{font-size:12px;font-weight:700;color:#1769c2}.broken-produced .prod-total-box span{color:#13802f}.prod-total-box strong{font-size:24px;margin-top:3px;color:#0e3d75}.broken-produced .prod-total-box strong{color:#07621f}.stock-filter-box{display:flex;gap:10px}.stock-filter-box .field{margin:0;min-width:150px}.stock-detail-table thead{background:#eaf4ff}.stock-detail-table th{font-weight:700;color:#273849}.stock-detail-table tbody tr:nth-child(even){background:#fafcfd}.stock-detail-table td:last-child{font-weight:800}.stock-detail-table .negative-stock{color:#b42318}.stock-detail-table .positive-stock{color:#166534}
@media(max-width:1100px){.fixed-production-grid{grid-template-columns:1fr}.prod-card-fields{grid-template-columns:1.3fr .8fr .8fr 1fr}}@media(max-width:800px){.production-page .production-stock-cards{grid-template-columns:1fr}.prod-card-fields{grid-template-columns:1fr 1fr}.stock-filter-box{flex-direction:column}.opening-row{grid-template-columns:160px 220px 140px 140px 180px}}

/* V9.5.5 duplicate-submit protection */
button.action-busy, .btn.action-busy{opacity:.58;cursor:wait;filter:saturate(.55);pointer-events:none;}
button:disabled{cursor:not-allowed;}

/* V9.5.8.8 Auditor Report grouped navigation */
.nav-group{margin:2px 0}.nav-group .nav-parent{display:flex;align-items:center;justify-content:space-between}.nav-submenu{display:block;padding-left:14px;border-left:2px solid rgba(255,255,255,.12);margin-left:10px}.nav-submenu button{font-size:13px;padding:8px 10px!important;color:#c7d2db!important}.nav-submenu button.active{background:#2a3b4b!important;color:#fff!important}

/* V9.5.8.35 - clearer Recent Sales GST Business filter */
.recent-sales-gst-filter{margin-top:12px;max-width:760px}.recent-sales-gst-filter label{display:block;font-size:13px;font-weight:700;color:#273746;margin-bottom:7px}.recent-sales-gst-filter select{width:100%;min-height:44px;padding:10px 42px 10px 12px;border:1px solid #aebdca;border-radius:8px;background:#fff;font:inherit;font-weight:600;color:#172b3a;box-shadow:0 1px 2px rgba(0,0,0,.04)}.recent-sales-gst-filter select:focus{outline:2px solid rgba(25,118,210,.18);border-color:#1976d2}.recent-sales-gst-help{margin-top:6px}


/* V9.5.8.47T - Mobile app responsive header, drawer and bottom navigation */
.mobile-app-header,.mobile-bottom-nav,.mobile-menu-backdrop{display:none}
@media(max-width:800px){
 body{padding-bottom:72px;background:#f4f6f8}
 .shell{display:block;min-height:100vh}
 .mobile-app-header{display:grid;grid-template-columns:48px minmax(0,1fr) 48px;align-items:center;gap:6px;position:sticky;top:0;z-index:1200;height:68px;padding:0 12px;background:#142b3b;color:#fff;box-shadow:0 1px 5px rgba(0,0,0,.18)}
 .mobile-menu-btn{border:0;background:transparent;color:#fff;font-size:31px;line-height:1;cursor:pointer;padding:4px 0;text-align:left}
 .mobile-company-name{font-size:19px;font-weight:800;line-height:1.12;text-align:center;white-space:normal;overflow-wrap:anywhere;max-height:44px;overflow:hidden}
 .mobile-header-mark{font-size:29px;text-align:right}
 .side{display:block;position:fixed!important;z-index:1400;left:0;top:0;width:min(86vw,330px)!important;height:100vh!important;padding:20px 16px 92px!important;overflow-y:auto;background:#182532;transform:translateX(-105%);transition:transform .22s ease;box-shadow:8px 0 28px rgba(0,0,0,.28)}
 .side.mobile-drawer-open{transform:translateX(0)}
 .side .brand{padding-right:28px}.side .brand>[data-company-name]{display:block;font-size:18px;line-height:1.2;overflow-wrap:anywhere}.side .brand small{font-size:12px;line-height:1.35}
 .mobile-menu-backdrop{position:fixed;inset:0;z-index:1300;background:rgba(0,0,0,.38)}
 .mobile-menu-backdrop.show{display:block}
 main{margin:0!important;width:100%!important;padding:18px 14px 24px!important}
 .top{gap:10px;align-items:flex-start}.top h1{font-size:28px;margin-bottom:8px}.top>.btn{flex:0 0 auto}
 .cards,.dashboard-cards{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px}
 .dashboard-grid,.grid,.form{grid-template-columns:1fr}
 .card{padding:14px 12px;min-width:0}.card .label{font-size:12px;line-height:1.25}.card .value{font-size:20px;line-height:1.15;overflow-wrap:anywhere}
 .panel{padding:14px}
 .mobile-bottom-nav{display:grid;grid-template-columns:repeat(5,1fr);position:fixed;left:0;right:0;bottom:0;z-index:1250;height:70px;padding:5px 4px max(5px,env(safe-area-inset-bottom));background:#fff;border-top:1px solid #dfe5ea;box-shadow:0 -2px 10px rgba(0,0,0,.06)}
 .mobile-bottom-nav button{border:0;background:transparent;color:#50606c;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;font:inherit;min-width:0;padding:2px;cursor:pointer}
 .mobile-bottom-nav button span{font-size:24px;line-height:1}.mobile-bottom-nav button b{font-size:11px;white-space:nowrap}.mobile-bottom-nav button.active{color:#1769c2}
 table{min-width:620px}
}
@media(max-width:390px){
 .mobile-company-name{font-size:17px}.card .value{font-size:18px}main{padding-left:10px!important;padding-right:10px!important}
}


/* V9.5.8.47U - Mobile UI refinement */
@media(max-width:800px){
 html,body{width:100%;max-width:100%;overflow-x:hidden}
 body{padding-bottom:calc(74px + env(safe-area-inset-bottom));}
 .mobile-app-header{
   grid-template-columns:42px minmax(0,1fr) 42px;
   height:64px;
   padding:0 14px;
   gap:4px;
   box-sizing:border-box;
 }
 .mobile-company-name{
   min-width:0;
   max-width:100%;
   font-size:15px;
   font-weight:800;
   line-height:1.15;
   letter-spacing:.05px;
   text-align:center;
   white-space:nowrap;
   overflow:hidden;
   text-overflow:ellipsis;
   overflow-wrap:normal;
 }
 .mobile-menu-btn{font-size:30px;text-align:left}
 .mobile-header-mark{font-size:27px;text-align:right}
 main{box-sizing:border-box;padding:18px 12px 28px!important;overflow-x:hidden}
 .page{width:100%;max-width:100%;min-width:0}
 .top{width:100%;align-items:flex-start}
 .top h1{font-size:27px;line-height:1.12}
 .cards,.dashboard-cards{width:100%;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}
 .card{min-width:0;padding:14px 12px}
 .card .label{font-size:12px;line-height:1.3}
 .card .value{font-size:19px;line-height:1.18;word-break:normal;overflow-wrap:anywhere}
 .panel{width:100%;max-width:100%;min-width:0;padding:14px 12px}
 .form{width:100%;grid-template-columns:1fr!important;gap:0!important}
 .form>.field,.field{min-width:0;width:100%}
 .field input,.field select,.field textarea{width:100%;max-width:100%;min-height:46px;font-size:16px;padding:11px 12px}
 .field label{font-size:12px;margin-bottom:6px}
 .grid,.dashboard-grid{width:100%;grid-template-columns:1fr!important}
 .mobile-bottom-nav{height:72px;padding:5px 4px max(6px,env(safe-area-inset-bottom))}
 .mobile-bottom-nav button span{font-size:23px}.mobile-bottom-nav button b{font-size:11px}
 /* Wide report tables scroll inside their own area instead of widening the whole page. */
 .panel{overflow-x:auto}
}
/* Android WebView draws under the status bar on some phones. Reserve that area only in the app. */
@media(max-width:800px){
 body.android-webview .mobile-app-header{
   height:88px;
   padding-top:24px;
 }
}
@media(max-width:390px){
 .mobile-company-name{font-size:13.5px}
 main{padding-left:10px!important;padding-right:10px!important}
 .card .value{font-size:18px}
}

/* V9.5.8.47V — English / Tamil language selector */
.language-select{border:1px solid #cfd8df;border-radius:8px;background:#fff;color:#142b3b;font-weight:700;padding:7px 9px;max-width:145px}
.desktop-language-wrap{display:flex;align-items:center;gap:8px;padding:8px 12px 10px}
.mobile-language-select{justify-self:end;width:58px;max-width:58px;padding:5px 3px;border-color:rgba(255,255,255,.55);background:#fff;color:#142b3b;font-size:12px}
@media(max-width:820px){.desktop-language-wrap{display:none!important}}


/* V9.5.8.47V2 — mobile company name + globe language popover */
.language-menu-wrap{position:relative;display:inline-flex;align-items:center}
.language-globe-btn{border:1px solid #cfd8df;border-radius:9px;background:#fff;color:#142b3b;font:inherit;font-weight:700;cursor:pointer;min-width:42px;min-height:38px;padding:6px 9px;display:inline-flex;align-items:center;justify-content:center;gap:6px}
.language-popup{display:none;position:absolute;z-index:1800;top:calc(100% + 7px);right:0;min-width:145px;background:#fff;border:1px solid #d7e0e7;border-radius:10px;padding:6px;box-shadow:0 10px 28px rgba(0,0,0,.20)}
.language-popup.show{display:block}
.language-popup button{display:block;width:100%;border:0;background:transparent;color:#142b3b;text-align:left;padding:10px 12px;border-radius:7px;font:inherit;font-weight:700;cursor:pointer}
.language-popup button:hover,.language-popup button.active{background:#eaf2f8;color:#1769c2}
.desktop-language-wrap{overflow:visible}
.desktop-globe-btn{width:100%;justify-content:flex-start}
.desktop-language-popup{left:0;right:auto;min-width:170px}
@media(max-width:820px){
 .mobile-language-menu-wrap{justify-self:end}
 .mobile-language-menu-wrap .language-globe-btn{border-color:rgba(255,255,255,.42);background:rgba(255,255,255,.10);color:#fff;font-size:23px;padding:4px;min-width:40px;min-height:40px}
 .mobile-app-header{grid-template-columns:42px minmax(0,1fr) 42px!important}
 .mobile-company-name{font-size:15px!important;line-height:1.12!important;white-space:normal!important;overflow:hidden!important;text-overflow:clip!important;overflow-wrap:normal!important;word-break:normal!important;display:-webkit-box!important;-webkit-box-orient:vertical!important;-webkit-line-clamp:2!important;max-height:36px!important;padding:0 2px}
}
@media(max-width:390px){.mobile-company-name{font-size:13.5px!important;max-height:32px!important}}

/* V9.5.8.47V4.1 - Login loading feedback */
#companyLoginBtn.login-busy{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-width:132px;opacity:.82;cursor:wait;pointer-events:none}
.login-spinner{width:15px;height:15px;border:2px solid rgba(255,255,255,.45);border-top-color:#fff;border-radius:50%;display:inline-block;animation:riceMillLoginSpin .75s linear infinite}
@keyframes riceMillLoginSpin{to{transform:rotate(360deg)}}

/* V9.5.8.47V29 — Android/mobile More opens the complete role-authorized menu */
@media(max-width:800px){
 .mobile-menu-spacer{width:42px;height:42px}
 .side{padding:12px 10px calc(88px + env(safe-area-inset-bottom))!important;scrollbar-width:thin;overscroll-behavior:contain}
 .side .brand{margin-bottom:8px;padding:4px 8px 8px;border-bottom:1px solid rgba(255,255,255,.12)}
 .side .desktop-language-wrap{margin:4px 0 7px}
 .side .nav button{padding:8px 9px;margin:1px 0;min-height:36px}
 .side .nav-submenu{margin-top:1px;margin-bottom:2px}
 .side .nav-submenu button{padding:7px 9px!important;min-height:33px}
 #cloudVersionStatus{padding:6px 9px!important}
}
