/* HMIS Pro Dashboard Theme */
:root {
    --hmis-navy: #0c1e3d;
    --hmis-navy-light: #152a52;
    --hmis-yellow: #f5c518;
    --hmis-yellow-text: #1a2744;
    --hmis-primary: #2563eb;
    --hmis-primary-dark: #1d4ed8;
    --hmis-bg: #eef2f7;
    --hmis-card: #ffffff;
    --hmis-border: #e2e8f0;
    --hmis-text: #1e293b;
    --hmis-muted: #64748b;
    --hmis-success: #16a34a;
    --hmis-danger: #dc2626;
    --hmis-sidebar-width: 260px;
    --hmis-radius: 12px;
    --hmis-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }

body.hmis-body {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    background: var(--hmis-bg);
    color: var(--hmis-text);
    font-size: 0.9rem;
}

.hmis-shell {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.hmis-sidebar {
    width: var(--hmis-sidebar-width);
    background: var(--hmis-navy);
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1040;
    transition: transform 0.25s ease, width 0.25s ease;
    overflow: hidden;
}

[dir="rtl"] .hmis-sidebar {
    left: auto;
    right: 0;
}

.hmis-sidebar-brand {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    padding: 1rem 0.85rem 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.hmis-sidebar-brand-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.55rem;
}

.hmis-sidebar-brand-text {
    min-width: 0;
    width: 100%;
}

.hmis-brand-icon {
    width: 42px;
    height: 42px;
    background: var(--hmis-yellow);
    color: var(--hmis-yellow-text);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    flex-shrink: 0;
}

.hmis-brand-logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
    border-radius: 10px;
    background: #fff;
    flex-shrink: 0;
}

.hmis-brand-logo--sidebar {
    width: 72px;
    height: 72px;
    border-radius: 14px;
    padding: 4px;
}

.hmis-brand-logo--login {
    width: 72px;
    height: 72px;
    margin: 0 auto 12px;
    display: block;
}

.hmis-brand-logo--topbar {
    width: 36px;
    height: 36px;
}

.hmis-topbar-logo {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.hmis-brand-title {
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.2;
}

.hmis-brand-role {
    font-size: 0.75rem;
    color: #94a3b8;
}

.hmis-sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.75rem 0.65rem;
    -webkit-overflow-scrolling: touch;
}

.hmis-nav-section {
    margin: 0.85rem 0.5rem 0.35rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
}

.hmis-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.65rem 0.85rem;
    margin-bottom: 4px;
    border-radius: 8px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.875rem;
    transition: background 0.15s, color 0.15s;
}

.hmis-nav-link:hover {
    background: var(--hmis-navy-light);
    color: #fff;
}

.hmis-nav-link.active {
    background: var(--hmis-yellow);
    color: var(--hmis-yellow-text);
    font-weight: 600;
}

.hmis-nav-badge {
    margin-left: auto;
    background: #ef4444;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 22px;
    text-align: center;
}

.hmis-nav-link.active .hmis-nav-badge {
    background: var(--hmis-navy);
    color: #fff;
}

.hmis-sidebar-footer {
    padding: 0.75rem 0.65rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.hmis-logout-btn { cursor: pointer; }

.hmis-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Main area */
.hmis-main {
    flex: 1;
    margin-left: var(--hmis-sidebar-width);
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.25s ease, margin-right 0.25s ease;
}

[dir="rtl"] .hmis-main {
    margin-left: 0;
    margin-right: var(--hmis-sidebar-width);
}

/* Topbar */
.hmis-topbar {
    background: var(--hmis-card);
    border-bottom: 1px solid var(--hmis-border);
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.hmis-topbar-left,
.hmis-topbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.hmis-search-form {
    position: relative;
    width: 320px;
}

.hmis-search-form .form-control {
    padding-left: 2.25rem;
    border-radius: 8px;
    border: 1px solid var(--hmis-border);
    background: #f8fafc;
    font-size: 0.85rem;
}

.hmis-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--hmis-muted);
    pointer-events: none;
}

[dir="rtl"] .hmis-search-form .form-control {
    padding-left: 0.75rem;
    padding-right: 2.25rem;
}

[dir="rtl"] .hmis-search-icon {
    left: auto;
    right: 10px;
}

.hmis-lang-btn {
    border: 1px solid var(--hmis-border);
    background: #fff;
    border-radius: 8px;
    font-size: 0.85rem;
    padding: 0.4rem 0.75rem;
}

.hmis-btn-new {
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.45rem 1rem;
    background: var(--hmis-primary);
    border-color: var(--hmis-primary);
}

.hmis-btn-new:hover {
    background: var(--hmis-primary-dark);
    border-color: var(--hmis-primary-dark);
}

.hmis-user-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 10px 4px 4px;
    border: 1px solid var(--hmis-border);
    border-radius: 999px;
    background: #f8fafc;
}

.hmis-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--hmis-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.hmis-user-name {
    font-weight: 600;
    font-size: 0.85rem;
    line-height: 1.2;
}

.hmis-user-role {
    font-size: 0.72rem;
    color: var(--hmis-muted);
}

.hmis-icon-btn {
    border: 1px solid var(--hmis-border);
    border-radius: 8px;
    padding: 0.35rem 0.5rem;
    background: #fff;
}

/* Content */
.hmis-content {
    padding: 1.25rem;
    flex: 1;
}

.hmis-guest {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: linear-gradient(135deg, var(--hmis-navy) 0%, #1e3a6e 100%);
}

/* Dashboard header */
.dash-header {
    margin-bottom: 1.25rem;
}

.dash-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 4px;
}

.dash-header p {
    color: var(--hmis-muted);
    margin: 0;
    font-size: 0.875rem;
}

.dash-period {
    background: var(--hmis-card);
    border: 1px solid var(--hmis-border);
    border-radius: var(--hmis-radius);
    padding: 0.65rem 1rem;
    font-size: 0.85rem;
    color: var(--hmis-muted);
}

/* KPI Cards */
.kpi-card {
    background: var(--hmis-card);
    border: 1px solid var(--hmis-border);
    border-radius: var(--hmis-radius);
    padding: 1rem 1.1rem;
    box-shadow: var(--hmis-shadow);
    height: 100%;
}

.kpi-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.kpi-icon.blue { background: #dbeafe; color: #2563eb; }
.kpi-icon.green { background: #dcfce7; color: #16a34a; }
.kpi-icon.orange { background: #ffedd5; color: #ea580c; }
.kpi-icon.purple { background: #ede9fe; color: #7c3aed; }
.kpi-icon.red { background: #fee2e2; color: #dc2626; }
.kpi-icon.teal { background: #ccfbf1; color: #0d9488; }
.kpi-icon.indigo { background: #e0e7ff; color: #4f46e5; }

.kpi-trend {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
}

.kpi-trend.up { background: #dcfce7; color: #16a34a; }
.kpi-trend.down { background: #fee2e2; color: #dc2626; }
.kpi-trend.neutral { background: #f1f5f9; color: var(--hmis-muted); }

.kpi-label {
    font-size: 0.8rem;
    color: var(--hmis-muted);
    margin-bottom: 4px;
}

.kpi-value {
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--hmis-text);
}

.kpi-footer {
    font-size: 0.72rem;
    color: #94a3b8;
    margin-top: 6px;
}

/* Chart cards */
.chart-card {
    background: var(--hmis-card);
    border: 1px solid var(--hmis-border);
    border-radius: var(--hmis-radius);
    box-shadow: var(--hmis-shadow);
    height: 100%;
}

.chart-card-header {
    padding: 1rem 1.15rem 0;
    font-weight: 600;
    font-size: 0.95rem;
}

.chart-card-body {
    padding: 0.75rem 1rem 1rem;
}

.chart-wrap {
    position: relative;
    height: 240px;
}

.chart-wrap-sm {
    height: 200px;
}

/* Panel cards */
.panel-card {
    background: var(--hmis-card);
    border: 1px solid var(--hmis-border);
    border-radius: var(--hmis-radius);
    box-shadow: var(--hmis-shadow);
    overflow: hidden;
}

.panel-card-header {
    padding: 1rem 1.15rem;
    border-bottom: 1px solid var(--hmis-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.panel-card-header a {
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
}

/* Quick actions */
.quick-panel {
    background: linear-gradient(180deg, #1d4ed8 0%, #1e40af 100%);
    border-radius: var(--hmis-radius);
    color: #fff;
    overflow: hidden;
    height: 100%;
}

.quick-panel-header {
    padding: 1rem 1.15rem;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.quick-action-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.15rem;
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.875rem;
    transition: background 0.15s;
}

.quick-action-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.quick-highlight {
    padding: 1rem 1.15rem;
    background: rgba(0, 0, 0, 0.15);
}

.quick-highlight-label {
    font-size: 0.75rem;
    opacity: 0.85;
}

.quick-highlight-value {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Global cards & tables */
.card {
    border-radius: var(--hmis-radius);
    border: 1px solid var(--hmis-border);
    box-shadow: var(--hmis-shadow);
}

.card-header {
    background: var(--hmis-card);
    border-bottom: 1px solid var(--hmis-border);
    font-weight: 600;
    padding: 0.85rem 1.15rem;
}

.table th {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--hmis-muted);
    background: #f8fafc;
    border-bottom: 1px solid var(--hmis-border);
    white-space: nowrap;
}

.table td {
    vertical-align: middle;
    font-size: 0.875rem;
    border-bottom: 1px solid #f1f5f9;
}

.table-hover tbody tr:hover {
    background: #f8fafc;
}

.btn {
    border-radius: 8px;
}

.form-control, .form-select {
    border-radius: 8px;
    border-color: var(--hmis-border);
}

.badge {
    border-radius: 6px;
    font-weight: 500;
    padding: 0.35em 0.65em;
}

.page-header {
    margin-bottom: 1.25rem;
}

.page-header h1 {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
}

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

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

/* Login */
.hmis-login-card {
    width: 100%;
    max-width: 420px;
    border-radius: var(--hmis-radius);
    border: none;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.hmis-login-brand {
    text-align: center;
    padding: 1.5rem 1.5rem 0;
}

.hmis-login-brand .hmis-brand-logo--login {
    margin-bottom: 12px;
}

/* Desktop sidebar hide (off) */
@media (min-width: 768px) {
    .hmis-shell.sidebar-hidden .hmis-sidebar {
        transform: translateX(-100%);
    }

    [dir="rtl"] .hmis-shell.sidebar-hidden .hmis-sidebar {
        transform: translateX(100%);
    }

    .hmis-shell.sidebar-hidden .hmis-main {
        margin-left: 0;
    }

    [dir="rtl"] .hmis-shell.sidebar-hidden .hmis-main {
        margin-right: 0;
    }
}

/* Mobile sidebar */
.hmis-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1035;
}

@media (max-width: 767.98px) {
    .hmis-sidebar {
        transform: translateX(-100%);
    }

    [dir="rtl"] .hmis-sidebar {
        transform: translateX(100%);
    }

    .hmis-sidebar.open {
        transform: translateX(0);
    }

    .hmis-sidebar-backdrop.show {
        display: block;
    }

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

    [dir="rtl"] .hmis-main {
        margin-right: 0;
    }

    .hmis-content {
        padding: 0.85rem;
    }

    .dash-header h1,
    .page-header h1 {
        font-size: 1.15rem;
    }

    .kpi-value {
        font-size: 1.35rem;
    }

    .hmis-search-form {
        width: 100%;
        max-width: 100%;
    }

    .hmis-topbar {
        padding: 0.65rem 0.85rem;
        flex-wrap: wrap;
    }

    .hmis-topbar-right {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .table-responsive {
        border-radius: var(--hmis-radius);
    }

    .table th,
    .table td {
        font-size: 0.8rem;
    }

    .hmis-status-select {
        min-width: 100px;
        max-width: 120px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start !important;
    }
}

@media (max-width: 575.98px) {
    .action-btns {
        gap: 6px;
    }

    .hmis-btn-icon {
        min-width: 36px;
        min-height: 36px;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .hmis-search-form {
        width: 220px;
    }
}

/* Legacy stat card fallback */
.stat-card {
    border-left: 3px solid var(--hmis-primary);
}

.stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-card .stat-label {
    color: var(--hmis-muted);
    font-size: 0.8rem;
}

[dir="rtl"] .stat-card {
    border-left: none;
    border-right: 3px solid var(--hmis-primary);
}

.hmis-btn-icon {
    padding: 0.25rem 0.45rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    min-height: 32px;
}

.hmis-btn-icon .hmis-icon {
    width: 16px;
    height: 16px;
}

.action-btns {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.hmis-status-select {
    width: auto;
    min-width: 110px;
    max-width: 140px;
    display: inline-block;
}

.patient-search-results .list-group-item {
    border-left: none;
    border-right: none;
}

.patient-search .input-group .patient-search-input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.patient-search .patient-quick-add-btn {
    white-space: nowrap;
}

.hmis-filter-bar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.5rem;
}

.hmis-filter-bar .hmis-filter-search {
    flex: 0 0 200px;
    width: 200px;
    max-width: 200px;
}

.hmis-filter-bar .hmis-filter-select {
    flex: 0 0 150px;
    width: 150px;
}

.hmis-filter-bar .hmis-filter-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

@media (max-width: 575.98px) {
    .hmis-filter-bar {
        overflow-x: auto;
    }
}

/* Doctors list panel */
.doctors-panel {
    border-radius: 12px;
    overflow: hidden;
}

.doctors-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.15rem 0.5rem;
}

.doctors-panel-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
    color: var(--hmis-text);
}

.doctors-panel-subtitle {
    font-size: 0.75rem;
    color: var(--hmis-muted);
    margin: 2px 0 0;
}

.doctors-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    font-weight: 600;
}

.doctors-filters {
    padding: 0 1.15rem 0.75rem;
}

.doctors-search-wrap {
    position: relative;
    margin-bottom: 0.65rem;
}

.doctors-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--hmis-muted);
    pointer-events: none;
}

[dir="rtl"] .doctors-search-icon {
    left: auto;
    right: 10px;
}

.doctors-search-input {
    padding-left: 2rem;
    font-size: 0.875rem;
    border-radius: 8px;
    background: #f8fafc;
}

[dir="rtl"] .doctors-search-input {
    padding-left: 0.75rem;
    padding-right: 2rem;
}

.doctors-filter-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.doctors-filter-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 767.98px) {
    .doctors-filter-grid,
    .doctors-filter-grid-3 {
        grid-template-columns: 1fr;
    }
}

.doctors-filter-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0.35rem 0 0.65rem;
}

.doctors-count {
    font-size: 0.75rem;
    color: var(--hmis-muted);
}

.doctors-clear-btn {
    font-size: 0.75rem;
    color: var(--hmis-primary);
    text-decoration: none;
    font-weight: 500;
}

.doctors-clear-btn:hover {
    text-decoration: underline;
}

.doctors-list {
    margin: 0 1.15rem;
    background: #f8fafc;
    border: 1px solid var(--hmis-border);
    border-radius: 12px;
    overflow: hidden;
}

.doctors-list-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 0.9rem;
    background: #fff;
}

.doctors-list-item + .doctors-list-item {
    border-top: 1px solid #eef2f7;
}

.doctor-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
}

.doctors-list-body {
    flex: 1;
    min-width: 0;
}

.doctors-list-top {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.doctors-list-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--hmis-text);
}

.doctors-status-pill {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    line-height: 1.4;
}

.doctors-status-active {
    background: #dcfce7;
    color: #16a34a;
}

.doctors-status-inactive {
    background: #fee2e2;
    color: #dc2626;
}

.doctors-list-meta,
.doctors-list-sub {
    font-size: 0.75rem;
    color: var(--hmis-muted);
    margin: 2px 0 0;
    line-height: 1.45;
}

.doctors-list-sub {
    font-size: 0.7rem;
}

.doctors-list-actions {
    flex-shrink: 0;
}

.doctors-empty {
    text-align: center;
    padding: 1.75rem 1rem;
    font-size: 0.85rem;
    color: var(--hmis-muted);
}

.doctors-panel-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.85rem 1.15rem 1rem;
}

.doctors-page-info {
    font-size: 0.75rem;
    color: var(--hmis-muted);
}

.doctors-pagination .pagination {
    margin: 0;
    gap: 4px;
}

.doctors-pagination .page-link {
    font-size: 0.75rem;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
}

/* Doctor profile (show) */
.doctor-profile {
    border-radius: 12px;
    overflow: hidden;
}

.doctor-profile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1.15rem;
    border-bottom: 1px solid var(--hmis-border);
}

.doctor-profile-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--hmis-muted);
    text-decoration: none;
}

.doctor-profile-back:hover {
    color: var(--hmis-primary);
}

[dir="rtl"] .doctor-profile-back .hmis-icon {
    transform: scaleX(-1);
}

.doctor-profile-hero {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.15rem;
    border-bottom: 1px solid var(--hmis-border);
}

.doctor-profile-hero .doctor-avatar {
    width: 56px;
    height: 56px;
    font-size: 1rem;
}

.doctor-profile-name {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0;
    color: var(--hmis-text);
}

.doctor-profile-spec {
    font-size: 0.85rem;
    color: var(--hmis-muted);
    margin: 4px 0 8px;
}

.doctor-profile-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    padding: 0.5rem 0;
}

@media (max-width: 575.98px) {
    .doctor-profile-details {
        grid-template-columns: 1fr;
    }
}

.doctor-detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0.85rem 1.15rem;
    border-bottom: 1px solid #f1f5f9;
}

.doctor-detail-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--hmis-muted);
}

.doctor-detail-value {
    font-size: 0.9rem;
    color: var(--hmis-text);
}

/* Professional index pages */
.hmis-index-page {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.hmis-index-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.hmis-index-header-main {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.hmis-index-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #eef2ff;
    color: var(--hmis-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hmis-index-icon svg {
    width: 22px;
    height: 22px;
}

.hmis-index-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
    color: var(--hmis-text);
    line-height: 1.2;
}

.hmis-index-subtitle {
    font-size: 0.8rem;
    color: var(--hmis-muted);
    margin: 4px 0 0;
}

.hmis-index-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.hmis-index-create-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    white-space: nowrap;
}

.hmis-index-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.hmis-index-stat {
    background: #fff;
    border: 1px solid var(--hmis-border);
    border-radius: 12px;
    padding: 0.9rem 1rem;
    box-shadow: var(--hmis-shadow);
}

.hmis-index-stat-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--hmis-muted);
    margin-bottom: 4px;
}

.hmis-index-stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--hmis-text);
    line-height: 1.1;
}

.hmis-index-panel {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 0;
}

.hmis-index-toolbar {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--hmis-border);
    background: #fff;
}

.hmis-index-filter-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.hmis-index-search {
    position: relative;
    flex: 1 1 220px;
    min-width: 180px;
    max-width: 320px;
}

.hmis-index-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--hmis-muted);
    pointer-events: none;
}

[dir="rtl"] .hmis-index-search-icon {
    left: auto;
    right: 10px;
}

.hmis-index-search-input {
    padding-left: 2rem;
    font-size: 0.875rem;
    border-radius: 8px;
    background: #f8fafc;
    border-color: var(--hmis-border);
}

[dir="rtl"] .hmis-index-search-input {
    padding-left: 0.75rem;
    padding-right: 2rem;
}

.hmis-index-filter-form .form-select,
.hmis-index-filter-form .form-control:not(.hmis-index-search-input) {
    flex: 0 1 150px;
    min-width: 130px;
    font-size: 0.875rem;
    border-radius: 8px;
    background: #f8fafc;
}

.hmis-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
    white-space: nowrap;
}

.hmis-filter-btn .hmis-icon {
    width: 14px;
    height: 14px;
}

.hmis-index-table-wrap {
    background: #fff;
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
    max-width: 100%;
}

.hmis-index-table-wrap.is-scrollable {

.hmis-index-table {
    margin-bottom: 0;
}

.hmis-index-table th {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
    background: #fff;
    border-bottom: 1px solid var(--hmis-border);
    padding: 0.75rem 1rem;
    white-space: nowrap;
}

.hmis-index-table td {
    padding: 0.85rem 1rem;
    font-size: 0.875rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.hmis-index-table tbody tr:last-child td {
    border-bottom: none;
}

.hmis-index-table tbody tr:hover {
    background: #f8fafc;
}

.hmis-cell-name {
    font-weight: 600;
    color: var(--hmis-text);
}

.hmis-index-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--hmis-border);
    background: #fff;
}

.hmis-index-showing {
    font-size: 0.78rem;
    color: var(--hmis-muted);
}

.hmis-index-pagination .pagination {
    margin: 0;
    gap: 4px;
}

.hmis-index-pagination .page-link {
    font-size: 0.78rem;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    color: var(--hmis-text);
}

.hmis-index-pagination .page-item.active .page-link {
    background: var(--hmis-primary);
    border-color: var(--hmis-primary);
}

.hmis-status-pill {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    line-height: 1.4;
    white-space: nowrap;
}

.hmis-status-success {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #86efac;
}

.hmis-status-danger {
    background: #fee2e2;
    color: #dc2626;
}

.hmis-status-warning {
    background: #fef3c7;
    color: #d97706;
}

.hmis-status-info {
    background: #dbeafe;
    color: #2563eb;
}

.hmis-status-muted {
    background: #f1f5f9;
    color: #64748b;
}

.hmis-index-table .doctor-avatar {
    width: 32px;
    height: 32px;
    font-size: 0.68rem;
}

.hmis-index-stats:has(> :nth-child(3):last-child) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hmis-index-stats:has(> :nth-child(2):last-child) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hmis-index-table-wrap.is-scrollable {
    background:
        linear-gradient(90deg, #fff 30%, rgba(255, 255, 255, 0)),
        linear-gradient(90deg, rgba(255, 255, 255, 0), #fff 70%) 100% 0,
        radial-gradient(farthest-side at 0 50%, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0)),
        radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0)) 100% 0;
    background-repeat: no-repeat;
    background-size: 40px 100%, 40px 100%, 14px 100%, 14px 100%;
    background-attachment: local, local, scroll, scroll;
}

.hmis-view-link {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--hmis-primary);
    text-decoration: none;
    white-space: nowrap;
}

.hmis-view-link:hover {
    text-decoration: underline;
    color: var(--hmis-primary-dark);
}

.hmis-index-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.hmis-index-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    font-size: 0.875rem;
    color: var(--hmis-muted);
}

.hmis-index-group-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--hmis-muted);
    padding: 0.65rem 1rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--hmis-border);
}

/* ── Responsive: Tablet (768px – 991px) ── */
@media (max-width: 991.98px) {
    .hmis-index-stats,
    .hmis-index-stats:has(> :nth-child(3):last-child),
    .hmis-index-stats:has(> :nth-child(2):last-child) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hmis-search-form {
        width: 220px;
    }

    .chart-wrap {
        height: 220px;
    }
}

/* ── Responsive: Mobile (≤767px) ── */
@media (max-width: 767.98px) {
    .hmis-index-title {
        font-size: 1.15rem;
    }

    .hmis-index-subtitle {
        font-size: 0.75rem;
    }

    .hmis-index-header {
        flex-direction: column;
        align-items: stretch;
    }

    .hmis-index-header-actions {
        width: 100%;
    }

    .hmis-index-create-btn {
        width: 100%;
        justify-content: center;
        min-height: 40px;
    }

    .hmis-index-filter-form {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .hmis-index-search {
        max-width: none;
        min-width: 0;
    }

    .hmis-index-filter-form .form-select,
    .hmis-index-filter-form .form-control:not(.hmis-index-search-input) {
        width: 100%;
        min-width: 0;
    }

    .hmis-filter-btn {
        width: 100%;
        justify-content: center;
        min-height: 38px;
    }

    .hmis-index-filter-form .btn-link {
        width: 100%;
        text-align: center;
        padding: 0.25rem;
    }

    .hmis-index-table {
        min-width: 580px;
    }

    .hmis-index-table th,
    .hmis-index-table td {
        padding: 0.65rem 0.75rem;
        font-size: 0.8rem;
    }

    .hmis-index-footer {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 0.5rem;
    }

    .hmis-index-pagination {
        display: flex;
        justify-content: center;
    }

    .hmis-index-pagination .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }

    .hmis-index-toolbar {
        padding: 0.75rem;
    }

    .hmis-index-actions {
        gap: 0.35rem;
    }

    .hmis-btn-icon {
        min-width: 36px;
        min-height: 36px;
    }

    .hmis-status-select {
        min-width: 100%;
        max-width: 100%;
    }

    .hmis-topbar {
        padding: 0.5rem 0.75rem;
        gap: 0.5rem;
    }

    .hmis-topbar-right {
        gap: 0.35rem;
    }

    .hmis-lang-btn {
        padding: 0.35rem 0.5rem;
        font-size: 0.78rem;
    }

    .hmis-user-pill {
        padding: 2px 6px 2px 2px;
    }

    .hmis-user-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .dash-header {
        flex-direction: column;
        align-items: stretch !important;
    }

    .dash-period {
        width: 100%;
        text-align: left;
    }

    .chart-wrap {
        height: 200px;
    }

    .chart-wrap-sm {
        height: 180px;
    }

    .doctor-profile-hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .doctor-profile-header {
        flex-wrap: wrap;
    }

    .card-body .btn {
        min-height: 40px;
    }

    .card-body .d-flex.gap-2,
    .card-body .mt-3 {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .patient-search .input-group {
        flex-wrap: wrap;
    }

    .patient-search .patient-quick-add-btn {
        width: 100%;
        border-radius: 8px !important;
        margin-top: 0.25rem;
    }

    .patient-search .patient-search-input {
        border-radius: 8px !important;
        min-height: 40px;
    }
}

/* ── Responsive: Small mobile (≤575px) ── */
@media (max-width: 575.98px) {
    .hmis-index-stats,
    .hmis-index-stats:has(> :nth-child(3):last-child),
    .hmis-index-stats:has(> :nth-child(2):last-child) {
        grid-template-columns: 1fr;
    }

    .hmis-index-stat-value {
        font-size: 1.25rem;
    }

    .hmis-index-icon {
        width: 38px;
        height: 38px;
    }

    .hmis-index-icon svg {
        width: 18px;
        height: 18px;
    }

    .hmis-content {
        padding: 0.75rem;
    }

    .kpi-value {
        font-size: 1.2rem;
    }

    .kpi-card {
        padding: 0.85rem;
    }

    .hmis-index-table {
        min-width: 520px;
    }

    .hmis-login-card {
        margin: 0 0.25rem;
    }

    .card-body {
        padding: 1rem !important;
    }

    .card-body form .btn-primary,
    .card-body form .btn-outline-secondary {
        width: 100%;
    }

    .card-body form .mt-3 .btn + .btn {
        margin-top: 0.35rem;
    }
}

/* ── Responsive: Large desktop (≥1200px) ── */
@media (min-width: 1200px) {
    .hmis-content {
        padding: 1.5rem;
    }

    .hmis-index-page {
        gap: 1.15rem;
    }
}

[dir="rtl"] .hmis-nav-badge {
    margin-left: 0;
    margin-right: auto;
}

/* Segmented pill tabs (Settings, Staff, etc.) */
.hmis-segmented-tabs,
.hmis-settings-tabs {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.25rem;
    width: 100%;
    max-width: 28rem;
    margin-bottom: 1.25rem;
    padding: 0.25rem;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 9999px;
    overflow-x: auto;
    scrollbar-width: none;
}

.hmis-segmented-tabs::-webkit-scrollbar,
.hmis-settings-tabs::-webkit-scrollbar {
    display: none;
}

.hmis-segmented-tab,
.hmis-settings-tab,
.hmis-segmented-tabs a,
.hmis-settings-tabs a {
    flex: 1 0 auto;
    min-width: 5.5rem;
    color: #6b7280 !important;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25;
    text-align: center;
    text-decoration: none !important;
    white-space: nowrap;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    background: transparent;
    border: none;
    box-shadow: none;
    transition: all 0.2s ease;
}

.hmis-segmented-tab:hover,
.hmis-settings-tab:hover,
.hmis-segmented-tabs a:hover,
.hmis-settings-tabs a:hover {
    color: #4b5563 !important;
    background: rgba(255, 255, 255, 0.45);
}

.hmis-segmented-tab.is-active,
.hmis-settings-tab.active,
.hmis-segmented-tabs a.is-active,
.hmis-settings-tabs a.active {
    color: #7e22ce !important;
    font-weight: 600;
    background: #ffffff !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.hmis-segmented-tab:focus-visible,
.hmis-settings-tab:focus-visible {
    outline: 2px solid rgba(126, 34, 206, 0.35);
    outline-offset: 1px;
}

.hmis-print-settings .hmis-segmented-tabs {
    max-width: 24rem;
}

/* Staff view (professional profile) */
.staff-view {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.staff-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: var(--hmis-muted);
}

.staff-breadcrumb a {
    color: var(--hmis-muted);
    text-decoration: none;
}

.staff-breadcrumb a:hover {
    color: var(--hmis-primary);
}

.staff-breadcrumb-sep {
    color: #cbd5e1;
}

.staff-breadcrumb-current {
    color: #475569;
    font-weight: 600;
}

.staff-view-page-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.staff-view-hero-card {
    border: none;
    border-radius: 14px;
    box-shadow: var(--hmis-shadow);
}

.staff-view-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1.25rem;
    align-items: start;
}

.staff-view-hero-main {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    min-width: 0;
}

.staff-view-hero {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.staff-view-hero-body {
    min-width: 0;
}

.staff-view-name-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.35rem;
}

.staff-view-name {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
}

.staff-view-designation {
    margin: 0 0 0.5rem;
    color: var(--hmis-muted);
    font-size: 0.92rem;
    text-transform: capitalize;
}

.staff-view-id-badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    background: rgba(77, 56, 151, 0.1);
    color: #4d3897;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.staff-view-contacts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 0.85rem;
}

.staff-view-contact-chip {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.45rem 0.7rem;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid var(--hmis-border);
    min-width: 140px;
}

.staff-view-contact-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
}

.staff-view-contact-value {
    font-size: 0.88rem;
    color: #0f172a;
    word-break: break-word;
}

.staff-view-contact {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: #475569;
}

.staff-view-contact svg {
    width: 15px !important;
    height: 15px !important;
    max-width: 15px !important;
    max-height: 15px !important;
    flex-shrink: 0;
}

.staff-view-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 0.5rem;
    min-width: 260px;
}

.staff-view-actions .btn {
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    white-space: nowrap;
}

.staff-view-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    width: 100%;
    font-weight: 600;
}

.staff-view-action-btn svg {
    width: 16px !important;
    height: 16px !important;
    max-width: 16px !important;
    max-height: 16px !important;
    flex-shrink: 0;
}

.staff-view-stats {
    margin-top: 0.15rem;
}

.staff-stat-tile {
    border: none;
    border-radius: 12px;
    box-shadow: var(--hmis-shadow);
    height: 100%;
}

.staff-stat-tile .card-body {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem 1.1rem;
}

.staff-stat-tile-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1;
}

.staff-stat-tile-icon svg {
    width: 20px !important;
    height: 20px !important;
    max-width: 20px !important;
    max-height: 20px !important;
}

.staff-stat-tile-icon-purple { background: #ede9fe; color: #6d28d9; }
.staff-stat-tile-icon-green { background: #dcfce7; color: #15803d; }
.staff-stat-tile-icon-blue { background: #dbeafe; color: #1d4ed8; }

.staff-stat-tile-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
    margin-bottom: 0.15rem;
}

.staff-stat-tile-value {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.staff-stat-tile-value-sm {
    font-size: 1rem;
}

.staff-info-card {
    border: none;
    border-radius: 12px;
    box-shadow: var(--hmis-shadow);
    overflow: hidden;
}

.staff-info-card-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.9rem 1.15rem;
    border-bottom: 1px solid var(--hmis-border);
    background: #fafbfc;
}

.staff-info-card-header-split {
    justify-content: space-between;
}

.staff-info-card-header h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
}

.staff-info-card-icon svg {
    width: 16px !important;
    height: 16px !important;
    max-width: 16px !important;
    max-height: 16px !important;
}

.staff-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.25rem;
}

.staff-info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.staff-info-full {
    grid-column: 1 / -1;
}

.staff-info-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #94a3b8;
}

.staff-info-value {
    font-size: 0.92rem;
    color: #0f172a;
    word-break: break-word;
}

.staff-notes-text {
    color: #334155;
    line-height: 1.55;
}

.staff-avatar {
    border-radius: 14px;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.staff-avatar-lg { width: 96px; height: 96px; }
.staff-avatar-md { width: 56px; height: 56px; }
.staff-avatar-sm { width: 40px; height: 40px; }

.staff-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.staff-avatar-initials {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.staff-avatar-lg .staff-avatar-initials { font-size: 2rem; }
.staff-avatar-md .staff-avatar-initials { font-size: 1.1rem; }
.staff-avatar-sm .staff-avatar-initials { font-size: 0.85rem; }

.staff-photo-upload {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-start;
    padding: 1rem;
    border: 1px dashed var(--hmis-border);
    border-radius: 12px;
    background: #f8fafc;
}

.staff-photo-preview-wrap {
    flex-shrink: 0;
}

.staff-photo-preview {
    width: 96px;
    height: 96px;
    border-radius: 12px;
    object-fit: cover;
    display: block;
}

.staff-photo-preview-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    background: #fff;
    border: 1px solid var(--hmis-border);
    color: #94a3b8;
    font-size: 0.72rem;
}

.staff-photo-preview-empty svg {
    width: 28px;
    height: 28px;
}

.staff-photo-upload-body {
    flex: 1;
    min-width: 220px;
}

.staff-photo-remove {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: #64748b;
}

.staff-view .staff-module-tabs {
    padding: 0;
    margin: 0.15rem 0 0;
}

/* Staff profile v2 (mockup layout) */
.staff-view-v2 {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.staff-crumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--hmis-muted);
    margin: 0 0 2px;
}

.staff-crumb a {
    color: var(--hmis-muted);
    text-decoration: none;
}

.staff-crumb a:hover {
    color: #534AB7;
}

.staff-crumb-current {
    color: var(--hmis-text);
}

.staff-hero-card {
    background: var(--hmis-card);
    border: 0.5px solid var(--hmis-border);
    border-radius: 12px;
    padding: 1.25rem;
}

.staff-hero-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.staff-hero-info {
    flex: 1;
    min-width: 200px;
}

.staff-hero-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.staff-hero-name {
    margin: 0;
    font-size: 20px;
    font-weight: 500;
    color: var(--hmis-text);
}

.staff-hero-meta {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--hmis-muted);
}

.staff-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
}

.staff-hero-contacts {
    display: flex;
    gap: 16px;
    margin-top: 8px;
    font-size: 13px;
    color: var(--hmis-muted);
    flex-wrap: wrap;
}

.staff-hero-contact {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.staff-hero-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.staff-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #534AB7 !important;
    border-color: #534AB7 !important;
    color: #fff !important;
    padding: 8px 16px;
    border-radius: var(--hmis-radius);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
}

.staff-btn-primary:hover {
    background: #453d9a !important;
    border-color: #453d9a !important;
    color: #fff !important;
}

.staff-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    background: var(--hmis-card);
    border: 1px solid var(--hmis-border);
    color: var(--hmis-text);
    border-radius: var(--hmis-radius);
    text-decoration: none;
}

.staff-btn-secondary:hover {
    background: #f8fafc;
    color: var(--hmis-text);
}

.staff-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    font-size: 13px;
    background: var(--hmis-card);
    border: 1px solid var(--hmis-border);
    color: var(--hmis-text);
    border-radius: var(--hmis-radius);
    text-decoration: none;
}

.staff-btn-icon:hover {
    background: #f8fafc;
}

.staff-ui-icon {
    width: 15px !important;
    height: 15px !important;
    max-width: 15px !important;
    max-height: 15px !important;
    flex-shrink: 0;
    vertical-align: -2px;
    object-fit: contain;
    display: inline-block;
}

.staff-ui-icon-lg,
.staff-panel-title .staff-ui-icon {
    width: 16px !important;
    height: 16px !important;
    max-width: 16px !important;
    max-height: 16px !important;
    color: #534AB7;
    vertical-align: -2px;
    margin-right: 4px;
}

.staff-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.staff-stat-box {
    background: #f8fafc;
    border-radius: var(--hmis-radius);
    padding: 1rem;
}

.staff-stat-box-label {
    font-size: 13px;
    color: var(--hmis-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.staff-stat-box-value {
    font-size: 22px;
    font-weight: 500;
    margin-top: 4px;
    color: var(--hmis-text);
}

.staff-panels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.staff-panel-card {
    background: var(--hmis-card);
    border: 0.5px solid var(--hmis-border);
    border-radius: 12px;
    padding: 1.25rem;
}

.staff-panel-title {
    font-size: 15px;
    font-weight: 500;
    margin: 0 0 12px;
    color: var(--hmis-text);
}

.staff-panel-table {
    width: 100%;
    font-size: 13px;
    border-collapse: collapse;
}

.staff-panel-table td {
    padding: 6px 0;
    vertical-align: top;
}

.staff-panel-table td:first-child {
    color: var(--hmis-muted);
    width: 42%;
}

.staff-panel-table tr + tr td {
    border-top: 0.5px solid var(--hmis-border);
}

.staff-salary-panel {
    margin-top: 0;
}

.staff-salary-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    gap: 12px;
    flex-wrap: wrap;
}

.staff-link {
    font-size: 13px;
    color: #534AB7;
    text-decoration: none;
    font-weight: 500;
}

.staff-link:hover {
    text-decoration: underline;
    color: #453d9a;
}

.staff-salary-table {
    width: 100%;
    font-size: 13px;
    border-collapse: collapse;
}

.staff-salary-table th {
    font-weight: 500;
    padding: 6px 0;
    color: var(--hmis-muted);
    text-align: left;
}

.staff-salary-table td {
    padding: 8px 0;
    vertical-align: middle;
}

.staff-salary-table tbody tr {
    border-top: 0.5px solid var(--hmis-border);
}

.staff-salary-empty {
    text-align: center;
    padding: 1.5rem 1rem;
}

.staff-avatar-profile {
    width: 64px;
    height: 64px;
    border-radius: 50%;
}

.staff-avatar-profile .staff-avatar-initials {
    font-size: 20px;
    font-weight: 500;
    border-radius: 50%;
}

.staff-avatar-profile .staff-avatar-img {
    border-radius: 50%;
}

.staff-view-v2 .hmis-status-pill {
    font-size: 12px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 999px;
}

/* Staff profile (legacy salary pages) */
.staff-profile {
    border: none;
    box-shadow: 0 1px 4px rgba(67, 123, 239, 0.08);
}

.staff-profile-header,
.staff-profile-hero,
.staff-profile-stats,
.staff-profile-details,
.staff-recent-salary {
    padding: 1.25rem 1.5rem;
}

.staff-profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--hmis-border);
}

.staff-profile-back {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--hmis-muted);
    text-decoration: none;
    font-size: 0.875rem;
}

.staff-profile-hero {
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--hmis-border);
}

.staff-profile-hero-compact {
    padding-top: 1rem;
    padding-bottom: 0.5rem;
}

.staff-profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: rgba(77, 56, 151, 0.12);
    color: var(--hmis-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
}

.staff-profile-name {
    margin: 0 0 0.25rem;
    font-size: 1.35rem;
    font-weight: 700;
}

.staff-profile-meta {
    margin: 0 0 0.5rem;
    color: var(--hmis-muted);
    font-size: 0.875rem;
}

.staff-profile-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    border-bottom: 1px solid var(--hmis-border);
}

.staff-stat-card {
    background: #f8fafc;
    border: 1px solid var(--hmis-border);
    border-radius: 12px;
    padding: 0.9rem 1rem;
}

.staff-stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--hmis-muted);
    margin-bottom: 0.25rem;
}

.staff-stat-value {
    font-size: 1.1rem;
    color: #0f172a;
}

.staff-module-tabs {
    padding: 1rem 1.5rem 0;
    margin-bottom: 0;
}

.staff-salary-page-body {
    padding: 1.25rem 1.5rem 1.5rem;
}

.staff-salary-intro {
    margin-bottom: 1.25rem;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid var(--hmis-border);
    color: #475569;
    font-size: 0.9rem;
}

.staff-salary-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--hmis-border);
}

.staff-salary-section-last {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 1rem;
}

.staff-salary-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.35rem;
}

.staff-salary-section-hint {
    color: var(--hmis-muted);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.staff-salary-net-box {
    margin-top: 1rem;
    padding: 1rem 1.15rem;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(77, 56, 151, 0.08), rgba(37, 99, 235, 0.08));
    border: 1px solid rgba(77, 56, 151, 0.15);
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.staff-salary-net-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}

.staff-salary-net-value {
    font-size: 1.75rem;
    line-height: 1.1;
    color: #4d3897;
}

.staff-salary-net-note {
    font-size: 0.8rem;
    color: #64748b;
}

.staff-payment-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.staff-payment-options-compact {
    max-width: 36rem;
}

.staff-payment-option {
    display: block;
    margin: 0;
    cursor: pointer;
}

.staff-payment-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.staff-payment-option-body {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    height: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid var(--hmis-border);
    border-radius: 10px;
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.staff-payment-option-body strong {
    color: #0f172a;
    font-size: 0.92rem;
}

.staff-payment-option-body small {
    color: #64748b;
    font-size: 0.8rem;
    line-height: 1.35;
}

.staff-payment-option input:checked + .staff-payment-option-body {
    border-color: #4d3897;
    background: rgba(77, 56, 151, 0.05);
    box-shadow: 0 0 0 1px rgba(77, 56, 151, 0.12);
}

.staff-payment-option:hover .staff-payment-option-body {
    border-color: #cbd5e1;
}

.staff-salary-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    padding-top: 0.25rem;
}

.staff-salary-empty {
    text-align: center;
    padding: 2rem 1rem;
    border: 1px dashed var(--hmis-border);
    border-radius: 12px;
    background: #f8fafc;
}

.staff-salary-empty-inline {
    text-align: left;
    padding: 1.25rem;
}

.staff-salary-pagination {
    padding-top: 1rem;
    border-top: 1px solid var(--hmis-border);
    margin-top: 0.5rem;
}

.staff-profile-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.5rem;
}

.staff-detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.staff-detail-full {
    grid-column: 1 / -1;
}

.staff-detail-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--hmis-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.staff-detail-value {
    font-size: 0.95rem;
    color: #0f172a;
}

@media (max-width: 767.98px) {
    .staff-hero-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .staff-hero-actions {
        width: 100%;
    }

    .staff-profile-stats,
    .staff-profile-details {
        grid-template-columns: 1fr;
    }

    .staff-payment-options {
        grid-template-columns: 1fr;
    }

    .staff-view-hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .staff-view-hero-grid {
        grid-template-columns: 1fr;
    }

    .staff-view-actions {
        grid-template-columns: 1fr 1fr;
        min-width: 0;
        width: 100%;
    }

    .staff-info-grid {
        grid-template-columns: 1fr;
    }
}

/* OPD clinical form sections */
.opd-form-section {
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--hmis-border);
}

.opd-form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.opd-form-section-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--hmis-primary);
    margin-bottom: 0.75rem;
}
