/* ============================================================
   UNIOSUN LAB PORTAL - STYLES
   Brand colors sourced from uniosun.edu.ng: green, gold, deep blue.
   ============================================================ */

:root {
    --primary: #5C8018;
    --primary-dark: #3f5a10;
    --secondary: #4caf50;
    --accent: #F9C234;
    --accent-dark: #d9a300;
    --danger: #e74c3c;
    --warning: #f39c12;
    --info: #1d4d6b;
    --light: #f8f9fa;
    --dark: #2c3e50;
    --white: #ffffff;
    --gray: #6c757d;
    --sidebar-width: 260px;
    --header-height: 60px;
    --radius: 14px;
    --shadow: 0 4px 16px rgba(30, 41, 59, 0.07);
    --shadow-lift: 0 10px 28px rgba(30, 41, 59, 0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Tahoma, Geneva, Verdana, sans-serif;
    background: #f4f6f4;
    color: var(--dark);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Login Page - modern split screen */
.login-container {
    display: flex;
    min-height: 100vh;
    background: var(--white);
}

.login-visual {
    flex: 1.1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 50px;
    background: linear-gradient(160deg, var(--primary) 0%, var(--info) 100%);
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.login-visual::after {
    content: '';
    position: absolute;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: rgba(249, 194, 52, 0.12);
    right: -140px;
    bottom: -140px;
}

.login-visual-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    z-index: 1;
}

.login-visual-brand img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--white);
    padding: 4px;
}

.login-visual-brand h2 {
    font-size: 32px;
    font-weight: 700;
}

.login-visual-brand span {
    font-size: 12px;
    opacity: 0.85;
}

.login-visual-headline {
    position: relative;
    z-index: 1;
    max-width: 380px;
}

.login-visual-headline h1 {
    font-size: 32px;
    line-height: 1.3;
    margin-bottom: 12px;
}

.login-visual-headline p {
    font-size: 15px;
    opacity: 0.9;
}

.vc-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.18);
    backdrop-filter: blur(6px);
    border-radius: var(--radius);
    padding: 14px 18px;
    position: relative;
    z-index: 1;
}

.vc-card img {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent);
    flex-shrink: 0;
}

.vc-card h4 {
    font-size: 14px;
    margin-bottom: 2px;
}

.vc-card span {
    font-size: 12px;
    opacity: 0.85;
}

.login-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.login-box {
    background: var(--white);
    padding: 20px;
    width: 100%;
    max-width: 380px;
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo h1 {
    color: var(--primary);
    font-size: 22px;
    margin-bottom: 5px;
}

.login-logo p {
    color: var(--gray);
    font-size: 14px;
}

@media (max-width: 860px) {
    .login-container { flex-direction: column; }
    .login-visual { flex: none; padding: 28px 24px; }
    .login-visual-headline h1 { font-size: 22px; }
    .login-visual-headline p { display: none; }
    .vc-card { margin-top: 20px; }
    .login-form-panel { padding: 30px 20px; }
}

@media (max-width: 480px) {
    .vc-card { flex-direction: column; text-align: center; }
    .login-visual::after { display: none; }
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark);
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e6e9e6;
    border-radius: 10px;
    font-size: 15px;
    background: #fbfcfb;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(92, 128, 24, 0.12);
    background: var(--white);
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: var(--primary);
    color: var(--white);
    width: 100%;
    box-shadow: 0 4px 12px rgba(92, 128, 24, 0.25);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-success {
    background: var(--secondary);
    color: var(--white);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-warning {
    background: var(--warning);
    color: var(--white);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.alert {
    padding: 12px 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-danger {
    background: #fdecea;
    color: var(--danger);
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Dashboard Layout */
.dashboard {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(195deg, var(--primary-dark) 0%, #26380a 100%);
    color: var(--white);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: all 0.3s;
    z-index: 1000;
}

.sidebar-header {
    padding: 22px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}

.sidebar-header h2 {
    font-size: 18px;
    margin-bottom: 5px;
}

.sidebar-header p {
    font-size: 12px;
    opacity: 0.8;
}

.sidebar-user {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--accent);
    color: #4a3800;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
}

.user-info h4 {
    font-size: 14px;
    margin-bottom: 3px;
}

.user-info span {
    font-size: 12px;
    opacity: 0.8;
    text-transform: uppercase;
}

.sidebar-menu {
    list-style: none;
    padding: 15px 0;
}

.sidebar-menu li {
    margin: 2px 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    margin: 2px 12px;
    padding: 12px 14px;
    border-radius: 10px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 14px;
}

.sidebar-menu a:hover {
    background: rgba(255,255,255,0.08);
    color: var(--white);
}

.sidebar-menu a.active {
    background: var(--accent);
    color: #4a3800;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.sidebar-menu i {
    width: 25px;
    margin-right: 10px;
    font-size: 16px;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 20px;
}

/* Header */
.top-header {
    background: var(--white);
    padding: 18px 25px;
    border-radius: var(--radius);
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
}

.top-header h2 {
    font-size: 20px;
    color: var(--dark);
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    background: var(--white);
    padding: 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lift);
}

.stat-icon {
    width: 55px;
    height: 55px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--white);
}

.stat-icon.blue { background: var(--info); }
.stat-icon.green { background: var(--secondary); }
.stat-icon.orange { background: var(--accent); color: #4a3800; }
.stat-icon.red { background: var(--danger); }

.stat-details h3 {
    font-size: 28px;
    margin-bottom: 5px;
}

.stat-details p {
    color: var(--gray);
    font-size: 14px;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 25px;
}

.card-header {
    padding: 20px 25px;
    border-bottom: 1px solid #eef2ec;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 16px;
    color: var(--dark);
}

.card-body {
    padding: 25px;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.data-table th {
    background: #f3f6f1;
    font-weight: 600;
    color: var(--dark);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.data-table tr:hover {
    background: #f8faf6;
}

.badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success { background: #e4f1e0; color: #3f5a10; }
.badge-warning { background: #fdf1d9; color: #8a5a00; }
.badge-danger { background: #f8d7da; color: #721c24; }
.badge-info { background: #dbe9ef; color: #1d4d6b; }

/* Search Box */
.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-box input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e6e9e6;
    border-radius: 10px;
    font-size: 15px;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--white);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 18px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray);
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    padding: 15px 25px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

/* Patient Info Display */
.patient-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.patient-info h4 {
    color: var(--primary);
    margin-bottom: 15px;
    font-size: 16px;
}

.info-row {
    display: flex;
    margin-bottom: 8px;
}

.info-label {
    width: 150px;
    font-weight: 600;
    color: var(--gray);
    font-size: 14px;
}

.info-value {
    flex: 1;
    font-size: 14px;
}

/* Mobile top bar (hidden on tablet/desktop, shown below 768px) */
.mobile-topbar {
    display: none;
    align-items: center;
    justify-content: space-between;
    background: var(--primary-dark);
    color: var(--white);
    padding: 14px 18px;
    position: sticky;
    top: 0;
    z-index: 1100;
}

.mobile-topbar .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 16px;
}

.mobile-topbar button {
    background: rgba(255,255,255,0.15);
    border: none;
    color: var(--white);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
}

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

.sidebar-overlay.active {
    display: block;
}

/* Responsive: tablet */
@media (max-width: 992px) {
    :root { --sidebar-width: 230px; }

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

/* Responsive: mobile */
@media (max-width: 768px) {
    .mobile-topbar {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
        top: 0;
        transition: transform 0.25s ease;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 15px;
    }

    .top-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

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

    table.data-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .search-box form,
    .search-box > form {
        flex-wrap: wrap;
    }
}

/* Loading Spinner */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 2px solid #eee;
    margin-bottom: 20px;
}

.tab {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-weight: 600;
    color: var(--gray);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}
