/* --- VARIABLES --- */
:root {
    --primary: #008751; /* NIMC Green */
    --primary-dark: #005c38;
    --primary-light: #e6f4ea;
    --accent: #F2A900; /* Gold */
    --bg-body: #f0f2f5;
    --bg-card: #ffffff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --radius: 8px;
}

/* --- RESET --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* --- SIDEBAR --- */
.sidebar {
    width: 260px;
    background-color: var(--primary-dark);
    color: white;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.brand {
    height: 70px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    background: rgba(0,0,0,0.2);
    font-weight: 700;
    font-size: 1.2rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

    .brand i {
        margin-right: 10px;
        color: var(--accent);
        font-size: 1.4rem;
    }

.nav-links {
    padding: 20px 0;
    flex: 1;
}

.nav-item {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    transition: 0.2s;
    border-left: 3px solid transparent;
}

    .nav-item:hover, .nav-item.active {
        background: rgba(255,255,255,0.1);
        color: white;
        border-left-color: var(--accent);
    }

    .nav-item a i {
        margin-right: 15px;
        width: 20px;
        text-align: center;
    }

.user-profile {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    padding: 2px;
}

.user-info small {
    display: block;
    color: rgba(255,255,255,0.6);
    font-size: 0.75rem;
}

/* --- MAIN CONTENT --- */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    position: relative;
}

/* Top Header */
header {
    height: 70px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-title h2 {
    font-size: 1.25rem;
}

.system-status {
    font-size: 0.85rem;
    color: var(--primary);
    background: var(--primary-light);
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
}

/* Dashboard Container */
.container {
    padding: 30px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* --- SEARCH SECTION --- */
.search-section {
    background: var(--bg-card);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
    margin-bottom: 30px;
}

    .search-section h3 {
        margin-bottom: 10px;
        color: var(--text-main);
    }

    .search-section p {
        color: var(--text-muted);
        margin-bottom: 25px;
    }

.input-group {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

    .input-group input {
        flex: 1;
        padding: 16px 20px;
        font-size: 1.1rem;
        border: 2px solid var(--border);
        border-radius: var(--radius) 0 0 var(--radius);
        outline: none;
        transition: 0.2s;
    }

        .input-group input:focus {
            border-color: var(--primary);
        }

.btn-verify {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0 30px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 0 var(--radius) var(--radius) 0;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

    .btn-verify:hover {
        background: var(--primary-dark);
    }

    .btn-verify:disabled {
        background: #ccc;
        cursor: not-allowed;
    }

/* --- RESULT CARD --- */
.result-wrapper {
    display: none; /* Hidden by default */
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.id-card {
    display: flex;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid var(--border);
    margin-bottom: 30px;
}

.id-photo {
    width: 250px;
    background: #e0e0e0;
    position: relative;
}

    .id-photo img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.id-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--primary);
    color: white;
    text-align: center;
    padding: 8px;
    font-size: 0.8rem;
    font-weight: 600;
}

.id-details {
    flex: 1;
    padding: 30px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.detail-group {
    margin-bottom: 5px;
}

.detail-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 4px;
}

.detail-value {
    font-size: 1rem;
    color: var(--text-main);
    font-weight: 500;
}

.status-banner {
    grid-column: span 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--primary-light);
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid var(--primary);
}

.verified-badge {
    color: var(--primary);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.actions {
    grid-column: span 2;
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.btn-action {
    padding: 8px 16px;
    border: 1px solid var(--border);
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

    .btn-action:hover {
        background: #f9fafb;
        border-color: #ccc;
    }

/* --- AUDIT LOG TABLE --- */
.log-section {
    background: white;
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.section-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    align-items: center;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 12px 15px;
    border-bottom: 2px solid var(--border);
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

td {
    padding: 15px;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
}

tr:last-child td {
    border-bottom: none;
}

.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-fail {
    background: #fee2e2;
    color: #991b1b;
}

/* Loader */
.loader {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: none;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    /* Simplified mobile view */
    .id-card {
        flex-direction: column;
    }

    .id-photo {
        width: 100%;
        height: 200px;
    }

    .id-details {
        grid-template-columns: 1fr;
    }
}
