@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    /* Fluid typography base: Optimized for mobile readability */
    font-size: clamp(11px, 0.85vw, 15px);
    background-color: #f4f7fa;
    color: #2d3748;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #1a202c;
    margin-bottom: 0.5rem;
}

/* Scaled down headers for mobile - more aggressive resizing */
h1 { font-size: clamp(1.15rem, 3.5vw, 2rem); }
h2 { font-size: clamp(1rem, 3vw, 1.75rem); }
h3 { font-size: clamp(0.9rem, 2.5vw, 1.5rem); }
h4 { font-size: clamp(0.85rem, 2vw, 1.25rem); }
h5 { font-size: clamp(0.75rem, 1.5vw, 1.1rem); }

a, .btn-link {
    color: #3182ce;
    text-decoration: none;
    transition: color 0.2s;
}

a:hover, .btn-link:hover {
    color: #2c5282;
}

/* Standard Professional Buttons */
/* Standard Professional Inputs & Selects */
.form-control, .form-select {
    font-size: 0.8rem; /* Reduced from 0.85rem */
    font-weight: 500;
    padding: 0.5rem 0.85rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.form-control::placeholder {
    font-size: 0.75rem; /* Reduced from 0.8rem */
    font-weight: 500;
    color: #a0aec0;
    text-transform: uppercase;
}

/* Specific fix for large text in selects and placeholders */
select.form-select, select.form-select option {
    font-size: 0.8rem;
    font-weight: 500;
}

.btn {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    transition: all 0.2s;
    font-size: 0.8rem; /* Standardized small for professional feel */
}

.btn-primary {
    background-color: #2b6cb0;
    border-color: #2b6cb0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    background-color: #2c5282;
    border-color: #2c5282;
    transform: translateY(-1px);
}

.btn-success {
    background-color: #38a169;
    border-color: #38a169;
}

.btn-danger {
    background-color: #e53e3e;
    border-color: #e53e3e;
}

.btn:focus {
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.3);
}

.content {
    padding-top: 1rem;
}

/* Standardized Professional Cards */
.card {
    background-color: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.04) !important;
    overflow: hidden;
}

/* Professional Light Card Header */
.card-header {
    background-color: #ffffff !important;
    border-bottom: 1px solid #edf2f7 !important;
    padding: 1rem 1.25rem !important;
    position: relative;
}

/* Standard Gradient Bottom for all headers */
.card-header::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(to right, #3182ce, #63b3ed, #4fd1c5, #48bb78);
    border-radius: 0 0 3px 3px;
}

.card-header h1, .card-header h2, .card-header h3, .card-header h4, .card-header h5, .card-header h6 {
    margin-bottom: 0;
    color: #2d3748;
}

/* Consistent Card Body */
.card-body {
    background-color: #ffffff !important;
    padding: 1.25rem !important;
}

/* Site footer styling */
.site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    font-size: 0.7rem;
    font-weight: 500;
    color: #718096;
    z-index: 1030;
    padding: 0.85rem 1.5rem;
    line-height: 1.5;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Page Layout */
.page {
    position: relative;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100vh;
    padding-bottom: 8rem;
}

.sidebar {
    background-color: #1a202c;
    background-image: linear-gradient(180deg, #1a202c 0%, #2d3748 100%);
    width: 280px;
    flex-shrink: 0;
}

/* Desktop Layout */
@media (min-width: 641px) {
    .page {
        flex-direction: row;
    }
    .sidebar {
        height: 100vh;
        position: sticky;
        top: 0;
    }
    main {
        width: calc(100% - 280px);
    }
}

/* Mobile Sidebar behavior */
@media (max-width: 640.98px) {
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        width: 280px;
        transition: left 0.3s ease;
        z-index: 2000;
        box-shadow: 10px 0 25px rgba(0,0,0,0.1);
    }

    #nav-toggle:checked ~ .sidebar {
        left: 0 !important;
    }

    .nav-menu-backdrop {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.4);
        z-index: 1990;
        backdrop-filter: blur(2px);
    }

    #nav-toggle:checked ~ .nav-menu-backdrop {
        display: block;
    }
}

/* Branded Navbar */
.light-navbar {
    background: #ffffff;
    border-bottom: 1px solid #edf2f7 !important;
    height: 4.5rem;
    z-index: 1040;
    width: 100%;
}

.brand-logo {
    height: 52px;
    width: auto;
    max-height: 100%;
    transition: all 0.2s ease;
    object-fit: contain;
}

@media (max-width: 576px) {
    .light-navbar {
        height: 3.5rem;
        padding: 0 0.75rem !important;
    }
    .brand-logo {
        height: 32px;
    }
    .top-row {
        padding: 0 0.5rem !important;
    }
}

.light-navbar::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(to right, #3182ce, #63b3ed, #4fd1c5, #48bb78);
}

.top-row {
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    height: 100%;
}

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4.5rem;
    background: #ffffff;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1050;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -4px 10px rgba(0,0,0,0.05);
}

.mobile-bottom-nav .nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #718096;
    font-size: 0.65rem;
    font-weight: 700;
    flex: 1;
    transition: all 0.2s;
}

.mobile-bottom-nav .nav-btn span {
    margin-top: 4px;
}

.mobile-bottom-nav .nav-btn.active {
    color: #2b6cb0;
}

.mobile-bottom-nav .plus-btn {
    position: relative;
    top: -20px;
    flex: 1.2;
}

.mobile-bottom-nav .plus-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #3182ce 0%, #2c5282 100%);
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid #ffffff;
    box-shadow: 0 4px 12px rgba(49, 130, 206, 0.4);
}

/* Report Filter Styling */
.report-filter-row {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem;
}

/* Table Refinement */
.table {
    color: #4a5568;
    font-size: 0.85rem;
}

.table thead th {
    background-color: #f8fafc !important;
    color: #64748b !important;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    padding: 0.85rem !important;
    border-bottom: 2px solid #edf2f7 !important;
}

.table tbody td {
    padding: 0.85rem !important;
    border-bottom: 1px solid #edf2f7;
}

.print-only { display: none; }

/* Global Modal Fixes for Mobile */
.modal {
    z-index: 2050 !important;
}

.modal-backdrop {
    z-index: 2040 !important;
}

@media (max-width: 576px) {
    .modal-dialog-scrollable .modal-content {
        max-height: 85vh; /* Ensure footer is always visible on small screens */
    }
    .modal-footer {
        padding: 0.75rem !important;
    }
    .modal-footer .btn {
        flex: 1; /* Make buttons equal width on mobile */
        padding: 0.75rem 0.5rem !important;
        font-size: 0.75rem !important;
    }
}
