:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #17211d;
  background: #edf4ef;
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; overflow-x: hidden; background: radial-gradient(circle at 10% 0, #d4ecde, transparent 35%), #f4f7f3; }
button, input, select, textarea { font: inherit; }
button, .button, input, select, textarea { touch-action: manipulation; }
.shell {
  width: min(1120px, calc(100% - 32px));
  margin: auto;
  padding:
    max(48px, env(safe-area-inset-top))
    env(safe-area-inset-right)
    max(40px, env(safe-area-inset-bottom))
    env(safe-area-inset-left);
}
.hidden { display: none !important; }
.login-wrap { min-height: calc(100vh - 96px); display: grid; grid-template-columns: 1.2fr .8fr; align-items: center; gap: 48px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-family: Georgia, serif; font-size: clamp(3rem, 7vw, 5.5rem); font-weight: 500; letter-spacing: 0; }
h2 { margin-bottom: 22px; font-size: 1.35rem; }
.brand-logo {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .12em;
  line-height: .94;
}
.brand-plus-mark {
  display: inline-grid;
  place-items: center;
  width: .74em;
  height: .74em;
  margin-right: .02em;
  border-radius: .24em;
  background:
    radial-gradient(circle at 28% 22%, rgba(255,255,255,.7), rgba(255,255,255,0) 26%),
    linear-gradient(135deg, #062719 0%, #0b4a31 45%, #063d68 100%);
  color: #fff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: .62em;
  font-weight: 950;
  line-height: 1;
  text-shadow: 0 1px 3px rgba(0,0,0,.24);
  transform: translateY(-.08em);
  box-shadow:
    0 14px 30px rgba(5, 45, 32, .34),
    inset 0 0 0 1px rgba(255,255,255,.24),
    inset 0 -10px 18px rgba(0,0,0,.18);
}
.brand-services {
  background: linear-gradient(135deg, #061f15 0%, #0d3b28 45%, #082719 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 1px 0 rgba(255,255,255,.18), 0 8px 24px rgba(8, 39, 25, .16);
}
.brand-plus {
  background: linear-gradient(135deg, #053a66 0%, #075f99 42%, #032c4e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 1px 0 rgba(255,255,255,.18), 0 8px 24px rgba(3, 44, 78, .16);
}
.brand-tagline {
  margin: -2px 0 12px;
  color: #385146;
  font-size: clamp(.92rem, 1.5vw, 1.08rem);
  font-weight: 750;
  letter-spacing: .01em;
}
.lede { color: #58675f; font-size: 1.1rem; }
.eyebrow { margin-bottom: 8px; color: #4a725c; font-size: .73rem; font-weight: 850; letter-spacing: 0; text-transform: uppercase; }
.card { padding: 28px; border: 1px solid #dbe4de; border-radius: 20px; background: rgba(255,255,255,.94); box-shadow: 0 14px 40px rgba(32,65,45,.07); }
.card.compact { max-width: 430px; width: 100%; justify-self: end; }
form { display: grid; gap: 17px; }
label { display: grid; gap: 7px; color: #34423a; font-size: .87rem; font-weight: 750; }
input, select, textarea { width: 100%; min-height: 48px; padding: 0 13px; border: 1px solid #c9d6ce; border-radius: 11px; background: #fbfdfb; color: #17211d; outline: 0; font-size: 16px; }
textarea { min-height: 132px; padding-block: 13px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: #347952; box-shadow: 0 0 0 4px rgba(52,121,82,.12); }
.password-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.password-row input { min-width: 0; }
.password-row button { min-height: 48px; }
button, .button { min-height: 46px; padding: 0 18px; border: 0; border-radius: 11px; background: #235f40; color: #fff; font-weight: 800; text-decoration: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
button:hover, .button:hover { background: #194b32; }
button:disabled { opacity: .5; cursor: not-allowed; }
.verified-button { gap: 7px; }
.verified-icon { width: 16px; height: 16px; flex: 0 0 auto; }
.secondary { background: #e8efea; color: #284435; }
.secondary:hover { background: #dce8e0; }
.danger { background: #f6e2e2; color: #8a2929; }
.danger:hover { background: #efd0d0; }
.small { min-height: 36px; padding: 0 12px; font-size: .8rem; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 24px; }
.topbar h1 { font-size: clamp(2.5rem, 6vw, 4.4rem); }
.account { display: flex; align-items: center; gap: 16px; padding-top: 8px; text-align: right; }
.account strong, .account span { display: block; }
.account span { color: #6c7871; font-size: .8rem; }
.metric { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; padding: 18px 22px; border-radius: 16px; background: #173e2a; color: white; }
.metric > div { display: grid; gap: 4px; min-width: 0; }
.metric strong { font-size: 2.2rem; line-height: 1; }
.metric small { color: #bfd1c5; }
.tabs { display: flex; gap: 8px; margin-bottom: 18px; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: none; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { background: transparent; color: #526159; white-space: nowrap; }
.tabs button { scroll-snap-align: start; flex: 0 0 auto; }
.tabs button.active { background: #dce9e0; color: #214d34; }
.tab-panel > .card, .split { margin-bottom: 18px; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 22px; }
.section-heading h2 { margin-bottom: 0; }
.status-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 18px; padding: 5px; border: 1px solid #d8e4dc; border-radius: 13px; background: #f4f8f5; }
.mode-switch button { min-height: 42px; background: transparent; color: #526159; }
.mode-switch button.active { background: #235f40; color: #fff; }
.batch-summary { display: grid; gap: 8px; padding: 16px; border: 1px solid #d8e4dc; border-radius: 13px; background: #f6faf7; color: #526159; }
.batch-summary strong { color: #17211d; }
.batch-summary span { font-size: .9rem; }
.batch-summary small { color: #748078; line-height: 1.5; }
.success-panel { display: grid; gap: 8px; padding: 14px 16px; border: 1px solid #cce2d3; border-radius: 13px; background: #eaf6ee; color: #235f40; }
.success-panel span { color: #526159; }
.success-panel button { justify-self: start; margin-top: 4px; }
.maintenance-panel { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; margin-bottom: 18px; padding: 16px; border: 1px solid #f0dca4; border-radius: 15px; background: #fff8e6; color: #604915; }
.maintenance-panel strong { display: block; margin-bottom: 5px; color: #604915; }
.maintenance-panel p { margin-bottom: 12px; color: #604915; line-height: 1.45; }
.maintenance-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; background: #fff0c9; font-size: 1.45rem; }
.notice-panel { border-color: #cfe0d5; background: #edf6f0; color: #24563c; }
.notice-panel strong, .notice-panel p { color: #24563c; }
.notice-panel .maintenance-icon { background: #dceee3; }
.estimate-panel { padding: 12px 14px; margin-bottom: 14px; }
.estimate-panel .maintenance-icon { width: 36px; height: 36px; font-size: 1.1rem; }
.estimate-panel strong { margin-bottom: 3px; }
.estimate-panel p { margin-bottom: 2px; font-weight: 750; }
.estimate-panel small { color: #5c7267; font-size: .78rem; }
#actas-estimate-panel { display: block; margin-bottom: 10px; padding: 7px 10px; border-radius: 10px; }
#actas-estimate-panel.hidden { display: none !important; }
#actas-estimate-panel p { margin: 0; font-size: .78rem; font-weight: 800; line-height: 1.25; }
#actas-estimate-panel small { display: block; margin-top: 2px; font-size: .66rem; line-height: 1.2; }
.admin-controls { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; margin-bottom: 18px; padding: 14px; border: 1px solid #dce4df; border-radius: 14px; background: #f7fbf8; }
.admin-controls textarea { width: 100%; resize: vertical; }
.admin-controls label { font-size: .84rem; }
.admin-controls select { min-height: 42px; padding-block: 0; }
.admin-controls textarea { min-height: 72px; padding-block: 10px; }
.admin-controls button { min-height: 42px; padding-inline: 16px; }
#actas-admin-controls { grid-template-columns: 1fr; gap: 9px; padding: 10px 12px; }
.actas-provider-status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; color: #607168; font-size: .78rem; }
.actas-provider-status strong { color: #174c32; font-size: .8rem; }
.actas-notice-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.actas-notice-row label { gap: 4px; font-size: .78rem; }
#actas-admin-controls #actas-notice-input { min-height: 42px; max-height: 90px; padding: 9px 11px; line-height: 1.25; }
.actas-notice-row button { min-height: 42px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.checkbox { grid-template-columns: auto 1fr; align-items: center; font-weight: 550; }
.checkbox input { width: 18px; min-height: 18px; }
.acta-folio-option { display: inline-grid; grid-template-columns: auto auto; justify-content: start; gap: 8px; margin: 2px 0 6px; color: #315443; font-size: .9rem; }
.acta-folio-option input { accent-color: #0d6b45; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 7px 10px; font-size: .72rem; font-weight: 850; white-space: nowrap; }
.badge.pending { background: #fff0c9; color: #785714; }
.badge.completed { background: #dff3e5; color: #23603a; }
.badge.failed { background: #f9dede; color: #842d2d; }
dl { margin: 0 0 22px; }
dl div { display: grid; grid-template-columns: 130px 1fr; padding: 10px 0; border-bottom: 1px solid #edf0ed; }
dt { color: #6b7770; } dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.actions, .user-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.error-text { color: #a22e2e; margin-bottom: 0; }
.help { margin: -4px 0 0; color: #6c7871; font-size: .8rem; line-height: 1.5; }
.curp-format-hint {
  margin: 8px 0 0;
  padding: 9px 11px;
  border-radius: 12px;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .01em;
}
.curp-format-hint.valid {
  border: 1px solid rgba(31, 112, 72, .18);
  background: rgba(223, 243, 229, .72);
  color: #1f7048;
}
.curp-format-hint.invalid {
  border: 1px solid rgba(162, 46, 46, .18);
  background: rgba(249, 222, 222, .58);
  color: #a22e2e;
}
#acta-curp-batch-field textarea {
  min-height: 48px;
  max-height: 180px;
  resize: vertical;
  overflow-y: auto;
}
#acta-batch-summary {
  display: block;
  margin-top: 6px;
  color: #526159;
  font-size: 13px;
}
.split { display: grid; grid-template-columns: minmax(280px, .75fr) minmax(400px, 1.25fr); gap: 18px; align-items: start; }
.users-list { display: grid; gap: 12px; }
.users-panel { border-top: 0; }
.users-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
  padding: 10px;
  border: 1px solid #dbe7df;
  border-radius: 18px;
  background: linear-gradient(135deg, #f6fbf7, #edf6f0);
}
.users-toolbar button {
  min-height: 40px;
  border-radius: 999px;
  box-shadow: none;
}
.users-toolbar .primary-action {
  background: #173f2b;
  color: #fff;
  box-shadow: 0 10px 24px rgba(23, 63, 43, .14);
}
.users-toolbar .active {
  background: #dfeee5;
  color: #153e2a;
  box-shadow: inset 0 0 0 1px #c7dfd0;
}

.api-client-form { display: grid; grid-template-columns: minmax(220px, 1fr) 180px auto; gap: 12px; align-items: end; margin-bottom: 16px; }
.api-key-panel { margin: 12px 0 18px; padding: 14px; border: 1px solid #e7c979; border-radius: 14px; background: #fff9e8; }
.api-key-panel p { margin: 3px 0 10px; color: #675a34; font-size: .82rem; }
.api-key-panel code { display: block; margin-bottom: 10px; padding: 10px; overflow-wrap: anywhere; border-radius: 9px; background: #fff; color: #153c2c; }
.api-client-actions { display: flex; flex-wrap: wrap; gap: 6px; min-width: 240px; }
.api-client-actions button { padding: 7px 9px; font-size: .74rem; }

@media (max-width: 760px) {
  .api-client-form { grid-template-columns: 1fr; }
}
.compact-form { margin-bottom: 18px; box-shadow: none; }
.users-table-controls { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 14px; }
.users-table-controls label { display: flex; align-items: center; gap: 8px; }
.users-table-controls select { width: 78px; }
.users-table-controls input { width: min(260px, 100%); }
.users-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; color: #526159; font-size: .86rem; }
.pagination { display: flex; align-items: center; gap: 6px; }
.pagination button { min-width: 36px; min-height: 36px; padding: 0 10px; }
.pagination button.active { background: #235f40; color: #fff; }
.pagination-dots { padding: 0 6px; color: #748078; }
.status-dot { display: inline-block; width: 15px; height: 15px; border-radius: 999px; box-shadow: inset 0 -2px 4px rgba(0,0,0,.18); }
.status-dot.active { background: #21d039; }
.status-dot.inactive { background: #e11f1f; }
.table-actions { display: flex; gap: 8px; align-items: center; }
.icon-action {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  border: 1px solid #dce7e0;
  border-radius: 11px;
  background: #f7fbf8;
  color: #204d36;
  font-size: 1rem;
  line-height: 1;
}
.icon-action:hover { background: #e8f2ec; transform: translateY(-1px); }
.icon-edit { color: #245f42; }
.icon-pause { color: #b83a3a; }
.icon-resume { color: #1f8d3a; }
.icon-delete { color: #9d2727; background: #fff6f4; border-color: #f0d1cc; }
.icon-delete:hover { background: #fde7e3; }
.modal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 18px; background: rgba(15, 28, 22, .48); }
.modal-card { width: min(760px, 100%); max-height: min(92dvh, 900px); overflow: auto; padding: 26px; border: 1px solid #dbe4de; border-radius: 20px; background: #fff; box-shadow: 0 24px 70px rgba(13, 31, 21, .22); }
.compact-modal { width: min(690px, 100%); padding: 22px; border-radius: 24px; }
.modal-heading { margin-bottom: 16px; }
.compact-grid { gap: 12px; }
.modal-card label {
  gap: 6px;
  font-size: .78rem;
}
.modal-card input,
.modal-card select {
  min-height: 42px;
}
.field-hint {
  display: block;
  margin-top: -2px;
  color: #748078;
  font-size: .7rem;
  font-weight: 550;
  line-height: 1.35;
  text-transform: none;
  letter-spacing: 0;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}
.modal-actions button { min-width: 132px; }
.user-item { padding: 16px; border: 1px solid #e1e7e3; border-radius: 13px; background: #fbfcfb; }
.user-item > div:first-child { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.user-item p { color: #647168; font-size: .82rem; margin: 8px 0 12px; }
.user-actions input { width: 92px; min-height: 36px; }
.table-wrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .85rem; }
th, td { padding: 12px 10px; border-bottom: 1px solid #e9eeea; text-align: left; white-space: nowrap; }
th { color: #657169; font-size: .72rem; text-transform: uppercase; letter-spacing: 0; }
td a { color: #22633f; font-weight: 750; }
.empty { color: #748078; text-align: center; padding: 28px 0 6px; }
.week-picker { min-width: 245px; }
.weekly-summary { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid #dce4df; border-radius: 14px 14px 0 0; overflow: hidden; }
.weekly-summary > div { display: grid; gap: 7px; padding: 22px; text-align: center; border-right: 1px solid #dce4df; }
.weekly-summary > div:last-child { border-right: 0; }
.weekly-summary span { color: #68756d; font-size: .77rem; text-transform: uppercase; }
.weekly-summary strong { font-size: 1.65rem; }
.weekly-summary small { color: #22633f; font-weight: 800; }
.period-banner { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 16px; padding: 18px 24px; border-radius: 0 0 14px 14px; background: #75aa47; color: #fff; }
.period-banner strong { grid-row: span 2; font-size: 2rem; }
.period-banner span { font-weight: 800; }
.period-banner small { color: #eff7e9; }
.period-banner b { color: #fff; }
.weekly-groups { display: grid; gap: 18px; }
.weekly-group-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 18px; }
.weekly-group-heading h3 { margin: 0; font-size: 1.15rem; }
.group-total { display: grid; text-align: right; }
.group-total strong { color: #235f40; font-size: 1.8rem; }
.group-total span { color: #6b7770; font-size: .75rem; }
.group-total small { color: #22633f; font-weight: 800; }
.own-downloads { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 14px; margin-bottom: 14px; padding: 13px 15px; border-radius: 10px; background: #edf4ef; }
.own-downloads span { color: #526159; font-size: .84rem; }
.own-downloads strong { font-size: 1.25rem; }
.own-downloads small { flex-basis: 100%; color: #6b7770; }
.credit-editor { display: grid; grid-template-columns: minmax(128px, 1fr) auto; gap: 8px; align-items: end; }
.credit-editor label { font-size: .75rem; }
.credit-editor input { width: 100%; min-height: 36px; }
.password-editor { grid-column: 1 / -1; }
.muted { color: #758078; text-align: center; }

@media (max-width: 920px) {
  .split { grid-template-columns: 1fr; }
  .login-wrap { gap: 32px; }
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 24px, 680px);
    padding-top: max(24px, env(safe-area-inset-top));
  }
  .login-wrap, .split { grid-template-columns: 1fr; }
  .login-wrap { min-height: calc(100dvh - 48px); align-content: center; gap: 24px; }
  .card.compact { justify-self: stretch; max-width: none; }
  .topbar { display: block; }
  .topbar h1 { font-size: clamp(2.65rem, 13vw, 4.2rem); }
  .account { justify-content: space-between; padding-top: 0; text-align: left; }
  .account > div { min-width: 0; }
  .account strong { overflow-wrap: anywhere; }
  .metric { padding: 16px 18px; }
  .tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-inline: 0;
    padding-inline: 0;
    overflow: visible;
    scroll-snap-type: none;
  }
  .tabs button {
    width: 100%;
    min-width: 0;
    white-space: normal;
    text-align: center;
  }
  .grid { grid-template-columns: 1fr; }
  .weekly-summary { grid-template-columns: 1fr; }
  .weekly-summary > div { border-right: 0; border-bottom: 1px solid #dce4df; }
  .weekly-summary > div:last-child { border-bottom: 0; }
  .section-heading { flex-direction: column; }
  .week-picker { width: 100%; }
  .week-picker select { width: 100%; }
  .weekly-group-heading { align-items: center; }
  .card { padding: 22px; border-radius: 17px; }
  .actions > button, .actions > .button { flex: 1 1 170px; }
}

@media (max-width: 600px) {
  .shell { width: min(100% - 20px, 540px); }
  .brand h1 { font-size: clamp(2.7rem, 15vw, 4rem); }
  .brand .lede { font-size: 1rem; }
  .card { padding: 18px; border-radius: 15px; }
  .tabs { gap: 4px; }
  .tabs button { min-height: 44px; padding-inline: 14px; }
  .mode-switch { grid-template-columns: 1fr; }
  .maintenance-panel { grid-template-columns: 1fr; }
  .admin-controls { grid-template-columns: 1fr; }
  .actas-notice-row { grid-template-columns: 1fr; }
  .users-table-controls, .users-footer { display: grid; grid-template-columns: 1fr; }
  .users-table-controls label { display: grid; align-items: stretch; }
  .users-table-controls select, .users-table-controls input { width: 100%; }
  .pagination { flex-wrap: wrap; }
  .section-heading { margin-bottom: 18px; }
  .section-heading .badge { align-self: flex-start; }
  dl div { grid-template-columns: 1fr; gap: 4px; }
  .period-banner { grid-template-columns: 1fr; gap: 3px; text-align: center; }
  .period-banner strong { grid-row: auto; }
  .weekly-group-heading { align-items: flex-start; }
  .group-total { flex: 0 0 auto; }
  .own-downloads { gap: 14px; }
  .user-item > div:first-child { align-items: flex-start; }
  .user-item > div:first-child strong { min-width: 0; overflow-wrap: anywhere; }
  .user-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .user-actions input { width: 100%; min-height: 44px; }
  .user-actions button { width: 100%; min-height: 44px; }
  .credit-editor, .password-row { grid-template-columns: 1fr; }

  .table-wrap { overflow: visible; }
  table, thead, tbody, tr, th, td { display: block; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  tbody { display: grid; gap: 12px; }
  tr { padding: 12px 14px; border: 1px solid #e1e7e3; border-radius: 12px; background: #fbfcfb; }
  td {
    display: grid;
    grid-template-columns: minmax(92px, .8fr) minmax(0, 1.2fr);
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #e9eeea;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  td:last-child { border-bottom: 0; }
  td::before {
    content: attr(data-label);
    color: #657169;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
  }
  td[colspan] { display: block; }
  td[colspan]::before { display: none; }
}

@media (max-width: 390px) {
  .shell { width: calc(100% - 16px); }
  .card { padding: 16px; }
  .topbar h1 { font-size: 2.65rem; }
  .account { gap: 10px; }
  .metric { grid-template-columns: 1fr; }
  .metric strong { font-size: 1.85rem; }
  .tabs { grid-template-columns: 1fr; }
  .user-actions { grid-template-columns: 1fr; }
  .weekly-group-heading { flex-direction: column; }
  .group-total { text-align: left; }
  button, .button { padding-inline: 14px; }
}

@media (hover: none) {
  button:hover, .button:hover { background: #235f40; }
  .secondary:hover { background: #e8efea; }
  .danger:hover { background: #f6e2e2; }
}

/* Modern visual refresh: capa estetica, sin tocar logica ni estructura */
:root {
  --ink: #10231b;
  --muted: #64746c;
  --surface: rgba(255, 255, 255, .82);
  --surface-strong: rgba(255, 255, 255, .94);
  --line: rgba(26, 79, 58, .13);
  --primary: #146a4b;
  --primary-dark: #0b3f2f;
  --primary-soft: #dff4ea;
  --accent: #2f7df6;
  --accent-2: #7c4dff;
  --gold: #f5bd3d;
  --danger-ink: #9a2f2f;
  --danger-bg: #fff0ee;
  --shadow-sm: 0 10px 28px rgba(15, 49, 36, .08);
  --shadow-md: 0 22px 70px rgba(15, 49, 36, .14);
  --radius-lg: 26px;
  color: var(--ink);
  background: #edf8f3;
}

html { background: #edf8f3; }

body {
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(circle at 8% 4%, rgba(47, 125, 246, .16), transparent 27%),
    radial-gradient(circle at 88% 0%, rgba(124, 77, 255, .14), transparent 28%),
    radial-gradient(circle at 82% 82%, rgba(20, 106, 75, .20), transparent 34%),
    linear-gradient(135deg, #f7fbff 0%, #eaf7f2 45%, #f9f4e8 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  pointer-events: none;
  filter: blur(2px);
}

body::before {
  inset: 0;
  background-image:
    linear-gradient(rgba(16, 35, 27, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 35, 27, .035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.8), transparent 72%);
}

body::after {
  width: 360px;
  height: 360px;
  right: -120px;
  top: 160px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(245, 189, 61, .22), rgba(20, 106, 75, .16));
}

.shell {
  position: relative;
  z-index: 1;
}

h1 {
  color: var(--ink);
  letter-spacing: -.045em;
  line-height: .92;
}

.brand h1,
.topbar h1 {
  background: linear-gradient(120deg, #10231b 0%, #126446 45%, #2f7df6 110%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

h2 {
  color: #0d1d16;
  letter-spacing: -.025em;
}

.lede,
.help,
.account span,
.muted,
.empty {
  color: var(--muted);
}

.eyebrow {
  color: #16714f;
  letter-spacing: .14em;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(145deg, rgba(255,255,255,.95), rgba(255,255,255,.74)),
    radial-gradient(circle at 0% 0%, rgba(47, 125, 246, .07), transparent 36%);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(18px);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card.compact {
  box-shadow: 0 24px 80px rgba(15, 49, 36, .16);
}

input,
select,
textarea {
  border-color: rgba(20, 106, 75, .18);
  border-radius: 15px;
  background: rgba(255,255,255,.78);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
}

input:hover,
select:hover,
textarea:hover {
  border-color: rgba(20, 106, 75, .32);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(47, 125, 246, .65);
  box-shadow:
    0 0 0 4px rgba(47, 125, 246, .12),
    0 12px 28px rgba(15, 49, 36, .08);
  background: #fff;
}

button,
.button {
  border-radius: 15px;
  background: linear-gradient(135deg, #177553, #0e4f3a);
  box-shadow: 0 12px 28px rgba(20, 106, 75, .18);
  transition:
    transform .16s ease,
    box-shadow .16s ease,
    background .16s ease,
    border-color .16s ease;
}

button:hover,
.button:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #1d845e, #0d4433);
  box-shadow: 0 16px 34px rgba(20, 106, 75, .23);
}

button:active,
.button:active {
  transform: translateY(0);
}

button:disabled {
  transform: none;
  box-shadow: none;
}

.secondary {
  border: 1px solid rgba(20, 106, 75, .12);
  background: rgba(255,255,255,.68);
  color: #214939;
  box-shadow: 0 8px 22px rgba(15, 49, 36, .07);
}

.secondary:hover {
  background: #eef8f3;
  color: #123b2c;
}

.danger {
  border: 1px solid rgba(154, 47, 47, .15);
  background: var(--danger-bg);
  color: var(--danger-ink);
  box-shadow: none;
}

.danger:hover {
  background: #ffe4df;
  color: #842424;
}

.topbar {
  align-items: center;
  padding: 16px 18px;
  border: 1px solid rgba(20, 106, 75, .10);
  border-radius: 30px;
  background: rgba(255,255,255,.42);
  box-shadow: 0 14px 46px rgba(15, 49, 36, .08);
  backdrop-filter: blur(18px);
}

.account {
  padding-top: 0;
}

.account strong {
  color: #0c2118;
}

.metric {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.38);
  border-radius: 24px;
  background:
    radial-gradient(circle at 92% 12%, rgba(245, 189, 61, .34), transparent 26%),
    linear-gradient(135deg, #0d3b2d 0%, #13694b 48%, #235e84 100%);
  box-shadow: 0 20px 60px rgba(13, 59, 45, .2);
}

.metric::after {
  content: "";
  position: absolute;
  inset: auto -30px -60px auto;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: rgba(255,255,255,.10);
}

.metric > div {
  position: relative;
  z-index: 1;
}

.metric span {
  color: rgba(255,255,255,.82);
}

.metric small {
  color: rgba(255,255,255,.68);
}

.tabs {
  gap: 10px;
  padding: 8px;
  border: 1px solid rgba(20, 106, 75, .11);
  border-radius: 22px;
  background: rgba(255,255,255,.52);
  box-shadow: 0 14px 34px rgba(15, 49, 36, .07);
  backdrop-filter: blur(16px);
}

.tabs button {
  border-radius: 16px;
  background: transparent;
  color: #53665d;
  box-shadow: none;
}

.tabs button:hover {
  background: rgba(255,255,255,.74);
  color: #123b2c;
  box-shadow: none;
}

.tabs button.active {
  background: linear-gradient(135deg, #173f2f, #197553);
  color: #fff;
  box-shadow: 0 12px 26px rgba(20, 106, 75, .20);
}

.mode-switch {
  padding: 6px;
  border-color: rgba(20, 106, 75, .13);
  border-radius: 18px;
  background: rgba(255,255,255,.62);
}

.mode-switch button {
  border-radius: 13px;
  box-shadow: none;
}

.mode-switch button.active {
  background: linear-gradient(135deg, #146a4b, #0c4735);
  box-shadow: 0 10px 24px rgba(20, 106, 75, .17);
}

.batch-summary,
.success-panel,
.maintenance-panel,
.notice-panel,
.admin-controls,
.own-downloads,
.user-item {
  border-color: rgba(20, 106, 75, .12);
  border-radius: 18px;
  background: rgba(255,255,255,.62);
  box-shadow: 0 10px 28px rgba(15, 49, 36, .06);
}

.success-panel {
  background: linear-gradient(135deg, rgba(223, 246, 233, .92), rgba(240, 252, 246, .78));
}

.maintenance-panel {
  background: linear-gradient(135deg, rgba(255, 248, 226, .95), rgba(255,255,255,.74));
}

.notice-panel {
  background: linear-gradient(135deg, rgba(232, 246, 238, .95), rgba(255,255,255,.72));
}

.maintenance-icon {
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(245, 189, 61, .25), rgba(255,255,255,.7));
}

.badge {
  border: 1px solid transparent;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55);
}

.badge.pending {
  border-color: rgba(245, 189, 61, .25);
  background: linear-gradient(135deg, #fff3cd, #fff8e8);
}

.badge.completed {
  border-color: rgba(20, 106, 75, .18);
  background: linear-gradient(135deg, #dff6e8, #eefaf3);
}

.badge.failed {
  border-color: rgba(154, 47, 47, .16);
  background: linear-gradient(135deg, #ffe0df, #fff2f0);
}

.users-toolbar {
  border-color: rgba(20, 106, 75, .12);
  background:
    radial-gradient(circle at 0% 0%, rgba(47, 125, 246, .10), transparent 34%),
    linear-gradient(135deg, rgba(255,255,255,.72), rgba(232,246,238,.70));
  box-shadow: 0 12px 30px rgba(15, 49, 36, .06);
}

.users-toolbar .primary-action {
  background: linear-gradient(135deg, #0e513d, #16875e);
}

.users-toolbar .active {
  background: linear-gradient(135deg, #e3f4eb, #f6fbf8);
  color: #123b2c;
}

.users-table-controls {
  padding: 12px;
  border: 1px solid rgba(20, 106, 75, .10);
  border-radius: 18px;
  background: rgba(255,255,255,.50);
}

.table-wrap {
  border: 1px solid rgba(20, 106, 75, .10);
  border-radius: 20px;
  background: rgba(255,255,255,.58);
}

table {
  border-collapse: separate;
  border-spacing: 0;
}

th {
  color: #496358;
  background: rgba(242, 249, 245, .84);
}

th:first-child { border-top-left-radius: 18px; }
th:last-child { border-top-right-radius: 18px; }

td {
  border-bottom-color: rgba(20, 106, 75, .09);
}

tbody tr {
  transition: background .16s ease;
}

tbody tr:hover {
  background: rgba(232, 246, 238, .46);
}

td a {
  color: #116448;
}

.pagination button {
  border: 1px solid rgba(20, 106, 75, .12);
  background: rgba(255,255,255,.70);
  color: #264c3b;
  box-shadow: none;
}

.pagination button.active {
  background: linear-gradient(135deg, #146a4b, #0c4735);
  color: #fff;
}

.status-dot.active {
  background: radial-gradient(circle at 35% 30%, #a8ffb7, #19b644 58%, #0d7e2b);
}

.status-dot.inactive {
  background: radial-gradient(circle at 35% 30%, #ffb4b4, #e12232 58%, #a30f1c);
}

.icon-action {
  background: rgba(255,255,255,.72);
  box-shadow: 0 8px 18px rgba(15, 49, 36, .06);
}

.icon-action:hover {
  box-shadow: 0 12px 24px rgba(15, 49, 36, .10);
}

.modal {
  background:
    radial-gradient(circle at 20% 10%, rgba(47, 125, 246, .18), transparent 36%),
    rgba(10, 24, 18, .56);
  backdrop-filter: blur(10px);
}

.modal-card {
  border-color: rgba(255,255,255,.44);
  border-radius: 28px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.96), rgba(247,251,248,.88)),
    radial-gradient(circle at 0% 0%, rgba(47, 125, 246, .09), transparent 34%);
  box-shadow: 0 34px 100px rgba(7, 24, 17, .30);
}

.weekly-summary {
  border-color: rgba(20, 106, 75, .11);
  border-radius: 22px 22px 0 0;
  background: rgba(255,255,255,.62);
}

.weekly-summary > div {
  border-right-color: rgba(20, 106, 75, .10);
  background:
    linear-gradient(145deg, rgba(255,255,255,.72), rgba(244,251,247,.58));
}

.weekly-summary strong,
.group-total strong {
  color: #125f43;
}

.period-banner {
  border-radius: 0 0 22px 22px;
  background:
    radial-gradient(circle at 95% 0%, rgba(245, 189, 61, .34), transparent 30%),
    linear-gradient(135deg, #146a4b, #6ca943);
  box-shadow: 0 18px 48px rgba(20, 106, 75, .16);
}

.weekly-group-heading h3 {
  letter-spacing: -.02em;
}

.credit-editor input {
  border-radius: 13px;
}

::selection {
  background: rgba(47, 125, 246, .22);
}

@media (max-width: 760px) {
  .topbar {
    padding: 14px;
    border-radius: 22px;
  }

  .tabs {
    border-radius: 18px;
  }

  .tabs button {
    border-radius: 13px;
  }

  .card {
    border-radius: 22px;
  }
}

@media (max-width: 600px) {
  .users-table-controls {
    padding: 10px;
  }

  .table-wrap {
    border: 0;
    background: transparent;
  }

  tr {
    border-color: rgba(20, 106, 75, .12);
    border-radius: 18px;
    background: rgba(255,255,255,.72);
    box-shadow: 0 10px 24px rgba(15, 49, 36, .06);
  }
}

@media (hover: none) {
  button:hover,
  .button:hover {
    transform: none;
    background: linear-gradient(135deg, #177553, #0e4f3a);
  }

  .secondary:hover {
    background: rgba(255,255,255,.68);
  }

  .danger:hover {
    background: var(--danger-bg);
  }
}
