/* ========================================================
   Centro Oncológico QA - Custom Styles
   Bootstrap 5 base + custom sidebar layout
   ======================================================== */

:root {
  --sidebar-width:    260px;
  --topbar-height:    60px;
  --primary:          #2B3487;
  --primary-dark:     #1e2560;
  --primary-light:    #3d4da8;
  --sidebar-bg:       #1a2040;
  --sidebar-text:     rgba(255,255,255,.8);
  --sidebar-active:   #2B3487;
  --topbar-bg:        #fff;
  --body-bg:          #f4f6fb;
  --card-shadow:      0 2px 12px rgba(0,0,0,.08);
}

/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: 'Segoe UI', system-ui, sans-serif; background: var(--body-bg); }

/* ── Sidebar ── */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  z-index: 1040;
  transition: transform .28s ease;
  overflow-y: auto;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  height: var(--topbar-height);
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
}

.sidebar-brand i { font-size: 1.4rem; color: #7b8ef8; }

.sidebar-close {
  background: none;
  border: none;
  color: var(--sidebar-text);
  font-size: 1.2rem;
  cursor: pointer;
  padding: .25rem;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.user-avatar i { font-size: 2.2rem; color: #7b8ef8; }
.user-name { font-size: .88rem; font-weight: 600; color: #fff; line-height: 1.3; }
.user-role { font-size: .75rem; color: rgba(255,255,255,.5); }

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

.nav-label {
  padding: .85rem 1rem .3rem;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.35);
}

.sidebar-nav .nav-item .nav-link {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .6rem 1rem;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: 0 2rem 2rem 0;
  margin-right: .75rem;
  transition: background .18s, color .18s;
}

.sidebar-nav .nav-item .nav-link i { font-size: 1.05rem; width: 1.2rem; text-align: center; }
.sidebar-nav .nav-item .nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-nav .nav-item .nav-link.active { background: var(--sidebar-active); color: #fff; }

.sidebar-footer {
  padding: .75rem;
  border-top: 1px solid rgba(255,255,255,.08);
}

.sidebar-footer .nav-link {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .5rem .75rem;
  text-decoration: none;
  border-radius: .5rem;
  transition: background .18s;
}

.sidebar-footer .nav-link:hover { background: rgba(255,255,255,.08); }

/* ── Main wrapper ── */
.main-wrapper {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  transition: margin .28s ease;
}

/* ── Topbar ── */
.topbar {
  position: sticky;
  top: 0;
  height: var(--topbar-height);
  background: var(--topbar-bg);
  border-bottom: 1px solid #e9ecef;
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  gap: 1rem;
  z-index: 1030;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.topbar-toggle {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: #495057;
  cursor: pointer;
  padding: .25rem;
  display: none;
}

.topbar-title { font-weight: 600; color: #212529; flex: 1; }
.topbar-right  { display: flex; align-items: center; gap: .75rem; }

.topbar-breadcrumb {
  flex: 1;
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .88rem;
  overflow: hidden;
}
.topbar-breadcrumb a { color: var(--primary); text-decoration: none; white-space: nowrap; }
.topbar-breadcrumb a:hover { text-decoration: underline; }
.topbar-breadcrumb span { color: #495057; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-breadcrumb .sep { color: #adb5bd; font-size: .75rem; }

/* ── Page content ── */
.page-content { padding: 1.5rem; }

/* ── Stat cards ── */
.stat-card {
  background: #fff;
  border-radius: 1rem;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .4rem;
  box-shadow: var(--card-shadow);
  border-left: 4px solid transparent;
}

.stat-blue   { border-left-color: #2B3487; }
.stat-green  { border-left-color: #28a745; }
.stat-orange { border-left-color: #fd7e14; }
.stat-purple { border-left-color: #6f42c1; }

.stat-icon { font-size: 1.6rem; }
.stat-blue   .stat-icon { color: #2B3487; }
.stat-green  .stat-icon { color: #28a745; }
.stat-orange .stat-icon { color: #fd7e14; }
.stat-purple .stat-icon { color: #6f42c1; }

.stat-value { font-size: 1.8rem; font-weight: 700; color: #212529; line-height: 1; }
.stat-label { font-size: .8rem; color: #6c757d; }

/* ── Cards ── */
.card { border: none; border-radius: 1rem; box-shadow: var(--card-shadow); }
.card-header {
  background: #fff;
  border-bottom: 1px solid #e9ecef;
  font-weight: 600;
  border-radius: 1rem 1rem 0 0 !important;
  padding: .9rem 1.25rem;
}

/* ── Quick links ── */
.quick-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  padding: 1rem .5rem;
  background: #f8f9fa;
  border-radius: .75rem;
  text-decoration: none;
  color: #495057;
  transition: background .18s, transform .18s;
  text-align: center;
  font-size: .82rem;
  font-weight: 500;
}

.quick-link i { font-size: 1.5rem; color: var(--primary); }
.quick-link:hover { background: #e8eaf8; color: var(--primary); transform: translateY(-2px); }

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

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

/* ── Login page ── */
.login-body {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary) 0%, #1a1f5e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.login-wrapper {
  width: 100%;
  max-width: 420px;
}

.login-card {
  background: #fff;
  border-radius: 1.25rem;
  padding: 2.5rem 2rem;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo i {
  font-size: 3rem;
  color: var(--primary);
}

.login-logo h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #212529;
  margin: .5rem 0 .25rem;
}

.login-logo p {
  color: #6c757d;
  font-size: .88rem;
  margin: 0;
}

.btn-login {
  background: var(--primary);
  border-color: var(--primary);
  font-weight: 600;
  padding: .65rem;
}

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

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

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

/* ── Responsive ── */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(calc(-1 * var(--sidebar-width)));
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-wrapper {
    margin-left: 0;
  }
  .topbar-toggle {
    display: block;
  }
}

@media (max-width: 576px) {
  .page-content { padding: 1rem .75rem; }
  .login-card { padding: 2rem 1.25rem; }
  .stat-value { font-size: 1.5rem; }
}
