:root {
    --primary: #3a2c75;
    --secondary: #6a4c9c;
    --accent: #fca311;
    --bg-dark: #1a1625;
    --bg-light: #f8f9fd;
    --white: #ffffff;
    --text-main: #2d3748;
    --text-muted: #718096;
    --red: #e53e3e;
    --green: #38a169;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Segoe UI', sans-serif;
}

body {
    background: var(--bg-light);
    color: var(--text-main);
    display: flex;
}

/* Sidebar */
.sidebar {
    width: 260px;
    height: 100vh;
    background: var(--bg-dark);
    color: #fff;
    position: fixed;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 2.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-links {
    flex-grow: 1;
}

/* Logout Section */
.sidebar-footer {
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.logout-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fca5a5;
    /* Light red/pink */
    text-decoration: none;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    transition: 0.3s;
}

.logout-link:hover {
    background: rgba(229, 62, 62, 0.2);
    color: #ff8080;
}

/* Collapsed Sidebar Support (Mobile/Tablet) */
@media (max-width: 992px) {
    .sidebar {
        width: 80px;
        padding: 1rem 0.5rem;
    }

    .logout-link {
        justify-content: center;
    }
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #a0aec0;
    text-decoration: none;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    background: var(--primary);
    color: #fff;
}

/* Main Content */
.main-content {
    margin-left: 260px;
    width: calc(100% - 260px);
    padding: 2rem;
    background-image: url('/admin/images/logo.png');
    background-repeat: no-repeat;
    background-position: center center;
    background-attachment: fixed;
    /* Keeps it centered even when scrolling */
    background-size: 380px;
    background-blend-mode: overlay;
    background-color: rgba(248, 249, 253, 0.99);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.header-title h1 {
    font-size: 1.5rem;
    font-weight: 800;
}

.header-title p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Search & Profile */
.header-tools {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.search-container {
    position: relative;
}

.search-container i {
    position: absolute;
    left: 12px;
    top: 12px;
    color: var(--text-muted);
}

.search-container input {
    padding: 0.7rem 1rem 0.7rem 2.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    width: 280px;
    outline: none;
}

.user-avatar {
    width: 42px;
    height: 42px;
    background: var(--primary);
    color: #fff;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-weight: bold;
}

/* Stats Widgets */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.icon-box {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 1.25rem;
}

.purple {
    background: #f3f0ff;
    color: #6b46c1;
}

.green {
    background: #f0fff4;
    color: #2f855a;
}

.red {
    background: #fff5f5;
    color: #c53030;
}

.stat-info .label {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: block;
}

.stat-info .value {
    font-size: 1.4rem;
    font-weight: 800;
}

/* Table Section */
.content-card {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid #edf2f7;
    display: flex;
    justify-content: space-between;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 1rem 1.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    background: #fafafa;
}

td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f7fafc;
}

.main-text {
    font-weight: 700;
    color: var(--bg-dark);
}

.sub-text {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Badges */
.badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
}

.badge-paid {
    background: #dcfce7;
    color: #166534;
}

.deadline {
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.text-red {
    color: var(--red);
    font-weight: bold;
}

/* Buttons */
.btn-action {
    background: var(--primary);
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
}

.icon-btn {
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1.1rem;
}


/* --- Responsiveness & Layout Fixes --- */

/* 1. Base Layout Structure */
body {
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

.sidebar {
    width: 260px;
    transition: all 0.3s ease;
    z-index: 1000;
}

.main-content {
    flex: 1;
    width: 100%;
    padding: 20px;
    transition: all 0.3s ease;
}

/* 2. Grid Responsiveness */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* 3. Table Responsiveness */
.table-container {
    width: 100%;
    overflow-x: auto;
    /* Allows horizontal scroll on mobile tables */
    -webkit-overflow-scrolling: touch;
}

/* 4. Mobile Devices (Tablets/Phones) */
@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        left: -260px;
        /* Hide sidebar off-screen */
        height: 100vh;
    }

    .sidebar.active {
        left: 0;
        /* Slide in when active */
    }

    .main-content {
        margin-left: 0;
        padding: 15px;
    }

    /* Show a hamburger menu button (needs to be added to HTML) */
    .mobile-toggle {
        display: block !important;
    }
}

@media (max-width: 576px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .header-tools {
        width: 100%;
    }

    .search-container {
        width: 100%;
    }
}


/* Table Mobile Transformation */
@media (max-width: 768px) {

    #dashboardTable,
    #dashboardTable tr,
    #dashboardTable td {
        display: block;
        width: 100%;
    }

    thead {
        display: none;
        /* Hide headers on mobile */
    }

    #dashboardTable tr {
        margin-bottom: 15px;
        border: 1px solid #eee;
        border-radius: 8px;
        padding: 10px;
        background: #fff;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    }

    #dashboardTable td {
        text-align: right;
        padding: 8px 10px;
        position: relative;
        border: none;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    /* Create labels using pseudo-elements */
    #dashboardTable td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #666;
        font-size: 0.85rem;
        text-transform: uppercase;
    }

    #dashboardTable td:last-child {
        border-top: 1px solid #eee;
        margin-top: 5px;
        padding-top: 15px;
        justify-content: center;
    }

    .main-text {
        text-align: right;
    }

    .sub-text {
        text-align: right;
    }
}





/* Table Mobile Transformation - Using your exact Dashboard logic */
@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .header-tools {
        width: 100%;
        flex-direction: column;
    }

    .search-container,
    #catFilter {
        width: 100% !important;
    }

    #appsTable,
    #appsTable tr,
    #appsTable td {
        display: block;
        width: 100%;
    }

    thead {
        display: none;
    }

    #appsTable tr {
        margin-bottom: 15px;
        border: 1px solid #eee;
        border-radius: 8px;
        padding: 10px;
        background: #fff;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    }

    #appsTable td {
        text-align: right;
        padding: 8px 10px;
        position: relative;
        border: none;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    #appsTable td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #666;
        font-size: 0.85rem;
        text-transform: uppercase;
    }

    #appsTable td:last-child {
        border-top: 1px solid #eee;
        margin-top: 5px;
        padding-top: 15px;
        justify-content: center;
    }

    .main-text,
    .sub-text {
        text-align: right;
    }


    #studentsTable,
    #studentsTable tr,
    #studentsTable td {
        display: block;
        width: 100%;
    }

    #studentsTable tr {
        margin-bottom: 15px;
        border: 1px solid #eee;
        border-radius: 8px;
        padding: 10px;
        background: #fff;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    }

    #studentsTable td {
        text-align: right;
        padding: 8px 10px;
        position: relative;
        border: none;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    #studentsTable td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #666;
        font-size: 0.85rem;
        text-transform: uppercase;
    }

    #studentsTable td:last-child {
        border-top: 1px solid #eee;
        margin-top: 5px;
        padding-top: 15px;
        justify-content: center;
    }

    #coursesTable,
    #coursesTable tr,
    #coursesTable td {
        display: block;
        width: 100%;
    }

    thead {
        display: none;
    }

    #coursesTable tr {
        margin-bottom: 15px;
        border: 1px solid #eee;
        border-radius: 8px;
        padding: 10px;
        background: #fff;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    }

    #coursesTable td {
        text-align: right;
        padding: 8px 10px;
        position: relative;
        border: none;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    #coursesTable td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #666;
        font-size: 0.85rem;
        text-transform: uppercase;
    }

    #coursesTable td:last-child {
        border-top: 1px solid #eee;
        margin-top: 5px;
        padding-top: 15px;
        justify-content: center;
    }


    #paymentsTable,
    #paymentsTable tr,
    #paymentsTable td {
        display: block;
        width: 100%;
    }

    thead {
        display: none;
    }

    #paymentsTable tr {
        margin-bottom: 15px;
        border: 1px solid #eee;
        border-radius: 8px;
        padding: 10px;
        background: #fff;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    }

    #paymentsTable td {
        text-align: right;
        padding: 8px 10px;
        position: relative;
        border: none;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    #paymentsTable td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #666;
        font-size: 0.85rem;
        text-transform: uppercase;
    }

    #paymentsTable td:last-child {
        border-top: 1px solid #eee;
        margin-top: 5px;
        padding-top: 15px;
        justify-content: center;
    }
}




/* Document Slide Panel */
.doc-panel {
    position: fixed;
    top: 0;
    right: -100%;
    /* Start hidden off-screen */
    width: 50%;
    height: 100vh;
    background: #fff;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
    transition: right 0.4s cubic-bezier(0.05, 0.7, 0.1, 1);
    z-index: 2000;
    display: flex;
    flex-direction: column;
}

.doc-panel.active {
    right: 0;
    /* Slide in */
}

.panel-header {
    padding: 20px;
    background: var(--primary);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-body {
    padding: 20px;
    height: calc(100vh - 100px);
    /* Adjust based on your header height */
    overflow-y: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.panel-body img {
    max-width: 100%;
    border-radius: 8px;
}

.panel-body iframe,
.panel-body img {
    width: 100%;
    height: 100%;
    border: none;
    object-fit: contain;
}

/* Dark Backdrop Overlay */
.panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(2px);
    display: none;
    z-index: 1999;
}

/* Mobile Responsive Adjustments */
@media (max-width: 992px) {
    .doc-panel {
        width: 90%;
    }
}



/* Layout Structure */
.profile-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 25px;
    margin-top: 20px;
}

/* Stats Section */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.bg-blue {
    background: #3b82f6;
}

.bg-green {
    background: #10b981;
}

.bg-orange {
    background: #f59e0b;
}

.admission-status {
    font-size: 0.7rem;
    margin-top: 5px;
    opacity: 0.9;
}

/* Content Cards */
.info-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.info-card h3 {
    margin-bottom: 20px;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row span {
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 500;
}

.detail-row strong {
    color: var(--text-main);
}

.id-status-text {
    color: #d97706;
}

/* Sidebar Styling */
.sidebar-id {
    text-align: center;
}

.avatar {
    width: 100px;
    height: 100px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 15px;
    font-weight: bold;
}

.sidebar-name {
    margin: 0;
}

.sidebar-reg {
    color: var(--primary);
    font-weight: 700;
    margin: 5px 0;
}

.enrollment-badge {
    margin-top: 15px;
}

/* Document Buttons */
.doc-btn {
    width: 100%;
    justify-content: center;
    background: #f8fafc;
    color: #000;
    border: 1px solid #e2e8f0;
    margin-bottom: 10px;
}

.doc-btn:last-child {
    margin-bottom: 0;
}

/* Header overrides */
.back-link {
    text-decoration: none;
    color: #64748b;
    font-size: 0.9rem;
}

.profile-title {
    margin-top: 5px;
}

.btn-update-id {
    background: var(--accent);
    color: #000;
}

.btn-print {
    background: var(--primary);
}

@media (max-width: 992px) {
    .profile-container {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}



.login-body {
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    margin: 0;
}

.login-card {
    background: white;
    width: 100%;
    max-width: 400px;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.login-card img {
    width: 80px;
    margin-bottom: 20px;
}

.login-card h2 {
    color: var(--text-main);
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.login-card p {
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 30px;
}

.alert {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 20px;
    border: 1px solid #fecaca;
}

.form-group {
    text-align: left;
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.input-wrapper {
    position: relative;
}

.input-wrapper i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

.form-control {
    width: 100%;
    padding: 12px 12px 12px 40px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    box-sizing: border-box;
}

.btn-login {
    background: var(--primary);
    color: white;
    border: none;
    width: 100%;
    padding: 14px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
}

.btn-login:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.footer-links {
    margin-top: 25px;
    font-size: 0.85rem;
}

.footer-links a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

/* Honeypot - Hidden from humans */
.hidden-field {
    display: none;
    visibility: hidden;
}



/* Apply form */
.public-container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #f87171;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-group.full-width {
    grid-column: span 2;
}

.upload-box {
    border: 2px dashed #e2e8f0;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    background: #f8fafc;
}

.btn-submit-main {
    background: var(--primary);
    color: white;
    padding: 18px;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    width: 100%;
    cursor: pointer;
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}



/* view application */

.view-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 20px;
    margin-top: 20px;
}

.info-section {
    margin-bottom: 30px;
}

.info-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    color: var(--primary);
    border-bottom: 2px solid #f0f2f5;
    padding-bottom: 8px;
}

.doc-preview {
    background: #f8fafc;
    border: 2px dashed #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    margin-bottom: 15px;
    transition: 0.3s;
}

.doc-preview:hover {
    border-color: var(--primary);
    background: #fff;
}

.action-bar {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.05);
    margin-left: -20px;
    margin-right: -20px;
    margin-top: 30px;
}

@media (max-width: 992px) {
    .view-grid {
        grid-template-columns: 1fr;
    }

    .action-bar {
        flex-direction: column;
        position: fixed;
        width: 100%;
        left: 0;
        margin: 0;
        z-index: 100;
    }

    .main-content {
        padding-bottom: 180px;
    }

}


.logo img {
    width: 120px;
    height: 120px;
    object-fit: contain;
}


/* add application */
.admin-form-container {
    max-width: 1000px;
    margin: 20px auto;
    padding: 0 15px;
}

.choices__inner {
    background-color: #fff;
    border-radius: 6px;
    border: 1px solid #ddd;
    padding: 5px;
}

.form-card {
    background: #fff;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 25px;
}

.form-card h3 {
    margin-bottom: 20px;
    font-size: 1.1rem;
    color: var(--primary);
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.btn-submit {
    background: var(--primary);
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    width: 100%;
    margin-top: 10px;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #bbf7d0;
    margin-bottom: 20px;
}

@media (max-width: 768px) {

    .full-width {
        grid-column: span 1;
    }
}