:root {
  --ink: #1A1B1B;
  --ink-soft: #4D4452;
  --muted: #7C7A85;
  --border: #E6E5E7;
  --border-soft: #F1EFF4;
  --bg: #FAFAFB;
  --bg-deep: #F1EDF7;
  --white: #ffffff;
  --brand: #6614F1;
  --brand-dark: #4C0FB8;
  --brand-darker: #2B0680;
  --brand-light: #F0D0FC;
  --brand-soft: #C2A6F9;
  --coral: #FD373E;
  --coral-dark: #C5242A;
  --coral-light: #FEE0E2;
  --gold: #F8DA20;
  --gold-light: #FEF8D1;
  --info: #0FD6F7;
  --info-light: #D9F6FD;
  --teal: #0B606F;
  --teal-light: #B5F6FF;
  --danger: #FD373E;
  --danger-light: #FEE0E2;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 26px;
  --r-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(26, 27, 27, .06), 0 1px 1px rgba(26, 27, 27, .04);
  --shadow-md: 0 10px 24px -10px rgba(26, 27, 27, .20);
  --shadow-lg: 0 24px 60px -16px rgba(26, 27, 27, .32);
  --font-body: "Poppins", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
}

input,
select,
textarea {
  font-family: inherit;
}

::selection {
  background: var(--brand-light);
  color: var(--brand-darker);
}

.hidden {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}

#login-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(680px 480px at 12% -6%, #F0D0FC 0%, transparent 60%),
    radial-gradient(560px 460px at 108% 18%, #B5F6FF 0%, transparent 55%),
    radial-gradient(700px 560px at 50% 118%, #FCFBD6 0%, transparent 60%),
    var(--bg);
  padding: 24px;
}

#login-screen::before,
#login-screen::after {
  content: "";
  position: absolute;
  border-radius: 44% 56% 62% 38% / 48% 42% 58% 52%;
  filter: blur(2px);
  opacity: .55;
  z-index: 0;
}

#login-screen::before {
  width: 340px;
  height: 340px;
  top: -90px;
  left: -110px;
  background: linear-gradient(135deg, #C2A6F9, #F0D0FC);
}

#login-screen::after {
  width: 280px;
  height: 280px;
  bottom: -100px;
  right: -90px;
  background: linear-gradient(135deg, #FEE0E2, #F4DCCC);
}

.brand-title {
  position: relative;
  z-index: 1;
  color: var(--brand-darker);
  font-size: 44px;
  font-weight: 700;
  margin: 0 0 2px 0;
  letter-spacing: -0.5px;
}

.brand-sub {
  position: relative;
  z-index: 1;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin: 0 0 30px 0;
}

.login-card {
  position: relative;
  z-index: 1;
  background: var(--white);
  border-radius: var(--r-xl);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-lg);
  padding: 40px 40px 34px;
  width: 100%;
  max-width: 420px;
  animation: card-rise .5s cubic-bezier(.2, .8, .2, 1);
}

@keyframes card-rise {
  from {
    opacity: 0;
    transform: translateY(14px) scale(.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-card h2 {
  text-align: center;
  margin: 0 0 6px 0;
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
}

.login-card .hint {
  text-align: center;
  color: var(--ink-soft);
  font-size: 13px;
  margin-bottom: 26px;
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 7px;
}

.field .req {
  color: var(--coral-dark);
}

.input-wrap {
  position: relative;
}

.field input,
.field select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  font-size: 15px;
  color: var(--ink);
  background: var(--bg);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.field input:focus,
.field select:focus {
  border-color: var(--brand);
  background: var(--white);
  box-shadow: 0 0 0 4px var(--brand-light);
}

.field .subtext {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.toggle-eye {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: var(--muted);
  user-select: none;
  font-size: 16px;
}

.btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--border);
  color: var(--muted);
  border: none;
  border-radius: var(--r-md);
  font-size: 15px;
  font-weight: 700;
  cursor: not-allowed;
  transition: all .18s ease;
  margin-top: 6px;
}

.btn-primary.active {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 8px 20px -8px rgba(102, 20, 241, .55);
}

.btn-primary.active:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px -10px rgba(102, 20, 241, .6);
}

.role-tabs {
  display: flex;
  background: var(--bg-deep);
  border-radius: var(--r-pill);
  padding: 4px;
  margin-bottom: 26px;
}

.role-tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: all .18s ease;
}

.role-tab.active {
  background: var(--white);
  color: var(--brand-dark);
  box-shadow: var(--shadow-sm);
}

#app-screen {
  display: none;
  min-height: 100vh;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 232px;
  background: var(--white);
  border-right: 1px solid var(--border-soft);
  flex-shrink: 0;
  padding: 0 12px 16px;
}

.sidebar .logo {
  padding: 22px 10px 18px;
  font-weight: 700;
  color: var(--brand-darker);
  font-size: 20px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border-soft);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  margin: 3px 0;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--r-md);
  border-left: none;
  transition: background .15s ease, color .15s ease;
}

.nav-item .ic {
  font-size: 14px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--bg);
  flex-shrink: 0;
}

.nav-item:hover {
  background: var(--bg);
  color: var(--ink);
}

.nav-item.active {
  background: var(--brand-light);
  color: var(--brand-darker);
  font-weight: 700;
}

.nav-item.active .ic {
  background: var(--brand);
  color: #fff;
}

.main-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  background: #6614F1;
  color: #fff;
  padding: 18px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .1px;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--coral), var(--gold));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
  transition: transform .15s ease;
}

.avatar:hover {
  transform: scale(1.06);
}

.content {
  padding: 28px 32px 40px;
  flex: 1;
}

.content h2.page-title {
  margin: 0 0 20px 0;
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
}

.card {
  background: var(--white);
  border-radius: var(--r-lg);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-sm);
  padding: 24px 26px;
}

.card+.card {
  margin-top: 18px;
}

.welcome-card {
  background: white;
}

.welcome-card h3 {
  margin: 0 0 8px 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--brand-darker);
}

.welcome-card p {
  color: var(--ink-soft);
  margin: 0 0 14px 0;
}

.welcome-card ul {
  margin: 0;
  padding-left: 20px;
  color: var(--ink-soft);
  line-height: 2;
}

.welcome-card ul li::marker {
  color: var(--brand);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 22px;
}

.form-grid.cols-3 {
  grid-template-columns: 1fr 1fr auto;
}

.form-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 7px;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.form-field textarea {
  resize: vertical;
  min-height: 80px;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--white);
  box-shadow: 0 0 0 4px var(--brand-light);
}

.btn-green {
  background: #fd373e;
  color: #fff;
  border: none;
  padding: 13px 22px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-green:disabled {
  background: var(--border);
  color: var(--muted);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn-outline {
  background: var(--white);
  color: var(--brand-dark);
  border: 1.5px solid var(--border);
  padding: 12px 20px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}

.btn-outline:hover {
  border-color: var(--brand);
  background: var(--brand-light);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 18px;
}

.breadcrumb .bc-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--white);
  border: 1px solid var(--border-soft);
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease;
}

.breadcrumb .bc-item:hover {
  background: var(--brand-light);
}

.breadcrumb .bc-item.current {
  background: var(--brand-light);
  color: var(--brand-darker);
  cursor: default;
  font-weight: 700;
}

.breadcrumb .bc-item.current:hover {
  background: var(--brand-light);
}

.breadcrumb .sep {
  color: var(--muted);
  font-weight: 700;
}

.subscriber-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--white);
  border: 1px solid var(--border-soft);
  border-left: 4px solid var(--brand);
  border-radius: var(--r-lg);
  padding: 16px 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}

.subscriber-bar.inactive {
  border-left-color: var(--danger);
}

.subscriber-bar .sb-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  flex-shrink: 0;
}

.subscriber-bar.inactive .sb-avatar {
  background: linear-gradient(135deg, var(--danger), #B71C22);
}

.subscriber-bar .sb-info {
  flex: 1 1 260px;
  min-width: 0;
}

.subscriber-bar .sb-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.subscriber-bar .sb-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--ink-soft);
}

.subscriber-bar .sb-actions {
  flex-shrink: 0;
}

.state-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: var(--r-pill);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .2px;
}

.state-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.state-pill.activa {
  background: var(--teal-light);
  color: var(--teal);
}

.state-pill.inactiva {
  background: var(--danger-light);
  color: var(--danger);
}

.inactive-note {
  background: var(--danger-light);
  color: #8F1B20;
  padding: 14px 18px;
  border-radius: var(--r-md);
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-mini-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.section-mini-header .smh-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.section-mini-header .smh-sub {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-top: 3px;
}

.camp-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 22px;
}

.ben-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px 20px;
}

.ben-card .c-title {
  font-weight: 700;
  font-size: 14.5px;
  color: var(--ink);
  margin-bottom: 5px;
}

.ben-card .c-meta {
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.6;
}

.ben-card .c-right {
  text-align: right;
  flex-shrink: 0;
}

.ben-card .c-off {
  font-size: 22px;
  font-weight: 700;
  color: var(--brand-dark);
  line-height: 1;
}

.action-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.action-row .grow {
  flex: 1;
}

.empty-state {
  text-align: center;
  padding: 54px 20px;
  color: var(--muted);
}

.empty-state .icon {
  font-size: 30px;
  margin-bottom: 14px;
  width: 62px;
  height: 62px;
  line-height: 62px;
  border-radius: 50%;
  background: var(--bg-deep);
  display: inline-block;
}

.promo-box {
  position: relative;
  border: 1.5px dashed var(--brand-soft);
  border-radius: var(--r-lg);
  padding: 22px 26px;
  margin-bottom: 22px;
  overflow: visible;
}

.promo-box::before,
.promo-box::after {
  content: "";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  background: var(--bg);
  border: 1.5px dashed var(--brand-soft);
  border-radius: 50%;
}

.promo-box::before {
  left: -12px;
}

.promo-box::after {
  right: -12px;
}

.promo-box .promo-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}

.promo-box .promo-title {
  font-weight: 700;
  font-size: 15.5px;
  color: var(--brand-darker);
}

.promo-box .promo-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.promo-box .promo-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 13.5px;
  color: var(--ink);
}

.promo-box .promo-list li:last-child {
  border-bottom: none;
}

.promo-box .promo-list li .lt {
  font-weight: 700;
}

.promo-box .promo-list li .lr {
  font-weight: 800;
  color: var(--brand-dark);
}

.check-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  box-shadow: 0 3px 8px -2px rgba(102, 20, 241, .5);
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 20px;
  max-width: 620px;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--border);
  transition: transform .15s ease, box-shadow .15s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card .s-label {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 7px;
}

.stat-card .s-value {
  font-size: 28px;
  font-weight: 800;
}

.stats-row .stat-card:nth-child(1) {
  border-left-color: var(--brand);
}

.stats-row .stat-card:nth-child(2) {
  border-left-color: var(--coral);
}

.s-camp {
  color: var(--brand-dark);
}

.s-red {
  color: var(--coral-dark);
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
}

table.data-table th {
  text-align: left;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: .3px;
  padding: 14px 18px;
  border-bottom: 1.5px solid var(--border-soft);
  background: var(--bg);
}

table.data-table th:first-child {
  border-top-left-radius: var(--r-lg);
}

table.data-table th:last-child {
  border-top-right-radius: var(--r-lg);
}

table.data-table td {
  padding: 14px 18px;
  font-size: 13.5px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--ink-soft);
  vertical-align: top;
}

table.data-table tbody tr {
  transition: background .12s ease;
}

table.data-table tbody tr:hover {
  background: var(--bg);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 700;
}

.status-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-aprobada {
  background: var(--teal-light);
  color: var(--teal);
}

.status-activa {
  background: var(--teal-light);
  color: var(--teal);
}

.status-finalizada {
  background: var(--bg-deep);
  color: var(--ink-soft);
}

.row-actions button {
  border: none;
  background: var(--bg);
  width: 30px;
  height: 30px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 14px;
  margin-right: 6px;
  transition: background .15s ease;
}

.row-actions button:hover {
  background: var(--brand-light);
}

.row-actions button.danger:hover {
  background: var(--danger-light);
}

.row-actions button.info:hover {
  background: var(--info-light);
}

.table-empty {
  text-align: center;
  padding: 46px;
  color: var(--muted);
}

.section-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filters-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--white);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  padding: 12px 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.filters-toolbar select,
.filters-toolbar input {
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--bg);
  font-size: 13px;
  color: var(--ink);
  transition: border-color .15s ease, background .15s ease;
}

.filters-toolbar select:focus,
.filters-toolbar input:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--white);
}

.filters-toolbar .search-grow {
  flex: 1;
  min-width: 200px;
}

.filters-toolbar .filter-count {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  margin-left: auto;
  padding-left: 12px;
}

.filters-toolbar .date-sep {
  color: var(--muted);
  font-weight: 600;
  font-size: 12.5px;
}

.status-toggle-mini {
  position: relative;
  width: 40px;
  height: 22px;
  border-radius: var(--r-pill);
  background: var(--border);
  cursor: pointer;
  border: none;
  padding: 0;
  flex-shrink: 0;
  transition: background .18s ease;
}

.status-toggle-mini.on {
  background: var(--teal);
}

.status-toggle-mini .knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transition: left .18s ease;
}

.status-toggle-mini.on .knob {
  left: 20px;
}

.estado-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.estado-text {
  font-size: 12.5px;
  font-weight: 700;
}

.estado-text.activo {
  color: var(--teal);
}

.estado-text.inactivo {
  color: var(--muted);
}

.comercios-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.master-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--gold), #e8a13a);
  color: #5C3D00;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--r-pill);
  margin-left: 6px;
  letter-spacing: .3px;
  text-transform: uppercase;
  vertical-align: middle;
}

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26, 27, 27, 0.55);
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  backdrop-filter: blur(2px);
}

.modal-overlay.show {
  display: flex;
}

.modal-box {
  background: var(--white);
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: card-rise .28s cubic-bezier(.2, .8, .2, 1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-soft);
}

.modal-header h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
}

.modal-close {
  cursor: pointer;
  color: var(--muted);
  font-size: 16px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s ease;
}

.modal-close:hover {
  color: var(--ink);
  background: var(--bg);
}

.modal-body {
  padding: 22px 24px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 18px 24px;
  border-top: 1px solid var(--border-soft);
}

.context-note {
  background: var(--brand-light);
  color: var(--brand-darker);
  padding: 10px 14px;
  border-radius: var(--r-md);
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 18px;
}

.section-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 22px 0 16px 0;
}

.section-divider .line {
  flex: 1;
  height: 1px;
  background: var(--border-soft);
}

.section-divider .label {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .8px;
  color: var(--brand-dark);
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--brand-light);
  white-space: nowrap;
}

.section-divider .hint-mini {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: -12px;
  margin-bottom: 14px;
}

.status-toggle {
  display: flex;
  gap: 8px;
}

.st-btn {
  padding: 9px 18px;
  border: 1.5px solid var(--border);
  background: var(--white);
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: all .15s ease;
}

.st-btn.active[data-estado="Activa"],
.st-btn.active[data-estado="Activo"] {
  background: var(--teal-light);
  border-color: var(--teal);
  color: var(--teal);
}

.st-btn.active[data-estado="Finalizada"] {
  background: var(--bg-deep);
  border-color: var(--border);
  color: var(--ink-soft);
}

.st-btn.active[data-estado="Inactivo"] {
  background: var(--danger-light);
  border-color: #F3B7BA;
  color: var(--danger);
}

.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--brand-darker);
  color: #fff;
  padding: 14px 22px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: all .3s cubic-bezier(.2, .8, .2, 1);
  z-index: 999;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.notif-wrap {
  position: relative;
}

.notif-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s ease;
}

.notif-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.notif-icon {
  font-size: 18px;
  line-height: 1;
}

.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #FD373E;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  border-radius: var(--r-pill);
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.notif-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 360px;
  max-height: 420px;
  overflow-y: auto;
  background: var(--white);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  color: var(--ink);
  padding: 8px 0;
  animation: card-rise .18s ease;
}

.notif-header {
  padding: 12px 18px;
  font-weight: 700;
  font-size: 13px;
  color: var(--brand-darker);
  border-bottom: 1px solid var(--border-soft);
}

.notif-list {
  display: flex;
  flex-direction: column;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
  transition: background .12s ease;
}

.notif-item:hover {
  background: var(--bg);
}

.notif-item:last-child {
  border-bottom: none;
}

.notif-item .n-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
  background: var(--gold);
}

.notif-item.danger .n-dot {
  background: var(--danger);
}

.notif-item .n-body {
  flex: 1;
  min-width: 0;
}

.notif-item .n-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
  margin-bottom: 3px;
}

.notif-item .n-meta {
  font-size: 11.5px;
  color: var(--muted);
}

.notif-item .n-days {
  font-size: 11.5px;
  font-weight: 700;
  margin-top: 3px;
}

.notif-item .n-days.warn {
  color: #9a6113;
}

.notif-item .n-days.danger {
  color: var(--danger);
}

.notif-empty {
  padding: 22px 18px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.contrato-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.contrato-cell .fecha {
  font-size: 12.5px;
  color: var(--ink-soft);
}

.contrato-cell .fecha.sec {
  color: var(--muted);
}

.contrato-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 700;
  margin-top: 2px;
}

.contrato-pill.ok {
  background: var(--teal-light);
  color: var(--teal);
}

.contrato-pill.warn {
  background: var(--gold-light);
  color: #9a6113;
}

.contrato-pill.danger {
  background: var(--danger-light);
  color: var(--danger);
}

.chk-inline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  background: var(--brand-light);
  padding: 10px 14px;
  border-radius: var(--r-md);
  width: 100%;
  border: 1.5px solid var(--brand-soft);
  transition: background .15s ease;
}

.chk-inline:hover {
  background: #E9C7F9;
}

.chk-inline input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
  cursor: pointer;
}

.grupo-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  margin-top: 5px;
  line-height: 1.4;
}

.grupo-tag.all {
  background: var(--teal-light);
  color: var(--teal);
}

.grupo-tag.partial {
  background: var(--gold-light);
  color: #9a6113;
}

@media (max-width: 900px) {

  .form-grid,
  .form-grid.cols-3 {
    grid-template-columns: 1fr;
  }

  .stats-row {
    grid-template-columns: 1fr 1fr;
  }

  .sidebar {
    width: 64px;
    padding: 0 8px 16px;
  }

  .sidebar .logo {
    display: none;
  }

  .nav-item span.label {
    display: none;
  }

  .nav-item {
    justify-content: center;
    padding: 12px;
  }
}