@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap');

        :root {
            --bg-main: #f8fafc;
            --bg-sidebar: #002147;
            --bg-card: #ffffff;
            --primary-gradient: linear-gradient(135deg, #002147 0%, #004080 100%);
            --gold-gradient: linear-gradient(135deg, #D4AF37 0%, #B8860B 100%);
            --accent-color: #8B6B00;
            --border-color: rgba(0, 33, 71, 0.1);
            --text-primary: #002147;
            --text-secondary: #334155;
            --sidebar-width: 250px;
        }

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    max-width: 100%;
    overflow-x: clip;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.mesh-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: 
        radial-gradient(at 0% 0%, rgba(212, 175, 55, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(0, 64, 128, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(212, 175, 55, 0.05) 0px, transparent 50%),
        radial-gradient(at 0% 100%, rgba(0, 33, 71, 0.08) 0px, transparent 50%);
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
    position: relative;
}

.main-content {
    flex: 1;
    min-width: 0;
    padding: 2rem 2.5rem;
    max-width: 1600px;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 1280px) {
    .main-content {
        padding: 1.5rem 1.5rem;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 1rem 1rem;
        padding-bottom: 90px;
    }
}

/* Sidebar Design */
.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    align-self: flex-start;
    background: var(--bg-sidebar);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.25rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 0;
    height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
    z-index: 100;
    box-sizing: border-box;
}

.brand {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    width: 100%;
}

.brand-logo {
    width: 24px;
    height: 24px;
    background: var(--gold-gradient);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #002147;
    font-size: 0.75rem;
    box-shadow: 0 4px 10px rgba(184, 134, 11, 0.2);
    flex-shrink: 0;
}

.brand-info {
    display: block;
    text-align: left;
}

.brand-info h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    line-height: 1.1;
}

.brand-info p {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-top: 1px;
}

.sidebar nav {
    width: 100%;
    scrollbar-width: none;
}

.sidebar nav::-webkit-scrollbar {
    display: none;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    width: 100%;
}

.nav-category {
    font-size: 0.8rem;
    font-weight: 700;
    color: #D4AF37; /* Bishop Amat Gold */
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 1rem 0.6rem 0.2rem 0.6rem;
    opacity: 0.85;
    width: 100%;
}

.nav-item {
    width: 100%;
}

.nav-item a {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    white-space: nowrap;
}

.nav-item a i {
    font-size: 1.1rem;
    width: 16px;
    text-align: center;
    margin-right: 0 !important;
    margin-bottom: 0;
    transition: transform 0.2s ease;
}

.nav-item a:hover i {
    transform: scale(1.1);
}

.nav-item a:hover, .nav-item.active a {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.nav-item.active a {
    background: rgba(255, 255, 255, 0.12);
    font-weight: 600;
}

.nav-item.active a i {
    color: #D4AF37;
}

/* Cards Design */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 10px 40px rgba(0, 33, 71, 0.08);
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.glass-card:hover {
    border-color: var(--accent-color);
    box-shadow: 0 20px 50px rgba(0, 33, 71, 0.12);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.icon-box {
    width: 52px;
    height: 52px;
    background: rgba(184, 134, 11, 0.1);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--accent-color);
}

.card-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Lists and Links */
.report-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex-grow: 1; /* This will push the content to the bottom of the stretched card */
}

.report-item a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: #fcfcfc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    color: var(--text-secondary);
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.report-item a:hover {
    background: #ffffff;
    border-color: var(--accent-color);
    color: var(--text-primary);
    padding-left: 2rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05);
}

.report-item a i.fa-chevron-right {
    font-size: 0.8rem;
    opacity: 0;
    transition: all 0.3s ease;
}

.report-item a:hover i.fa-chevron-right {
    opacity: 1;
    transform: translateX(5px);
}

/* Footer */
.main-footer {
    margin-top: 5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Grid System */
.grid-aligned {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    grid-auto-rows: 1fr;
    gap: 1.5rem;
    align-items: stretch;
}

/* Responsiveness */
@media (max-width: 1024px) {
    .main-content { padding: 1.5rem; }
}

@media (max-width: 768px) {
    .app-container { flex-direction: column; }
    .sidebar { 
        width: 100%; 
        height: auto; 
        position: relative;
        padding: 1.5rem 1.25rem;
        gap: 1.25rem;
        align-items: stretch;
    }
    .brand {
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        gap: 0.6rem;
    }
    .brand-logo {
        width: 32px;
        height: 32px;
        border-radius: 8px;
        font-size: 0.95rem;
    }
    .brand-info {
        display: block;
    }
    .brand-info h2 {
        font-size: 1.2rem;
        font-weight: 700;
        color: white;
        line-height: 1.2;
    }
    .brand-info p {
        font-size: 0.9rem;
        color: #94a3b8;
    }
    .sidebar nav {
        max-height: none;
        overflow-y: visible;
    }
    .nav-links {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }
    .nav-category {
        display: none !important;
    }
    .nav-item {
        width: auto;
    }
    .nav-item a {
        padding: 0.65rem 1rem;
        font-size: 1rem;
        flex-direction: row;
        gap: 0.4rem;
        width: auto;
    }
    .nav-item a i {
        font-size: 1.15rem;
        margin-bottom: 0;
    }
    .main-content { padding: 1.25rem; }
}

/* Forms and Inputs */
.modern-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.input-wrapper i.prefix-icon {
    position: absolute;
    left: 1rem;
    color: var(--accent-color);
    font-size: 1rem;
    pointer-events: none;
    z-index: 5;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.form-control {
    width: 100%;
    padding: 0.5rem 0.8rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(139, 107, 0, 0.1);
}

.btn-search {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    box-shadow: 0 4px 12px rgba(0, 33, 71, 0.2);
}

.btn-search:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 33, 71, 0.3);
}

/* Data Tables */
.table-container {
    overflow-x: auto;
    margin-top: 1rem;
}

.modern-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.04rem;
}

.modern-table th {
    padding: 0.4rem 0.6rem;
    text-align: left;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid #e2e8f0;
}

.modern-table td {
    padding: 0.35rem 0.6rem;
    background: #ffffff;
    border-top: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
    color: var(--text-primary);
    font-size: 0.85rem;
}

.modern-table tr td:first-child {
    border-left: 1px solid #f1f5f9;
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.modern-table tr td:last-child {
    border-right: 1px solid #f1f5f9;
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

.modern-table tr:hover td {
    background: #f8fafc;
    border-color: var(--accent-color);
}

.badge-status {
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 600;
    background: #f1f5f9;
    color: var(--text-secondary);
    display: inline-block;
}

.badge-active { background: #dcfce7; color: #166534; }
.badge-inactive { background: #fee2e2; color: #991b1b; }

/* Modernized Legacy Pagination */
.pagination-container table {
    border-collapse: separate;
    border-spacing: 6px 0;
}

.pagination-container td {
    padding: 0 !important;
    vertical-align: middle;
}

.pagination-container .fontNormal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    padding: 0.35rem 0.65rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.78rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.pagination-container .fontNormal:hover {
    background: #f8fafc;
    border-color: var(--accent-color);
    color: var(--accent-color);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(139, 107, 0, 0.08);
}

.pagination-container select {
    padding: 0.35rem 0.65rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: var(--text-primary);
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    outline: none;
    transition: all 0.3s ease;
    min-width: 55px;
}

.pagination-container select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(139, 107, 0, 0.08);
}

.pagination-container .fontLabel {
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-right: 8px !important;
}

/* Hide the pipes in the legacy table */
.pagination-container td:contains('|'), 
.pagination-container {
    color: transparent;
}
/* Re-enable color for relevant parts */
.pagination-container table,
.pagination-container .fontNormal,
.pagination-container select,
.pagination-container .fontLabel {
    color: var(--text-primary);
}

/* Remove pipes via CSS hack for text nodes if possible, or just let them be subtle */
.pagination-container td {
    font-size: 0; /* Hide the pipes */
}
.pagination-container .fontNormal,
.pagination-container select,
.pagination-container .fontLabel {
    font-size: 0.78rem; /* Restore font size */
}

/* ==========================================================================
   Centralized Directory & Listing Grid System Styles (Compact Density)
   ========================================================================== */
.search-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    box-shadow: 0 6px 25px rgba(0, 33, 71, 0.04);
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}
.search-card:hover {
    box-shadow: 0 10px 30px rgba(0, 33, 71, 0.06);
    border-color: var(--accent-color);
}
.modern-form-container {
    width: 100%;
}
.form-grid-custom {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    align-items: flex-end;
}
.form-row-custom {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
    flex-wrap: wrap;
}
.form-group-custom {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.form-group-custom.flex-grow {
    flex: 1;
    min-width: 200px;
}
.form-group-custom label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin: 0;
}
.form-group-custom label i {
    color: var(--accent-color);
    font-size: 0.8rem;
}
.form-select-custom, .form-input-custom {
    height: 44px;
    border-radius: 8px;
    border: 1px solid rgba(0, 33, 71, 0.15);
    background: #fafbfc;
    padding: 0 0.75rem;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    width: 100%;
}
.form-select-custom {
    cursor: pointer;
    padding-right: 2rem;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23002147' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 0.95rem;
}
.form-select-custom option {
    padding: 0.25rem 0.75rem;
    font-size: 0.85rem;
    background: #ffffff;
    color: var(--text-primary);
}
.form-select-custom:focus, .form-input-custom:focus {
    border-color: var(--accent-color);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(139, 107, 0, 0.1);
}
.btn-premium-search {
    height: 44px;
    border-radius: 8px;
    border: none;
    background: var(--primary-gradient);
    color: white;
    font-weight: 600;
    font-size: 1rem;
    padding: 0 1.25rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    box-shadow: 0 3px 8px rgba(0, 33, 71, 0.12);
    white-space: nowrap;
}
.btn-premium-search:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 12px rgba(0, 33, 71, 0.2);
}
.btn-premium-secondary {
    height: 38px;
    border-radius: 8px;
    border: 1.5px solid var(--accent-color);
    background: transparent;
    color: var(--accent-color);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0 1.1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    white-space: nowrap;
}
.btn-premium-secondary:hover {
    background: rgba(139, 107, 0, 0.05);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(139, 107, 0, 0.08);
}
.form-footer-custom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.checkbox-item-custom {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
    font-size: 0.95rem;
}
.checkbox-item-custom input[type="checkbox"] {
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: var(--accent-color);
}
.results-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    box-shadow: 0 6px 25px rgba(0, 33, 71, 0.04);
    margin-bottom: 1rem;
}
.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid rgba(0, 33, 71, 0.06);
    padding-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.results-title-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.results-badge-icon {
    width: 28px;
    height: 28px;
    background: rgba(139, 107, 0, 0.08);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: var(--accent-color);
}
.results-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}
.results-count-badge {
    background: rgba(0, 33, 71, 0.05);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.72rem;
    padding: 0.2rem 0.55rem;
    border-radius: 12px;
    border: 1px solid rgba(0, 33, 71, 0.05);
}

/* ==========================================================================
   Responsive Utilities & Layout Helpers
   ========================================================================== */
.d-none {
    display: none !important;
}
.d-block {
    display: block !important;
}

@media (min-width: 769px) {
    .d-md-none {
        display: none !important;
    }
    .d-md-block {
        display: block !important;
    }
    .d-md-table-cell {
        display: table-cell !important;
    }
}

/* Responsive Table Container */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Dashboard Panels & Recent Items */
.dashboard-panel-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1rem;
    box-shadow: 0 4px 15px rgba(0, 33, 71, 0.02);
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease;
    height: 100%;
}
.dashboard-panel-card:hover {
    box-shadow: 0 8px 25px rgba(0, 33, 71, 0.04);
    border-color: rgba(0, 33, 71, 0.12);
}
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.6rem;
    border-bottom: 1px solid rgba(0, 33, 71, 0.05);
    padding-bottom: 0.4rem;
    flex-shrink: 0;
}
.panel-title-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.panel-badge-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}
.panel-card-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}
.recent-list-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.recent-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    border: 1px solid rgba(0, 33, 71, 0.03);
    background: #fafbfc;
    text-decoration: none !important;
    transition: all 0.2s ease;
}
.recent-item:hover {
    background: #ffffff;
    border-color: var(--accent-color);
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}
.recent-avatar {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(0, 33, 71, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-size: 0.75rem;
    flex-shrink: 0;
}
.recent-item:hover .recent-avatar {
    background: var(--primary-gradient);
    color: white;
}
.recent-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex-grow: 1;
}
.recent-name {
    font-weight: 700;
    font-size: 0.82rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}
.recent-meta {
    font-size: 0.68rem;
    color: var(--text-secondary);
    line-height: 1.1;
}
.recent-link-icon {
    font-size: 0.68rem;
    color: var(--text-secondary);
    opacity: 0.5;
}
.recent-item:hover .recent-link-icon {
    opacity: 1;
    color: var(--accent-color);
}
.recent-empty-state {
    text-align: center;
    padding: 1rem;
    color: var(--text-secondary);
    font-size: 0.75rem;
}
.recent-empty-state i {
    font-size: 1.25rem;
    color: var(--accent-color);
    margin-bottom: 0.25rem;
    opacity: 0.6;
}
.view-all-history-btn {
    padding-top: 0.5rem;
    width: 100%;
    text-align: center;
    color: var(--accent-color);
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none !important;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    border-top: 1px solid rgba(0, 33, 71, 0.04);
    margin-top: 0.5rem;
}
.view-all-history-btn:hover {
    color: var(--text-primary);
}

/* ==========================================================================
   Student Profile Detail Page Layout & Components (DRY reusable styles)
   ========================================================================== */
.profile-container {
    display: grid;
    grid-template-columns: 280px 1fr 220px;
    gap: 1.5rem;
    padding: 0;
    max-width: 100%;
    margin: 0;
    position: relative;
    align-items: start;
}

.profile-left-column {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.profile-right-column {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

@media (max-width: 1400px) {
    .profile-container {
        grid-template-columns: 280px 1fr;
    }
    .profile-right-column {
        grid-column: span 2;
    }
}

@media (max-width: 992px) {
    .profile-container {
        grid-template-columns: 1fr;
    }
    .profile-right-column {
        grid-column: span 1;
    }
}

.profile-main-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 1.25rem;
    align-items: start;
    min-width: 0;
}

@media (max-width: 576px) {
    .profile-main-grid {
        grid-template-columns: 1fr;
    }
}

/* Modern Photo Container */
.avatar-wrapper {
    position: relative;
    width: 140px;
    height: 175px;
    border-radius: 12px;
    overflow: hidden;
    margin: 0 auto 1rem;
    border: 2px solid rgba(0, 33, 71, 0.08);
    background: #f8fafc;
    box-shadow: 0 4px 12px rgba(0, 33, 71, 0.05);
    transition: all 0.3s ease;
}
.avatar-wrapper:hover {
    transform: scale(1.02);
    border-color: var(--accent-color);
    box-shadow: 0 8px 20px rgba(0, 33, 71, 0.1);
}
.avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Profile header */
.profile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 33, 71, 0.02);
}
.header-logo-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.header-logo {
    width: 42px;
    height: 42px;
    background: var(--gold-gradient);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #002147;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(184, 134, 11, 0.2);
}
.header-info h1 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
    margin: 0;
}
.header-info p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin: 0;
}

/* Info items */
.info-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    width: 100%;
}
.info-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 0.5rem;
    border-bottom: 1px dashed rgba(0, 33, 71, 0.05);
    font-size: 0.85rem;
}
.info-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.info-label {
    font-weight: 700;
    color: var(--text-primary);
    min-width: 110px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.info-label i {
    color: var(--accent-color);
    font-size: 0.78rem;
    width: 14px;
    text-align: center;
}
.info-val {
    color: var(--text-secondary);
    text-align: right;
    font-weight: 500;
    word-break: break-word;
}

/* Sub-card tables */
.card-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
}
.card-table th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 700;
    color: var(--text-primary);
    border-bottom: 2px solid rgba(0, 33, 71, 0.08);
    padding: 0.4rem 0.5rem;
    text-align: left;
}
.card-table td {
    padding: 0.4rem 0.5rem;
    font-size: 0.8rem;
    border-bottom: 1px solid rgba(0, 33, 71, 0.04);
    color: var(--text-secondary);
}
.card-table tr:last-child td {
    border-bottom: none;
}

/* Edit button design */
.btn-edit-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    border: 1px solid rgba(139, 107, 0, 0.25);
    background: transparent;
    color: var(--accent-color);
    font-size: 0.72rem;
    font-weight: 700;
    text-decoration: none !important;
    transition: all 0.2s ease;
}
.btn-edit-pill:hover {
    background: rgba(139, 107, 0, 0.06);
    border-color: var(--accent-color);
    transform: translateY(-1px);
}

/* Related links */
.related-links-table td {
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
}
.related-links-table a {
    display: flex;
    align-items: center;
    padding: 0.35rem 0.6rem;
    background: #fafbfc;
    border: 1px solid rgba(0, 33, 71, 0.05);
    border-radius: 8px;
    color: var(--text-secondary) !important;
    font-weight: 600;
    font-size: 0.8rem;
    text-decoration: none !important;
    transition: all 0.2s ease;
    margin-bottom: 0.25rem;
}
.related-links-table a:hover {
    background: #ffffff;
    border-color: var(--accent-color);
    color: var(--text-primary) !important;
    padding-left: 0.8rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
}
.related-links-table font.fontLabel2,
.related-links-table b {
    color: var(--accent-color) !important;
    font-weight: 700;
}
.related-links-table font.fontLabel2 {
    font-size: 0.8rem;
}

/* Medical Alert banner */
.medical-alert-banner {
    background: rgba(153, 27, 27, 0.06);
    border: 1px solid rgba(153, 27, 27, 0.15);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    color: #991b1b;
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.medical-alert-banner i {
    font-size: 1.2rem;
}

/* Household Overlay Styling */
#divHHID {
    position: absolute;
    z-index: 999;
    box-shadow: 0 10px 30px rgba(0,33,71,0.15);
    border-radius: 12px;
    background: #ffffff;
    border: 2px solid var(--accent-color);
    padding: 1rem;
    overflow: hidden;
    width: 320px;
}
#divHHID table {
    width: 100% !important;
    background: transparent !important;
}
#divHHID td {
    background: transparent !important;
}
#divHHID .clsSideBarBlockTitle {
    font-size: 0.9rem !important;
    font-weight: 700 !important;
    color: var(--text-primary) !important;
    padding-bottom: 0.4rem !important;
    border-bottom: 1px solid rgba(0, 33, 71, 0.1) !important;
}
#divHHID .fontSmall {
    font-size: 0.8rem !important;
    color: var(--text-secondary) !important;
}
#divHHID input[type="button"] {
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.3rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.5rem;
    box-shadow: 0 2px 6px rgba(0, 33, 71, 0.15);
}

/* Centralized Success Modal Overlay */
.success-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 33, 71, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.success-modal-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 2rem;
    width: 340px;
    box-shadow: 0 20px 50px rgba(0, 33, 71, 0.15);
    text-align: center;
    border: 1px solid rgba(0, 33, 71, 0.1);
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.success-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
.success-modal-overlay.active .success-modal-card {
    transform: translateY(0);
    opacity: 1;
}
.success-modal-icon {
    font-size: 3rem;
    color: #166534;
    margin-bottom: 1rem;
}
.success-modal-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}
.success-modal-body {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Global Admin Spinner for Loaders */
.admin-spinner {
    border: 4px solid rgba(0, 33, 71, 0.1);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border-left-color: var(--accent-color);
    animation: admin-spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes admin-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   Printable Popup Reports (Compact Edition)
   ========================================================================== */
.report-page-container {
    padding: 1.5rem; max-width: 1000px; margin: 0 auto;
    background: white; border-radius: 8px;
}
.report-page-container .modern-table { 
    width: 100%; border-collapse: collapse; margin-bottom: 1rem; font-size: 0.8rem; border-spacing: 0;
}
.report-page-container .modern-table th { 
    background-color: #f1f5f9; padding: 4px 8px; border-bottom: 2px solid #cbd5e1; text-align: left; 
    border-radius: 0;
}
.report-page-container .modern-table td { 
    padding: 3px 8px; border-bottom: 1px solid #e2e8f0; border-top: none; 
    border-radius: 0;
}
.report-page-container .modern-table tr td:first-child,
.report-page-container .modern-table tr td:last-child {
    border-left: none; border-right: none; border-radius: 0;
}
.report-page-container .page-break { 
    page-break-before: always; margin-top: 1rem; padding-top: 1rem; border-top: 2px dashed #cbd5e1; 
}

@media print {
    body { background: white; }
    .report-page-container { box-shadow: none; padding: 0; }
    .mesh-bg { display: none; }
    .page-break { border-top: none; }
    .main-footer { display: none !important; }
}

/* ==========================================================================
   Compact Navigation Dashboards (SIS Dense Layout - Option C)
   ========================================================================== */
.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}
.config-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    box-shadow: 0 2px 10px rgba(0, 33, 71, 0.04);
    display: flex;
    flex-direction: column;
    height: 100%;
}
.config-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.config-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #fff;
    flex-shrink: 0;
    background: var(--accent-color);
}
.config-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}
.config-links-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
    flex-grow: 1;
}
.config-link-item a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0.5rem;
    border-radius: 6px;
    border: 1px solid #edf2f7;
    background: #fcfcfc;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary) !important;
    text-decoration: none !important;
    transition: all 0.3s ease;
}
.config-link-item a:hover {
    background: #ffffff;
    border-color: var(--accent-color);
    color: var(--text-primary) !important;
    padding-left: 0.75rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}
.config-link-item a i.fa-chevron-right {
    font-size: 0.7rem;
    opacity: 0;
    transition: all 0.3s ease;
}
.config-link-item a:hover i.fa-chevron-right {
    opacity: 1;
    transform: translateX(3px);
}

/* Compact Grid System (Option C) */
.config-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0.75rem; margin-bottom: 1rem; }
.config-card { background: #ffffff; border: 1px solid var(--border-color); border-radius: 8px; padding: 0.75rem; box-shadow: 0 2px 10px rgba(0, 33, 71, 0.04); display: flex; flex-direction: column; height: 100%; }
.config-card-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }
.config-card-icon { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 6px; font-size: 0.85rem; background: rgba(139, 107, 0, 0.08); color: var(--accent-color); flex-shrink: 0; }
.config-card-title { font-size: 0.95rem; font-weight: 700; margin: 0; color: var(--text-primary); }
.config-links-list { display: flex; flex-direction: column; gap: 0.25rem; margin: 0; padding: 0; list-style: none; }
.config-link-item a { display: flex; align-items: center; justify-content: space-between; padding: 0.4rem 0.5rem; border-radius: 6px; border: 1px solid #edf2f7; background: #fcfcfc; font-size: 0.8rem; font-weight: 500; color: var(--text-secondary) !important; text-decoration: none !important; }
.config-link-item a:hover { background: #ffffff; border-color: var(--accent-color); color: var(--text-primary) !important; padding-left: 0.75rem; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03); }

/* ==========================================================================
   Select2 Global Theme Overrides for Modern Admin UI
   ========================================================================== */
.select2-container--default .select2-selection--single {
    height: 38px;
    border-radius: 8px;
    border: 1px solid rgba(0, 33, 71, 0.15);
    background-color: #fafbfc;
    font-family: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.select2-container--default .select2-selection--single:focus,
.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--accent-color);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(139, 107, 0, 0.1);
    outline: none;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 36px;
    padding-left: 0.75rem;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px;
    right: 0.5rem;
}
.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: var(--text-primary) transparent transparent transparent;
}
.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent var(--text-primary) transparent;
}
.select2-dropdown {
    border: 1px solid var(--accent-color);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 33, 71, 0.1);
    overflow: hidden;
    font-family: inherit;
}
.select2-results__option {
    padding: 0.2rem 0.6rem;
    font-size: 0.8rem;
    color: var(--text-primary);
    transition: all 0.2s ease;
    margin: 0;
}
.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: #f8fafc;
    color: var(--text-primary);
    border-left: 3px solid var(--accent-color);
    padding-left: calc(0.6rem - 3px);
}
.select2-container--default .select2-results__option[aria-selected=true] {
    background-color: rgba(139, 107, 0, 0.1);
    color: var(--text-primary);
    font-weight: 600;
}
.select2-search--dropdown .select2-search__field {
    border-radius: 6px;
    border: 1px solid rgba(0, 33, 71, 0.15);
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
    font-family: inherit;
    outline: none;
}
.select2-search--dropdown .select2-search__field:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(139, 107, 0, 0.1);
}

/* Primary Button Styles */
.btn-primary, .btn-premium-search {
    background: var(--primary-gradient);
    color: #fff !important;
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 33, 71, 0.15);
    text-decoration: none;
}

.btn-primary:hover, .btn-premium-search:hover {
    box-shadow: 0 6px 15px rgba(0, 33, 71, 0.25);
    transform: translateY(-1px);
    background: var(--gold-gradient);
}

input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
    display: none;
}
