/* Design System: Papel & Tinta (Minimalismo Calmo) */

:root {
  --bg: #fafbfc;
  --text: #1f2328;
  --muted: #6b7280;
  --soft: #f1f3f5;
  --soft-hover: #e9ecef;
  --border: #e6e8eb;
  --accent: #2f6feb;
  --code-bg: #f6f8fa;
  --code-fg: #24292f;
  --error: #b42318;
  --toast-bg: #1f2328;
  --toast-fg: #f6f8fa;
}

html.dark {
  --bg: #0f1115;
  --text: #e6e8eb;
  --muted: #9aa4b2;
  --soft: #1b1f26;
  --soft-hover: #232833;
  --border: #262b33;
  --accent: #5b9bff;
  --code-bg: #14171d;
  --code-fg: #e6e8eb;
  --error: #ff8a80;
  --toast-bg: #e6e8eb;
  --toast-fg: #14171d;
}

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

html,
body {
  background-color: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  width: 100%;
  box-shadow: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Accessible focus: blue (--accent) is reserved exclusively for focus-visible and form controls */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

input, select, textarea, button {
  accent-color: var(--accent);
}

/* Zero glassmorphism and heavy shadows */
.card,
.panel {
  background-color: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: none;
}

/* Rail & Pill Navigation */
.nav-rail {
  background-color: var(--soft);
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: 3px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.nav-pill {
  border-radius: 9999px;
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid transparent;
  transition: color 0.15s ease, background-color 0.15s ease;
  white-space: nowrap;
}

.nav-pill:hover {
  color: var(--text);
}

.nav-pill-active {
  background-color: var(--bg);
  color: var(--text);
  border-color: var(--border);
  font-weight: 600;
}

/* Admin Tabs (Rail & Pill) */
.tabs-rail {
  background-color: var(--soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.tab-pill {
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab-pill:hover {
  color: var(--text);
}

.tab-pill.active {
  background-color: var(--bg);
  color: var(--text);
  border-color: var(--border);
  font-weight: 600;
}

/* Buttons */
.btn-ink {
  background-color: var(--text);
  color: var(--bg);
  border: 1px solid var(--text);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity 0.15s ease;
  text-decoration: none;
}

.btn-ink:hover {
  opacity: 0.88;
}

.btn-soft {
  background-color: var(--soft);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background-color 0.15s ease;
  text-decoration: none;
}

.btn-soft:hover {
  background-color: var(--soft-hover);
}

/* Ghost actions: discrete buttons that gain presence on hover */
.btn-ghost {
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.btn-ghost:hover {
  color: var(--text);
  background-color: var(--soft-hover);
}

.btn-ghost-danger {
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.btn-ghost-danger:hover {
  color: var(--error);
  background-color: var(--soft-hover);
}

/* Form fields */
.form-input,
.form-textarea {
  width: 100%;
  background-color: var(--soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease;
}

.form-input:focus,
.form-textarea:focus {
  border-color: var(--accent);
}

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 6px;
}

/* Code & monospace */
pre, code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  background-color: var(--code-bg);
  color: var(--code-fg);
  border-radius: 4px;
}

/* Minimal Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

/* Print Styles */
@media print {
  nav,
  footer,
  .no-print,
  button {
    display: none !important;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    padding: 0 !important;
    font-size: 12pt;
  }

  main {
    padding-top: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
  }

  .card, .panel {
    border: none !important;
    padding: 0 !important;
  }
}
