:root{
  --primary:#0a2f7a;
  --primary-dark:#08245d;
  --primary-soft:#123f9e;
  --accent:#e9eefb;
  --bg:#f4f7fc;
  --surface:#ffffff;
  --text:#15233b;
  --muted:#66748f;
  --border:#dbe4f0;
  --shadow:0 14px 40px rgba(10, 35, 80, 0.10);
  --radius:22px;
}

*{
  margin:0;
  padding:0;
  box-sizing:border-box;
}

html, body{
  font-family: "Segoe UI", Arial, sans-serif;
  background: linear-gradient(180deg, #eef3fb 0%, #f7faff 100%);
  color:var(--text);
}

a{
  text-decoration:none;
}

img{
  display:block;
  max-width:100%;
}

.container{
  width:min(1200px, 92%);
  margin:0 auto;
}

.site-header{
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-soft) 100%);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 9999;
}

.header-content{
  min-height: 92px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
}

.brand-block{
  display:flex;
  align-items:center;
  gap:16px;
}

.brand-logo{
  width:68px;
  height:68px;
  object-fit:contain;
  background:#ffffff;
  border-radius:18px;
  padding:8px;
  box-shadow:0 8px 24px rgba(0,0,0,.18);
}

.brand-kicker{
  color:rgba(255,255,255,.75);
  font-size:.84rem;
  font-weight:700;
  letter-spacing:.04em;
  text-transform:uppercase;
  margin-bottom:4px;
}

.brand-title{
  color:#fff;
  font-size:1.7rem;
  font-weight:800;
  line-height:1.05;
}

.brand-subtitle{
  color:rgba(255,255,255,.88);
  margin-top:4px;
  font-size:1rem;
}

.main-nav{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  position: relative;
  z-index: 10000;
}

.main-nav a{
  color:#fff;
  font-weight:700;
  padding:10px 14px;
  border-radius:12px;
  transition:.2s ease;
  position: relative;
  z-index: 10001;
}

.main-nav a:hover{
  background:rgba(255,255,255,.12);
}

.nav-btn{
  border:1px solid rgba(255,255,255,.28);
}

.hero-section{
  padding:38px 0 20px;
}

.hero-card{
  background: linear-gradient(135deg, rgba(255,255,255,.98) 0%, rgba(246,249,255,.98) 100%);
  border:1px solid var(--border);
  border-radius:30px;
  box-shadow: var(--shadow);
  padding:34px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:22px;
}

.hero-badge{
  display:inline-flex;
  align-items:center;
  padding:8px 12px;
  border-radius:999px;
  background:#eaf0ff;
  color:var(--primary-soft);
  font-size:.85rem;
  font-weight:800;
  margin-bottom:14px;
}

.hero-text h2{
  font-size:2rem;
  line-height:1.15;
  color:var(--primary-dark);
  margin-bottom:12px;
  max-width:800px;
}

.hero-text p{
  color:var(--muted);
  font-size:1rem;
  line-height:1.7;
  max-width:760px;
}

.btn-primary{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-soft) 100%);
  color:#fff;
  border:none;
  border-radius:14px;
  padding:14px 20px;
  font-weight:800;
  box-shadow:0 10px 24px rgba(18,63,158,.24);
  cursor:pointer;
  transition:.2s ease;
}

.btn-primary:hover{
  transform:translateY(-2px);
}

.links-public-section,
.dashboard-section{
  padding:36px 0 50px;
}

.section-title-row{
  margin-bottom:20px;
}

.section-title-row h3{
  font-size:1.55rem;
  color:var(--primary-dark);
  margin-bottom:6px;
}

.section-title-row p{
  color:var(--muted);
}

.links-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(270px, 1fr));
  gap:22px;
}

.link-card{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:24px;
  overflow:hidden;
  box-shadow: var(--shadow);
  transition:.2s ease;
}

.link-card:hover{
  transform:translateY(-5px);
  border-color:#bfd0ff;
}

.link-card-logo{
  height:170px;
  background: linear-gradient(135deg, #eef4ff 0%, #f9fbff 100%);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:22px;
}

.link-card-logo img{
  max-width:100%;
  max-height:100%;
  object-fit:contain;
}

.no-logo{
  color:var(--muted);
  font-weight:700;
}

.link-card-body{
  padding:18px;
}

.link-card-body h4{
  color:var(--primary-dark);
  font-size:1.08rem;
  margin-bottom:8px;
}

.link-card-body p{
  color:var(--muted);
  font-size:.92rem;
  word-break:break-word;
  line-height:1.5;
}

.empty-box{
  background:var(--surface);
  border:1px dashed #bfd0ea;
  border-radius:24px;
  padding:36px;
  text-align:center;
  color:var(--muted);
  box-shadow: var(--shadow);
}

.empty-box h4{
  color:var(--primary-dark);
  margin-bottom:8px;
}

.dashboard-header{
  background: linear-gradient(135deg, rgba(255,255,255,.98) 0%, rgba(246,249,255,.98) 100%);
  border:1px solid var(--border);
  border-radius:30px;
  box-shadow: var(--shadow);
  padding:28px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:20px;
  margin-bottom:24px;
}

.dashboard-header h2{
  color:var(--primary-dark);
  margin:8px 0;
}

.dashboard-header p{
  color:var(--muted);
}

.form-page,
.login-page{
  padding:42px 0 50px;
}

.form-wrapper,
.login-box{
  width: min(620px, 100%);
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 30px;
}

.form-top{
  margin-bottom:22px;
}

.form-top.center{
  text-align:center;
}

.form-top h2{
  color:var(--primary-dark);
  margin-bottom:8px;
}

.form-top p{
  color:var(--muted);
  line-height:1.6;
}

.modern-form{
  display:grid;
  gap:18px;
}

.form-group{
  display:grid;
  gap:8px;
}

.form-group label{
  font-weight:800;
  color:var(--primary-dark);
}

.form-group input{
  width:100%;
  border:1px solid var(--border);
  background:#fbfcff;
  border-radius:14px;
  padding:14px 16px;
  font-size:1rem;
  outline:none;
  transition:.2s ease;
}

.form-group input:focus{
  border-color:#7fa7ff;
  box-shadow:0 0 0 4px rgba(43,109,255,.12);
}

.full-width{
  width:100%;
}

.error-box{
  margin-bottom:16px;
  background:#ffe9e9;
  color:#b42318;
  border:1px solid #f2b1b1;
  padding:12px 14px;
  border-radius:14px;
  font-weight:700;
}

.site-footer{
  margin-top:30px;
  background:var(--primary-dark);
}

.footer-content{
  min-height:70px;
  display:flex;
  align-items:center;
  justify-content:center;
}

.footer-content p{
  color:#fff;
  font-weight:600;
}

.page-main{
  min-height: calc(100vh - 162px);
  padding-bottom: 30px;
}

.dashboard-header{
  background: linear-gradient(135deg, rgba(255,255,255,.98) 0%, rgba(246,249,255,.98) 100%);
  border:1px solid var(--border);
  border-radius:30px;
  box-shadow: var(--shadow);
  padding:28px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:20px;
  margin-bottom:24px;
}

@media (max-width: 860px){
  .header-content,
  .hero-card,
  .dashboard-header{
    flex-direction:column;
    align-items:flex-start;
  }

  .brand-title{
    font-size:1.35rem;
  }

  .hero-text h2{
    font-size:1.55rem;
  }

  .main-nav{
    width:100%;
  }
}

.admin-card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: .2s ease;
}

.admin-card:hover{
  transform: translateY(-4px);
  border-color: #bfd0ff;
}

.card-actions{
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.btn-secondary{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef3ff;
  color: var(--primary-dark);
  border: 1px solid #cfdcff;
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 800;
  transition: .2s ease;
}

.btn-secondary:hover{
  transform: translateY(-2px);
}

.current-logo-box{
  background: #f8fbff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 180px;
}

.current-logo-box img{
  max-width: 100%;
  max-height: 140px;
  object-fit: contain;
}

.form-actions-row{
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* ===== Base general ===== */
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: linear-gradient(180deg, #eef3fb 0%, #f7f9fc 100%);
  color: #18243d;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-main {
  flex: 1;
}

.container {
  width: min(1180px, 92%);
  margin: 0 auto;
}

/* ===== Header ===== */
.site-header {
  background: #123f95;
  color: #fff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0;
  flex-wrap: wrap;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 58px;
  height: 58px;
  object-fit: cover;
  border-radius: 14px;
  background: #fff;
  padding: 4px;
}

.brand-kicker {
  font-size: 12px;
  text-transform: uppercase;
  opacity: 0.85;
  letter-spacing: 0.08em;
}

.brand-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.1;
}

.brand-subtitle {
  margin: 2px 0 0;
  font-size: 14px;
  opacity: 0.9;
}

/* ===== Nav ===== */
.main-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.main-nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 12px;
  transition: 0.18s ease;
}

.main-nav a:hover {
  background: rgba(255, 255, 255, 0.12);
}

.nav-btn {
  border: 1px solid rgba(255, 255, 255, 0.35);
}

/* ===== Footer ===== */
.site-footer {
  background: #0f2f70;
  color: #fff;
  margin-top: 40px;
}

.footer-content {
  padding: 18px 0;
  text-align: center;
}

.footer-content p {
  margin: 0;
  opacity: 0.92;
}

/* ===== Secciones generales ===== */
.hero-section,
.links-public-section,
.dashboard-section,
.form-page,
.admin-page {
  padding: 32px 0 48px;
}

/* ===== Hero ===== */
.hero-card {
  background: #fff;
  border-radius: 22px;
  padding: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(15, 23, 42, 0.06);
  flex-wrap: wrap;
}

.hero-badge {
  display: inline-block;
  padding: 7px 12px;
  border-radius: 999px;
  background: #eef4ff;
  color: #123f95;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hero-text h2 {
  margin: 12px 0 10px;
  font-size: 32px;
  line-height: 1.1;
  color: #0d2c6c;
  max-width: 760px;
}

.hero-text p {
  margin: 0;
  color: #5b6780;
  max-width: 760px;
}

.hero-actions {
  display: flex;
  align-items: center;
}

/* ===== Botones ===== */
.btn-primary,
.btn-secondary,
.btn-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  transition: 0.18s ease;
  border: none;
}

.btn-primary {
  background: #123f95;
  color: #fff;
  padding: 13px 20px;
}

.btn-primary:hover {
  background: #0f357d;
  transform: translateY(-1px);
}

.btn-secondary {
  background: #eef4ff;
  color: #123f95;
  padding: 13px 20px;
  border: 1px solid #d7e2fb;
}

.btn-secondary:hover {
  background: #e4eeff;
}

.btn-sm {
  padding: 8px 14px;
  background: #eef4ff;
  color: #123f95;
  border: 1px solid #d7e2fb;
}

.full-width {
  width: 100%;
}

/* ===== Encabezados de secciones ===== */
.section-title-row,
.page-head,
.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.section-title-row h3,
.page-head h2,
.dashboard-header h2 {
  margin: 0 0 6px;
  color: #0d2c6c;
}

.section-title-row p,
.page-head p,
.dashboard-header p {
  margin: 0;
  color: #66758c;
}

/* ===== Cards de links ===== */
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.link-card,
.admin-card {
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.07);
}

.link-card {
  text-decoration: none;
  color: inherit;
  transition: 0.18s ease;
}

.link-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.11);
}

.link-card-logo {
  height: 160px;
  background: #f5f8fd;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.link-card-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.no-logo {
  color: #718198;
  font-weight: 600;
  font-size: 14px;
}

.link-card-body {
  padding: 18px;
}

.link-card-body h4 {
  margin: 0 0 10px;
  font-size: 18px;
  color: #0d2c6c;
}

.link-card-body p {
  margin: 0 0 8px;
  color: #5c6d85;
  line-height: 1.45;
}

.card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

/* ===== Formularios ===== */
.form-wrapper {
  max-width: 760px;
  margin: 0 auto;
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  padding: 28px;
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.form-wrapper-wide {
  max-width: 920px;
}

.form-top {
  margin-bottom: 22px;
}

.form-top h2 {
  margin: 8px 0 8px;
  font-size: 30px;
  line-height: 1.1;
  color: #0d2c6c;
}

.form-top p {
  margin: 0;
  color: #5b6780;
}

.modern-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 14px;
  font-weight: 700;
  color: #0b2559;
}

.form-group input,
.form-group select,
.form-group textarea {
  height: 50px;
  border-radius: 14px;
  border: 1px solid #d7dfed;
  background: #f8fbff;
  padding: 0 16px;
  font-size: 15px;
  color: #18243d;
  outline: none;
  transition: 0.18s ease;
}

.form-group textarea {
  min-height: 120px;
  padding: 14px 16px;
  resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.multi-select:focus {
  border-color: #1f5fa8;
  box-shadow: 0 0 0 4px rgba(31, 95, 168, 0.12);
  background: #fff;
}

.multi-select {
  min-height: 220px !important;
  padding: 10px !important;
}

.form-actions-row {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 10px;
}

.current-logo-box {
  background: #f8fbff;
  border: 1px solid #d7dfed;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  justify-content: center;
}

.current-logo-box img {
  max-width: 220px;
  max-height: 120px;
  object-fit: contain;
}

/* ===== Tablas ===== */
.table-wrap {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table thead {
  background: #123f95;
  color: #fff;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 16px 18px;
  vertical-align: top;
  border-bottom: 1px solid #edf1f7;
}

.admin-table tbody tr:hover {
  background: #f8fbff;
}

/* ===== Chips / estados ===== */
.tag-chip {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef4ff;
  color: #123f95;
  font-size: 13px;
  font-weight: 700;
  margin: 0 6px 6px 0;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.status-chip.neutral {
  background: #eef2f7;
  color: #344054;
}

/* ===== Cajas ===== */
.empty-box,
.error-box {
  border-radius: 18px;
  padding: 18px 20px;
}

.empty-box {
  background: #fff;
  border: 1px dashed #ccd7ea;
}

.error-box {
  background: #fff1f1;
  border: 1px solid #f3b7b7;
  color: #8f1d1d;
  margin-bottom: 18px;
}

.muted-text {
  color: #718198;
}

/* ===== Responsive ===== */
@media (max-width: 860px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-wrapper,
  .form-wrapper-wide {
    padding: 20px;
  }

  .hero-text h2 {
    font-size: 26px;
  }

  .form-top h2 {
    font-size: 26px;
  }

  .main-nav {
    width: 100%;
  }
}

.checkbox-group {
  margin-top: -4px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: #0b2559;
}

.check-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #123f95;
}

.public-section-block {
  margin-bottom: 34px;
}

.public-section-head {
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid #dbe5f3;
}

.public-section-head h3 {
  margin: 0;
  font-size: 24px;
  color: #0d2c6c;
}

.public-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid #dbe5f3;
}

.public-section-head h3 {
  margin: 0;
  font-size: 24px;
  color: #0d2c6c;
  font-weight: 800;
}