/* Cinco aparências do painel. Escolha em "Aparência" (ou abra #/aparencia). Fontes locais em /admin/fonts. */

@font-face { font-family: "Manrope"; src: url("fonts/Manrope-Variable.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("fonts/SpaceGrotesk-Variable.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Plus Jakarta Sans"; src: url("fonts/PlusJakartaSans-Variable.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("fonts/Fraunces-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/IBMPlexSans-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/IBMPlexSans-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/IBMPlexSans-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

/* login em cartão, em todas as aparências */
html[data-tema] .login-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); padding: 32px 28px; box-shadow: var(--shadow); }

/* ============================================================ 1. PORCELANA — claro, navegação no topo */

html[data-tema="porcelana"] {
  --ink: #0f1c2e; --ink-soft: #3a475a; --mute: #64718a;
  --paper: #f5f7fa; --card: #ffffff; --line: #dde3ec; --line-soft: #ebeff5;
  --ok: #0c7a56; --ok-bg: #dff3ea; --warn: #7a5200; --warn-bg: #fbeec8; --bad: #b42318; --bad-bg: #fde7e4;
  --link: #0b6b8a;
  --btn: #0e7c86; --btn-hover: #0a646c; --btn-text: #fff;
  --edge: #c5cedb; --edge-hover: #96a3b6;
  --ev: #dcecf1; --ev-all: #dff3ea; --over: #eef6f8;
  --side: #ffffff; --side-text: #3a475a; --side-hi: #0f1c2e; --side-active: #0b6b8a; --side-mute: #64718a;
  --side-hover: #f0f4f8; --side-on: transparent; --side-dot: #aab5c5; --dot-ok: #12a071;
  --r-ctl: 8px; --r-card: 14px; --shadow: 0 1px 2px rgba(15, 28, 46, .05);
  --serif: "Manrope", system-ui, sans-serif; --sans: "Manrope", system-ui, sans-serif;
}
html[data-tema="porcelana"] h1 { font-weight: 800; letter-spacing: -0.025em; font-size: 30px; }
html[data-tema="porcelana"] h2, html[data-tema="porcelana"] h3 { font-weight: 700; letter-spacing: -0.012em; }
html[data-tema="porcelana"] .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
html[data-tema="porcelana"] .side {
  position: sticky; top: 0; z-index: 20; height: auto; flex-direction: row; align-items: center; gap: 28px;
  padding: 0 clamp(16px, 4vw, 40px); border-bottom: 1px solid var(--line);
}
html[data-tema="porcelana"] .brand { padding: 0; white-space: nowrap; }
html[data-tema="porcelana"] .brand b { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; }
html[data-tema="porcelana"] .brand span { display: none; }
html[data-tema="porcelana"] .nav { flex-direction: row; flex: 1; overflow-x: auto; gap: 2px; scrollbar-width: none; padding: 0; }
html[data-tema="porcelana"] .nav a { white-space: nowrap; padding: 18px 9px 16px; gap: 6px; border-radius: 0; font-weight: 600; font-size: 13.5px; border-bottom: 2px solid transparent; }
html[data-tema="porcelana"] .nav a[aria-current="page"] { border-bottom-color: var(--btn); background: none; }
html[data-tema="porcelana"] .side-foot { margin: 0; padding: 0; }
html[data-tema="porcelana"] main { margin: 0 auto; max-width: 1000px; }
html[data-tema="porcelana"] .cal-day.today { box-shadow: inset 0 0 0 2px var(--btn); }
@media (max-width: 820px) {
  html[data-tema="porcelana"] .side { flex-wrap: wrap; padding: 10px 16px 0; gap: 0 12px; }
  html[data-tema="porcelana"] .brand { padding: 4px 0 0; }
  html[data-tema="porcelana"] .nav { order: 3; flex: 1 1 100%; padding: 0; }
  html[data-tema="porcelana"] .nav a { padding: 12px 10px 10px; }
}

/* ============================================================ 2. NOITE — escuro, barra lateral estreita */

html[data-tema="noite"] {
  color-scheme: dark;
  --ink: #e8ecf4; --ink-soft: #b4bccd; --mute: #8590a6;
  --paper: #0d1017; --card: #151a24; --line: #262d3b; --line-soft: #1e2431;
  --ok: #5ed3a0; --ok-bg: #12301f; --warn: #f0c35a; --warn-bg: #33290f; --bad: #ff8b82; --bad-bg: #3a1a1b;
  --link: #9fb0ff;
  --btn: #9aa9ff; --btn-hover: #b3beff; --btn-text: #0d1017;
  --edge: #364055; --edge-hover: #58647e; --field: #0f131b;
  --on-ok: #08140e;
  --ev: #232c47; --ev-all: #16372b; --over: #1a2030;
  --side: #090b10; --side-text: #9aa4b8; --side-hi: #ffffff; --side-active: #ffffff; --side-mute: #7b8599;
  --side-hover: #141a25; --side-on: #1b2233; --side-dot: #4a556b; --dot-ok: #5ed3a0;
  --r-ctl: 8px; --r-card: 12px; --shadow: none;
  --serif: "Space Grotesk", system-ui, sans-serif; --sans: "Space Grotesk", system-ui, sans-serif;
}
html[data-tema="noite"] body { font-size: 15px; }
html[data-tema="noite"] h1 { font-weight: 600; letter-spacing: -0.03em; font-size: 31px; }
html[data-tema="noite"] h2, html[data-tema="noite"] h3 { font-weight: 600; letter-spacing: -0.015em; }
@media (min-width: 821px) { html[data-tema="noite"] .shell { grid-template-columns: 220px minmax(0, 1fr); } }
html[data-tema="noite"] .side { border-right: 1px solid var(--line-soft); }
html[data-tema="noite"] .nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--btn); border-top-left-radius: 2px; border-bottom-left-radius: 2px; }
html[data-tema="noite"] .btn.ghost:hover { background: #1b2233; }
html[data-tema="noite"] .toast { box-shadow: 0 8px 24px rgba(0, 0, 0, .5); }
html[data-tema="noite"] .attention .node { background: #f0c35a; color: #2b2000; }
html[data-tema="noite"] .cal-day.today { box-shadow: inset 0 0 0 2px var(--btn); }
html[data-tema="noite"] .inline-form { background: #0f131b; }

/* ============================================================ 3. MARÉ — claro, barra lateral flutuante */

html[data-tema="mare"] {
  --ink: #12263f; --ink-soft: #3d5169; --mute: #6a7c93;
  --paper: #e6eef8; --card: #ffffff; --line: #d3dfee; --line-soft: #e6eef8;
  --ok: #0d7d5b; --ok-bg: #d9f2e8; --warn: #805400; --warn-bg: #fdefc7; --bad: #b3261e; --bad-bg: #fbe3e0;
  --link: #1d5fd6;
  --btn: #1d5fd6; --btn-hover: #174db0; --btn-text: #fff;
  --edge: #bccbdf; --edge-hover: #8ba2c0;
  --ev: #dbe8fb; --ev-all: #d9f2e8; --over: #f0f6ff;
  --side: #ffffff; --side-text: #3d5169; --side-hi: #12263f; --side-active: #1d5fd6; --side-mute: #6a7c93;
  --side-hover: #f0f5fc; --side-on: #e3ecfc; --side-dot: #a9b9cf; --dot-ok: #12a071;
  --r-ctl: 12px; --r-card: 20px; --shadow: 0 6px 24px rgba(30, 70, 130, .08);
  --serif: "Plus Jakarta Sans", system-ui, sans-serif; --sans: "Plus Jakarta Sans", system-ui, sans-serif;
}
html[data-tema="mare"] h1 { font-weight: 800; letter-spacing: -0.03em; font-size: 31px; }
html[data-tema="mare"] h2, html[data-tema="mare"] h3 { font-weight: 700; letter-spacing: -0.015em; }
html[data-tema="mare"] .shell { padding: 16px; gap: 8px; }
@media (min-width: 821px) { html[data-tema="mare"] .shell { grid-template-columns: 248px minmax(0, 1fr); } }
html[data-tema="mare"] .side { top: 16px; height: calc(100vh - 32px); border-radius: 24px; box-shadow: var(--shadow); padding: 24px 12px 16px; }
html[data-tema="mare"] .brand b { font-weight: 800; letter-spacing: -0.02em; }
html[data-tema="mare"] .nav a { border-radius: 14px; padding: 10px 14px; font-weight: 600; }
html[data-tema="mare"] .nav a[aria-current="page"] { font-weight: 700; }
html[data-tema="mare"] .btn { border-radius: 999px; padding-inline: 22px; }
html[data-tema="mare"] .badge, html[data-tema="mare"] .chip { font-weight: 600; }
html[data-tema="mare"] .cal-day.today { box-shadow: inset 0 0 0 2px var(--btn); }
html[data-tema="mare"] .panel { border-color: transparent; }
@media (max-width: 820px) {
  html[data-tema="mare"] .shell { padding: 10px; }
  html[data-tema="mare"] .side { top: 0; height: auto; border-radius: 20px; padding: 14px 0 0; }
}

/* ============================================================ 4. JARDIM — verde suave, dock na parte de baixo */

html[data-tema="jardim"] {
  --ink: #1d2b23; --ink-soft: #435247; --mute: #6b7a70;
  --paper: #edf1ec; --card: #fbfcfa; --line: #d5ddd4; --line-soft: #e4eae3;
  --ok: #1f6b46; --ok-bg: #dcefe3; --warn: #7a5200; --warn-bg: #f7ebc4; --bad: #a82e27; --bad-bg: #f8e2df;
  --link: #2a6a52;
  --btn: #2f5d46; --btn-hover: #244a37; --btn-text: #fff;
  --edge: #bac6bb; --edge-hover: #8a9b8d; --field: #ffffff;
  --ev: #dbe8dd; --ev-all: #e6e3f3; --over: #f3f6f2;
  --side: #1d2b23; --side-text: #bccabf; --side-hi: #ffffff; --side-active: #1d2b23; --side-mute: #93a597;
  --side-hover: rgba(255,255,255,.08); --side-on: #dcefe3; --side-dot: #6f8275; --dot-ok: #6fd3a0;
  --r-ctl: 10px; --r-card: 16px; --shadow: 0 1px 0 rgba(29, 43, 35, .04);
  --serif: "Fraunces", Georgia, serif; --sans: "Manrope", system-ui, sans-serif;
}
html[data-tema="jardim"] h1 { font-weight: 560; letter-spacing: -0.02em; font-size: 36px; }
html[data-tema="jardim"] h2 { font-weight: 560; font-size: 24px; }
html[data-tema="jardim"] h3 { font-weight: 600; }
html[data-tema="jardim"] .shell { display: block; }
html[data-tema="jardim"] .side {
  position: fixed; z-index: 30; left: 50%; bottom: 14px; transform: translateX(-50%); top: auto;
  width: min(1040px, calc(100vw - 24px)); height: auto; flex-direction: row; align-items: center; gap: 8px;
  padding: 8px 8px 8px 22px; border-radius: 999px; box-shadow: 0 10px 34px rgba(20, 35, 27, .28);
}
html[data-tema="jardim"] .brand { padding: 0 8px 0 0; white-space: nowrap; }
html[data-tema="jardim"] .brand b { font-size: 17px; font-weight: 600; }
html[data-tema="jardim"] .brand span { display: none; }
html[data-tema="jardim"] .nav { flex-direction: row; flex: 1; overflow-x: auto; gap: 2px; scrollbar-width: none; }
html[data-tema="jardim"] .nav a { white-space: nowrap; border-radius: 999px; padding: 9px 10px; gap: 6px; }
html[data-tema="jardim"] .side-foot { margin: 0; padding: 0 12px 0 4px; }
html[data-tema="jardim"] main { margin: 0 auto; max-width: 940px; padding-bottom: 150px; }
html[data-tema="jardim"] #toasts { bottom: 90px; }
html[data-tema="jardim"] .btn { border-radius: 999px; }
html[data-tema="jardim"] .cal-day.today { box-shadow: inset 0 0 0 2px var(--btn); }
@media (max-width: 820px) {
  html[data-tema="jardim"] .side { bottom: 8px; width: calc(100vw - 16px); padding: 6px; position: fixed; flex-direction: row; }
  html[data-tema="jardim"] .brand { display: none; }
  html[data-tema="jardim"] .nav { padding: 0; }
  html[data-tema="jardim"] main { padding: 28px 16px 130px; }
  html[data-tema="jardim"] h1 { font-size: 30px; }
}

/* ============================================================ 5. GRAFITE — denso e técnico */

html[data-tema="grafite"] {
  --ink: #1b1c1f; --ink-soft: #44464d; --mute: #6c6f78;
  --paper: #eeeeef; --card: #ffffff; --line: #cfd0d4; --line-soft: #e4e4e7;
  --ok: #15733f; --ok-bg: #dcf0e2; --warn: #7a5200; --warn-bg: #f9edc3; --bad: #b3261e; --bad-bg: #fae3e1;
  --link: #2347b8;
  --btn: #2347b8; --btn-hover: #1a3794; --btn-text: #fff;
  --edge: #b3b5bb; --edge-hover: #80838c;
  --ev: #dfe3f4; --ev-all: #dcefe2; --over: #f5f5f6;
  --side: #1f2023; --side-text: #b7b9c0; --side-hi: #ffffff; --side-active: #ffffff; --side-mute: #8c8f98;
  --side-hover: #2b2c30; --side-on: #34363b; --side-dot: #6a6d76; --dot-ok: #43c279;
  --r-ctl: 3px; --r-card: 4px; --shadow: none;
  --serif: "IBM Plex Sans", system-ui, sans-serif; --sans: "IBM Plex Sans", system-ui, sans-serif;
}
html[data-tema="grafite"] body { font-size: 14px; line-height: 1.5; }
html[data-tema="grafite"] h1 { font-weight: 600; font-size: 24px; letter-spacing: -0.01em; }
html[data-tema="grafite"] h2 { font-size: 18px; font-weight: 600; }
html[data-tema="grafite"] h3 { font-size: 15px; font-weight: 600; }
@media (min-width: 821px) { html[data-tema="grafite"] .shell { grid-template-columns: 192px minmax(0, 1fr); } }
html[data-tema="grafite"] .side { padding: 18px 8px 14px; }
html[data-tema="grafite"] .brand { padding: 0 10px 18px; }
html[data-tema="grafite"] .brand b { font-size: 15px; }
html[data-tema="grafite"] .nav a { padding: 6px 10px; font-size: 13.5px; border-radius: 3px; }
html[data-tema="grafite"] .nav a[aria-current="page"] { box-shadow: inset 2px 0 0 #7b9bff; }
html[data-tema="grafite"] main { padding: 28px clamp(16px, 3vw, 40px) 64px; max-width: 1080px; }
html[data-tema="grafite"] .page-head { margin-bottom: 20px; }
html[data-tema="grafite"] .page-head .lede { font-size: 14px; }
html[data-tema="grafite"] .panel { padding: 16px 18px; }
html[data-tema="grafite"] .stack > * + * { margin-top: 18px; }
html[data-tema="grafite"] input[type="text"], html[data-tema="grafite"] input[type="password"], html[data-tema="grafite"] input[type="number"],
html[data-tema="grafite"] input[type="url"], html[data-tema="grafite"] select { min-height: 34px; padding: 5px 10px; }
html[data-tema="grafite"] .btn { min-height: 34px; padding: 5px 14px; font-size: 13.5px; }
html[data-tema="grafite"] .btn.small { min-height: 28px; padding: 3px 10px; font-size: 12.5px; }
html[data-tema="grafite"] .items > li { padding: 10px 0; }
html[data-tema="grafite"] .badge { border-radius: 3px; font-size: 12px; padding: 2px 8px; }
html[data-tema="grafite"] .chip { border-radius: 3px; }
html[data-tema="grafite"] .cal-day { min-height: 80px; }
html[data-tema="grafite"] .cal-day.today { box-shadow: inset 0 0 0 2px var(--btn); }
html[data-tema="grafite"] .rail li { padding-bottom: 18px; }
html[data-tema="grafite"] .node { border-radius: 4px; }
html[data-tema="grafite"] .login-box { padding: 24px; }

/* ============================================================ seletor de aparência */

.temas { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; list-style: none; margin: 0; padding: 0; }
.tema-card { display: block; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; background: var(--card); border: 2px solid var(--line); border-radius: var(--r-card); padding: 12px; }
.tema-card:hover { border-color: var(--edge-hover); }
.tema-card[aria-pressed="true"] { border-color: var(--btn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--btn) 22%, transparent); }
.tema-card b { display: block; margin-top: 10px; }
.tema-card small { display: block; color: var(--mute); margin-top: 2px; }
.mini { height: 104px; border-radius: 8px; overflow: hidden; position: relative; border: 1px solid rgba(0, 0, 0, .12); }
.mini i { position: absolute; display: block; }
