/* General page */
body {
    font-family: Arial, sans-serif;
    margin: 20px;
    background-color: #303030;
    color: #eee;
    text-align:center;
}

/* Wrapper keeps tables centered */
.tables-wrapper {
    width: 1000px;   /* or whatever your left+right tables widths + gap */
    margin: 0 auto; /* center the wrapper */
}

/* Flex container for tables */
.tables-container {
    display: flex;
    gap: 0;               /* no extra gap from flex */
    align-items: flex-start;
    justify-content: flex-start; 
}

/* Tiny spacing between tables */
.tables-container > table:first-child {
    margin-right: 8px;    /* adjust: 6~10px looks good */
}

/* Main table styling */
table {
    border-collapse: collapse;
    width: 420px;
    background-color: #111;
    font-size: 12px;
    table-layout: fixed;
}

th, td {
    border: 1px solid #555;
    padding: 4px;
    text-align: left;
    vertical-align: middle;
    color: #eee;
}

th {
    background-color: #222;
    font-weight: bold;
}

/* Category title rows */
.cat-title {
    background-color: #888 !important;
    color: #000 !important;
    font-weight: bold;
    text-align:center;

    display:flex;
    justify-content:space-between;
    align-items:center;

    padding: 4px 6px;      /* increases height */
    font-size: 13px;       /* slightly larger text */
}

/* dropdowns */
select.item-menu {
    width:100%;
    background-color:#000;
    color:#fff;
    border:1px solid #555;
    padding:2px;
    font-size:12px;
    box-sizing:border-box;
}

select.item-menu:hover,
select.item-menu:focus {
    border-color:#ff6600;
    box-shadow:0 0 3px #ffdd57;
    outline:none;
}

/* EM / GM columns */
.ca {
    text-align:center;
}

/* Plus button (keep original) */
.addmore {
    width:16px;
    height:16px;
    border:1px solid #888;
    background-color:#444;
    color:#eee;
    cursor:pointer;
    font-weight:bold;
    text-align:center;
    line-height:14px;
    border-radius:3px;  /* keep oval/rounded */
	
	    /* Adjust vertical alignment */
    line-height:14px;   /* current line height */
    padding-top:3px;    /* push content slightly down */
    border-radius:3px;  /* keep rounded */
}

.remove-row {
    display: block;
    width: 15px;
    height: 15px;
    line-height: 15px;
    text-align: center;
    margin: 0 auto; /* centers in table cell */
    font-size: 18px;
    border-radius: 0;
    border: 1px solid #888;
    background-color: #444;
    color: #eee;
    cursor: pointer;
}

.addmore:hover,
.remove-row:hover {
    background-color:#666;
}

/* Totals table */
#totals-table {
    width:420px;
    margin:20px auto;
    background-color:#111;
}

#totals-table th {
    background-color:#222;
    text-align:center;
}

#totals-table td {
    text-align:center;
}

/* Reset button */
#resetSelections {
    margin-top:10px;
    padding:6px 12px;
    font-size:12px;
    cursor:pointer;
    border:1px solid #888;
    border-radius:3px;
    background-color:#444;
    color:#eee;
}

#resetSelections:hover {
    background-color:#666;
}

/* footer */
footer {
    margin-top:20px;
    font-size:12px;
    color:#aaa;
}

/* Make category (item dropdown) column wider */
table.data-table th:first-child,
table.data-table td:first-child {
    width:200px;
}

/* keep EM / GM columns compact */
table.data-table th:nth-child(2),
table.data-table th:nth-child(3),
table.data-table td:nth-child(2),
table.data-table td:nth-child(3) {
    width:60px;
}

/* +/- column */
table.data-table th:nth-child(4),
table.data-table td:nth-child(4) {
    width:40px;
    text-align:center;
}

.tables-container > table:last-child {
    margin-left: -6px;  /* adjust until visually snug */
}

/* Totals table EM / GM cells */
#totals-table td.em-gm-cell {
    background-color: #888;  /* same gray as categories */
    color: #000;             /* black text for contrast */
    font-weight: bold;
}

/* Slightly reduce category row height on right table */
.tables-container > table:last-child .cat-title {
    padding: 2px 6px;   /* was 4px 6px */
    font-size: 10px;    /* was 13px */
}

/* Make category header rows less tall */
.data-table .cat-title {
    padding: 1px 6px;       /* Reduce vertical padding */
    font-size: 10px;        /* Slightly smaller text if you want */
    line-height: 1.2;       /* Tighter line spacing */
}