/* ===== SILICA Shared Styles ===== */
:root {
    --primary: #0060ff;
    --primary-light: #eef4ff;
    --sidebar-w: 230px;
    --text-dark: #000000;
    --text-body: #000000;
    --text-muted: #000000;
    --border: #e2e8f0;
    --bg-page: #f8fafc;
    --radius: 14px;
    --radius-lg: 18px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.04);
    --shadow-md: 0 4px 16px rgba(0,0,0,.06);
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: #dce4ef;
    font-size: 14px;
    color: var(--text-body);
    padding: 16px;
    margin: 0;
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* === APP SHELL === */
.app-shell {
    display: flex;
    min-height: calc(100vh - 32px);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0,0,0,.08);
    background: var(--bg-page);
    border: 0px solid #000000;
}

/* === SIDEBAR === */
.sidebar {
    width: var(--sidebar-w);
    min-width: var(--sidebar-w);
    background: #fff;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
}

.sidebar-brand {
    padding: 24px 20px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-brand .logo {
    display: flex; align-items: center; gap: 10px; text-decoration: none;
}

.sidebar-brand .logo-icon {
    width: 36px; height: 36px;
    background: var(--primary);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 17px;
}

.sidebar-brand .brand-title {
    font-size: 18px; font-weight: 700; color: var(--text-dark); line-height: 1.2;
}

.sidebar-brand .brand-sub {
    font-size: 9.5px; color: var(--primary); font-style: italic; letter-spacing: .2px;
}

.sidebar-toggle {
    background: none; border: none; color: #b0b8c4; font-size: 20px; cursor: pointer;
}

.sidebar-menu { flex: 1; padding: 8px 10px; overflow-y: auto; }

/* Main menu parent */
.menu-group { margin-bottom: 4px; }
.menu-parent {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 16px;
    color: #000000; text-decoration: none;
    font-size: 14px; font-weight: 600;
    cursor: pointer; transition: all .2s;
    border-radius: 10px;
    user-select: none;
}
.menu-parent:hover { background: var(--primary-light); color: var(--primary); }
.menu-parent.open { color: var(--primary); }
.menu-parent i.bi { font-size: 17px; width: 22px; text-align: center; color:blue !important; }
.menu-parent .arrow { margin-left: auto; font-size: 12px; transition: transform .2s; }
.menu-parent.open .arrow { transform: rotate(90deg); }

/* Sub menu */
.menu-sub { display: none; padding: 2px 0 4px 0; }
.menu-sub.show { display: block; }
.menu-sub .menu-child {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 16px 9px 50px;
    color: #000 !important; text-decoration: none;
    font-size: 13px; font-weight: 500;
    border-radius: 8px;
    transition: all .15s;
    position: relative;
}
.menu-sub .menu-child::before {
    content: ''; position: absolute; left: 34px; top: 50%; transform: translateY(-50%);
    width: 5px; height: 5px; border-radius: 50%; background: #cbd5e1; transition: .2s;
}
.menu-sub .menu-child:hover { color: var(--primary); background: var(--primary-light); }
.menu-sub .menu-child:hover::before { background: var(--primary); }
.menu-sub .menu-child.active {
    color: var(--primary); background: var(--primary-light); font-weight: 600;
}
.menu-sub .menu-child.active::before { background: var(--primary); width: 7px; height: 7px; }

/* Single menu item (no children) */
.sidebar-menu .menu-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 16px;
    color: #000000; text-decoration: none;
    font-size: 14px; font-weight: 600;
    cursor: pointer; transition: all .2s;
    border-radius: 10px;
    margin-bottom: 2px;
}
.sidebar-menu .menu-item:hover { background: var(--primary-light); color: var(--primary); }
.sidebar-menu .menu-item.active {
    color: var(--primary); background: var(--primary-light); font-weight: 600;
}
.sidebar-menu .menu-item i { font-size: 17px; width: 22px; text-align: center; }

/* Sidebar section label */
.menu-label {
    font-size: 10px; font-weight: 700; color: #000000;
    text-transform: uppercase; letter-spacing: 1.5px;
    padding: 16px 16px 6px; margin-top: 4px;
}

.sidebar-menu .menu-item i {
    font-size: 18px; width: 22px; color:blue !important; text-align: center;
}

.sidebar-footer {
    padding: 18px 20px; border-top: 1px solid var(--border);
}

.sidebar-footer .help-link {
    display: flex; align-items: center; gap: 8px;
    color: #64748b; font-size: 13px; margin-bottom: 16px;
    cursor: pointer; text-decoration: none;
}

.sidebar-footer .help-link:hover { color: var(--primary); }

.sidebar-footer .user-block {
    display: flex; align-items: center; gap: 10px;
}

.sidebar-footer .user-avatar {
    width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: #e2e8f0;
}

.sidebar-footer .user-name { font-size: 13px; font-weight: 600; color: var(--text-dark); }
.sidebar-footer .user-role { font-size: 11px; color: var(--text-muted); }
.sidebar-footer .btn-logout {
    width: 36px; height: 36px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: #94a3b8; background: var(--bg-page); border: 1px solid var(--border);
    font-size: 18px; text-decoration: none; transition: .2s; flex-shrink: 0;
}
.sidebar-footer .btn-logout:hover { color: #ef4444; border-color: #fecaca; background: #fef2f2; }

/* === MAIN AREA === */
.main-area {
    flex: 1; display: flex; flex-direction: column;
    overflow-y: auto; background: var(--bg-page);
}

/* Top bar - Deep Navy */
.top-bar {
    background: #ffffff;
    padding: 18px 32px;
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: none;
}

.top-bar h1 {
    font-size: 22px; font-weight: 700; margin: 0; color: #0056ff;
}

.top-bar .text-muted,
.top-bar .d-flex > i.bi,
.top-bar .d-flex .text-muted {
    color: rgba(0,105,255,1) !important;
}

.top-bar .header-actions {
    display: flex; align-items: center; gap: 16px;
}

.top-bar .search-input {
    background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); border-radius: 10px;
    padding: 9px 16px 9px 38px; font-size: 13px; outline: none; width: 180px;
    color: #0056ff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='%23ffffff60' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242.656a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: 14px center;
    transition: .2s;
}

.top-bar .search-input::placeholder { color: rgba(255,255,255,.4); }

.top-bar .search-input:focus {
    border-color: var(--primary);
    background: rgba(255,255,255,.12);
    box-shadow: 0 0 0 3px rgba(66,133,244,.2);
}

.top-bar .btn-primary {
    background: var(--primary); border-color: var(--primary);
}

.noti-bell {
    position: relative; font-size: 21px; color: rgba(255,255,255,.6); cursor: pointer;
}

.noti-bell:hover { color: #fff; }

.noti-bell .dot {
    position: absolute; top:-2px; right:-2px;
    width:9px; height:9px; background:#ef4444;
    border-radius:50%; border:2px solid #0f172a;
}

/* Breadcrumb bar */
.crumb-bar {
    background: #000000; padding: 12px 32px;
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: none;
}

.crumb-bar .crumbs a { color: #60a5fa; }
.crumb-bar .crumbs .sep { color: #475569; }
.crumb-bar .crumbs .cur { color: #ffffff; }
.crumb-bar .btn-outline-secondary { border-color: #334155; color: #ffffff; }
.crumb-bar .btn-outline-secondary:hover { background: #334155; color: #fff; border-color: #475569; }

.crumb-bar .crumbs {
    display: flex; align-items: center; gap: 8px; font-size: 14px;
}

.crumb-bar .crumbs a {
    color: #60a5fa; text-decoration: none; font-weight: 500;
}

/* Page area - KEY: generous padding */
.page-area {
    flex: 1;
    padding: 32px;
}

/* === CARDS === */
.card {
    border: none;
    box-shadow: var(--shadow-sm);
    border-radius: var(--radius);
    background: #fff;
    border: 1px solid rgba(0,0,0,.03);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
}

/* === PATIENT DETAIL COMPONENTS === */
.profile-avatar-wrap {
    width: 92px; height: 92px; border-radius: 50%; overflow: hidden;
    border: 3px solid #d4a853; margin: 0 auto 12px;
}

.profile-avatar-wrap img { width: 100%; height: 100%; object-fit: cover; }
.stat-divider { width: 1px; background: var(--border); align-self: stretch; }

.detail-label {
    font-size: 11.5px; color: var(--text-muted); margin-bottom: 4px;
    text-transform: uppercase; letter-spacing: .5px; font-weight: 500;
}

.detail-value {
    font-size: 14px; font-weight: 600; color: var(--text-dark);
}

.note-box {
    background: var(--primary-light);
    border-left: 3px solid var(--primary);
    border-radius: 10px;
    padding: 16px 18px;
}

.note-box p {
    font-size: 13px; color: #475569; line-height: 1.9; margin: 0;
}

/* Patient tabs pill style */
.patient-tabs .nav-link {
    border: 1px solid transparent; border-radius: 10px; color: var(--text-muted);
    font-size: 13px; font-weight: 500; padding: 10px 22px;
    transition: all .2s;
}

.patient-tabs .nav-link.active {
    color: var(--primary); border-color: var(--primary); background: #fff;
}

/* Timeline */
.timeline { position: relative; padding-left: 32px; }

.timeline::before {
    content:''; position:absolute; left:9px; top:14px; bottom:14px;
    width:2.5px; background: var(--primary); border-radius: 2px;
}

.tl-item {
    position:relative; margin-bottom:16px; padding:18px 20px;
    background: var(--bg-page); border-radius: 12px;
}

.tl-item:last-child { margin-bottom:0; }

.tl-item::before {
    content:''; position:absolute; left:-28px; top:24px;
    width:14px; height:14px; border-radius:50%;
    border:2.5px solid var(--primary); background:#fff;
}

.tl-item.tl-green::before { background:#dcfce7; border-color:#22c55e; }
.tl-date-main { font-size:18px; font-weight:700; color: var(--text-dark); }
.tl-date-time { font-size:11px; color: var(--primary); }

.tl-sep {
    width:1px; background: var(--border); align-self:stretch; margin:0 20px;
}

/* File list */
.file-row {
    display:flex; align-items:center; gap:14px;
    padding:12px 0; border-bottom:1px solid #f1f5f9;
}

.file-row:last-child { border-bottom:none; }

.file-icon-box {
    width:40px; height:40px; background: var(--bg-page); border-radius:10px;
    display:flex; align-items:center; justify-content:center;
    color:#64748b; font-size:17px;
}

/* Calendar grid */
.cal-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:3px; }

.cal-header-cell {
    text-align:center; font-weight:600; font-size:12px;
    color:var(--text-muted); padding:10px 0;
}

.cal-cell {
    aspect-ratio:1; display:flex; align-items:flex-start; justify-content:flex-start;
    padding:7px; font-size:12px; border-radius:8px; cursor:pointer; position:relative;
    font-weight: 500;
}

.cal-cell:hover { background:var(--primary-light); }

.cal-cell.today {
    background:var(--primary); color:#fff; font-weight:700; border-radius:8px;
}

.cal-cell.other-month { color:#d1d5db; }

.cal-cell .cal-dot {
    position:absolute; bottom:5px; left:50%; transform:translateX(-50%);
    width:5px; height:5px; background:var(--primary); border-radius:50%;
}

.cal-cell.today .cal-dot { background:#fff; }

/* Message contact */
.msg-contact { cursor:pointer; transition:.15s; }
.msg-contact:hover, .msg-contact.active { background: var(--primary-light); }
.msg-contact.active { border-left: 3px solid var(--primary); }

/* Settings form */
.settings-form .form-label {
    font-size:13px; font-weight:600; color:var(--text-dark);
}

.settings-form .form-control {
    font-size:14px; border-radius:10px; border:1px solid var(--border);
    padding: 10px 14px;
}

.settings-form .form-control:focus {
    border-color:var(--primary);
    box-shadow:0 0 0 3px rgba(66,133,244,.1);
}

/* === UTILITY === */
.text-primary { color: var(--primary) !important; }
.fs-11 { font-size: 11px; }
.fs-12 { font-size: 12px; }
.fs-13 { font-size: 13px; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

/* Better Bootstrap overrides */
.btn { border-radius: 10px; font-weight: 500; font-size: 16px; padding:10px; }
.btn-primary { background: linear-gradient(to right, #2B58C1, #1FBE5B) !important;  border-color: var(--primary); }
.btn-primary:hover { background: linear-gradient(to right, #2B58C1, #1FBE5B) !important;  border-color: #3b78e7; }
.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); border-color: var(--primary); }
.btn-outline-secondary { border-color: var(--border); color: var(--text-body); }
.btn-outline-secondary:hover { background: var(--bg-page); border-color: #cbd5e1; color: var(--text-dark); }
.badge { font-weight: 500; letter-spacing: .2px; border-radius: 8px; }
.form-control, .form-select { border-radius: 10px; border-color: var(--border); font-size: 13px; }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(66,133,244,.1); }
.table > :not(caption) > * > * { padding: 14px 12px; }
.pagination .page-link { border-radius: 8px; margin: 0 2px; border-color: var(--border); color: var(--text-body); font-size: 13px; }
.pagination .page-item.active .page-link { background: var(--primary); border-color: var(--primary); }

/* Common Profile Banner */
.profile-banner {
    background: linear-gradient(135deg, #fff 0%, #fff 100%);
    border-radius: 16px;
    padding: 20px 28px;
    color: #000;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 16px;
	border:1px solid #000;
    margin-bottom: 24px;
}
.profile-banner::after {
    content: '';
    position: absolute;
    right: 200px;
    top: -30px;
    width: 160px;
    height: 160px;
    background: rgba(0,0,0,.01);
    border-radius: 50%;
}
.profile-banner .pb-avatar {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: rgba(0,0,0,.1);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.profile-banner .pb-avatar i { font-size: 22px; color: rgba(0,0,0,.6); }
.profile-banner .pb-info { flex-grow: 1; }
.profile-banner .pb-name { font-size: 16px; font-weight: 700; }
.profile-banner .pb-meta { font-size: 12px; opacity: 1; margin-top: 2px; }
.profile-banner .pb-badges { display: flex; gap: 6px; margin-top: 6px; }
.profile-banner .pb-badge {
    padding: 3px 10px; border-radius: 12px; font-size: 13px; font-weight: 600;
    background: rgba(255,255,255,.1); color: rgba(0,0,0,1); border:1px solid #000;
}
.profile-banner .pb-points {
    display: flex; gap: 18px; flex-shrink: 0; margin-left: auto;
}
.profile-banner .pb-point { text-align: center; }
.profile-banner .pb-point-value { font-size: 16px; font-weight: 700; line-height: 1; }
.profile-banner .pb-point-label { font-size: 10px; opacity: .5; margin-top: 4px; text-transform: uppercase; letter-spacing: .5px; }

/* Mobile toggle button */
.mobile-toggle {
    background: none;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 8px;
    color: rgba(0,105,255,1);
    font-size: 22px;
    padding: 4px 8px;
    cursor: pointer;
    margin-right: 10px;
    transition: .2s;
}
.mobile-toggle:hover { color: #fff; border-color: rgba(255,255,255,.3); }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ===== RESPONSIVE ===== */

/* Mobile overlay for sidebar */
.sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 998;
}
.sidebar-overlay.show { display: block; }

/* Tablet: <= 992px — sidebar collapses to overlay */
@media (max-width: 991.98px) {
    body { padding: 0; }

    .app-shell {
        border-radius: 0;
        min-height: 100vh;
    }

    .sidebar {
        position: fixed;
        left: -260px;
        top: 0; bottom: 0;
        z-index: 9999;
        width: 260px;
        min-width: 260px;
        transition: left .3s ease;
        box-shadow: 4px 0 24px rgba(0,0,0,.15);
    }

    .sidebar.open { left: 0; }

    .sidebar-toggle { display: flex !important; }

    .main-area { margin-left: 0; }

    .top-bar { padding: 14px 20px; }
    .top-bar h1 { font-size: 18px; }

    .crumb-bar { padding: 10px 20px; }

    .page-area { padding: 20px; }

    /* Hide search on small top bar */
    .top-bar .search-input { width: 140px; }
}

/* Mobile: <= 768px */
@media (max-width: 767.98px) {
    .top-bar .search-input { display: none; }

    .top-bar h1 { font-size: 16px; }
    .top-bar { padding: 12px 16px; }

    /* Profile banner stacking */
    .profile-banner { flex-wrap: wrap; padding: 16px 20px; }
    .profile-banner .pb-points { width: 100%; justify-content: space-around; margin-left: 0; margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.1); }

    .crumb-bar { padding: 8px 16px; font-size: 12px; }
    .crumb-bar .crumbs { font-size: 12px; gap: 4px; }

    .page-area { padding: 16px; }

    /* Profile card stacking */
    .profile-avatar-wrap { width: 72px; height: 72px; }

    /* Timeline adjustments */
    .timeline { padding-left: 24px; }
    .tl-item::before { left: -20px; width: 11px; height: 11px; }
    .tl-date-main { font-size: 15px; }
    .tl-sep { margin: 0 10px; }

    /* Top bar actions */
    .header-actions { gap: 10px; }

    /* Patient list card grid */
    .plc-grid, .sc-grid, .inv-grid, .rc-grid, .hist-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 12px 16px !important;
    }

    .plc-header, .sc-header, .inv-header, .rc-header, .hist-header {
        padding: 16px 18px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .plc-body, .sc-body, .inv-body, .rc-body, .hist-body {
        padding: 0 18px 14px;
    }

    .plc-footer, .sc-footer, .inv-footer, .hist-footer {
        padding: 10px 18px;
        flex-wrap: wrap;
        gap: 12px;
    }

    .plc-contact { flex-wrap: wrap; gap: 8px; }

    .plc-actions { margin-left: 0; width: 100%; justify-content: flex-end; }
}

/* Small mobile: <= 576px */
@media (max-width: 575.98px) {
    .page-area { padding: 12px; }

    .card { border-radius: 10px; }

    .plc-grid, .sc-grid, .inv-grid, .rc-grid, .hist-grid {
        grid-template-columns: 1fr !important;
    }

    /* Stack summary strip */
    .summary-strip { flex-direction: column; }
    .summary-strip-item { border-right: none !important; border-bottom: 1px solid var(--border); padding: 14px 20px; }
    .summary-strip-item:last-child { border-bottom: none; }

    /* Messages full width */
    .chat-shell { min-height: auto; }

    /* Step bar compact */
    .step-bar { gap: 0; }
    .step-label { font-size: 10px; }
    .step-dot { width: 30px; height: 30px; font-size: 12px; }
}
