/* Portal Grupo Valdaloma — estilos compartidos
   Manual Identidad Visual ACTIVA SUMINISTRO MEDICO */
@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;600;700&display=swap');

* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  /* Paleta oficial Manual Identidad Visual ACTIVA SUMINISTRO MEDICO */
  --bg: #f0eee2;             /* Pantone 11-4201 TCX · Cream */
  --surface: #ffffff;
  --surface-2: #f8f5e8;
  --border: #e0ddcf;
  --text: #25453a;           /* Pantone 18-5406 · Verde oscuro como texto */
  --text-muted: #5e7a6c;

  /* Marca corporativa */
  --primary: #25453a;        /* Pantone 18-5406 TCX · Verde oscuro Activa */
  --primary-dark: #1a3329;   /* Hover */
  --primary-deep: #0f2620;
  --accent: #4d8c61;         /* Pantone 18-5624 TCX · Verde medio */
  --highlight: #b5c44c;      /* Pantone 13-0540 TCX · Verde lima */

  /* Semánticos */
  --danger: #a33028;
  --warning: #b87a1b;
  --success: #4d8c61;        /* Reutiliza verde medio Activa */

  /* Colores categóricos para iconos de módulo */
  --teal: #4d8c61;
  --coral: #a04a2a;
  --purple: #4d8c61;
  --amber: #b87a1b;
  --pink: #25453a;
}
html, body { height: 100%; }
body {
  font-family: 'Barlow', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

/* HEADER */
.header {
  background: var(--primary);
  color: #fff;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.header .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}
.header .logo {
  width: 32px; height: 32px;
  background: #fff;
  color: var(--primary);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 14px;
}
.header .brand-text { font-size: 15px; font-weight: 600; letter-spacing: 0.2px; }
.header .brand-text small { display: block; font-size: 10px; font-weight: 400; opacity: 0.7; }
.header .user {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px;
}
.header .user .avatar {
  width: 30px; height: 30px;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
}
.header .nav-back {
  font-size: 12px; opacity: 0.8;
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 4px;
}
.header .nav-back:hover { background: rgba(255,255,255,0.1); }

/* CONTAINER */
.container {
  padding: 16px;
  max-width: 1100px;
  margin: 0 auto;
}

/* BREADCRUMB */
.breadcrumb {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.breadcrumb a { color: var(--accent); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* PAGE TITLE */
.page-title {
  margin-bottom: 16px;
}
.page-title h1 {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
}
.page-title p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* KPIs */
.kpis {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.kpi {
  background: var(--surface);
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.kpi .label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
}
.kpi .value {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
}
.kpi .trend {
  font-size: 11px;
  margin-top: 4px;
}
.kpi .trend.up { color: var(--success); }
.kpi .trend.down { color: var(--danger); }
.kpi .trend.neutral { color: var(--text-muted); }
.kpi.alert .value { color: var(--danger); }
.kpi.warn .value { color: var(--warning); }

/* SECTION */
.section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 10px;
  padding-left: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.section-title .link { color: var(--accent); font-weight: 500; text-transform: none; letter-spacing: 0; font-size: 12px; text-decoration: none; }

/* MODULES GRID */
.modules {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.module {
  background: var(--surface);
  padding: 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  display: block;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.module:active { transform: scale(0.98); box-shadow: 0 2px 6px rgba(0,0,0,0.08); }
.module .icon {
  width: 38px; height: 38px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 10px;
}
.module .name { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.module .desc { font-size: 11px; color: var(--text-muted); }
.module .badge {
  display: inline-block;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  margin-top: 8px;
  font-weight: 500;
}
.module .badge.new { background: var(--highlight); color: var(--primary); }     /* Lima vivo, atrae el ojo */
.module .badge.soon { background: #ece9dd; color: var(--text-muted); }
.module .badge.alert { background: #f4dad6; color: var(--danger); }

.icon.bg-primary { background: var(--accent); }
.icon.bg-teal    { background: var(--teal); }
.icon.bg-coral   { background: var(--coral); }
.icon.bg-purple  { background: var(--purple); }
.icon.bg-amber   { background: var(--amber); }
.icon.bg-pink    { background: var(--pink); }
.icon.bg-gray    { background: var(--text-muted); }

/* CARD */
.card {
  background: var(--surface);
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 16px;
  margin-bottom: 14px;
}
.card h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
  display: flex; justify-content: space-between; align-items: center;
}
.card h3 .link { font-size: 12px; font-weight: 500; color: var(--accent); text-decoration: none; }

/* QUICK ACTIONS */
.actions-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.action-btn {
  flex: 1 1 calc(50% - 4px);
  min-width: 140px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.action-btn:hover { background: #efece4; }

/* TABLE */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  min-width: 500px;
}
table.data th {
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  padding: 10px 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
table.data td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover { background: var(--surface-2); }
.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 500;
}
.pill.ok { background: #e4ecd9; color: var(--primary); }       /* Soft lima */
.pill.warn { background: #f5e9cf; color: var(--warning); }
.pill.danger { background: #f4dad6; color: var(--danger); }
.pill.info { background: #d9e7df; color: var(--primary); }     /* Soft medio */
.pill.neutral { background: #ece9dd; color: var(--text-muted); }

/* SEARCH BAR */
.searchbar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.searchbar input {
  border: none; outline: none;
  flex: 1;
  font-size: 14px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
}
.searchbar .icon { color: var(--text-muted); font-size: 16px; }

/* LIST */
.list { background: var(--surface); border-radius: 10px; border: 1px solid var(--border); overflow: hidden; margin-bottom: 14px; }
.list-item {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  text-decoration: none; color: var(--text);
}
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: var(--surface-2); }
.list-item .main .title { font-size: 13px; font-weight: 500; }
.list-item .main .sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.list-item .right { font-size: 11px; color: var(--text-muted); }

/* ALERT BLOCKS */
.alert-block {
  background: var(--surface);
  border-left: 3px solid var(--danger);
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 8px;
  font-size: 12px;
}
.alert-block.warn { border-color: var(--warning); }
.alert-block.info { border-color: var(--accent); }
.alert-block.ok { border-color: var(--success); }
.alert-block b { font-weight: 600; }

/* CHART PLACEHOLDER */
.chart {
  background: var(--surface-2);
  border-radius: 8px;
  padding: 12px;
  height: 160px;
  display: flex; align-items: flex-end; justify-content: space-around;
  gap: 6px;
}
.chart .bar {
  background: var(--accent);
  width: 100%;
  border-radius: 4px 4px 0 0;
  position: relative;
}
.chart .bar span { position: absolute; bottom: -18px; left: 0; right: 0; text-align: center; font-size: 10px; color: var(--text-muted); }

/* FORM */
.form-row { margin-bottom: 12px; }
.form-row label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 14px; background: var(--surface); color: var(--text); font-family: inherit;
}
.btn-primary {
  background: var(--primary); color: #fff; border: none;
  padding: 10px 18px; border-radius: 6px; font-weight: 600;
  cursor: pointer; font-size: 13px;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost {
  background: transparent; color: var(--text-muted); border: 1px solid var(--border);
  padding: 10px 18px; border-radius: 6px;
  cursor: pointer; font-size: 13px;
}

/* FOOTER */
.footer {
  text-align: center;
  padding: 20px 16px 40px;
  font-size: 11px;
  color: var(--text-muted);
}
.footer .links a {
  color: var(--accent);
  text-decoration: none;
  margin: 0 6px;
}

/* RESPONSIVE */
@media (min-width: 700px) {
  .kpis { grid-template-columns: repeat(4, 1fr); }
  .modules { grid-template-columns: repeat(3, 1fr); }
  .page-title h1 { font-size: 26px; }
  .container { padding: 24px; }
}
.two-col { display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 14px; }
@media (min-width: 900px) {
  .two-col { grid-template-columns: 2fr 1fr; }
}
