/* ============================
   Variables de diseno (tema)
   ============================ */
:root {
  --font-main: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;

  --color-primary: #1976d2;
  --color-primary-dark: #145ca5;
  --color-primary-soft: #e3f2fd;
  --color-header-grad-2: #1565c0;

  --color-bg: #f5f5f5;
  --color-card: #ffffff;
  --color-border: #e0e0e0;
  --color-surface: #f8fafc;
  --color-surface-alt: #f1f5f9;
  --color-surface-muted: #eef2f7;
  --color-surface-strong: #e7eef7;

  --color-text-main: #222222;
  --color-text-muted: #666666;

  --color-success: #2e7d32;
  --color-error: #c62828;
  --color-permission-yes-bg: #f0f9f0;
  --color-permission-yes-border: #dcfce7;
  --color-permission-no-bg: #fff5f5;
  --color-permission-no-border: #fed7d7;

  --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-float: 0 10px 24px rgba(0, 0, 0, 0.12);

  --color-table-head: #f2f2f2;
  --color-table-row: #ffffff;
  --color-table-row-alt: #fafafa;
  --color-table-hover: #e8f2ff;

  --color-input-bg: #ffffff;
  --color-input-border: #cccccc;

  --color-btn-secondary-bg: #ffffff;
  --color-btn-secondary-text: #1976d2;
  --color-btn-secondary-border: #1976d2;

  --color-cup-bg: #f6f8fc;
  --color-cup-border: #dbe3ef;
  --color-cup-item-bg: #ffffff;
  --color-cup-item-border: #dfe6f2;
  --color-cup-item-hover: #8ab6f9;

  --font-size-base: 14px;
  --font-size-sm: 13px;
  --font-size-lg: 1.4rem;
  --radius-card: 12px;
}

[data-theme="dark"] {
  --color-primary: #3c7fc1;
  --color-primary-dark: #2f628f;
  --color-primary-soft: #1b2a3b;
  --color-header-grad-2: #1e3f66;

  --color-bg: #0f141a;
  --color-card: #121a24;
  --color-border: #1f2a36;
  --color-surface: #0f1621;
  --color-surface-alt: #151e2a;
  --color-surface-muted: #1b2635;
  --color-surface-strong: #1f2c3d;

  --color-text-main: #e7edf5;
  --color-text-muted: #a1adbd;

  --color-success: #3bb273;
  --color-error: #ff6b6b;
  --color-permission-yes-bg: rgba(46, 125, 50, 0.18);
  --color-permission-yes-border: rgba(46, 125, 50, 0.4);
  --color-permission-no-bg: rgba(198, 40, 40, 0.16);
  --color-permission-no-border: rgba(198, 40, 40, 0.45);

  --color-table-head: #1b2430;
  --color-table-row: #121a24;
  --color-table-row-alt: #16202b;
  --color-table-hover: #1f2a36;

  --color-input-bg: #111821;
  --color-input-border: #2c3a4a;

  --color-btn-secondary-bg: #121a23;
  --color-btn-secondary-text: #cfe4ff;
  --color-btn-secondary-border: #375a8a;

  --color-cup-bg: #101821;
  --color-cup-border: #243244;
  --color-cup-item-bg: #151c24;
  --color-cup-item-border: #273241;
  --color-cup-item-hover: #4fa3ff;

  --shadow-card: 0 6px 18px rgba(0, 0, 0, 0.5);
  --shadow-float: 0 16px 32px rgba(0, 0, 0, 0.55);
}

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

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-main);
  background-color: var(--color-bg);
  color: var(--color-text-main);
  -webkit-font-smoothing: antialiased;
}

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

button,
input,
select,
textarea {
  font-family: inherit;
}

/* === Layout base === */
.page-shell {
  min-height: 100vh;
  background-color: var(--color-bg);
}

.content-container {
  max-width: 1200px;
  margin: 24px auto 40px;
  padding: 0 16px 32px;
}

/* === Tarjetas === */
.card {
  background: var(--color-card);
  border-radius: var(--radius-card);
  padding: 20px 24px;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-card);
}

.card.compact {
  padding: 16px 20px;
}

.section-title {
  margin: 0 0 16px 0;
  color: var(--color-text-main);
  font-size: 1.2rem;
  font-weight: 600;
}

/* === Botones === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: var(--color-primary);
  color: #ffffff;
  font-size: var(--font-size-base);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.05s ease,
    box-shadow 0.15s ease;
}

.btn:hover:not(:disabled) {
  background-color: var(--color-primary-dark);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-sm {
  padding: 6px 12px;
  font-size: var(--font-size-sm);
  font-weight: 600;
}

.btn-primary {
  background: var(--color-primary);
  color: #ffffff;
}

.btn-secondary {
  background: var(--color-btn-secondary-bg);
  color: var(--color-btn-secondary-text);
  border: 1px solid var(--color-btn-secondary-border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--color-primary-soft);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.2);
}

.btn-danger {
  background: #c62828;
  color: #ffffff;
}

.btn-danger:hover:not(:disabled) {
  background: #b71c1c;
}

.btn-success {
  background: #10b981;
  color: #ffffff;
}

.btn-success:hover:not(:disabled) {
  background: #059669;
}

/* === Badges === */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-success {
  background: #e8f5e9;
  color: #2e7d32;
}

.badge-danger {
  background: #ffebee;
  color: #c62828;
}

/* === Estado === */
.status {
  margin-top: 6px;
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.status.error {
  color: var(--color-error);
  font-weight: 600;
}

.status.ok {
  color: var(--color-success);
  font-weight: 600;
}

/* === Tabla base === */
.table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--color-card);
  border-radius: 8px;
  overflow: hidden;
  font-size: var(--font-size-base);
}

.table th,
.table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--color-border);
}

.table th {
  background-color: var(--color-table-head);
  text-align: left;
  font-weight: 700;
}

.table tr:nth-child(even) td {
  background-color: var(--color-table-row-alt);
}

.table tr:hover td {
  background-color: var(--color-table-hover);
}
