/* ============================================
   Dr Farid Medical Clinic - Staff Portal CSS
   Monjaro Tracking System
   ============================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700;900&family=Montserrat:wght@400;500;600;700;800&display=swap');

/* ── CSS Variables ── */
:root {
    --farid-primary: #0085c8;
    --farid-primary-dark: #006da3;
    --farid-primary-light: #33a0d8;
    --farid-secondary: #5fdbe1;
    --farid-secondary-dark: #3dc5cc;
    --farid-secondary-light: #8ae8ec;
    --farid-accent: #f6ac1b;
    --farid-accent-dark: #d99410;
    --farid-accent-light: #f9c45a;
    --farid-sidebar-bg: #002d47;
    --farid-sidebar-hover: #003d5e;
    --farid-sidebar-text: #a0a4c1;
    --farid-sidebar-active: #5fdbe1;
    --farid-header-bg: #ffffff;
    --farid-body-bg: #f0f2f8;
    --farid-card-bg: #ffffff;
    --farid-text-dark: #1a1d3b;
    --farid-text-muted: #6c7293;
    --farid-border: #e3e6f0;
    --farid-success: #28a745;
    --farid-danger: #dc3545;
    --farid-warning: #f6ac1b;
    --farid-info: #5fdbe1;
    --sidebar-width: 260px;
    --header-height: 64px;
    --font-body: 'Lato', sans-serif;
    --font-heading: 'Montserrat', sans-serif;
    --shadow-sm: 0 1px 3px rgba(0, 45, 71, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 45, 71, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 45, 71, 0.12);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
}

/* ── Base Reset ── */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--farid-text-dark);
    background-color: var(--farid-body-bg);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--farid-text-dark);
    margin-bottom: 0.5rem;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

a {
    color: var(--farid-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--farid-primary-dark);
}

/* ── Layout ── */
.staff-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ── */
.staff-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--farid-sidebar-bg);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    height: var(--header-height);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-brand .brand-icon {
    width: 36px;
    height: 36px;
    background: var(--farid-secondary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    color: var(--farid-sidebar-bg);
    flex-shrink: 0;
    font-family: var(--font-heading);
}

.sidebar-brand .brand-text {
    margin-left: 12px;
    display: flex;
    flex-direction: column;
}

.sidebar-brand .brand-text .brand-name {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
}

.sidebar-brand .brand-text .brand-sub {
    font-size: 10px;
    color: var(--farid-sidebar-text);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.sidebar-brand .sidebar-logo {
    max-height: 40px;
    width: auto;
}

.sidebar-menu {
    flex: 1;
    padding: 16px 0;
}

.sidebar-menu .menu-label {
    padding: 8px 24px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(160, 164, 193, 0.5);
    margin-top: 8px;
}

.sidebar-menu .menu-item {
    list-style: none;
}

.sidebar-menu .menu-link {
    display: flex;
    align-items: center;
    padding: 10px 24px;
    color: var(--farid-sidebar-text);
    font-size: 13.5px;
    font-weight: 400;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    gap: 12px;
}

.sidebar-menu .menu-link i {
    font-size: 18px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-menu .menu-link:hover {
    color: #ffffff;
    background: var(--farid-sidebar-hover);
}

.sidebar-menu .menu-item.active .menu-link {
    color: var(--farid-sidebar-active);
    background: var(--farid-sidebar-hover);
    border-left-color: var(--farid-sidebar-active);
    font-weight: 600;
}

.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-footer .menu-link {
    display: flex;
    align-items: center;
    padding: 10px 0;
    color: var(--farid-sidebar-text);
    font-size: 13.5px;
    gap: 12px;
    transition: color 0.2s ease;
}

.sidebar-footer .menu-link:hover {
    color: #ff6b6b;
}

.sidebar-footer .menu-link i {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

/* ── Main Content Area ── */
.staff-main {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── Header ── */
.staff-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    height: var(--header-height);
    background: var(--farid-header-bg);
    border-bottom: 1px solid var(--farid-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    box-shadow: var(--shadow-sm);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-left .sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    color: var(--farid-text-dark);
    cursor: pointer;
    padding: 4px;
}

.header-left .page-title-header {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    color: var(--farid-text-dark);
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-right .staff-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-right .staff-info .staff-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--farid-primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    font-family: var(--font-heading);
}

.header-right .staff-info .staff-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--farid-text-dark);
}

.header-right .staff-info .staff-role {
    font-size: 11px;
    color: var(--farid-text-muted);
}

.btn-header-logout {
    background: none;
    border: 1px solid var(--farid-border);
    color: var(--farid-text-muted);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-header-logout:hover {
    color: var(--farid-danger);
    border-color: var(--farid-danger);
    background: #fff5f5;
}

/* ── Page Content ── */
.staff-content {
    flex: 1;
    padding: 24px;
}

.page-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header-bar h1 {
    margin: 0;
}

.breadcrumb-custom {
    font-size: 12px;
    color: var(--farid-text-muted);
}

.breadcrumb-custom a {
    color: var(--farid-primary);
}

/* ── Cards ── */
.card {
    background: var(--farid-card-bg);
    border: 1px solid var(--farid-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--farid-border);
    padding: 16px 20px;
    font-family: var(--font-heading);
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

/* Stat Cards */
.stat-card {
    position: relative;
    overflow: hidden;
    border: none;
}

.stat-card .card-body {
    padding: 20px;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 16px;
}

.stat-card .stat-icon.bg-primary-soft {
    background: rgba(0, 133, 200, 0.1);
    color: var(--farid-primary);
}

.stat-card .stat-icon.bg-secondary-soft {
    background: rgba(95, 219, 225, 0.12);
    color: var(--farid-secondary-dark);
}

.stat-card .stat-icon.bg-accent-soft {
    background: rgba(246, 172, 27, 0.12);
    color: var(--farid-accent-dark);
}

.stat-card .stat-icon.bg-success-soft {
    background: rgba(40, 167, 69, 0.1);
    color: var(--farid-success);
}

.stat-card .stat-value {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--farid-text-dark);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-card .stat-label {
    font-size: 13px;
    color: var(--farid-text-muted);
    font-weight: 400;
}

.stat-card .stat-change {
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
}

.stat-card .stat-change.up {
    color: var(--farid-success);
}

.stat-card .stat-change.down {
    color: var(--farid-danger);
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    opacity: 0.06;
}

.stat-card.stat-primary::after {
    background: var(--farid-primary);
}

.stat-card.stat-secondary::after {
    background: var(--farid-secondary);
}

.stat-card.stat-accent::after {
    background: var(--farid-accent);
}

.stat-card.stat-success::after {
    background: var(--farid-success);
}

/* ── Buttons ── */
.btn-farid-primary {
    background: var(--farid-primary);
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-farid-primary:hover {
    background: var(--farid-primary-dark);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 133, 200, 0.3);
    transform: translateY(-1px);
}

.btn-farid-primary:active {
    transform: translateY(0);
}

.btn-farid-secondary {
    background: var(--farid-secondary);
    color: var(--farid-sidebar-bg);
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-farid-secondary:hover {
    background: var(--farid-secondary-dark);
    color: var(--farid-sidebar-bg);
    box-shadow: 0 4px 12px rgba(95, 219, 225, 0.3);
    transform: translateY(-1px);
}

.btn-farid-accent {
    background: var(--farid-accent);
    color: var(--farid-primary);
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 13px;
    transition: all 0.2s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-farid-accent:hover {
    background: var(--farid-accent-dark);
    color: var(--farid-primary);
    box-shadow: 0 4px 12px rgba(246, 172, 27, 0.3);
    transform: translateY(-1px);
}

.btn-farid-outline {
    background: transparent;
    color: var(--farid-primary);
    border: 1.5px solid var(--farid-primary);
    padding: 9px 20px;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-farid-outline:hover {
    background: var(--farid-primary);
    color: #ffffff;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}

.btn-lg {
    padding: 12px 28px;
    font-size: 15px;
}

/* ── Tables ── */
.table-card {
    border-radius: var(--radius-md);
    overflow: hidden;
}

.table-farid {
    margin-bottom: 0;
    font-size: 13px;
}

.table-farid thead th {
    background: var(--farid-body-bg);
    border-bottom: 2px solid var(--farid-border);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--farid-text-muted);
    padding: 12px 16px;
    white-space: nowrap;
}

.table-farid tbody td {
    padding: 12px 16px;
    vertical-align: middle;
    border-bottom: 1px solid var(--farid-border);
    color: var(--farid-text-dark);
}

.table-farid tbody tr:hover {
    background: rgba(0, 133, 200, 0.02);
}

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

/* ── Forms ── */
.form-label {
    font-family: var(--font-heading);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--farid-text-dark);
    margin-bottom: 6px;
}

.form-control,
.form-select {
    border: 1.5px solid var(--farid-border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 13.5px;
    font-family: var(--font-body);
    color: var(--farid-text-dark);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--farid-primary);
    box-shadow: 0 0 0 3px rgba(0, 133, 200, 0.1);
    outline: none;
}

.form-control::placeholder {
    color: #b0b4cc;
}

.form-text {
    font-size: 12px;
    color: var(--farid-text-muted);
}

.input-group-text {
    background: var(--farid-body-bg);
    border: 1.5px solid var(--farid-border);
    color: var(--farid-text-muted);
    font-size: 13px;
}

/* ── Badges ── */
.badge-farid {
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.3px;
}

.badge-active {
    background: rgba(40, 167, 69, 0.1);
    color: var(--farid-success);
}

.badge-inactive {
    background: rgba(108, 114, 147, 0.1);
    color: var(--farid-text-muted);
}

.badge-paid {
    background: rgba(40, 167, 69, 0.1);
    color: var(--farid-success);
}

.badge-partial {
    background: rgba(246, 172, 27, 0.1);
    color: var(--farid-accent-dark);
}

.badge-unpaid {
    background: rgba(220, 53, 69, 0.1);
    color: var(--farid-danger);
}

/* ── Progress ── */
.progress-farid {
    height: 8px;
    border-radius: 4px;
    background: var(--farid-body-bg);
    overflow: hidden;
}

.progress-farid .progress-bar {
    background: linear-gradient(90deg, var(--farid-primary), var(--farid-secondary));
    border-radius: 4px;
    transition: width 0.6s ease;
}

/* ── Charts ── */
.chart-container {
    position: relative;
    width: 100%;
    min-height: 250px;
}

/* ── Patient Info Card ── */
.patient-info-card {
    background: linear-gradient(135deg, var(--farid-primary) 0%, var(--farid-primary-dark) 100%);
    color: #ffffff;
    border-radius: var(--radius-lg);
    padding: 24px;
    border: none;
}

.patient-info-card h3 {
    color: #ffffff;
    margin-bottom: 4px;
}

.patient-info-card .info-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.7;
    margin-bottom: 2px;
}

.patient-info-card .info-value {
    font-size: 14px;
    font-weight: 600;
}

.patient-info-card .package-badge {
    background: var(--farid-accent);
    color: var(--farid-primary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    font-family: var(--font-heading);
}

/* ── Payment Summary Card ── */
.payment-summary-card .summary-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed var(--farid-border);
}

.payment-summary-card .summary-item:last-child {
    border-bottom: none;
    font-weight: 700;
    font-size: 15px;
}

/* ── Search Bar ── */
.search-bar {
    position: relative;
    max-width: 360px;
}

.search-bar .form-control {
    padding-left: 40px;
}

.search-bar .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--farid-text-muted);
    font-size: 14px;
}

/* ── Login Page ── */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--farid-sidebar-bg) 0%, var(--farid-primary) 100%);
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--farid-card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 40px;
    border: none;
}

.login-brand {
    text-align: center;
    margin-bottom: 32px;
}

.login-brand .brand-icon-lg {
    width: 56px;
    height: 56px;
    background: var(--farid-primary);
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 800;
    color: #ffffff;
    font-family: var(--font-heading);
    margin-bottom: 16px;
}

.login-brand .login-brand-logo {
    max-width: 220px;
    width: 100%;
    height: auto;
    margin-bottom: 16px;
}

.login-brand h2 {
    font-size: 20px;
    margin-bottom: 2px;
}

.login-brand p {
    color: var(--farid-text-muted);
    font-size: 13px;
}

.login-card .form-group {
    margin-bottom: 20px;
}

.login-card .btn-farid-primary {
    width: 100%;
    justify-content: center;
    padding: 12px;
    font-size: 14px;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

/* ── Alerts ── */
.alert-farid {
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 13px;
    border: none;
}

.alert-farid.alert-danger {
    background: rgba(220, 53, 69, 0.1);
    color: var(--farid-danger);
}

.alert-farid.alert-success {
    background: rgba(40, 167, 69, 0.1);
    color: var(--farid-success);
}

/* ── BMI Display ── */
.bmi-display {
    background: var(--farid-body-bg);
    border: 2px dashed var(--farid-border);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
}

.bmi-display .bmi-value {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--farid-primary);
    line-height: 1;
}

.bmi-display .bmi-label {
    font-size: 12px;
    color: var(--farid-text-muted);
    margin-top: 4px;
}

.bmi-display .bmi-category {
    font-size: 13px;
    font-weight: 600;
    margin-top: 4px;
}

/* ── Spinner / Loading ── */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 133, 200, 0.2);
    border-top-color: var(--farid-primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Mobile Overlay ── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1035;
}

.sidebar-overlay.active {
    display: block;
}

/* ── Responsive ── */
@media (max-width: 991.98px) {
    .staff-sidebar {
        transform: translateX(-100%);
    }

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

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

    .header-left .sidebar-toggle {
        display: block;
    }

    .sidebar-overlay.active {
        display: block;
    }
}

@media (max-width: 767.98px) {
    .staff-content {
        padding: 16px;
    }

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

    .stat-card .stat-value {
        font-size: 1.4rem;
    }

    h1 {
        font-size: 1.4rem;
    }

    .header-right .staff-info .staff-name,
    .header-right .staff-info .staff-role {
        display: none;
    }

    .table-responsive {
        font-size: 12px;
    }
}

@media (max-width: 575.98px) {
    .login-card {
        padding: 28px 20px;
    }

    .staff-header {
        padding: 0 16px;
    }
}

/* ── Utility Classes ── */
.text-farid-primary { color: var(--farid-primary) !important; }
.text-farid-secondary { color: var(--farid-secondary) !important; }
.text-farid-accent { color: var(--farid-accent) !important; }
.text-farid-muted { color: var(--farid-text-muted) !important; }
.bg-farid-primary { background-color: var(--farid-primary) !important; }
.bg-farid-secondary { background-color: var(--farid-secondary) !important; }
.bg-farid-accent { background-color: var(--farid-accent) !important; }

.rounded-farid { border-radius: var(--radius-md); }

.section-divider {
    border: none;
    border-top: 1px solid var(--farid-border);
    margin: 24px 0;
}

/* ── Print Styles ── */
@media print {
    .staff-sidebar,
    .staff-header,
    .btn-farid-primary,
    .btn-farid-accent {
        display: none !important;
    }

    .staff-main {
        margin-left: 0 !important;
    }

    .staff-content {
        padding: 0 !important;
    }
}
