/*
Theme Name: RansHosting
Theme URI: https://ranstechdigital.com
Author: RansTech Digital
Author URI: https://ranstechdigital.com
Description: Client portal with multiple services per client (hosting, email accounts, domain registrations, website maintenance), any number of logins per service, billing invoice, technical health, and 45d-24h renewal reminders, managed from a WordPress backend. Branded for RansTech Digital.
Version: 2.4.0
License: GNU General Public License v2 or later
Text Domain: ranshosting
*/

/* =========================================================================
   BRAND TOKENS — RansTech Digital
   Edit these few values to match the brand palette exactly.
   ========================================================================= */
/* Warm cream, sage and plum, with a system type stack. */
:root {
  --ink:          #202b29;
  --coral:        #a8d3bd;
  --coral-hi:     #bddfcd;
  --coral-deep:   #3c695b;
  --sky:          #90c8b3;
  --sand:         #efbd79;
  --mist:         #f1f5ef;
  --paper:        #faf7f1;

  --brand:        #a8d3bd;
  --brand-hover:  #bddfcd;
  --brand-2:      #90c8b3;
  --brand-grad:   linear-gradient(135deg, #a8d3bd 0%, #efbd79 100%);

  /* Dark mode: the site's ink-blue panels */
  --bg:           #202b29;
  --bg-elev:      #293733;
  --bg-card:      #2c3b36;
  --bg-input:     #202c28;
  --bg-hover:     rgba(174, 209, 220, 0.07);
  --border:       rgba(174, 209, 220, 0.18);
  --border-strong:rgba(174, 209, 220, 0.34);

  --text:         #f1f8fa;
  --text-muted:   #aed1dc;
  --text-dim:     #8fb0bb;
  --link:         #90c8b3;

  --success:      #34d399;
  --warning:      #efbd79;
  --danger:       #f48b80;
  --success-bg:   rgba(52, 211, 153, 0.13);
  --warning-bg:   rgba(231, 169, 84, 0.16);
  --danger-bg:    rgba(244, 139, 128, 0.15);
  --whatsapp:     #25d366;

  --radius:       22px;
  --radius-sm:    12px;
  --shadow:       0 16px 36px -20px rgba(0, 0, 0, 0.6);
  --font:         system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: var(--font);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg:           #faf7f1;
  --bg-elev:      #ffffff;
  --bg-card:      #ffffff;
  --bg-input:     #f1f5ef;
  --bg-hover:     rgba(5, 42, 60, 0.045);
  --border:       #dfe7dc;
  --border-strong:rgba(5, 42, 60, 0.26);

  --text:         #202b29;
  --text-muted:   #455850;
  --text-dim:     #52655c;
  --link:         #3c695b;
  --brand-2:      #397b66;

  --success:      #0b7a55;
  --warning:      #a55a05;
  --danger:       #c0262d;
  --success-bg:   rgba(16, 163, 115, 0.12);
  --warning-bg:   rgba(231, 169, 84, 0.20);
  --danger-bg:    rgba(220, 38, 38, 0.10);
  --shadow:       0 18px 44px -26px rgba(5, 42, 60, 0.28);
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body.ranshosting-body {
  font-family: var(--font);
  background:
    radial-gradient(900px 460px at 88% -12%, rgba(186, 148, 179, 0.18), transparent 62%),
    radial-gradient(700px 400px at -6% 6%, rgba(131, 177, 152, 0.12), transparent 58%),
    var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
:root[data-theme="light"] body.ranshosting-body {
  background:
    radial-gradient(900px 460px at 88% -12%, rgba(186, 148, 179, 0.10), transparent 62%),
    radial-gradient(700px 400px at -6% 6%, rgba(131, 177, 152, 0.18), transparent 58%),
    var(--bg);
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; border-radius: 4px; }

.rh-container { --gutter: 1.5rem; max-width: 1280px; margin: 0 auto; padding: 0 var(--gutter); }
.rh-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.rh-skip { position: absolute; left: -999px; top: 8px; z-index: 2000; background: var(--brand); color: #151b22; padding: 0.5rem 0.9rem; border-radius: 8px; }
.rh-skip:focus { left: 8px; }

.rh-i { width: 1.05em; height: 1.05em; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Brand + page tools (no site header) ---------- */
.rh-brandline {
  display: inline-flex; align-items: center; gap: 0.65rem; padding: 0.32rem 1rem 0.32rem 0.36rem; margin-bottom: 1.2rem;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 999px; box-shadow: var(--shadow);
}
.rh-brand-badge {
  width: 32px; height: 32px; border-radius: 50%; background: var(--brand-grad); color: #151b22;
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 1rem;
  box-shadow: 0 6px 16px -6px rgba(186, 148, 179, 0.7);
}
.rh-brand-logo { height: 30px; width: auto; display: block; margin: 0 0.5rem; }
.rh-brand-text { display: flex; flex-direction: column; line-height: 1.12; }
.rh-brand-name { font-family: var(--font-display); font-weight: 800; font-size: 0.95rem; letter-spacing: -0.01em; }
.rh-brand-by { font-size: 0.7rem; color: var(--text-muted); }

.rh-dock { position: fixed; left: 16px; bottom: 16px; z-index: 900; display: flex; flex-direction: column-reverse; gap: 0.5rem; }
.rh-icon-btn {
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px;
  background: var(--bg-card); border: 1px solid var(--border-strong); color: var(--text-muted); cursor: pointer;
  box-shadow: var(--shadow); transition: background 0.15s, color 0.15s, transform 0.15s;
}
.rh-icon-btn:hover { background: var(--bg-elev); color: var(--text); transform: translateY(-2px); }
.rh-icon-btn[hidden] { display: none; }
.rh-icon-btn .rh-i { width: 18px; height: 18px; }
.rh-icon-btn-sm { width: 34px; height: 34px; border-radius: 10px; box-shadow: none; background: var(--bg-hover); border-color: var(--border); }
.rh-icon-btn-sm .rh-i { width: 16px; height: 16px; }
.rh-i-sun { display: none; }
:root[data-theme="light"] .rh-i-sun { display: block; }
:root[data-theme="light"] .rh-i-moon { display: none; }

/* ---------- Buttons ---------- */
.rh-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 0.6rem 1.05rem; border-radius: 14px; border: 1px solid transparent;
  font-family: inherit; font-size: 0.88rem; font-weight: 600; line-height: 1.2; cursor: pointer;
  text-decoration: none !important; transition: background 0.18s, border-color 0.18s, box-shadow 0.18s, color 0.18s;
  white-space: nowrap;
}
.rh-btn-sm { padding: 0.45rem 0.8rem; font-size: 0.8rem; }
.rh-btn-xs { padding: 0.25rem 0.55rem; font-size: 0.74rem; border-radius: 7px; }
.rh-btn-block { width: 100%; }
.rh-btn-primary { background: var(--brand); color: #151b22; box-shadow: 0 8px 20px -10px rgba(186, 148, 179, 0.7); }
.rh-btn-primary:hover { background: var(--brand-hover); color: #151b22; }
.rh-btn-outline { background: transparent; color: var(--text); border-color: var(--border-strong); }
.rh-btn-outline:hover { background: var(--bg-hover); }
.rh-btn-ghost { background: var(--bg-hover); color: var(--text); border-color: var(--border); }
.rh-btn-ghost:hover { border-color: var(--border-strong); }
.rh-btn-wa { background: rgba(37, 211, 102, 0.14); color: #176b3a; border-color: rgba(37, 211, 102, 0.42); }
:root:not([data-theme="light"]) .rh-btn-wa { color: #4ade80; }
.rh-btn-wa:hover { background: var(--whatsapp); color: #062b16; }
.rh-btn.is-up { color: var(--success); border-color: var(--success); }
.rh-btn.is-down { color: var(--danger); border-color: var(--danger); }

/* ---------- Hero ---------- */
.rh-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 1.5rem 3rem; padding: clamp(1.25rem, 4vw, 3rem); margin: clamp(1rem, 3vw, 2rem) 0 1.25rem; border: 1px solid var(--border); border-radius: var(--radius); background: linear-gradient(130deg, var(--bg-elev), var(--bg-input)); }
.rh-hero h1 { font-family: var(--font-display); font-size: clamp(2.1rem, 4.6vw, 3.5rem); line-height: 1.12; letter-spacing: -0.025em; font-weight: 740; max-width: 20ch; overflow-wrap: anywhere; }
.rh-grad { color: var(--link); }
.rh-lede { max-width: 58ch; color: var(--text-muted); font-size: 1.06rem; margin-top: 1rem; }
.rh-hero-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: flex-end; }
.rh-muted { color: var(--text-muted); font-size: 0.85rem; }

.rh-gate { max-width: 560px; margin: 6rem auto; text-align: left; }
.rh-gate h1 { font-family: var(--font-display); font-size: 2.2rem; letter-spacing: -0.02em; margin-bottom: 0.7rem; }
.rh-gate p { color: var(--text-muted); margin-bottom: 1.4rem; }

/* ---------- Summary cards ---------- */
.rh-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.9rem; margin-bottom: 1.1rem; }
.rh-stat {
  position: relative; min-width: 0; overflow: hidden; padding: 1.15rem 1.25rem 1.2rem;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: transform 0.2s, border-color 0.2s;
}
.rh-stat:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.rh-stat::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--accent, var(--brand-grad)); }
.rh-stat.is-warn { --accent: var(--warning); --ico: var(--warning); }
.rh-stat.is-bad { --accent: var(--danger); --ico: var(--danger); }
.rh-stat.is-money { --ico: var(--link); }
.rh-stat-ico { position: absolute; right: 1rem; top: 1rem; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: var(--ico, var(--text-muted)); background: color-mix(in srgb, var(--ico, var(--text-muted)) 13%, transparent); }
.rh-stat-ico .rh-i { width: 18px; height: 18px; }
.rh-stat-val { font-family: var(--font-display); font-size: 2.2rem; font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; padding-right: 2.6rem; }
.rh-stat-money { font-size: 1.45rem; padding-top: 0.45rem; overflow-wrap: anywhere; }
.rh-stat-label { font-size: 0.88rem; font-weight: 700; margin-top: 0.3rem; }
.rh-stat-sub { font-size: 0.8rem; color: var(--text-dim); margin-top: 0.15rem; overflow-wrap: anywhere; }
.rh-stat.is-warn .rh-stat-val { color: var(--warning); }
.rh-stat.is-bad .rh-stat-val { color: var(--danger); }
.rh-meter { height: 6px; border-radius: 999px; background: var(--bg-hover); border: 1px solid var(--border); overflow: hidden; margin-top: 0.55rem; }
.rh-meter > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--success), var(--sky)); }

/* ---------- Needs attention ---------- */
.rh-attn { margin-bottom: 1.1rem; padding: 1rem 1.2rem 1.1rem; border-radius: var(--radius); border: 1px solid color-mix(in srgb, var(--danger) 38%, var(--border)); background: color-mix(in srgb, var(--danger) 7%, var(--bg-card)); box-shadow: var(--shadow); }
.rh-attn[hidden] { display: none; }
.rh-attn-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.rh-attn-head h2 { font-family: var(--font-display); font-size: 1.02rem; font-weight: 700; display: flex; align-items: center; gap: 0.5rem; letter-spacing: -0.01em; }
.rh-attn-head h2 .rh-i { color: var(--danger); }
.rh-attn-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.55rem; margin-top: 0.75rem; }
.rh-attn-item { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.55rem 0.7rem 0.55rem 0.9rem; background: var(--bg-card); border: 1px solid var(--border); border-left: 4px solid var(--danger); border-radius: 12px; }
.rh-attn-item.is-expiring { border-left-color: var(--warning); }
.rh-attn-item.is-active { border-left-color: var(--brand-2); }
.rh-attn-main { flex: 1; min-width: 0; text-align: left; background: none; border: 0; color: inherit; font-family: inherit; cursor: pointer; padding: 0; }
.rh-attn-main b { display: block; font-family: var(--font-display); font-size: 0.98rem; overflow-wrap: anywhere; }
.rh-attn-main span { display: block; font-size: 0.8rem; color: var(--text-muted); }
.rh-attn-main:hover b { color: var(--link); }

/* ---------- Renewal timeline ---------- */
.rh-timeline { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.3rem 0.9rem; margin-bottom: 1.2rem; box-shadow: var(--shadow); }
.rh-timeline-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 0.4rem 1rem; }
.rh-timeline-head h2 { font-family: var(--font-display); font-size: 1.02rem; font-weight: 700; letter-spacing: -0.01em; }
.rh-legend { display: flex; gap: 1rem; font-size: 0.78rem; color: var(--text-muted); flex-wrap: wrap; }
.rh-legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; background: var(--c); }
.rh-legend .is-active { --c: var(--success); }
.rh-legend .is-expiring { --c: var(--warning); }
.rh-legend .is-expired { --c: var(--danger); }

.rh-track { position: relative; margin-top: 0.7rem; border-radius: 10px; background: var(--bg-input); border: 1px solid var(--border); min-height: 48px; overflow: visible; }
.rh-zone { position: absolute; top: 0; bottom: 0; }
.rh-zone-over { left: 0; background: var(--danger-bg); border-radius: 10px 0 0 10px; }
.rh-zone-warn { background: var(--warning-bg); }
.rh-today { position: absolute; top: -5px; bottom: -5px; width: 2px; background: var(--text); opacity: 0.7; border-radius: 2px; }
.rh-dot {
  position: absolute; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%;
  border: 2px solid var(--bg-card); background: var(--c); cursor: pointer; padding: 0;
  box-shadow: 0 0 0 1px var(--c); transition: transform 0.12s;
}
.rh-dot:hover, .rh-dot:focus-visible { transform: scale(1.35); z-index: 5; }
.rh-dot.is-active { --c: var(--success); }
.rh-dot.is-expiring { --c: var(--warning); }
.rh-dot.is-expired { --c: var(--danger); }
.rh-dot::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg); font-size: 0.74rem; font-weight: 600; padding: 0.3rem 0.6rem; border-radius: 7px;
  white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 0.12s;
}
.rh-dot.tip-left::after { left: auto; right: -6px; transform: none; }
.rh-dot:hover::after, .rh-dot:focus-visible::after { opacity: 1; }
.rh-track-empty { position: absolute; inset: 0; display: grid; place-items: center; font-size: 0.84rem; color: var(--text-dim); }
.rh-axis { position: relative; height: 1.3rem; margin-top: 0.35rem; font-size: 0.74rem; color: var(--text-dim); }
.rh-tick { position: absolute; transform: translateX(-50%); }
.rh-axis .rh-tick:first-child { font-weight: 700; color: var(--text); }
.rh-axis .rh-tick:last-child { transform: translateX(-100%); }
.rh-timeline-foot { font-size: 0.78rem; color: var(--text-dim); margin-top: 0.15rem; }

.rh-notice { background: var(--warning-bg); border: 1px solid color-mix(in srgb, var(--warning) 35%, transparent); color: var(--warning); border-radius: 10px; padding: 0.6rem 0.9rem; font-size: 0.85rem; margin-bottom: 1rem; }

/* ---------- Toolbar ---------- */
.rh-toolbar { margin: 0 calc(var(--gutter) * -1) 1rem; padding: 0.75rem var(--gutter) 0.1rem; transition: box-shadow 0.2s, border-color 0.2s; border-bottom: 1px solid transparent; }
@media (min-width: 901px) {
  .rh-toolbar { position: sticky; top: 0; z-index: 60; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
  .rh-toolbar.is-stuck { border-bottom-color: var(--border); box-shadow: 0 14px 26px -24px rgba(5, 42, 60, 0.6); }
}
.rh-controls { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; margin-bottom: 0.8rem; }
.rh-search { position: relative; flex: 1 1 280px; display: block; }
.rh-search .rh-i { position: absolute; left: 0.85rem; top: 50%; transform: translateY(-50%); color: var(--text-dim); pointer-events: none; }
.rh-search kbd { position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%); font-family: var(--font); font-size: 0.72rem; color: var(--text-dim); border: 1px solid var(--border-strong); border-radius: 6px; padding: 0 0.42rem; }
.rh-search kbd[hidden] { display: none; }
.rh-search-clear { position: absolute; right: 0.4rem; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; display: grid; place-items: center; border: 0; background: var(--bg-hover); color: var(--text-muted); border-radius: 8px; cursor: pointer; }
.rh-search-clear[hidden] { display: none; }
.rh-search-clear .rh-i { position: static; transform: none; width: 14px; height: 14px; color: inherit; }
.rh-controls input, .rh-controls select {
  background: var(--bg-card); border: 1px solid var(--border-strong); color: var(--text);
  padding: 0.68rem 0.9rem; border-radius: 12px; font-family: inherit; font-size: 0.9rem; box-shadow: var(--shadow);
}
.rh-search input { width: 100%; padding-left: 2.5rem; padding-right: 2.6rem; }
.rh-controls select { min-width: 160px; }
.rh-controls input:focus, .rh-controls select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(186, 148, 179, 0.28); }

.rh-subbar { display: flex; justify-content: space-between; align-items: center; gap: 0.7rem 1rem; flex-wrap: wrap; padding-bottom: 0.8rem; }
.rh-tabs { display: flex; gap: 0.15rem; flex-wrap: wrap; padding: 3px; background: var(--bg-hover); border: 1px solid var(--border); border-radius: 14px; }
.rh-tab { font-family: inherit; font-size: 0.84rem; font-weight: 600; color: var(--text-muted); background: transparent; border: 0; border-radius: 11px; padding: 0.42rem 0.85rem; cursor: pointer; transition: background 0.15s, color 0.15s; }
.rh-tab:hover { color: var(--text); }
.rh-tab[aria-pressed="true"] { background: var(--bg-card); color: var(--text); box-shadow: 0 2px 8px -3px rgba(5, 42, 60, 0.35), 0 0 0 1px var(--border-strong); }
.rh-count { font-weight: 700; opacity: 0.65; margin-left: 0.2rem; }
.rh-subbar-actions { display: flex; gap: 0.45rem; flex-wrap: wrap; align-items: center; }

.rh-seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--bg-hover); border: 1px solid var(--border); border-radius: 11px; }
.rh-seg button { width: 32px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--text-muted); cursor: pointer; }
.rh-seg button[aria-pressed="true"] { background: var(--bg-card); color: var(--text); box-shadow: 0 0 0 1px var(--border-strong); }
.rh-seg .rh-i { width: 16px; height: 16px; }

.rh-more { position: relative; }
.rh-more summary { list-style: none; cursor: pointer; user-select: none; }
.rh-more summary::-webkit-details-marker { display: none; }
.rh-more[open] summary .rh-i { transform: rotate(180deg); }
.rh-more-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 250px; z-index: 80; padding: 0.35rem; background: var(--bg-card); border: 1px solid var(--border-strong); border-radius: 14px; box-shadow: 0 24px 50px -16px rgba(5, 42, 60, 0.45); }
.rh-more-menu button { display: flex; align-items: center; gap: 0.6rem; width: 100%; padding: 0.55rem 0.7rem; border: 0; border-radius: 9px; background: transparent; color: var(--text); font-family: inherit; font-size: 0.86rem; font-weight: 600; text-align: left; cursor: pointer; }
.rh-more-menu button:hover { background: var(--bg-hover); }
.rh-more-menu .rh-i { color: var(--text-muted); }

/* ---------- Service rows ---------- */
.rh-list { display: grid; gap: 0.8rem; padding-bottom: 5rem; }
.rh-service {
  position: relative; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.rh-service:hover:not(.is-open) { transform: translateY(-2px); }
.rh-service::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--rail, var(--brand)); }
.rh-service.is-active { --rail: var(--success); }
.rh-service.is-expiring { --rail: var(--warning); }
.rh-service.is-expired { --rail: var(--danger); }
.rh-service:hover, .rh-service.is-open { border-color: var(--border-strong); }
.rh-service.is-flash { animation: rhFlash 1.4s ease-out; }
@keyframes rhFlash { from { box-shadow: 0 0 0 3px var(--brand-2); } to { box-shadow: var(--shadow); } }

.rh-row {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.05fr) minmax(0, 0.8fr) auto;
  gap: 1rem 1.6rem; align-items: center; padding: 1rem 1.2rem 1rem 1.5rem; cursor: pointer;
}
.rh-domain { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.rh-domain a { color: var(--text); overflow-wrap: anywhere; }
.rh-meta { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; margin-top: 0.15rem; font-size: 0.82rem; color: var(--text-muted); }
.rh-type { font-weight: 600; color: var(--text); background: var(--bg-hover); border: 1px solid var(--border); border-radius: 6px; padding: 0 0.45rem; }
.rh-owner-line { color: var(--text-muted); font-size: 0.84rem; margin-top: 0.2rem; overflow-wrap: anywhere; }
.rh-owner-line span { color: var(--text-dim); margin-left: 0.4rem; }

.rh-days { font-size: 0.86rem; color: var(--text-muted); }
.rh-days b { font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; color: var(--text); letter-spacing: -0.02em; margin-right: 0.1rem; }
.is-expiring .rh-days b { color: var(--warning); }
.is-expired .rh-days b { color: var(--danger); }
.rh-bar { height: 5px; border-radius: 999px; background: var(--bg-hover); border: 1px solid var(--border); overflow: hidden; margin: 0.35rem 0 0.3rem; }
.rh-bar > i { display: block; height: 100%; background: var(--rail, var(--brand)); border-radius: 999px; }
.rh-term-dates { font-size: 0.76rem; color: var(--text-dim); }

.rh-amt { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; margin-bottom: 0.3rem; }
.rh-amt small { font-family: var(--font); font-weight: 500; font-size: 0.76rem; color: var(--text-dim); }
.rh-row-actions { display: flex; align-items: center; gap: 0.5rem; justify-content: flex-end; }
.rh-expander { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; border: 1px solid var(--border); background: transparent; color: var(--text-muted); cursor: pointer; }
.rh-expander:hover { background: var(--bg-hover); color: var(--text); }
.rh-expander .rh-i { width: 18px; height: 18px; transition: transform 0.2s; }
.rh-service.is-open .rh-expander .rh-i { transform: rotate(180deg); }

/* ---------- Compact layout ---------- */
.rh-list.is-compact { gap: 0.4rem; }
.is-compact .rh-service { border-radius: 14px; box-shadow: none; }
.is-compact .rh-service:hover:not(.is-open) { transform: none; }
.is-compact .rh-row { padding: 0.55rem 1rem 0.55rem 1.3rem; gap: 0.4rem 1.3rem; }
.is-compact .rh-domain { font-size: 1rem; }
.is-compact .rh-meta, .is-compact .rh-bar, .is-compact .rh-term-dates, .is-compact .rh-owner-line span { display: none; }
.is-compact .rh-owner-line { margin-top: 0; font-size: 0.8rem; }
.is-compact .rh-days b { font-size: 1.1rem; }
.is-compact .rh-amt { font-size: 1rem; margin-bottom: 0; }
.is-compact .rh-row-money { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.is-compact .rh-expander { width: 30px; height: 30px; }

/* ---------- Badges ---------- */
.rh-badge { padding: 0.15rem 0.55rem; border-radius: 6px; font-size: 0.74rem; font-weight: 700; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.rh-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.rh-badge-ok { background: var(--success-bg); color: var(--success); }
.rh-badge-warn { background: var(--warning-bg); color: var(--warning); }
.rh-badge-bad { background: var(--danger-bg); color: var(--danger); }
.rh-badge-demo { background: rgba(186, 148, 179, 0.16); color: var(--link); font-family: var(--font); font-size: 0.7rem; font-weight: 700; }
.rh-badge-demo::before { display: none; }

/* ---------- Expanded details ---------- */
.rh-detail { border-top: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 40%, var(--bg-card)); padding-left: 4px; }
.rh-detail[hidden] { display: none; }
.rh-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rh-cell { padding: 1rem 1.2rem 1.1rem; min-width: 0; border-left: 1px solid var(--border); }
.rh-cell:first-child { border-left: 0; }
.rh-cell h4 { font-size: 0.9rem; font-weight: 700; margin-bottom: 0.65rem; }
.rh-kv { display: flex; justify-content: space-between; gap: 0.7rem; font-size: 0.84rem; padding: 0.3rem 0; border-bottom: 1px dashed var(--border); }
.rh-kv:last-child { border-bottom: 0; }
.rh-kv dt { color: var(--text-muted); flex-shrink: 0; }
.rh-kv dd { text-align: right; overflow-wrap: anywhere; }
.rh-cell-foot { margin-top: 0.65rem; }

.rh-mini { background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.5rem 0.65rem; margin-bottom: 0.4rem; font-size: 0.82rem; min-width: 0; }
.rh-mini:last-child { margin-bottom: 0; }
.rh-mini-empty { color: var(--text-dim); }
.rh-cred-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; font-weight: 700; }
.rh-cred-head a { font-size: 0.78rem; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.rh-cred-row { display: flex; align-items: center; justify-content: space-between; gap: 0.4rem; margin-top: 0.35rem; }
.rh-cred-head + .rh-cred-row { margin-top: 0.4rem; }
.rh-cred-row .rh-mono { overflow-wrap: anywhere; min-width: 0; }
.rh-cred-btns { display: flex; gap: 0.25rem; flex-shrink: 0; }
.rh-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 0.78rem; }

.rh-note { margin: 0 1.2rem 0.9rem; padding: 0.55rem 0.8rem; border-radius: var(--radius-sm); background: var(--bg-hover); border: 1px solid var(--border); font-size: 0.86rem; color: var(--text-muted); }
.rh-note b { color: var(--text); margin-right: 0.4rem; }
.rh-detail-foot { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; padding: 0.8rem 1.2rem; border-top: 1px solid var(--border); }
.rh-foot-spacer { flex: 1; }

.rh-empty { text-align: center; padding: 3.2rem 1rem; color: var(--text-muted); border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.rh-empty h3 { font-family: var(--font-display); font-size: 1.25rem; color: var(--text); margin-bottom: 0.4rem; }
.rh-empty p { max-width: 46ch; margin: 0 auto 1.1rem; }

/* ---------- Client groups ---------- */
.rh-list.is-grouped { gap: 1.9rem; }
.rh-group { display: grid; gap: 0.75rem; }
.rh-group-list { display: grid; gap: 0.8rem; }
.rh-list.is-compact .rh-group-list { gap: 0.4rem; }
.rh-group-head { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 0.6rem 1rem; padding-left: 0.85rem; border-left: 4px solid var(--brand); }
.rh-group-id { min-width: 0; }
.rh-group-head h3 { font-family: var(--font-display); font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.rh-group-meta { margin-top: 0.15rem; color: var(--text-muted); font-size: 0.85rem; }
.rh-group-meta b { color: var(--text); }
.rh-group-types { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.5rem; }
.rh-pill { padding: 0.12rem 0.6rem; border-radius: 999px; font-size: 0.74rem; font-weight: 700; background: var(--bg-hover); border: 1px solid var(--border); color: var(--text-muted); }
.rh-group-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.rh-btn[aria-pressed="true"] { border-color: var(--brand); color: var(--text); }
.rh-login-note { margin-top: 0.35rem; color: var(--text-dim); font-size: 0.78rem; overflow-wrap: anywhere; }

/* ---------- Toast ---------- */
.rh-toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px);
  background: var(--text); color: var(--bg); padding: 0.6rem 1.05rem; border-radius: 10px;
  font-size: 0.86rem; font-weight: 600; box-shadow: var(--shadow); opacity: 0; pointer-events: none;
  transition: opacity 0.22s, transform 0.22s; z-index: 1200; max-width: calc(100vw - 2rem);
}
.rh-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Invoice modal ---------- */
.rh-modal-backdrop { position: fixed; inset: 0; background: rgba(5, 42, 60, 0.72); backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; padding: 20px; z-index: 999; }
.rh-modal { background: var(--bg-card); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 1.1rem; width: 100%; max-width: 720px; max-height: 92vh; overflow-y: auto; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.8); }
.rh-modal-actions { display: flex; justify-content: flex-end; gap: 0.5rem; flex-wrap: wrap; margin-top: 1rem; }
.rh-invoice-paper { background: #fff; color: #202b29; border-radius: 10px; padding: 2rem; font-size: 14px; }
.rh-inv-top { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-bottom: 1.1rem; border-bottom: 3px solid #a8d3bd; }
.rh-inv-brand { display: flex; align-items: center; gap: 0.6rem; }
.rh-inv-badge { width: 38px; height: 38px; border-radius: 10px; background: linear-gradient(135deg, #a8d3bd, #efbd79); color: #151b22; display: grid; place-items: center; font-weight: 800; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.rh-inv-title { font-family: var(--font-display); font-size: 1.35rem; font-weight: 800; letter-spacing: -0.01em; }
.rh-inv-sub { font-size: 12px; color: #64748b; }
.rh-inv-meta { text-align: right; line-height: 1.5; }
.rh-stamp { display: inline-block; margin-top: 6px; padding: 3px 12px; border-radius: 6px; font-weight: 800; letter-spacing: 0.1em; font-size: 12px; border: 2px solid; transform: rotate(-3deg); }
.rh-stamp.paid { color: #059669; border-color: #059669; }
.rh-stamp.unpaid { color: #dc2626; border-color: #dc2626; }
.rh-stamp.partial { color: #d97706; border-color: #d97706; }
.rh-inv-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1.1rem 0; }
.rh-inv-label { font-size: 11px; color: #94a3b8; font-weight: 700; margin-bottom: 4px; }
.rh-inv-table { width: 100%; border-collapse: collapse; margin: 0.4rem 0 1rem; }
.rh-inv-table th { text-align: left; font-size: 12px; color: #64748b; padding: 8px 6px; border-bottom: 1px solid #e2e8f0; }
.rh-inv-table td { padding: 10px 6px; border-bottom: 1px solid #f1f5f9; }
.rh-inv-line { display: flex; justify-content: space-between; padding: 4px 14px; font-size: 13px; color: #475569; }
.rh-inv-total { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; background: #f1f5f9; border-radius: 10px; font-size: 18px; font-weight: 800; margin-top: 4px; }
.rh-inv-pay { margin-top: 1rem; padding: 12px 14px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; font-size: 12.5px; }
.rh-inv-foot { margin-top: 1.1rem; font-size: 11.5px; color: #64748b; text-align: center; }
.rh-invoice-paper a { color: #3c695b; }

/* ---------- Shortcuts dialog ---------- */
.rh-modal-sm { max-width: 420px; }
.rh-modal-title { font-family: var(--font-display); font-size: 1.15rem; margin-bottom: 0.8rem; }
.rh-keys > div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.5rem 0; border-bottom: 1px dashed var(--border); font-size: 0.9rem; }
.rh-keys > div:last-child { border-bottom: 0; }
.rh-keys dd { color: var(--text-muted); text-align: right; }
.rh-keys kbd { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.78rem; font-weight: 700; padding: 0.1rem 0.45rem; border-radius: 6px; background: var(--bg-hover); border: 1px solid var(--border-strong); }

/* ---------- WhatsApp widget ---------- */
.rh-wa-widget { position: fixed; bottom: 22px; right: 22px; z-index: 950; display: flex; flex-direction: column; align-items: flex-end; gap: 0.6rem; }
.rh-wa-box { width: 350px; max-width: calc(100vw - 44px); max-height: calc(100dvh - 100px); background: var(--bg-card); border: 1px solid var(--border-strong); border-radius: 20px; overflow: auto; display: none; box-shadow: 0 24px 50px -12px rgba(0, 0, 0, 0.6); }
.rh-wa-box.open { display: block; animation: rhPop 0.18s ease; }
@keyframes rhPop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.rh-wa-head { background: linear-gradient(135deg, #063c39, #09645b); color: #fff; padding: 0.85rem 1rem; display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; }
.rh-wa-avatar { flex: 0 0 52px; width: 52px; height: 52px; border-radius: 50%; object-fit: cover; object-position: center; background: #075e54; border: 2px solid rgba(255, 255, 255, 0.65); }
.rh-wa-heading { flex: 1; min-width: 0; }
.rh-wa-head strong { display: block; font-size: 0.92rem; }
.rh-wa-head span { font-size: 0.76rem; opacity: 0.92; }
.rh-wa-close { background: none; border: 0; color: #fff; font-size: 1rem; cursor: pointer; padding: 0.2rem 0.4rem; }
.rh-wa-close { min-width: 36px; min-height: 36px; border-radius: 50%; background: rgba(255, 255, 255, 0.12); }
.rh-wa-close:hover { background: rgba(255, 255, 255, 0.22); }
.rh-wa-close:focus-visible { outline: 2px solid white; outline-offset: 2px; }
.rh-wa-body { padding: 1rem; }
.rh-wa-intro { margin: 0 0 0.85rem; color: var(--text-muted); font-size: 0.87rem; }
.rh-wa-body label { display: block; margin-bottom: 0.35rem; font-weight: 700; font-size: 0.85rem; }
.rh-wa-body textarea { width: 100%; background: var(--bg-input); border: 1px solid var(--border); color: var(--text); border-radius: 10px; padding: 0.6rem 0.75rem; font-family: inherit; font-size: 0.86rem; margin-bottom: 0.65rem; resize: vertical; }
.rh-wa-float { background: var(--whatsapp); color: #062b16; border: 0; border-radius: 999px; padding: 0.72rem 1.15rem; font-family: inherit; font-weight: 700; font-size: 0.88rem; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; box-shadow: 0 12px 26px rgba(37, 211, 102, 0.32); }
.rh-wa-float:hover { filter: brightness(1.05); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .rh-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rh-cell:nth-child(3) { border-left: 0; }
  .rh-cell:nth-child(n+3) { border-top: 1px solid var(--border); }
  .rh-row { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; }
  .rh-row-money { grid-column: 1; grid-row: 2; display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; }
  .rh-row-money .rh-amt { margin-bottom: 0; }
  .rh-row-actions { grid-column: 2 / 4; grid-row: 2; }
  .rh-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .rh-hero { grid-template-columns: 1fr; }
  .rh-hero-actions { justify-content: flex-start; }
  .rh-attn-list { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .rh-container { --gutter: 1rem; }
  .rh-hero { padding-top: 2rem; }
  .rh-grid { grid-template-columns: 1fr; }
  .rh-cell { border-left: 0; border-top: 1px solid var(--border); }
  .rh-cell:first-child { border-top: 0; }
  .rh-row { grid-template-columns: 1fr auto; padding: 0.95rem 0.9rem 0.95rem 1.2rem; }
  .rh-row-id { grid-column: 1; }
  .rh-row-term, .rh-row-money { grid-column: 1 / 3; }
  .rh-row-actions { grid-column: 2; grid-row: 1; align-self: start; }
  .rh-row-actions .rh-btn { display: none; }
  .rh-row-money { grid-row: auto; }
  .rh-inv-cols { grid-template-columns: 1fr; }
  .rh-controls select { flex: 1 1 100%; }
  .rh-stat { padding: 0.95rem 1rem; }
  .rh-stat-val { font-size: 1.8rem; }
  .rh-stat-ico { display: none; }
  .rh-stat-val { padding-right: 0; }
  .rh-wa-float span { display: none; }
  .rh-wa-float { padding: 0.8rem; }
  .rh-foot-spacer { display: none; }
  .rh-tabs { width: 100%; }
  .rh-tab { flex: 1 1 auto; padding: 0.42rem 0.55rem; }
  .rh-more-menu { right: auto; left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Print ---------- */
@media print {
  body.print-invoice * { visibility: hidden; }
  body.print-invoice #rh-invoice-print, body.print-invoice #rh-invoice-print * { visibility: visible; }
  body.print-invoice #rh-invoice-print { position: fixed; left: 0; top: 0; width: 100%; border-radius: 0; }

  body.print-report {
    background: #fff !important; color: #202b29;
    --bg: #fff; --bg-card: #fff; --bg-elev: #fff; --bg-input: #f3f8fa; --bg-hover: rgba(5, 42, 60, 0.04);
    --text: #202b29; --text-muted: #455850; --text-dim: #52655c; --border: #dfe7dc; --border-strong: #b9cdd5; --shadow: none;
    --success: #0b7a55; --warning: #a55a05; --danger: #c0262d; --link: #3c695b;
  }
  body.print-report .rh-dock, body.print-report .rh-wa-widget, body.print-report .rh-toolbar, body.print-report .rh-timeline,
  body.print-report .rh-hero-actions, body.print-report .rh-toast, body.print-report .rh-skip, body.print-report .rh-notice,
  body.print-report .rh-attn, body.print-report .rh-detail-foot, body.print-report .rh-row-actions, body.print-report .rh-expander,
  body.print-report .rh-modal-backdrop { display: none !important; }
  body.print-report .rh-hero { padding-top: 0; }
  body.print-report .rh-service, body.print-report .rh-stat { break-inside: avoid; transform: none !important; }
  body.print-report .rh-list { padding-bottom: 0; }
  body.print-report .rh-group-actions { display: none !important; }
  body.print-report .rh-row { grid-template-columns: 1.5fr 1fr 0.8fr; cursor: default; }
}

.rh-bundle { padding: 1rem clamp(.85rem, 3vw, 1.5rem); border-top: 1px solid var(--border); }
.rh-bundle h4 { margin-bottom: .75rem; }
.rh-bundle-items { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 235px), 1fr)); gap: .65rem; list-style: none; }
.rh-bundle-item { padding: .8rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-input); overflow-wrap: anywhere; }
.rh-bundle-item-head, .rh-bundle-total { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1rem; }
.rh-bundle-item-head { margin-bottom: .2rem; }
.rh-bundle-note { margin-top: .35rem; white-space: pre-line; font-size: .85rem; }
.rh-bundle-total { margin-top: .75rem; padding: .7rem .85rem; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow-wrap: anywhere; }
