/* Base */
* { box-sizing: border-box; }
:root { --bg:#fff; --fg:#111; --muted:#666; --border:#e5e7eb; --hover:#dddddd; }
html, body { background: var(--bg); color: var(--fg); }
body { font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif; }

/* Containers */
.container { max-width: 1000px; margin: 32px auto; padding: 0 16px; }
.container-sm { max-width: 520px; margin: 32px auto; padding: 0 12px; }

/* Header / Nav */
.app-header { display:flex; align-items:center; justify-content:space-between; padding:12px 0; border-bottom:1px solid var(--border); gap:16px; flex-wrap:wrap; }
.top-nav a { margin-right:12px; text-decoration:none; color:var(--fg); padding:8px 10px; border-radius:8px; }
.top-nav a:hover { background: var(--hover); }
.top-nav a.active { background: #111; color: #fff; }

/* Buttons / Cards */
button { padding: 10px 14px; border: 0; border-radius: 10px; cursor: pointer; background:#111; color:#fff; }
button.secondary { background:#cdeef7; color:#111; }
.card { border:1px solid var(--border); border-radius: 12px; padding: 12px; }

/* Alerts */
.alert { margin: 12px 0; padding:10px; border-radius:8px; }
.alert.error { background:#fee; border:1px solid #f99; color:#900; }
.alert.success { background:#eef9f0; border:1px solid #8fd19e; color:#14532d; }

/* Big vertical menu on / */
.big-menu { list-style:none; padding:0; margin:24px auto; max-width:min(900px, 90vw); }
.big-menu li { margin-bottom:12px; }
.big-menu li a { display:block; width:100%; padding:22px 24px; border:1px solid var(--border); border-radius:16px; text-decoration:none; color:var(--fg); font-size:clamp(1.25rem, 2vw, 1.75rem); font-weight:700; }
.big-menu li a:hover { background: var(--hover); }

/* Forms */
label { display:block; margin:8px 0 4px; font-weight:600; }
input, select { width:100%; padding:10px; border:1px solid #ddd; border-radius:8px; }


/* Tablas globales */


.card { overflow-x: auto; }

.card table {
  width: 100%;
  border-collapse: separate;    /* mejor separación que collapse */
  border-spacing: 0;
  table-layout: auto;           /* deja que se ajuste al contenido */
}

.card th,
.card td {
  padding: 12px 16px;           /* <-- espaciado cómodo */
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.35;            /* mejora lectura en varias líneas */
  word-break: break-word;       /* evita superposición en textos largos */
}

.card th {
  text-align: left;
  background: var(--hover);
  font-weight: 700;
}

.card tr:last-child td {
  border-bottom: 0;
}

.card tr:hover td {
  background: #fafafa;          
}

/* Columna de acciones (última) alineada y con separación entre botones */
.card table td:last-child {
  display: flex;               
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  white-space: nowrap;
  min-width: 140px;            
}

/* Botones dentro de la tabla */
.card table td:last-child button {
  display: inline-block;
  padding: 8px 12px;
}

table th, table td{
  word-break: keep-all;
  overflow-wrap: normal;
  hyphens: none;
  vertical-align: top;
}
table th{ white-space: nowrap; }

/* Utilidad opcional */
.nowrap{ white-space: nowrap; }
.soft-break{ overflow-wrap:anywhere; word-break:break-word; }
.table-responsive{ overflow-x:auto; -webkit-overflow-scrolling:touch; }