:root {
  --bg: #f6f6f6;
  --surface: #ffffff;
  --surface-soft: #fff3f3;
  --sidebar: #05090b;
  --sidebar-soft: #11181c;
  --primary: #c4000b;
  --primary-strong: #9d0008;
  --primary-dark: #680006;
  --accent: #e30613;
  --border: #e8e8e8;
  --text: #161616;
  --muted: #6e6e6e;
  --success: #137d3f;
  --warning: #a26100;
  --danger-soft: #fff0f1;
  --shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
  --red-shadow: 0 12px 28px rgba(196, 0, 11, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

body.menu-open {
  overflow: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(320px, 1.05fr);
  background: var(--bg);
}

.login-brand {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 20%, rgba(227, 6, 19, 0.72), transparent 28%),
    linear-gradient(145deg, #070b0f 0%, #101010 46%, #b4000a 100%);
  color: #ffffff;
  padding: 54px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 42px;
}

.login-brand::after {
  content: "";
  position: absolute;
  inset: auto -120px -160px auto;
  width: 360px;
  height: 360px;
  border: 45px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

.brand-lockup,
.sidebar-brand,
.login-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-lockup strong,
.sidebar-brand strong {
  display: block;
  font-size: 1.8rem;
  line-height: 1;
  letter-spacing: 0.02em;
}

.brand-lockup span,
.sidebar-brand span {
  display: block;
  font-size: 1.25rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
}

.seal-mark,
.mark {
  width: 62px;
  height: 62px;
  border: 4px solid #ffffff;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 35% 28%, #ff535d, var(--primary) 62%, var(--primary-dark));
  color: #ffffff;
  font-weight: 900;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
}

.brand-logo {
  width: 86px;
  height: 64px;
  border: 2px solid rgba(255, 255, 255, 0.86);
  border-radius: 8px;
  background: #050505;
  object-fit: cover;
  object-position: center;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
}

.compact-logo {
  width: 74px;
  height: 54px;
  border-color: #f1d7d8;
  box-shadow: 0 6px 14px rgba(196, 0, 11, 0.15);
}

.sidebar-logo {
  width: 82px;
  height: 62px;
}

.small-mark {
  width: 48px;
  height: 48px;
  border-width: 3px;
}

.login-brand h1 {
  position: relative;
  margin: 30px 0 16px;
  max-width: 640px;
  font-size: clamp(2.2rem, 4.2vw, 4.25rem);
  line-height: 1.02;
}

.login-brand p {
  position: relative;
  max-width: 570px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.08rem;
  line-height: 1.6;
}

.brand-pills {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.brand-pills span {
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  padding: 8px 12px;
  color: #ffffff;
  font-size: 0.88rem;
  background: rgba(255, 255, 255, 0.08);
}

.cfe-tag {
  position: relative;
  font-weight: 800;
  font-style: italic;
  color: #ffffff;
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 32px;
}

.password-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 20%, rgba(227, 6, 19, 0.13), transparent 32%),
    linear-gradient(135deg, #f7f7f7, #ffffff);
}

.password-card {
  width: min(100%, 520px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.password-card h1 {
  margin: 0;
  font-size: 1.55rem;
}

.password-card p {
  margin: 6px 0 0;
}

.login-card {
  width: min(100%, 500px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 30px;
}

.login-card h2,
.section-title h2,
.admin-section h3 {
  margin: 0;
}

.login-card p,
.section-title p {
  color: var(--muted);
  line-height: 1.55;
}

.form-grid {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 7px;
}

.field span,
.field label {
  font-weight: 750;
  font-size: 0.92rem;
}

.field input,
.field textarea,
.field select,
.search-box input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  padding: 11px 12px;
  min-height: 44px;
}

.field textarea {
  min-height: 120px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.search-box input:focus,
button:focus-visible {
  outline: 3px solid rgba(227, 6, 19, 0.18);
  border-color: var(--accent);
}

.btn {
  min-height: 42px;
  border: 1px solid var(--primary);
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--primary-strong));
  color: #ffffff;
  padding: 10px 16px;
  font-weight: 800;
  box-shadow: 0 6px 14px rgba(196, 0, 11, 0.18);
}

.btn:hover {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.btn.secondary {
  background: #ffffff;
  color: var(--primary);
  box-shadow: none;
}

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

.btn.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--primary);
  box-shadow: none;
}

.btn.small {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 0.88rem;
}

.link-btn {
  border: 0;
  background: transparent;
  color: var(--primary);
  padding: 4px 0;
  font-weight: 850;
}

.centered {
  justify-self: center;
  margin-top: 8px;
}

.demo-box {
  margin-top: 8px;
  border: 1px dashed #f0b5b9;
  border-radius: 8px;
  padding: 14px;
  color: var(--muted);
  background: #fffafa;
  font-size: 0.92rem;
}

.demo-box strong {
  color: var(--text);
}

.alert {
  border-radius: 8px;
  padding: 11px 12px;
  background: var(--danger-soft);
  color: var(--primary-strong);
  border: 1px solid #f3b9bd;
  font-weight: 750;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
}

.drawer-backdrop {
  display: none;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background:
    radial-gradient(circle at 55% 20%, rgba(196, 0, 11, 0.22), transparent 28%),
    linear-gradient(160deg, #030506, #090d10 54%, #000000);
  color: #ffffff;
  padding: 28px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.sidebar-brand {
  padding: 0 10px;
}

.sidebar-brand .seal-mark {
  width: 72px;
  height: 72px;
}

.sidebar-subtitle {
  margin: -4px 18px 12px 94px;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.35;
}

.sidebar-subtitle strong {
  display: block;
  margin-bottom: 4px;
  color: #ffffff;
  font-size: 0.86rem;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-btn {
  width: 100%;
  min-height: 52px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  text-align: left;
  font-weight: 700;
}

.nav-btn span {
  width: 26px;
  min-width: 26px;
  text-align: center;
  color: #ffffff;
  font-weight: 900;
}

.nav-btn:hover,
.nav-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--primary-strong));
  color: #ffffff;
  box-shadow: var(--red-shadow);
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 16px;
  padding: 26px 18px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.32);
}

.main {
  min-width: 0;
  padding: 28px 30px 34px;
}

.topbar {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.topbar-title {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.mobile-portal-hero {
  display: none;
}

.mobile-hero-row,
.mobile-brand-lockup,
.mobile-quick-actions {
  display: flex;
  align-items: center;
}

.mobile-hero-row {
  justify-content: space-between;
  gap: 10px;
}

.mobile-brand-lockup {
  min-width: 0;
  gap: 12px;
}

.mobile-brand-lockup strong {
  display: block;
  font-size: 1.55rem;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.mobile-brand-lockup span {
  display: block;
  margin-top: 3px;
  font-size: 0.9rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}

.mobile-quick-actions {
  justify-content: flex-end;
  gap: 8px;
}

.mobile-icon-btn {
  position: relative;
  width: 50px;
  min-width: 50px;
  height: 50px;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #ffffff;
  color: var(--primary-strong);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.mobile-icon-btn span {
  display: grid;
  place-items: center;
}

.mobile-menu-btn {
  display: none;
  position: relative;
  width: 82px;
  min-width: 82px;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  color: var(--primary);
  font-weight: 900;
  transition:
    background 0.24s ease,
    border-color 0.24s ease,
    color 0.24s ease,
    transform 0.24s ease,
    box-shadow 0.24s ease;
}

.hero-menu-btn {
  min-width: 82px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.mobile-menu-btn span {
  display: none;
}

.mobile-menu-btn::after {
  content: "Menú";
}

.drawer-open .mobile-menu-btn span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.drawer-open .mobile-menu-btn span:nth-child(2) {
  opacity: 0;
}

.drawer-open .mobile-menu-btn span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.drawer-open .mobile-menu-btn {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--primary-strong));
  color: #ffffff;
  transform: translateX(2px);
  box-shadow: 0 12px 24px rgba(196, 0, 11, 0.26);
}

.drawer-open .mobile-menu-btn span {
  background: #ffffff;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(1.6rem, 2vw, 2.35rem);
  line-height: 1.1;
}

.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  min-width: min(100%, 620px);
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 220px;
}

.search-box span {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.35rem;
  color: #111111;
}

.search-box input {
  min-height: 52px;
  padding-left: 48px;
  border-radius: 999px;
}

.notification-btn,
.user-chip {
  min-height: 56px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  box-shadow: var(--shadow);
}

.notification-btn {
  position: relative;
  width: 58px;
  display: grid;
  place-items: center;
  color: var(--primary);
  font-weight: 900;
}

.notification-btn span {
  display: grid;
  place-items: center;
}

.notification-btn svg,
.user-chip svg,
.mobile-icon-btn svg,
.feature-icon svg,
.nav-btn svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notification-btn strong,
.mobile-icon-btn strong {
  position: absolute;
  right: 6px;
  top: 5px;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: #ffffff;
  font-size: 0.75rem;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px 8px 10px;
}

.user-chip.icon-only {
  width: 58px;
  min-width: 58px;
  display: grid;
  place-items: center;
  padding: 0;
}

.avatar {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary-strong);
  color: #ffffff;
  font-size: 0.85rem;
}

.content {
  display: grid;
  gap: 18px;
  animation: content-enter 0.26s ease both;
}

@keyframes content-enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-banner {
  min-height: 180px;
  border-radius: 8px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(220px, 0.42fr);
  align-items: center;
  gap: 28px;
  padding: 28px 34px;
  color: #ffffff;
  background:
    linear-gradient(90deg, rgba(125, 0, 8, 0.95), rgba(196, 0, 11, 0.86)),
    radial-gradient(circle at 82% 32%, rgba(255, 255, 255, 0.2), transparent 34%);
  box-shadow: var(--red-shadow);
  overflow: hidden;
}

.hero-icon,
.suggestion-icon {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(90, 0, 6, 0.55);
  color: #ffffff;
  font-size: 3rem;
  font-weight: 900;
}

.hero-banner h2 {
  margin: 0 0 8px;
  font-size: clamp(1.7rem, 2.5vw, 2.6rem);
}

.hero-banner p {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.45;
}

.hero-quote {
  max-width: 290px;
  padding-left: 18px;
  border-left: 3px solid #ffffff;
  font-weight: 700;
}

.feature-grid,
.stats-grid,
.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.cards-grid,
.stats-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.feature-card,
.card,
.stat-card,
.notice-card,
.admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.feature-card button {
  width: 100%;
  min-height: 128px;
  border: 0;
  background: transparent;
  color: var(--text);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 20px;
  text-align: left;
}

.feature-card strong {
  display: block;
  margin-bottom: 8px;
}

.feature-card small {
  display: block;
  color: #4d4d4d;
  line-height: 1.45;
}

.feature-card b,
.row-arrow,
.document-row b {
  color: var(--primary);
  font-size: 1.85rem;
  line-height: 1;
}

.feature-icon,
.suggestion-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--danger-soft);
  color: var(--primary);
  font-size: 2rem;
  font-weight: 900;
}

.feature-icon svg,
.suggestion-icon svg {
  width: 34px;
  height: 34px;
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.1fr) minmax(320px, 1fr) minmax(280px, 0.82fr);
  gap: 16px;
  align-items: start;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.78fr);
  gap: 16px;
  align-items: start;
}

.card,
.notice-card,
.admin-card {
  padding: 18px;
}

.stat-card {
  padding: 18px;
}

.stat-card span {
  color: var(--muted);
  font-weight: 700;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  color: var(--primary-strong);
  font-size: 2rem;
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.section-title h2 {
  position: relative;
  padding-bottom: 10px;
}

.section-title h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 34px;
  height: 3px;
  background: var(--primary);
  border-radius: 999px;
}

.section-title p {
  margin: 8px 0 0;
}

.list {
  display: grid;
  gap: 12px;
}

.notice-card {
  display: grid;
  gap: 10px;
}

.notice-card h3,
.notice-card p,
.news-list-item h3,
.news-list-item p,
.event-row h3,
.event-row p {
  margin: 0;
}

.notice-card p,
.news-list-item p {
  line-height: 1.55;
}

.news-list-item {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.news-list-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.news-thumb {
  display: block;
  width: 100%;
  height: 82px;
  border-radius: 8px;
  object-fit: cover;
  background:
    linear-gradient(145deg, rgba(196, 0, 11, 0.1), rgba(196, 0, 11, 0.24)),
    linear-gradient(135deg, #e7e7e7, #ffffff);
  border: 1px solid var(--border);
}

.notice-image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 8;
  border: 1px solid var(--border);
  border-radius: 8px;
  object-fit: cover;
  background: #f1f1f1;
}

.news-gallery {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(240px, 82%);
  gap: 10px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: inline mandatory;
  padding-bottom: 4px;
}

.news-gallery .gallery-image {
  scroll-snap-align: start;
}

.event-row {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.date-badge {
  min-height: 70px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--danger-soft);
  color: var(--primary);
}

.date-badge strong {
  font-size: 1.75rem;
  line-height: 1;
}

.date-badge span {
  margin-top: -12px;
  font-weight: 900;
}

.row-arrow {
  border: 0;
  background: transparent;
  font-weight: 900;
}

.right-rail {
  display: grid;
  gap: 16px;
}

.suggestion-panel {
  display: grid;
  gap: 18px;
  justify-items: center;
  text-align: center;
}

.suggestion-panel .btn {
  width: 100%;
}

.document-list {
  display: grid;
  gap: 0;
}

.document-row {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  text-align: left;
  text-decoration: none;
}

.document-row span {
  color: var(--primary);
  font-weight: 900;
}

.document-detail-card {
  align-content: start;
}

.attached-documents {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.download-row {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fffafa;
}

.download-row small {
  color: var(--muted);
  font-weight: 750;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  width: fit-content;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--muted);
  padding: 5px 9px;
  font-size: 0.82rem;
  font-weight: 800;
}

.pill.local {
  color: var(--primary);
  border-color: #ffc4c8;
  background: var(--danger-soft);
}

.pill.nacional {
  color: #ffffff;
  border-color: var(--primary);
  background: var(--primary);
}

.pill.published {
  color: var(--success);
  border-color: rgba(25, 135, 84, 0.22);
  background: #eefaf3;
}

.pill.draft {
  color: var(--warning);
  border-color: rgba(173, 111, 0, 0.22);
  background: #fff8e8;
}

.status-nueva {
  color: var(--primary);
}

.status-en-revision {
  color: var(--warning);
}

.status-atendida {
  color: var(--success);
}

.meta {
  color: var(--muted);
  font-size: 0.88rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.empty {
  padding: 20px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: #fffafa;
  color: var(--muted);
}

.admin-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.admin-tab {
  white-space: nowrap;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  padding: 10px 12px;
  font-weight: 800;
}

.admin-tab.active {
  color: #ffffff;
  border-color: var(--primary);
  background: var(--primary);
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.42fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.admin-stack {
  display: grid;
  gap: 16px;
}

.security-list {
  display: grid;
  gap: 10px;
}

.security-list article {
  display: grid;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fffafa;
  padding: 12px;
}

.security-list span {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.compact-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.restore-form {
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.access-card {
  border-color: #ffc4c8;
  box-shadow: 0 12px 24px rgba(196, 0, 11, 0.08);
}

.admin-section {
  display: grid;
  gap: 14px;
}

.worker-list-header {
  align-items: center;
}

.worker-filter-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(150px, 1fr));
  gap: 10px;
  align-items: end;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.worker-search-field input {
  min-width: 0;
}

.compact-list {
  display: grid;
  gap: 10px;
}

.compact-item {
  display: grid;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 13px;
  background: #ffffff;
}

.compact-item strong {
  overflow-wrap: anywhere;
}

.access-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  color: var(--muted);
  font-size: 0.84rem;
}

.access-meta-grid span {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fffafa;
  padding: 8px;
  line-height: 1.35;
}

.access-meta-grid strong {
  display: block;
  color: var(--text);
  margin-bottom: 2px;
}

.inline-fields {
  display: grid;
  grid-template-columns: minmax(160px, 0.35fr) minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.42fr) minmax(0, 1fr);
  gap: 16px;
}

.profile-card {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 16px;
}

.profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: #ffffff;
  font-size: 2.4rem;
  font-weight: 900;
}

.footer-note {
  color: var(--muted);
  font-size: 0.86rem;
}

.file-field input {
  padding: 9px;
}

.image-preview-box {
  display: grid;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fffafa;
  padding: 10px;
}

.document-preview-box {
  display: grid;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fffafa;
  padding: 10px;
}

.document-preview-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.document-preview-item:last-of-type {
  border-bottom: 0;
  padding-bottom: 0;
}

.document-preview-item > span:first-child {
  color: var(--primary);
  font-weight: 900;
}

.document-preview-item strong {
  overflow-wrap: anywhere;
}

.document-preview-item small {
  color: var(--muted);
  font-weight: 750;
}

.image-preview-box img,
.admin-item-image {
  display: block;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  object-fit: cover;
  background: #f1f1f1;
}

.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.image-preview-item {
  display: grid;
  gap: 8px;
}

.image-preview-box img {
  max-height: 180px;
}

.admin-item-image {
  max-height: 120px;
}

.check-field {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-weight: 750;
}

.check-field input {
  width: auto;
}

.import-feedback {
  border-radius: 8px;
  padding: 11px 12px;
  font-weight: 750;
  line-height: 1.45;
}

.import-feedback.success {
  border: 1px solid #bfe8cf;
  background: #eefaf3;
  color: var(--success);
}

.import-feedback.error {
  border: 1px solid #f3b9bd;
  background: var(--danger-soft);
  color: var(--primary-strong);
}

.reservations-layout {
  align-items: start;
}

.reservation-request-card,
.reservation-calendar-card {
  min-width: 0;
}

.availability-strip,
.whatsapp-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.whatsapp-links {
  margin-top: 10px;
}

.availability-pill,
.mini-status {
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
}

.availability-pill {
  padding: 9px 11px;
}

.availability-pill.available,
.mini-status.available {
  color: var(--success);
  border-color: rgba(19, 125, 63, 0.24);
  background: #eefaf3;
}

.availability-pill.busy,
.mini-status.busy {
  color: var(--primary-strong);
  border-color: rgba(196, 0, 11, 0.22);
  background: var(--danger-soft);
}

.reservation-calendar-toolbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.reservation-calendar-toolbar strong {
  text-align: center;
  text-transform: capitalize;
}

.reservation-weekdays,
.reservation-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.reservation-weekdays {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-align: center;
}

.reservation-day {
  min-height: 92px;
  display: grid;
  gap: 6px;
  align-content: start;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  padding: 9px;
  text-align: left;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.reservation-day:hover {
  border-color: rgba(196, 0, 11, 0.35);
  box-shadow: 0 8px 18px rgba(196, 0, 11, 0.12);
  transform: translateY(-1px);
}

.reservation-day.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(196, 0, 11, 0.12);
}

.reservation-day.past {
  opacity: 0.52;
}

.empty-day {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.mini-status {
  width: fit-content;
  padding: 5px 7px;
}

.reservation-item .actions {
  margin-top: 2px;
}

.whatsapp-btn {
  text-decoration: none;
}

@media (max-width: 1260px) {
  .feature-grid,
  .home-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .right-rail {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .worker-filter-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1260px) {
  .login-page,
  .app-shell,
  .two-col,
  .admin-layout,
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: min(86vw, 330px);
    height: 100dvh;
    opacity: 0.7;
    filter: blur(2px);
    transform: translateX(-112%) scale(0.97);
    transform-origin: left center;
    transition:
      transform 0.42s cubic-bezier(0.16, 1, 0.3, 1),
      opacity 0.28s ease,
      filter 0.32s ease,
      box-shadow 0.32s ease;
    box-shadow: none;
    will-change: transform, opacity, filter;
  }

  .drawer-open .sidebar {
    opacity: 1;
    filter: blur(0);
    transform: translateX(0) scale(1);
    box-shadow: 22px 0 60px rgba(0, 0, 0, 0.34);
    animation: drawer-panel-pop 0.46s cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: block;
    border: 0;
    background:
      radial-gradient(circle at 18% 18%, rgba(227, 6, 19, 0.26), transparent 34%),
      rgba(0, 0, 0, 0.48);
    opacity: 0;
    pointer-events: none;
    backdrop-filter: blur(0);
    transition:
      opacity 0.28s ease,
      backdrop-filter 0.28s ease;
  }

  .drawer-open .drawer-backdrop {
    opacity: 1;
    pointer-events: auto;
    backdrop-filter: blur(4px);
  }

  .drawer-open .sidebar-brand,
  .drawer-open .sidebar-subtitle,
  .drawer-open .nav-btn,
  .drawer-open .sidebar-footer {
    animation: drawer-item-rise 0.42s cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .drawer-open .sidebar-brand {
    animation-delay: 0.07s;
  }

  .drawer-open .sidebar-subtitle {
    animation-delay: 0.11s;
  }

  .drawer-open .nav-btn:nth-child(1) {
    animation-delay: 0.15s;
  }

  .drawer-open .nav-btn:nth-child(2) {
    animation-delay: 0.18s;
  }

  .drawer-open .nav-btn:nth-child(3) {
    animation-delay: 0.21s;
  }

  .drawer-open .nav-btn:nth-child(4) {
    animation-delay: 0.24s;
  }

  .drawer-open .nav-btn:nth-child(5) {
    animation-delay: 0.27s;
  }

  .drawer-open .nav-btn:nth-child(6) {
    animation-delay: 0.3s;
  }

  .drawer-open .nav-btn:nth-child(7) {
    animation-delay: 0.33s;
  }

  .drawer-open .nav-btn:nth-child(8) {
    animation-delay: 0.36s;
  }

  .drawer-open .nav-btn:nth-child(9) {
    animation-delay: 0.39s;
  }

  .drawer-open .nav-btn:nth-child(10) {
    animation-delay: 0.42s;
  }

  .nav-list {
    grid-template-columns: 1fr;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    align-items: stretch;
    flex-direction: column;
    padding: 12px 0;
    background: rgba(246, 246, 246, 0.94);
    backdrop-filter: blur(10px);
  }

  .topbar-actions {
    min-width: 0;
  }

  .mobile-menu-btn {
    display: inline-flex;
    position: relative;
    z-index: 45;
  }
}

@keyframes drawer-panel-pop {
  0% {
    opacity: 0.75;
    transform: translateX(-112%) scale(0.97);
  }

  72% {
    transform: translateX(8px) scale(1);
  }

  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes drawer-item-rise {
  from {
    opacity: 0;
    transform: translateX(-14px) translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateX(0) translateY(0);
  }
}

@keyframes mobile-hero-crystal-in {
  0% {
    opacity: 0;
    transform: translateY(-18px) scale(0.98);
    filter: saturate(0.8);
  }

  70% {
    opacity: 1;
    transform: translateY(2px) scale(1);
    filter: saturate(1.18);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: saturate(1);
  }
}

@keyframes mobile-hero-title-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes mobile-hero-item-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes mobile-card-rise {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar,
  .drawer-backdrop,
  .mobile-menu-btn,
  .mobile-menu-btn span,
  .content,
  .mobile-portal-hero,
  .mobile-brand-lockup,
  .mobile-quick-actions,
  .mobile-portal-hero h2,
  .feature-card,
  .drawer-open .sidebar,
  .drawer-open .sidebar-brand,
  .drawer-open .sidebar-subtitle,
  .drawer-open .nav-btn,
  .drawer-open .sidebar-footer {
    animation: none;
    transition: none;
  }
}

@media (max-width: 760px) {
  .login-brand,
  .login-panel,
  .main,
  .sidebar {
    padding: 18px;
  }

  .main {
    padding: 0 18px 28px;
  }

  .brand-lockup strong,
  .sidebar-brand strong {
    font-size: 1.45rem;
  }

  .brand-lockup span,
  .sidebar-brand span {
    font-size: 1rem;
  }

  .mobile-portal-hero {
    display: grid;
    position: sticky;
    top: 0;
    z-index: 25;
    gap: 14px;
    margin: 0 -18px;
    padding: 12px 14px 16px;
    color: #ffffff;
    background:
      radial-gradient(circle at 82% 18%, rgba(227, 6, 19, 0.42), transparent 34%),
      linear-gradient(145deg, rgba(6, 7, 7, 0.88) 0%, rgba(17, 17, 17, 0.82) 48%, rgba(109, 0, 6, 0.78) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(16px) saturate(1.2);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
    animation: mobile-hero-crystal-in 0.72s cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .mobile-portal-hero .compact-logo {
    width: 58px;
    height: 44px;
    border-color: rgba(255, 255, 255, 0.84);
  }

  .mobile-portal-hero h2 {
    margin: 0;
    max-width: 680px;
    font-size: clamp(1.5rem, 6.5vw, 2.15rem);
    line-height: 1.06;
    letter-spacing: 0;
    animation: mobile-hero-title-in 0.66s cubic-bezier(0.16, 1, 0.3, 1) 0.16s both;
  }

  .mobile-brand-lockup {
    gap: 10px;
    animation: mobile-hero-item-in 0.56s ease 0.08s both;
  }

  .mobile-quick-actions {
    animation: mobile-hero-item-in 0.56s ease 0.14s both;
  }

  .mobile-brand-lockup strong {
    font-size: 1.28rem;
  }

  .mobile-brand-lockup span {
    font-size: 0.74rem;
    letter-spacing: 0.28em;
  }

  .mobile-icon-btn {
    width: 46px;
    min-width: 46px;
    height: 46px;
  }

  .mobile-icon-btn svg {
    width: 23px;
    height: 23px;
  }

  .hero-menu-btn {
    width: 74px;
    min-width: 74px;
    height: 46px;
    padding: 0 12px;
  }

  .hero-banner,
  .feature-grid,
  .home-grid,
  .right-rail,
  .stats-grid,
  .cards-grid,
  .nav-list,
  .inline-fields,
  .worker-filter-panel,
  .access-meta-grid,
  .image-preview-grid {
    grid-template-columns: 1fr;
  }

  .reservation-calendar,
  .reservation-weekdays {
    gap: 4px;
  }

  .reservation-day {
    min-height: 74px;
    padding: 6px;
  }

  .mini-status {
    width: 100%;
    padding: 4px 3px;
    font-size: 0.64rem;
    text-align: center;
  }

  .reservation-calendar-toolbar {
    grid-template-columns: 1fr;
  }

  .news-gallery {
    grid-auto-columns: minmax(220px, 88%);
  }

  .document-preview-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .document-preview-item small,
  .document-preview-item .check-field {
    grid-column: 2;
  }

  .hero-banner {
    padding: 22px;
  }

  .hero-quote {
    border-left: 0;
    padding-left: 0;
  }

  .topbar {
    position: static;
    min-height: 0;
    align-items: stretch;
    gap: 18px;
    margin: 0 0 22px;
    padding: 26px 0 0;
    background: transparent;
    backdrop-filter: none;
  }

  .topbar-title {
    display: block;
  }

  .topbar-title .mobile-menu-btn,
  .topbar-actions .notification-btn,
  .topbar-actions .user-chip,
  .desktop-nav-item {
    display: none;
  }

  .topbar h1 {
    color: var(--primary-dark);
    font-size: clamp(2rem, 8vw, 2.75rem);
  }

  .topbar p {
    color: #1b1b1b;
    font-size: 1.12rem;
  }

  .topbar-actions {
    flex-wrap: wrap;
    gap: 0;
  }

  .search-box {
    flex-basis: 100%;
    min-width: 0;
  }

  .search-box input {
    min-height: 58px;
    font-size: 1.1rem;
  }

  .feature-grid {
    gap: 14px;
  }

  .feature-card {
    animation: mobile-card-rise 0.54s cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .feature-card:nth-child(1) {
    animation-delay: 0.12s;
  }

  .feature-card:nth-child(2) {
    animation-delay: 0.2s;
  }

  .feature-card:nth-child(3) {
    animation-delay: 0.28s;
  }

  .feature-card:nth-child(4) {
    animation-delay: 0.36s;
  }

  .feature-card:nth-child(5) {
    animation-delay: 0.44s;
  }

  .feature-card button {
    min-height: 150px;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 18px;
    padding: 24px;
  }

  .feature-card strong {
    margin-bottom: 6px;
    font-size: 1.35rem;
  }

  .feature-card small {
    font-size: 1rem;
  }

  .feature-card b {
    grid-column: 2;
    justify-self: start;
    font-size: 2rem;
  }

  .feature-icon {
    width: 78px;
    height: 78px;
  }

  .feature-icon svg {
    width: 38px;
    height: 38px;
  }

  .section-title {
    flex-direction: column;
    align-items: stretch;
  }

  .news-list-item {
    grid-template-columns: 1fr;
  }

  .news-thumb {
    height: 120px;
  }
}
