﻿/* =============================================================
   MedCare Clinic Management System – Stylesheet
   ============================================================= */

/* ---- Reset & Base ----------------------------------------- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    background-color: #f0f2f5;
    color: #333;
}

a {
    text-decoration: none;
    color: #2980b9;
}

    a:hover {
        text-decoration: underline;
    }

/* ---- Layout ----------------------------------------------- */
.wrapper {
    display: flex;
    min-height: 100vh;
}

/* ---- Sidebar ---------------------------------------------- */
.sidebar {
    width: 220px;
    background: #1a2940;
    color: #cdd8e3;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-logo {
    padding: 20px 16px 16px;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    border-bottom: 1px solid #2c3e55;
    letter-spacing: 0.5px;
}

    .sidebar-logo span {
        color: #3498db;
    }

.sidebar-user {
    padding: 14px 16px;
    border-bottom: 1px solid #2c3e55;
    font-size: 12px;
    color: #8da5b8;
}

    .sidebar-user strong {
        display: block;
        color: #e2eaf2;
        font-size: 13px;
    }

.sidebar nav a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #afc0ce;
    font-size: 13px;
    transition: background 0.2s, color 0.2s;
    border-left: 3px solid transparent;
}

    .sidebar nav a:hover,
    .sidebar nav a.active {
        background: #243347;
        color: #ffffff;
        border-left-color: #3498db;
        text-decoration: none;
    }

.sidebar nav .nav-section {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #5d7a8a;
    padding: 16px 20px 4px;
}

.sidebar-logout {
    margin-top: auto;
    padding: 14px 20px;
    border-top: 1px solid #2c3e55;
}

    .sidebar-logout a {
        color: #e74c3c;
        font-size: 13px;
    }

        .sidebar-logout a:hover {
            text-decoration: none;
            color: #ff6b6b;
        }

/* ---- Main Content ----------------------------------------- */
.main-content {
    margin-left: 220px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ---- Top Bar ---------------------------------------------- */
.topbar {
    background: #fff;
    padding: 14px 28px;
    border-bottom: 1px solid #e0e6ed;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

    .topbar h2 {
        font-size: 18px;
        font-weight: 600;
        color: #1a2940;
    }

    .topbar .topbar-right {
        font-size: 13px;
        color: #7f8c9a;
    }

/* ---- Page Body -------------------------------------------- */
.page-body {
    padding: 28px;
    flex: 1;
}

/* ---- Cards ------------------------------------------------ */
.card {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e4eaf1;
    padding: 24px;
    margin-bottom: 24px;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: #1a2940;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eaf0f6;
}

/* ---- Stat Cards (Dashboard) ------------------------------- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

.stat-card {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e4eaf1;
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
}

    .stat-card .stat-label {
        font-size: 12px;
        color: #7f8c9a;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-bottom: 8px;
    }

    .stat-card .stat-value {
        font-size: 30px;
        font-weight: 700;
        color: #1a2940;
    }

    .stat-card.blue .stat-value {
        color: #2980b9;
    }

    .stat-card.green .stat-value {
        color: #27ae60;
    }

    .stat-card.orange .stat-value {
        color: #e67e22;
    }

    .stat-card.red .stat-value {
        color: #e74c3c;
    }

/* ---- Buttons ---------------------------------------------- */
.btn {
    display: inline-block;
    padding: 8px 18px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: opacity 0.2s, transform 0.1s;
    text-align: center;
}

    .btn:active {
        transform: scale(0.98);
    }

.btn-primary {
    background: #2980b9;
    color: #fff;
}

.btn-success {
    background: #27ae60;
    color: #fff;
}

.btn-danger {
    background: #e74c3c;
    color: #fff;
}

.btn-warning {
    background: #f39c12;
    color: #fff;
}

.btn-secondary {
    background: #95a5a6;
    color: #fff;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

.btn:hover {
    opacity: 0.88;
    text-decoration: none;
}

/* ---- Forms ------------------------------------------------ */
.form-group {
    margin-bottom: 16px;
}

    .form-group label {
        display: block;
        font-size: 13px;
        font-weight: 600;
        color: #4a5568;
        margin-bottom: 5px;
    }

.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #cdd5df;
    border-radius: 5px;
    font-size: 13px;
    color: #333;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

    .form-control:focus {
        outline: none;
        border-color: #3498db;
        box-shadow: 0 0 0 3px rgba(52,152,219,0.15);
    }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.form-actions {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid #eaf0f6;
    display: flex;
    gap: 10px;
}

.required {
    color: #e74c3c;
}

/* ---- Validation Errors ------------------------------------ */
.field-error {
    color: #e74c3c;
    font-size: 12px;
    display: block;
    margin-top: 3px;
}

.validation-summary {
    background: #fef0ef;
    border: 1px solid #f5c6c2;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 18px;
    color: #c0392b;
    font-size: 13px;
}

/* ---- Alerts ----------------------------------------------- */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: 500;
}

.alert-success {
    background: #eafaf1;
    color: #1e8449;
    border: 1px solid #a9dfbf;
}

.alert-danger {
    background: #fef0ef;
    color: #c0392b;
    border: 1px solid #f5c6c2;
}

.alert-info {
    background: #eaf4fb;
    color: #1a5276;
    border: 1px solid #aed6f1;
}

/* ---- GridView / Table ------------------------------------- */
.grid-container {
    overflow-x: auto;
}

table.grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

    table.grid th {
        background: #1a2940;
        color: #fff;
        padding: 11px 14px;
        text-align: left;
        font-weight: 600;
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 0.4px;
        white-space: nowrap;
    }

    table.grid td {
        padding: 10px 14px;
        border-bottom: 1px solid #eaf0f6;
        color: #444;
        vertical-align: middle;
    }

    table.grid tr:nth-child(even) td {
        background: #f8fafc;
    }

    table.grid tr:hover td {
        background: #eaf4fb;
    }

/* ---- Badges / Status Pills -------------------------------- */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-success {
    background: #d5f5e3;
    color: #1e8449;
}

.badge-warning {
    background: #fef9e7;
    color: #b7770d;
}

.badge-danger {
    background: #fdecea;
    color: #c0392b;
}

.badge-info {
    background: #eaf4fb;
    color: #1a5276;
}

.badge-secondary {
    background: #f0f2f5;
    color: #7f8c9a;
}

/* ---- Search / Filter Bar ---------------------------------- */
.search-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

    .search-bar input {
        flex: 1;
        min-width: 200px;
        padding: 8px 12px;
        border: 1px solid #cdd5df;
        border-radius: 5px;
        font-size: 13px;
    }

/* ---- Pager ------------------------------------------------ */
.pager {
    text-align: center;
    margin-top: 14px;
}

    .pager a, .pager span {
        display: inline-block;
        padding: 6px 12px;
        margin: 0 2px;
        border: 1px solid #cdd5df;
        border-radius: 4px;
        font-size: 13px;
        color: #2980b9;
        background: #fff;
    }

    .pager span {
        background: #2980b9;
        color: #fff;
        border-color: #2980b9;
    }

/* ---- Login Page ------------------------------------------- */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #1a2940 0%, #2c3e55 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box {
    background: #fff;
    border-radius: 10px;
    padding: 40px 44px;
    width: 380px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

.login-logo {
    text-align: center;
    margin-bottom: 28px;
}

    .login-logo h1 {
        font-size: 26px;
        font-weight: 800;
        color: #1a2940;
        margin-bottom: 4px;
    }

        .login-logo h1 span {
            color: #3498db;
        }

    .login-logo p {
        font-size: 13px;
        color: #7f8c9a;
    }

/* ---- Responsive ------------------------------------------- */
@media (max-width: 768px) {
    .sidebar {
        width: 0;
        overflow: hidden;
    }

    .main-content {
        margin-left: 0;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .stat-grid {
        grid-template-columns: 1fr 1fr;
    }
}
