:root {
  --el-navy: #0c3d68;
  --el-navy-strong: #082a49;
  --el-teal: #0ea5ae;
  --el-teal-strong: #0b8089;
  --el-teal-soft: #e1f3f3;
  --el-success: #167a52;
  --el-warning: #a6690c;
  --el-danger: #c23b3b;
  --el-bg: #f5f8fa;
  --el-border: #d7e0e6;
  --el-text: #10202e;
  --el-text-muted: #4e6472;
  --el-font-body: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  font-family: var(--el-font-body);
  color: var(--el-text);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--el-teal-strong);
}

h1, h2, h3 {
  color: var(--el-navy);
}

/* Navbar */
.el-navbar {
  border-bottom: 3px solid var(--el-teal);
  box-shadow: 0 1px 4px rgba(12, 61, 104, 0.08);
}

.el-nav-link {
  color: var(--el-navy) !important;
  font-weight: 500;
  transition: color 0.15s ease-in-out;
}

.el-nav-link:hover, .el-nav-link:focus {
  color: var(--el-teal-strong) !important;
}

/* Dropdown menus */
.dropdown-menu {
  border-color: var(--el-border);
  box-shadow: 0 4px 16px rgba(12, 61, 104, 0.12);
}

.dropdown-item {
  color: var(--el-text);
}

.dropdown-item:hover, .dropdown-item:focus {
  background-color: var(--el-teal-soft);
  color: var(--el-navy);
}

.dropdown-item-text {
  font-size: 0.9rem;
}

/* User menu */
.el-user-menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.el-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--el-teal);
  color: #fff;
  font-weight: 600;
  font-size: 0.8rem;
  flex-shrink: 0;
}

/* Footer */
.el-footer {
  border-top: 1px solid var(--el-border);
  color: var(--el-text-muted);
  padding: 0.75rem 0;
}

.el-footer a {
  color: var(--el-teal-strong);
}

/* Home */
.el-home-hero {
  padding: 4rem 1rem 2rem;
}

.el-home-logo {
  height: 64px;
  margin-bottom: 1.5rem;
}

.el-home-title {
  font-weight: 600;
  font-size: 2.25rem;
  margin-bottom: 0.75rem;
}

.el-home-lead {
  color: var(--el-text-muted);
  font-size: 1.15rem;
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Copiable field (contraseña temporal, etc.) - mismo patrón visual que el cuadro de historia clínica en Agent/Index */
.el-copy-field {
  display: flex;
  align-items: stretch;
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
  background-color: #fff;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.el-copy-field:focus-within {
  border-color: var(--el-teal-strong);
  box-shadow: 0 0 0 0.25rem rgba(11, 128, 137, 0.25);
}

.el-copy-field-input {
  flex: 1 1 auto;
  border: 0;
  outline: none;
  box-shadow: none;
  padding: 0.5rem 0.75rem;
  background: transparent;
  font-family: "Consolas", "Courier New", monospace;
}

.el-copy-field-toolbar {
  display: flex;
  align-items: center;
  padding: 0 0.375rem;
}

.el-copy-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 0;
  border-radius: 0.375rem;
  background: transparent;
}

.el-copy-icon-button:hover:not(:disabled) {
  background-color: var(--el-teal-soft);
}

/* Admin screen titles (grids) */
.el-page-title {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

/* Truncated single-line grid cell (ej. Petición en Ver mis consumos) */
.el-truncate-cell {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* table-layout: auto (DevExtreme's default) lets a cell grow to fit its content,
   ignoring the computed <col> width and defeating .el-truncate-cell's ellipsis.
   Forcing "fixed" makes every cell honor the colgroup width instead. */
#GridMyQueries .dx-datagrid-headers table,
#GridMyQueries .dx-datagrid-rowsview table {
  table-layout: fixed;
}

/* The custom theme (dx.elisa-brand.css) already assigns flex "order" values meant to
   arrange each tree node as [toggle arrow, checkbox, label] (order 0, 1, and 2 respectively),
   but never actually turns .dx-treeview-node into a flex container, nor gives the label
   wrapper its own order:2. Without the flex container, order is ignored entirely and the
   three pieces stack on separate lines (list-item default); with only align-items/flex
   added but no order on the label, it falls back to DOM order, landing as
   [label, arrow, checkbox] instead of the intended [arrow, checkbox, label].
   Affects any header filter that groups values into a tree (e.g. date columns). */
.dx-treeview-node {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}
.dx-treeview-node > .dx-treeview-item {
  order: 2;
}
/* When a node is expanded, its nested <ul> of children is also a flex child of the same
   <li> (alongside the toggle/checkbox/label row) — without this, it renders beside the
   label instead of dropping to a new line below it. */
.dx-treeview-node > .dx-treeview-node-container {
  order: 3;
  flex-basis: 100%;
}

/* Scrollable textarea for long text shown in a detail modal */
.el-detail-textarea {
  min-height: 280px;
  max-height: 450px;
  overflow-y: auto;
  resize: vertical;
  font-family: "Consolas", "Courier New", monospace;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}