:root{
  --bg:#f5f7fb;
  --card:#ffffff;
  --text:#0f172a;
  --muted:#64748b;

  --primary:#2c4a86;
  --primary-dark:#1f3563;
  --accent:#24a7d9;
  --success:#16a34a;
  --danger:#b00020;
  --border:#e5e7eb;

  --shadow: 0 10px 30px rgba(15,23,42,.08);
  --radius: 14px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: Arial, Helvetica, sans-serif;
  color:var(--text);
  background:var(--bg);
}

/* Links */
a{ color:var(--primary); text-decoration:none; }
a:hover{ text-decoration:underline; }

/* Layout ADMIN */
.app{
  display:flex;
  min-height:100vh;
}

/* Sidebar: ahora es flex columna para empujar meta al final */
.sidebar{
  width:260px;
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
  color:#fff;
  padding:18px 16px;
  position:sticky;
  top:0;
  height:100vh;

  display:flex;
  flex-direction:column;
}

/* Brand: sin cuadro, centrado, logo grande */
.brand{
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
  gap:10px;
  padding:8px 10px 14px;
  border-bottom:1px solid rgba(255,255,255,.14);
  margin-bottom:14px;
}
.brand img{
  width:190px;
  height:auto;
  object-fit:contain;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow:none;
}
.brand .title{
  font-weight:800;
  font-size:18px;
  line-height:1.1;
}
.brand .subtitle{
  font-size:12px;
  opacity:.95;
}

/* Nav ocupa espacio y deja meta al final */
.nav{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top:14px;
  flex:1;
}
.nav a{
  color:#fff;
  padding:12px 14px;
  border-radius:14px;
  display:block;
  background: rgba(255,255,255,.10);
}
.nav a:hover{
  background: rgba(255,255,255,.16);
  text-decoration:none;
}
.nav a.active{
  background: rgba(255,255,255,.24);
}

/* Meta al final */
.sidebar .meta{
  margin-top:auto;
  padding:12px;
  border-radius:14px;
  background: rgba(255,255,255,.10);
  font-size:12px;
  line-height:1.6;
  opacity:.98;
}

.content{
  flex:1;
  padding:26px;
}

/* Cards */
.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:16px;
}

.card + .card{ margin-top:14px; }

/* Logo en cards públicas */
.card-logo{
  display:block;
  margin:4px auto 12px auto;
  width:180px;
  height:auto;
}

/* Headings */
h1,h2,h3{
  margin:0 0 12px 0;
}
h2{
  font-size:22px;
}
h3{
  font-size:16px;
  color:var(--primary-dark);
}

/* Tables */
table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  overflow:hidden;
  box-shadow:var(--shadow);
}
th,td{
  padding:10px 12px;
  border-bottom:1px solid var(--border);
  vertical-align:top;
  font-size:14px;
}
th{
  background:#f1f5ff;
  color:var(--primary-dark);
  text-align:left;
  font-weight:700;
}
tr:last-child td{ border-bottom:none; }

/* Forms */
label{ font-size:13px; color:var(--muted); }
input[type="text"], input[type="password"], input[type="datetime-local"], select, textarea{
  width:100%;
  max-width:520px;
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:12px;
  outline:none;
  background:#fff;
}
textarea{ resize:vertical; }
input:focus, select:focus, textarea:focus{
  border-color: rgba(36,167,217,.55);
  box-shadow: 0 0 0 3px rgba(36,167,217,.18);
}

/* Check label helper */
label.check{
  display:flex;
  align-items:center;
  gap:10px;
  color:var(--text);
  font-size:14px;
}
label.check input{ width:auto; }

/* Simple grid form */
.form-grid{
  display:grid;
  gap:12px;
}

/* Hint */
.hint{
  font-size:12px;
  color:var(--muted);
  margin-top:6px;
}

/* Buttons */
button{
  border:0;
  border-radius:12px;
  padding:10px 14px;
  background:var(--primary);
  color:#fff;
  cursor:pointer;
  font-weight:700;
}
button:hover{ background:var(--primary-dark); }

.btn-secondary{
  background:#eaf0ff;
  color:var(--primary-dark);
  border:1px solid #d7e2ff;
}
.btn-secondary:hover{
  background:#dfe9ff;
}

/* Badges */
.badge{
  display:inline-block;
  padding:3px 10px;
  border-radius:999px;
  font-size:12px;
  border:1px solid var(--border);
  background:#fff;
  color:var(--muted);
}
.badge.ok{ border-color: rgba(22,163,74,.25); background: rgba(22,163,74,.08); color: var(--success); }
.badge.no{ border-color: rgba(176,0,32,.25); background: rgba(176,0,32,.06); color: var(--danger); }

/* Alerts */
.alert{
  padding:12px 14px;
  border-radius:14px;
  border:1px solid var(--border);
  background:#fff;
  box-shadow:var(--shadow);
}
.alert.error{
  border-color: rgba(176,0,32,.25);
  background: rgba(176,0,32,.06);
  color: var(--danger);
  font-weight:700;
}
.alert.success{
  border-color: rgba(22,163,74,.25);
  background: rgba(22,163,74,.08);
  color: var(--success);
  font-weight:700;
}

/* PUBLIC layout */
.public-wrap{
  max-width:980px;
  margin:28px auto;
  padding:0 16px;
}
.public-header{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:16px;
  margin-bottom:16px;
}

@media (max-width: 900px){
  .sidebar{ width:220px; }
  .brand img{ width:160px; }
}
@media (max-width: 780px){
  .app{ flex-direction:column; }
  .sidebar{
    width:100%;
    height:auto;
    position:relative;
  }
  .content{ padding:16px; }
}
