/* =====================================================
   HMS - Hospital Management System
   Main Stylesheet - Desktop-grade UI
   ===================================================== */

:root {
    --hms-primary: #1a6b9e;
    --hms-primary-dark: #124e75;
    --hms-secondary: #26a69a;
    --hms-sidebar-bg: #1e2a38;
    --hms-sidebar-width: 240px;
    --hms-topbar-height: 52px;
    --hms-text-light: #ecf0f1;
    --hms-nav-hover: rgba(255,255,255,0.08);
    --hms-nav-active: rgba(26,107,158,0.9);
}

/* ---- Base ---- */
body.hms-body { background: #f0f2f5; font-family: 'Segoe UI', Arial, sans-serif; font-size: 14px; }

/* ---- Topbar ---- */
.hms-topbar { background: var(--hms-primary-dark) !important; height: var(--hms-topbar-height); z-index: 1040; }
.hms-topbar .navbar-brand { font-size: 1.1rem; letter-spacing: 0.5px; }

/* ---- Sidebar ---- */
.hms-sidebar {
    position: fixed; top: var(--hms-topbar-height); left: 0; bottom: 0;
    width: var(--hms-sidebar-width); background: var(--hms-sidebar-bg);
    overflow-y: auto; z-index: 1030; transition: transform 0.25s ease;
    scrollbar-width: thin; scrollbar-color: #3a4a5c transparent;
}
.hms-sidebar.collapsed { transform: translateX(calc(-1 * var(--hms-sidebar-width))); }
.sidebar-section {
    padding: 6px 16px 3px; font-size: 10px; font-weight: 700; letter-spacing: 1px;
    color: #6c8498; text-transform: uppercase; margin-top: 8px;
}
.hms-nav-link {
    color: #b0c4d8 !important; padding: 8px 16px; border-radius: 6px; margin: 1px 8px;
    transition: background 0.15s, color 0.15s; font-size: 13.5px;
}
.hms-nav-link:hover { background: var(--hms-nav-hover) !important; color: #fff !important; }
.hms-nav-link.active { background: var(--hms-nav-active) !important; color: #fff !important; font-weight: 600; }
.hms-nav-link i { width: 18px; text-align: center; }

/* ---- Main Content ---- */
.hms-main-content {
    margin-left: var(--hms-sidebar-width); padding-top: var(--hms-topbar-height);
    min-height: 100vh; transition: margin-left 0.25s ease;
}
.hms-main-content.expanded { margin-left: 0; }

/* ---- Page Header ---- */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.page-title { font-size: 1.2rem; font-weight: 600; color: #2c3e50; margin: 0; }
.page-title i { color: var(--hms-primary); }

/* ---- Cards ---- */
.hms-card { background: #fff; border: none; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.hms-card .card-header { background: var(--hms-primary); color: #fff; border-radius: 8px 8px 0 0; font-weight: 600; padding: 10px 16px; }
.stat-card { border-radius: 10px; border: none; box-shadow: 0 2px 8px rgba(0,0,0,0.09); transition: transform 0.15s; cursor: default; }
.stat-card:hover { transform: translateY(-2px); }
.stat-card .stat-icon { font-size: 2.2rem; opacity: 0.85; }
.stat-card .stat-value { font-size: 1.9rem; font-weight: 700; line-height: 1; }
.stat-card .stat-label { font-size: 12px; opacity: 0.85; }

/* ---- Tables ---- */
.hms-table { font-size: 13px; }
.hms-table thead th { background: #f8f9fa; font-weight: 600; border-bottom: 2px solid #dee2e6; white-space: nowrap; }
.hms-table tbody tr:hover { background: #f0f7ff; }
.hms-table .actions { white-space: nowrap; }

/* ---- Forms ---- */
.form-label { font-weight: 500; font-size: 13px; margin-bottom: 3px; color: #495057; }
.form-control, .form-select { font-size: 14px; border-radius: 5px; }
.form-control:focus, .form-select:focus { border-color: var(--hms-primary); box-shadow: 0 0 0 0.2rem rgba(26,107,158,0.2); }
.required-star::after { content: " *"; color: #dc3545; }

/* ---- Buttons ---- */
.btn-hms { background: var(--hms-primary); color: #fff; border: none; }
.btn-hms:hover { background: var(--hms-primary-dark); color: #fff; }

/* ---- Token Slip ---- */
.token-slip { max-width: 380px; margin: 0 auto; border: 2px dashed var(--hms-primary); border-radius: 12px; padding: 24px; text-align: center; background: #fff; }
.token-number { font-size: 4rem; font-weight: 800; color: var(--hms-primary); line-height: 1; }
.token-badge-free { background: #27ae60; color: #fff; padding: 3px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; display: inline-block; }

/* ---- Search Box ---- */
.hms-search-wrap { position: relative; }
.hms-search-wrap .search-results-dropdown {
    position: absolute; top: 100%; left: 0; right: 0; background: #fff;
    border: 1px solid #dee2e6; border-radius: 6px; z-index: 9999;
    max-height: 300px; overflow-y: auto; box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    display: none;
}
.hms-search-wrap .search-results-dropdown.show { display: block; }
.search-result-item { padding: 8px 14px; cursor: pointer; border-bottom: 1px solid #f0f0f0; }
.search-result-item:hover, .search-result-item.selected { background: #e8f4fd; }
.search-result-item .patient-name { font-weight: 600; color: #2c3e50; }
.search-result-item .patient-info { font-size: 12px; color: #6c757d; }
.search-result-item .badge-followup { background: #27ae60; color: #fff; font-size: 10px; padding: 2px 7px; border-radius: 10px; }
.search-result-item .badge-due { background: #e74c3c; color: #fff; font-size: 10px; padding: 2px 7px; border-radius: 10px; }

/* ---- Status Badges ---- */
.badge-waiting { background: #f39c12; }
.badge-consulting { background: #3498db; }
.badge-completed { background: #27ae60; }
.badge-paid { background: #27ae60; }
.badge-pending { background: #e67e22; }
.badge-partial { background: #3498db; }
.status-admitted { background: #27ae60; color:#fff; }
.status-discharged { background: #95a5a6; color:#fff; }

/* ---- Print Styles ---- */
@media print {
    .hms-sidebar, .hms-topbar, .no-print, .btn, nav { display: none !important; }
    .hms-main-content { margin-left: 0 !important; padding-top: 0 !important; }
    body { background: #fff !important; }
    .print-section { border: none !important; box-shadow: none !important; }
}

/* ---- Public Website ---- */
.public-nav { background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.hero-section { background: linear-gradient(135deg, var(--hms-primary-dark) 0%, var(--hms-secondary) 100%); color: #fff; padding: 100px 0 70px; }
.feature-card { border: none; border-radius: 12px; box-shadow: 0 2px 12px rgba(0,0,0,0.08); transition: transform 0.2s; height: 100%; }
.feature-card:hover { transform: translateY(-4px); }
.pricing-card { border: 2px solid #e9ecef; border-radius: 12px; transition: border-color 0.2s; }
.pricing-card.featured { border-color: var(--hms-primary); }
.pricing-card .price { font-size: 2.8rem; font-weight: 800; color: var(--hms-primary); }

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .hms-sidebar { transform: translateX(calc(-1 * var(--hms-sidebar-width))); }
    .hms-sidebar.mobile-open { transform: translateX(0); }
    .hms-main-content { margin-left: 0; }
    .stat-value { font-size: 1.4rem; }
}

/* ---- Keyboard hints ---- */
.kbd-hint { font-size: 11px; color: #6c757d; }
kbd { background: #e9ecef; border: 1px solid #ced4da; border-radius: 3px; padding: 1px 5px; font-size: 11px;color:black !important }
