/* ==========================================================================
   LINVO — Design System (ecossistema e-Laborando)
   Tokens → base → layout → componentes → páginas
   Reaproveitável nos demais apps e-Laborando: troque apenas os tokens.
   ========================================================================== */

/* ---------- Fonte Sora (hospedada localmente — sem chamadas externas, LGPD) ---------- */
@font-face { font-family: "Sora"; font-style: normal; font-display: swap; font-weight: 300; src: url("../fonts/sora-latin-300-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Sora"; font-style: normal; font-display: swap; font-weight: 400; src: url("../fonts/sora-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Sora"; font-style: normal; font-display: swap; font-weight: 500; src: url("../fonts/sora-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Sora"; font-style: normal; font-display: swap; font-weight: 600; src: url("../fonts/sora-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Sora"; font-style: normal; font-display: swap; font-weight: 700; src: url("../fonts/sora-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Sora"; font-style: normal; font-display: swap; font-weight: 300; src: url("../fonts/sora-latin-ext-300-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Sora"; font-style: normal; font-display: swap; font-weight: 400; src: url("../fonts/sora-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Sora"; font-style: normal; font-display: swap; font-weight: 500; src: url("../fonts/sora-latin-ext-500-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Sora"; font-style: normal; font-display: swap; font-weight: 600; src: url("../fonts/sora-latin-ext-600-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Sora"; font-style: normal; font-display: swap; font-weight: 700; src: url("../fonts/sora-latin-ext-700-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ==========================================================================
   1. TOKENS
   ========================================================================== */
:root {
  /* Marca */
  --el-navy: #131629;
  --el-navy-900: #0c0e1c;
  --el-navy-800: #1b1f38;
  --el-navy-700: #262b4a;
  --el-navy-600: #3a4066;
  --el-orange: #fb5200;
  --el-orange-600: #e04900;
  --el-orange-700: #c23f00;
  --el-orange-50: #fff3ec;
  --el-orange-100: #ffe2d1;

  /* Neutros (cinzas levemente azulados, derivados do navy) */
  --gray-0: #ffffff;
  --gray-25: #fbfbfd;
  --gray-50: #f6f7fa;
  --gray-100: #eef0f4;
  --gray-200: #e3e6ed;
  --gray-300: #cdd2dd;
  --gray-400: #9aa1b3;
  --gray-500: #6c7389;
  --gray-600: #4b5169;
  --gray-700: #343951;

  /* Semânticas */
  --success: #11805a;  --success-bg: #e9f7f1;
  --warning: #a6620a;  --warning-bg: #fdf4e3;
  --danger:  #cf2c1e;  --danger-bg:  #fdeceb;
  --info:    #2f56c9;  --info-bg:    #ecf1fd;

  /* Papéis */
  --color-bg: var(--gray-0);
  --color-surface: var(--gray-0);
  --color-surface-muted: var(--gray-50);
  --color-text: var(--el-navy);
  --color-text-muted: var(--gray-500);
  --color-text-subtle: var(--gray-400);
  --color-border: var(--gray-200);
  --color-border-strong: var(--gray-300);
  --color-primary: var(--el-navy);
  --color-accent: var(--el-orange);
  --color-focus: rgba(251, 82, 0, .35);

  /* Tipografia */
  --font-sans: "Sora", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --text-xs: .75rem;    /* 12 */
  --text-sm: .8125rem;  /* 13 */
  --text-base: .875rem; /* 14 */
  --text-md: 1rem;      /* 16 */
  --text-lg: 1.125rem;  /* 18 */
  --text-xl: 1.375rem;  /* 22 */
  --text-2xl: 1.75rem;  /* 28 */
  --leading: 1.55;
  --tracking-tight: -.015em;

  /* Espaçamento (base 4px) */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px;
  --sp-6: 24px; --sp-8: 32px; --sp-10: 40px; --sp-12: 48px; --sp-16: 64px;

  /* Bordas e sombras */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 999px;
  --shadow-xs: 0 1px 2px rgba(19, 22, 41, .05);
  --shadow-sm: 0 1px 3px rgba(19, 22, 41, .06), 0 1px 2px rgba(19, 22, 41, .04);
  --shadow-md: 0 8px 24px -6px rgba(19, 22, 41, .12), 0 2px 6px rgba(19, 22, 41, .05);
  --shadow-lg: 0 24px 48px -12px rgba(19, 22, 41, .22);

  /* Movimento */
  --ease: cubic-bezier(.2, .7, .2, 1);
  --dur-fast: 120ms;
  --dur: 200ms;

  /* Layout */
  --sidebar-w: 252px;
  --sidebar-w-collapsed: 72px;
  --header-h: 64px;
  --content-max: 1240px;

  --z-dropdown: 40; --z-sidebar: 50; --z-overlay: 60; --z-modal: 70; --z-toast: 80;
}

/* ==========================================================================
   2. BASE
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: var(--tracking-tight); font-weight: 600; }
h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); }
h4 { font-size: var(--text-md); }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
a.link, .prose a { color: var(--el-orange-600); text-decoration: underline; text-underline-offset: 2px; }
a.link:hover { color: var(--el-orange-700); }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
code, kbd { font-family: var(--font-mono); font-size: .9em; }
kbd { padding: 1px 6px; border: 1px solid var(--color-border-strong); border-bottom-width: 2px; border-radius: 5px; background: var(--gray-50); font-size: var(--text-xs); }
[hidden] { display: none !important; }
hr { border: 0; border-top: 1px solid var(--color-border); margin: var(--sp-6) 0; }
::selection { background: var(--el-orange-100); }

:focus-visible { outline: 2px solid var(--el-orange); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: var(--sp-4); top: -60px; z-index: 100; padding: var(--sp-2) var(--sp-4); background: var(--el-navy); color: #fff; border-radius: var(--radius); transition: top var(--dur) var(--ease); }
.skip-link:focus { top: var(--sp-4); }

.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 22px; height: 22px; }

.muted { color: var(--color-text-muted); }
.subtle { color: var(--color-text-subtle); }
.small { font-size: var(--text-sm); }
.xsmall { font-size: var(--text-xs); }
.mono { font-family: var(--font-mono); }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-right { text-align: right; }
.stack { display: flex; flex-direction: column; gap: var(--sp-4); }
.stack-sm { display: flex; flex-direction: column; gap: var(--sp-2); }
.row { display: flex; align-items: center; gap: var(--sp-3); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.mt-2 { margin-top: var(--sp-2); } .mt-4 { margin-top: var(--sp-4); } .mt-6 { margin-top: var(--sp-6); }
.mb-2 { margin-bottom: var(--sp-2); } .mb-4 { margin-bottom: var(--sp-4); }

/* ==========================================================================
   3. LAYOUT DO APP
   ========================================================================== */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns var(--dur) var(--ease); }
.app.is-collapsed { grid-template-columns: var(--sidebar-w-collapsed) minmax(0, 1fr); }

/* Sidebar */
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: var(--el-navy); color: #c9cce0;
  z-index: var(--z-sidebar);
  overflow: hidden;
}
.sidebar-brand { display: flex; align-items: center; gap: var(--sp-3); height: var(--header-h); padding: 0 var(--sp-4) 0 18px; flex: none; }
.sidebar-brand img { width: 36px; height: 36px; flex: none; }
.brand-word { font-weight: 700; font-size: 1.125rem; letter-spacing: .14em; color: #fff; }
.brand-by { display: block; font-size: 10px; font-weight: 400; letter-spacing: .04em; color: #8b90ad; margin-top: -2px; }
.sidebar-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: var(--sp-2) var(--sp-3) var(--sp-4); scrollbar-width: thin; scrollbar-color: var(--el-navy-600) transparent; }
.nav-label { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: #6e7393; padding: var(--sp-4) var(--sp-3) var(--sp-2); white-space: nowrap; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: var(--sp-3);
  height: 40px; padding: 0 var(--sp-3); border-radius: var(--radius);
  color: #c9cce0; font-size: var(--text-base); font-weight: 500; white-space: nowrap;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.nav-item .icon { width: 19px; height: 19px; }
.nav-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
a.nav-item:hover { background: var(--el-navy-800); color: #fff; }
.nav-item.is-active { background: var(--el-navy-700); color: #fff; }
.nav-item.is-active::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--el-orange); }
.nav-item.is-active .icon { color: var(--el-orange); }
.nav-item.is-disabled { color: #6e7393; cursor: default; }
.nav-soon { margin-left: auto; font-size: 10px; font-weight: 500; letter-spacing: .02em; padding: 1px 7px; border-radius: var(--radius-full); background: rgba(255,255,255,.06); color: #8b90ad; }
.sidebar-foot { padding: var(--sp-3); border-top: 1px solid rgba(255,255,255,.06); flex: none; }
.sidebar-toggle { width: 100%; justify-content: flex-start; background: transparent; border: 0; cursor: pointer; }
.sidebar-toggle:hover { background: var(--el-navy-800); color: #fff; }

.app.is-collapsed .nav-text, .app.is-collapsed .nav-soon, .app.is-collapsed .brand-text, .app.is-collapsed .nav-label { display: none; }
.app.is-collapsed .nav-item { justify-content: center; padding: 0; }
.app.is-collapsed .sidebar-brand { justify-content: center; padding: 0; }
.app.is-collapsed .sidebar-toggle .icon { transform: rotate(180deg); }

/* Área principal */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; }
.header {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: var(--sp-4);
  height: var(--header-h); padding: 0 var(--sp-6);
  background: rgba(255,255,255,.92); backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--color-border);
}
.header-title { display: flex; flex-direction: column; min-width: 0; }
.header-title .crumb { font-size: var(--text-xs); color: var(--color-text-muted); white-space: nowrap; }
.header-title h1 { font-size: var(--text-md); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: var(--sp-2); }
.icon-button.menu-button { display: none; }
.content { flex: 1; width: 100%; max-width: var(--content-max); margin: 0 auto; padding: var(--sp-8) var(--sp-6) var(--sp-12); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; margin-bottom: var(--sp-6); }
.page-head p { color: var(--color-text-muted); margin-top: var(--sp-1); }
.app-footer { padding: var(--sp-4) var(--sp-6); font-size: var(--text-xs); color: var(--color-text-subtle); border-top: 1px solid var(--color-border); display: flex; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; }

.banner { display: flex; align-items: center; gap: var(--sp-3); padding: 10px var(--sp-6); font-size: var(--text-sm); border-bottom: 1px solid var(--color-border); }
.banner-info { background: var(--info-bg); color: var(--info); }
.banner-warning { background: var(--warning-bg); color: var(--warning); }
.banner a { font-weight: 600; text-decoration: underline; }

.overlay { position: fixed; inset: 0; background: rgba(12, 14, 28, .45); z-index: var(--z-overlay); opacity: 0; pointer-events: none; transition: opacity var(--dur) var(--ease); }
.overlay.is-visible { opacity: 1; pointer-events: auto; }

/* ==========================================================================
   4. COMPONENTES
   ========================================================================== */

/* Botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  height: 40px; padding: 0 var(--sp-4);
  border: 1px solid transparent; border-radius: var(--radius);
  font-size: var(--text-base); font-weight: 600; line-height: 1; white-space: nowrap;
  cursor: pointer; user-select: none;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled, .btn.is-loading { opacity: .6; cursor: not-allowed; }
.btn-primary { background: var(--el-orange); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--el-orange-600); }
.btn-dark { background: var(--el-navy); color: #fff; }
.btn-dark:hover:not(:disabled) { background: var(--el-navy-700); }
.btn-secondary { background: #fff; color: var(--el-navy); border-color: var(--color-border-strong); box-shadow: var(--shadow-xs); }
.btn-secondary:hover:not(:disabled) { background: var(--gray-50); border-color: var(--gray-400); }
.btn-ghost { background: transparent; color: var(--gray-600); }
.btn-ghost:hover:not(:disabled) { background: var(--gray-100); color: var(--el-navy); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b42318; }
.btn-danger-soft { background: var(--danger-bg); color: var(--danger); }
.btn-danger-soft:hover:not(:disabled) { background: #fbdcd9; }
.btn-sm { height: 32px; padding: 0 var(--sp-3); font-size: var(--text-sm); border-radius: var(--radius-sm); }
.btn-lg { height: 48px; padding: 0 var(--sp-6); font-size: var(--text-md); }
.btn-block { width: 100%; }
.btn-icon { width: 40px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }
.btn .spinner { width: 16px; height: 16px; }

.icon-button {
  position: relative; display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: var(--radius);
  background: transparent; border: 0; color: var(--gray-600); cursor: pointer;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.icon-button:hover { background: var(--gray-100); color: var(--el-navy); }
.icon-button[aria-expanded="true"] { background: var(--gray-100); color: var(--el-navy); }
.dot-badge { position: absolute; top: 3px; right: 1px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--radius-full); background: var(--el-orange); color: #fff; font-size: 10px; font-weight: 700; line-height: 14px; text-align: center; border: 2px solid #fff; box-sizing: border-box; pointer-events: none; }
.dot-badge[hidden] { display: none; }

.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Formulários */
.form { display: flex; flex-direction: column; gap: var(--sp-5); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-5); }
.form-grid .span-2 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label { font-size: var(--text-sm); font-weight: 600; color: var(--el-navy); }
.label .optional { font-weight: 400; color: var(--color-text-subtle); }
.input, .select, .textarea {
  width: 100%; height: 42px; padding: 0 var(--sp-3);
  background: #fff; border: 1px solid var(--color-border-strong); border-radius: var(--radius);
  font-size: var(--text-base); color: var(--el-navy);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.textarea { height: auto; min-height: 96px; padding: 10px var(--sp-3); resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--gray-400); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--gray-400); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--el-orange); box-shadow: 0 0 0 3px var(--color-focus); }
.input[readonly] { background: var(--gray-50); color: var(--gray-600); }
.select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236c7389' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.field.has-error .input, .field.has-error .select, .field.has-error .textarea { border-color: var(--danger); }
.field.has-error .input:focus { box-shadow: 0 0 0 3px rgba(207, 44, 30, .2); }
.field-error { font-size: var(--text-xs); color: var(--danger); display: flex; align-items: center; gap: 4px; }
.field-help { font-size: var(--text-xs); color: var(--color-text-muted); }
.input-group { position: relative; }
.input-group .input { padding-right: 44px; }
.input-group .input-addon { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; }
.input-code { font-family: var(--font-mono); font-size: 1.25rem; letter-spacing: .35em; text-align: center; height: 52px; }

.check { display: flex; align-items: flex-start; gap: var(--sp-3); cursor: pointer; font-size: var(--text-sm); }
.check input { appearance: none; flex: none; width: 18px; height: 18px; margin: 1px 0 0; border: 1.5px solid var(--gray-400); border-radius: 5px; background: #fff; cursor: pointer; display: grid; place-items: center; transition: background var(--dur-fast), border-color var(--dur-fast); }
.check input::after { content: ""; width: 9px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); opacity: 0; }
.check input:checked { background: var(--el-orange); border-color: var(--el-orange); }
.check input:checked::after { opacity: 1; }
.check input:focus-visible { outline: 2px solid var(--el-orange); outline-offset: 2px; }

.switch { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); cursor: pointer; }
.switch input { appearance: none; flex: none; position: relative; width: 38px; height: 22px; border-radius: var(--radius-full); background: var(--gray-300); cursor: pointer; transition: background var(--dur) var(--ease); }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-xs); transition: transform var(--dur) var(--ease); }
.switch input:checked { background: var(--el-orange); }
.switch input:checked::after { transform: translateX(16px); }

.form-actions { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }

/* Cartões */
.card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-5) var(--sp-6) 0; }
.card-head h2, .card-head h3 { font-size: var(--text-md); font-weight: 600; display: flex; align-items: center; gap: var(--sp-2); }
.card-head h2 .icon, .card-head h3 .icon { color: var(--gray-500); }
.card-body { padding: var(--sp-5) var(--sp-6) var(--sp-6); }
.card-body > p + p { margin-top: var(--sp-3); }
.card-foot { padding: var(--sp-4) var(--sp-6); border-top: 1px solid var(--color-border); background: var(--gray-25); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.card-muted { background: var(--gray-50); box-shadow: none; }
.card-danger { border-color: #f5c6c1; }

.grid { display: grid; gap: var(--sp-5); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.col-span-2 { grid-column: span 2; }

/* Estatísticas */
.stat { padding: var(--sp-5); }
.stat-label { font-size: var(--text-sm); color: var(--color-text-muted); display: flex; align-items: center; gap: var(--sp-2); }
.stat-value { font-size: 1.75rem; font-weight: 600; letter-spacing: var(--tracking-tight); margin-top: var(--sp-2); line-height: 1.1; }
.stat-meta { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: var(--sp-2); }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: var(--radius-full); font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--gray-100); color: var(--gray-600); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.no-dot::before { display: none; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-accent { background: var(--el-orange-50); color: var(--el-orange-700); }
.badge-dark { background: var(--el-navy); color: #fff; }

/* Alertas */
.alert { display: flex; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-radius: var(--radius); font-size: var(--text-sm); border: 1px solid transparent; }
.alert .icon { margin-top: 1px; }
.alert-success { background: var(--success-bg); color: #0b5e42; border-color: #c6ebdc; }
.alert-error { background: var(--danger-bg); color: #a32217; border-color: #f7cfca; }
.alert-warning { background: var(--warning-bg); color: #84500b; border-color: #f4e0b7; }
.alert-info { background: var(--info-bg); color: #24439f; border-color: #d3defa; }

/* Barra de progresso (armazenamento) */
.progress { height: 8px; border-radius: var(--radius-full); background: var(--gray-100); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--el-navy); transition: width .6s var(--ease); }
.progress.is-warning > span { background: #e0a100; }
.progress.is-critical > span, .progress.is-full > span { background: var(--danger); }

/* Tabelas */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.table th { text-align: left; font-weight: 600; font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .05em; color: var(--color-text-muted); padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--color-border); background: var(--gray-25); white-space: nowrap; }
.table td { padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--color-border); vertical-align: middle; }
.table tbody tr { transition: background var(--dur-fast); }
.table tbody tr:hover { background: var(--gray-25); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .cell-user { display: flex; align-items: center; gap: var(--sp-3); min-width: 220px; }

/* Abas */
.tabs { display: flex; gap: var(--sp-1); border-bottom: 1px solid var(--color-border); margin-bottom: var(--sp-6); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; display: inline-flex; align-items: center; gap: var(--sp-2); padding: var(--sp-3) var(--sp-3); font-size: var(--text-sm); font-weight: 500; color: var(--color-text-muted); white-space: nowrap; transition: color var(--dur-fast); }
.tab:hover { color: var(--el-navy); }
.tab.is-active { color: var(--el-navy); font-weight: 600; }
.tab.is-active::after { content: ""; position: absolute; left: var(--sp-2); right: var(--sp-2); bottom: -1px; height: 2px; border-radius: 2px; background: var(--el-orange); }

/* Avatar */
.avatar { display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; overflow: hidden; background: var(--el-navy); color: #fff; font-size: 13px; font-weight: 600; letter-spacing: .02em; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-lg { width: 72px; height: 72px; font-size: 22px; }
.avatar-button { display: flex; align-items: center; gap: var(--sp-2); padding: 3px; padding-right: var(--sp-2); border: 0; border-radius: var(--radius-full); background: transparent; cursor: pointer; }
.avatar-button:hover, .avatar-button[aria-expanded="true"] { background: var(--gray-100); }

/* Dropdown */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: var(--z-dropdown);
  min-width: 240px; padding: var(--sp-2);
  background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
  opacity: 0; transform: translateY(-4px) scale(.98); transform-origin: top right; pointer-events: none;
  transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.dropdown.is-open .dropdown-menu { opacity: 1; transform: none; pointer-events: auto; }
.dropdown-item { display: flex; align-items: center; gap: var(--sp-3); width: 100%; padding: 9px var(--sp-3); border: 0; border-radius: var(--radius-sm); background: none; font-size: var(--text-sm); text-align: left; color: var(--gray-700); cursor: pointer; }
.dropdown-item:hover, .dropdown-item:focus-visible { background: var(--gray-50); color: var(--el-navy); outline: none; }
.dropdown-item .icon { color: var(--gray-500); }
.dropdown-sep { height: 1px; background: var(--color-border); margin: var(--sp-2) 0; }
.dropdown-head { padding: var(--sp-2) var(--sp-3) var(--sp-3); }

/* Painel de notificações */
.notif-menu { width: 380px; max-width: calc(100vw - 24px); padding: 0; }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-4) var(--sp-4) var(--sp-3); border-bottom: 1px solid var(--color-border); }
.notif-list { max-height: 420px; overflow-y: auto; }
.notif-item { display: flex; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--gray-100); cursor: pointer; transition: background var(--dur-fast); }
.notif-item:hover { background: var(--gray-25); }
.notif-item.is-unread { background: #fffaf6; }
.notif-item.is-unread .notif-title::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 6px; border-radius: 50%; background: var(--el-orange); vertical-align: middle; }
.notif-icon { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--radius); background: var(--gray-100); color: var(--gray-600); }
.notif-title { font-size: var(--text-sm); font-weight: 600; }
.notif-body { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: 2px; }
.notif-time { font-size: 11px; color: var(--color-text-subtle); margin-top: 4px; }
.notif-foot { padding: var(--sp-3); text-align: center; }

/* Estado vazio */
.empty { text-align: center; padding: var(--sp-10) var(--sp-6); color: var(--color-text-muted); }
.empty .empty-icon { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: var(--radius-lg); background: var(--gray-50); color: var(--gray-400); margin-bottom: var(--sp-3); }
.empty h3 { color: var(--el-navy); font-size: var(--text-md); margin-bottom: var(--sp-1); }

/* Lista simples */
.list { list-style: none; margin: 0; padding: 0; }
.list-item { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) 0; border-bottom: 1px solid var(--gray-100); }
.list-item:last-child { border-bottom: 0; }
.list-item .icon-box { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius); background: var(--gray-50); color: var(--gray-600); }

/* Lista de definição (dados) */
.dl { display: grid; grid-template-columns: minmax(110px, max-content) 1fr; gap: var(--sp-3) var(--sp-4); margin: 0; font-size: var(--text-sm); }
.dl dt { color: var(--color-text-muted); }
.dl dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }

/* Modal (elemento <dialog>) */
dialog.modal { width: min(520px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); color: var(--el-navy); }
dialog.modal::backdrop { background: rgba(12, 14, 28, .5); backdrop-filter: blur(2px); }
dialog.modal[open] { animation: modal-in var(--dur) var(--ease); }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-6) var(--sp-6) 0; }
.modal-head h2 { font-size: var(--text-lg); }
.modal-body { padding: var(--sp-4) var(--sp-6); color: var(--gray-600); }
.modal-foot { display: flex; justify-content: flex-end; gap: var(--sp-3); padding: var(--sp-4) var(--sp-6) var(--sp-6); }

/* Toasts */
.toasts { position: fixed; right: var(--sp-6); bottom: var(--sp-6); z-index: var(--z-toast); display: flex; flex-direction: column; gap: var(--sp-2); width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; align-items: flex-start; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); background: var(--el-navy); color: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg); font-size: var(--text-sm); animation: toast-in var(--dur) var(--ease); }
.toast .icon { margin-top: 1px; }
.toast-success .icon { color: #5ee0ac; }
.toast-error .icon { color: #ff8a7d; }
.toast-warning .icon { color: #ffc65c; }
.toast-close { margin-left: auto; background: none; border: 0; color: #9da2c0; cursor: pointer; padding: 0; }
.toast.is-leaving { opacity: 0; transform: translateY(6px); transition: all var(--dur) var(--ease); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

.offline-bar { position: fixed; left: 50%; top: var(--sp-4); transform: translateX(-50%); z-index: var(--z-toast); display: none; align-items: center; gap: var(--sp-2); padding: var(--sp-2) var(--sp-4); border-radius: var(--radius-full); background: var(--danger); color: #fff; font-size: var(--text-sm); box-shadow: var(--shadow-md); }
.offline-bar.is-visible { display: flex; }

/* Paginação */
.pagination { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-4) var(--sp-6); border-top: 1px solid var(--color-border); font-size: var(--text-sm); color: var(--color-text-muted); }

/* Gráfico de barras SVG (painel admin) */
.chart-bars { width: 100%; height: 180px; }
.chart-bars rect.bar { fill: var(--el-navy); transition: fill var(--dur-fast); }
.chart-bars rect.bar:hover { fill: var(--el-orange); }
.chart-bars .axis { stroke: var(--gray-200); }
.chart-bars text { font-size: 10px; fill: var(--gray-500); font-family: var(--font-sans); }

/* Códigos de recuperação */
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-2); padding: var(--sp-4); background: var(--gray-50); border: 1px dashed var(--color-border-strong); border-radius: var(--radius); font-family: var(--font-mono); font-size: var(--text-md); text-align: center; }
.qr-box { display: grid; place-items: center; width: 196px; height: 196px; padding: 10px; background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-lg); }
.qr-box svg, .qr-box img { width: 100%; height: 100%; }
.secret-key { font-family: var(--font-mono); letter-spacing: .08em; word-break: break-all; padding: var(--sp-2) var(--sp-3); background: var(--gray-50); border-radius: var(--radius-sm); }

/* Módulos (próximas etapas) */
.module-tile { display: flex; gap: var(--sp-3); padding: var(--sp-4); border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: #fff; }
.module-tile .module-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius); background: var(--el-orange-50); color: var(--el-orange-600); }
.module-tile h3 { font-size: var(--text-base); }
.module-tile p { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: 2px; }

/* ==========================================================================
   5. AUTENTICAÇÃO E INSTALADOR
   ========================================================================== */
.auth { display: grid; grid-template-columns: minmax(360px, 44%) 1fr; min-height: 100vh; }
.auth-aside { position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: var(--sp-10) var(--sp-12); background: var(--el-navy); color: #fff; overflow: hidden; }
.auth-aside::after { content: ""; position: absolute; right: -180px; bottom: -180px; width: 520px; height: 520px; border-radius: 50%; border: 60px solid rgba(255,255,255,.03); pointer-events: none; }
.auth-brand { display: flex; align-items: center; gap: var(--sp-3); }
.auth-brand img { width: 44px; height: 44px; }
.auth-brand .brand-word { font-size: 1.375rem; }
.auth-hero { position: relative; z-index: 1; max-width: 420px; }
.auth-hero h2 { font-size: 2.25rem; font-weight: 600; line-height: 1.15; letter-spacing: -.025em; }
.auth-hero h2 em { font-style: normal; color: var(--el-orange); }
.auth-hero p { margin-top: var(--sp-4); color: #a9adc8; font-size: var(--text-md); line-height: 1.6; }
.auth-modules { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-8); }
.auth-modules span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--radius-full); background: rgba(255,255,255,.06); color: #d5d8ea; font-size: var(--text-sm); }
.auth-modules .icon { width: 15px; height: 15px; color: var(--el-orange); }
.auth-aside-foot { font-size: var(--text-xs); color: #6e7393; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: var(--sp-10) var(--sp-6); }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 1.625rem; }
.auth-card .lead { color: var(--color-text-muted); margin-top: var(--sp-2); margin-bottom: var(--sp-8); }
.auth-mobile-brand { display: none; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-8); }
.auth-mobile-brand img { width: 40px; height: 40px; }
.auth-alt { margin-top: var(--sp-6); text-align: center; font-size: var(--text-sm); color: var(--color-text-muted); }
.auth-alt a { color: var(--el-orange-600); font-weight: 600; }
.divider-text { display: flex; align-items: center; gap: var(--sp-3); color: var(--color-text-subtle); font-size: var(--text-xs); }
.divider-text::before, .divider-text::after { content: ""; flex: 1; height: 1px; background: var(--color-border); }
.password-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 2px; }
.password-meter span { height: 4px; border-radius: 2px; background: var(--gray-200); transition: background var(--dur); }
.password-meter[data-score="1"] span:nth-child(-n+1) { background: var(--danger); }
.password-meter[data-score="2"] span:nth-child(-n+2) { background: #e0a100; }
.password-meter[data-score="3"] span:nth-child(-n+3) { background: #5aa86f; }
.password-meter[data-score="4"] span { background: var(--success); }

.install { min-height: 100vh; background: var(--gray-50); padding: var(--sp-10) var(--sp-4); }
.install-wrap { max-width: 760px; margin: 0 auto; }
.install-top { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-8); }
.install-top img { width: 40px; height: 40px; }
.steps { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-6); counter-reset: step; overflow-x: auto; scrollbar-width: none; }
.step { flex: 1; min-width: 92px; display: flex; flex-direction: column; gap: 6px; font-size: var(--text-xs); color: var(--color-text-subtle); }
.step::before { content: ""; height: 4px; border-radius: 2px; background: var(--gray-200); }
.step.is-done { color: var(--gray-600); }
.step.is-done::before { background: var(--el-navy); }
.step.is-current { color: var(--el-navy); font-weight: 600; }
.step.is-current::before { background: var(--el-orange); }
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { display: flex; align-items: center; gap: var(--sp-3); padding: 10px 0; border-bottom: 1px solid var(--gray-100); font-size: var(--text-sm); }
.check-list li:last-child { border-bottom: 0; }
.check-ok { color: var(--success); }
.check-fail { color: var(--danger); }
.check-warn { color: var(--warning); }
pre.code { margin: 0; padding: var(--sp-3) var(--sp-4); background: var(--el-navy); color: #e6e8f5; border-radius: var(--radius); font-size: var(--text-xs); overflow-x: auto; white-space: pre-wrap; word-break: break-all; }

/* Página de erro */
.error-page { min-height: 100vh; display: grid; place-items: center; padding: var(--sp-6); text-align: center; }
.error-code { font-size: 4.5rem; font-weight: 700; letter-spacing: -.04em; color: var(--el-navy); line-height: 1; }
.error-code span { color: var(--el-orange); }

/* ==========================================================================
   6. RESPONSIVO
   ========================================================================== */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .app, .app.is-collapsed { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: min(280px, 86vw); transform: translateX(-100%); transition: transform var(--dur) var(--ease); }
  .app.is-mobile-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .sidebar { z-index: calc(var(--z-overlay) + 1); }
  .app.is-collapsed .nav-text, .app.is-collapsed .nav-soon, .app.is-collapsed .brand-text, .app.is-collapsed .nav-label { display: initial; }
  .app.is-collapsed .nav-item { justify-content: flex-start; padding: 0 var(--sp-3); }
  .app.is-collapsed .sidebar-brand { justify-content: flex-start; padding: 0 var(--sp-4) 0 18px; }
  .sidebar-toggle { display: none; }
  .icon-button.menu-button { display: inline-grid; }
  .header { padding: 0 var(--sp-4); }
  .content { padding: var(--sp-6) var(--sp-4) var(--sp-10); }
  .auth { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-mobile-brand { display: flex; }
  .grid-2, .col-span-2 { grid-template-columns: minmax(0, 1fr); grid-column: auto; }
}
@media (max-width: 640px) {
  .grid-4, .grid-3, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid .span-2 { grid-column: auto; }
  .header-title .crumb { display: none; }
  .hide-sm { display: none !important; }
  .dl { grid-template-columns: 1fr; gap: 2px var(--sp-4); }
  .dl dd { margin-bottom: var(--sp-3); }
  .card-head { padding: var(--sp-4) var(--sp-4) 0; }
  .card-body { padding: var(--sp-4); }
  .toasts { right: var(--sp-4); bottom: var(--sp-4); }
  .codes { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Marca sobre fundo claro */
.auth-mobile-brand .brand-word, .install-top .brand-word { color: var(--el-navy); }
.auth-mobile-brand .brand-by, .install-top .brand-by { color: var(--gray-500); }
.nav-count { background: var(--el-orange); color: #fff; }

/* ==========================================================================
   7. ETAPA 2 — componentes dos módulos
   ========================================================================== */
.kbd-hint { margin-left: auto; font-size: 10px; padding: 0 5px; }
.dropdown-item.is-disabled { color: var(--gray-400); cursor: default; }
.dropdown-item.is-disabled:hover { background: none; }
.dropdown-item .nav-soon { background: var(--gray-100); color: var(--gray-500); }

/* Barra de ferramentas de página */
.toolbar { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; margin-bottom: var(--sp-5); }
.toolbar .grow { flex: 1; }
.seg { display: inline-flex; padding: 3px; background: var(--gray-100); border-radius: var(--radius); gap: 2px; }
.seg button, .seg a { height: 32px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; font-size: var(--text-sm); font-weight: 500; color: var(--gray-600); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.seg button:hover, .seg a:hover { color: var(--el-navy); }
.seg .is-active { background: #fff; color: var(--el-navy); font-weight: 600; box-shadow: var(--shadow-xs); }
.search-input { position: relative; }
.search-input .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--gray-400); pointer-events: none; }
.search-input .input { padding-left: 36px; height: 38px; }

/* Cores */
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { position: relative; width: 28px; height: 28px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--color-border-strong); cursor: pointer; }
.swatch input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.swatch:has(input:checked) { box-shadow: 0 0 0 2px var(--el-navy); }
.swatch:has(input:focus-visible) { outline: 2px solid var(--el-orange); outline-offset: 2px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }

/* Etiquetas */
.tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tag { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: var(--radius-full); background: var(--gray-100); color: var(--gray-700); font-size: 12px; font-weight: 500; }
.tag button { border: 0; background: none; padding: 0; color: var(--gray-500); cursor: pointer; display: grid; }
.tag-input { border: 0; outline: none; font-size: 12.5px; min-width: 110px; flex: 1; background: transparent; padding: 4px 2px; }

/* Modal largo e formulários compactos */
dialog.modal.modal-lg { width: min(720px, calc(100vw - 32px)); }
dialog.modal .modal-body { max-height: calc(100vh - 220px); overflow-y: auto; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-4); }
.inline-fields { display: flex; gap: var(--sp-3); align-items: flex-end; flex-wrap: wrap; }
.weekday-picker { display: flex; gap: 6px; flex-wrap: wrap; }
.weekday-picker label { position: relative; }
.weekday-picker input { position: absolute; opacity: 0; }
.weekday-picker span { display: grid; place-items: center; width: 38px; height: 34px; border-radius: var(--radius-sm); border: 1px solid var(--color-border-strong); font-size: 12px; font-weight: 600; cursor: pointer; }
.weekday-picker input:checked + span { background: var(--el-navy); color: #fff; border-color: var(--el-navy); }
.weekday-picker input:focus-visible + span { outline: 2px solid var(--el-orange); outline-offset: 2px; }
details.more > summary { cursor: pointer; font-size: var(--text-sm); font-weight: 600; color: var(--gray-600); list-style: none; display: flex; align-items: center; gap: 6px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more[open] > summary .icon { transform: rotate(180deg); }

/* Upload */
.dropzone { border: 1.5px dashed var(--color-border-strong); border-radius: var(--radius); padding: var(--sp-4); text-align: center; font-size: var(--text-sm); color: var(--color-text-muted); transition: background var(--dur-fast), border-color var(--dur-fast); cursor: pointer; }
.dropzone.is-over { background: var(--el-orange-50); border-color: var(--el-orange); color: var(--el-orange-700); }
.file-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.file-item { display: flex; align-items: center; gap: var(--sp-3); padding: 8px 10px; border: 1px solid var(--color-border); border-radius: var(--radius); font-size: var(--text-sm); background: #fff; }
.file-item .file-ext { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: var(--gray-100); color: var(--gray-600); font-size: 10px; font-weight: 700; text-transform: uppercase; overflow: hidden; }
.file-item .file-ext img { width: 100%; height: 100%; object-fit: cover; }
.file-item .progress { height: 4px; margin-top: 4px; }

/* Painel lateral (vínculos, anexos) */
.side-panel { display: flex; flex-direction: column; gap: var(--sp-5); }
.side-panel h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--color-text-muted); margin-bottom: var(--sp-2); display: flex; align-items: center; justify-content: space-between; }
.link-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.link-list a { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--radius-sm); font-size: var(--text-sm); }
.link-list a:hover { background: var(--gray-50); }
.type-pill { font-size: 10.5px; font-weight: 600; padding: 1px 7px; border-radius: var(--radius-full); background: var(--gray-100); color: var(--gray-600); white-space: nowrap; }

/* ---------- Agenda ---------- */
.agenda-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: var(--sp-6); align-items: start; }
.agenda-side { position: sticky; top: calc(var(--header-h) + 16px); display: flex; flex-direction: column; gap: var(--sp-5); }
.cal-list { list-style: none; margin: 0; padding: 0; }
.cal-list li { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: var(--text-sm); }
.cal-list input[type=checkbox] { accent-color: var(--el-navy); width: 16px; height: 16px; }
.calendar-card { padding: var(--sp-4); }
.fc { --fc-border-color: var(--gray-200); --fc-today-bg-color: #fff6f0; --fc-page-bg-color: #fff; --fc-neutral-bg-color: var(--gray-50); --fc-event-border-color: transparent; --fc-button-bg-color: #fff; --fc-button-border-color: var(--color-border-strong); --fc-button-text-color: var(--el-navy); --fc-button-hover-bg-color: var(--gray-50); --fc-button-hover-border-color: var(--gray-400); --fc-button-active-bg-color: var(--el-navy); --fc-button-active-border-color: var(--el-navy); font-size: var(--text-sm); }
.fc .fc-toolbar-title { font-size: 1.125rem; font-weight: 600; letter-spacing: -.01em; }
.fc .fc-toolbar-title::first-letter { text-transform: uppercase; }
.fc .fc-button { font-weight: 600; font-size: 13px; border-radius: 8px !important; padding: 6px 12px; box-shadow: none !important; text-transform: capitalize; }
.fc .fc-button-primary:not(:disabled).fc-button-active { color: #fff; }
.fc .fc-button-group { gap: 4px; }
.fc .fc-col-header-cell-cushion { font-size: 12px; font-weight: 600; color: var(--gray-500); text-transform: uppercase; padding: 8px 4px; }
.fc .fc-daygrid-day-number { font-size: 12.5px; padding: 6px 8px; color: var(--gray-600); }
.fc .fc-day-today .fc-daygrid-day-number { background: var(--el-orange); color: #fff; border-radius: 999px; min-width: 24px; text-align: center; margin: 4px; padding: 2px 6px; }
.fc-event { border-radius: 6px; padding: 1px 4px; font-weight: 500; cursor: pointer; }
.fc .fc-list-event:hover td { background: var(--gray-50); }
.fc-routine { opacity: .85; border-style: dashed !important; }
.fc-routine-done { opacity: .55; text-decoration: line-through; }
.fc .fc-timegrid-now-indicator-line { border-color: var(--el-orange); }
.event-meta { display: flex; flex-direction: column; gap: 10px; font-size: var(--text-sm); }
.event-meta .row { align-items: flex-start; }
.event-meta .icon { color: var(--gray-500); margin-top: 2px; }

/* Rotinas */
.routine-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--sp-4); align-items: center; padding: var(--sp-4) var(--sp-5); }
.routine-check { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--gray-300); background: #fff; display: grid; place-items: center; cursor: pointer; color: transparent; transition: all var(--dur-fast); }
.routine-check:hover { border-color: var(--success); color: var(--success); }
.routine-check.is-done { background: var(--success); border-color: var(--success); color: #fff; }
.routine-check.is-skipped { background: var(--gray-200); border-color: var(--gray-300); color: var(--gray-500); }
.routine-check:disabled { opacity: .4; cursor: default; }
.routine-stats { display: flex; gap: var(--sp-5); flex-wrap: wrap; font-size: var(--text-xs); color: var(--color-text-muted); margin-top: 6px; }
.routine-stats strong { color: var(--el-navy); font-size: var(--text-sm); }
.heat { display: grid; grid-template-rows: repeat(7, 11px); grid-auto-flow: column; grid-auto-columns: 11px; gap: 3px; }
.heat span { border-radius: 3px; background: var(--gray-100); }
.heat span.off { background: transparent; }
.heat span.done { background: var(--success); }
.heat span.skipped { background: var(--gray-300); }
.heat span.missed { background: #f6c9c4; }
.heat span.today { outline: 1.5px solid var(--el-navy); outline-offset: 1px; }
.heat-legend { display: flex; gap: 10px; font-size: 11px; color: var(--color-text-muted); align-items: center; }
.heat-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 3px; vertical-align: -1px; }

/* ---------- Caderno ---------- */
.nb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--sp-5); }
.nb-card { display: flex; flex-direction: column; border: 1px solid var(--color-border); border-radius: var(--radius-lg); overflow: hidden; background: #fff; transition: box-shadow var(--dur), transform var(--dur); }
.nb-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.nb-cover { height: 96px; position: relative; display: flex; align-items: flex-end; padding: var(--sp-3) var(--sp-4); background-size: cover; background-position: center; }
.nb-cover .nb-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: rgba(255,255,255,.92); color: var(--el-navy); box-shadow: var(--shadow-sm); }
.nb-body { padding: var(--sp-4); display: flex; flex-direction: column; gap: 4px; }
.nb-body h3 { font-size: var(--text-md); }
.nb-new { border-style: dashed; align-items: center; justify-content: center; min-height: 190px; color: var(--gray-500); gap: var(--sp-2); cursor: pointer; background: var(--gray-25); font: inherit; }
.nb-new:hover { color: var(--el-orange-600); border-color: var(--el-orange); }

.notebook { display: grid; grid-template-columns: 270px minmax(0, 1fr); min-height: calc(100vh - var(--header-h)); }
.notebook.has-panel { grid-template-columns: 270px minmax(0, 1fr) 280px; }
.content.content-full { max-width: none; padding: 0; }
.nb-tree { border-right: 1px solid var(--color-border); background: var(--gray-25); padding: var(--sp-4) var(--sp-3); position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); overflow-y: auto; display: flex; flex-direction: column; gap: var(--sp-3); }
.nb-tree-head { display: flex; align-items: center; gap: var(--sp-2); padding: 0 var(--sp-2); }
.nb-tree-head .nb-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: #fff; flex: none; }
.nb-tree-head strong { font-size: var(--text-sm); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { padding-left: 14px; min-height: 6px; }
.tree-row { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: var(--radius-sm); font-size: var(--text-sm); color: var(--gray-700); cursor: pointer; user-select: none; }
.tree-row:hover { background: var(--gray-100); }
.tree-row.is-active { background: #fff; color: var(--el-navy); font-weight: 600; box-shadow: var(--shadow-xs); }
.tree-row .icon { width: 15px; height: 15px; color: var(--gray-500); flex: none; }
.tree-row .tree-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-row .tree-actions { display: none; gap: 2px; }
.tree-row:hover .tree-actions, .tree-row:focus-within .tree-actions { display: flex; }
.tree-row .tree-actions button { width: 22px; height: 22px; border: 0; background: none; border-radius: 5px; color: var(--gray-500); cursor: pointer; display: grid; place-items: center; }
.tree-row .tree-actions button:hover { background: var(--gray-200); color: var(--el-navy); }
.tree-section > .tree-row { font-weight: 600; color: var(--el-navy); }
.tree-section.is-collapsed > ul { display: none; }
.tree-section.is-collapsed > .tree-row .chev { transform: rotate(-90deg); }
.sortable-ghost { opacity: .35; }
.sortable-drag { box-shadow: var(--shadow-md); }
.nb-search-results { display: flex; flex-direction: column; gap: 2px; }
.nb-search-results a { display: block; padding: 6px 8px; border-radius: var(--radius-sm); font-size: var(--text-sm); }
.nb-search-results a:hover { background: var(--gray-100); }
.nb-search-results small { display: block; color: var(--color-text-muted); font-size: 11.5px; }

.nb-main { min-width: 0; display: flex; flex-direction: column; }
.editor-toolbar { position: sticky; top: var(--header-h); z-index: 20; display: flex; align-items: center; gap: 2px; flex-wrap: wrap; padding: 6px var(--sp-6); background: rgba(255,255,255,.96); backdrop-filter: blur(6px); border-bottom: 1px solid var(--color-border); }
.editor-toolbar button, .editor-toolbar select { height: 32px; min-width: 32px; padding: 0 7px; border: 0; border-radius: 7px; background: none; color: var(--gray-600); cursor: pointer; font-size: 13px; font-weight: 600; display: inline-grid; place-items: center; }
.editor-toolbar select { border: 1px solid transparent; font-weight: 500; }
.editor-toolbar button:hover, .editor-toolbar select:hover { background: var(--gray-100); color: var(--el-navy); }
.editor-toolbar button.is-active { background: var(--el-navy); color: #fff; }
.editor-toolbar .sep { width: 1px; height: 20px; background: var(--color-border); margin: 0 4px; }
.editor-toolbar .tb-icon { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.save-status { margin-left: auto; font-size: 12px; color: var(--color-text-muted); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.save-status.is-error { color: var(--danger); }
.page-wrap { width: 100%; max-width: 820px; margin: 0 auto; padding: var(--sp-8) var(--sp-6) var(--sp-16); }
.page-title { width: 100%; border: 0; outline: none; font: inherit; font-size: 2rem; font-weight: 700; letter-spacing: -.025em; color: var(--el-navy); padding: 0; margin-bottom: var(--sp-2); background: transparent; }
.page-title::placeholder { color: var(--gray-300); }
.page-meta { display: flex; gap: var(--sp-3); align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--color-text-muted); margin-bottom: var(--sp-6); }

.prose { font-size: 15.5px; line-height: 1.75; color: #1c2036; }
.prose .ProseMirror { outline: none; min-height: 50vh; }
.prose .ProseMirror > * + * { margin-top: .7em; }
.prose p { margin: 0; }
.prose h1, .prose h2, .prose h3, .prose h4 { margin-top: 1.4em; color: var(--el-navy); }
.prose h1 { font-size: 1.75rem; } .prose h2 { font-size: 1.4rem; } .prose h3 { font-size: 1.15rem; } .prose h4 { font-size: 1rem; }
.prose ul, .prose ol { padding-left: 1.5em; margin: 0; }
.prose li > p { margin: 0; }
.prose blockquote { margin: 0; padding: .2em 1em; border-left: 3px solid var(--el-orange); color: var(--gray-600); background: var(--gray-25); border-radius: 0 8px 8px 0; }
.prose code { background: var(--gray-100); padding: .12em .35em; border-radius: 5px; font-size: .88em; }
.prose pre { background: var(--el-navy); color: #e8eaf6; padding: 14px 16px; border-radius: 10px; overflow-x: auto; font-size: 13.5px; line-height: 1.55; }
.prose pre code { background: none; padding: 0; color: inherit; }
.prose hr { margin: 1.6em 0; border-top: 1px solid var(--color-border-strong); }
.prose a { color: var(--el-orange-600); text-decoration: underline; text-underline-offset: 2px; }
.prose mark { background: #fff1a8; border-radius: 3px; padding: 0 .1em; }
.prose img { max-width: 100%; border-radius: 10px; display: block; }
.prose img.ProseMirror-selectednode { outline: 3px solid var(--el-orange); }
.prose ul[data-type="taskList"] { list-style: none; padding-left: .2em; }
.prose ul[data-type="taskList"] li { display: flex; gap: 10px; align-items: flex-start; }
.prose ul[data-type="taskList"] li > label { margin-top: .32em; flex: none; }
.prose ul[data-type="taskList"] li > label input { accent-color: var(--el-orange); width: 16px; height: 16px; }
.prose ul[data-type="taskList"] li[data-checked="true"] > div { color: var(--gray-400); text-decoration: line-through; }
.prose ul[data-type="taskList"] li > div { flex: 1; }
.prose table { border-collapse: collapse; width: 100%; table-layout: fixed; margin: 1em 0; overflow: hidden; }
.prose td, .prose th { border: 1px solid var(--gray-300); padding: 6px 10px; vertical-align: top; position: relative; min-width: 60px; }
.prose th { background: var(--gray-50); font-weight: 600; text-align: left; }
.prose .selectedCell::after { content: ""; position: absolute; inset: 0; background: rgba(251, 82, 0, .12); pointer-events: none; }
.prose .column-resize-handle { position: absolute; right: -2px; top: 0; bottom: 0; width: 4px; background: var(--el-orange); pointer-events: none; }
.prose .tableWrapper { overflow-x: auto; }
.prose.resize-cursor { cursor: col-resize; }
.prose p.is-editor-empty:first-child::before { content: attr(data-placeholder); color: var(--gray-400); float: left; height: 0; pointer-events: none; }
.prose .file-chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; background: var(--gray-100); color: var(--el-navy) !important; text-decoration: none !important; font-size: .9em; font-weight: 500; }
.prose .tiptap-mathematics-render { cursor: pointer; padding: 0 2px; border-radius: 4px; }
.prose .tiptap-mathematics-render:hover { background: var(--gray-100); }
.prose [data-type="block-math"] { display: block; text-align: center; margin: 1em 0; }

.bubble { position: absolute; z-index: 40; display: none; gap: 2px; padding: 4px; background: var(--el-navy); border-radius: 10px; box-shadow: var(--shadow-lg); }
.bubble.is-visible { display: flex; }
.bubble button { height: 30px; padding: 0 10px; border: 0; border-radius: 7px; background: none; color: #e5e7f3; font-size: 12.5px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.bubble button:hover { background: var(--el-navy-700); color: #fff; }
.bubble .icon { width: 14px; height: 14px; }
.nb-panel { border-left: 1px solid var(--color-border); padding: var(--sp-5) var(--sp-4); position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); overflow-y: auto; background: #fff; }
.version-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: var(--text-sm); }
.version-item:hover, .version-item.is-active { background: var(--gray-50); }
.version-preview { border: 1px solid var(--color-border); border-radius: var(--radius); padding: var(--sp-4); max-height: 50vh; overflow-y: auto; }

/* ---------- Notas ---------- */
.notes-shell { display: flex; flex-direction: column; gap: var(--sp-4); }
.board-tabs { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.board-tab { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: var(--radius-full); border: 1px solid var(--color-border); font-size: var(--text-sm); font-weight: 500; background: #fff; color: var(--gray-600); }
.board-tab:hover { border-color: var(--gray-400); color: var(--el-navy); }
.board-tab.is-active { background: var(--el-navy); color: #fff; border-color: var(--el-navy); }
.board-tab .count { font-size: 11px; opacity: .7; }
.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--sp-4); align-items: start; }
.notes-canvas-wrap { position: relative; overflow: auto; border: 1px solid var(--color-border); border-radius: var(--radius-lg); height: calc(100vh - 250px); min-height: 420px;
  background-color: var(--gray-25); background-image: radial-gradient(var(--gray-200) 1px, transparent 1px); background-size: 22px 22px; }
.notes-canvas { position: relative; width: 3000px; height: 2000px; }
.note { --note-bg: #FFF4C2; position: relative; display: flex; flex-direction: column; background: var(--note-bg); border-radius: 12px; box-shadow: 0 1px 2px rgba(19,22,41,.06), 0 4px 12px -4px rgba(19,22,41,.12); transition: box-shadow var(--dur); min-height: 120px; }
.note:hover { box-shadow: 0 2px 4px rgba(19,22,41,.08), 0 10px 24px -6px rgba(19,22,41,.18); }
.note.is-focus { outline: 3px solid var(--el-orange); outline-offset: 2px; }
.notes-canvas .note { position: absolute; }
.note-head { display: flex; align-items: center; gap: 4px; padding: 8px 8px 0 12px; cursor: grab; }
.notes-grid .note-head { cursor: grab; }
.note-head:active { cursor: grabbing; }
.note-title { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-weight: 700; font-size: 14px; color: var(--el-navy); outline: none; padding: 2px 0; }
.note-title::placeholder { color: rgba(19,22,41,.35); font-weight: 600; }
.note-body { flex: 1; min-height: 60px; width: 100%; border: 0; resize: none; background: transparent; font: inherit; font-size: 13.5px; line-height: 1.55; color: #262a40; outline: none; padding: 4px 12px; overflow: hidden; }
.notes-canvas .note-body { overflow-y: auto; }
.note-body::placeholder { color: rgba(19,22,41,.35); }
.note-links { padding: 0 12px; display: flex; flex-direction: column; gap: 2px; }
.note-links a { font-size: 12px; color: var(--el-orange-700); text-decoration: underline; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-check { list-style: none; margin: 0; padding: 2px 12px 4px; display: flex; flex-direction: column; gap: 2px; }
.note-check li { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.note-check input[type=checkbox] { accent-color: var(--el-navy); flex: none; }
.note-check input[type=text] { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; outline: none; padding: 2px 0; }
.note-check li.done input[type=text] { text-decoration: line-through; color: rgba(19,22,41,.45); }
.note-check .rm { opacity: 0; border: 0; background: none; cursor: pointer; color: rgba(19,22,41,.5); }
.note-check li:hover .rm { opacity: 1; }
.note-foot { display: flex; align-items: center; gap: 2px; padding: 4px 6px 6px; opacity: .55; transition: opacity var(--dur-fast); flex-wrap: wrap; }
.note:hover .note-foot, .note:focus-within .note-foot { opacity: 1; }
.note-foot > button, .note-foot > .dropdown > button { width: 28px; height: 28px; border: 0; background: none; border-radius: 7px; color: rgba(19,22,41,.7); cursor: pointer; display: grid; place-items: center; }
.note-foot > button:hover, .note-foot > .dropdown > button:hover { background: rgba(19,22,41,.08); color: var(--el-navy); }
.note-foot > button.is-on { color: var(--el-orange-700); }
.note-foot .icon { width: 15px; height: 15px; }
.note-meta { font-size: 11px; color: rgba(19,22,41,.55); margin-left: auto; padding-right: 4px; display: flex; gap: 6px; align-items: center; }
.note-badges { display: flex; gap: 4px; flex-wrap: wrap; padding: 0 12px 4px; }
.note-badges span { font-size: 10.5px; padding: 1px 7px; border-radius: 999px; background: rgba(19,22,41,.08); color: #262a40; display: inline-flex; gap: 3px; align-items: center; }
.note-resize { position: absolute; right: 2px; bottom: 2px; width: 14px; height: 14px; cursor: nwse-resize; background: linear-gradient(135deg, transparent 50%, rgba(19,22,41,.25) 50%); border-radius: 0 0 10px 0; }
.notes-grid .note-resize { display: none; }
.note-pin { position: absolute; top: -6px; right: 12px; width: 18px; height: 18px; border-radius: 50%; background: var(--el-orange); box-shadow: 0 2px 4px rgba(0,0,0,.2); }
.note.is-saving .note-meta::before { content: "salvando…"; }
.color-pop { position: absolute; z-index: 30; display: flex; gap: 6px; padding: 8px; background: #fff; border-radius: 10px; box-shadow: var(--shadow-md); border: 1px solid var(--color-border); }
.color-pop button { width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(19,22,41,.15); cursor: pointer; }

/* ---------- Dashboard ---------- */
.widgets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-5); align-items: start; }
.widget { min-width: 0; }
.widget.w-wide { grid-column: span 2; }
.widget .card-head .drag { cursor: grab; color: var(--gray-400); display: none; }
.widgets.is-editing .widget .card-head .drag { display: inline-grid; }
.widgets.is-editing .widget { outline: 2px dashed var(--gray-300); outline-offset: 2px; border-radius: var(--radius-lg); }
.widget-hidden-list { display: flex; flex-wrap: wrap; gap: 8px; }
.agenda-item { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--gray-100); }
.agenda-item:last-child { border-bottom: 0; }
.agenda-item .time { flex: none; width: 52px; font-size: 12px; font-weight: 600; color: var(--gray-600); padding-top: 1px; }
.agenda-item .bar { flex: none; width: 3px; align-self: stretch; border-radius: 3px; }
.mini-notes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mini-note { padding: 10px 12px; border-radius: 10px; font-size: 12.5px; min-height: 70px; color: #262a40; overflow: hidden; }
.mini-note strong { display: block; font-size: 13px; margin-bottom: 2px; }

/* Lixeira */
.days-left { font-size: 12px; font-weight: 600; }
.days-left.is-soon { color: var(--danger); }

@media (max-width: 1100px) {
  .notebook.has-panel { grid-template-columns: 250px minmax(0, 1fr); }
  .nb-panel { position: fixed; right: 0; top: var(--header-h); bottom: 0; width: 300px; z-index: 45; box-shadow: var(--shadow-lg); display: none; }
  .notebook.panel-open .nb-panel { display: block; }
  .widgets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .agenda-layout { grid-template-columns: minmax(0, 1fr); }
  .agenda-side { position: static; }
  .notebook, .notebook.has-panel { grid-template-columns: minmax(0, 1fr); }
  .nb-tree { position: static; height: auto; max-height: 40vh; border-right: 0; border-bottom: 1px solid var(--color-border); }
  .editor-toolbar { padding: 6px var(--sp-3); overflow-x: auto; flex-wrap: nowrap; }
  .page-wrap { padding: var(--sp-5) var(--sp-4) var(--sp-12); }
  .widgets { grid-template-columns: minmax(0, 1fr); }
  .widget.w-wide { grid-column: auto; }
  .form-grid-3 { grid-template-columns: 1fr 1fr; }
  .routine-card { grid-template-columns: auto minmax(0, 1fr); }
  .routine-card .routine-heat { grid-column: 1 / -1; overflow-x: auto; }
}
@media (max-width: 640px) {
  .form-grid-3 { grid-template-columns: 1fr; }
  .fc .fc-toolbar { flex-direction: column; gap: 8px; }
  .notes-canvas-wrap { height: calc(100vh - 230px); }
  .mini-notes { grid-template-columns: 1fr; }
}
.card.is-focus { outline: 3px solid var(--el-orange); outline-offset: 2px; }
.note-grip { flex: none; width: 18px; display: grid; place-items: center; color: rgba(19,22,41,.35); cursor: grab; font-size: 14px; user-select: none; touch-action: none; }
.note-grip:hover { color: rgba(19,22,41,.7); }
.note-head { cursor: default; padding-left: 6px; }
.fc .fc-timegrid-axis-cushion { font-size: 11px; }
.note .dropdown-menu { top: auto; bottom: calc(100% + 4px); transform-origin: bottom right; }
.note:has(.dropdown.is-open), .note:has(.color-pop) { z-index: 100000 !important; }
.dropzone { display: block; }
