/* =============================================
   MH HOSPITAL - ADMIN / HMS STYLESHEET
   ============================================= */

.hms-layout { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.hms-sidebar { background: var(--primary-dark); color: rgba(255,255,255,.8); display: flex; flex-direction: column; position: fixed; top: 0; left: 0; height: 100vh; width: 240px; z-index: 50; overflow-y: auto; }
.hms-sidebar-logo { padding: 24px 20px; border-bottom: 1px solid rgba(255,255,255,.1); display: flex; align-items: center; gap: 12px; }
.hms-sidebar-logo .icon { width: 40px; height: 40px; background: rgba(255,255,255,.15); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.hms-sidebar-logo h2 { font-family: 'Playfair Display', serif; color: #fff; font-size: 1rem; line-height: 1.2; }
.hms-sidebar-logo p { font-size: .68rem; opacity: .7; }
.sidebar-nav { flex: 1; padding: 16px 0; }
.sidebar-section { font-size: .65rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 16px 20px 6px; opacity: .5; }
.sidebar-item { display: flex; align-items: center; gap: 12px; padding: 11px 20px; color: rgba(255,255,255,.7); text-decoration: none; font-size: .85rem; font-weight: 500; transition: all .18s; border-left: 3px solid transparent; cursor: pointer; }
.sidebar-item:hover { color: #fff; background: rgba(255,255,255,.07); border-left-color: rgba(255,255,255,.3); }
.sidebar-item.active { color: #fff; background: rgba(255,255,255,.12); border-left-color: var(--accent); }
.sidebar-item .icon { font-size: 1rem; flex-shrink: 0; }
.sidebar-item .badge-count { margin-left: auto; background: var(--accent2); color: #fff; border-radius: 50px; padding: 2px 7px; font-size: .68rem; font-weight: 700; }
.sidebar-bottom { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.1); }
.admin-avatar { display: flex; align-items: center; gap: 10px; color: #fff; font-size: .82rem; margin-bottom: 10px; }
.admin-avatar .av { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center; }

/* ---- MAIN CONTENT ---- */
.hms-main { margin-left: 240px; background: #f0f4fa; min-height: 100vh; }
.hms-topbar { background: #fff; padding: 16px 28px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1.5px solid var(--border); position: sticky; top: 0; z-index: 40; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.hms-topbar h1 { font-family: 'Playfair Display', serif; font-size: 1.2rem; color: var(--primary-dark); }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.topbar-notif { position: relative; cursor: pointer; }
.notif-badge { position: absolute; top: -4px; right: -4px; background: var(--accent2); color: #fff; border-radius: 50%; width: 16px; height: 16px; font-size: .6rem; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.hms-content { padding: 28px; }

/* ---- STAT BOXES ---- */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 28px; }
.stat-box { border-radius: 14px; padding: 22px 20px; color: #fff; position: relative; overflow: hidden; }
.stat-box::before { content: ''; position: absolute; top: -20px; right: -20px; width: 80px; height: 80px; border-radius: 50%; background: rgba(255,255,255,.1); }
.stat-box.blue { background: linear-gradient(135deg, var(--primary), var(--primary-light)); }
.stat-box.green { background: linear-gradient(135deg, #16a34a, #22c55e); }
.stat-box.orange { background: linear-gradient(135deg, #d97706, #f59e0b); }
.stat-box.red { background: linear-gradient(135deg, var(--accent2), #f87171); }
.stat-box .val { font-family: 'Playfair Display', serif; font-size: 2rem; font-weight: 700; line-height: 1.1; margin-bottom: 4px; }
.stat-box .lbl { font-size: .72rem; opacity: .85; text-transform: uppercase; letter-spacing: .06em; }
.stat-box .trend { font-size: .75rem; opacity: .8; margin-top: 8px; }

/* ---- PANEL CARDS ---- */
.panel-card { background: #fff; border-radius: 14px; box-shadow: 0 2px 16px rgba(10,77,140,.07); border: 1.5px solid var(--border); margin-bottom: 24px; overflow: hidden; }
.panel-card-header { padding: 18px 22px; border-bottom: 1.5px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.panel-card-header h3 { font-family: 'Playfair Display', serif; font-size: 1rem; color: var(--primary-dark); }
.panel-card-body { padding: 20px 22px; }

/* ---- TABLES ---- */
table { width: 100%; border-collapse: collapse; font-size: .84rem; }
table th { background: #f8faff; color: var(--text-muted); font-weight: 700; padding: 11px 14px; text-align: left; border-bottom: 1.5px solid var(--border); font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; }
table td { padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
table tr:last-child td { border-bottom: none; }
table tr:hover td { background: #f8faff; }
table .action-btns { display: flex; gap: 6px; }
table .action-btn { padding: 4px 10px; border-radius: 6px; font-size: .73rem; font-weight: 600; border: none; cursor: pointer; text-decoration: none; }
.action-view { background: #dbeafe; color: var(--primary); }
.action-edit { background: #fef9c3; color: #a16207; }
.action-delete { background: #fee2e2; color: var(--accent2); }

/* ---- FORM ---- */
.admin-form { display: grid; gap: 16px; }
.admin-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.admin-form .form-group { display: flex; flex-direction: column; gap: 6px; }
.admin-form label { font-size: .8rem; font-weight: 600; color: var(--text); }
.admin-form input, .admin-form select, .admin-form textarea { padding: 10px 14px; border: 1.5px solid var(--border); border-radius: 9px; font-family: 'DM Sans', sans-serif; font-size: .88rem; color: var(--text); outline: none; transition: border-color .2s, box-shadow .2s; }
.admin-form input:focus, .admin-form select:focus, .admin-form textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(10,77,140,.1); }

/* ---- CHART BARS ---- */
.mini-bar { height: 6px; background: #e2e8f0; border-radius: 3px; margin-bottom: 10px; }
.mini-bar-fill { height: 100%; border-radius: 3px; }

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  .hms-layout { grid-template-columns: 1fr; }
  .hms-sidebar { width: 100%; height: auto; position: static; flex-direction: row; overflow-x: auto; }
  .sidebar-nav { display: flex; flex-direction: row; overflow-x: auto; padding: 8px 0; }
  .sidebar-section { display: none; }
  .sidebar-item { white-space: nowrap; border-left: none; border-bottom: 3px solid transparent; }
  .sidebar-item.active { border-bottom-color: var(--accent); border-left-color: transparent; }
  .hms-main { margin-left: 0; }
  .stats-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .stats-row { grid-template-columns: 1fr; }
  .admin-form .form-row { grid-template-columns: 1fr; }
}
