:root {
    --ink: #172033;
    --muted: #6b7488;
    --line: #e8eaf0;
    --primary: #5d45e8;
    --primary-dark: #4933ce;
    --bg: #f7f8fc;
    --sidebar: #141827
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    font-family: Inter, Arial, sans-serif;
    color: var(--ink);
    background: var(--bg)
}

.translation-transition body::before {
    content: 'தமிழில் ஏற்றுகிறது…';
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: grid;
    place-items: center;
    color: var(--primary);
    background: var(--bg);
    font-size: 15px;
    font-weight: 700
}

a {
    text-decoration: none;
    color: inherit
}

button,
input {
    font: inherit
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    font-size: 21px;
    font-weight: 800
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: linear-gradient(135deg, #7d65ff, #4b35db);
    color: #fff;
    box-shadow: 0 8px 18px #4d38d94a
}

.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.08fr .92fr;
    background: #fff
}

.login-brand {
    padding: 52px 7vw;
    display: flex;
    flex-direction: column;
    color: #fff;
    background: radial-gradient(circle at 80% 20%, #704fea55, transparent 34%), linear-gradient(145deg, #18162b, #25184c 65%, #322171)
}

.login-brand .brand {
    margin-bottom: auto
}

.login-copy {
    max-width: 620px;
    margin: 80px 0
}

.eyebrow {
    color: #7662e8;
    font-size: 11px;
    letter-spacing: 2px;
    font-weight: 800
}

.login-brand .eyebrow {
    color: #bdb4ff
}

.login-copy h1 {
    font-size: 52px;
    line-height: 1.1;
    margin: 18px 0
}

.login-copy p {
    color: #c9c6dc;
    line-height: 1.8;
    font-size: 16px;
    max-width: 550px
}

.feature-row {
    display: flex;
    gap: 30px;
    color: #cbc7df;
    font-size: 13px
}

.feature-row span::first-letter {
    color: #8b78ff
}

.login-card-wrap {
    display: grid;
    place-items: center;
    padding: 40px
}

.login-card {
    width: min(430px, 100%)
}

.mobile-brand {
    display: none
}

.login-icon {
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    border-radius: 15px;
    background: #eeeaff;
    color: var(--primary);
    font-size: 24px
}

.login-card h2 {
    font-size: 32px;
    margin: 20px 0 8px
}

.muted,
.page-head p,
.section-title p {
    color: var(--muted)
}

.login-card form {
    margin-top: 30px
}

.login-card label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin: 18px 0 8px
}

.input-wrap {
    height: 50px;
    border: 1px solid #dfe2e9;
    border-radius: 10px;
    display: flex;
    align-items: center;
    padding: 0 14px;
    gap: 10px
}

.input-wrap:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px #5d45e814
}

.input-wrap input {
    border: 0;
    outline: 0;
    width: 100%;
    height: 100%
}

.eye {
    border: 0;
    background: none;
    color: var(--muted);
    font-size: 12px;
    cursor: pointer
}

.login-card label.check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: var(--muted)
}

.primary-btn {
    border: 0;
    border-radius: 10px;
    color: #fff;
    background: var(--primary);
    height: 51px;
    width: 100%;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 20px #5d45e830
}

.primary-btn:hover {
    background: var(--primary-dark)
}

.demo-hint {
    padding: 12px;
    background: #f5f3ff;
    border-radius: 9px;
    text-align: center;
    font-size: 11px;
    color: var(--muted);
    margin-top: 20px
}

.alert {
    padding: 12px;
    margin-top: 18px;
    background: #fff0f0;
    color: #c73f4a;
    border-radius: 8px;
    font-size: 13px
}

.app-shell {
    min-height: 100vh
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 240px;
    background: var(--sidebar);
    color: #acb0c2;
    /* padding: 28px 18px; */
    display: flex;
    flex-direction: column;
    z-index: 20
}

.sidebar-brand {
    color: #fff;
    padding: 0 10px 27px
}

.sidebar-brand small {
    display: block;
    font-size: 8px;
    letter-spacing: 1.8px;
    color: #74798e;
    margin-top: 3px
}

.sidebar nav p {
    font-size: 9px;
    letter-spacing: 1.6px;
    color: #656a7f;
    padding: 10px 13px
}

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 11px 13px;
    border-radius: 8px;
    font-size: 13px;
    margin: 2px 0
}

.sidebar nav a:hover,
.sidebar nav a.active {
    background: #292546;
    color: #fff
}

.sidebar nav a.active {
    box-shadow: inset 3px 0 #806cff
}

.sidebar nav i {
    width: 19px;
    text-align: center;
    font-style: normal;
    font-size: 17px
}

.sidebar-footer {
    margin-top: auto
}

.help {
    background: #201e35;
    border: 1px solid #343149;
    border-radius: 10px;
    padding: 13px;
    display: flex;
    flex-direction: column;
    font-size: 12px
}

.help span {
    color: #777c90;
    font-size: 10px;
    margin-top: 5px
}

.sidebar-footer>small {
    display: block;
    text-align: center;
    margin-top: 16px;
    color: #555b70;
    font-size: 9px
}

.main-area {
    margin-left: 250px
}

.topbar {
    height: 60px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 35px;
    position: sticky;
    top: 0;
    z-index: 10
}

.menu-btn {
    display: none
}

.top-search {
    width: 350px;
    color: #9ba1af;
    display: flex;
    align-items: center;
    gap: 8px
}

.top-search input {
    border: 0;
    outline: 0;
    width: 100%
}

.top-search kbd {
    white-space: nowrap;
    border: 1px solid #e2e4ea;
    padding: 3px 6px;
    border-radius: 5px;
    font-size: 9px
}

.top-actions,
.admin {
    display: flex;
    align-items: center;
    gap: 12px
}

.icon-btn,
.logout,
.menu-btn {
    border: 0;
    background: none;
    cursor: pointer;
    font-size: 20px
}

.icon-btn {
    position: relative
}

.icon-btn span {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #ef5064;
    border-radius: 50%;
    right: 2px
}

.avatar {
    width: 35px;
    height: 35px;
    border-radius: 10px;
    background: #e8e4ff;
    color: var(--primary);
    display: grid;
    place-items: center;
    font-weight: 700
}

.admin div {
    display: flex;
    flex-direction: column;
    font-size: 11px
}

.admin small {
    color: var(--muted);
    font-size: 9px;
    margin-top: 2px
}

.logout {
    color: #8890a0
}

.content {
    padding: 35px;
    max-width: 1600px;
    margin: auto
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 28px
}

.page-head h1 {
    margin: 7px 0;
    font-size: 28px
}

.page-head p {
    margin: 0;
    font-size: 13px
}

.primary-btn.compact {
    width: auto;
    height: 42px;
    padding: 0 18px;
    font-size: 12px
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px
}

.stats article {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 13px;
    padding: 20px;
    display: flex;
    gap: 15px;
    align-items: flex-start
}

.stat-icon {
    width: 43px;
    height: 43px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    font-size: 20px
}

.stat-icon svg {
    width: 23px;
    height: 23px;
}

.dashboard-summary-section {
    margin-bottom: 24px;
}

.dashboard-summary-section>h2 {
    margin: 0 0 12px;
    color: var(--text-dark);
    font-size: 18px;
}

.purple {
    background: #eeeaff;
    color: #6049e5
}

.green {
    background: #e2f8ee;
    color: #1da36b
}

.orange {
    background: #fff0df;
    color: #e1882d
}

.blue {
    background: #e6f2ff;
    color: #3485d4
}

.stats p {
    font-size: 11px;
    color: var(--muted);
    margin: 2px 0 8px
}

.stats h2 {
    font-size: 21px;
    margin: 0 0 7px
}

.stats small {
    font-size: 9px;
    color: #9097a6
}

.stats .up {
    color: #1b9a69
}

.section {
    margin-top: 32px
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px
}

.section-title h2 {
    font-size: 16px;
    margin: 0 0 5px
}

.section-title p {
    font-size: 10px;
    margin: 0
}

.section-title a {
    font-size: 11px;
    color: var(--primary);
    font-weight: 700
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 13px
}

.module-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 17px;
    display: flex;
    align-items: center;
    gap: 13px;
    transition: .2s
}

.module-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px #25263b0d;
    border-color: #d8d2fc
}

.module-icon {
    width: 39px;
    height: 39px;
    border-radius: 10px;
    background: #eeeaff;
    display: grid;
    place-items: center;
    color: var(--primary);
    font-size: 18px
}

.module-card:nth-child(2n) .module-icon {
    background: #e7f7ef;
    color: #219766
}

.module-card:nth-child(3n) .module-icon {
    background: #fff0df;
    color: #d47b20
}

.module-card>span:nth-child(2) {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 5px
}

.module-card b {
    font-size: 12px
}

.module-card small {
    color: var(--muted);
    font-size: 9px
}

.module-card em {
    font-style: normal;
    color: #a5aab5;
    font-size: 22px
}

.bottom-grid {
    display: grid;
    grid-template-columns: 1.7fr 1fr;
    gap: 18px;
    margin-top: 26px
}

.panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 13px;
    padding: 20px
}

.empty {
    text-align: center;
    padding: 26px
}

.empty>span,
.module-page-icon {
    display: grid;
    place-items: center;
    margin: auto;
    width: 48px;
    height: 48px;
    border-radius: 13px;
    background: #f0edff;
    color: var(--primary);
    font-size: 22px
}

.empty h3 {
    font-size: 13px;
    margin: 12px 0 5px
}

.empty p,
.module-page p {
    color: var(--muted);
    font-size: 10px
}

.empty a {
    font-size: 10px;
    font-weight: 700;
    color: var(--primary)
}

.stock-row {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #f0f1f4;
    padding: 15px 2px;
    font-size: 11px
}

.dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    margin-right: 7px
}

.green-dot {
    background: #27b779
}

.orange-dot {
    background: #ef9b3b
}

.red-dot {
    background: #ed5564
}

.wide-link {
    display: block;
    background: #f5f3ff;
    color: var(--primary);
    font-size: 10px;
    font-weight: 700;
    text-align: center;
    padding: 11px;
    border-radius: 8px;
    margin-top: 16px
}

.module-page {
    text-align: center;
    padding: 70px 30px
}

.module-page h2 {
    font-size: 18px
}

.module-page .primary-btn {
    margin: 20px auto 0
}

.module-page-icon {
    width: 62px;
    height: 62px;
    font-size: 28px
}

@media(max-width:1100px) {
    .stats {
        grid-template-columns: repeat(2, 1fr)
    }
}

@media(max-width:900px) {
    .sidebar {
        transform: translateX(-100%);
        transition: .25s
    }

    .sidebar.open {
        transform: translateX(0)
    }

    .main-area {
        margin-left: 0
    }

    .menu-btn {
        display: block
    }

    .top-search {
        display: none
    }

    .content {
        padding: 25px
    }

    .login-shell {
        grid-template-columns: 1fr
    }

    .login-brand {
        display: none
    }

    .mobile-brand {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 45px;
        font-weight: 800
    }

    .login-card-wrap {
        min-height: 100vh
    }
}

@media(max-width:650px) {

    .module-grid,
    .bottom-grid,
    .stats {
        grid-template-columns: 1fr
    }

    .topbar {
        padding: 0 18px
    }

    .content {
        padding: 20px 15px
    }

    .admin div {
        display: none
    }

    .page-head {
        align-items: flex-start;
        gap: 20px
    }

    .page-head .primary-btn {
        white-space: nowrap
    }

    .login-card-wrap {
        padding: 25px
    }
}

/* Refreshed navy and teal theme with accessible type sizing. */
:root {
    --ink: #102a43;
    --muted: #627d98;
    --line: #d9e2ec;
    --primary: #008f83;
    --primary-dark: #00756b;
    --bg: #f0f4f8;
    --sidebar: #102a43
}

body {
    font-size: 15px
}

.brand {
    font-size: 23px
}

.brand-mark {
    background: linear-gradient(135deg, #18b7a5, #00796f);
    box-shadow: 0 8px 18px #008f8340
}

.login-brand {
    background: radial-gradient(circle at 80% 20%, #19b8a755, transparent 34%), linear-gradient(145deg, #102a43, #164e63 65%, #087f75)
}

.login-brand .eyebrow {
    color: #99f6e4
}

.login-icon {
    background: #dff8f4
}

.eyebrow {
    color: #008f83;
    font-size: 12px
}

.input-wrap:focus-within {
    box-shadow: 0 0 0 3px #008f831c
}

.primary-btn {
    box-shadow: 0 8px 20px #008f8330
}

.demo-hint {
    background: #e5f7f4
}

.sidebar {
    width: 240px
}

.main-area {
    margin-left: 240px
}

.sidebar nav a {
    font-size: 15px;
    padding: 12px 13px
}

.sidebar nav a:hover,
.sidebar nav a.active {
    background: #164e63
}

.sidebar nav a.active {
    box-shadow: inset 3px 0 #2dd4bf
}

.sidebar nav p,
.sidebar-brand small {
    font-size: 10px
}

.help {
    background: #163b55;
    font-size: 14px
}

.help span,
.sidebar-footer>small {
    font-size: 11px
}

.top-search,
.admin div {
    font-size: 14px
}

.admin small,
.top-search kbd {
    font-size: 11px
}

.page-head h1 {
    font-size: 32px
}

.page-head p {
    font-size: 15px
}

.primary-btn.compact {
    font-size: 14px
}

.stats {
    grid-template-columns: repeat(5, 1fr);
    gap: 14px
}

.stats.stats-today {
    grid-template-columns: repeat(4, 1fr);
}

.stats article {
    padding: 18px
}

.stats p {
    font-size: 13px
}

.stats h2 {
    font-size: 23px
}

.stats small {
    font-size: 11px
}

.stat-icon.teal {
    background: #dff8f4;
    color: #008f83
}

.stat-icon.red {
    background: #fee9e7;
    color: #d64545
}

.section-title h2 {
    font-size: 18px
}

.section-title p,
.section-title a {
    font-size: 13px
}

.module-card b {
    font-size: 15px
}

.module-card small {
    font-size: 12px;
    line-height: 1.4
}

.module-icon {
    background: #dff8f4;
    color: #008f83
}

.module-card:hover {
    border-color: #84d9cf
}

.empty h3 {
    font-size: 16px
}

.empty p,
.empty a,
.stock-row,
.wide-link {
    font-size: 13px
}

.quick-actions {
    margin: 24px 0;
    background: linear-gradient(110deg, #0f766e, #0e9f8f);
    padding: 20px 24px;
    border-radius: 14px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 26px
}

.quick-actions h2 {
    font-size: 17px;
    white-space: nowrap
}

.quick-actions>div {
    display: flex;
    gap: 10px;
    flex-wrap: wrap
}

.quick-actions a {
    background: #ffffff1f;
    border: 1px solid #ffffff38;
    border-radius: 8px;
    padding: 10px 13px;
    font-size: 12px;
    font-weight: 600
}

.quick-actions a:hover {
    background: #fff;
    color: #087f75
}

.chart-grid {
    display: grid;
    grid-template-columns: 1.65fr 1fr;
    gap: 18px;
    margin: 26px 0
}

.section-title select {
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 7px;
    color: var(--muted);
    background: white
}

.dashboard-period {
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--muted);
    background: #fff;
    font-size: 12px;
}

.bar-chart {
    height: 215px;
    display: flex;
    align-items: flex-end;
    gap: 5%;
    padding: 20px 10px 0;
    border-bottom: 1px solid var(--line);
    background: repeating-linear-gradient(to bottom, #fff 0, #fff 52px, #edf2f7 53px)
}

.bar-chart div {
    height: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    gap: 10px
}

.bar-chart .chart-bar {
    position: relative
}

.chart-tooltip {
    position: absolute;
    z-index: 5;
    bottom: 34px;
    left: 50%;
    width: max-content;
    padding: 7px 9px;
    border-radius: 6px;
    background: #102a43;
    color: #fff;
    font-size: 11px;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 5px);
    transition: .18s
}

.chart-bar:hover .chart-tooltip {
    opacity: 1;
    transform: translate(-50%, 0)
}

.bar-chart span {
    width: 70%;
    min-height: 5px;
    border-radius: 6px 6px 0 0;
    background: linear-gradient(#20bba9, #008f83)
}

.bar-chart small {
    font-size: 11px;
    color: var(--muted)
}

.payment-summary {
    display: flex;
    align-items: center;
    gap: 25px;
    padding: 12px
}

.donut {
    width: 130px;
    height: 130px;
    border: 17px solid #dff8f4;
    border-top-color: #008f83;
    border-radius: 50%;
    display: grid;
    place-items: center;
    flex-shrink: 0
}

.donut span {
    text-align: center;
    font-size: 17px;
    font-weight: 800
}

.donut small {
    display: block;
    font-size: 10px;
    color: var(--muted)
}

.payment-summary ul {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%
}

.payment-summary li {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 0;
    font-size: 12px
}

.payment-summary li b {
    margin-left: auto
}

.payment-summary li i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #008f83
}

.payment-summary li i.upi {
    background: #3b82f6
}

.payment-summary li i.card {
    background: #f59e0b
}

.payment-summary li i.bank {
    background: #8b5cf6
}

.payment-summary li i.credit {
    background: #ef4444
}

.module-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 16px
}

.module-toolbar button {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 9px;
    padding: 0 18px;
    color: var(--ink);
    cursor: pointer
}

.record-search {
    height: 44px;
    flex: 1;
    max-width: 440px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 9px;
    display: flex;
    align-items: center;
    padding: 0 14px;
    gap: 8px
}

.record-search input {
    border: 0;
    outline: 0;
    width: 100%;
    font-size: 14px
}

.table-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid var(--line);
    padding-bottom: 15px
}

.table-head h2 {
    font-size: 18px;
    margin: 0 0 5px
}

.table-head p {
    font-size: 13px;
    color: var(--muted);
    margin: 0
}

.record-count {
    background: #e5f7f4;
    color: #087f75;
    border-radius: 20px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 700
}

.data-panel .empty {
    padding: 45px
}

/* .data-panel .primary-btn {
    margin: 18px auto 0
} */

.detail-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 18px;
    margin-top: 20px
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 9px
}

.field-grid span,
.feature-list span {
    background: #f7fafc;
    border: 1px solid #e4ebf1;
    border-radius: 8px;
    padding: 10px;
    font-size: 12px;
    color: #486581
}

.field-grid i,
.feature-list i {
    color: #008f83;
    font-style: normal;
    margin-right: 7px;
    font-weight: 800
}

.feature-list {
    display: grid;
    gap: 8px
}

@media(max-width:1300px) {
    .stats {
        grid-template-columns: repeat(3, 1fr)
    }

    .stats.stats-today {
        grid-template-columns: repeat(2, 1fr)
    }

    .field-grid {
        grid-template-columns: repeat(2, 1fr)
    }
}

@media(max-width:900px) {
    .main-area {
        margin-left: 0
    }

    .chart-grid,
    .detail-grid {
        grid-template-columns: 1fr
    }

    .quick-actions {
        align-items: flex-start;
        flex-direction: column
    }

    .sidebar {
        width: 270px
    }
}

@media(max-width:650px) {
    .stats {
        grid-template-columns: 1fr
    }

    .stats.stats-today {
        grid-template-columns: 1fr
    }

    .field-grid {
        grid-template-columns: 1fr
    }

    .chart-grid {
        grid-template-columns: 1fr
    }

    .payment-summary {
        flex-direction: column
    }

    .module-toolbar {
        flex-wrap: wrap
    }

    .record-search {
        max-width: none;
        flex-basis: 100%
    }
}

.success-alert {
    background: #dff8f4;
    border: 1px solid #9de5db;
    color: #087f5b;
    padding: 13px 16px;
    border-radius: 10px;
    margin-bottom: 18px;
    font-size: 14px;
    font-weight: 600
}

.toolbar-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 9px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink)
}

.records-table-wrap {
    overflow: auto
}

.records-table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap
}

.records-table th {
    text-align: left;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .4px;
    background: #f7fafc
}

.records-table th,
.records-table td {
    padding: 14px 13px;
    border-bottom: 1px solid var(--line)
}

.records-table td {
    font-size: 13px;
    max-width: 230px;
    overflow: hidden;
    text-overflow: ellipsis
}

.row-actions {
    display: flex;
    align-items: center;
    gap: 8px
}

.row-actions a,
.row-actions button {
    border: 0;
    border-radius: 6px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer
}

.row-actions a {
    background: #e5f7f4;
    color: #087f75
}

.row-actions button {
    background: #fee9e7;
    color: #c53030
}

.pagination {
    display: flex;
    justify-content: center;
    padding: 22px 12px 4px
}

.pagination nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 11px
}

.pagination p {
    margin: 0;
    color: var(--muted);
    font-size: 12px
}

.pagination-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex-wrap: wrap
}

.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 34px;
    color: var(--muted);
    font-weight: 700
}

.module-table-panel.loading .records-table-wrap,
.module-table-panel.loading .pagination {
    opacity: .45;
    pointer-events: none
}

.pagination-page,
.pagination-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: #486581;
    font-size: 13px;
    font-weight: 700;
    transition: .15s ease
}

.pagination-page:hover,
.pagination-arrow:hover {
    border-color: #79cfc5;
    color: var(--primary);
    background: #f0fdfa
}

.pagination-page.active {
    border-color: var(--primary);
    color: #fff;
    background: var(--primary);
    box-shadow: 0 4px 10px rgba(0, 143, 131, .22)
}

.pagination-arrow {
    font-size: 21px;
    line-height: 1
}

.pagination-arrow.disabled {
    color: #b8c4ce;
    background: #f7fafc;
    cursor: not-allowed
}

.record-form {
    padding: 0;
    overflow: hidden
}

.form-section-title {
    padding: 22px 25px;
    border-bottom: 1px solid var(--line);
    background: #f8fafc
}

.form-section-title h2 {
    margin: 0 0 5px;
    font-size: 19px
}

.form-section-title p {
    margin: 0;
    color: var(--muted);
    font-size: 13px
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 25px
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px
}

.form-group.full-field {
    grid-column: 1/-1
}

.form-group label {
    font-size: 13px;
    font-weight: 700;
    color: #334e68
}

.form-group label b {
    color: #dc3545
}

.form-group input,
.form-group textarea {
    width: 100%;
    border: 1px solid #bcccdc;
    border-radius: 8px;
    background: #fff;
    padding: 11px 12px;
    outline: 0;
    font-size: 14px;
    color: var(--ink)
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px #008f8318
}

.form-group textarea {
    resize: vertical
}

.form-group small {
    color: #c53030;
    font-size: 12px
}

.form-actions {
    border-top: 1px solid var(--line);
    padding: 18px 25px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 14px;
    background: #f8fafc
}

.form-actions>a {
    font-size: 14px;
    font-weight: 600;
    color: #425466;
    background: #e8eef5;
    border: 1px solid #c5d1de;
    border-radius: 8px;
    padding: 11px 18px;
    transition: background .2s ease, border-color .2s ease, color .2s ease
}

.form-actions>a:hover {
    color: #17324d;
    background: #dbe6f0;
    border-color: #aebfd0
}

.alert ul {
    margin: 8px 0 0;
    padding-left: 20px
}

.data-panel {
    padding-bottom: 20px
}

@media(max-width:1000px) {
    .form-grid {
        grid-template-columns: repeat(2, 1fr)
    }

    .product-price-card {
        grid-template-columns: repeat(2, 1fr)
    }
}

@media(max-width:650px) {
    .form-grid {
        grid-template-columns: 1fr;
        padding: 18px
    }

    .form-group.full-field {
        grid-column: auto
    }

    .records-table {
        min-width: 750px
    }

    .page-head {
        flex-wrap: wrap
    }

    .product-form-grid,
    .product-price-card {
        grid-template-columns: 1fr
    }

    .product-price-card {
        margin: 0 18px 18px
    }
}

/* .sidebar nav {
    padding-top: 18px
} */

.sidebar nav i svg,
.sidebar-logout svg {
    width: 21px;
    height: 21px;
    display: block
}

.sidebar nav i {
    display: grid;
    place-items: center
}

.sidebar-footer form {
    width: 100%
}

.sidebar-logout {
    width: 100%;
    border: 1px solid #31526b;
    background: #163b55;
    color: #fff;
    border-radius: 9px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer
}

.sidebar-logout:hover {
    background: #1b556e
}

.topbar {
    height: 60px
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 245px
}

.top-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    font-size: 18px;
    font-weight: 800;
    color: var(--ink)
}

.top-brand img,
.settings-logo-preview img {
    width: 45px;
    height: 45px;
    object-fit: contain;
    border-radius: 10px;
    background: #fff
}

.top-brand small {
    display: block;
    font-size: 9px;
    letter-spacing: 1.5px;
    color: var(--muted);
    margin-top: 3px
}

.top-search svg {
    width: 18px;
    height: 18px
}

.user-menu {
    position: relative
}

.user-menu>button {
    border: 0;
    background: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 7px;
    border-radius: 10px
}

.user-menu>button:hover {
    background: #f0f4f8
}

.user-summary {
    display: flex;
    flex-direction: column;
    text-align: left
}

.user-summary b {
    font-size: 13px
}

.user-summary small {
    font-size: 10px;
    color: var(--muted);
    max-width: 165px;
    overflow: hidden;
    text-overflow: ellipsis
}

.user-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 12px);
    width: 260px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 18px 45px #102a4329;
    padding: 9px;
    z-index: 50
}

.user-dropdown.show {
    display: block
}

.user-dropdown-head {
    display: flex;
    gap: 11px;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 7px
}

.user-dropdown-head .avatar svg {
    width: 20px
}

.user-dropdown-head div {
    display: flex;
    flex-direction: column;
    min-width: 0
}

.user-dropdown-head b {
    font-size: 13px
}

.user-dropdown-head small {
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.user-dropdown a,
.user-dropdown button {
    width: 100%;
    border: 0;
    background: none;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 7px;
    color: var(--ink);
    font-size: 13px;
    cursor: pointer;
    text-align: left
}

.user-dropdown a:hover,
.user-dropdown button:hover {
    background: #e5f7f4;
    color: #087f75
}

.user-dropdown svg {
    width: 18px;
    height: 18px
}

.module-icon svg,
.empty>span svg {
    width: 22px;
    height: 22px
}

.form-group select {
    width: 100%;
    border: 1px solid #bcccdc;
    border-radius: 8px;
    background: #fff;
    padding: 11px 12px;
    outline: 0;
    font-size: 14px;
    color: var(--ink)
}

.form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px #008f8318
}

.product-form-grid {
    grid-template-columns: repeat(4, 1fr)
}

.category-selector,
.supplier-selector,
.customer-selector,
.expense-category-selector,
.purchase-product-selector {
    position: relative
}

.field-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px
}

.field-add-button {
    border: 0;
    background: transparent;
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer
}

.field-add-button:hover {
    color: #087f75;
    text-decoration: underline
}

.expense-form-grid {
    align-items: start
}

.category-combobox {
    display: flex;
    align-items: center;
    border: 1px solid #bcccdc;
    border-radius: 8px;
    background: #fff
}

.category-combobox:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px #008f8318
}

.category-combobox input {
    flex: 1;
    min-width: 0;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important
}

.combobox-search-icon {
    display: grid;
    flex: 0 0 36px;
    place-items: center;
    padding-left: 8px;
    color: #7c8da1
}

.combobox-search-icon svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-width: 1.6
}

.category-combobox button {
    display: grid;
    flex: 0 0 42px;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 0;
    background: transparent;
    color: var(--ink);
    font-size: 18px;
    cursor: pointer
}

.category-combobox button svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    transition: transform .15s ease
}

.category-combobox button[aria-expanded="true"] svg {
    transform: rotate(180deg)
}

.purchase-product-selector .category-options {
    min-width: 220px
}

.category-options {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 20;
    display: none;
    max-height: 180px;
    overflow-y: auto;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 25px rgba(16, 42, 67, .16)
}

.category-options.show {
    display: block
}

.purchase-product-selector .product-dropdown-floating {
    position: fixed;
    inset: auto;
    margin: 0;
    min-width: 0;
    z-index: 1000;
}

.category-options button {
    display: block;
    width: 100%;
    border: 0;
    border-radius: 6px;
    padding: 10px 12px;
    background: transparent;
    color: var(--ink);
    text-align: left;
    cursor: pointer;
    border-bottom: 1px solid #edf2f7;
    border-radius: 0
}

.category-options button:last-child {
    border-bottom: 0
}

.category-options button:hover {
    background: #e5f7f4;
    color: #087f75
}

.category-options button.active {
    background: #d9f3ef;
    color: #087f75;
    outline: 1px solid #79cfc5
}

.category-options button[hidden] {
    display: none
}

.category-empty {
    padding: 10px 12px;
    color: var(--muted);
    font-size: 13px
}

.product-price-card {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    margin: 0 25px 25px;
    overflow: hidden;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: 10px
}

.product-price-card>div {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 16px;
    background: #fff
}

.product-price-card span {
    color: var(--muted);
    font-size: 12px
}

.product-price-card b {
    color: var(--ink);
    font-size: 19px
}

.product-price-card .selling-total {
    background: #e5f7f4
}

.product-price-card .selling-total b {
    color: var(--primary)
}

.form-group label span {
    color: var(--muted);
    font-weight: 500;
    font-size: 11px
}

.settings-logo-section {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 25px;
    border-bottom: 1px solid var(--line)
}

.settings-logo-preview {
    width: 86px;
    height: 86px;
    border-radius: 16px;
    background: #e5f7f4;
    border: 1px dashed #75cfc4;
    display: grid;
    place-items: center;
    color: var(--primary);
    font-size: 31px;
    font-weight: 800;
    overflow: hidden
}

.settings-logo-preview img {
    width: 100%;
    height: 100%;
    border-radius: 0
}

.settings-logo-section h2 {
    font-size: 17px;
    margin: 0 0 5px
}

.settings-logo-section p {
    font-size: 12px;
    color: var(--muted);
    margin: 0 0 12px
}

.upload-button {
    display: inline-block;
    background: #e5f7f4;
    color: #087f75;
    border-radius: 7px;
    padding: 9px 13px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer
}

.settings-grid {
    grid-template-columns: repeat(2, 1fr)
}

@media(max-width:900px) {
    .topbar-left {
        min-width: auto
    }

    .top-brand>span:last-child {
        display: none
    }

    .user-summary {
        display: none
    }
}

@media(max-width:650px) {
    .settings-grid {
        grid-template-columns: 1fr
    }

    .topbar {
        padding: 0 12px
    }

    .top-brand img,
    .top-brand .brand-mark {
        width: 38px;
        height: 38px
    }

    .settings-logo-section {
        align-items: flex-start
    }
}

/* Full-width application header. The navigation begins below it. */
.topbar {
    position: fixed;
    inset: 0 0 auto 0;
    width: 100%;
    height: 60px;
    z-index: 40;
    justify-content: space-between;
    padding: 0 28px;
    box-shadow: 0 1px 0 var(--line);
    background: #fff
}

.sidebar {
    top: 44px;
    bottom: 0;
    height: calc(100vh - 60px);
    padding-top: 16px
}

.main-area {
    padding-top: 50px;
    min-height: 100vh
}

.topbar-left {
    min-width: 0
}

.user-menu {
    margin-left: auto
}

.user-menu>button {
    min-height: 52px
}

.user-menu>button .avatar svg {
    width: 21px;
    height: 21px
}

.user-menu>button[aria-expanded="true"] {
    background: #e5f7f4
}

.user-dropdown {
    top: calc(100% + 10px);
    border-radius: 14px;
    box-shadow: 0 20px 55px rgba(16, 42, 67, .22)
}

@media(max-width:900px) {
    .sidebar {
        top: 82px;
        height: calc(100vh - 82px)
    }

    .main-area {
        margin-left: 0
    }

    .topbar {
        padding: 0 18px
    }
}

@media(max-width:520px) {
    .topbar {
        height: 72px;
        padding: 0 12px
    }

    .sidebar {
        top: 72px;
        height: calc(100vh - 72px)
    }

    .main-area {
        padding-top: 72px
    }

    .user-chevron {
        display: none
    }

    .user-menu>button {
        padding: 5px
    }

    .user-dropdown {
        position: fixed;
        top: 66px;
        right: 10px;
        width: min(280px, calc(100vw - 20px))
    }
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(16, 42, 67, .05);
    color: var(--muted);
    font-size: 13px
}

.page-header-card {
    margin-bottom: 24px;
    padding: 20px 22px;
    background: linear-gradient(135deg, #f0fdfa 0%, #eef6ff 100%);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(16, 42, 67, .06)
}

.page-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 12px
}

.page-title-row h1 {
    margin: 0;
    font-size: 30px
}

.page-title-row+.page-head {
    margin-bottom: 0
}

.breadcrumb a {
    color: var(--primary);
    font-weight: 600
}

.breadcrumb a:hover {
    text-decoration: underline
}

.module-page-head {
    margin-bottom: 0
}

.module-page-head h1 {
    margin-top: 0
}

.module-table-panel {
    padding: 18px;
    overflow: hidden;
    background: #fff
}

.module-header {
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none
}

.module-header .page-title-row {
    margin-bottom: 12px
}

.table-card-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 0 16px;
    background: #fff;
    border-bottom: 0
}

.table-search {
    display: flex;
    align-items: center;
    gap: 8px;
    width: min(520px, 100%)
}

.table-search.sales-index-filters {
    width: min(850px, 100%)
}

.table-search.sales-index-filters input[type="date"] {
    flex: 0 1 165px
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px
}

.export-button {
    color: #087f5b;
    border-color: #9bd8c3;
    background: #ecfdf5
}

.table-search input,
.table-search select {
    flex: 1;
    min-width: 160px;
    height: 42px;
    padding: 0 12px;
    border: 1px solid #bcccdc;
    border-radius: 8px;
    outline: 0;
    color: var(--ink);
    background: #fff
}

.table-search select {
    min-width: 180px;
    cursor: pointer
}

.table-search input:focus,
.table-search select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px #008f8318
}

.module-table-panel>.records-table-wrap {
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 9px
}

.table-filters {
    display: grid;
    grid-template-columns: minmax(240px, 1.6fr) minmax(170px, .75fr) minmax(170px, .75fr) auto;
    gap: 12px;
    align-items: end;
    padding: 0 18px 18px;
    background: #fff;
    border-bottom: 1px solid var(--line)
}

.filter-field {
    display: flex;
    flex-direction: column;
    gap: 7px
}

.filter-field label {
    color: var(--ink);
    font-size: 12px;
    font-weight: 700
}

.filter-field input {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid #bcccdc;
    border-radius: 8px;
    outline: 0;
    color: var(--ink);
    background: #fff
}

.filter-field input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px #008f8318
}

.filter-actions {
    display: flex;
    align-items: center;
    gap: 8px
}

.filter-actions .primary-btn,
.filter-actions .toolbar-button {
    height: 42px;
    white-space: nowrap
}

.filter-error {
    padding: 0 18px 14px;
    color: #c53030;
    background: #fff;
    font-size: 12px
}

.table-empty {
    padding: 52px 20px !important;
    color: var(--muted);
    text-align: center !important
}

.row-actions .edit-category-button {
    background: #e5f7f4;
    color: #087f75
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(16, 42, 67, .55)
}

.modal-backdrop.show {
    display: flex
}

.modal-card {
    width: min(460px, 100%);
    overflow: hidden;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 24px 70px rgba(16, 42, 67, .28)
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line)
}

.modal-head h2 {
    margin: 0;
    font-size: 19px
}

.modal-head>button {
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 25px;
    cursor: pointer
}

.modal-head>a {
    color: var(--muted);
    font-size: 25px;
    line-height: 1
}

.bill-modal-card {
    width: min(900px, 100%);
    max-height: calc(100vh - 40px);
    overflow: auto
}

.bill-preview {
    padding: 20px
}

.bill-preview-head {
    text-align: center
}

.bill-preview-head h3,
.bill-preview-head p {
    margin: 3px 0
}

.bill-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 20px;
    margin: 18px 0
}

.bill-items-table {
    width: 100%;
    border-collapse: collapse
}

.bill-items-table th,
.bill-items-table td {
    padding: 9px;
    border: 1px solid var(--line);
    text-align: left
}

.bill-preview-totals {
    display: flex;
    justify-content: flex-end;
    gap: 24px;
    padding-top: 16px
}

.bill-modal-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 9px;
    padding: 16px 20px;
    border-top: 1px solid var(--line);
    background: #f8fafc
}

.print-format-button {
    padding: 11px 16px;
    border-radius: 8px;
    color: #fff;
    background: var(--primary);
    font-size: 13px;
    font-weight: 700
}

.modal-head>a {
    color: var(--muted);
    font-size: 25px;
    line-height: 1
}

.bill-modal-card {
    width: min(900px, 100%);
    max-height: calc(100vh - 40px);
    overflow: auto
}

.bill-preview {
    padding: 20px
}

.bill-preview-head {
    text-align: center
}

.bill-preview-head h3,
.bill-preview-head p {
    margin: 3px 0
}

.bill-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 20px;
    margin: 18px 0
}

.bill-items-table {
    width: 100%;
    border-collapse: collapse
}

.bill-items-table th,
.bill-items-table td {
    padding: 9px;
    border: 1px solid var(--line);
    text-align: left
}

.bill-preview-totals {
    display: flex;
    justify-content: flex-end;
    gap: 24px;
    padding-top: 16px
}

.bill-modal-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 9px;
    padding: 16px 20px;
    border-top: 1px solid var(--line);
    background: #f8fafc
}

.print-format-button {
    padding: 11px 16px;
    border-radius: 8px;
    color: #fff;
    background: var(--primary);
    font-size: 13px;
    font-weight: 700
}

.modal-body {
    padding: 22px 20px
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    background: #f8fafc;
    border-top: 1px solid var(--line)
}

@media(max-width:650px) {
    .page-title-row {
        align-items: flex-start;
        flex-direction: column
    }

    .breadcrumb {
        width: 100%;
        overflow-x: auto;
        white-space: nowrap
    }

    .table-filters {
        grid-template-columns: 1fr
    }

    .filter-actions {
        flex-wrap: wrap
    }

    .table-card-toolbar,
    .table-search {
        align-items: stretch;
        flex-direction: column;
        width: 100%
    }
}

@media(min-width:651px) and (max-width:1150px) {
    .table-filters {
        grid-template-columns: 1fr 1fr
    }
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px
}

.language-switch {
    display: inline-flex;
    padding: 3px;
    border: 1px solid #b8d8d4;
    border-radius: 9px;
    background: #eefaf8
}

.language-option {
    min-width: 38px;
    height: 30px;
    padding: 0 9px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer
}

.language-option.active {
    color: #fff;
    background: var(--primary);
    box-shadow: 0 3px 8px rgba(0, 143, 131, .25)
}

.tamil-typing-status {
    color: var(--muted);
    font-size: 11px;
    white-space: nowrap
}

#google_translate_element,
.goog-te-banner-frame,
.goog-te-balloon-frame,
.goog-te-spinner-pos,
#goog-gt-tt,
.goog-tooltip,
body>.skiptranslate,
.skiptranslate iframe {
    display: none !important
}

html {
    min-height: 100% !important
}

body {
    top: 0 !important
}

.goog-text-highlight {
    background: transparent !important;
    box-shadow: none !important
}

@media(max-width:650px) {
    .tamil-typing-status {
        display: none
    }

    .topbar-actions {
        gap: 5px
    }

    .language-option {
        min-width: 32px;
        padding: 0 6px
    }
}

/* Purchase Module Custom Styles */
.report-panel {
    margin-bottom: 18px;
    padding: 20px;
    overflow: visible;
}

.report-filters {
    display: grid;
    grid-template-columns: minmax(240px, 1.4fr) minmax(170px, .8fr) minmax(170px, .8fr) auto;
    gap: 16px;
    align-items: end;
    width: 100%;
}

.report-filters label {
    display: grid;
    gap: 7px;
    color: var(--text-dark);
    font-weight: 700;
}

.report-filters select,
.report-filters input {
    width: 100%;
    min-height: 46px;
    padding: 0 13px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    color: var(--text-dark);
    font: inherit;
}

.report-filter-actions,
.report-results-head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.report-results {
    padding: 0;
    overflow: hidden;
}

.report-results .records-table-wrap {
    margin: 0;
}

.report-filter-actions .primary-btn,
.report-filter-actions .toolbar-button {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.report-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.report-summary article {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
}

.report-summary span {
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 13px;
}

.report-summary strong {
    color: var(--text-dark);
    font-size: 20px;
}

.report-results-head {
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--line);
}

.report-results-head h2,
.report-results-head p {
    margin: 0;
}

.report-results-head p {
    margin-top: 5px;
    color: var(--muted);
    font-size: 13px;
}

.report-number {
    text-align: right;
    white-space: nowrap;
}

.report-table th,
.report-table td {
    vertical-align: middle;
}

.report-table th {
    white-space: nowrap;
}

.report-table-gst {
    table-layout: fixed;
}

.report-table-gst th,
.report-table-gst td {
    width: 16.666%;
    padding-right: 24px;
}

.report-table-gst th:first-child,
.report-table-gst td:first-child {
    padding-left: 24px;
}

.report-profit {
    color: #15803d !important;
}

.report-loss {
    color: #dc2626 !important;
}

.top-selling-row td {
    background: #ecfdf5;
    color: #166534;
}

.top-selling-badge {
    display: inline-block;
    margin-left: 7px;
    padding: 3px 7px;
    border-radius: 999px;
    background: #16a34a;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
}

@media(max-width:900px) {
    .report-filters {
        grid-template-columns: 1fr 1fr;
    }
}

@media(max-width:650px) {
    .report-filters {
        grid-template-columns: 1fr;
    }

    .report-filter-actions,
    .report-results-head {
        align-items: stretch;
        flex-direction: column;
    }
}

.purchase-items-card {
    margin-top: 24px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 20px;
}
.items-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}
.gst-mode-selector {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
}
.radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}
.items-table {
    width: 100%;
    border-collapse: collapse;
}
.items-table th, .items-table td {
    padding: 10px 12px;
    border: 1px solid var(--line);
    text-align: left;
    font-size: 13px;
}
.items-table th {
    background: #f8fafc;
    font-weight: 600;
}
.items-table input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 13px;
}
.items-table .category-combobox input {
    height: 42px;
    padding: 10px 12px;
    border-radius: 8px 0 0 8px;
}
.remove-row-btn {
    background: #fee2e2;
    color: #dc2626;
    border: none;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}
.remove-row-btn:hover {
    background: #fca5a5;
}
.purchase-summary-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    margin-top: 16px;
}
.bill-wise-gst-fields {
    display: flex;
    align-items: center;
    gap: 16px;
}
.inline-group {
    display: flex;
    align-items: center;
    gap: 8px;
}
.purchase-summary-row {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
}

/* Responsive fit fixes */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

img,
svg,
video,
canvas {
    max-width: 100%;
}

.app-shell,
.main-area,
.content,
.panel,
.page-header-card,
.module-table-panel,
.record-form,
.purchase-items-card {
    min-width: 0;
}

.content {
    width: 100%;
}

.topbar-left,
.topbar-actions,
.top-brand,
.toolbar-actions,
.filter-actions,
.report-filter-actions,
.form-actions,
.modal-actions,
.bill-modal-actions {
    min-width: 0;
}

.top-brand>span,
.page-head h1,
.page-title-row h1,
.section-title h2,
.table-head h2,
.report-results-head h2 {
    overflow-wrap: anywhere;
}

.records-table-wrap,
.table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.items-table,
.bill-items-table {
    min-width: 760px;
}

.module-table-panel>.records-table-wrap {
    max-width: 100%;
}

.table-search {
    min-width: 0;
    flex-wrap: wrap;
}

.table-search input,
.table-search select {
    min-width: min(160px, 100%);
}

.table-search.sales-index-filters input[type="date"] {
    min-width: min(150px, 100%);
}

.report-filters,
.table-filters {
    min-width: 0;
}

.quick-actions,
.payment-summary,
.settings-logo-section,
.bill-wise-gst-fields {
    min-width: 0;
    flex-wrap: wrap;
}

.quick-actions h2 {
    white-space: normal;
}

.purchase-summary-wrap {
    max-width: 100%;
}

.form-grid > *,
.form-group,
.filter-field,
.report-filters > *,
.table-filters > *,
.category-combobox,
.product-price-card > div,
.settings-logo-section > div {
    min-width: 0;
}

.form-group input,
.form-group select,
.form-group textarea,
.filter-field input,
.report-filters input,
.report-filters select {
    min-width: 0;
    max-width: 100%;
}

.form-group label,
.form-group small,
.category-options button,
.purchase-summary-row,
.product-price-card b {
    overflow-wrap: anywhere;
}

@media(min-width:651px) and (max-width:1100px) {
    .record-form .form-grid,
    .product-price-card {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media(max-width:900px) {
    .topbar {
        gap: 12px;
    }

    .sidebar {
        max-width: min(270px, 86vw);
        overflow-y: auto;
    }

    .content {
        max-width: none;
        padding: 24px 18px;
    }

    .page-head,
    .page-title-row,
    .section-title,
    .table-head,
    .report-results-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .page-head .primary-btn,
    .page-title-row .primary-btn,
    .section-title a,
    .record-count {
        width: fit-content;
    }

    .stats,
    .stats.stats-today,
    .module-grid,
    .bottom-grid,
    .chart-grid,
    .detail-grid,
    .report-summary {
        grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
    }

    .table-card-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .table-search,
    .table-search.sales-index-filters {
        width: 100%;
    }

    .toolbar-actions {
        flex-wrap: wrap;
    }

    .report-filters,
    .table-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media(max-width:650px) {
    .topbar {
        height: auto;
        min-height: 68px;
        padding: 8px 12px;
    }

    .topbar-left {
        gap: 9px;
        min-width: 0;
    }

    .topbar-actions {
        flex-shrink: 0;
    }

    .top-brand {
        gap: 8px;
        min-width: 0;
    }

    .top-brand img,
    .top-brand .brand-mark {
        flex: 0 0 36px;
        width: 36px;
        height: 36px;
    }

    .main-area {
        padding-top: 76px;
    }

    .sidebar {
        top: 76px;
        height: calc(100vh - 76px);
    }

    .content {
        padding: 16px 12px;
    }

    .page-header-card,
    .module-table-panel,
    .panel,
    .purchase-items-card {
        padding: 15px;
        border-radius: 10px;
    }

    .page-title-row h1,
    .page-head h1 {
        font-size: 24px;
        line-height: 1.2;
    }

    .stats,
    .stats.stats-today,
    .module-grid,
    .bottom-grid,
    .chart-grid,
    .detail-grid,
    .field-grid,
    .form-grid,
    .product-form-grid,
    .product-price-card,
    .settings-grid,
    .report-filters,
    .table-filters,
    .report-summary {
        grid-template-columns: 1fr;
    }

    .stats article,
    .module-card {
        min-width: 0;
    }

    .quick-actions {
        padding: 16px;
    }

    .quick-actions>div,
    .toolbar-actions,
    .filter-actions,
    .report-filter-actions,
    .form-actions,
    .modal-actions,
    .bill-modal-actions {
        width: 100%;
    }

    .quick-actions a,
    .toolbar-button,
    .filter-actions .primary-btn,
    .filter-actions .toolbar-button,
    .report-filter-actions .primary-btn,
    .report-filter-actions .toolbar-button,
    .form-actions>a,
    .form-actions>.primary-btn,
    .modal-actions button,
    .bill-modal-actions a,
    .bill-modal-actions button {
        flex: 1 1 100%;
        width: 100%;
    }

    .table-search input,
    .table-search select,
    .table-search.sales-index-filters input[type="date"] {
        flex: 1 1 100%;
        width: 100%;
    }

    .form-section-title,
    .form-grid,
    .form-actions {
        padding: 16px;
    }

    .records-table {
        min-width: 720px;
    }

    .bill-meta {
        grid-template-columns: 1fr;
    }

    .bill-preview,
    .modal-body {
        padding: 16px;
    }

    .bill-preview-totals,
    .purchase-summary-wrap {
        align-items: stretch;
        flex-direction: column;
    }

    .bill-wise-gst-fields,
    .inline-group {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }

    .gst-mode-selector {
        align-items: flex-start;
        flex-direction: column;
        gap: 9px;
    }

    .settings-logo-section {
        padding: 16px;
        flex-wrap: wrap;
    }

    .record-form .form-grid,
    .product-price-card,
    .settings-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .form-group input,
    .form-group select,
    .form-group textarea,
    .filter-field input,
    .report-filters input,
    .report-filters select,
    .table-search input,
    .table-search select {
        font-size: 16px;
    }

    .field-label-row {
        flex-wrap: wrap;
    }

    .bill-wise-gst-fields .inline-group input {
        width: 100%;
    }

    .product-price-card {
        margin: 0 16px 16px;
    }
}

@media(max-width:420px) {
    .language-switch {
        padding: 2px;
    }

    .language-option {
        min-width: 29px;
        height: 28px;
        padding: 0 5px;
        font-size: 11px;
    }

    .avatar {
        width: 32px;
        height: 32px;
    }

    .menu-btn {
        font-size: 18px;
    }

    .page-title-row h1,
    .page-head h1 {
        font-size: 22px;
    }

    .records-table {
        min-width: 680px;
    }
}

.product-pricing-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.product-pricing-grid .form-group { min-width: 0; }
@media (max-width: 1100px) {
    .product-pricing-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
    .product-pricing-grid { grid-template-columns: 1fr; }
}

.product-line-actions {
    display: flex;
    justify-content: flex-end;
    padding: 0 26px 20px;
}
#additionalPricingLines .product-pricing-grid {
    position: relative;
}
.remove-product-line {
    position: absolute;
    top: 0;
    right: 12px;
    width: 26px;
    height: 26px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--danger, #dc3545);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.product-line-actions .toolbar-button { cursor: pointer; }
