:root {
  color-scheme: light;
  --pacific: #0e2a47;
  --sky: #3fa9f5;
  --sand: #f2e6d0;
  --fog: #f7f9fb;
  --sidebar: var(--pacific);
  --bg: var(--fog);
  --card: #fff;
  --text: var(--pacific);
  --muted: color-mix(in srgb, var(--pacific) 72%, var(--fog));
  --line: color-mix(in srgb, var(--pacific) 14%, var(--fog));
  --soft: color-mix(in srgb, var(--sky) 12%, var(--fog));
  --heading-font: "Fredoka", ui-rounded, "Segoe UI", system-ui, sans-serif;
  --sidebar-width: 242px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 "Inter", "Segoe UI", system-ui, sans-serif;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}
body.dark {
  color-scheme: dark;
  --bg: color-mix(in srgb, var(--pacific) 56%, black);
  --sidebar: color-mix(in srgb, var(--pacific) 77%, black);
  --card: color-mix(in srgb, var(--pacific) 87%, black);
  --text: var(--fog);
  --muted: color-mix(in srgb, var(--fog) 72%, var(--pacific));
  --line: color-mix(in srgb, var(--fog) 18%, var(--pacific));
  --soft: color-mix(in srgb, var(--sky) 16%, var(--pacific));
}
body.nav-collapsed { --sidebar-width: 78px; }
[hidden] { display: none !important; }
svg { flex: none; }
button, input, select, textarea { font: inherit; }
button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 150ms, border-color 150ms;
}
button:hover { background: var(--soft); }
:focus-visible { outline: 2px solid var(--sky); outline-offset: 3px; }
.primary { background: var(--sky); color: var(--pacific); border-color: transparent; }
.primary:hover { background: color-mix(in srgb, var(--sky) 80%, var(--fog)); }
.primary svg { width: 17px; height: 17px; }
.skip { position: fixed; top: 8px; left: 8px; z-index: 9; transform: translateY(-160%); background: var(--card); color: var(--text); padding: 8px; }
.skip:focus { transform: none; }
aside {
  display: flex;
  flex-direction: column;
  gap: 32px;
  background: var(--sidebar);
  color: var(--fog);
  padding: 22px 14px 16px;
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow: auto;
  scrollbar-width: thin;
}
.brand { display: flex; align-items: center; gap: 10px; padding-inline: 3px; white-space: nowrap; }
.brand img { border-radius: 12px; object-fit: cover; background: var(--sand); flex: none; }
.brand-copy strong { display: block; font: 700 16px/1.25 var(--heading-font); }
.brand-copy span { display: block; color: var(--sky); font-size: 10px; letter-spacing: .2em; font-weight: 800; margin-top: 2px; }
nav { display: grid; gap: 4px; }
nav button {
  justify-content: flex-start;
  width: 100%;
  text-align: left;
  gap: 11px;
  padding: 9px 11px;
  min-height: 42px;
  border-color: transparent;
  background: transparent;
  color: color-mix(in srgb, var(--fog) 81%, var(--pacific));
}
nav button:hover { background: color-mix(in srgb, var(--sky) 12%, transparent); }
nav button[aria-current="page"] { color: var(--fog); background: color-mix(in srgb, var(--sky) 22%, transparent); border-color: color-mix(in srgb, var(--sky) 34%, transparent); }
nav button[aria-current="page"] svg { color: var(--sky); }
.asidefoot { margin-top: auto; border-top: 1px solid #f7f9fb29; padding: 16px 6px 0; display: flex; gap: 10px; align-items: flex-start; white-space: nowrap; }
.asidefoot strong, .asidefoot small { display: block; font-size: 12px; }
.asidefoot small { color: color-mix(in srgb, var(--fog) 76%, var(--pacific)); }
.asidefoot .status-dot { margin-top: 6px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sky); flex: none; }
.scrim { display: none; }
main { min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 56px; padding: 8px clamp(16px,3vw,36px); background: var(--card); border-bottom: 1px solid var(--line); }
.topbar-start, .breadcrumb, .actions { display: flex; align-items: center; gap: 9px; }
.actions { flex-wrap: wrap; }
.topbar-start { gap: 14px; min-width: 0; }
.breadcrumb { min-width: 0; color: var(--muted); font-size: 13px; }
.breadcrumb strong { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-button { width: 38px; padding: 0; flex: none; }
.workspace-status { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 20px; padding: 5px 10px; color: var(--muted); font-size: 12px; margin-right: 5px; }
.topbar-actions { flex: none; }
#account svg { width: 18px; height: 18px; }
.workspace { max-width: 1540px; margin: auto; padding: 18px clamp(16px,3vw,32px) 26px; }
.notice { background: var(--soft); border: 1px solid var(--line); border-radius: 9px; padding: 10px 14px; margin-bottom: 14px; overflow-wrap: anywhere; }
#view:focus { outline: none; }
h1,h2,.kpi { font-family: var(--heading-font); font-weight: 700; }
h1 { font-size: clamp(30px,4vw,45px); line-height: 1.05; letter-spacing: -.035em; margin: 0; }
h2 { font-size: 18px; line-height: 1.25; margin: 0 0 14px; letter-spacing: -.014em; }
p { margin: 0 0 14px; }
small,.muted,.page-title p,.panel-detail { color: var(--muted); }
.page-title { margin-bottom: 24px; }
.page-title p { margin: 9px 0 0; }
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  min-height: 148px;
  color: var(--fog);
  border-radius: 12px;
  padding: 16px clamp(18px,3vw,34px);
  margin-bottom: 12px;
  background: radial-gradient(ellipse at 79% 125%, #3fa9f5a8, transparent 58%), var(--pacific);
}
.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 0 0 56%;
  background: repeating-radial-gradient(ellipse at 68% 110%, transparent 0 23px, #f7f9fb20 24px 25px, transparent 26px 41px);
  mask-image: linear-gradient(90deg,transparent,#000);
}
.hero-copy { max-width: 60%; }
.hero .hero-date { margin: 0 0 6px; color: var(--sand); font-size: 12px; font-weight: 650; }
.hero-date::first-letter { text-transform: uppercase; }
.hero h1 { font-size: clamp(29px,3.2vw,43px); }
.hero p { margin: 6px 0 0; color: #f7f9fbe6; }
.hero-rumo { position: absolute; inset: auto clamp(20px,9vw,130px) 0 auto; width: auto; height: 138px; max-width: 40%; object-fit: contain; object-position: bottom; }
.grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 11px; margin-bottom: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 13px; padding: 15px; margin-bottom: 12px; min-width: 0; }
.grid .card { margin: 0; padding: 11px 13px; }
.metric-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 13px; font-weight: 650; }
.tile-icon { width: 34px; height: 34px; display: inline-grid; place-items: center; background: var(--soft); color: var(--text); border-radius: 9px; flex: none; }
.tile-icon svg { width: 17px; height: 17px; }
.kpi { font-size: clamp(23px,2.7vw,34px); line-height: 1.15; margin: 3px 0; letter-spacing: -.025em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric small { display: block; font-size: 12px; }
.two { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(0,1fr); gap: 12px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.toolbar h2 { margin: 0; }
.filters select { width: auto; margin: 0; min-height: 38px; padding: 6px 24px 6px 10px; background-color: var(--card); }
.tablewrap,.calendar-scroll { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th,td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); font-size: 13px; }
th { color: var(--muted); font-weight: 650; white-space: nowrap; background: var(--bg); }
td { overflow-wrap: anywhere; min-width: 100px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--bg); }
.row-actions { display: flex; gap: 6px; }
td button { font-size: 12px; min-height: 32px; padding: 5px 8px; }
.danger:hover { border-color: var(--text); }
.empty { display: flex; align-items: center; gap: 11px; border: 1px dashed var(--line); border-radius: 8px; padding: 11px; background: var(--bg); }
.empty strong { display: block; font-size: 13px; }
.empty p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
#importWeather { margin-bottom: 10px; }
.connections { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 16px; padding: 10px 13px; }
.connection-heading h2 { font-size: 15px; margin: 0; }
.connection-heading p { font-size: 11px; color: var(--muted); margin: 2px 0 0; }
.connections ul { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); padding: 0; margin: 0; list-style: none; gap: 8px; }
.connections li { display: flex; align-items: center; gap: 8px; min-width: 0; border-inline-start: 1px solid var(--line); padding-inline-start: 10px; }
.connections strong { font-size: 12px; display: block; }
.connections .tile-icon { width: 30px; height: 30px; }
.connection-state { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; }
.connection-state i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.chart { display: grid; gap: 10px; margin-top: 10px; }
.chart-row { display: grid; grid-template-columns: 98px minmax(0,1fr) minmax(24px,auto); align-items: center; gap: 12px; font-size: 12px; }
.chart-network { display: flex; align-items: center; gap: 6px; }
.chart-network svg { width: 15px; height: 15px; }
.chart-row strong { text-align: right; font-variant-numeric: tabular-nums; }
.chart-track,.bar { height: 8px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.chart-track div,.bar span { height: 100%; display: block; border-radius: inherit; background: var(--sky); }
.panel-detail { font-size: 12px; color: var(--muted); }
.panel-detail { margin-top: -6px; }
.operation { display: grid; grid-template-columns: auto 1fr auto auto; gap: 8px; width: 100%; text-align: left; border: 0; border-radius: 8px; padding: 3px 2px; font-weight: 500; }
.operation .tile-icon { width: 29px; height: 29px; }
.operation + .operation { border-top: 1px solid var(--line); }
.operation > svg { width: 14px; height: 14px; color: var(--muted); }
.operation strong { text-align: right; font-variant-numeric: tabular-nums; }
.rowline { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; }
.bar { margin-bottom: 12px; }
.calendar { min-width: 560px; display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 5px; }
.day { min-height: 90px; border: 1px solid var(--line); border-radius: 7px; padding: 7px; font-size: 12px; overflow-wrap: anywhere; }
.day.is-today { border-color: var(--sky); }
.day em { display: block; font-style: normal; background: var(--soft); padding: 4px; margin-top: 4px; border-radius: 4px; }
.dayname { text-align: center; color: var(--muted); font-size: 12px; padding-bottom: 4px; }
dialog { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 15px; width: min(510px,calc(100% - 28px)); padding: 24px; max-height: 90dvh; }
dialog::backdrop { background: #0e2a479e; }
#fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px 12px; }
#fields p,#fields label:has([name="title"],[name="url"],[name="email"],[name="password"]) { grid-column: 1 / -1; }
label { display: block; margin: 0; color: var(--muted); font-size: 13px; font-weight: 600; }
input,select,textarea { display: block; width: 100%; padding: 9px; margin-top: 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); }
dialog .actions { justify-content: flex-end; margin-top: 18px; }
@media (min-width: 761px) {
  .nav-collapsed .brand-copy,.nav-collapsed nav button span,.nav-collapsed .asidefoot { display: none; }
  .nav-collapsed nav button { justify-content: center; }
}
@media (max-width: 1120px) {
  .grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 950px) {
  .two { grid-template-columns: 1fr; gap: 0; }
}
@media (max-width: 975px) {
  .connections { grid-template-columns: 1fr; gap: 7px; }
  .connection-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
}
@media (max-width: 760px) {
  body { display: block; }
  body.drawer-open { overflow: hidden; }
  aside { position: fixed; z-index: 5; inset: 0 auto 0 0; width: min(280px,85vw); transform: translateX(-100%); visibility: hidden; transition: transform 180ms, visibility 180ms; }
  .drawer-open aside { transform: none; visibility: visible; }
  .drawer-open .scrim { display: block; position: fixed; z-index: 4; inset: 0; width: 100%; height: 100%; background: #0e2a478f; border: 0; border-radius: 0; }
  .workspace { padding-top: 16px; }

  .workspace-status { margin-right: 0; }
}
@media (max-width: 480px) {
  .breadcrumb > span { display: none; }
  .topbar { gap: 7px; }
  .topbar-start,.topbar-actions { gap: 7px; }
  .workspace-status { font-size: 10px; padding: 5px 6px; gap: 4px; }
  #account { width: 38px; padding: 0; }
  #account span { display: none; }
  .hero { min-height: 134px; padding: 13px; }
  .hero-copy { max-width: 63%; }
  .hero-rumo { height: 120px; inset-inline-end: 8px; }
  .grid { gap: 8px; }
  .card { padding: 13px; }
  .connections ul { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .connections li { padding-inline-start: 0; border: 0; }
  .grid .card { padding: 9px; }
  .metric-top { font-size: 12px; }
  .metric .tile-icon { width: 28px; height: 28px; }
  .filters .actions { gap: 6px; }
  .chart-row { gap: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
.auth-locked { display: block; }
.auth-locked > :is(aside,main,.skip,.scrim) { display: none; }
.access-screen { min-height: 100dvh; display: grid; place-items: center; padding: 18px; }
.access-card { width: min(100%,490px); border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--card); }
.access-header { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 16px 20px; min-height: 115px; color: var(--fog); background: var(--pacific); }
.access-header img { height: 96px; max-width: 32%; object-fit: contain; }
.access-header span { color: var(--sand); font-size: 10px; font-weight: 700; letter-spacing: .095em; }
.access-header h1 { font-size: clamp(26px,5vw,39px); margin-top: 5px; }
.access-body { padding: 18px 20px; }
.access-body label { margin-bottom: 10px; }
.access-body button:disabled { opacity: .65; cursor: progress; }
.access-actions { margin-top: 12px; }
.access-actions .icon-button { margin-inline-start: auto; }
.sync-actions { margin: 10px 0; }
