/* Custom styles for the dental clinic screens (patient file, doctor file, etc.) */

/*
 * Safety net against horizontal page scroll on mobile: `.app` sets
 * overflow-x:hidden, but that does NOT clip position:fixed descendants
 * (like the sidebar) — if any child ever forces the page wider than the
 * viewport, the fixed sidebar bleeds into view at the screen edge. Stop the
 * overflow at the document level too so that can't happen.
 */
html,
body {
    overflow-x: hidden;
    max-width: 100%;
}

/*
 * Sidebar submenus (المستخدمون والأدوار / الإعدادات): main.css highlights an active
 * parent <li> via ".list-item.active a", but that's a descendant selector — it also
 * matches every nested submenu link, painting the whole open submenu the accent color
 * (color AND the active border-right both leak this way). Reset submenu links back to
 * normal, then re-highlight only the one that's actually active.
 */
.app .sidebar .list .item-collapse .list-item a {
    background: transparent;
    color: rgba(255, 255, 255, .68);
    font-size: 13px;
    border-inline-start: none;
}

.app .sidebar .list .item-collapse .list-item a:hover {
    color: #ffffff;
    background: transparent;
}

.app .sidebar .list .item-collapse .list-item.active a {
    background: transparent;
    color: var(--primary-bright);
    font-weight: 600;
    border-inline-start: 3px solid var(--primary-bright);
}

.patient-header-photo,
.doctor-header-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #F1F5F9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #94A3B8;
    flex: none;
}

/*
 * Compact profile header (patient file / doctor file): avatar + name on one
 * line, then a dense single-line "meta" row (phone, status, branches...)
 * instead of a wide grid of isolated label/value pairs with huge gaps.
 */
.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.profile-info {
    flex: 1;
    min-width: 0;
}

.profile-name-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.profile-name {
    font-size: 16px;
    font-weight: 800;
    color: #111827;
    margin: 0;
}

.profile-subtitle {
    font-size: 12.5px;
    color: #6B7280;
    margin-top: 2px;
}

.profile-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-top: 10px;
}

.profile-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
    color: #374151;
    flex-wrap: wrap;
}

.profile-meta-item>i {
    color: #9CA3AF;
    font-size: 12.5px;
    width: 14px;
    text-align: center;
}

.profile-note {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #E5E7EB;
    font-size: 12.5px;
    color: #6B7280;
}

/* ====== MINI STAT CARDS (compact quick-links / KPI row) ======
 * One clinical, low-key palette (teal/blue/amber/rose/indigo) on plain white
 * cards — a colored icon carries the meaning, not a tinted card background.
 * Used on the dashboard and inside profile-header pages (doctor/patient KPIs).
 */
.mini-stat-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 15px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #EEF1F5;
    text-decoration: none;
    height: 100%;
    transition: .2s;
}

.mini-stat-card:hover {
    border-color: #E2E8F0;
    box-shadow: 0 6px 16px rgba(17, 24, 39, .06);
}

.mini-stat-icon {
    width: 40px;
    height: 40px;
    flex: none;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
}

.mini-stat-body {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.mini-stat-label {
    font-size: 12px;
    font-weight: 600;
    color: #6B7280;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-stat-number {
    font-size: 17px;
    font-weight: 800;
    color: #111827;
    line-height: 1.2;
}

.mini-stat-teal .mini-stat-icon { background: var(--primary-bright); }
.mini-stat-blue .mini-stat-icon { background: var(--primary); }
.mini-stat-amber .mini-stat-icon { background: var(--primary-deep); }
.mini-stat-rose .mini-stat-icon { background: #E11D48; }
.mini-stat-indigo .mini-stat-icon { background: var(--primary-deep); }

.odontogram-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 10px;
}

.tooth-btn {
    width: 46px;
    height: 46px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, .1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    color: #fff;
}

.tooth-btn.bg-light-tooth {
    background: #dee2e6 !important;
    color: #495057;
}

.media-placeholder {
    aspect-ratio: 4/3;
    border-radius: 8px;
    background: #eef1f4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #99a3ad;
    font-size: 26px;
    gap: 6px;
}

.notes-timeline {
    border-right: 3px solid #dee2e6;
    padding-right: 16px;
}

.notes-timeline .note-item {
    position: relative;
    margin-bottom: 18px;
}

.notes-timeline .note-item::before {
    content: "";
    position: absolute;
    right: -21px;
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary-bright);
}

/*
 * Status column (appointments/visits/lab orders...): a badge plus an optional
 * "history/follow-up" trigger were rendered as two mismatched controls (a small
 * pill next to a full-size Bootstrap button). Line them up on one baseline with
 * a small round icon the same height as the badge.
 */
.status-cell {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-cell .badge {
    font-size: 11px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 20px;
}

.status-info-btn {
    width: 22px;
    height: 22px;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: var(--primary-tint);
    color: var(--primary);
    font-size: 11px;
    cursor: pointer;
    transition: .15s;
}

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

/*
 * Icon-only action buttons in table rows (edit/delete/view...): Bootstrap's
 * .btn-sm gives them slightly different widths depending on icon glyph width,
 * so they never quite line up into a clean grid. Force a fixed square.
 */
.main-table .btn-holder .btn,
.main-table .btn-holder .main-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

/*
 * Profile-style pages (patient file, doctor file...): Bootstrap's default
 * .nav-tabs is plain/unstyled here since nothing themes it. Give it one
 * clean, reusable look instead of the browser-default underline tabs.
 */
.nav-tabs {
    border-bottom: 1px solid #E5E7EB;
    gap: 4px;
    flex-wrap: nowrap;
    scrollbar-width: none;
}

.nav-tabs::-webkit-scrollbar {
    display: none;
}

.nav-tabs .nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    border: none;
    border-radius: 10px 10px 0 0;
    padding: 11px 18px;
    font-size: 13px;
    font-weight: 600;
    color: #6B7280;
    background: transparent;
    white-space: nowrap;
    transition: .15s;
}

.nav-tabs .nav-link:hover {
    color: var(--primary);
    background-color: #F8FAFC;
    border-color: transparent;
    isolation: isolate;
}

.nav-tabs .nav-link.active {
    color: var(--primary);
    background-color: var(--primary-tint);
    border-color: transparent;
    box-shadow: inset 0 -2px 0 var(--primary);
}

.tab-content {
    background: #fff;
    border: 1px solid #E5E7EB;
    border-top: none;
    border-radius: 0 0 14px 14px;
    padding: 1.25rem;
}

/*
 * Header (navbar) on mobile: the logo, branch switcher, notifications and
 * user menu were all fighting for space on one line and overflowing/overlapping.
 * Shrink and trim non-essential bits so everything fits on small screens.
 */
@media (max-width: 575.98px) {
    .main-navbar .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }

    .main-navbar .logo .img {
        width: 90px;
    }

    .main-navbar .gap-2rem {
        gap: 8px;
    }

    .main-navbar .btn.dropdown-toggle {
        padding: 6px 10px !important;
    }

    .main-navbar .branch-label {
        display: none;
    }

    .main-navbar .info-user {
        padding-right: 10px;
    }

    .main-navbar .info-user .content .text .dic {
        display: none;
    }

    .main-navbar .info-user .content .text .name {
        font-size: 13px;
        max-width: 90px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .main-navbar .info-user .content .img {
        width: 36px;
        height: 36px;
    }

    .main-navbar .dropdown-menu {
        max-width: 90vw;
    }
}
