@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;500;600;700&display=swap');

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

:root {
  --primary: #057A8D;
  --primary-dark: #045A68;
  --primary-light: #E1F0F2;
  --primary-mid: #0C6271;
  --bg: #F4F6F7;
  --surface: #FFFFFF;
  --border: #E2E5E6;
  --border2: #CCD2D4;
  --text: #1A1917;
  --text2: #6B6B6B;
  --text3: #9E9E9E;
  --font: 'Open Sans', system-ui, sans-serif;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
}

/* ── LOGIN ── */
.login-wrap {
  max-width: 360px;
  margin: 60px auto;
  background: var(--surface);
  border-radius: 16px;
  padding: 36px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}

.brand-mark {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.brand-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.brand-sub { font-size: 11px; color: var(--text3); }

h1 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}
.sub {
  font-size: 12px;
  color: var(--text2);
  margin-bottom: 20px;
  line-height: 1.5;
}

.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text2);
  margin-bottom: 5px;
}
.field input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  font-size: 13px;
  font-family: var(--font);
  border: 1px solid var(--border2);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  outline: none;
}
.field input:focus {
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(5,122,141,0.12);
}

button {
  width: 100%;
  height: 42px;
  background: var(--primary);
  color: white;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.15s;
}
button:hover { background: var(--primary-dark); }

.error {
  color: #D32F2F;
  font-size: 12px;
  margin-bottom: 8px;
  min-height: 16px;
}

.login-footer {
  font-size: 12px;
  color: var(--text3);
  text-align: center;
  margin-top: 16px;
}
.login-footer a { color: var(--primary); text-decoration: none; }

/* ── TOPBAR ── */
.topbar {
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-divider {
  width: 1px;
  height: 20px;
  background: var(--border2);
}
.topbar-sub {
  font-size: 13px;
  color: var(--text2);
  font-weight: 400;
}

.topbar-nav { display: flex; align-items: center; gap: 2px; }
.nav-item {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
}
.nav-item:hover { background: var(--bg); color: var(--text); }
.nav-item.active {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 600;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: var(--text2);
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}
.btn-logout {
  width: auto;
  height: 32px;
  padding: 0 14px;
  background: none;
  color: var(--text2);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  margin-top: 0;
}
.btn-logout:hover { background: var(--bg); color: var(--text); }

/* ── MAIN ── */
.main { padding: 24px; }

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 4px;
}
.page-header h2 {
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
}
.page-subheader {
  font-size: 13px;
  color: var(--text3);
  margin-bottom: 18px;
}
.page-header input {
  height: 36px;
  padding: 0 12px 0 36px;
  font-size: 13px;
  font-family: var(--font);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  outline: none;
  width: 220px;
}
.page-header input:focus { border-color: var(--primary); }

.search-wrap { position: relative; }
.search-wrap::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--text3);
  border-radius: 50%;
}

.header-actions { display: flex; align-items: center; gap: 8px; }
.btn-filter {
  width: auto;
  height: 32px;
  padding: 0 14px;
  background: white;
  color: var(--text);
  border: 1px solid var(--border2);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  margin-top: 0;
}
.btn-filter:hover { background: var(--bg); }
.btn-nueva {
  width: auto;
  height: 32px;
  padding: 0 14px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 0;
}
.btn-nueva:hover { background: var(--primary-dark); }

/* ── COMPANY GRID ── */
.company-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.company-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.1s, border-color 0.15s;
}
.company-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  transform: translateY(-1px);
  border-color: var(--border2);
}
.company-card.selected {
  border: 2px solid var(--primary);
  box-shadow: 0 0 0 3px rgba(5,122,141,0.12);
}

.logo-area {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: white;
  background: var(--primary);
}
.card-body { padding: 12px 14px; }
.card-name {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
  color: var(--text);
}
.card-slogan { font-size: 11px; color: var(--text2); margin-bottom: 10px; }
.card-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--bg);
  color: var(--text2);
  border: 1px solid var(--border);
}
.tag.primary {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-color: transparent;
}

/* ── DETAIL PANEL ── */
.detail-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}
.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}
.detail-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.detail-header p { font-size: 12px; color: var(--text2); margin-top: 2px; }
.detail-header button {
  width: 28px; height: 28px;
  background: var(--bg);
  color: var(--text2);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  margin-top: 0;
  padding: 0;
  display: flex; align-items: center; justify-content: center;
}
.detail-header button:hover { background: var(--border); }

.colores {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding: 12px 14px;
  background: var(--bg);
  border-radius: 8px;
  flex-wrap: wrap;
}
.color-chip { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text2); }
.color-swatch {
  width: 24px; height: 24px;
  border-radius: 6px;
  border: 1px solid rgba(0,0,0,0.08);
}
.tipografia { font-size: 12px; color: var(--text2); margin-left: auto; }

.section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text3);
  margin-bottom: 10px;
}

/* ── FORMATS GRID ── */
.formats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.format-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 6px;
  text-align: center;
  cursor: pointer;
  background: var(--bg);
  transition: all 0.15s;
}
.format-item:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}
.format-icon { font-size: 18px; margin-bottom: 5px; color: var(--text2); }
.format-ext { font-size: 12px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.format-desc { font-size: 10px; color: var(--text3); }
.format-dl {
  font-size: 10px;
  color: var(--primary-dark);
  font-weight: 600;
  margin-top: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.btn-pdf {
  width: 100%;
  height: 42px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  margin-top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-pdf:hover { background: var(--primary-dark); }