/* =========================
   Base reset & typography
   ========================= */
* {
    box-sizing: border-box;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

body {
    margin: 0;
    min-height: 100vh;
    background: #eef1f4; /* neutral, calm */
    display: flex;
    align-items: center;
    justify-content: center;
    color: #222;
}

/* =========================
   Login container
   ========================= */
.login-container {
    width: 420px;
    padding: 28px 32px 30px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

/* =========================
   Headings
   ========================= */
.login-container h2 {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    color: #000;
}

.subtitle {
    margin: 6px 0 22px;
    font-size: 14px;
    color: #555;
}

/* =========================
   Form layout
   ========================= */
#loginForm {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 12px;
    row-gap: 14px;
    align-items: center;
}

/* Labels */
#loginForm label {
    font-size: 14px;
    color: #222;
    white-space: nowrap;
}

/* Inputs */
#loginForm input {
    height: 32px;
    padding: 5px 8px;
    font-size: 14px;
    border: 1px solid #c6cbd1;
    border-radius: 3px;
    background: #f9fafb;
}

#loginForm input:focus {
    outline: none;
    border-color: #7a8794;
    background: #ffffff;
}

/* =========================
   Login button
   ========================= */
#loginForm button {
    grid-column: 2;
    width: fit-content;
    padding: 5px 14px;
    font-size: 14px;
    border-radius: 3px;
    border: 1px solid #9aa1a8;
    background: linear-gradient(#f7f7f7, #e1e1e1);
    cursor: pointer;
}

#loginForm button:hover {
    background: linear-gradient(#ffffff, #e8e8e8);
}

/* =========================
   Login messages
   ========================= */
#loginMessage {
    grid-column: 1 / -1;
    margin-top: 8px;
    font-size: 13px;
    color: #b00020;
}

/* =========================
   Tables – neutral, no blue
   ========================= */
table {
    border-collapse: collapse;
    width: 100%;
}

thead tr {
    background: #f1f3f5;
    border-bottom: 1px solid #d0d4d8;
}

th {
    text-align: left;
    font-weight: 600;
    color: #222;
}

td, th {
    padding: 8px 10px;
    font-size: 14px;
}

tbody tr {
    background: #ffffff;
}

tbody tr:nth-child(even) {
    background: #f6f7f9; /* mild grey alt rows */
}

tbody tr:hover {
    background: #eef1f4;
}

/* =========================
   Form controls inside tables
   ========================= */
select,
input[type="text"],
input[type="number"] {
    font-size: 13px;
    padding: 4px 6px;
    border: 1px solid #c6cbd1;
    border-radius: 3px;
    background: #ffffff;
}

select:focus,
input:focus {
    outline: none;
    border-color: #7a8794;
}

.fin-table {
    border-collapse: collapse;
    width: 100%;
}

.fin-table th,
.fin-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #ddd;
}

.fin-table tr:nth-child(even) {
    background: #f4f4f4;
}

.fin-form {
    max-width: 420px;
}

.fin-form label {
    display: block;
    margin-top: 10px;
}

.fin-form input {
    width: 100%;
    padding: 6px;
}

.btn-primary {
    margin-top: 12px;
    padding: 8px 14px;
}

.top-right {
    position: absolute;
    top: 15px;
    right: 15px;
}

/* =========================
   Loans table spacing & alignment
   ========================= */

/* More breathing room overall */
.fin-table th,
.fin-table td {
    padding: 10px 14px;   /* wider + taller cells */
    line-height: 1.4;
}

/* Slightly taller rows */
.fin-table tbody tr {
    height: 44px;
}

/* --- Alignment helpers by column position --- */
/* Columns (1-based):
   6  Borrowed
   7  Term
   9  Monthly
   10 Shed
   11 Remaining
   12 Est Balance
*/

/* Right-align numeric money / totals */
.fin-table th:nth-child(6),
.fin-table td:nth-child(6),
.fin-table th:nth-child(9),
.fin-table td:nth-child(9),
.fin-table th:nth-child(11),
.fin-table td:nth-child(11),
.fin-table th:nth-child(12),
.fin-table td:nth-child(12) {
    text-align: right;
    white-space: nowrap;
}

/* Centre small numeric fields */
.fin-table th:nth-child(7),
.fin-table td:nth-child(7),
.fin-table th:nth-child(10),
.fin-table td:nth-child(10) {
    text-align: center;
}

/* Dates look nicer centred */
.fin-table th:nth-child(4),
.fin-table td:nth-child(4),
.fin-table th:nth-child(5),
.fin-table td:nth-child(5) {
    text-align: center;
}

.fin-table tfoot td {
    font-weight: 700;
    background: #dfeaf2;
}

.fin-table tfoot td:last-child {
    text-align: right;
}
.fin-table td.money,
.fin-table th.money {
    text-align: right;
    padding-right: 14px; /* tweakable */
}
