
:root {
  --color-primary: #1E7C78;
  --color-primary-dark: #145F5C;
  --color-primary-light: #2CA6A0;
  --color-surface-soft: #BFE6E0;
  --color-bg: #F7FAFA;
  --color-white: #FFFFFF;
  --color-text: #2D3B3A;
  --color-text-muted: #6B7C7A;
  --color-border: #DCEEEC;


  --status-good: #0ca30c;
  --status-good-bg: #e5f6e5;
  --status-warning: #b8790f;
  --status-warning-bg: #fef2dc;
  --status-critical: #d03b3b;
  --status-critical-bg: #fbe7e7;

  --font-heading: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --sidebar-width: 260px;
  --topbar-height: 64px;
  --radius: 10px;
  --shadow-sm: 0 1px 3px rgba(20, 40, 38, 0.08);
  --shadow-md: 0 4px 16px rgba(20, 40, 38, 0.10);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 15px;
}

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

a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-primary-dark); text-decoration: underline; }

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--color-surface-soft) 0%, var(--color-bg) 55%);
  padding: 1.5rem;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 2.25rem 2rem;
}

.brand-mark {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 1.5rem;
}

.brand-mark__icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  margin-bottom: 0.75rem;
  box-shadow: 0 0 0 6px var(--color-surface-soft);
}

.brand-mark__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.6);
}

.brand-mark__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-primary-dark);
}

.brand-mark__subtitle {
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

.form-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--color-text);
}

.form-control, .form-select {
  border-radius: 8px;
  border: 1px solid var(--color-border);
  padding: 0.55rem 0.75rem;
  font-family: var(--font-body);
}

.form-control:focus, .form-select:focus {
  border-color: var(--color-primary-light);
  box-shadow: 0 0 0 3px rgba(44, 166, 160, 0.18);
}

.btn-brand {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-white);
  font-weight: 600;
  border-radius: 8px;
  padding: 0.6rem 1rem;
}

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

.btn-outline-brand {
  border: 1px solid var(--color-primary);
  color: var(--color-primary);
  font-weight: 600;
  border-radius: 8px;
  background: transparent;
}

.btn-outline-brand:hover {
  background: var(--color-surface-soft);
  color: var(--color-primary-dark);
}


.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--color-primary-dark);
  color: var(--color-white);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 1030;
  transition: transform 0.2s ease;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

.sidebar__brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--color-white);
}

.sidebar__brand-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.6);
}

.sidebar__brand-text {
  line-height: 1.15;
}

.sidebar__brand-text strong {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.92rem;
}

.sidebar__brand-text span {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.7);
}

.sidebar__nav {
  flex: 1;
  padding: 0.75rem 0.6rem;
  overflow-y: auto;
}

.sidebar__nav-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.5);
  padding: 0.9rem 0.75rem 0.35rem;
}

.sidebar__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.75rem 0.6rem 1rem;
  border-radius: 10px;
  color: rgba(255,255,255,0.72);
  font-size: 0.87rem;
  font-weight: 500;
  margin-bottom: 0.15rem;
  transition: background-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.sidebar__link-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.08);
  flex-shrink: 0;
  transition: background-color 0.16s ease;
}

.sidebar__link i { font-size: 0.95rem; }

.sidebar__link:hover {
  background: rgba(255,255,255,0.07);
  color: var(--color-white);
  text-decoration: none;
  transform: translateX(2px);
}

.sidebar__link.active {
  background: rgba(255,255,255,0.1);
  color: var(--color-white);
  font-weight: 600;
}

.sidebar__link.active .sidebar__link-icon {
  background: var(--color-primary-light);
}

.sidebar__link.active::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 20%;
  bottom: 20%;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: var(--color-primary-light);
}

.sidebar__footer {
  padding: 0.85rem 1.1rem 1.1rem;
  border-top: 1px solid rgba(255,255,255,0.12);
}

.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-height);
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 1020;
}

.topbar__title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
}

.sidebar-toggle {
  display: none;
  border: none;
  background: transparent;
  font-size: 1.3rem;
  color: var(--color-text);
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.75rem 0.35rem 0.35rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-bg);
}

.user-pill__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-surface-soft);
  color: var(--color-primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
}

.user-pill__name { font-size: 0.82rem; font-weight: 600; line-height: 1.1; }
.user-pill__role { font-size: 0.7rem; color: var(--color-text-muted); }

.page-content {
  padding: 1.75rem;
  flex: 1;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
}

.stat-tile {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow-sm);
  height: 100%;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.stat-tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary-light);
}

.stat-tile__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.stat-tile__trend {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
}

.stat-tile__trend--good { color: var(--status-good); background: var(--status-good-bg); }
.stat-tile__trend--warning { color: var(--status-warning); background: var(--status-warning-bg); }

.stat-tile__label {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.stat-tile__value {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  margin: 0.15rem 0;
  font-variant-numeric: tabular-nums;
}

.stat-tile__meta {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

.stat-tile__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--color-surface-soft);
  color: var(--color-primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  margin-bottom: 0.6rem;
}

.panel {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
}

.panel__header h2 { font-size: 1rem; margin: 0; }
.panel__body { padding: 1.1rem 1.25rem; }


.table-brand {
  margin: 0;
  font-size: 0.87rem;
}

.table-brand thead th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
  font-weight: 700;
  padding: 0.7rem 1rem;
  white-space: nowrap;
}

.table-brand tbody td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.table-brand tbody tr:last-child td { border-bottom: none; }
.table-brand tbody tr:hover { background: var(--color-bg); }


.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
}

.badge-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.badge-status--good { background: var(--status-good-bg); color: var(--status-good); }
.badge-status--good::before { background: var(--status-good); }

.badge-status--warning { background: var(--status-warning-bg); color: var(--status-warning); }
.badge-status--warning::before { background: var(--status-warning); }

.badge-status--critical { background: var(--status-critical-bg); color: var(--status-critical); }
.badge-status--critical::before { background: var(--status-critical); }

.badge-role {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: var(--color-surface-soft);
  color: var(--color-primary-dark);
  font-size: 0.72rem;
  font-weight: 700;
}


.nav-tabs-brand {
  display: inline-flex;
  border-bottom: none;
  gap: 3px;
  background: var(--color-surface-soft);
  padding: 4px;
  border-radius: 11px;
}

.nav-tabs-brand .nav-link {
  color: var(--color-primary-dark);
  opacity: 0.65;
  border: none;
  font-weight: 600;
  font-size: 0.84rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: background-color 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
}

.nav-tabs-brand .nav-link:hover { opacity: 1; }

.nav-tabs-brand .nav-link.active {
  opacity: 1;
  background: var(--color-white);
  box-shadow: var(--shadow-sm);
}

.entity-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.entity-header__avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-surface-soft);
  color: var(--color-primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.entity-header__meta {
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

.record-card {
  border-left: 3px solid var(--color-primary-light);
  background: var(--color-bg);
  border-radius: 0 8px 8px 0;
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
}

.record-card__date {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.record-card__title { font-weight: 700; margin: 0.15rem 0; }

.pagination .page-link {
  color: var(--color-primary-dark);
  border-color: var(--color-border);
}

.pagination .page-item.active .page-link {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.agenda-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.agenda-date-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.agenda-date-nav__label {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  min-width: 220px;
  text-align: center;
}

.agenda-table th {
  text-align: center;
}

.agenda-table td {
  vertical-align: top;
  padding: 0.4rem;
}

.agenda-table td:first-child {
  vertical-align: middle;
  text-align: center;
  font-weight: 600;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.agenda-slot {
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  font-size: 0.8rem;
}

.agenda-slot--busy {
  background: var(--color-surface-soft);
  border-left: 3px solid var(--color-primary);
}

.agenda-slot--busy strong { display: block; font-size: 0.82rem; }

.agenda-slot--free {
  border: 1px dashed var(--color-border);
  color: var(--color-text-muted);
  text-align: center;
}

.agenda-slot--free:hover {
  border-color: var(--color-primary-light);
  color: var(--color-primary-dark);
  text-decoration: none;
  background: var(--color-bg);
}

.agenda-legend {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

.agenda-legend__dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 0.35rem;
}

.specialist-card__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-surface-soft);
  color: var(--color-primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  flex-shrink: 0;
}

.specialist-card__schedule {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

.specialist-card__schedule li {
  display: flex;
  justify-content: space-between;
  padding: 0.25rem 0;
  border-bottom: 1px dashed var(--color-border);
}

.specialist-card__schedule li:last-child { border-bottom: none; }

.text-muted-brand { color: var(--color-text-muted); }
.divider-soft { border-color: var(--color-border); }

@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-md);
  }
  .sidebar.is-open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .sidebar-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 30, 29, 0.35);
    z-index: 1025;
  }
  .sidebar-backdrop.is-visible { display: block; }
}

.required-marker {
  color: var(--status-critical);
  font-weight: 600;
}
