:root {
  --bg: #f4efe6;
  --panel: #fffaf2;
  --panel-strong: #ffffff;
  --ink: #1f2937;
  --muted: #5b6472;
  --line: rgba(31, 41, 55, 0.12);
  --brand: #1f8fce;
  --brand-soft: #dceffd;
  --accent: #4aa8dd;
  --shadow: 0 24px 60px rgba(38, 29, 19, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(208, 107, 45, 0.18), transparent 24%),
    radial-gradient(circle at bottom right, rgba(31, 143, 206, 0.16), transparent 28%),
    var(--bg);
}

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

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

.hero-panel {
  width: 352px;
  min-width: 352px;
  max-width: 352px;
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  background:
    linear-gradient(180deg, rgba(44, 164, 230, 0.96), rgba(25, 117, 178, 0.98)),
    #2c9fe0;
  color: #f4f8f6;
}

.brand-pill {
  width: 100%;
  padding: 0;
  border-radius: 0;
  background: transparent;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-panel h1 {
  margin: 16px 0 0;
  max-width: none;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.75rem, 2.1vw, 2.8rem);
  line-height: 0.94;
  text-transform: lowercase;
}

.hero-copy {
  display: flex;
  align-items: flex-start;
  min-height: auto;
  padding-top: 24px;
}

.side-nav {
  display: grid;
  gap: 10px;
  margin-top: 34px;
}

.side-nav a {
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 16px;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.15;
  text-decoration: none;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.12);
}

.side-nav a:hover,
.side-nav a.active {
  background: #ffffff;
  color: #176f9f;
}

.info-card,
.auth-card,
.modal-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.modal-card h3 {
  margin: 10px 0 8px;
  font-size: 1.15rem;
}

.workspace-panel {
  flex: 1;
  padding: 40px;
}

.dashboard-panel {
  overflow: auto;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

#loginView.active {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 80px);
  isolation: isolate;
}

#loginView.active::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      30deg,
      transparent 0 26px,
      rgba(0, 0, 0, 0.06) 26px 28px,
      transparent 28px 54px
    ),
    repeating-linear-gradient(
      150deg,
      transparent 0 26px,
      rgba(0, 0, 0, 0.06) 26px 28px,
      transparent 28px 54px
    ),
    repeating-linear-gradient(
      90deg,
      transparent 0 46px,
      rgba(0, 0, 0, 0.03) 46px 48px,
      transparent 48px 94px
    );
  background-size: 220px 190px, 220px 190px, 220px 190px;
  background-position: 28px 20px, 28px 20px, 28px 20px;
  opacity: 0.35;
  z-index: -1;
}

#loginView.active::after {
  content: none;
}

#loginView .login-logo-wrap {
  width: min(560px, 100%);
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}

#loginView .login-logo {
  width: min(520px, 100%);
  height: auto;
  max-height: 260px;
  object-fit: contain;
  filter: drop-shadow(0 20px 34px rgba(31, 143, 206, 0.22));
}

.panel-header,
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.panel-header {
  margin-bottom: 28px;
}

.eyebrow,
.card-label {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.76rem;
  font-weight: 800;
}

.eyebrow {
  color: var(--accent);
}

.coop-label {
  margin-bottom: 10px;
  color: var(--muted);
}

.panel-header h2 {
  margin: 8px 0 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.9rem, 4vw, 3rem);
}

.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.auth-card,
.info-card,
.modal-card {
  background: var(--panel-strong);
}

.auth-card,
.receiver-form {
  display: grid;
  gap: 16px;
}

.auth-card {
  width: min(460px, 100%);
  max-width: 460px;
  padding: 28px;
}

.alert-error,
.alert-success {
  padding: 14px 16px;
  border-radius: 16px;
  font-size: 0.95rem;
  font-weight: 700;
}

.alert-error {
  background: #fff1f1;
  border: 1px solid #f4c7c7;
  color: #a43f3f;
}

.alert-success {
  margin-bottom: 20px;
  background: #eefaf4;
  border: 1px solid #cbe9d6;
  color: #1f7a49;
}

label {
  display: grid;
  gap: 8px;
  font-size: 0.95rem;
  color: var(--muted);
}

input,
select {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffdf9;
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 92px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  width: 74px;
  padding: 8px 10px;
  border: 0;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  transform: translateY(-50%);
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.whatsapp-btn,
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease;
  text-decoration: none;
}

.primary-btn:hover,
.secondary-btn:hover,
.ghost-btn:hover,
.whatsapp-btn:hover,
.icon-btn:hover {
  transform: translateY(-1px);
}

.primary-btn {
  padding: 14px 18px;
  background: linear-gradient(135deg, var(--brand), #176f9f);
  color: #ffffff;
  font-weight: 800;
}

.secondary-btn,
.ghost-btn,
.whatsapp-btn {
  padding: 12px 16px;
  font-weight: 700;
}

.secondary-btn {
  background: var(--brand-soft);
  color: var(--brand);
}

.ghost-btn {
  background: #f8f2e8;
  color: var(--ink);
}

.whatsapp-btn {
  width: fit-content;
  background: #e8f8ee;
  color: #167c3f;
}

.list-card-link {
  color: inherit;
  text-decoration: none;
}

.selected-card {
  border-color: rgba(23, 111, 159, 0.95);
  background: #f2fbff;
  box-shadow:
    inset 0 0 0 2px rgba(23, 111, 159, 0.72),
    0 10px 24px rgba(23, 111, 159, 0.16);
}

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

.disabled-btn {
  opacity: 0.65;
  cursor: default;
}

.icon-btn {
  width: 42px;
  height: 42px;
  background: #f3ede3;
  font-size: 1.6rem;
}

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

.dashboard-grid.single-view {
  grid-template-columns: 1fr;
}

.receiver-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.info-card {
  padding: 24px;
}

.form-card {
  max-width: 760px;
}

.file-inputs {
  display: grid;
  gap: 12px;
}

.file-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.file-row input[type="file"] {
  flex: 1;
}

.remove-file-btn {
  white-space: nowrap;
}

.accent-card {
  background: linear-gradient(180deg, #fff8ef, #fff);
}

.wide-card {
  grid-column: 1 / -1;
}

.list-stack,
.table-like {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.list-item,
.payment-row {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.list-item h3,
.payment-row h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.item-meta,
.muted-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.expediente-line {
  font-weight: 800;
  color: var(--ink);
}

.status-pill {
  display: inline-flex;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.status-recibida {
  background: var(--brand-soft);
  color: var(--brand);
}

.status-liquidacion {
  background: #ffe6bf;
  color: #b26500;
}

.status-pagado {
  background: #dff3e6;
  color: #248a4b;
}

.payment-row {
  display: grid;
  grid-template-columns: 1.2fr auto;
  gap: 16px;
  align-items: center;
}

.button-row {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.item-actions {
  display: flex;
  margin-top: 12px;
}

.start-row {
  justify-content: flex-start;
}

.receiver-form {
  margin-top: 18px;
}

.empty-copy {
  margin-top: 18px;
}

.admin-card {
  margin-top: 20px;
}

.admin-divider {
  height: 1px;
  margin: 24px 0;
  background: var(--line);
}

.uploaded-files-box {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
}

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

.file-link {
  justify-content: flex-start;
  text-align: left;
}

.selected-summary {
  display: grid;
  gap: 6px;
}

.is-hidden {
  display: none;
}

.admin-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
}

.inline-alert {
  margin-top: 18px;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(15, 21, 31, 0.45);
  padding: 20px;
}

.hidden {
  display: none;
}

.modal-card {
  width: min(560px, 100%);
  padding: 24px;
}

@media (max-width: 1080px) {
  .dashboard-grid,
  .receiver-layout {
    grid-template-columns: 1fr;
  }

  .admin-form {
    grid-template-columns: 1fr;
  }

  .app-shell {
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero-panel {
    width: auto;
    min-width: 0;
    max-width: none;
  }

  .hero-panel h1 {
    max-width: 100%;
  }

  .workspace-panel {
    padding: 24px;
  }
}

@media (max-width: 720px) {
  .hero-panel {
    padding: 28px 24px;
  }

  .payment-row {
    grid-template-columns: 1fr;
  }

  .file-row,
  .button-row,
  .header-actions {
    flex-direction: column;
    align-items: stretch;
  }
}
