/* Tema compartido por index.html, admin.html y login.html.
   data-theme ("dark" | "light") lo fija /theme.js antes del primer render. */
@font-face {
  font-family: 'Twemoji Country Flags';
  unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E007F;
  src: url('/TwemojiCountryFlags.woff2') format('woff2');
}
:root {
  --chat-bg: #0b141a;
  --bg-dark: #111b21;
  --bg-medium: #202c33;
  --text-on-accent: #111b21;
  --header-title: #00a884;
  /* Superficies (de más oscura a más clara) */
  --surface-1: var(--bg-dark);
  --surface-2: #1f2c34;
  --surface-3: #2a3942;
  --border: #222e35;
  --border-strong: #374045;
  /* Texto */
  --text: #e9edef;
  --text-soft: #aebac1;
  --text-muted: #8696a0;
  --text-faint: #667781;
  /* Acento y estados */
  --accent: #00a884;
  --accent-hover: #06cf9c;
  --info: #53bdeb;
  --warn: #f4b400;
  --danger: #ea4335;
  --danger-text: #ff6b5e;
  --st-mine: var(--accent);
  --st-pending: var(--warn);
  --st-assigned: var(--info);
  --st-closed: var(--text-muted);
  /* Mensajes y detalles */
  --bubble-out: #005c4b;
  --agent-label: #a5d6a7;
  --translation: #b3ddcf;
  --hover: rgba(255,255,255,0.06);
  --busy-overlay: rgba(17,27,33,0.72);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.45);
  color-scheme: dark;
  /* Forma y tipografía */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --font: 'Twemoji Country Flags', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  --ease: 120ms ease;
}
:root[data-theme="light"] {
  --chat-bg: #eef1f4;
  --bg-dark: #ffffff;
  --bg-medium: #ffffff;
  --text-on-accent: #ffffff;
  --surface-2: #f5f6f7;
  --surface-3: #e9edef;
  --border: #e6e9ec;
  --border-strong: #d1d7db;
  --text: #111b21;
  --text-soft: #3b4a54;
  --text-muted: #667781;
  --text-faint: #8696a0;
  --accent: #008069;
  --accent-hover: #017561;
  --info: #027eb5;
  --warn: #b58400;
  --danger: #d93025;
  --danger-text: #d93025;
  --bubble-out: #d9fdd3;
  --agent-label: #1f7a4d;
  --translation: #2a6f5a;
  --hover: rgba(0,0,0,0.05);
  --busy-overlay: rgba(255,255,255,0.78);
  --shadow-lg: 0 12px 40px rgba(11,20,26,0.12);
  color-scheme: light;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font); font-size: 14px; background: var(--surface-1); color: var(--text); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font-family: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Iconos (icon() de /theme.js) */
.ic { flex-shrink: 0; display: inline-block; vertical-align: middle; }
.icon-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; width: 36px; height: 36px; border-radius: var(--r-md); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; position: relative; text-decoration: none; transition: background var(--ease), color var(--ease); }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }

/* Botones y campos */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border: 1px solid transparent; border-radius: var(--r-sm); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background var(--ease), color var(--ease), border-color var(--ease); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-primary { background: var(--accent); color: var(--text-on-accent); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--text-soft); border-color: var(--border-strong); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }
.btn-danger { background: rgba(234,67,53,0.12); color: var(--danger-text); border-color: rgba(234,67,53,0.35); }
.btn-danger:hover:not(:disabled) { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; }
.input { width: 100%; height: 38px; background: var(--surface-3); border: 1px solid var(--border-strong); border-radius: var(--r-sm); padding: 0 12px; color: var(--text); font-size: 14px; outline: none; transition: border-color var(--ease), background var(--ease); }
.input:focus { border-color: var(--accent); background: var(--surface-2); }
.input::placeholder { color: var(--text-faint); }
textarea.input { height: auto; padding: 8px 12px; resize: vertical; line-height: 1.45; }
.input.mono, textarea.input.mono { font-family: var(--font-mono); font-size: 12px; }
