* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Segoe UI", sans-serif;
}

body {
    background: #f4f7fc;
    color: #333;
}


/* ==========================================
   MAIN CONTENT
========================================== */

.main-content {
    margin-left: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}


/* ==========================================
   DASHBOARD CONTAINER
========================================== */

.dashboard-container {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    padding: 30px;
}


/* ==========================================
   PAGE HEADER
========================================== */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.page-header h2 {
    color: #123a84;
    font-size: 25px;
    margin-bottom: 5px;
}

.page-header p {
    color: #777;
    font-size: 14px;
}


/* ==========================================
   STATISTICS GRID
========================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 25px;
}


/* ==========================================
   STAT CARD
========================================== */

.stat-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 22px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid #edf0f5;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
    transition: 0.25s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}


/* ==========================================
   STAT ICON
========================================== */

.stat-icon {
    width: 55px;
    height: 55px;
    min-width: 55px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}


/* BLUE */

.stat-icon.blue {
    background: #e9f0ff;
    color: #2e6be6;
}


/* ORANGE */

.stat-icon.orange {
    background: #fff3df;
    color: #f59e0b;
}


/* GREEN */

.stat-icon.green {
    background: #e7f8ed;
    color: #16a34a;
}


/* PURPLE */

.stat-icon.purple {
    background: #f1eaff;
    color: #7c3aed;
}


/* ==========================================
   STAT INFO
========================================== */

.stat-info {
    min-width: 0;
}

.stat-info span {
    display: block;
    color: #777;
    font-size: 13px;
    margin-bottom: 5px;
}

.stat-info h2 {
    color: #123a84;
    font-size: 27px;
    margin-bottom: 3px;
}

.stat-info small {
    color: #999;
    font-size: 11px;
}


/* ==========================================
   DASHBOARD GRID
========================================== */

.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}


/* ==========================================
   DASHBOARD CARD
========================================== */

.dashboard-card {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #edf0f5;
    padding: 22px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
    min-width: 0;
}

.large-card {
    min-height: 330px;
}


/* ==========================================
   CARD HEADER
========================================== */

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 20px;
}

.card-header h3 {
    color: #123a84;
    font-size: 17px;
    margin-bottom: 4px;
}

.card-header p {
    color: #999;
    font-size: 12px;
}

.view-link {
    color: #2e6be6;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.view-link:hover {
    color: #123a84;
    text-decoration: underline;
}


/* ==========================================
   CHART
========================================== */

.chart-container {
    position: relative;
    width: 100%;
    height: 250px;
}

.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}


/* ==========================================
   SECTION LIST
========================================== */

.section-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.section-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 10px;
    border-bottom: 1px solid #f0f1f4;
}

.section-row:last-child {
    border-bottom: none;
}

.section-row div {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.section-row strong {
    color: #333;
    font-size: 13px;
}

.section-row span {
    color: #999;
    font-size: 11px;
}

.section-row b {
    color: #2e6be6;
    font-size: 16px;
}


/* ==========================================
   TABLE
========================================== */

.table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.dashboard-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 500px;
}

.dashboard-table th {
    background: #f7f9fc;
    color: #666;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    padding: 12px;
}

.dashboard-table td {
    padding: 13px 12px;
    border-bottom: 1px solid #edf0f5;
    color: #555;
    font-size: 13px;
}

.dashboard-table tbody tr:hover {
    background: #fafcff;
}


/* ==========================================
   STATUS
========================================== */

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.status-pending {
    background: #fff4df;
    color: #d97706;
}

.status-approved {
    background: #e8f8ee;
    color: #15803d;
}

.status-rejected {
    background: #feecec;
    color: #dc2626;
}


/* ==========================================
   DOCUMENT LIST
========================================== */

.document-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.document-item {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 13px 8px;
    border-bottom: 1px solid #edf0f5;
}

.document-item:last-child {
    border-bottom: none;
}

.document-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 9px;
    background: #f0f4ff;
    color: #2e6be6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.document-item div:last-child {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.document-item strong {
    color: #444;
    font-size: 13px;
}

.document-item span {
    color: #999;
    font-size: 11px;
}

.document-item span b {
    color: #dc3545;
}


/* ==========================================
   PENDING REQUESTS
========================================== */

.request-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.request-item {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 13px 8px;
    border-bottom: 1px solid #edf0f5;
    transition: 0.2s;
}

.request-item:last-child {
    border-bottom: none;
}

.request-item:hover {
    background: #fafcff;
    border-radius: 8px;
}


/* REQUEST ICON */

.request-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 9px;
    background: #fff4df;
    color: #f59e0b;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 16px;
}


/* REQUEST CONTENT */

.request-item > div:last-child {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.request-item strong {
    color: #444;
    font-size: 13px;
}

.request-item span {
    color: #999;
    font-size: 11px;
}

.request-item span b {
    color: #d97706;
    font-weight: 700;
}


/* ==========================================
   QUICK ACTIONS
========================================== */

.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.quick-action {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: #f8faff;
    border: 1px solid #edf0f5;
    border-radius: 10px;
    color: #444;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    transition: 0.25s;
}

.quick-action i {
    color: #2e6be6;
    font-size: 17px;
}

.quick-action:hover {
    background: #edf3ff;
    border-color: #cbdafe;
    transform: translateY(-2px);
}


/* ==========================================
   ACTIVITY
========================================== */

.activity-card {
    margin-bottom: 25px;
}

.activity-log {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 5px;
    border-bottom: 1px solid #edf0f5;
}

.activity-log:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    background: #edf3ff;
    color: #2e6be6;

    display: flex;
    align-items: center;
    justify-content: center;
}

.activity-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.activity-details h4 {
    color: #333;
    font-size: 13px;
}

.activity-details p {
    color: #777;
    font-size: 12px;
}

.activity-date {
    color: #aaa;
    font-size: 10px;
}


/* ==========================================
   EMPTY STATE
========================================== */

.empty-state {
    padding: 35px 20px;
    text-align: center;
    color: #999;
    font-size: 13px;
}


/* ==========================================
   FOOTER
========================================== */

footer {
    margin-top: auto;
    padding: 20px 30px;
    text-align: center;
    color: #999;
    font-size: 12px;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
}


/* ==========================================
   SIDEBAR OVERLAY
========================================== */

.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 998;
}

.overlay.active {
    display: block;
}


/* ==========================================
   RESPONSIVE - TABLET
========================================== */

@media (max-width: 1200px) {

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

}


/* ==========================================
   RESPONSIVE - MOBILE
========================================== */

@media (max-width: 900px) {

    .main-content {
        margin-left: 0;
    }

    .menu-toggle {
        display: block;
    }

    .topbar {
        height: auto;
        min-height: 80px;
        padding: 15px 20px;
        gap: 15px;
    }

    .topbar > div:nth-child(2) {
        flex: 1;
    }

    .topbar h1 {
        font-size: 18px;
    }

    .topbar p {
        font-size: 11px;
    }

    .date-pill {
        display: none;
    }

    .profile .info,
    .profile > i {
        display: none;
    }

    .topbar-right {
        gap: 5px;
    }

    .dashboard-container {
        padding: 20px;
    }

}


/* ==========================================
   RESPONSIVE - SMALL MOBILE
========================================== */

@media (max-width: 600px) {

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-container {
        padding: 15px;
    }

    .page-header h2 {
        font-size: 21px;
    }

    .dashboard-card {
        padding: 17px;
    }

    .card-header {
        align-items: flex-start;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 18px;
    }

    .request-item {
        padding: 12px 5px;
    }

}

/* ==========================================================
   RECENT REGISTRAR ACTIVITIES
========================================================== */

.activity-card {
    width: 100%;
}


.activity-list {
    display: flex;
    flex-direction: column;
    width: 100%;
}


.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 4px;
    border-bottom: 1px solid #eef2f7;
}


.activity-item:last-child {
    border-bottom: none;
}


.activity-icon {
    width: 42px;
    height: 42px;

    min-width: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 10px;

    background: #eff6ff;
    color: #2563eb;

    font-size: 17px;
}


.activity-content {
    flex: 1;
    min-width: 0;
}


.activity-title {
    margin-bottom: 4px;
}


.activity-title strong {
    color: #1e293b;
    font-size: 14px;
    font-weight: 600;
}


.activity-content p {
    margin: 0 0 7px;

    color: #64748b;

    font-size: 13px;
    line-height: 1.5;
}


.activity-meta {
    display: flex;
    align-items: center;
    gap: 16px;

    color: #94a3b8;

    font-size: 12px;
}


.activity-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}


.activity-meta i {
    font-size: 11px;
}


.activity-card .empty-state {
    min-height: 130px;

    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

    color: #94a3b8;

    text-align: center;
}


.activity-card .empty-state i {
    font-size: 28px;
    margin-bottom: 8px;
}


.activity-card .empty-state p {
    margin: 0;
}


/* ==========================================================
   MOBILE / SMALL SCREEN - FULL WIDTH CONTENT
========================================================== */

@media (max-width: 768px) {

    /* Hide sidebar by default */
    .sidebar {
        transform: translateX(-100%);
    }

    /* Sidebar opens when menu toggle is clicked */
    .sidebar.active {
        transform: translateX(0);
    }

    /* MAIN CONTENT USES THE WHOLE SCREEN */
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    /* Dashboard/page container */
    .dashboard-container {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* Prevent content from becoming wider than screen */
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

}

/* ==========================================================
   ENROLLMENT PAGE - FULL WIDTH FIX
========================================================== */

.main-content {
    width: calc(100% - 250px);
    margin-left: 250px;
    min-height: 100vh;
    box-sizing: border-box;
}

.dashboard-container {
    width: 100%;
    max-width: none !important;
    margin: 0;
    padding: 30px 40px;
    box-sizing: border-box;
}

/* Enrollment page content */
.enrollment-container,
.enrollment-page,
.page-container {
    width: 100%;
    max-width: none !important;
    box-sizing: border-box;
}

/* Cards should use the available width */
.dashboard-card,
.enrollment-card {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}

/* Enrollment table */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.dashboard-table,
.enrollment-table {
    width: 100%;
    min-width: 700px;
}

/* Filter section */
.filter-card,
.filters-card {
    width: 100%;
    max-width: none !important;
    box-sizing: border-box;
}

/* ==========================================================
   REGISTRAR DASHBOARD - FINAL RESPONSIVE / SIDEBAR FIX
   This block intentionally comes last so it overrides older
   dashboard/enrollment rules in this stylesheet.
========================================================== */

.registrar-dashboard {
    min-width: 0;
    overflow-x: hidden;
}

.registrar-dashboard .main-content {
    width: calc(100% - 260px) !important;
    max-width: none !important;
    margin-left: 260px !important;
    min-width: 0 !important;
}

.registrar-dashboard .dashboard-container {
    width: 100% !important;
    max-width: 1500px !important;
    margin: 0 auto !important;
    padding: 30px !important;
    min-width: 0 !important;
}

.registrar-dashboard .topbar {
    min-width: 0;
}

/* Workflow */

.workflow-card {
    width: 100%;
    margin-bottom: 25px;
    padding: 20px;
    background: #ffffff;
    border: 1px solid #edf0f5;
    border-radius: 14px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .05);
}

.workflow-header {
    margin-bottom: 16px;
}

.workflow-header h3 {
    color: #123a84;
    font-size: 17px;
    margin-bottom: 4px;
}

.workflow-header p {
    color: #8a94a6;
    font-size: 12px;
    line-height: 1.5;
}

.workflow-steps {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}

.workflow-step {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 12px 10px;
    border: 1px solid #e9edf4;
    border-radius: 10px;
    background: #f9fbff;
    color: #334155;
    text-decoration: none;
    transition: .2s ease;
}

.workflow-step:hover {
    transform: translateY(-2px);
    border-color: #cbd8f3;
    background: #f2f6ff;
}

.workflow-number {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #123a84;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.workflow-content {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.workflow-content strong {
    color: #1e293b;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.workflow-content small {
    color: #94a3b8;
    font-size: 10px;
    line-height: 1.3;
}

.workflow-step > i {
    flex: 0 0 auto;
    color: #94a3b8;
    font-size: 10px;
}

/* Quick actions */

.quick-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

/* Mobile sidebar / overlay */

@media (min-width: 993px) {

    .registrar-dashboard .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        width: 260px !important;
        height: 100vh !important;
        z-index: 10000 !important;
    }

    .registrar-dashboard .overlay {
        display: none !important;
    }

    .registrar-dashboard #menuToggle,
    .registrar-dashboard .menu-toggle,
    .registrar-dashboard .sidebar-toggle {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

}

@media (max-width: 1200px) {

    .registrar-dashboard .workflow-steps {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

}

@media (max-width: 992px) {

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

    .registrar-dashboard .main-content {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        min-width: 0 !important;
    }

    .registrar-dashboard .dashboard-container {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 20px !important;
    }

    .registrar-dashboard .sidebar {
        position: fixed !important;
        top: 0 !important;
        bottom: 0 !important;
        left: -280px !important;
        width: 280px !important;
        max-width: 280px !important;
        height: 100vh !important;
        z-index: 10000 !important;
        transition: left .3s ease !important;
        transform: none !important;
    }

    .registrar-dashboard .sidebar.active {
        left: 0 !important;
    }

    .registrar-dashboard .overlay {
        display: none;
        position: fixed !important;
        inset: 0 !important;
        width: 100% !important;
        height: 100% !important;
        background: rgba(15, 23, 42, .45) !important;
        z-index: 9999 !important;
    }

    .registrar-dashboard .overlay.active {
        display: block !important;
    }

    .registrar-dashboard #menuToggle,
    .registrar-dashboard .menu-toggle,
    .registrar-dashboard .sidebar-toggle {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        position: relative;
        z-index: 10001 !important;
        cursor: pointer;
    }

    .registrar-dashboard body.sidebar-open {
        overflow: hidden !important;
    }

    .registrar-dashboard .workflow-steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .registrar-dashboard .dashboard-grid {
        grid-template-columns: 1fr !important;
    }

    .registrar-dashboard .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

}

@media (max-width: 700px) {

    .registrar-dashboard .dashboard-container {
        padding: 15px !important;
    }

    .registrar-dashboard .stats-grid {
        grid-template-columns: 1fr !important;
    }

    .registrar-dashboard .workflow-steps {
        grid-template-columns: 1fr !important;
    }

    .registrar-dashboard .workflow-step {
        padding: 12px;
    }

    .registrar-dashboard .quick-actions {
        grid-template-columns: 1fr !important;
    }

    .registrar-dashboard .page-header {
        align-items: flex-start;
    }

    .registrar-dashboard .page-header h2 {
        font-size: 21px;
    }

    .registrar-dashboard .card-header {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .registrar-dashboard .topbar {
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden;
    }

    .registrar-dashboard .topbar > div:nth-child(2) {
        min-width: 0;
    }

}

@media (max-width: 480px) {

    .registrar-dashboard .dashboard-container {
        padding: 12px !important;
    }

    .workflow-card,
    .registrar-dashboard .dashboard-card {
        padding: 16px !important;
        border-radius: 12px;
    }

    .registrar-dashboard .stat-card {
        padding: 16px !important;
    }

    .registrar-dashboard .stat-info h2 {
        font-size: 24px;
    }

    .registrar-dashboard .chart-container {
        height: 220px;
    }

    .registrar-dashboard .topbar {
        padding: 12px 15px !important;
    }

}

/* When the sidebar is open, prevent page scrolling. */
body.sidebar-open {
    overflow: hidden !important;
}

/* Never allow the menu button to remain visible above an open sidebar. */
@media (max-width: 992px) {

    body.sidebar-open #menuToggle,
    body.sidebar-open .menu-toggle,
    body.sidebar-open .sidebar-toggle {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

}

