/*
 * Tema "oscuro" para HotelDruid - Residencia Julio Cienfuegos (2026).
 * Se carga después de base.css y stylesheet.css (copia del tema blu) y
 * sobrescribe colores y formas. Solo para pantalla: al imprimir manda paper.css.
 * Licencia: AGPL-3.0 o posterior, como el resto de HotelDruid.
 */

:root {
  --bg: #0e1116;
  --surface: #161b22;
  --surface-2: #1c222b;
  --surface-3: #232a35;
  --hover: #262e3a;
  --border: #2b333f;
  --border-strong: #3a4452;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #58a6ff;
  --accent-strong: #2f81f7;
  --ok: #3fb950;
  --warn: #d29922;
  --danger: #f85149;
  --radius: 8px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Liberation Sans", Arial, sans-serif;
  color-scheme: dark;
}

/* ---------- Base ---------- */

html, body { background: var(--bg) !important; color: var(--text); font-family: var(--font); font-size: 14px; }
body, td, th, input, select, textarea, button { font-family: var(--font); color: var(--text); }
h3, h4, h5 { font-family: var(--font); color: var(--text); letter-spacing: -0.01em; }
h3 { font-size: 1.6em; font-weight: 600; margin: 6px 0 14px 0; }
h4 { font-size: 1.35em; font-weight: 500; }
h5 { font-size: 1.1em; }
small, .smallfont, .xsmallfont { color: var(--muted); }
b, strong { color: inherit; }
hr { border: 0; border-top: 1px solid var(--border); }

a:link, a:visited { color: var(--accent); text-decoration: none; }
a:hover { color: #79b8ff; text-decoration: underline; }
a.noho:hover { color: var(--text); }

.colred { color: var(--danger); }
.colblu, .colinfo { color: var(--accent); }
.colwarn { color: var(--warn); }
.infobox { border: 1px solid var(--accent-strong); border-radius: var(--radius); background: rgba(47,129,247,.08); }

/* Contenedor principal: sin la caja blanca con borde negro */
#menubox { margin: 0; border-top: 0; }
/* HotelDruid desplaza dentro de #contentbox (screen.css pone html con overflow oculto):
   la caja ocupa todo el alto que deja la barra de menú, ocupe esta una línea o dos */
body { display: flex; flex-direction: column; height: 100vh; min-height: 0 !important; }
#menubox { flex: none; }
#contentbox {
  background: var(--bg) !important; border: 0 !important; margin: 0 !important;
  padding: 10px 18px 18px 18px !important; line-height: 1.35;
  box-sizing: border-box; flex: 1 1 auto; min-height: 0; height: auto !important; overflow: auto;
}
#contentbox > table, #contentbox > table[style],
#contentbox > table > tbody > tr > td[style] { background: transparent !important; }
#contentbox > table > tbody > tr > td[style*="height: 57px"],
#contentbox > table > tbody > tr > td[style*="height: 57px"] a { color: var(--muted) !important; }
/* fichas de reserva: dos columnas que quepan en pantallas de 1366 px */
table.modres, div.modres { max-width: 660px; }
table.modres td { padding: 4px 6px; }

/* Fondos blancos escritos en el propio HTML de las páginas */
[style*="background-color: #ffffff"], [style*="background-color:#ffffff"],
[style*="background-color: #FFFFFF"], [style*="background-color: white"],
[bgcolor="#ffffff"], [bgcolor="#FFFFFF"], [bgcolor="white"] {
  background-color: var(--surface) !important;
}
[style*="color: #666666"], [style*="color: #777777"] { color: var(--muted) !important; }
[style*="color: black"], [style*="color: #000000"], [style*="color: #222222"], [style*="color: #333333"] { color: var(--text) !important; }
td[style*="background-color: #cccccc"], td[style*="background-color: #CCCCCC"] { background-color: var(--surface-3) !important; }
td[style*="background-color: #e6e6e6"], td[style*="background-color: #eeeeee"], td[style*="background-color: #dddddd"],
td[bgcolor="#faffff"] { background-color: var(--surface-2) !important; }
.floatcbut { background-color: var(--bg); }

/* ---------- Barra de navegación ---------- */

table.nav_bar {
  background: var(--surface) !important; border: 0; border-bottom: 1px solid var(--border);
  border-radius: 0; position: sticky; top: 0; z-index: 20;
}
table.nav_bar tr td {
  background: transparent !important; height: 46px; color: var(--muted);
  font-family: var(--font); font-size: 13px; border: 0;
}
table.nav_bar tr:first-child td:first-child, table.nav_bar tr:first-child td:last-child { border-radius: 0; }
table.nav td { color: var(--border-strong); }
a.nav, a.nav:visited, a.nonav, a.nonav:visited {
  color: var(--text); padding: 8px 10px 8px 26px; border-radius: 6px; margin: 0 1px;
  background-position: 8px center !important;
}
/* hueco para el icono pequeño (las reglas #nb_* del tema blu usan id) */
table.nav_bar a[id^="nb_"] { padding-left: 28px !important; background-position: 8px center !important; }
.drop ul ul a[id^="nb_"] { padding-left: 32px !important; background-position: 10px center !important; }
a.nav b, a.nonav b, .drop ul ul a b { font-weight: 500; text-transform: lowercase; display: inline-block; }
a.nav b::first-letter, a.nonav b::first-letter, .drop ul ul a b::first-letter { text-transform: uppercase; }
a.nav:hover, .drop ul li:hover > a.nonav { background-color: var(--hover) !important; color: var(--text); text-decoration: none; }
#nb_men b { font-weight: 700; }

.drop ul ul {
  top: 38px; background: var(--surface-2) !important; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 6px; box-shadow: 0 10px 30px rgba(0,0,0,.45);
}
/* puente invisible sobre el hueco entre el botón y el desplegable: sin él,
   al bajar el ratón se pierde el hover y el menú se cierra */
.drop ul ul::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px; }
.drop ul ul li, .drop ul ul a, .lifdrop { background-image: none !important; }
.drop ul ul li { float: none; }
.drop ul ul a, .drop ul ul a:visited {
  background-color: transparent !important; color: var(--text); border-radius: 6px;
  padding: 7px 12px 7px 28px; background-position: 9px center !important; min-width: 150px;
}
.drop ul ul a:hover { background-color: var(--hover) !important; color: var(--text); }
.drop ul ul li:last-child a { padding: 7px 12px 7px 28px; }
.lifdrop, .fdrop { color: var(--muted); padding: 6px 8px; }

/* La X de cerrar y el texto de "situación a las..." */
table.nav_bar a[href*="inizio.php"] + td { color: var(--muted); }

/* ---------- Formularios ---------- */

input[type="text"], input[type="password"], input[type="number"], input[type="email"],
input:not([type]), select, textarea {
  background-color: var(--surface-2) !important; color: var(--text) !important;
  border: 1px solid var(--border-strong) !important; border-radius: 6px; padding: 4px 6px;
}
input[type="text"]:focus, input[type="password"]:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent-strong) !important; box-shadow: 0 0 0 3px rgba(47,129,247,.25);
}
select.smallsel, select.smallsel85, select.rselect { padding: 1px 4px; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent-strong); }
::placeholder { color: var(--muted); }

/* Botones: planos, redondeados; el icono va en el div interior y se respeta */
button, input.sbutton, input.rbutton, .cpbutton, .smallsbutton, input[type="submit"], input[type="button"]:not(.dbutton) {
  background: var(--surface-2) !important; color: var(--text) !important;
  border: 1px solid var(--border-strong) !important; border-radius: var(--radius) !important;
  cursor: pointer; transition: border-color .12s, background-color .12s;
}
button:hover, input.sbutton:hover, input.rbutton:hover, .cpbutton:hover, .smallsbutton:hover,
input[type="submit"]:hover, input[type="button"]:not(.dbutton):hover {
  background: var(--surface-3) !important; border-color: var(--accent-strong) !important;
}
button[class] { min-height: 38px; padding: 0 6px; }
button[class] div { padding-top: 9px !important; padding-bottom: 9px !important; font-weight: 500; }
input.sbutton, input[type="submit"] { padding: 5px 12px; }
input.rbutton, .smallsbutton, .cpbutton { padding: 2px 8px; }
/* botón del calendario: conservar el icono */
.dbutton {
  background: transparent url('../img/calpick.png') no-repeat center top !important;
  border: 0 !important; filter: invert(.85) hue-rotate(180deg);
}

/* ---------- Tablas ---------- */

table, td { border-color: var(--border); }
.t1color { background-color: var(--surface) !important; }
table.t1, table.t1wc, table.me1, table.m2 {
  border-collapse: separate !important; border-spacing: 0; border: 1px solid var(--border) !important;
  border-radius: 10px; background: var(--surface) !important;
}
table.t1 tr td, table.t1wc tr td, table.me1 tr td, table.m2 tr td {
  border: 0 !important; border-bottom: 1px solid var(--border) !important; padding: 6px 8px;
}
table.t1 tr:last-child td, table.t1wc tr:last-child td { border-bottom: 0 !important; }
table.t1 tr:first-child td, table.me1 tr:first-child td, table.t1 tr:last-child td, table.me1 tr:last-child td {
  background-image: none !important;
}
table.t1 tr:first-child td, table.t1wc tr:first-child td {
  background-color: var(--surface-2); color: var(--muted); font-size: .92em; font-weight: 600;
}
table.t1 tr:first-child td a, table.t1wc tr:first-child td a { color: var(--muted); }
/* fila de títulos fija al desplazar (HotelDruid solo marca algunas celdas con .t1top);
   top negativo = el relleno superior de #contentbox, para que no asome nada por encima */
table.t1 > tbody > tr:first-child > td, .t1top, .m1top { position: sticky; top: -10px; z-index: 3; }
table.t1 > tbody > tr:first-child > td.t1left, table.t1 > tbody > tr:first-child > td.t1left1,
table.t1 > tbody > tr:first-child > td.t1left2 { z-index: 4; }
tr.t1row2, table.t1 tr:nth-child(even):not(:first-child) { background-color: #181e26; }
table.t1 tr:not(:first-child):hover, table.t1wc tr:hover, table.m1 tr:not(:first-child):hover,
table.m2 tr:not(:first-child):hover { background-color: var(--hover) !important; }
table.t1 tr:not(:first-child):hover td.t1left, table.t1 tr:not(:first-child):hover td.t1left1,
table.t1 tr:not(:first-child):hover td.t1left2, table.m1 tr:not(:first-child):hover td.t1left,
table.m2 tr:not(:first-child):hover td.t1left { background-color: var(--hover) !important; }
.t1top, .t1left, .t1left1, .t1left2 { background-color: var(--surface-2) !important; }
.t1wc .t1top, .t1wc .t1left, .t1wc .t1left1, .t1wc .t1left2 { background-color: var(--surface) !important; }

.rbox { border: 1px solid var(--border) !important; border-radius: 12px; background: var(--surface); padding: 8px 12px; }
textarea { border-color: var(--border-strong); }

/* Estados de reserva (tablas y listados) en tonos legibles sobre oscuro */
.bcolunconf { background-color: #8e1b1b !important; }
.bcolconf { background-color: #8a5a00 !important; }
.bcoldeposit { background-color: #6b5d00 !important; }
.bcolpaid { background-color: #1d5b3a !important; }
.bcoldeleted, .bcoldeleted .t1left { background-color: #3a3f47 !important; }
.bcolclosed { background-color: #2d3139 !important; }
table tr:not(:first-child):hover td.bcolclosed { background-color: #3a3f47 !important; }

/* Colores fuertes que algunas páginas escriben directamente */
td[style*="#00ff00" i], td[style*="#00FF00"] { background-color: #1d5b3a !important; color: #d7ffe4 !important; }
td[style*="#ff9900" i], td[style*="#FF9900"] { background-color: #7a4f00 !important; color: #ffe8bf !important; }
td[style*="#ff0000" i], td[style*="#FF0000"] { background-color: #8e1b1b !important; color: #ffdede !important; }

/* ---------- Tabla del mes ---------- */

table.m1ext { border: 1px solid var(--border); border-radius: 10px; }
table.m1 tr td { border: 1px solid var(--bg) !important; }
table.m1 tr td td { border: none !important; }
.pren table { border-radius: 6px; }
.pren a:link, .pren a:visited { color: #f0f6fc; font-weight: 500; }
.pren a:hover { color: #ffffff; text-decoration: underline; }

/* ---------- Selector de fechas ---------- */

.datepick { background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius);
  color: var(--text); font-family: var(--font); box-shadow: 0 10px 30px rgba(0,0,0,.45); }

/* ---------- Login ---------- */

#flogin {
  max-width: 340px; margin: 12vh auto 0 auto; padding: 28px 30px !important;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5); line-height: 2.2 !important;
}
#flogin big big { font-size: 1.35em; font-weight: 600; }
#flogin input[type="text"], #flogin input[type="password"] { width: 100%; box-sizing: border-box; padding: 8px 10px; line-height: 1.2; }
#flogin button.login { width: 100%; margin-top: 10px; justify-content: center; }
#flogin button.login div { display: inline-block; }
#flogin div[style*="position: absolute"] { background: transparent !important; color: var(--muted) !important; line-height: 1.4; }
#flogin div[style*="position: absolute"] a { color: var(--muted) !important; }

/* ---------- Menú principal ---------- */

#mmenu, #flogin { background-image: none; }
#mmenu { max-width: 980px; margin: 0 auto; }
#mm_sub4 { border-radius: 12px; }

/* Pie con el aviso de licencia: se conserva, pero discreto */
#contentbox small, #contentbox .xsmallfont { color: var(--muted); }

/* ---------- Varios ---------- */

.logout a:link, .logout a:visited, .logout a:hover { color: var(--muted); }
.dphoto { border-radius: var(--radius); }
#aziobar > div { background-color: var(--surface) !important; border-radius: var(--radius); }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 6px; border: 2px solid var(--bg); }

/* Residencia: menú Facturación */
#nb_fac { background: url("../img/incomes_mini.png") no-repeat left center; }
#nb_elec { background: url("../img/statistics_mini.png") no-repeat left center; }
#nb_pool { background: url("../img/documents_mini.png") no-repeat left center; }
#nb_hpool { background: url("../img/resall_mini.png") no-repeat left center; }
.nb_fac ul ul a, .nb_fac ul ul a:visited, .nb_fac ul ul a:hover { min-width: 120px; }
