*{margin:0;padding:0;box-sizing:border-box}
input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
input[type=number]{-moz-appearance:textfield}
body{font-family:'Segoe UI',system-ui,sans-serif;background:#f0f2f5;min-height:100vh}
.header{background:#fff;color:#333;padding:12px 24px;display:flex;justify-content:space-between;align-items:center;position:sticky;top:0;z-index:100;box-shadow:0 2px 10px rgba(0,0,0,.08);border-bottom:1px solid #eee}
.header h1{font-size:20px;font-weight:700}
.header-right{display:flex;align-items:center;gap:12px;font-size:13px}
.header-right button{background:#f0f0f0;border:1px solid #ddd;color:#333;padding:6px 14px;border-radius:6px;cursor:pointer;font-size:12px}
.nav-tabs{display:flex;flex-wrap:wrap;background:linear-gradient(135deg,#667eea,#764ba2);overflow:visible;padding:2px 10px;position:sticky;top:69px;z-index:90;gap:1px}
.nav-tab{padding:7px 11px;cursor:pointer;border:none;background:none;font-size:11.5px;font-weight:500;color:rgba(255,255,255,.85);white-space:nowrap;border-bottom:2px solid transparent;border-radius:6px 6px 0 0;transition:all .2s}
.nav-tab:hover{color:#fff;background:rgba(255,255,255,.15)}
.nav-tab.active{color:#fff;background:rgba(255,255,255,.2);border-bottom-color:#fff;font-weight:700}
.nav-dropdown{position:relative;display:inline-block}
.nav-dropdown>.nav-tab::after{content:" \25BE";font-size:10px}
.nav-dropdown-menu{display:none;position:absolute;top:100%;left:0;background:#fff;min-width:220px;box-shadow:0 8px 24px rgba(102,126,234,.2);border:none;border-radius:0 0 12px 12px;z-index:9990;overflow:hidden}
.nav-dropdown-menu a{display:block;padding:9px 16px;font-size:12px;color:#444;cursor:pointer;border-bottom:1px solid #f0f0f0;text-decoration:none;white-space:nowrap;transition:all .15s}
.nav-dropdown-menu a:hover{background:linear-gradient(135deg,#667eea,#764ba2);color:#fff}
.nav-dropdown-menu a:last-child{border-bottom:none}
.tab-content{display:none;padding:20px}
.tab-content.active{display:block}
.fiori-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px}
.fiori-header h2{margin:0;font-size:22px;font-weight:700;color:#1a1a2e}
.fiori-header .fiori-subtitle{font-size:12px;color:#888;margin-top:2px}
.fiori-grid{display:grid;grid-template-columns:repeat(auto-fill,150px);gap:16px;margin-bottom:20px}
.fiori-group-label{grid-column:1/-1;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:1px;color:#999;padding:8px 0 0;border-top:1px solid #eee;margin-top:4px}
.fiori-group-label:first-child{border-top:none;margin-top:0}
.fiori-tile{position:relative;border-radius:14px;padding:14px 12px;cursor:pointer;transition:all .25s;box-shadow:0 2px 8px rgba(0,0,0,.06);overflow:hidden;width:150px;height:150px;display:flex;flex-direction:column;justify-content:space-between}
.fiori-tile:hover{transform:translateY(-4px);box-shadow:0 8px 24px rgba(0,0,0,.12)}
.fiori-tile:active{transform:translateY(-1px)}
.fiori-icon{font-size:32px;margin-bottom:8px}
.fiori-title{font-size:14px;font-weight:700;color:#fff}
.fiori-desc{font-size:10px;color:rgba(255,255,255,.75);margin-top:2px}
.fiori-kpi{position:absolute;top:12px;right:14px;background:rgba(255,255,255,.25);backdrop-filter:blur(4px);padding:3px 10px;border-radius:12px;font-size:11px;font-weight:700;color:#fff}
.fiori-blue{background:linear-gradient(135deg,#4472c4,#365fa0)}
.fiori-green{background:linear-gradient(135deg,#22c55e,#16a34a)}
.fiori-orange{background:linear-gradient(135deg,#f59e0b,#d97706)}
.fiori-purple{background:linear-gradient(135deg,#8b5cf6,#7c3aed)}
.fiori-teal{background:linear-gradient(135deg,#14b8a6,#0d9488)}
.fiori-rose{background:linear-gradient(135deg,#f43f5e,#e11d48)}
.fiori-indigo{background:linear-gradient(135deg,#667eea,#764ba2)}
.fiori-gray{background:linear-gradient(135deg,#64748b,#475569)}
.fiori-emerald{background:linear-gradient(135deg,#10b981,#059669)}
.fiori-back-btn{padding:8px 20px;background:#f0f0f0;border:none;border-radius:8px;font-size:13px;font-weight:600;color:#555;cursor:pointer;transition:background .2s}
.fiori-back-btn:hover{background:#e0e0e0}
@media(max-width:1024px){.fiori-grid{grid-template-columns:repeat(3,1fr)}.fiori-tile{width:auto;height:auto;aspect-ratio:1/1}}
@media(max-width:768px){.fiori-grid{grid-template-columns:repeat(2,1fr)!important}.fiori-tile{width:auto!important;height:auto!important;aspect-ratio:1/1;padding:16px}}
@media(max-width:480px){.fiori-grid{grid-template-columns:repeat(2,1fr)!important}.fiori-tile{width:auto!important;height:auto!important;aspect-ratio:1/1;min-height:unset}}
.form-section{background:#fff;border-radius:12px;padding:20px;margin-bottom:16px;box-shadow:0 1px 3px rgba(0,0,0,.08)}
.section-title{font-size:16px;font-weight:600;color:#667eea;margin-bottom:16px;padding-bottom:8px;border-bottom:2px solid #667eea;display:flex;align-items:center;gap:8px}
.section-title .badge{background:#667eea;color:#fff;font-size:10px;padding:2px 8px;border-radius:10px}
.form-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:12px}
.bp-section{background:#f9fafe;border:1px solid #e2e8f0;border-radius:8px;padding:16px;margin-bottom:12px}
.bp-section-title{font-size:13px;font-weight:600;color:#667eea;margin-bottom:10px;padding-bottom:6px;border-bottom:1px solid #dde4f0}
.form-group{display:flex;flex-direction:column;gap:4px}
.form-group label{font-size:12px;font-weight:600;color:#555}
.form-group input,.form-group select,.form-group textarea{padding:8px 10px;border:1px solid #ddd;border-radius:6px;font-size:13px;transition:.2s}
.form-group input:focus,.form-group select:focus{border-color:#667eea;outline:none;box-shadow:0 0 0 2px rgba(102,126,234,.15)}
.info-badge{background:#28a745;color:#fff;font-size:9px;padding:1px 6px;border-radius:8px;font-weight:400}
.info-badge.search{background:#007bff}
.required::after{content:" *";color:#e53e3e}
.items-section{background:#fff;border-radius:12px;padding:20px;margin-bottom:16px;box-shadow:0 1px 3px rgba(0,0,0,.08)}
.items-table-wrap{overflow-x:auto;margin-top:12px}
.items-table{width:100%;border-collapse:collapse;border:1px solid #9cb4d8;table-layout:fixed}
.items-table th{background:linear-gradient(180deg,#4472c4 0%,#365fa0 100%);color:#fff;padding:6px 4px;font-size:10px;font-weight:700;text-align:center;border:1px solid #365fa0;white-space:nowrap;text-transform:uppercase;letter-spacing:.3px;position:relative;overflow:hidden}
.col-resize-handle{position:absolute;right:0;top:0;width:5px;height:100%;cursor:col-resize;background:transparent;z-index:3;user-select:none}
.col-resize-handle:hover,.col-resize-handle.active{background:rgba(255,255,255,.4)}
body.col-resizing{cursor:col-resize!important;user-select:none}
body.col-resizing *{cursor:col-resize!important}
.items-table td{padding:2px 2px;border:1px solid #c5d3e8;vertical-align:middle;background:#fff;text-align:center;overflow:hidden;text-overflow:ellipsis}
.items-table tbody tr:hover td{background:#f5f7fb !important}
.items-table input,.items-table select{width:100%;padding:3px 2px;border:1px solid #ccd6e3;border-radius:2px;font-size:11px;text-align:center;background:#fff;box-sizing:border-box}
.items-table input:focus,.items-table select:focus{border-color:#4472c4;outline:none;box-shadow:0 0 0 1px #4472c4 inset}
.items-table input[readonly]{background:#f9fafb;color:#333;font-weight:600;border-color:#e2e6ea}
.item-remove-btn{background:#e53e3e;color:#fff;border:none;border-radius:3px;width:22px;height:22px;cursor:pointer;font-size:12px;display:flex;align-items:center;justify-content:center}
.item-remove-btn:hover{background:#c53030}
.add-item-btn{background:#667eea;color:#fff;border:none;padding:8px 16px;border-radius:6px;cursor:pointer;font-size:13px;font-weight:500;margin-top:10px;display:inline-flex;align-items:center;gap:6px}
.add-item-btn:hover{background:#5a6fd6}
.grand-total-bar{background:linear-gradient(135deg,#667eea,#764ba2);color:#fff;border-radius:12px;padding:16px 24px;margin-bottom:16px;display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:12px}
.gt-item{text-align:center}
.gt-label{font-size:11px;opacity:.8}
.gt-value{font-size:20px;font-weight:700}
.btn{padding:10px 24px;border:none;border-radius:8px;font-size:14px;font-weight:600;cursor:pointer;transition:.2s}
.btn-primary{background:#667eea;color:#fff}
.btn-primary:hover{background:#5a6fd6}
.btn-success{background:#28a745;color:#fff}
.btn-danger{background:#e53e3e;color:#fff}
.btn-outline{background:#fff;color:#667eea;border:2px solid #667eea}
.btn:disabled{opacity:.5;cursor:not-allowed}
.form-actions{display:flex;gap:12px;justify-content:flex-end;padding:16px 0}
.stats-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:12px;margin-bottom:20px}
.stat-card{background:#fff;border-radius:12px;padding:16px;box-shadow:0 1px 3px rgba(0,0,0,.08);cursor:pointer;transition:.2s;border-left:4px solid #667eea}
.stat-card:hover{transform:translateY(-2px);box-shadow:0 4px 12px rgba(0,0,0,.12)}
.stat-card.purple{border-left-color:#667eea}
.stat-card.green{border-left-color:#28a745}
.stat-card.orange{border-left-color:#fd7e14}
.stat-card.teal{border-left-color:#20c997}
.stat-card.blue{border-left-color:#007bff}
.stat-card.red{border-left-color:#e53e3e}
.stat-icon{font-size:24px;margin-bottom:4px}
.stat-label{font-size:11px;color:#888;font-weight:500}
.stat-value{font-size:22px;font-weight:700;color:#333}
.stat-change{font-size:10px;color:#888}
.dashboard-row{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-bottom:16px}
.dashboard-card{background:#fff;border-radius:12px;box-shadow:0 1px 3px rgba(0,0,0,.08);overflow:hidden}
.card-header{display:flex;justify-content:space-between;align-items:center;padding:14px 16px;border-bottom:1px solid #f0f0f0}
.card-title{font-size:14px;font-weight:600;color:#333}
.view-all-link{font-size:12px;color:#667eea;cursor:pointer;text-decoration:none}
/* report-table base — overridden by Excel-style rules below */
.status-badge{padding:3px 10px;border-radius:12px;font-size:11px;font-weight:600}
.status-badge.pending{background:#fff3cd;color:#856404}
.status-badge.approved{background:#d4edda;color:#155724}
.status-badge.rejected{background:#f8d7da;color:#721c24}
.sub-tabs{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:16px}
.sub-tab{padding:8px 16px;border-radius:20px;border:1px solid #ddd;background:#fff;cursor:pointer;font-size:12px;font-weight:500;transition:.2s}
.sub-tab.active{background:#667eea;color:#fff;border-color:#667eea}
.quick-actions{padding:12px;display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.action-button{display:flex;flex-direction:column;align-items:center;text-align:center;gap:6px;padding:14px 8px;border-radius:10px;text-decoration:none;color:#333;transition:.15s;cursor:pointer;border:1px solid #f0f0f0}
.action-button:hover{background:#f8f9ff;border-color:#667eea;transform:translateY(-1px)}
.action-icon{width:38px;height:38px;background:#667eea;color:#fff;border-radius:10px;display:flex;align-items:center;justify-content:center;font-size:16px;font-weight:700}
.action-icon.sales-icon{background:#28a745}
.action-title{font-size:11px;font-weight:600;line-height:1.2}
.action-desc{font-size:9px;color:#888;line-height:1.2}
.scrollable-table{max-height:300px;overflow-y:auto}
.empty-state{text-align:center;padding:40px;color:#aaa}
.empty-state-icon{font-size:40px;margin-bottom:8px}
.toast{position:fixed;top:20px;right:20px;padding:14px 24px;border-radius:10px;color:#fff;font-size:14px;z-index:9999;box-shadow:0 4px 12px rgba(0,0,0,.2);animation:slideIn .3s ease}
.toast.success{background:#28a745}
.toast.error{background:#e53e3e}
.toast.info{background:#007bff}
@keyframes slideIn{from{transform:translateX(100%);opacity:0}to{transform:translateX(0);opacity:1}}
.loading-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(255,255,255,.8);display:none;justify-content:center;align-items:center;z-index:9998}
.loading-overlay.show{display:flex}
.spinner{width:40px;height:40px;border:4px solid #f3f3f3;border-top:4px solid #667eea;border-radius:50%;animation:spin 1s linear infinite}
@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}
.modal-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,.5);display:none;justify-content:center;align-items:center;z-index:9997;padding:20px}
.modal-overlay.show{display:flex}
.modal-box{background:#fff;border-radius:16px;max-width:95vw;max-height:90vh;overflow-y:auto;box-shadow:0 20px 60px rgba(0,0,0,.3);width:1000px}
.modal-header{padding:16px 20px;border-bottom:1px solid #e0e0e0;display:flex;justify-content:space-between;align-items:center}
.modal-header h3{font-size:16px;color:#333}
.modal-close{background:none;border:none;font-size:24px;cursor:pointer;color:#888}
.modal-body{padding:20px}
.modal-footer{padding:12px 20px;border-top:1px solid #e0e0e0;display:flex;justify-content:flex-end;gap:10px}
.detail-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:8px;margin-bottom:16px}
.detail-item{padding:8px;background:#f8f9fa;border-radius:6px}
.detail-label{font-size:10px;color:#888;font-weight:600;text-transform:uppercase}
.detail-value{font-size:14px;color:#333;font-weight:500}
.login-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background:#f0f2f5;display:flex;justify-content:center;align-items:center;z-index:10000}
.login-overlay.hidden{display:none}
.login-wrapper{display:flex;width:90%;max-width:900px;min-height:560px;border-radius:24px;overflow:hidden;box-shadow:0 25px 80px rgba(0,0,0,.15)}
.login-brand{flex:1;background:#fff;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:40px;border-right:1px solid #eee}
.login-brand img{height:380px;position:relative;z-index:1}
.login-brand .login-tagline{color:#764ba2;font-size:15px;margin-top:12px;letter-spacing:.5px;font-weight:600}
.login-box{background:#fff;flex:1;padding:50px 40px;display:flex;flex-direction:column;justify-content:center;text-align:left;min-width:0}
.login-box h2{color:#1a1a2e;margin-bottom:6px;font-size:26px;font-weight:700}
.login-box p{color:#888;margin-bottom:28px;font-size:14px}
.login-box label{display:block;font-size:12px;font-weight:600;color:#555;margin-bottom:6px;text-transform:uppercase;letter-spacing:.5px}
.login-box input{width:100%;padding:13px 16px;border:2px solid #e8e8e8;border-radius:12px;font-size:15px;margin-bottom:18px;outline:none;transition:all .25s;background:#fafafa}
.login-box input:focus{border-color:#667eea;box-shadow:0 0 0 4px rgba(102,126,234,.12);background:#fff}
.login-box input::placeholder{color:#aaa}
.login-box .btn{width:100%;padding:14px;font-size:16px;border-radius:12px;font-weight:600;letter-spacing:.3px;background:linear-gradient(135deg,#667eea,#764ba2);border:none;color:#fff;cursor:pointer;transition:all .3s;box-shadow:0 4px 15px rgba(102,126,234,.35)}
.login-box .btn:hover{transform:translateY(-1px);box-shadow:0 6px 20px rgba(102,126,234,.45)}
.login-error{color:#e53e3e;font-size:13px;margin-bottom:12px;display:none}
@media(max-width:768px){.login-wrapper{flex-direction:column;max-width:420px;min-height:auto}.login-brand{padding:30px;min-height:200px}.login-brand img{height:140px}.login-box{padding:30px}}
@media(max-width:768px){
  body{font-size:16px}
  .header{padding:12px 16px}
  .header h1{font-size:18px}
  .nav-tabs{padding:10px 12px;gap:6px;flex-wrap:wrap;background:#f8f9fa;border-bottom:none;position:sticky;top:44px;z-index:90}
  .nav-tab{padding:10px 16px;font-size:14px;font-weight:600;border-radius:24px;border-bottom:none!important;background:#e8eaef}
  .nav-tab.active{background:linear-gradient(135deg,#667eea,#764ba2);color:#fff!important}
  .form-grid{grid-template-columns:1fr!important;gap:14px!important}
  .form-group input,.form-group select{padding:14px 16px!important;font-size:16px!important;min-height:48px!important}
  .dashboard-row{grid-template-columns:1fr}
  .stats-grid{grid-template-columns:1fr 1fr}
  .btn{width:100%;min-height:50px}
  .form-actions{flex-direction:column}
  .modal-box{width:100%;max-width:100vw;border-radius:14px}
}
@media(max-width:400px){
  .header h1{font-size:15px}
  .header-right span{display:none}
}
/* Tax column toggle */
.items-table.no-tax .tax-col{display:none !important;}
.items-table td.cell-stack{text-align:center}
.items-table td.cell-conv{white-space:nowrap}
.items-table td.cell-conv span.conv-eq{font-size:9px;color:#888}

/* Alt UoM column toggle - hidden by default, shown when any row has Alt=Yes */
.items-table .alt-col{display:none;}
.items-table.show-alt .alt-col{display:table-cell !important;}

/* Report Summary Cards */
.rpt-card{background:#fff;border-radius:10px;padding:14px 18px;border:1px solid #e8ecf0;box-shadow:0 2px 8px rgba(0,0,0,.04);position:relative;overflow:hidden}
.rpt-card::before{content:'';position:absolute;top:0;left:0;right:0;height:3px}
.rpt-card.blue::before{background:linear-gradient(90deg,#667eea,#764ba2)}
.rpt-card.green::before{background:linear-gradient(90deg,#28a745,#20c997)}
.rpt-card.red::before{background:linear-gradient(90deg,#dc3545,#fd7e14)}
.rpt-card.orange::before{background:linear-gradient(90deg,#fd7e14,#ffc107)}
.rpt-card.purple::before{background:linear-gradient(90deg,#6C63FF,#a855f7)}
.rpt-card.teal::before{background:linear-gradient(90deg,#0d6efd,#0dcaf0)}
.rpt-card .rpt-label{font-size:11px;color:#888;text-transform:uppercase;letter-spacing:.5px;font-weight:600}
.rpt-card .rpt-value{font-size:22px;font-weight:800;margin-top:4px;color:#1a1a2e}
.rpt-card .rpt-sub{font-size:11px;color:#999;margin-top:2px}
/* Report table — Excel cell borders */
.report-table{width:100%;border-collapse:collapse;font-size:12px;border:2px solid #4472c4;font-family:'Segoe UI',Calibri,Arial,sans-serif}
.report-table thead th{background:linear-gradient(180deg,#4472c4 0%,#365fa0 100%);color:#fff;padding:9px 12px;text-align:left;border:1px solid #365fa0;font-weight:700;font-size:11px;text-transform:uppercase;letter-spacing:.3px;white-space:nowrap}
.report-table tbody td{padding:8px 12px;border:1px solid #d6dce4;background:#fff;vertical-align:middle}
.report-table tbody tr:nth-child(even) td{background:#dce6f1}
.report-table tbody tr:hover td{background:#bdd7ee !important}
.report-table tfoot td{padding:8px 12px;border:1px solid #365fa0;border-top:2px solid #4472c4;font-weight:700;background:#e8ecf5}
/* ═══ EXCEL-STYLE TABLE ═══ */
.excel-wrap{overflow-x:auto;border:2px solid #4472c4;border-radius:4px;margin-top:8px}
.excel-table{width:100%;border-collapse:collapse;font-size:12px;font-family:'Segoe UI',Calibri,Arial,sans-serif;white-space:nowrap;min-width:1200px}
.excel-table thead th{background:linear-gradient(180deg,#4472c4 0%,#365fa0 100%);color:#fff;font-weight:700;font-size:11px;padding:9px 12px;text-align:left;border:1px solid #365fa0;text-transform:uppercase;letter-spacing:.3px;position:sticky;top:0;z-index:2}
.excel-table tbody td{padding:7px 12px;border:1px solid #d6dce4;background:#fff;vertical-align:middle}
.excel-table tbody tr:nth-child(even) td{background:#dce6f1}
.excel-table tbody tr:hover td{background:#bdd7ee !important}
.excel-table tbody tr.row-inactive td{color:#999}
.excel-table .col-code{min-width:90px;font-weight:600;color:#1a3a6b}
.excel-table .col-name{min-width:160px;max-width:220px;overflow:hidden;text-overflow:ellipsis}
.excel-table .col-type{min-width:80px;text-align:center}
.excel-table .col-otp{min-width:50px;text-align:center}
.excel-table .col-gstin{min-width:160px;font-family:'Consolas','Courier New',monospace;font-size:11px;letter-spacing:.3px}
.excel-table .col-country{min-width:80px}
.excel-table .col-state{min-width:100px}
.excel-table .col-statecode{min-width:55px;text-align:center}
.excel-table .col-currency{min-width:70px;text-align:center}
.excel-table .col-pmt{min-width:90px}
.excel-table .col-inco{min-width:80px}
.excel-table .col-mobile{min-width:110px;font-family:'Consolas','Courier New',monospace;font-size:11px}
.excel-table .col-status{min-width:75px;text-align:center}
.excel-table .col-actions{min-width:155px;text-align:center}
.excel-table .excel-badge{display:inline-block;padding:2px 10px;border-radius:3px;font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.2px}
.excel-table .badge-active{background:#c6efce;color:#006100;border:1px solid #006100}
.excel-table .badge-inactive{background:#ffc7ce;color:#9c0006;border:1px solid #9c0006}
.excel-table .badge-otp{background:#ffeb9c;color:#9c6500;border:1px solid #9c6500;font-size:9px;padding:1px 6px}
.excel-table .excel-btn{font-size:11px;padding:3px 10px;border:1px solid #4472c4;background:#fff;color:#4472c4;border-radius:3px;cursor:pointer;font-weight:600;transition:.15s}
.excel-table .excel-btn:hover{background:#4472c4;color:#fff}
.excel-table .excel-btn-danger{border-color:#c00000;color:#c00000}
.excel-table .excel-btn-danger:hover{background:#c00000;color:#fff}
.excel-table .excel-btn-success{border-color:#006100;color:#006100}
.excel-table .excel-btn-success:hover{background:#006100;color:#fff}
.excel-table .excel-btn-warn{border-color:#856404;color:#856404}
.excel-table .excel-btn-warn:hover{background:#856404;color:#fff}
.excel-table .badge-blocked{background:#ffeb9c;color:#856404;border:1px solid #856404}
.excel-table .badge-deleted{background:#ffc7ce;color:#9c0006;border:1px solid #9c0006}
.excel-table .col-erp{min-width:110px;font-weight:600;color:#1a3a6b}
.excel-table .col-erpname{min-width:150px;max-width:200px;overflow:hidden;text-overflow:ellipsis}
.excel-table .col-prodtype{min-width:80px}
.excel-table .col-mattype{min-width:80px}
.excel-table .col-hsn{min-width:80px;font-family:'Consolas','Courier New',monospace;font-size:11px}
.excel-table .col-gst{min-width:50px;text-align:center}
.excel-table .col-uom{min-width:50px;text-align:center}
.excel-table .col-altuom{min-width:70px;text-align:center;font-size:11px}
.excel-table .col-dept{min-width:80px}
.excel-table .col-cat{min-width:80px}
.excel-table .col-subcat{min-width:70px}
.excel-table .col-brands{min-width:200px;white-space:normal;font-size:11px}
.excel-table .col-idx{min-width:40px;text-align:center;color:#888}
.excel-table .col-bomname{min-width:200px;font-weight:600}
.excel-table .col-outqty{min-width:70px;text-align:center}
.excel-table .col-cost{min-width:120px;text-align:right;font-weight:600;color:#2d6a4f}
.excel-table .col-created{min-width:90px;text-align:center;font-size:11px}
.excel-table .badge-standard{background:#c6efce;color:#006100;border:1px solid #006100}
.excel-table .badge-draft{background:#ffeb9c;color:#9c6500;border:1px solid #9c6500}
.excel-table .row-blocked td{opacity:0.75}
.excel-table .row-deleted td{opacity:0.5;text-decoration:line-through}
.excel-count{font-size:12px;color:#555;margin-top:6px;font-style:italic}

/* Status badges */
.status-badge{display:inline-block;padding:2px 8px;border-radius:12px;font-size:10px;font-weight:700;text-transform:uppercase}
.status-badge.approved{background:#d4edda;color:#155724}
.status-badge.pending{background:#fff3cd;color:#856404}
.status-badge.rejected{background:#f8d7da;color:#721c24}

/* ═══ WORLD-CLASS DASHBOARD ═══ */
.dash-kpi-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:10px;margin-bottom:18px}
.dash-kpi{border-radius:10px;padding:12px 14px;color:#fff;position:relative;overflow:hidden;cursor:pointer;transition:.2s}
.dash-kpi:hover{transform:translateY(-2px);box-shadow:0 6px 20px rgba(0,0,0,.18)}
.dash-kpi::after{content:'';position:absolute;top:-20px;right:-20px;width:60px;height:60px;border-radius:50%;background:rgba(255,255,255,.1)}
.dash-kpi .kpi-label{font-size:10px;opacity:.85;text-transform:uppercase;letter-spacing:.5px;font-weight:600}
.dash-kpi .kpi-value{font-size:18px;font-weight:800;margin-top:2px;line-height:1.2}
.dash-kpi .kpi-sub{font-size:10px;opacity:.7;margin-top:3px}
.dash-kpi.grad-blue{background:linear-gradient(135deg,#667eea,#764ba2)}
.dash-kpi.grad-green{background:linear-gradient(135deg,#28a745,#20c997)}
.dash-kpi.grad-orange{background:linear-gradient(135deg,#fd7e14,#ffc107)}
.dash-kpi.grad-red{background:linear-gradient(135deg,#e53e3e,#f56565)}
.dash-kpi.grad-teal{background:linear-gradient(135deg,#0d6efd,#0dcaf0)}
.dash-kpi.grad-purple{background:linear-gradient(135deg,#6C63FF,#a855f7)}
.dash-kpi.grad-dark{background:linear-gradient(135deg,#1a1a2e,#16213e)}
.dash-kpi.grad-indigo{background:linear-gradient(135deg,#4f46e5,#7c3aed)}
.dash-kpi.grad-rose{background:linear-gradient(135deg,#e11d48,#f43f5e)}
/* KPI trend badge */
.kpi-trend{font-size:10px;font-weight:700;padding:2px 6px;border-radius:4px;vertical-align:middle;white-space:nowrap}
.kpi-trend.up{background:rgba(255,255,255,.22);color:#d4edda}
.kpi-trend.down{background:rgba(255,255,255,.22);color:#f8d7da}
/* Inventory bar */
.inv-bar-wrap{margin-bottom:10px}
.inv-bar-label{display:flex;justify-content:space-between;font-size:11px;margin-bottom:3px}
.inv-bar-label span:first-child{color:#555;font-weight:600}
.inv-bar-label span:last-child{color:#667eea;font-weight:700}
.inv-bar{height:8px;background:#eee;border-radius:4px;overflow:hidden}
.inv-bar-fill{height:100%;border-radius:4px;transition:width .5s ease}
/* Top items */
.top-item-row{display:flex;align-items:center;gap:12px;padding:10px 0;border-bottom:1px solid #f5f5f5}
.top-item-row:last-child{border-bottom:none}
.top-item-rank{width:28px;height:28px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:800;color:#fff;flex-shrink:0}
.top-item-rank.r1{background:linear-gradient(135deg,#ffd700,#f0c000)}
.top-item-rank.r2{background:linear-gradient(135deg,#c0c0c0,#a8a8a8)}
.top-item-rank.r3{background:linear-gradient(135deg,#cd7f32,#b8702d)}
.top-item-rank.rn{background:#ddd;color:#666}
.top-item-info{flex:1;min-width:0}
.top-item-name{font-size:12px;font-weight:600;color:#333;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.top-item-code{font-size:10px;color:#888}
.top-item-val{font-size:13px;font-weight:700;color:#28a745;white-space:nowrap}
@media(max-width:992px){.dash-kpi-grid{grid-template-columns:repeat(3,1fr)}}
@media(max-width:768px){.dash-kpi-grid{grid-template-columns:1fr 1fr}#dashPendingGrid{grid-template-columns:1fr!important}}
/* ─── Sales Conditions Sub-Row (green accent) ─── */
.s-cond-row td{padding:0!important;border-bottom:2px solid #b8e6c8}
.s-cond-wrap{display:flex;flex-wrap:wrap;align-items:center;gap:5px;background:#f0fff4;border-left:3px solid #28a745;padding:5px 12px;font-size:11px;color:#444}
.s-cond-label{font-weight:700;color:#28a745;margin-right:4px;font-size:10px;text-transform:uppercase;letter-spacing:.5px}
.s-cond-chip{background:#fff;border:1px solid #c3e6cb;border-radius:10px;padding:2px 8px;white-space:nowrap;font-size:11px}
.s-cond-total{background:#e8f5e9;border-color:#28a745;font-weight:700}
.s-cond-input{border:none;background:transparent;font-size:11px;width:72px;font-weight:600;color:#333;padding:0}
.s-cond-total-input{width:95px;color:#1b5e20;font-weight:700}
.no-tax .s-cond-row{display:none}
/* ─── PO Conditions Sub-Row (blue accent) ─── */
.o-cond-row td{padding:0!important;border:1px solid #c5d3e8;border-top:none}
.o-cond-wrap{display:flex;flex-wrap:wrap;align-items:center;gap:4px;background:#f5f7fb;border-left:3px solid #4472c4;padding:4px 10px;font-size:10px;color:#444}
.o-cond-label{font-weight:700;color:#4472c4;margin-right:4px;font-size:9px;text-transform:uppercase;letter-spacing:.5px}
.o-cond-chip{background:#fff;border:1px solid #c3cbe6;border-radius:3px;padding:1px 6px;white-space:nowrap;font-size:10px}
.o-cond-total{background:#c62828;border-color:#b71c1c;font-weight:700;color:#fff;border-radius:3px;padding:2px 8px}
.o-cond-total strong{color:#fff}
.o-cond-input{border:none;background:transparent;font-size:11px;width:72px;font-weight:600;color:#333;padding:0}
.o-cond-total-input{width:95px;color:#283593;font-weight:700}
.no-tax .o-cond-row{display:none}
.o-cond-chip.o-cond-active{background:#1b5e20;color:#fff;border-color:#1b5e20}
.o-cond-chip.o-cond-active span,.o-cond-chip.o-cond-active strong{color:#fff}
/* ═══ PO Brand & Alt UoM Buttons ═══ */
.po-brand-btn{display:block;width:100%;padding:3px 4px;font-size:10px;border:1px solid #c5d3e8;border-radius:3px;background:#f5f7fb;color:#4472c4;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center;transition:.15s}
.po-brand-btn:hover{background:#e8ecff;border-color:#4472c4}
.po-brand-btn.po-brand-selected{background:#4472c4;color:#fff;border-color:#365fa0;font-weight:600}
.po-brand-btn.po-brand-selected:hover{background:#365fa0}
.po-brand-btn.po-brand-has-lt::after{content:' \1F4DD';font-size:8px}
.po-alt-btn{display:block;width:100%;padding:3px 4px;font-size:10px;border:1px solid #c5d3e8;border-radius:3px;background:#f5f7fb;color:#888;cursor:pointer;text-align:center;transition:.15s}
.po-alt-btn:hover{background:#e8ecff;border-color:#4472c4;color:#4472c4}
.po-alt-btn.po-alt-active{background:#d4edda;color:#155724;border-color:#28a745;font-weight:600}
.po-alt-btn.po-alt-active:hover{background:#c3e6cb}
/* ═══ BoM Styles ═══ */
.bom-dd-item{padding:7px 12px;cursor:pointer;border-bottom:1px solid #f0f0f0;font-size:12px}
.bom-dd-item:hover{background:#f0f7ff}
.bom-comp-dd{display:none;position:absolute;background:#fff;border:1px solid #ddd;border-radius:4px;max-height:140px;overflow-y:auto;z-index:60;width:280px;box-shadow:0 2px 8px rgba(0,0,0,.1);font-size:11px}

/* ═══ REPORT FIXED TABLE (table-layout:fixed, explicit widths required) ═══ */
.rpt-scroll-wrap{overflow-x:auto;border:2px solid #4472c4;border-radius:4px;margin-top:8px}
.rpt-scroll-wrap.sales-accent{border-color:#28a745}
.rpt-fixed-table{width:100%;border-collapse:collapse;table-layout:fixed;font-size:11px;font-family:'Segoe UI',Calibri,Arial,sans-serif}
.rpt-fixed-table thead th{background:linear-gradient(180deg,#4472c4 0%,#365fa0 100%);color:#fff;padding:6px 8px;font-weight:700;font-size:10px;text-transform:uppercase;letter-spacing:.3px;border:1px solid #365fa0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rpt-fixed-table tbody td{padding:5px 8px;border:1px solid #d6dce4;background:#fff;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rpt-fixed-table tbody tr:nth-child(even) td{background:#f0f3ff}
.rpt-fixed-table tbody tr:hover td{background:#bdd7ee !important}
.rpt-fixed-table tfoot td{padding:6px 8px;border:1px solid #365fa0;border-top:2px solid #4472c4;font-weight:700;background:#e8ecf5}
.rpt-link{color:#3b82f6;text-decoration:underline;cursor:pointer}.rpt-link:hover{color:#1d4ed8}
/* Accounting entries collapsible */
.acct-toggle{display:flex;align-items:center;gap:8px;cursor:pointer;padding:8px 0;user-select:none}
.acct-chevron{display:inline-block;font-size:12px;color:#4472c4;transition:transform .2s}
.acct-chevron.open{transform:rotate(90deg)}
.acct-body{display:none;padding-top:8px}
.acct-body.open{display:block}
.acct-badge{font-size:11px;font-weight:600;padding:2px 8px;border-radius:10px;background:#dcfce7;color:#059669}
.rpt-fixed-table.register-sales thead th{background:linear-gradient(180deg,#28a745 0%,#1e7e34 100%);border-color:#1e7e34}
/* Alignment utilities */
.rpt-fixed-table .al-r{text-align:right}
.rpt-fixed-table .al-c{text-align:center}
.rpt-fixed-table .al-l{text-align:left}
.rpt-fixed-table .fw-b{font-weight:700}
.rpt-fixed-table .fw-s{font-weight:600}
/* Color accents */
.rpt-fixed-table .clr-green{color:#28a745}
.rpt-fixed-table .clr-red{color:#dc3545}
.rpt-fixed-table .clr-blue{color:#2563eb}
.rpt-fixed-table .clr-purple{color:#6C63FF}
.rpt-fixed-table .clr-muted{color:#888}
/* Row accents */
.rpt-fixed-table .row-shortage td{background:#fff5f5 !important}
.rpt-fixed-table .bsr-row-short td{background:#fff5f5 !important}
/* Global utility classes (outside table scope) */
.clr-green{color:#28a745}.clr-red{color:#dc3545}.clr-blue{color:#2563eb}.clr-purple{color:#6C63FF}.clr-muted{color:#888}
.fw-b{font-weight:700}.fw-s{font-weight:600}.al-r{text-align:right}.al-c{text-align:center}.al-l{text-align:left}
/* Sub-tab buttons */
.pr-sub-btn{border-radius:4px !important;transition:.15s}
/* Tax column toggle */
.pr-no-tax .tax-col{display:none}

/* ═══ STOCK BY LOCATION CARDS ═══ */
.sbl-location-card{margin-bottom:20px}
.sbl-location-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}
.sbl-location-title{color:#667eea;margin:0;font-size:16px;font-weight:600}
.sbl-location-meta{font-size:13px}
.sbl-location-meta .count{color:#888}
.sbl-location-meta .value{color:#28a745;font-weight:700}

/* ═══ BOM SHORTAGE REPORT ═══ */
.bsr-card{margin-bottom:12px;border-radius:10px;overflow:hidden;border:1px solid #e0e0e0}
.bsr-card.bsr-short{border-color:#fecaca}
.bsr-card.bsr-ok{border-color:#bbf7d0}
.bsr-header{display:flex;justify-content:space-between;align-items:center;padding:12px 16px;cursor:pointer;user-select:none}
.bsr-card.bsr-short .bsr-header{background:#fef2f2}
.bsr-card.bsr-ok .bsr-header{background:#f0fdf4}
.bsr-header:hover{filter:brightness(.97)}
.bsr-title{display:flex;align-items:center;gap:8px}
.bsr-title .bsr-name{font-weight:700;font-size:13px;color:#1a1a2e}
.bsr-title .bsr-fg{font-size:11px;color:#555}
.bsr-chevron{font-size:12px;transition:transform .2s;display:inline-block;margin-right:8px}
.bsr-chevron.open{transform:rotate(90deg)}
.bsr-right{display:flex;align-items:center;gap:10px}
.bsr-meta{font-size:10px;color:#888}
.bsr-status{font-size:11px;padding:3px 10px;border-radius:12px;font-weight:700}
.bsr-status.short{background:#fef2f2;color:#dc2626;border:1px solid #dc2626}
.bsr-status.ok{background:#f0fdf4;color:#16a34a;border:1px solid #16a34a}
.bsr-body{display:none;padding:8px 16px 12px}
.bsr-body.open{display:block}
.bsr-sub-label{display:flex;align-items:center;gap:8px;margin:8px 0 6px 4px}
.bsr-sub-icon{color:#4338ca;font-size:12px}
.bsr-sub-name{font-weight:600;font-size:12px;color:#4338ca}
.bsr-root-label{font-size:11px;font-weight:600;color:#555;margin:8px 0 4px 4px}
