* { box-sizing: border-box; }
body { margin: 0; font-family: 'Segoe UI', Arial, sans-serif; background: #f5f7f8; color: #24332f; }
.app-nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 24px; background: white; border-bottom: 1px solid #dce2e5; }
.app-nav a { text-decoration: none; color: #263238; }
.app-nav .brand { font-weight: bold; }
.nav-links { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.nav-links a[aria-current] { color: #087b61; font-weight: bold; }
.nav-links form { margin: 0; }
button, .button { display: inline-block; padding: 10px 16px; border: 1px solid #c4ced2; border-radius: 4px; background: white; color: #263238; cursor: pointer; text-decoration: none; font-size: 14px; }
.primary { background: #087b61; border-color: #087b61; color: white; }
.login-box { width: min(420px, calc(100% - 32px)); margin: 80px auto; background: white; padding: 32px; border: 1px solid #dce2e5; border-radius: 6px; }
.login-box h1 { font-size: 24px; margin: 0 0 24px; }
label { display: block; font-size: 14px; margin-bottom: 6px; }
.field { width: 100%; padding: 10px; border: 1px solid #c4ced2; border-radius: 4px; font: inherit; }
.login-box .field { margin-bottom: 20px; }
.error { color: #a92323; }
.report { max-width: 1200px; margin: 32px auto; padding: 0 24px; }
.report h1 { font-size: 26px; }
.filters { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; padding: 20px 0; border-block: 1px solid #dce2e5; }
.summary { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 16px; padding: 24px 0; }
.summary span { display: block; font-size: 13px; color: #54666e; margin-bottom: 8px; }
.summary strong { font-size: 18px; overflow-wrap: anywhere; }
.table-scroll { overflow-x: auto; }
.report table { width: 100%; border-collapse: collapse; background: white; font-size: 14px; }
.report th, .report td { padding: 12px; text-align: left; border-bottom: 1px solid #dce2e5; }
.report th { background: #eaf0ee; white-space: nowrap; }
.report .money { text-align: right; white-space: nowrap; }
.report .description { white-space: pre-wrap; overflow-wrap: anywhere; min-width: 180px; }
.report-tools { display: flex; gap: 8px; margin-bottom: 16px; }
@media(max-width: 700px) { .app-nav { align-items: start; flex-direction: column; } .nav-links { gap: 12px; } .summary { grid-template-columns: repeat(2,minmax(0,1fr)); } .filters > div { flex: 1 1 140px; } }
@media print { .no-print { display: none !important; } body { background: white; } .report { max-width: none; margin: 0; padding: 0; } .report th, .report td { padding: 6px; font-size: 10px; } .table-scroll { overflow: visible; } .report .description { min-width: 0; } thead { display: table-header-group; } }
.app-nav { min-height: 84px; padding: 16px max(24px, calc((100% - 1280px) / 2)); }
.brand { display: flex; align-items: center; gap: 12px; font-size: 18px; line-height: 1.3; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; flex-shrink: 0; color: white; background: #11755c; border-radius: 6px; font-size: 18px; }
.brand-caption { display: block; margin-top: 4px; font-size: 10px; font-weight: 600; color: #79867f; }
.nav-links { gap: 10px; font-size: 14px; }
.nav-links > a { display: flex; align-items: center; gap: 8px; padding: 11px 14px; border-radius: 4px; }
.nav-links > a:hover { background: #f1f5f3; }
.nav-links > a[aria-current] { background: #e9f4ef; color: #11755c; }
.user-account { display: flex; align-items: center; gap: 8px; margin-left: 18px; padding-left: 22px; border-left: 1px solid #e0e6e3; }
.user-avatar { width: 32px; height: 32px; display: grid; place-items: center; background: #f0eafa; color: #71549d; border-radius: 50%; font-weight: 600; }
.logout-button { width: 38px; height: 38px; padding: 9px; border: none; background: transparent; }
i[data-lucide], svg.lucide { width: 18px; height: 18px; flex: 0 0 18px; vertical-align: middle; }
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; font-family: inherit; font-weight: 600; transition: background .15s, border-color .15s; }
button:hover, .button:hover { background: #edf3ef; border-color: #93aea0; color: #24332f; }
.primary, .primary:hover { background: #11755c; border-color: #11755c; color: white; }
.primary:hover { background: #095d47; }
button:focus-visible, a:focus-visible { outline: 3px solid #80bdaa; outline-offset: 3px; }
.field:focus { outline: 2px solid #b9dbcf; border-color: #11755c; }
.field { min-height: 42px; background: #fff; font-size: 14px; }
.eyebrow { color: #11755c; font-size: 11px; font-weight: 700; margin: 0 0 7px; }
.page-subtitle { font-size: 14px; color: #76827c; margin: 8px 0 0; }
.workspace-heading, .report-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.workspace-heading { max-width: 1200px; margin: 32px auto 24px; padding: 0 24px; }
.workspace-heading h1, .report h1 { font-size: 28px; font-weight: 650; margin: 0; color: #24332f; }
.report { max-width: 1280px; margin-top: 32px; }
.report-heading { margin-bottom: 28px; }
.report-tools { margin: 0; flex-wrap: wrap; }
.filters { border-top: 1px solid #dce5df; border-bottom: 1px solid #dce5df; padding: 20px 0; gap: 14px; }
.filters label { font-size: 12px; font-weight: 600; color: #56665d; }
.filters > div:nth-child(3) { flex: 1; min-width: 200px; }
.report-range { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #738079; margin: 18px 0 0; }
.summary { gap: 12px; padding: 20px 0 28px; }
.summary .metric { background: white; border: 1px solid #dfe6e2; border-radius: 6px; padding: 18px 16px; min-height: 105px; border-top: 3px solid #bed0c4; }
.summary .metric span { font-size: 12px; margin-bottom: 12px; }
.summary .metric strong { font-size: 20px; font-weight: 650; line-height: 1.3; }
.summary .metric-count { border-top-color: #ab92cf; }
.summary .metric-cgst, .summary .metric-sgst { border-top-color: #ddaa83; }
.summary .metric-round_off { border-top-color: #e5ce87; }
.summary .metric-total { border-color: #11755c; background: #11755c; color: white; }
.summary .metric-total span { color: #cce8da; }
.ledger-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 0 16px; }
.ledger-heading h2 { font-size: 18px; font-weight: 650; margin: 0; }
.record-count { color: #65766c; font-size: 12px; }
.report .table-scroll { border: 1px solid #dce5df; border-radius: 4px; }
.report th { background: #edf2ef; color: #57695e; font-size: 11px; text-transform: uppercase; font-weight: 650; }
.report td { vertical-align: top; font-size: 13px; padding: 16px 12px; }
.report tbody tr:hover { background: #f8faf9; }
.report .description { color: #6d7c72; font-size: 12px; max-width: 280px; }
.invoice-reference { color: #11755c; white-space: nowrap; }
.secondary-text { color: #7b8880; font-size: 12px; }
.record-actions { display: flex; gap: 6px; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; height: 32px; width: 32px; color: #586e61; border: 1px solid #dce5df; border-radius: 4px; }
.icon-button:hover { color: #11755c; background: #edf5f0; }
.report .empty-state { padding: 36px; text-align: center; }
.empty-state > svg { display: block; width: 28px; height: 28px; color: #91a699; margin: 0 auto 12px; }
.empty-state strong, .empty-state span { display: block; }
.empty-state span { margin-top: 8px; color: #7b8880; }
.report-breakdown { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 36px; padding-top: 24px; border-top: 1px solid #dce5df; }
.report-breakdown > section { min-width: 0; }
.report-breakdown .ledger-heading > svg { color: #829b8c; }
.month-row { margin: 20px 0; }
.month-row > div { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; margin-bottom: 8px; }
.month-row meter { width: 100%; height: 12px; }
.month-row meter::-webkit-meter-bar { background: #e1ebe5; border: none; border-radius: 2px; }
.month-row meter::-webkit-meter-optimum-value { background: #4d9c7d; }
.customer-rank { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid #e1e7e3; font-size: 13px; }
.customer-rank > div { min-width: 0; overflow-wrap: anywhere; }
.customer-rank > div span { display: block; margin-top: 4px; }
.customer-rank > strong { white-space: nowrap; }
.print-only { display: none; }
.invoice-note { margin-top: 22px; }
.invoice-note textarea, .account-details textarea { overflow: hidden; }
.invoice-note > label, .account-details > label:first-child { font-size: 13px; font-weight: 600; color: #42624e; margin-bottom: 8px; }
.invoice-footer { display: flex; justify-content: flex-end; margin-top: 24px; }
.invoice-footer > * { min-width: 0; }
.invoice-footer .invoice-signature { margin-top: 0 !important; text-align: right; overflow-wrap: anywhere; }
.invoice-words { margin: 12px 0 0; overflow-wrap: anywhere; text-align: right; }
.fixed-bank-details { margin-top: 8px; line-height: 1.6; overflow-wrap: anywhere; }
.invoice-totals .account-details { padding-top: 8px; padding-bottom: 16px; }
@media screen {
  .invoice-box, .bill-list { max-width: 1152px; padding: 28px 32px; border: none; border-top: 2px solid #bfd3c7; box-shadow: none; border-radius: 0; margin: 24px auto; }
  .invoice-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 20px; margin-bottom: 24px; border-bottom: 1px solid #e1e8e4; }
  .invoice-title h3 { font-size: 17px; text-align: left; margin: 0; color: #2d493a; }
  .invoice-badge { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; color: #648171; white-space: nowrap; }
  .invoice-badge > span { width: 6px; height: 6px; border-radius: 50%; background: #2b9c71; }
  .section-title { font-size: 14px; font-weight: 650; color: #42624e; padding-bottom: 12px; margin-bottom: 16px; }
  .customer-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; border-bottom: 1px solid #e1e8e4; padding-bottom: 24px; }
  .customer-fields label { font-size: 12px; font-weight: 600; color: #68796d; }
  .invoice-box .form-control { border-color: #d4dfd8; border-radius: 4px; background: #fcfdfc; font-size: 14px; min-height: 40px; }
  .invoice-box .form-control:focus { border-color: #78af95; box-shadow: 0 0 0 3px #e5f1eb; }
  .date-control { width: min(260px, 100%); }
  .invoice-box .date-picker-control { width: 42px; min-width: 42px; flex: 0 0 42px; padding: 9px; }
  .date-picker-control::-webkit-datetime-edit { display: none; }
  .date-picker-control::-webkit-calendar-picker-indicator { margin: 0; cursor: pointer; }
  #productTable { margin-bottom: 16px; font-size: 13px; min-width: 730px; }
  #productTable th { padding: 12px; font-size: 11px; color: #5b7364; text-transform: uppercase; background: #eff5f1; border-color: #dce5df; }
  #productTable td { padding: 10px; border-color: #e2e9e5; }
  .invoice-box .btn { font-size: 13px; font-weight: 600; border-radius: 4px; min-height: 40px; gap: 8px; display: inline-flex; align-items: center; justify-content: center; }
  .invoice-box .btn-primary, .invoice-box .btn-success { background: #11755c; border-color: #11755c; }
  .invoice-box .btn-primary:hover, .invoice-box .btn-success:hover { background: #095d47; }
  .invoice-box .btn-outline-primary { border-color: #a9c3b5; color: #11755c; }
  .invoice-box .btn-outline-primary:hover { background: #e6f0eb; }
  .invoice-box .remove-row { min-height: 30px; padding: 4px 9px; background: #faefee; border-color: #eedad6; color: #af5e52; }
  .invoice-box .table-sm th, .invoice-box .table-sm td { padding: 9px 12px; font-size: 13px; }
  .invoice-box .table-sm tr:last-child th, .invoice-box .table-sm tr:last-child td { background: #edf5f0; color: #11755c; font-size: 18px; }
  .invoice-box .action-bar { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 24px; border-top: 1px solid #e1e8e4; text-align: left; }
  .status-line { width: 100%; }
  .bill-list h5 { font-size: 18px; }
  .bill-list table { font-size: 13px; }
  .bill-list th { color: #5b7364; font-size: 11px; text-transform: uppercase; padding: 12px; }
  .bill-list td { padding: 12px; }
}
@media(max-width: 1050px) { .summary { grid-template-columns: repeat(3,minmax(0,1fr)); } .user-account { margin-left: 0; padding-left: 10px; } .nav-links { gap: 2px; } }
@media(max-width: 700px) {
  .app-nav { padding: 16px; gap: 14px; }
  .brand { font-size: 16px; }
  .nav-links { width: 100%; justify-content: space-between; gap: 6px; }
  .nav-links > a { padding: 8px 6px; font-size: 12px; gap: 5px; }
  .user-account { font-size: 12px; border: none; padding: 0; gap: 5px; }
  .user-avatar { display: none; }
  .workspace-heading, .report-heading { align-items: start; flex-direction: column; gap: 16px; }
  .workspace-heading { margin: 24px auto 20px; padding: 0 16px; }
  .workspace-heading h1, .report h1 { font-size: 25px; }
  .report { padding: 0 16px; margin-top: 24px; }
  .report-tools { width: 100%; }
  .report-tools > * { flex: 1; }
  .filters { gap: 12px; }
  .filters > div:nth-child(3) { flex-basis: 100%; }
  .summary { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .summary .metric { padding: 14px; min-height: 96px; }
  .summary .metric strong { font-size: 18px; }
  .report-breakdown { grid-template-columns: 1fr; gap: 24px; }
  .customer-fields { grid-template-columns: 1fr; gap: 10px; }
  .invoice-box, .bill-list { padding: 20px 16px; }
}
@media print {
  .summary { gap: 10px; grid-template-columns: repeat(6,minmax(0,1fr)); }
  .summary .metric { padding: 6px 0; border: none; background: white; color: black; min-height: 0; }
  .summary .metric strong { font-size: 12px; }
  .summary .metric-total span { color: black; }
  .report .table-scroll { border: none; }
  .report .description { font-size: 10px; }
  .report tbody tr:hover { background: white; }
}
