/* JFAP eMIS - Site Stylesheet */
:root {
    --jfap-primary: #0d6efd;
    --jfap-sidebar-bg: #1a2035;
}

html { font-size: 14px; scroll-behavior: smooth; }
body { min-height: 100vh; display: flex; flex-direction: column; background: #f4f6fb; }
main { flex: 1; }

/* ====== NAVBAR ====== */
.navbar-brand { font-size: 1.2rem; letter-spacing: 0.5px; }

/* ====== PAGE HEADER ====== */
.page-header {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    color: #fff;
    border-radius: .5rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 2px 8px rgba(13,110,253,.25);
}
.page-header h4 { margin: 0; font-weight: 600; }
.page-header .breadcrumb { margin: 0; background: transparent; padding: 0; }
.page-header .breadcrumb-item, .page-header .breadcrumb-item a { color: rgba(255,255,255,.8); font-size: .8rem; }
.page-header .breadcrumb-item.active { color: #fff; }

/* ====== CARDS ====== */
.card { border: none; box-shadow: 0 1px 6px rgba(0,0,0,.08); border-radius: .5rem; }
.card-header { font-weight: 600; }

/* ====== TABLES ====== */
.table-responsive { border-radius: .5rem; overflow: hidden; }
.table thead th { background: #e9ecef; font-size: .8rem; text-transform: uppercase; letter-spacing: .5px; white-space: nowrap; }
.table tbody tr:hover { background: #f0f4ff; }
.table td, .table th { vertical-align: middle; }

/* ====== DASHBOARD STAT CARDS ====== */
.stat-card { border-left: 4px solid var(--bs-primary); transition: transform .15s; }
.stat-card:hover { transform: translateY(-2px); }
.stat-card.income { border-color: #198754; }
.stat-card.expense { border-color: #dc3545; }
.stat-card.payroll { border-color: #0d6efd; }
.stat-card.inventory { border-color: #fd7e14; }
.stat-card .stat-icon { font-size: 2rem; opacity: .15; position: absolute; right: 1rem; bottom: .5rem; }
.stat-card .stat-value { font-size: 1.4rem; font-weight: 700; }

/* ====== FORMS ====== */
.form-label { font-weight: 500; font-size: .85rem; }
.required-mark::after { content: " *"; color: #dc3545; }
.form-section-title {
    font-size: .75rem; text-transform: uppercase; letter-spacing: 1px;
    color: #6c757d; border-bottom: 1px solid #dee2e6; padding-bottom: .35rem; margin-bottom .75rem;
}

/* ====== BADGE STATUS ====== */
.badge-active { background: #d1e7dd; color: #0f5132; }
.badge-inactive { background: #f8d7da; color: #842029; }
.badge-pending { background: #fff3cd; color: #664d03; }
.badge-closed { background: #e2e3e5; color: #41464b; }

/* ====== SIDEBAR for desktop (optional future use) ====== */

/* ====== LOGIN PAGE ====== */
.login-wrapper {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 60%, #084298 100%);
}
.login-card { border-radius: 1rem; max-width: 420px; width: 100%; }
.login-logo { font-size: 2.5rem; font-weight: 800; color: #0d6efd; letter-spacing: -1px; }

/* ====== MOBILE OPTIMIZATIONS ====== */
@media (max-width: 767.98px) {
    html { font-size: 13px; }
    .page-header { padding: .75rem 1rem; margin-bottom: .75rem; }
    .table thead { display: none; }
    .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
    .table tr { border: 1px solid #dee2e6; border-radius: .4rem; margin-bottom: .5rem; padding: .5rem; background: #fff; }
    .table td { border: none; padding: .2rem .5rem; font-size: .82rem; }
    .table td::before {
        content: attr(data-label) ": ";
        font-weight: 600; color: #6c757d; display: inline;
    }
    .btn-sm { padding: .25rem .5rem; }
    .card-body { padding: .75rem; }
    .stat-value { font-size: 1.2rem !important; }
    .hide-mobile { display: none !important; }
}

@media (max-width: 575.98px) {
    .container-fluid { padding-left: .75rem; padding-right: .75rem; }
    .page-header h4 { font-size: 1rem; }
}

/* ====== PRINT ====== */
@media print {
    .navbar, footer, .btn, .no-print { display: none !important; }
    body { background: #fff; }
    .card { box-shadow: none; border: 1px solid #dee2e6 !important; }
}

/* ====== DROPDOWN SUBMENUS ====== */
.dropdown-submenu { position: relative; }
.dropdown-submenu > .dropdown-menu {
    top: 0;
    left: 100%;
    margin-top: -1px;
    display: none;
    min-width: 14rem;
}
.dropdown-submenu:hover > .dropdown-menu { display: block; }
/* Right-aligned parent: submenus open to the left */
.dropdown-menu-end .dropdown-submenu > .dropdown-menu {
    left: auto;
    right: 100%;
}

/* ====== UTILITIES ====== */
.cursor-pointer { cursor: pointer; }
.text-money { font-family: 'Courier New', monospace; }
.table-actions { white-space: nowrap; width: 1%; }
