body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f5f5f5;
}

.app {
    display: flex;
}

.sidebar {
    width: 220px;
    background: #2c3e50;
    color: #fff;
    min-height: 100vh;
}
.user-name {
		font-size: medium;
    color: #1f8918;
	
}
.logo {
    padding: 0px;
    text-align: center;
    background: #1a252f;
}

.menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu li {
    padding: 10px 15px;
}

.menu li a {
    color: #fff;
    text-decoration: none;
    display: block;
}

.menu li a:hover {
    background: #34495e;
}

.menu-title {
    font-size: 12px;
    text-transform: uppercase;
    opacity: 0.7;
}

.content {
    flex: 1;
	margin-left: 230px;
    padding: 20px;
    background: #fff;
    overflow-x: auto; /* prevents breaking layout */
}
.topbar {
    height: 50px;
    background: #ffffff;
    border-bottom: 1px solid #ddd;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar .page-title {
    font-weight: bold;
    color: #333;
}

.topbar .user-name {
    margin-right: 10px;
    font-weight: 600;

}

.topbar .logout {
    color: #c0392b;
    text-decoration: none;
}

.topbar .logout:hover {
    text-decoration: underline;
}
.cards {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: #f8f9fa;
    border: 1px solid #ddd;
    padding: 20px;
    width: 200px;
    text-align: center;
}

.card h3 {
    margin: 0;
    font-size: 28px;
    color: #2c3e50;
}

.card p {
    margin: 5px 0 0;
    color: #555;
}
/* ===== TABLE FIX (VERY IMPORTANT) ===== */

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 5px;
    background: #fff;
}

table th,
table td {
    border: 1px solid #ccc;
    padding: 10px;
    text-align: left;
    vertical-align: middle;
    font-size: 14px;
}

table th {
    background: #f2f2f2;
    font-weight: 600;
}

table tr:nth-child(even) {
    background: #fafafa;
}

/* Prevent weird column shrinking */
table th,
table td {
    white-space: nowrap;
}

.product-cell {
    padding: 4px;
    vertical-align: top;
}

.prod-name-wrap {
    width: 100%;
}

.prod-desc-wrap {
    margin-top: 2px;
}

.item-desc {
    width: 100%;
    height: 26px;
    font-size: 11px;
    resize: none;
    box-sizing: border-box;
}

/* ===== RESPONSIVE TABLE WRAPPER ===== */

.table-wrapper {
    width: 100%;
    overflow-x: auto;      /* horizontal scroll when needed */
    margin-top: 15px;
}

/* Ensure table behaves correctly */
.table-wrapper table {
    width: 100%;
    min-width: 900px;      /* prevents column collapse */
    border-collapse: collapse;
}

/* Table cells */
.table-wrapper th,
.table-wrapper td {
    border: 1px solid #ccc;
    padding: 10px;
    text-align: left;
    white-space: nowrap;  /* prevents vertical stacking */
}

/* Header styling */
.table-wrapper th {
    background: #f2f2f2;
    font-weight: 600;
}

/* ===== FORM VALIDATION ===== */

.error {
    border: 1px solid #e74c3c !important;
    background: #fff6f6;
}

.error-msg {
    color: #e74c3c;
    font-size: 13px;
    margin-top: 5px;
}



.sidebar.collapsed {
    width: 60px;
}

.sidebar.collapsed .menu-text {
    display: none;
}

.content.collapsed {
    margin-left: 60px;
}


.list-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;   /* IMPORTANT */
}

.list-table th, .list-table td {
    border: 1px solid #ddd;
    padding: 4px;
    font-size: 14px;
    text-align: center;
    vertical-align: middle;
}

.list-table th {
    background: #f3f3f3;
    font-weight: bold;
}

.list-table input,
.list-table select {
    width: 100%;
    box-sizing: border-box;
    font-size: 12px;
}

.submenu {
    display: none;
    padding-left: 10px;
}

.menu-group.open .submenu {
    display: block;
}

.menu-title {
    cursor: pointer;
    padding: 10px;
    background: #111827;
    font-size: 12px;
    text-transform: uppercase;
}

.menu a.active {
    background: #2563eb;
}
<div class="content main-content" id="mainContent">


.list-table th:nth-child(1) { width: 160px; } /* Product */
.list-table th:nth-child(2) { width: 120px; } /* Batch */
.list-table th:nth-child(3) { width: 70px; }  /* MRP */
.list-table th:nth-child(4) { width: 70px; }  /* Avl */
.list-table th:nth-child(5) { width: 60px; }  /* Qty */
.list-table th:nth-child(6) { width: 110px; } /* Sell */
.list-table th:nth-child(7) { width: 60px; }  /* Disc Type */
.list-table th:nth-child(8) { width: 70px; }  /* Disc Val */
.list-table th:nth-child(9) { width: 90px; }  /* Final */
.list-table th:nth-child(10){ width: 60px; }  /* GST */
.list-table th:nth-child(11){ width: 100px; } /* Line Total */
.list-table th:nth-child(12){ width: 40px; }  /* X */





.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.modal-box {
    background: #fff;
    width: 400px;
    max-height: 90vh;
    overflow: auto;
    border-radius: 6px;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

.modal-header {
    padding: 10px;
    font-weight: bold;
    background: #333;
    color: #fff;
    display: flex;
    justify-content: space-between;
}

.modal-close {
    cursor: pointer;
    font-size: 18px;
}

.modal-toggle {
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

.modal-body {
    padding: 10px;
    background: #fafafa;
}

.modal-footer {
    padding: 10px;
    text-align: right;
    border-top: 1px solid #ddd;
}