/* ============================================================
   Tarificador Chedraui Media — Estilos globales
   ============================================================ */

:root {
  --orange:       #FF6600;
  --orange-dark:  #cc5200;
  --navy:         #002147;
  --navy-light:   #003366;
  --green:        #00a651;
  --sidebar-w:    240px;
  --topbar-h:     56px;
  --navbar-h:     60px;
  --radius:       10px;
  --shadow-sm:    0 1px 4px rgba(0,0,0,.08);
  --shadow-md:    0 4px 16px rgba(0,0,0,.1);
  --font:         'Inter', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--font);
  background: #f5f6fa;
  color: #1a1a2e;
  font-size: .9rem;
  margin: 0;
}

/* ── Logos ─────────────────────────────────────────────────── */
.navbar-logo {
  height: 34px;
  width: auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.sidebar-logo {
  height: 28px;
  width: auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.auth-logo-img {
  height: 56px;
  width: auto;
  object-fit: contain;
  margin: 0 auto 1.25rem;
  display: block;
}

/* ── Navbar ────────────────────────────────────────────────── */
.app-navbar {
  background: var(--navy);
  height: var(--navbar-h);
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
  position: sticky;
  top: 0;
  z-index: 1030;
}

.app-navbar .navbar-brand {
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -.02em;
}

.app-navbar .nav-link {
  color: rgba(255,255,255,.75);
  border-radius: 6px;
  padding: .35rem .75rem;
  font-size: .85rem;
  font-weight: 500;
  transition: all .15s;
}
.app-navbar .nav-link:hover,
.app-navbar .nav-link.active {
  color: #fff;
  background: rgba(255,255,255,.12);
}

.user-pill {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: rgba(255,255,255,.85);
  font-size: .85rem;
  font-weight: 500;
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rol-badge {
  background: rgba(255,102,0,.35);
  font-size: .65rem;
  padding: .2em .5em;
}

/* ── Main content ──────────────────────────────────────────── */
.app-main {
  min-height: calc(100vh - var(--navbar-h) - 44px);
  padding: 1.5rem 0;
}

.app-footer {
  background: var(--navy);
  color: rgba(255,255,255,.5);
  text-align: center;
  font-size: .75rem;
  padding: .75rem 1rem;
}

/* ── Page titles ───────────────────────────────────────────── */
.page-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
}

.breadcrumb-nav a {
  text-decoration: none;
  color: #6c757d;
}
.breadcrumb-nav a:hover { color: var(--orange); }

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  border: 1px solid #e8eaf0;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-header {
  background: #fff;
  border-bottom: 1px solid #e8eaf0;
  padding: .875rem 1.25rem;
  border-radius: var(--radius) var(--radius) 0 0 !important;
}
.card-header h5 { font-size: .95rem; font-weight: 600; color: var(--navy); }

/* ── Stat cards ─────────────────────────────────────────────── */
.stat-card {
  background: #fff;
  border: 1px solid #e8eaf0;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}
.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}
.stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1; color: var(--navy); }
.stat-label { font-size: .75rem; color: #6c757d; margin-top: .15rem; }

.bg-primary-soft  { background: rgba(13,110,253,.1); }
.bg-success-soft  { background: rgba(25,135,84,.1); }
.bg-warning-soft  { background: rgba(255,193,7,.15); }
.bg-info-soft     { background: rgba(13,202,240,.1); }
.bg-secondary-soft{ background: rgba(108,117,125,.1); }
.bg-orange        { background: var(--orange); }

.text-success { color: #198754 !important; }
.text-warning { color: #ffc107 !important; }
.text-info    { color: #0dcaf0 !important; }

/* ── Pestañas Tarifario ────────────────────────────────────── */
.tarifario-tabs {
  display: flex;
  gap: 0;
  border-bottom: 0;
}

.tarifario-tab {
  display: inline-flex;
  align-items: center;
  padding: .6rem 1.4rem;
  font-size: .875rem;
  font-weight: 600;
  color: #6c757d;
  text-decoration: none;
  border: 1px solid #dee2e6;
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  background: #f8f9fc;
  transition: all .15s;
  margin-right: 4px;
  position: relative;
  bottom: -1px;
}

.tarifario-tab:hover { color: var(--navy); background: #fff; }

.tarifario-tab.active {
  color: var(--navy);
  background: #fff;
  border-color: #dee2e6;
  border-bottom-color: #fff;
  z-index: 1;
}

.tarifario-tab.active i { color: var(--orange); }

.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 5px;
  font-size: .7rem;
  font-weight: 700;
  background: #e8eaf0;
  color: #495057;
  border-radius: 10px;
  margin-left: .4rem;
}

.tarifario-tab.active .tab-count {
  background: var(--orange);
  color: #fff;
}

/* ── Aviso Digital ─────────────────────────────────────────── */
.digital-notice {
  background: #eef3ff;
  border: 1px solid #c5d3f0;
  color: #3a4a7a;
}

/* ── Badges categoría Digital ──────────────────────────────── */
.digital-cat-badge {
  font-size: .8rem;
  padding: .35rem .9rem;
  border-radius: 6px;
  font-weight: 600;
}

.digital-cat-badge.cat-onsite {
  background: #0d6efd;
  color: #fff;
}

.digital-cat-badge.cat-direct {
  background: #6610f2;
  color: #fff;
}

.digital-cat-badge.cat-offsite {
  background: #0d9488;
  color: #fff;
}

.digital-cat-badge.cat-audiencias {
  background: #e67e00;
  color: #fff;
}

/* ── Grupo Digital (label pequeño sobre el badge) ──────────── */
.digital-grupo-label {
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #6c757d;
  margin-bottom: .15rem;
}

/* ── Tabla Digital ─────────────────────────────────────────── */
.table-digital thead th {
  background: #f0f4ff;
}

.table-digital th.zona-digital {
  background: #e8eeff;
  color: #2d4a9e;
  font-size: .72rem;
}

/* ── Precio NA y PKG ───────────────────────────────────────── */
.precio-na  { background: #fde8e8; color: #b91c1c; border-radius: 4px; padding: .1em .4em; font-size: .78rem; font-weight: 600; }
.precio-pkg { background: #f3e5f5; color: #7b1fa2; border-radius: 4px; padding: .1em .4em; font-size: .78rem; font-weight: 700; }

.badge-tipo.digital-metrica {
  display: inline-block;
  background: #fff3e0;
  color: #7a4500;
  border: 1px solid #ffcc80;
  font-size: .72rem;
  font-weight: 700;
  padding: .25em .6em;
  border-radius: 5px;
  white-space: nowrap;
}

.badge-tipo.digital-metrica.cpm       { background: #e3f2fd; color: #0d47a1; border-color: #90caf9; }
.badge-tipo.digital-metrica.cpc       { background: #e8f5e9; color: #1b5e20; border-color: #a5d6a7; }
.badge-tipo.digital-metrica.cpv       { background: #f3e5f5; color: #4a148c; border-color: #ce93d8; }
.badge-tipo.digital-metrica.por-env-o { background: #fff8e1; color: #795548; border-color: #ffcc02; }

/* ── Tabla Tarifario ───────────────────────────────────────── */
.table-tarifario {
  font-size: .82rem;
}
.table-tarifario thead th {
  background: #f8f9fc;
  color: #495057;
  font-weight: 600;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  border-bottom: 2px solid #dee2e6;
  padding: .6rem .75rem;
  white-space: nowrap;
}
.table-tarifario td {
  padding: .55rem .75rem;
  vertical-align: middle;
}

.precio-col {
  min-width: 90px;
  white-space: nowrap;
}
.precio-valor { font-weight: 600; color: var(--green); }
.precio-texto { font-style: italic; color: #6c757d; font-size: .8rem; }

.id-medio {
  background: #f0f4ff;
  color: var(--navy);
  padding: .15em .4em;
  border-radius: 4px;
  font-size: .8rem;
  font-weight: 600;
}

.row-inactivo { opacity: .5; }

/* ── Categoría header ──────────────────────────────────────── */
.categoria-section { }
.categoria-header { }
.categoria-badge {
  background: var(--navy);
  color: #fff;
  padding: .3rem .8rem;
  border-radius: 6px;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .02em;
}

/* ── Badge tipo cobro ──────────────────────────────────────── */
.badge-tipo {
  font-size: .72rem;
  font-weight: 600;
  padding: .25em .55em;
  border-radius: 4px;
}
.badge-tipo.quincenal { background: #e8f4fd; color: #0d6efd; }
.badge-tipo.diario    { background: #fff3cd; color: #856404; }
.badge-tipo.na        { background: #f8f9fa; color: #6c757d; }
.badge-tipo.tbd       { background: #f8f9fa; color: #6c757d; }

/* ── Botones pequeños ──────────────────────────────────────── */
.btn-xs {
  padding: .2rem .45rem;
  font-size: .75rem;
  border-radius: 5px;
  line-height: 1.4;
}
.btn-primary {
  background: var(--orange);
  border-color: var(--orange);
}
.btn-primary:hover {
  background: var(--orange-dark);
  border-color: var(--orange-dark);
}

/* ── Filter bar ─────────────────────────────────────────────── */
.filter-bar { border: 1px solid #dee2e6; }

/* ── Detail list ─────────────────────────────────────────────── */
.detail-list {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: .5rem .75rem;
  margin: 0;
}
.detail-list dt {
  font-size: .8rem;
  font-weight: 600;
  color: #6c757d;
  align-self: start;
  padding-top: .1rem;
}
.detail-list dd {
  font-size: .875rem;
  margin: 0;
}

/* ── Admin layout ───────────────────────────────────────────── */
.admin-body { background: #f0f2f8; }

.admin-wrapper {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: var(--sidebar-w);
  background: var(--navy);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-brand {
  padding: 1.1rem 1.25rem;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.1);
  display: flex;
  align-items: center;
}

.sidebar-section {
  padding: .5rem 1.25rem .2rem;
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.35);
  font-weight: 700;
}

.sidebar-nav { padding: .5rem 0 1rem; flex: 1; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .5rem 1.25rem;
  color: rgba(255,255,255,.7);
  text-decoration: none;
  font-size: .85rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all .15s;
}
.sidebar-link:hover,
.sidebar-link.active {
  color: #fff;
  background: rgba(255,255,255,.08);
  border-left-color: var(--orange);
}
.sidebar-link.text-danger { color: #ff6b6b; }
.sidebar-link.text-danger:hover { color: #ff4444; background: rgba(255,0,0,.08); }

.admin-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.admin-topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid #e8eaf0;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}
.topbar-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
}
.topbar-user {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: #495057;
  font-size: .85rem;
}
.user-avatar-sm {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-content {
  padding: 1.5rem;
  flex: 1;
}

/* ── Auth ───────────────────────────────────────────────────── */
.auth-body {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-wrapper {
  width: 100%;
  max-width: 440px;
  padding: 1rem;
}
.auth-card {
  background: #fff;
  border-radius: 16px;
  padding: 2.5rem 2rem;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.auth-brand { text-align: center; margin-bottom: 2rem; }
.auth-logo-wrap {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--orange), #ff9933);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 1.8rem;
  color: #fff;
  box-shadow: 0 6px 20px rgba(255,102,0,.4);
}
.auth-title  { font-size: 1.5rem; font-weight: 800; color: var(--navy); margin: 0 0 .25rem; }
.auth-subtitle { color: #6c757d; font-size: .875rem; }

/* ── Formularios ─────────────────────────────────────────────── */
.form-label.required::after {
  content: ' *';
  color: #dc3545;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .admin-sidebar {
    transform: translateX(-100%);
    transition: transform .3s;
  }
  .admin-main {
    margin-left: 0;
  }
  .detail-list {
    grid-template-columns: 1fr;
  }
}
