/* ============================================================
   GNHS Batch 2006 Tampuhay — Lending System Theme
   ============================================================ */

/* --- Design Tokens --- */
:root {
    --primary: #1f4f98;
    --primary-dark: #163a6b;
    --accent: #f7b731;
    --background: #f4f6fb;
    --surface: #fff;
    --text-main: #222b45;
    --text-muted: #6c7a89;
    --border: #e3e8f0;
    --success-bg: #e8f7ee;
    --success-text: #1f6d3d;
    --error-bg: #fdecec;
    --error-text: #8f1f1f;
    --radius: 12px;
    --shadow: 0 2px 12px rgba(31, 79, 152, .07);
}

/* --- Base --- */
body {
    font-family: 'Manrope', Arial, sans-serif;
    background: var(--background);
    color: var(--text-main);
    font-size: 15px;
    line-height: 1.6;
}

/* --- Layout Shell --- */
.container { max-width: 1260px; }

/* --- Executive Header / Navbar --- */
.executive-header {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(31, 79, 152, .08);
    padding: .75rem 0;
    margin-bottom: 1.5rem;
    border-radius: var(--radius);
}
.executive-brand { display: flex; flex-direction: column; gap: .1rem; }
.executive-title {
    font-weight: 800;
    font-size: 1.5rem;
    margin: 0;
    color: #fff;
}
.executive-subtitle {
    font-size: .85rem;
    color: var(--accent);
    margin: 0;
}
.executive-shell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;
}

/* Navbar links */
.navbar-nav .nav-link {
    font-weight: 600;
    color: rgba(255,255,255,.85) !important;
    transition: color .2s;
    font-size: .9rem;
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--accent) !important;
    font-weight: 700;
}

/* Dropdown menus */
.navbar-nav .dropdown-menu {
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(31, 79, 152, .12);
    border: 1px solid var(--border);
    min-width: 200px;
    font-size: .9rem;
}
.dropdown-item.active,
.dropdown-item:active {
    background: var(--primary);
}
@media (min-width: 992px) {
    .navbar-nav .dropdown:hover > .dropdown-menu { display: block; margin-top: 0; }
}

/* --- Cards --- */
.card {
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    background: var(--surface);
    padding: 24px 28px;
    margin-bottom: 1.5rem;
}
.card h2 {
    font-size: 1.35rem;
    font-weight: 800;
    margin: 0 0 6px;
    color: var(--text-main);
}
.card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: 12px 0 6px;
    color: var(--text-main);
}
.card > p { color: var(--text-muted); font-size: .92rem; margin-bottom: 16px; }
.card dl { margin: 0 0 16px; }
.card dt { font-weight: 700; color: var(--text-muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .3px; margin-top: 8px; }
.card dd { margin: 0 0 2px; font-size: .95rem; }

/* --- Forms --- */
form { display: grid; gap: 10px; }
.row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}
input, select, textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: .92rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--text-main);
    transition: border-color .2s, box-shadow .2s;
}
textarea { min-height: 68px; resize: vertical; }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(31, 79, 152, .1);
}
input[type="file"] {
    padding: 8px;
    font-size: .85rem;
}

/* --- Buttons --- */
button, .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    font-size: .92rem;
    font-weight: 700;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: background .2s, border-color .2s, box-shadow .2s;
}
button, .btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
button:hover, .btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(31, 79, 152, .18);
}
.btn-outline-primary {
    background: #fff;
    border-color: var(--primary);
    color: var(--primary);
}
.btn-outline-primary:hover {
    background: var(--background);
    border-color: var(--primary-dark);
    color: var(--primary-dark);
}
.btn-danger {
    background: #dc3545;
    border-color: #dc3545;
    color: #fff;
}
.btn-danger:hover {
    background: #b02a37;
    border-color: #b02a37;
}
.btn-success {
    background: #1f6d3d;
    border-color: #1f6d3d;
    color: #fff;
}
.btn-success:hover {
    background: #185a32;
    border-color: #185a32;
}

/* --- Tables --- */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
th, td {
    border-bottom: 1px solid #eaeff6;
    padding: 9px 12px;
    font-size: .82rem;
    text-align: left;
    vertical-align: top;
}
th {
    background: #f4f7fb;
    color: #2c435e;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .35px;
}
tbody tr:nth-child(even) td { background: #fcfdff; }
tbody tr:hover td { background: #f0f4fb; }
tbody tr:last-child td { border-bottom: none; }

.table-responsive {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow-x: auto;
}

/* --- Metric Grid --- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
    margin-bottom: 1.5rem;
}
.metric {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 16px;
    text-align: center;
    box-shadow: var(--shadow);
}
.metric h3 {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--text-muted);
    margin: 0 0 6px;
    font-weight: 700;
}
.metric p {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0;
}

/* --- Dashboard Cards (admin index) --- */
.dashboard-card {
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    background: var(--surface);
}
.dashboard-icon {
    font-size: 2rem;
    color: var(--primary);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: .35rem;
}

/* --- Status Badges --- */
.status-badge, .badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: .65rem;
    font-weight: 800;
    letter-spacing: .5px;
    text-transform: uppercase;
}
.status-pending   { color: #825500; background: #fff4d9; border-color: #f0d58f; }
.status-approved,
.status-disbursed,
.status-closed,
.status-active    { color: #1f6d3d; background: #e8f7ee; border-color: #b6e2c7; }
.status-rejected,
.status-delinquent { color: #8f1f1f; background: #fdecec; border-color: #f2c7c7; }
.status-inactive  { color: #7b4b00; background: #fff4d9; border-color: #f0d58f; }

/* --- Filter Links --- */
.filter-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border: 1px solid #cfe0ff;
    border-radius: 999px;
    background: #eef4ff;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: .82rem;
}
.filter-link.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.filter-link:hover:not(.active) {
    background: #dde8fc;
}

/* --- Inline Controls --- */
.inline-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .78rem;
    color: var(--text-muted);
}
.inline-toggle-input { width: auto; margin: 0; padding: 0; }
.actions-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    padding: 8px;
    border: 1px solid #e4ecf8;
    border-radius: 10px;
    background: #f9fbff;
}
.compact-form { display: flex; align-items: flex-end; gap: 8px; }
.compact-form input[type="password"] { min-width: 150px; }
.compact-status-form { margin-left: auto; }
.export-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.export-actions .btn { width: auto; }

/* --- Heading With Icon --- */
.heading-with-icon {
    display: flex;
    align-items: center;
    gap: 10px;
}
.page-subtitle {
    font-size: .88rem;
    color: var(--text-muted);
    margin: 0 0 12px;
}

/* --- Auth Pages --- */
.auth-page {
    min-height: 100vh;
    background: linear-gradient(180deg, #f7f9fc 0%, #eef3f9 100%);
}
.auth-card {
    max-width: 480px;
    margin: 80px auto;
    padding: 36px 32px;
    border: 1px solid var(--border);
}
.auth-badge {
    display: inline-flex;
    width: auto;
    padding: 5px 11px;
    border-radius: 999px;
    background: #edf2fb;
    color: #204d93;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    margin-bottom: 10px;
}
.auth-card h2 {
    font-size: 2rem;
    margin-bottom: 12px;
}
.auth-card p {
    font-size: 1rem;
    color: #4f647d;
    margin: 0 0 20px;
}

/* --- SOA (Statement of Account) --- */
.soa-header {
    text-align: center;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
    background: var(--background);
}
.soa-header p { margin: 2px 0; color: var(--text-muted); font-size: .82rem; }
.soa-signatures {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 24px;
}
.soa-sign-box { text-align: center; }
.soa-sign-name { min-height: 20px; font-weight: 600; margin-bottom: 6px; }
.soa-line { border-bottom: 1px solid #70819e; margin-bottom: 6px; height: 24px; }

/* --- Alerts --- */
.alert {
    border-radius: 10px;
    border: 1px solid var(--border);
    padding: 12px 16px;
    margin-bottom: 14px;
    font-size: .88rem;
    font-weight: 600;
}
.alert.success, .alert-success {
    background: var(--success-bg);
    color: var(--success-text);
    border-color: #b6e2c7;
}
.alert.error, .alert-danger {
    background: var(--error-bg);
    color: var(--error-text);
    border-color: #f2c7c7;
}

/* --- Footer --- */
footer {
    text-align: center;
    color: var(--text-muted);
    padding: 14px 0 6px;
    font-size: .78rem;
}

/* --- No-print / Print-only --- */
.no-print {}
.print-only { display: none; }

/* --- Responsive --- */
@media (max-width: 991.98px) {
    .executive-title { font-size: 1.2rem; }
    .executive-subtitle { font-size: .78rem; }
    .executive-shell { flex-direction: column; align-items: flex-start; }
    .auth-card { margin: 32px auto; padding: 20px; }
    .auth-card h2 { font-size: 1.6rem; }
    .grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
}

@media (max-width: 575.98px) {
    .card { padding: 16px; }
    .row { grid-template-columns: 1fr; }
    .soa-signatures { grid-template-columns: 1fr; }
}

/* --- Print --- */
@media print {
    .topbar, .executive-header, form, .no-print, .navbar { display: none !important; }
    .print-only { display: block; }
    body { background: #fff; font-size: 12px; }
    .card, .metric, table { box-shadow: none; border: 1px solid #ccc; }
}
