/* ===================== ALERTS / FLASH MESSAGES ===================== */
.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 14px;
    border: 1px solid transparent;
}
.alert-success { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }
.alert-danger  { background: #fce7f3; color: #9f1239; border-color: #fbcfe8; }
.alert-info    { background: var(--primary-soft); color: var(--primary-dark); border-color: var(--primary-light); }

/* ===================== AUTH PAGES (login / signup) ===================== */
body.auth-body {
    min-height: 100vh;
    height: auto;
    overflow-y: auto;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.auth-wrapper {
    width: 100%;
    max-width: 430px;
}
.auth-wrapper.wide { max-width: 720px; }
.auth-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 34px 32px;
}
.auth-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    margin-bottom: 6px;
    color: var(--primary);
    font-weight: 700;
    font-size: 19px;
}
.auth-brand i { font-size: 24px; }
.auth-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 24px;
}
.auth-form-group { margin-bottom: 16px; }
.auth-form-group label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 6px;
}
.auth-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.auth-input {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13.5px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: 'Inter', sans-serif;
}
.auth-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.auth-captcha-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.auth-captcha-box {
    background: var(--primary-soft);
    border: 1px dashed var(--primary-light);
    border-radius: 8px;
    padding: 10px 14px;
    font-weight: 700;
    color: var(--primary-dark);
    letter-spacing: 1px;
    white-space: nowrap;
}
.auth-btn {
    width: 100%;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    margin-top: 6px;
}
.auth-btn:hover { background: var(--primary-dark); }
.auth-footer-link {
    text-align: center;
    margin-top: 18px;
    font-size: 13px;
    color: var(--text-muted);
}
.auth-footer-link a { color: var(--primary); font-weight: 600; text-decoration: none; }
.auth-footer-link a:hover { text-decoration: underline; }

/* ===================== GENERIC "CARD PAGE" (fiscal years, statements etc.) ===================== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.page-header h1 {
    font-size: 19px;
    font-weight: 700;
    display: flex;
    align-items: center;
}
.card-box {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    margin-bottom: 16px;
}
.card-box h3 {
    font-size: 14.5px;
    font-weight: 700;
    margin-bottom: 14px;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.form-grid .full { grid-column: 1 / -1; }
.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 5px;
}
.form-control {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 13px;
    outline: none;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.form-check { display: flex; align-items: center; gap: 8px; margin-top: 26px; }
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: none;
    border-radius: 6px;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.15s, background 0.15s;
    text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: #fff; border: 1px solid var(--border-color); color: var(--text-main); }
.btn-outline:hover { background: var(--primary-soft); }
.btn-danger { background: var(--c-rose); color: #fff; }
.btn-danger:hover { filter: brightness(0.92); }
.btn-success { background: var(--c-emerald); color: #fff; }
.btn-success:hover { filter: brightness(0.92); }
.btn-sm { padding: 6px 11px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }

.simple-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.simple-table th {
    text-align: left;
    padding: 10px 12px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-weight: 700;
    font-size: 12px;
    border-bottom: 1px solid var(--border-color);
}
.simple-table td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}
.simple-table tr:hover td { background: var(--primary-bg); }
.simple-table .text-right { text-align: right; }
.simple-table .text-center { text-align: center; }

.pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}
.pill-green { background: #d1fae5; color: #065f46; }
.pill-rose  { background: #fce7f3; color: #9f1239; }
.pill-amber { background: #fef3c7; color: #92400e; }
.pill-blue  { background: #dbeafe; color: #1e40af; }
.pill-gray  { background: #e5e7eb; color: #374151; }

.dr { color: var(--c-rose); font-weight: 700; }
.cr { color: var(--c-emerald); font-weight: 700; }

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}
.empty-state i { font-size: 34px; margin-bottom: 10px; color: var(--border-color); }

/* toggle switch used for confirmation ticks */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
    position: absolute; cursor: pointer; inset: 0;
    background-color: #cbd5e1; transition: .2s; border-radius: 22px;
}
.switch-slider:before {
    position: absolute; content: ""; height: 16px; width: 16px; left: 3px; bottom: 3px;
    background-color: #fff; transition: .2s; border-radius: 50%;
}
.switch input:checked + .switch-slider { background-color: var(--c-emerald); }
.switch input:checked + .switch-slider:before { transform: translateX(18px); }

/* ===================== PRINT (statement / confirmation letter) ===================== */
.print-sheet { display: none; }
@page { size: A4; margin: 14mm; }
@media print {
    body * { visibility: hidden; }
    .print-sheet, .print-sheet * { visibility: visible; }
    .print-sheet {
        display: block; position: absolute; top: 0; left: 0; width: 100%;
        padding: 0; font-size: 12px; line-height: 1.4;
    }
}
.letter-head {
    text-align: center;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 10px;
    margin-bottom: 14px;
}
.letter-head h2 { color: var(--primary); font-size: 18px; margin-bottom: 3px; }
.letter-head p { color: var(--text-muted); font-size: 11.5px; margin: 1px 0; }

.print-sheet h4 {
    font-size: 13px;
    color: var(--primary-dark);
    margin: 14px 0 6px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 4px;
}
table.print-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    margin-bottom: 8px;
}
table.print-table th, table.print-table td {
    border: 1px solid #cbd5e1;
    padding: 3px 6px;
    text-align: left;
}
table.print-table th { background: #eaf0f8; font-weight: 700; }
table.print-table td:nth-child(4), table.print-table td:nth-child(5), table.print-table td:nth-child(6),
table.print-table th:nth-child(4), table.print-table th:nth-child(5), table.print-table th:nth-child(6) {
    text-align: right;
}

/* Modal (used for CSV/Excel upload) */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(11,26,47,0.45);
    display: none; align-items: center; justify-content: center; z-index: 5000;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: var(--radius); width: 100%; max-width: 460px;
    box-shadow: var(--shadow-lg); overflow: hidden;
}
.modal-box-header {
    padding: 16px 20px; border-bottom: 1px solid var(--border-color);
    display: flex; align-items: center; justify-content: space-between; font-weight: 700;
}
.modal-box-body { padding: 20px; }
.modal-box-footer { padding: 14px 20px; border-top: 1px solid var(--border-color); display: flex; justify-content: flex-end; gap: 10px; }
.modal-close-btn { background: none; border: none; font-size: 16px; cursor: pointer; color: var(--text-muted); }

@media (max-width: 768px) {
    .form-grid { grid-template-columns: 1fr; }
    .auth-form-row { grid-template-columns: 1fr; }
    .auth-card { padding: 26px 20px; }
    .auth-wrapper, .auth-wrapper.wide { max-width: 100%; }
    body.auth-body { padding: 16px 12px; align-items: flex-start; }
}
