:root {
    --bg: #f7f8fa;
    --card: #ffffff;
    --muted: #6b7280;
    --border: #e9eef5;
    --accent: #2563eb;
    --danger: #ef4444;
    --radius: 8px;
    --gap: 14px;
    --pad: 18px;
    --maxw: 1000px;
    --ui-sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

body {
    font-family: var(--ui-sans);
    background: var(--bg);
    color: #0f172a;
    margin: 28px;
    display: flex;
    justify-content: center;
}

.container {
    width: 100%;
    max-width: var(--maxw);
}

.table-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: none;
    /* flat */
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1.05rem;
    /* slightly larger base */
    color: inherit;
}

thead {
    background: transparent;
    border-bottom: 1px solid var(--border);
}

th,
td {
    padding: var(--pad);
    vertical-align: middle;
}

th {
    text-align: left;
    font-weight: 600;
    font-size: 1.02rem;
    color: #0b1220;
    letter-spacing: 0.02em;
}

td {
    text-align: right;
    font-size: 1.06rem;
    /* larger numbers */
    color: #111827;
}

.left {
    text-align: left;
}

tbody tr {
    transition: background 100ms ease;
}

tbody tr:not(:last-child) {
    border-bottom: 1px solid var(--border);
}

tbody tr:hover {
    background: rgba(37, 99, 235, 0.03);
}

/* Flat, larger inputs */
input[type="number"],
input[type="date"],
input[type="text"],
.editable {
    -webkit-appearance: none;
    appearance: none;
    border: 1px solid var(--border);
    background: #fbfdff;
    padding: 12px 14px;
    /* bigger touch targets */
    border-radius: 8px;
    font-size: 1.06rem;
    outline: none;
    min-width: 160px;
    text-align: right;
}

input[type="date"] {
    text-align: left;
    min-width: 180px;
}

input[type="number"] {
    min-width: 180px;
}

input[type="number"]:focus,
input[type="date"]:focus,
.editable:focus {
    border-color: rgba(37, 99, 235, 0.18);
    box-shadow: none;
    /* flat focus, subtle border only */
    background: #ffffff;
}

/* Buttons: flat, larger */
button {
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
}

button.secondary {
    background: transparent;
    color: var(--accent);
    border: 1px solid rgba(37, 99, 235, 0.12);
}

button.ghost {
    background: transparent;
    color: var(--muted);
    border: none;
    padding: 8px;
    font-size: 0.98rem;
}

button:active {
    transform: none;
}

button:focus {
    outline: 2px solid rgba(37, 99, 235, 0.12);
    outline-offset: 2px;
}

.edit-actions {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
}

.small {
    font-size: 0.95rem;
    color: var(--muted);
}

.totals {
    margin-top: var(--gap);
    display: flex;
    justify-content: flex-end;
    gap: 14px;
    padding: 14px;
}

.totals .card {
    background: #fff;
    border: 1px solid var(--border);
    padding: 14px 18px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1.06rem;
    color: #0b1220;
    min-width: 220px;
    text-align: right;
}

@media (max-width: 720px) {
    body {
        margin: 14px;
    }

    th,
    td {
        padding: 12px;
        font-size: 1rem;
    }

    input[type="number"],
    input[type="date"],
    .editable {
        min-width: 120px;
        font-size: 1rem;
        padding: 10px 12px;
    }

    .totals {
        flex-direction: column;
        align-items: stretch;
    }

    .totals .card {
        text-align: left;
        min-width: auto;
    }
}

.sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.tabular {
    font-variant-numeric: tabular-nums;
}