/**
 * E-Barangay Information Management System
 * Custom Styles — Polished Professional Theme
 */

:root {
    /* Refined professional palette */
    --primary-color: #1a365d;
    --primary-hover: #2b4c7e;
    --primary-light: #3b6cb0;
    --primary-50: #ebf2ff;
    --primary-100: #d0e0f5;
    --sidebar-bg: #1a365d;
    --white: #ffffff;
    --gray-50: #f7f8fc;
    --gray-100: #eef1f6;
    --gray-200: #e2e6ee;
    --gray-300: #d1d5e0;
    --gray-400: #a0aec0;
    --gray-500: #718096;
    --gray-600: #4a5568;
    --gray-700: #2d3748;
    --gray-800: #1a202c;
    --dark-color: #171923;
    /* Status: modern, accessible */
    --success-color: #276749;
    --success-light: #c6f6d5;
    --danger-color: #c53030;
    --danger-light: #fed7d7;
    --warning-color: #b7791f;
    --warning-light: #fefcbf;
    --info-color: #2b6cb0;
    --info-light: #bee3f8;
    /* Legacy aliases */
    --success-muted: #276749;
    --danger-muted: #c53030;
    --warning-muted: #b7791f;

    --app-navbar-height: 64px;
    --app-sidebar-width: 260px;
    --app-sidebar-collapsed-width: 72px;
    --card-radius: 14px;
    --transition-base: 0.2s ease;
}

/* ── Global Reset & Base ── */
*:focus-visible {
    outline: 2px solid var(--primary-light);
    outline-offset: 2px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--gray-50);
    color: var(--dark-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Skip to main content (a11y) */
.skip-to-content {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 0 0 8px 8px;
    z-index: 10000;
    font-weight: 600;
    transition: top var(--transition-base);
    text-decoration: none;
}
.skip-to-content:focus {
    top: 0;
    color: #fff;
}

/* Logged-in layout: keep content below fixed navbar */
body.app-authenticated {
    padding-top: var(--app-navbar-height);
}

/* Layout: main content fills space, footer at bottom */
body.app-authenticated {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.app-authenticated .main-content {
    flex: 1;
    padding-bottom: 2rem;
}

/* ── Smooth scroll ── */
html { scroll-behavior: smooth; }

/* ── Premium Footer ── */
.footer-premium {
    margin-left: var(--app-sidebar-width);
    background: var(--gray-800);
    color: rgba(255,255,255,0.9);
    border-top: 3px solid var(--primary-light);
}

.footer-premium .footer-top {
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-premium .footer-brand {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.footer-premium .footer-app-name {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.02em;
}

.footer-premium .footer-barangay {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.75);
    font-weight: 500;
}

.footer-premium .footer-desc {
    font-size: 0.875rem;
    line-height: 1.5;
    color: rgba(255,255,255,0.7);
    margin: 0;
    max-width: 320px;
}

.footer-premium .footer-heading {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255,255,255,0.5);
    margin-bottom: 0.75rem;
}

.footer-premium .footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-premium .footer-links li {
    margin-bottom: 0.4rem;
}

.footer-premium .footer-links a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-premium .footer-links a:hover {
    color: #fff;
}

.footer-premium .footer-links li {
    color: rgba(255,255,255,0.75);
    font-size: 0.9rem;
}

.footer-premium .footer-links a {
    color: rgba(255,255,255,0.9);
}

.footer-premium .footer-meta {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-premium .footer-meta li {
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.85);
}

.footer-premium .footer-meta-label {
    display: inline-block;
    min-width: 4.5rem;
    color: rgba(255,255,255,0.5);
    font-size: 0.8rem;
}

.footer-premium .footer-bottom {
    background: rgba(0,0,0,0.15);
}

.footer-premium .footer-copy,
.footer-premium .footer-tagline {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.75);
}

@media (max-width: 768px) {
    body.app-authenticated .footer-premium {
        margin-left: 0;
    }
}

/* ── Navbar ── */
.app-navbar {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    background: rgba(255,255,255,0.96);
}

.app-navbar-brand {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
}

.app-navbar-logo {
    height: 36px !important;
    width: 36px !important;
    max-height: 36px !important;
    max-width: 36px !important;
    object-fit: cover;
    border-radius: 10px;
    border: 2px solid var(--gray-200);
    transition: transform var(--transition-base);
}

.app-navbar-brand:hover .app-navbar-logo {
    transform: scale(1.08);
}

.app-navbar-user {
    color: var(--gray-700);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.app-navbar-role {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--gray-500);
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    padding: 0.15rem 0.55rem;
}

.app-view-switcher-item {
    display: flex;
    align-items: center;
}

.app-view-switcher {
    display: inline-flex;
    align-items: center;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 0.15rem;
    gap: 0.1rem;
}

.app-view-switch-link {
    display: inline-block;
    color: var(--gray-600);
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.app-view-switch-link:hover {
    color: var(--gray-800);
    background: var(--gray-200);
}

.app-view-switch-link.is-active {
    color: var(--primary-color);
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Mobile: open sidebar button (admin and resident) */
.sidebar-open-btn {
    font-size: 1.25rem;
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    color: var(--primary-color);
}

.sidebar-open-btn:hover {
    background: var(--gray-100);
    color: var(--primary-hover);
}

/* Login Page Styles */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
}

.login-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
}

.login-card .card-title {
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
}

.login-card .form-label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
}

/* ── Dashboard Stat Cards ── */
.stat-card {
    border-radius: var(--card-radius);
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
    border: 1px solid var(--gray-200);
    background: white;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-light);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(26, 54, 93, 0.1);
}

.stat-card:hover::after {
    opacity: 1;
}

.stat-card.bg-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    border: none;
}

.stat-card.bg-primary::after {
    background: rgba(255,255,255,0.3);
}

.stat-card .stat-icon {
    font-size: 2.25rem;
    opacity: 0.85;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 800;
    margin: 0.5rem 0 0.25rem;
    letter-spacing: -0.02em;
}

.stat-card .stat-label {
    color: rgba(255,255,255,0.9);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

.stat-card .stat-sublabel {
    font-size: 0.8rem;
    opacity: 0.85;
    margin-top: 0.2rem;
}

/* Colored stat card variants */
.stat-card.stat-success { border-left: 4px solid var(--success-color); }
.stat-card.stat-danger  { border-left: 4px solid var(--danger-color); }
.stat-card.stat-warning { border-left: 4px solid var(--warning-color); }
.stat-card.stat-info    { border-left: 4px solid var(--info-color); }

.calendar-widget {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.day-widget {
    font-size: 1.1rem;
    color: var(--gray-500);
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.time-widget {
    font-size: 1rem;
    color: var(--gray-400);
    font-variant-numeric: tabular-nums;
}

/* ── Table Styles ── */
.data-table {
    background: white;
    border-radius: var(--card-radius);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--gray-200);
}

.data-table .table {
    margin-bottom: 0;
}

.data-table .table thead {
    background: var(--gray-800);
    color: white;
}

.data-table .table thead th {
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.07em;
    padding: 0.85rem 1.25rem;
    white-space: nowrap;
}

.data-table .table tbody td {
    padding: 0.85rem 1.25rem;
    vertical-align: middle;
}

.data-table .table tbody tr {
    transition: background-color var(--transition-base);
    border-bottom: 1px solid var(--gray-100);
}

.data-table .table tbody tr:hover {
    background-color: var(--primary-50);
}

.data-table .table tbody tr:last-child {
    border-bottom: none;
}

/* Ensure tables scroll on mobile */
.table-responsive {
    border-radius: var(--card-radius);
}

/* Touch-friendly tap targets */
@media (pointer: coarse) {
    .btn, .nav-link, .dropdown-item {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
    .dropdown-item {
        padding: 0.6rem 1rem;
    }
}

/* Navbar collapse mobile styling */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background: white;
        border-radius: 0 0 12px 12px;
        box-shadow: 0 8px 24px rgba(0,0,0,0.1);
        padding: 0.75rem;
        margin-top: 0.5rem;
    }
    .navbar-collapse .navbar-nav {
        gap: 0.25rem;
    }
    .navbar-collapse .nav-link {
        padding: 0.6rem 0.75rem;
        border-radius: 8px;
    }
    .navbar-collapse .nav-link:hover {
        background: var(--gray-50);
    }
    .navbar-collapse .dropdown-menu {
        box-shadow: none;
        border: 1px solid var(--gray-200);
    }
}

/* ── Badge Styles ── */
.badge {
    padding: 0.35em 0.7em;
    font-weight: 600;
    font-size: 0.72rem;
    border-radius: 6px;
    letter-spacing: 0.02em;
}

.badge.bg-primary {
    background: var(--primary-color) !important;
    color: white;
}

.badge.bg-danger {
    background: var(--danger-light) !important;
    color: var(--danger-color) !important;
}

.badge.bg-success {
    background: var(--success-light) !important;
    color: var(--success-color) !important;
}

.badge.bg-warning {
    background: var(--warning-light) !important;
    color: var(--warning-color) !important;
}

.badge.bg-info {
    background: var(--info-light) !important;
    color: var(--info-color) !important;
}

.badge.text-dark {
    color: var(--gray-700) !important;
}

/* ── Form Styles ── */
.form-card {
    background: white;
    border-radius: var(--card-radius);
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    margin-bottom: 2rem;
    border: 1px solid var(--gray-200);
}

.form-label {
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.form-control,
.form-select {
    border: 1.5px solid var(--gray-300);
    border-radius: 10px;
    padding: 0.65rem 1rem;
    font-size: 0.95rem;
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(59, 108, 176, 0.15);
}

.form-control::placeholder {
    color: var(--gray-400);
}

/* Required field asterisk */
.text-danger {
    color: var(--danger-color) !important;
}

/* ── Button Styles ── */
.btn {
    border-radius: 10px;
    font-weight: 600;
    padding: 0.6rem 1.25rem;
    transition: all var(--transition-base);
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    letter-spacing: 0.01em;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 54, 93, 0.12);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--primary-color);
    border: none;
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    border: none;
    color: white;
}

.btn-danger:hover {
    background: #b91c1c;
    color: white;
}

.btn-success {
    background: var(--success-color);
    border: none;
    color: white;
}

.btn-success:hover {
    background: #22543d;
    color: white;
}

.btn-warning {
    background: var(--warning-color);
    border: none;
    color: white;
}

.btn-outline-primary {
    border: 1.5px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-50);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

/* ── Status Badges — soft colors for accessibility ── */
.status-pending {
    background-color: var(--warning-light);
    color: var(--warning-color);
}

.status-approved {
    background-color: var(--success-light);
    color: var(--success-color);
}

.status-rejected {
    background-color: var(--danger-light);
    color: var(--danger-color);
}

.status-active {
    background-color: var(--success-light);
    color: var(--success-color);
}

.status-inactive {
    background-color: var(--gray-200);
    color: var(--gray-600);
}

.status-resolved {
    background-color: var(--info-light);
    color: var(--info-color);
}

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* ── Alert Styles ── */
.alert {
    border-radius: 10px;
    border: none;
    font-size: 0.9rem;
}

.alert-success { background: var(--success-light); color: var(--success-color); }
.alert-danger  { background: var(--danger-light);  color: var(--danger-color); }
.alert-warning { background: var(--warning-light); color: var(--warning-color); }
.alert-info    { background: var(--info-light);    color: var(--info-color); }

/* Pagination */
.pagination {
    margin-top: 1rem;
}

/* ── Search Bar ── */
.search-bar {
    background: white;
    border-radius: var(--card-radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--gray-200);
}

/* ── Residents Management Page ── */
.residents-management-page .residents-page-shell {
    padding-bottom: 0.25rem;
}

.residents-management-page .residents-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.2rem 1.35rem;
    background: linear-gradient(140deg, #ffffff 0%, #f4f7fb 100%);
    border: 1px solid var(--gray-200);
    border-radius: var(--card-radius);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.residents-management-page .residents-kicker {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--gray-500);
    margin-bottom: 0.25rem;
}

.residents-management-page .residents-title {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--gray-800);
}

.residents-management-page .residents-title i {
    margin-right: 0.35rem;
    color: var(--primary-color);
}

.residents-management-page .residents-subtitle {
    color: var(--gray-600);
    max-width: 760px;
}

.residents-management-page .residents-hero-actions {
    display: flex;
    align-items: center;
}

.residents-management-page .residents-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border-radius: 10px;
    font-weight: 600;
    padding: 0.55rem 1rem;
    white-space: nowrap;
}

.residents-management-page .residents-filter-panel {
    background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
}

.residents-management-page .residents-filter-heading {
    margin-bottom: 0.8rem;
}

.residents-management-page .residents-section-title {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gray-700);
    margin: 0;
}

.residents-management-page .residents-filter-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    margin-bottom: 0.32rem;
}

.residents-management-page .residents-table-shell {
    overflow: hidden;
}

.residents-management-page .residents-table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem 0.4rem 1.25rem;
    border-bottom: 1px solid var(--gray-200);
    background: #ffffff;
}

.residents-management-page .residents-table-meta {
    font-size: 0.86rem;
    color: var(--gray-500);
}

.residents-management-page .table-responsive {
    border-radius: 0;
}

.residents-management-page .residents-table thead {
    background: #f3f6fb;
    color: var(--gray-700);
}

.residents-management-page .residents-table thead th {
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-600);
}

.residents-management-page .residents-table tbody tr:hover {
    background: #f8fbff;
}

.resident-id-pill {
    display: inline-flex;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--primary-color);
    background: var(--primary-50);
    border: 1px solid var(--primary-100);
    border-radius: 999px;
    padding: 0.18rem 0.56rem;
}

.resident-name-cell {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 220px;
}

.resident-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e8eef8;
    color: var(--primary-color);
    font-size: 0.78rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.resident-name {
    font-weight: 600;
    color: var(--gray-800);
    line-height: 1.2;
}

.resident-subline {
    font-size: 0.76rem;
    color: var(--gray-500);
    margin-top: 0.1rem;
}

.resident-household-link {
    font-weight: 600;
    text-decoration: none;
}

.resident-household-link i {
    margin-right: 0.2rem;
}

.resident-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.resident-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    border-radius: 8px;
    padding: 0.26rem 0.52rem;
    white-space: nowrap;
}

.resident-action-btn i {
    font-size: 0.8rem;
}

.resident-action-text {
    font-size: 0.76rem;
    font-weight: 600;
}

@media (max-width: 991.98px) {
    .residents-management-page .residents-hero {
        flex-direction: column;
        align-items: stretch;
    }

    .residents-management-page .residents-hero-actions {
        width: 100%;
    }

    .residents-management-page .residents-add-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #6b7280;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

/* Links */
a {
    color: var(--primary-color);
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-hover);
}

/* ── Announcement Cards ── */
.announcement-card {
    border-left: 4px solid var(--primary-light);
    transition: all var(--transition-base);
    background: white;
}

.announcement-card:hover {
    border-left-color: var(--primary-color);
    transform: translateX(3px);
    box-shadow: 0 8px 24px rgba(26, 54, 93, 0.08);
}

/* ── Card & Card Headers ── */
.card {
    border: 1px solid var(--gray-200);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    border-radius: var(--card-radius);
    overflow: hidden;
}

.card-header {
    background: var(--gray-800);
    color: white;
    border: none;
    font-weight: 600;
    padding: 1rem 1.5rem;
    border-radius: var(--card-radius) var(--card-radius) 0 0;
    font-size: 0.9rem;
}

.card-header.bg-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%) !important;
    color: white;
    border: none;
}

.card-header.bg-info {
    background: var(--info-color) !important;
    color: white;
    border: none;
}

.card-body {
    padding: 1.25rem 1.5rem;
}

.card-header .card-title {
    color: white;
    margin: 0;
    font-weight: 600;
}

/* ── Modal Headers ── */
.modal-header.bg-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%) !important;
    color: white;
    border: none;
}

.modal-header.bg-danger {
    background: var(--danger-color) !important;
    color: white;
    border: none;
}

.modal-header.bg-success {
    background: var(--success-color) !important;
    color: white;
    border: none;
}

.modal-content {
    border: none;
    border-radius: var(--card-radius);
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.modal-footer {
    border-top: 1px solid var(--gray-100);
}

/* ── Content / Page Header ── */
.content-header {
    margin-bottom: 1.5rem;
}

.content-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--dark-color);
    margin: 0;
    letter-spacing: -0.01em;
}

.main-content h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

.btn-print-header {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.4);
}

.btn-print-header:hover {
    background: rgba(255,255,255,0.3);
    color: white;
    border-color: rgba(255,255,255,0.5);
}

.content-wrapper {
    margin-left: var(--app-sidebar-width, 250px);
    padding: 2rem;
    min-height: calc(100vh - var(--app-navbar-height, 56px));
}

.content {
    padding-bottom: 2rem;
}

/* ── Responsive ── */

/* Tablet and below */
@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }
    
    .content-wrapper {
        margin-left: 0;
        padding: 1rem;
    }
    
    .stat-card {
        margin-bottom: 0.75rem;
        padding: 1.1rem 1.25rem;
    }
    
    .stat-card .stat-value {
        font-size: 1.5rem;
    }
    
    .form-card {
        padding: 1rem;
    }
    
    .card-header {
        padding: 0.85rem 1rem;
        font-size: 0.85rem;
    }
    
    .card-body {
        padding: 1rem;
    }

    /* Navbar mobile */
    .app-navbar-brand {
        font-size: 0.95rem;
        max-width: 200px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .app-navbar-brand span {
        display: inline-block;
        max-width: 150px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        vertical-align: middle;
    }
    .app-navbar-logo {
        height: 30px !important;
        width: 30px !important;
        max-height: 30px !important;
        max-width: 30px !important;
    }
    .app-navbar-role {
        display: none;
    }
    .app-view-switcher-item {
        width: 100%;
        margin: 0.2rem 0 0.55rem;
    }
    .app-view-switcher {
        width: 100%;
        justify-content: center;
    }

    /* Table mobile: horizontal scroll */
    .data-table {
        border-radius: 10px;
    }
    .data-table .table thead th {
        font-size: 0.7rem;
        padding: 0.65rem 0.75rem;
    }
    .data-table .table tbody td {
        font-size: 0.85rem;
        padding: 0.65rem 0.75rem;
    }

    /* Notification dropdown: full-width on mobile */
    .notification-dropdown {
        width: calc(100vw - 24px) !important;
        max-width: 400px;
        right: -60px !important;
    }

    /* Modals */
    .modal-dialog {
        margin: 0.5rem;
    }
    .modal-content {
        border-radius: 12px;
    }

    /* Search bar */
    .search-bar {
        padding: 0.75rem 1rem;
    }

    /* Content header */
    .content-header h1,
    .main-content h2 {
        font-size: 1.15rem;
    }

    /* Dashboard charts responsive grid */
    .dashboard-charts {
        grid-template-columns: 1fr;
    }

    /* Footer Premium */
    body.app-authenticated .footer-premium {
        margin-left: 0;
    }
    .footer-premium .footer-desc {
        max-width: 100%;
    }
}

/* Phone screens */
@media (max-width: 576px) {
    .stat-card .stat-icon {
        font-size: 1.75rem;
    }
    .stat-card .stat-value {
        font-size: 1.25rem;
    }
    .stat-card .stat-label {
        font-size: 0.72rem;
    }
    .stat-card {
        padding: 0.9rem 1rem;
    }

    /* Stack buttons */
    .btn {
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
    }
    .btn-lg {
        font-size: 0.9rem;
        padding: 0.6rem 1.1rem;
    }

    /* Make badge text smaller */
    .badge {
        font-size: 0.65rem;
        padding: 0.3em 0.55em;
    }

    /* Notification dropdown */
    .notification-dropdown {
        width: calc(100vw - 16px) !important;
        right: -8px !important;
        left: auto !important;
    }

    /* Form inputs */
    .form-control,
    .form-select {
        font-size: 16px; /* Prevents iOS zoom on focus */
        padding: 0.6rem 0.85rem;
    }

    /* Chart container */
    .chart-container {
        padding: 0.85rem;
    }
    .chart-container canvas {
        max-height: 220px;
    }

    /* Card heading wrap */
    .card-header {
        font-size: 0.8rem;
        padding: 0.7rem 0.85rem;
    }
    .card-header .d-flex {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    /* Modal full-width on small screens */
    .modal-dialog {
        margin: 0.25rem;
        max-width: calc(100vw - 0.5rem);
    }

    /* Footer compact */
    .footer-premium .footer-bottom .row {
        text-align: center;
    }
    .footer-premium .footer-bottom .text-md-end {
        text-align: center !important;
        margin-top: 0.25rem;
    }
}

/* News Cards Styles - Professional News Layout */
.news-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.news-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transform: translateY(-6px);
}

.news-date-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--primary-color);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.9rem;
    z-index: 10;
    letter-spacing: 0.3px;
}

.news-image {
    position: relative;
    overflow: hidden;
    background: #f0f0f0;
}

.news-image img {
    display: block;
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.news-card:hover .news-image img {
    transform: scale(1.08);
}

.news-card-content {
    padding: 18px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.news-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.3;
    margin-bottom: 10px;
    transition: color 0.2s ease;
}

.news-card:hover .news-title {
    color: var(--primary-hover);
}

.news-excerpt {
    font-size: 0.93rem;
    color: #666;
    line-height: 1.5;
    flex-grow: 1;
    margin-bottom: 12px;
}

.news-link {
    display: inline-block;
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.93rem;
    align-self: flex-start;
}

.news-link:hover {
    color: var(--primary-hover);
    margin-left: 4px;
}

/* Announcements Section Header */
.announcements-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid var(--primary-color);
}

.announcements-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.announcements-header p {
    color: #666;
    font-size: 1rem;
    margin: 0;
}

/* ── Charts container ── */
.chart-container {
    position: relative;
    background: white;
    border-radius: var(--card-radius);
    border: 1px solid var(--gray-200);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    padding: 1.25rem;
}

.chart-container canvas {
    max-height: 280px;
}

.chart-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.75rem;
}

/* ── Dashboard grid layout ── */
.dashboard-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 1.25rem;
    margin-top: 1.25rem;
}

/* ── Notification dropdown enhancements ── */
.notification-dropdown {
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.12);
}

/* ── Empty state ── */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--gray-500);
}

.empty-state i {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    opacity: 0.25;
    color: var(--gray-400);
}

.empty-state p {
    font-size: 0.95rem;
    max-width: 300px;
    margin: 0 auto;
}

/* ── Loading skeleton ── */
@keyframes skeleton-pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

.skeleton {
    background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    border-radius: 6px;
}

/* ── Links ── */
a {
    color: var(--primary-light);
    transition: color var(--transition-base);
}

a:hover {
    color: var(--primary-color);
}

/* Print Styles */
@media print {
    .sidebar,
    .navbar,
    .btn,
    .pagination {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
}
