/*
  Fecha:       2026-11-16
  Ruta:        talayot-ftp/panel/static/app.css  (en el CT: /opt/talayot-ftp/panel/static/app.css)
  Descripción: Estilos del panel Talayot FTP. Claro y oscuro según el sistema.
*/
:root {
    --bg: #f3f5f4; --card: #ffffff; --text: #17201d; --muted: #5f6b67; --line: #dde3e0;
    --brand: #14332c; --accent: #1f7a62; --accent-text: #ffffff; --danger: #b3261e;
    --warn: #9a6400; --ok: #1f7a3c; --chip: #e7efec;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f1513; --card: #18201d; --text: #e6ece9; --muted: #98a6a0; --line: #2a3531;
        --brand: #0b1f1a; --accent: #3fae8c; --accent-text: #08130f; --danger: #f2867e;
        --warn: #e0a94a; --ok: #6cc489; --chip: #23302b;
    }
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--danger); min-height: 1.2em; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 6px 12px; }
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
button.danger { color: var(--danger); }
button.link { border: 0; background: none; padding: 4px 6px; text-decoration: underline; }
button:disabled { opacity: .5; cursor: default; }
input, select { border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 6px 8px; min-width: 0; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
label.check { flex-direction: row; align-items: center; gap: 6px; }
code, .mono { font-family: ui-monospace, Consolas, monospace; font-size: 13px; word-break: break-all; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 12px; }
.login-card h1 { margin: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }

.topbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; background: var(--brand); color: #e9f2ef; padding: 8px 16px; position: sticky; top: 0; z-index: 5; }
.topbar button { color: #e9f2ef; }
.brand { font-size: 17px; }
.tabs { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.tabs button { background: none; border: 0; color: #b9cfc8; padding: 8px 10px; border-radius: 8px; white-space: nowrap; }
.tabs button.active { background: rgba(255,255,255,.12); color: #fff; }
.user { display: flex; align-items: center; gap: 4px; font-size: 13px; }

main { padding: 16px; max-width: 1280px; margin: 0 auto; }
h2 { margin: 4px 0 12px; font-size: 20px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat b { display: block; font-size: 22px; }

.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
td.actions { display: flex; gap: 6px; }
td.wrap { white-space: normal; }

.chip { display: inline-block; padding: 1px 8px; border-radius: 99px; background: var(--chip); font-size: 12px; }
.chip.ev { background: var(--warn); color: #fff; }
.chip.ok { color: var(--ok); }
.chip.off { color: var(--danger); }
.chip.warn { color: var(--warn); }

dialog { border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--text); padding: 0; width: min(960px, calc(100vw - 32px)); max-height: calc(100vh - 32px); }
dialog::backdrop { background: rgba(0,0,0,.55); }
#modal-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
#modal-body video, #modal-body img { width: 100%; max-height: 65vh; background: #000; border-radius: 8px; object-fit: contain; }
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.row-end { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.creds { background: var(--chip); border-radius: 8px; padding: 12px; }

.banner { background: var(--accent); color: var(--accent-text); text-align: center; padding: 8px; }
.banner button { margin-left: 8px; }
.toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 8px; z-index: 20; max-width: calc(100vw - 32px); }
.more { display: flex; justify-content: center; margin-top: 12px; }

@media (max-width: 640px) {
    main { padding: 12px; }
    .user span { display: none; }
}
