/* ═══════════════════════════════════════════════════════════════
   ClinicPro MVC — site.css
   ═══════════════════════════════════════════════════════════════ */

:root {
  --cp-primary:     #1565C0;
  --cp-primary-lt:  #EEF4FF;
  --cp-sidebar-w:   240px;
  --cp-sidebar-bg:  #0A1628;
  --cp-sidebar-txt: rgba(255,255,255,0.80);
  --cp-sidebar-act: #1565C0;
  --cp-topbar-h:    56px;
  --cp-radius:      10px;
  --cp-shadow:      0 2px 8px rgba(0,0,0,0.08);
}

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

body.cp-body {
  display: flex;
  min-height: 100vh;
  background: #F4F6FA;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: .875rem;
}

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

.cp-sidebar-header {
  padding: 1.25rem 1rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.cp-logo {
  display: flex;
  align-items: center;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
}

.cp-nav-list {
  list-style: none;
  padding: .5rem 0;
  margin: 0;
  flex: 1;
}

.cp-nav-section {
  padding: 1rem 1rem .25rem;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,0.35);
}

.cp-nav-link {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .55rem 1rem;
  color: var(--cp-sidebar-txt);
  text-decoration: none;
  transition: all .15s;
  border-left: 3px solid transparent;
  font-size: .83rem;
}

.cp-nav-link:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}

.cp-nav-link.active {
  background: rgba(21,101,192,0.25);
  color: #fff;
  border-left-color: var(--cp-sidebar-act);
  font-weight: 600;
}

.cp-sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

/* ── Main content ────────────────────────────────────────────── */
.cp-main {
  margin-left: var(--cp-sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left .25s ease;
}

/* ── Topbar ──────────────────────────────────────────────────── */
.cp-topbar {
  position: sticky;
  top: 0;
  height: var(--cp-topbar-h);
  background: #fff;
  border-bottom: 1px solid #E9ECF0;
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  z-index: 900;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* ── Page Content ────────────────────────────────────────────── */
.cp-page-content {
  flex: 1;
  padding: 1.25rem 1.5rem;
}

.cp-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: .5rem;
}

.cp-page-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1A1F2B;
  margin: 0;
}

/* ── Cards ───────────────────────────────────────────────────── */
.cp-card {
  background: #fff;
  border-radius: var(--cp-radius);
  box-shadow: var(--cp-shadow);
  border: 1px solid #E9ECF0;
  overflow: hidden;
}

.cp-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .85rem 1.1rem;
  border-bottom: 1px solid #F0F2F5;
  background: #FAFBFC;
  font-size: .85rem;
  font-weight: 600;
}

.cp-card-body {
  padding: 1.1rem;
}

.cp-card-footer {
  background: #FAFBFC;
}

/* ── KPI Cards ───────────────────────────────────────────────── */
.cp-kpi-card {
  background: #fff;
  border-radius: var(--cp-radius);
  padding: 1rem;
  box-shadow: var(--cp-shadow);
  border: 1px solid #E9ECF0;
  transition: transform .15s, box-shadow .15s;
}

.cp-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.cp-kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.cp-kpi-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: #1A1F2B;
  line-height: 1;
}

.cp-kpi-label {
  font-size: .72rem;
  color: #6B7280;
  margin-top: .2rem;
}

/* ── Avatar ──────────────────────────────────────────────────── */
.cp-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .85rem;
  flex-shrink: 0;
}

/* ── Tables ──────────────────────────────────────────────────── */
.table { font-size: .85rem; }
.table th { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: #6B7280; }
.table td { vertical-align: middle; }

/* ── Badges ──────────────────────────────────────────────────── */
.badge { font-weight: 500; letter-spacing: .02em; }
.btn-xs { padding: .15rem .4rem; font-size: .75rem; }

/* ── Forms ───────────────────────────────────────────────────── */
.form-label { font-size: .8rem; font-weight: 600; color: #374151; margin-bottom: .35rem; }
.form-control, .form-select {
  font-size: .85rem;
  border-color: #D1D5DB;
  border-radius: 8px;
}
.form-control:focus, .form-select:focus {
  border-color: var(--cp-primary);
  box-shadow: 0 0 0 3px rgba(21,101,192,.12);
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn { border-radius: 8px; font-size: .85rem; font-weight: 500; }
.btn-primary { background: var(--cp-primary); border-color: var(--cp-primary); }
.btn-primary:hover { background: #1255A4; border-color: #1255A4; }

/* ── Footer ──────────────────────────────────────────────────── */
.cp-footer {
  padding: .75rem 1.5rem;
  border-top: 1px solid #E9ECF0;
  background: #FAFBFC;
  text-align: center;
}

/* ── Report cards ────────────────────────────────────────────── */
.cp-report-card { transition: transform .15s, box-shadow .15s; }
.cp-report-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.12); }

/* ── Quick search dropdown ───────────────────────────────────── */
#quickSearchResults .qs-item {
  padding: .6rem .8rem;
  cursor: pointer;
  border-bottom: 1px solid #F3F4F6;
  font-size: .82rem;
}
#quickSearchResults .qs-item:hover { background: #F9FAFB; }
#quickSearchResults .qs-item:last-child { border-bottom: none; }

/* ── Sidebar collapsed ───────────────────────────────────────── */
body.sidebar-collapsed .cp-sidebar { transform: translateX(-100%); }
body.sidebar-collapsed .cp-main   { margin-left: 0; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .cp-sidebar { transform: translateX(-100%); }
  .cp-main    { margin-left: 0; }
  body.sidebar-open .cp-sidebar { transform: translateX(0); }
  .cp-page-content { padding: 1rem; }
  .cp-kpi-value { font-size: 1rem; }
}

/* ── FullCalendar overrides ──────────────────────────────────── */
.fc .fc-toolbar-title { font-size: 1rem !important; font-weight: 700; }
.fc .fc-button { border-radius: 6px !important; font-size: .8rem !important; }
.fc .fc-event { border-radius: 4px !important; font-size: .78rem !important; cursor: pointer; }
