:root {
    --navy: #1F2837;
    --red: #EA1B37;
    --maroon: #931B1D;
    --text: #333;
    --border: #e2e5ea;
    --bg: #f4f5f7;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
    background: var(--navy);
    color: #fff;
}
.topbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 600; font-size: 16px; }
.brand:hover { text-decoration: none; }
.brand-logo { height: 26px; background: #fff; border-radius: 4px; padding: 2px 6px; }
.topbar nav { display: flex; align-items: center; gap: 18px; }
.topbar nav a { color: #dfe3ea; }
.btn-nav {
    background: var(--red);
    color: #fff !important;
    padding: 7px 14px;
    border-radius: 6px;
    font-weight: 600;
}
.btn-nav:hover { background: var(--maroon); text-decoration: none; }
.logout-link { opacity: 0.8; }

.container { max-width: 1100px; margin: 0 auto; padding: 26px 20px 60px; }

.card-box {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 22px;
    margin-bottom: 20px;
}

h1.page-title { font-size: 22px; margin: 0 0 18px 0; color: var(--navy); }

table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td {
    text-align: left;
    padding: 11px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
table.list th { color: #666; font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.4px; }
table.list tr:hover td { background: #fafbfc; }
.amount-cell { font-weight: 600; color: var(--navy); }

.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.search-form { display: flex; gap: 8px; }
input[type=text], input[type=search], input[type=date], input[type=number], input[type=password], textarea {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 9px 11px;
    font-size: 14px;
    font-family: inherit;
    width: 100%;
}
textarea { resize: vertical; }
label { display: block; font-size: 12.5px; font-weight: 600; color: #555; margin-bottom: 5px; margin-top: 14px; }
.btn {
    display: inline-block;
    background: var(--navy);
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.btn:hover { background: #10151d; text-decoration: none; color: #fff; }
.btn-primary { background: var(--red); }
.btn-primary:hover { background: var(--maroon); }
.btn-secondary { background: #fff; color: var(--navy); border: 1px solid var(--border); }
.btn-secondary:hover { background: #f0f1f3; color: var(--navy); }
.btn-danger { background: #fff; color: #c0392b; border: 1px solid #f0c4bd; }
.btn-danger:hover { background: #fdecea; color: #c0392b; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }

.actions-cell { display: flex; gap: 8px; flex-wrap: wrap; }

.items-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.items-table th { text-align: left; font-size: 12px; color: #666; padding: 6px 8px; }
.items-table td { padding: 6px 8px; vertical-align: top; }
.items-table td.amount-col { width: 150px; }
.items-table td.remove-col { width: 40px; text-align: center; }
.remove-row { background: none; border: none; color: #c0392b; cursor: pointer; font-size: 18px; line-height: 1; }

.totals-preview { margin-top: 14px; text-align: right; font-size: 15px; }
.totals-preview b { color: var(--navy); font-size: 18px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

.login-wrap {
    max-width: 360px;
    margin: 10vh auto;
    background: #fff;
    border-radius: 12px;
    padding: 34px 30px;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}
.login-wrap img { height: 40px; margin-bottom: 4px; }
.login-wrap h1 { font-size: 16px; color: #666; font-weight: 500; margin: 6px 0 22px; }
.pin-input {
    text-align: center;
    letter-spacing: 10px;
    font-size: 22px;
    font-weight: 700;
}
.error-msg { background: #fdecea; color: #c0392b; padding: 10px 12px; border-radius: 6px; font-size: 13.5px; margin: 14px 0; }
.success-msg { background: #e9f9ee; color: #1e7e42; padding: 10px 12px; border-radius: 6px; font-size: 13.5px; margin: 14px 0; }
.empty-state { text-align: center; padding: 50px 20px; color: #888; }

.preview-toolbar { display: flex; justify-content: flex-end; gap: 10px; margin-bottom: 16px; }
.preview-frame-wrap { display: flex; justify-content: center; }

@media print {
    .topbar, .preview-toolbar { display: none !important; }
    body { background: #fff; }
    .container { padding: 0; max-width: none; }
}
