@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Poppins:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #818cf8;
    --primary-glow: rgba(79, 70, 229, 0.25);
    --bg-dark: #090d16;
    --bg-card: #131b2e;
    --bg-card-hover: #1a243d;
    --border-color: rgba(255, 255, 255, 0.08);
    --text-white: #f8fafc;
    --text-gray: #94a3b8;
    --accent-emerald: #10b981;
    --accent-cyan: #06b6d4;
    --accent-amber: #f59e0b;
    --radius-lg: 20px;
    --radius-md: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
    background: var(--bg-dark);
    color: var(--text-white);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navbar */
.dash-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 40px;
    background: rgba(19, 27, 46, 0.75);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 50;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.nav-brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #6366f1, #06b6d4);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 22px;
}

.nav-brand-title {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
}

.nav-brand-title span {
    background: linear-gradient(135deg, #818cf8, #38bdf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 18px;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 6px 14px;
    border-radius: 30px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #4f46e5, #06b6d4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.user-info-text {
    font-size: 14px;
    font-weight: 600;
    color: #e2e8f0;
}

.logout-btn {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
    padding: 8px 18px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #fff;
    transform: translateY(-1px);
}

/* Dashboard Container */
.dash-content {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 36px 24px;
}

/* Welcome Card */
.welcome-banner {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.25) 0%, rgba(6, 182, 212, 0.2) 100%), var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 36px 40px;
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.welcome-banner::before {
    content: '';
    position: absolute;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.2) 0%, transparent 70%);
    top: -50px;
    right: 20%;
    pointer-events: none;
}

.welcome-text h1 {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.welcome-text p {
    color: var(--text-gray);
    font-size: 15px;
    max-width: 600px;
}

.status-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-top: 14px;
}

/* Profile Info Cards Grid */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 36px;
}

.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 22px;
    display: flex;
    align-items: center;
    gap: 18px;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.info-card:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.4);
}

.info-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.12);
    color: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.info-card:nth-child(2) .info-icon {
    background: rgba(6, 182, 212, 0.12);
    color: var(--accent-cyan);
}

.info-card:nth-child(3) .info-icon {
    background: rgba(16, 185, 129, 0.12);
    color: var(--accent-emerald);
}

.info-card:nth-child(4) .info-icon {
    background: rgba(245, 158, 11, 0.12);
    color: var(--accent-amber);
}

.info-meta h4 {
    font-size: 13px;
    color: var(--text-gray);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.info-meta p {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    word-break: break-all;
}

/* Services Grid */
.section-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title i {
    color: var(--primary-light);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
    margin-bottom: 36px;
}

.service-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    color: inherit;
    display: block;
}

.service-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

.service-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.2), rgba(6, 182, 212, 0.2));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #38bdf8;
    margin-bottom: 16px;
}

.service-card h3 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 6px;
}

.service-card p {
    font-size: 13.5px;
    color: var(--text-gray);
    line-height: 1.5;
}

/* Applications Table Card */
.table-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 26px;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    padding: 12px 16px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-gray);
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 16px;
    font-size: 14.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

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

.badge-approved {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-pending {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.action-btn {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--primary-light);
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.action-btn:hover {
    background: var(--primary);
    color: #fff;
}

/* Footer */
.dash-footer {
    text-align: center;
    padding: 24px;
    font-size: 13.5px;
    color: var(--text-gray);
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

@media screen and (max-width: 768px) {
    .dash-nav {
        padding: 16px 20px;
    }

    .welcome-banner {
        flex-direction: column;
        align-items: flex-start;
        padding: 24px;
        gap: 20px;
    }
}

/* ================= ENHANCED DASHBOARD STYLES ================= */

/* Navigation Actions Enhancement */
.nav-links {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.nav-link-secondary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    color: var(--text-white);
}

.nav-link-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.nav-link-primary {
    background: linear-gradient(135deg, #4f46e5, #06b6d4);
    border: none;
    color: #fff;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.35);
}

.nav-link-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.5);
}

.user-badge {
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-badge:hover {
    border-color: var(--primary-light);
    background: rgba(99, 102, 241, 0.1);
}

/* Stats Counter Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
}

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

.stat-icon.blue { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.stat-icon.green { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.stat-icon.amber { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.stat-icon.cyan { background: rgba(6, 182, 212, 0.15); color: #22d3ee; }

.stat-meta h3 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.stat-meta p {
    font-size: 13px;
    color: var(--text-gray);
    margin-top: 4px;
}

/* Table Card & Filter Bar */
.table-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.filter-tabs {
    display: flex;
    gap: 8px;
}

.filter-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-gray);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn.active, .filter-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-color: var(--border-color);
}

.table-search {
    position: relative;
    min-width: 240px;
}

.table-search input {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 8px 14px 8px 36px;
    color: #fff;
    font-size: 13.5px;
    outline: none;
    transition: border-color 0.2s;
}

.table-search input:focus {
    border-color: var(--primary-light);
}

.table-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-gray);
}

.badge-rejected {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.action-btn.secondary {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-color);
    color: var(--text-gray);
}

.action-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.action-btn.fast-track {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.action-btn.fast-track:hover {
    background: #10b981;
    color: #fff;
}

.table-actions-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ================= MODAL OVERLAYS & CARDS ================= */
.app-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 1000;
    padding: 20px 14px;
    overflow-y: auto;
}

.app-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-modal-dialog {
    background: #111827;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 100%;
    max-width: 680px;
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7);
    animation: modalIn 0.25s ease-out;
    margin: auto;
}

.app-modal-dialog.large {
    max-width: 860px;
}

.app-modal-dialog form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.96) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.app-modal-header {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 28px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
}

.app-modal-header h3 {
    font-size: 19px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-gray);
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.modal-close:hover {
    color: #fff;
}

.app-modal-body {
    padding: 24px 28px;
    overflow-y: auto !important;
    overflow-x: hidden;
    flex: 1;
    min-height: 0;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #6366f1 rgba(255, 255, 255, 0.05);
}

.app-modal-body::-webkit-scrollbar {
    width: 8px;
}

.app-modal-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 4px;
}

.app-modal-body::-webkit-scrollbar-thumb {
    background: #6366f1;
    border-radius: 4px;
}

.app-modal-body::-webkit-scrollbar-thumb:hover {
    background: #4f46e5;
}

.app-modal-footer {
    flex-shrink: 0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 28px;
    border-top: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
}

/* Form Styles Inside Modals */
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

@media (max-width: 600px) {
    .form-grid-2 {
        grid-template-columns: 1fr;
    }
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-gray);
    margin-bottom: 6px;
}

.form-group input, 
.form-group select, 
.form-group textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 14px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
    border-color: var(--primary-light);
    background: rgba(255, 255, 255, 0.08);
}

.form-group select option {
    background: #1f2937;
    color: #fff;
}

/* Timeline Stepper (Tracking Modal) */
.tracking-header-info {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.info-item span {
    font-size: 12px;
    color: var(--text-gray);
    display: block;
}

.info-item strong {
    font-size: 14px;
    color: #fff;
}

.timeline-stepper {
    position: relative;
    padding-left: 32px;
    margin-top: 10px;
}

.timeline-stepper::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 10px;
    bottom: 20px;
    width: 2px;
    background: rgba(255, 255, 255, 0.1);
}

.timeline-step {
    position: relative;
    margin-bottom: 24px;
}

.step-bullet {
    position: absolute;
    left: -32px;
    top: 2px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #1e293b;
    border: 2px solid var(--text-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--text-gray);
    z-index: 1;
}

.timeline-step.completed .step-bullet {
    background: #10b981;
    border-color: #10b981;
    color: #fff;
}

.timeline-step.current .step-bullet {
    background: #f59e0b;
    border-color: #f59e0b;
    color: #fff;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.5);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.step-content h4 {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}

.step-content .step-date {
    font-size: 12px;
    color: var(--text-gray);
    margin: 2px 0 4px;
}

.step-content p {
    font-size: 13.5px;
    color: #cbd5e1;
}

/* ================= GOVERNMENT-GRADE CERTIFICATE STYLING ================= */
.cert-printable-container {
    background: #ffffff;
    color: #1e293b;
    border: 12px double #0d3b66;
    border-radius: 4px;
    padding: 36px 40px;
    position: relative;
    font-family: 'Plus Jakarta Sans', serif;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.cert-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.05;
    pointer-events: none;
    font-size: 320px;
    color: #0d3b66;
}

.cert-header {
    text-align: center;
    border-bottom: 2px solid #0d3b66;
    padding-bottom: 18px;
    margin-bottom: 22px;
    position: relative;
}

.cert-emblem {
    font-size: 44px;
    color: #0d3b66;
    margin-bottom: 4px;
}

.cert-header h2 {
    font-size: 21px;
    font-weight: 800;
    color: #0d3b66;
    letter-spacing: 0.5px;
    margin: 0;
}

.cert-header h4 {
    font-size: 13px;
    color: #475569;
    font-weight: 600;
    margin-top: 4px;
}

.cert-title-badge {
    display: inline-block;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #0f172a;
    font-size: 16px;
    font-weight: 800;
    padding: 6px 20px;
    border-radius: 6px;
    margin-top: 10px;
    letter-spacing: 0.5px;
}

.cert-meta-row {
    display: flex;
    justify-content: space-between;
    font-size: 12.5px;
    color: #475569;
    margin-bottom: 24px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #cbd5e1;
}

.cert-body-text {
    font-size: 15px;
    line-height: 1.8;
    color: #334155;
    margin-bottom: 28px;
    text-align: justify;
}

.cert-body-text strong {
    color: #0f172a;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.cert-details-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 28px;
    font-size: 13.5px;
}

.cert-details-table th, .cert-details-table td {
    border: 1px solid #e2e8f0;
    padding: 8px 12px;
    text-align: left;
    color: #1e293b;
}

.cert-details-table th {
    background: #f8fafc;
    width: 32%;
    font-weight: 700;
}

.cert-footer-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 24px;
    padding-top: 14px;
    border-top: 2px solid #0d3b66;
}

.cert-qr-box {
    display: flex;
    align-items: center;
    gap: 14px;
}

.cert-qr-code {
    width: 90px;
    height: 90px;
    background: #fff;
    padding: 4px;
    border: 1px solid #cbd5e1;
}

.cert-qr-text {
    font-size: 11px;
    color: #64748b;
    max-width: 160px;
    line-height: 1.4;
}

.cert-sign-seal {
    text-align: right;
    max-width: 260px;
}

.sign-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11.5px;
    font-weight: 700;
    margin-bottom: 6px;
}

.sign-officer {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
}

.sign-dept {
    font-size: 11px;
    color: #64748b;
}

/* Print CSS */
@media print {
    body * {
        visibility: hidden !important;
    }

    #certPrintArea, #certPrintArea * {
        visibility: visible !important;
    }

    #certPrintArea {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        border: 4px double #000 !important;
        box-shadow: none !important;
        padding: 20px !important;
    }

    .modal-close, .app-modal-footer, .dash-nav, .dash-footer {
        display: none !important;
    }
}

