﻿/* =========================
   Clinic MVP Shared UI
========================= */

:root {
    --app-primary: #0d6efd;
    --app-success: #0f766e;
    --app-purple: #7c3aed;
    --app-dark: #0f172a;
    --app-muted: #64748b;
    --app-border: #e2e8f0;
    --app-soft-bg: #f8fafc;
    --app-shadow: 0 16px 45px rgba(15, 23, 42, .08);
    --app-shadow-lg: 0 24px 70px rgba(15, 23, 42, .18);
    --app-radius: 24px;
}

/* =========================
   Login Page
========================= */

.login-page {
    min-height: 82vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, #eefaf8 0%, #f8fbff 50%, #edf4ff 100%);
}

.login-card {
    max-width: 980px;
    width: 100%;
    border: 0;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: var(--app-shadow-lg);
    background: #fff;
}

.login-image-panel {
    min-height: 560px;
    background: linear-gradient(180deg, rgba(13, 110, 253, .08), rgba(15, 23, 42, .76)), url("https://images.unsplash.com/photo-1505751172876-fa1923c5c528?auto=format&fit=crop&w=1200&q=80");
    background-size: cover;
    background-position: center;
    color: white;
    padding: 2.5rem;
    display: flex;
    align-items: end;
}

.login-form-panel {
    padding: 3rem;
}

.brand-icon {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    background: var(--app-primary);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin-bottom: 1rem;
    box-shadow: 0 12px 30px rgba(13, 110, 253, .28);
}

.btn-login {
    min-height: 50px;
    border-radius: 14px;
    font-weight: 700;
    box-shadow: 0 12px 24px rgba(13, 110, 253, .22);
}

/* =========================
   Dashboard Page
========================= */

.dashboard-hero {
    border-radius: 28px;
    overflow: hidden;
    background: linear-gradient(90deg, rgba(15, 23, 42, .88), rgba(13, 110, 253, .55)), url("https://images.unsplash.com/photo-1505751172876-fa1923c5c528?auto=format&fit=crop&w=1600&q=80");
    background-size: cover;
    background-position: center;
    color: white;
    padding: 2.5rem;
    box-shadow: var(--app-shadow-lg);
}

.hero-icon,
.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.6rem;
}

.hero-icon {
    background: rgba(255,255,255,.16);
    backdrop-filter: blur(8px);
}

.stat-card,
.dashboard-section {
    border: 0;
    border-radius: var(--app-radius);
    box-shadow: var(--app-shadow);
}

.stat-card {
    transition: .2s ease;
}

    .stat-card:hover {
        transform: translateY(-3px);
    }

.stat-blue {
    background: var(--app-primary);
}

.stat-green {
    background: var(--app-success);
}

.stat-purple {
    background: var(--app-purple);
}

.dashboard-section {
    overflow: hidden;
}

.section-header {
    padding: 1.35rem 1.5rem;
    border-bottom: 1px solid #edf2f7;
    background: #fff;
}

.quick-btn {
    border-radius: 14px;
    padding: .75rem 1rem;
    font-weight: 700;
}

.open-btn {
    border-radius: 999px;
    font-weight: 600;
    padding: .35rem .85rem;
}

.avatar-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #e8f1ff;
    color: var(--app-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    margin-right: .65rem;
}

.complaint-row {
    background: var(--app-soft-bg);
    font-size: .9rem;
}

.empty-state {
    padding: 2rem;
    border-radius: 18px;
    background: var(--app-soft-bg);
    color: var(--app-muted);
    text-align: center;
}

/* =========================
   Shared Form/Table Styling
========================= */

.form-control {
    min-height: 50px;
    border-radius: 14px;
    border-color: #dbe3ea;
}

    .form-control:focus {
        border-color: var(--app-primary);
        box-shadow: 0 0 0 .25rem rgba(13, 110, 253, .12);
    }

.table thead th {
    background: var(--app-soft-bg);
    color: #334155;
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 1px solid var(--app-border);
}

.table tbody td {
    vertical-align: middle;
    padding: 1rem;
}

/* =========================
   Responsive
========================= */

@media (max-width: 991px) {
    .login-image-panel {
        min-height: 260px;
    }

    .login-form-panel {
        padding: 2rem;
    }

    .dashboard-hero {
        padding: 1.75rem;
    }
}


/* =========================
   App Header / Navbar
========================= */

.app-navbar {
    background: rgba(15, 23, 42, .92);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    box-shadow: 0 16px 40px rgba(15, 23, 42, .18);
    min-height: 76px;
}

.app-brand {
    color: #fff !important;
    display: inline-flex;
    align-items: center;
    gap: .8rem;
    text-decoration: none;
}

.app-brand-icon {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    background: linear-gradient(135deg, #0d6efd, #0f766e);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.35rem;
    box-shadow: 0 12px 28px rgba(13, 110, 253, .28);
}

.app-brand strong {
    display: block;
    font-size: 1.05rem;
    line-height: 1.1;
}

.app-brand small {
    display: block;
    color: rgba(255, 255, 255, .6);
    font-size: .72rem;
    margin-top: .15rem;
}

.app-nav-link {
    color: rgba(255, 255, 255, .68) !important;
    border-radius: 14px;
    padding: .65rem .85rem !important;
    font-weight: 600;
    font-size: .92rem;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    transition: .2s ease;
}

    .app-nav-link:hover {
        color: #fff !important;
        background: rgba(255, 255, 255, .08);
    }

    .app-nav-link.active,
    .app-nav-link[aria-current="page"] {
        color: #fff !important;
        background: rgba(13, 110, 253, .25);
    }

.app-user-box {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .45rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .08);
}

.app-user-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .12);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.app-user-meta {
    color: white;
    line-height: 1.1;
    min-width: 120px;
}

    .app-user-meta span {
        display: block;
        font-size: .7rem;
        color: rgba(255, 255, 255, .58);
    }

    .app-user-meta strong {
        display: block;
        font-size: .88rem;
        margin-top: .15rem;
    }

    .app-user-meta small {
        display: inline-block;
        margin-top: .2rem;
        padding: .12rem .45rem;
        border-radius: 999px;
        background: white;
        color: #0f172a;
        font-size: .68rem;
        font-weight: 700;
    }

.app-logout-btn {
    color: white;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 14px;
    padding: .55rem .85rem;
    font-weight: 700;
}

    .app-logout-btn:hover {
        background: white;
        color: #0f172a;
    }

.app-navbar-toggler {
    border: 1px solid rgba(255, 255, 255, .2);
}

.app-navbar .navbar-toggler-icon {
    filter: invert(1);
}

@media (max-width: 991px) {
    .app-user-box {
        margin-top: 1rem;
        align-items: flex-start;
    }

    .app-nav-link {
        width: 100%;
        margin-top: .25rem;
    }
}


/* =========================
   Patients Page
========================= */

.page-hero {
    border-radius: 28px;
    overflow: hidden;
    background: linear-gradient(90deg, rgba(15, 23, 42, .9), rgba(13, 110, 253, .55)), url("https://images.unsplash.com/photo-1584515933487-779824d29309?auto=format&fit=crop&w=1600&q=80");
    background-size: cover;
    background-position: center;
    color: white;
    padding: 2.5rem;
    box-shadow: var(--app-shadow-lg);
}

.search-card {
    border: 0;
    border-radius: 24px;
    box-shadow: var(--app-shadow);
}

.search-btn {
    border-radius: 14px;
    font-weight: 700;
}

.empty-patient-state {
    border-radius: 24px;
    background: white;
    box-shadow: var(--app-shadow);
    padding: 3rem 2rem;
    text-align: center;
}

.empty-icon {
    width: 72px;
    height: 72px;
    border-radius: 24px;
    background: #e8f1ff;
    color: var(--app-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 1rem;
}

/* =========================
   Create / Edit Forms
========================= */

.patient-create-hero {
    background: linear-gradient(90deg, rgba(15, 23, 42, .9), rgba(15, 118, 110, .58)), url("https://images.unsplash.com/photo-1584515933487-779824d29309?auto=format&fit=crop&w=1600&q=80");
    background-size: cover;
    background-position: center;
}

.form-card {
    border: 0;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--app-shadow);
}

.input-icon-wrap {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    z-index: 2;
}

.textarea-icon {
    top: 24px;
    transform: none;
}

.input-with-icon {
    padding-left: 44px;
}

.form-select.input-with-icon {
    padding-left: 44px;
}

.form-actions {
    display: flex;
    gap: .75rem;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid #edf2f7;
}

@media (max-width: 767px) {
    .form-actions {
        flex-direction: column;
    }

        .form-actions .btn {
            width: 100%;
        }
}

/* =========================
   Patient Details Page
========================= */

.patient-details-hero {
    background: linear-gradient(90deg, rgba(15, 23, 42, .9), rgba(13, 110, 253, .55)), url("https://images.unsplash.com/photo-1576091160550-2173dba999ef?auto=format&fit=crop&w=1600&q=80");
    background-size: cover;
    background-position: center;
}

.profile-card {
    border: 0;
    border-radius: 24px;
    box-shadow: var(--app-shadow);
}

.profile-avatar {
    width: 92px;
    height: 92px;
    border-radius: 30px;
    background: linear-gradient(135deg, #0d6efd, #0f766e);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
    font-weight: 800;
    box-shadow: 0 18px 35px rgba(13, 110, 253, .24);
}

.patient-info-list {
    display: grid;
    gap: .75rem;
}

    .patient-info-list div {
        padding: .9rem;
        border-radius: 18px;
        background: #f8fafc;
    }

    .patient-info-list span {
        display: block;
        color: #64748b;
        font-size: .78rem;
        margin-bottom: .25rem;
    }

    .patient-info-list strong {
        color: #0f172a;
        font-size: .95rem;
        overflow-wrap: anywhere;
    }

.visit-timeline {
    padding: 1.5rem;
}

.visit-card {
    border: 1px solid #e2e8f0;
    border-radius: 22px;
    padding: 1.25rem;
    background: #fff;
    margin-bottom: 1rem;
    box-shadow: 0 10px 25px rgba(15, 23, 42, .05);
}

    .visit-card:last-child {
        margin-bottom: 0;
    }

.visit-card-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.visit-date {
    color: #64748b;
    font-size: .88rem;
    margin-bottom: .25rem;
}

.visit-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    justify-content: flex-end;
}

.visit-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
}

    .visit-detail-grid > div {
        background: #f8fafc;
        border-radius: 16px;
        padding: .85rem;
    }

    .visit-detail-grid span {
        display: block;
        color: #64748b;
        font-size: .76rem;
        margin-bottom: .25rem;
    }

    .visit-detail-grid strong {
        color: #0f172a;
        font-size: .92rem;
        font-weight: 600;
        overflow-wrap: anywhere;
    }

.grid-span-2 {
    grid-column: span 2;
}

.attachments-box {
    background: #f8fafc;
    border-radius: 18px;
    padding: 1rem;
}

@media (max-width: 767px) {
    .visit-card-header {
        flex-direction: column;
    }

    .visit-actions {
        justify-content: flex-start;
    }

    .visit-detail-grid {
        grid-template-columns: 1fr;
    }

    .grid-span-2 {
        grid-column: span 1;
    }
}


/* =========================
   Visit Create / Edit Pages
========================= */

.visit-form-hero {
    background: linear-gradient(90deg, rgba(15, 23, 42, .9), rgba(13, 110, 253, .55)), url("https://images.unsplash.com/photo-1581056771107-24ca5f033842?auto=format&fit=crop&w=1600&q=80");
    background-size: cover;
    background-position: center;
}

.form-card .section-header {
    background: #fff;
}

textarea.form-control {
    min-height: auto;
}

.form-card + .form-card {
    margin-top: 1rem;
}

