/* ============================================================ */
/*  DESIGN TOKENS — Código Zero                                  */
/* ============================================================ */
:root {
  --bg: #f5f5f0;
  --fg: #1a1915;
  --primary: #c97856;
  --primary-dark: #a85d3e;
  --secondary: #e8e4de;
  --border: #d4d0c8;
  --card: #ffffff;
  --muted: #6b6860;
  --muted-2: #8a8680;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 2px rgba(26, 25, 21, 0.04);
  --shadow-md: 0 4px 12px rgba(26, 25, 21, 0.06);
  --shadow-lg: 0 16px 40px rgba(26, 25, 21, 0.12);

  --font-body: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

/* ============================================================ */
/*  RESET                                                        */
/* ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { overflow-x: hidden; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  width: 100%;
}
button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* ============================================================ */
/*  TOPBAR                                                       */
/* ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(245, 245, 240, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 28px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--fg);
  flex-shrink: 0;
  transition: border-color 120ms, background 120ms;
}
.sidebar-toggle:hover { border-color: var(--primary); background: var(--secondary); }
.sidebar-toggle:active { background: var(--secondary); }
@media (max-width: 960px) {
  .sidebar-toggle { display: inline-flex; }
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.03em;
  font-size: 14px;
  flex-shrink: 0;
}
.brand-mark {
  width: 28px; height: 28px;
  background: var(--primary);
  color: var(--bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-weight: 800;
  font-size: 14px;
}
.brand-sub {
  color: var(--muted);
  font-weight: 500;
  font-size: 13px;
}
@media (max-width: 720px) {
  .brand-wordmark, .brand-sub { display: none; }
}

.search-wrap {
  flex: 1;
  position: relative;
  max-width: 620px;
}
.search-input {
  width: 100%;
  padding: 12px 40px 12px 40px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--fg);
  transition: border-color 120ms, box-shadow 120ms;
}
.search-input::placeholder { color: var(--muted-2); }
.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(201, 120, 86, 0.15);
}
.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.search-kbd {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--secondary);
  color: var(--muted);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.topbar-meta {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg);
  font-weight: 600;
  flex-shrink: 0;
}
.topbar-meta .muted { color: var(--muted); font-weight: 400; }

.session { position: relative; flex-shrink: 0; }
.session-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  padding: 6px 10px 6px 6px;
  border-radius: 99px;
  cursor: pointer;
  transition: border-color 120ms, background 120ms;
  font-family: inherit;
  color: var(--fg);
}
.session-btn:hover { border-color: var(--primary); background: var(--secondary); }
.session-avatar {
  width: 28px; height: 28px;
  background: var(--primary);
  color: var(--bg);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
}
.session-email {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg);
  font-weight: 500;
  letter-spacing: 0.01em;
}
@media (max-width: 640px) {
  .session-email { display: none; }
}
.session-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 8px;
  z-index: 50;
}
.session-menu-head {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.session-menu-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.session-menu-email {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg);
  word-break: break-all;
}
.session-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg);
  cursor: pointer;
  transition: background 120ms;
}
.session-menu-item:hover { background: var(--secondary); color: var(--primary); }

/* ============================================================ */
/*  LAYOUT                                                       */
/* ============================================================ */
.layout {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 28px 80px;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 40px;
  align-items: start;
}
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; gap: 24px; padding: 24px 20px 60px; }
}
@media (max-width: 560px) {
  .layout { padding: 20px 14px 60px; gap: 20px; }
}

/* ============================================================ */
/*  SIDEBAR                                                      */
/* ============================================================ */
.sidebar {
  position: sticky;
  top: 84px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: calc(100vh - 108px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  min-width: 0;
}
.sidebar { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar-backdrop { display: none; }
@media (max-width: 960px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 320px;
    max-width: 86vw;
    height: 100vh;
    max-height: 100vh;
    background: var(--bg);
    padding: 20px 20px 40px;
    z-index: 90;
    overflow-y: auto;
    box-shadow: 2px 0 20px rgba(0,0,0,0.12);
    transform: translateX(-100%);
    transition: transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
    flex-direction: column;
    gap: 6px;
  }
  body.sidebar-open .sidebar {
    transform: translateX(0);
  }
  body.sidebar-open .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(26, 25, 21, 0.45);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 85;
    animation: fadeIn 180ms ease-out;
  }
  body.sidebar-open { overflow: hidden; }
}

.terminal-line {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--primary);
  letter-spacing: 0.04em;
  padding: 0 12px 12px;
  border-bottom: 1px dashed var(--border);
  margin-bottom: 8px;
}
.areas-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.area-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  background: transparent;
  color: var(--fg);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.01em;
  transition: background 120ms, border-color 120ms, color 120ms;
}
.area-chip:hover {
  background: var(--secondary);
}
.area-chip.active {
  background: var(--primary);
  color: var(--bg);
  border-color: var(--primary);
}
.area-chip.active .area-count {
  background: rgba(245, 245, 240, 0.25);
  color: var(--bg);
}
.area-icon {
  width: 24px; height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--secondary);
  color: var(--primary);
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  transition: background 120ms, color 120ms;
}
.area-chip.active .area-icon {
  background: rgba(245, 245, 240, 0.9);
  color: var(--primary);
}
.area-name { flex: 1; }
.area-count {
  font-size: 11px;
  color: var(--muted);
  background: var(--secondary);
  padding: 2px 8px;
  border-radius: 99px;
  font-weight: 600;
  min-width: 24px;
  text-align: center;
}

.topics-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 2px 0 8px 0;
  padding-left: 14px;
  border-left: 1px dashed var(--border);
  margin-left: 12px;
}
.topics-list[hidden] { display: none !important; }
.topic-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  text-align: left;
  padding: 5px 10px;
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.01em;
  transition: background 120ms, color 120ms;
  cursor: pointer;
}
.topic-chip .topic-name { min-width: 0; overflow-wrap: anywhere; }
.topic-chip:hover {
  background: var(--secondary);
  color: var(--fg);
}
.topic-chip.active {
  background: var(--secondary);
  color: var(--primary);
  font-weight: 600;
}
.topic-name { flex: 1; }
.topic-count {
  font-size: 10px;
  color: var(--muted);
  min-width: 20px;
  text-align: right;
  font-weight: 500;
}
.topic-chip.active .topic-count { color: var(--primary); }

.folders-block {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.folders-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 4px;
}
.folders-title {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.folders-add-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  width: 22px; height: 22px;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex; align-items: center; justify-content: center;
}
.folders-add-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(201, 120, 86, 0.08);
}
.folders-new {
  display: flex;
  gap: 6px;
  padding: 4px;
}
.folders-new input {
  flex: 1;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg, #faf9f5);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
}
.folders-new input:focus {
  outline: none;
  border-color: var(--primary);
}
.folders-new button {
  padding: 7px 12px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-mono);
  text-transform: lowercase;
}
.folders-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.folder-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 13px;
  transition: all 0.12s;
  width: 100%;
}
.folder-chip:hover {
  background: rgba(201, 120, 86, 0.06);
  border-color: var(--border);
}
.folder-chip.active {
  background: rgba(201, 120, 86, 0.12);
  border-color: var(--primary);
  color: var(--primary);
}
.folder-chip-icon {
  color: var(--muted);
  flex-shrink: 0;
}
.folder-chip.active .folder-chip-icon { color: var(--primary); }
.folder-chip-name { flex: 1; font-weight: 500; }
.folder-chip-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}
.folder-chip.active .folder-chip-count { color: var(--primary); }
.folders-empty {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}
.folders-empty a { color: var(--primary); text-decoration: underline; }

/* Custom skill card variant */
.card.is-custom {
  position: relative;
  border-left: 3px solid var(--primary);
}
.card .custom-badge {
  position: absolute;
  top: 10px; right: 12px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
  background: rgba(201, 120, 86, 0.12);
  padding: 3px 7px;
  border-radius: 999px;
}

@media (max-width: 960px) {
  .folders-block { display: none; }
}

.sidebar-foot {
  margin-top: 20px;
  padding: 0 12px;
  border-top: 1px dashed var(--border);
  padding-top: 16px;
}
.sidebar-link {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.03em;
}
.sidebar-link:hover { color: var(--primary); }
@media (max-width: 960px) { .sidebar-foot { display: none; } }

/* ============================================================ */
/*  SIDEBAR CTA — Criador de Skills                              */
/* ============================================================ */
.sidebar-cta {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 22px;
  padding: 22px 22px 20px;
  background:
    radial-gradient(circle at 100% 0%, rgba(201,120,86,0.28), transparent 55%),
    linear-gradient(165deg, #1a1915 0%, #2a241e 100%);
  color: #f5f5f0;
  border: 1px solid #3a2e25;
  border-radius: 16px;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.25s ease, border-color 0.2s ease;
  box-shadow: 0 12px 28px -14px rgba(26,25,21,0.5);
}
.sidebar-cta:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: 0 18px 34px -14px rgba(26,25,21,0.6);
}

.sidebar-cta-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.14em;
  padding: 4px 10px;
  background: rgba(201,120,86,0.18);
  border: 1px solid rgba(201,120,86,0.4);
  border-radius: 999px;
  margin-bottom: 14px;
}

.sidebar-cta-title {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: #f5f5f0;
  margin: 0 0 10px;
}

.sidebar-cta-sub {
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.5;
  color: #d4d0c8;
  margin: 0 0 16px;
}

.sidebar-cta-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  padding-top: 14px;
  border-top: 1px dashed rgba(245,245,240,0.15);
  width: 100%;
  transition: gap 0.18s ease;
}
.sidebar-cta:hover .sidebar-cta-arrow { gap: 10px; }
.sidebar-cta:hover .sidebar-cta-arrow svg { transform: translateX(2px); }
.sidebar-cta-arrow svg { transition: transform 0.18s ease; }


/* ============================================================ */
/*  CONTENT                                                      */
/* ============================================================ */
.content { min-width: 0; }
.content-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.content-head h1 {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 32px;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0;
}
.content-meta {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg);
  font-weight: 600;
  flex-shrink: 0;
}
.content-meta .muted { color: var(--muted); font-weight: 400; }

/* ============================================================ */
/*  GRID + CARD                                                  */
/* ============================================================ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  transition: border-color 150ms, box-shadow 150ms, transform 150ms;
  text-align: left;
  font: inherit;
  color: inherit;
  position: relative;
  contain: layout style paint;
}

.card-fav {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  transition: color 140ms, background 140ms, border-color 140ms, transform 140ms;
  z-index: 2;
}
.card-fav:hover {
  color: var(--primary);
  background: var(--secondary);
  border-color: var(--border);
  transform: scale(1.05);
}
.card-fav.is-active {
  color: var(--primary);
  background: rgba(201, 120, 86, 0.12);
  border-color: rgba(201, 120, 86, 0.35);
}
.card-fav.is-active:hover {
  background: rgba(201, 120, 86, 0.18);
}
.card:hover {
  will-change: transform;
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.card:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(201, 120, 86, 0.2);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.card-area {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  font-weight: 600;
}
.card-area .dot {
  width: 6px; height: 6px;
  background: var(--primary);
  border-radius: 50%;
}
.card-arrow {
  color: var(--muted);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 150ms, transform 150ms;
}
.card:hover .card-arrow {
  opacity: 1;
  transform: translateX(0);
  color: var(--primary);
}
.card-title {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 17px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--fg);
}
.card-desc {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.meta-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 600;
  line-height: 1.4;
}
.meta-level.meta-iniciante {
  background: rgba(52, 168, 83, 0.12);
  color: #2c7c3f;
}
.meta-level.meta-intermediario {
  background: rgba(201, 120, 86, 0.14);
  color: var(--primary-dark);
}
.meta-level.meta-avancado {
  background: rgba(26, 25, 21, 0.08);
  color: var(--fg);
}
.meta-type {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}
.tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  background: var(--secondary);
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

/* ============================================================ */
/*  EMPTY STATE                                                  */
/* ============================================================ */
.empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--muted);
}
.empty-icon {
  font-family: var(--font-mono);
  font-size: 48px;
  color: var(--primary);
  opacity: 0.3;
  margin-bottom: 16px;
}
.empty h3 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 20px;
  color: var(--fg);
  margin: 0 0 8px;
}
.empty p { margin: 0 0 20px; }
.btn-ghost {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  transition: background 120ms, color 120ms;
}
.btn-ghost:hover {
  background: var(--primary);
  color: var(--bg);
}

/* ============================================================ */
/*  MODAL                                                        */
/* ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 180ms ease-out;
}
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 25, 21, 0.5);
  backdrop-filter: blur(4px);
}
.modal-card {
  position: relative;
  background: var(--card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 760px;
  max-height: calc(100vh - 48px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: slideUp 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px; height: 36px;
  background: var(--secondary);
  border: 0;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  color: var(--fg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 120ms;
  z-index: 2;
}
.modal-close:hover { background: var(--border); }

.modal-head {
  padding: 32px 32px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-area {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--secondary);
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 12px;
}
.modal-head h2 {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
  padding-right: 40px;
}
.modal-desc {
  color: var(--muted);
  margin: 0 0 14px;
  font-size: 15px;
}
.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  background: var(--bg);
}
.modal-toolbar {
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--secondary);
  position: sticky;
  top: 0;
  z-index: 1;
}
.modal-toolbar-label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-weight: 600;
}
.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: var(--bg);
  border: 0;
  padding: 6px 14px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  transition: background 120ms;
}
.btn-copy:hover { background: var(--primary-dark); }
.btn-copy.copied { background: #3b7a4a; }

.modal-toolbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.folder-picker {
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.folder-picker-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 600;
}
.folder-picker-close {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.folder-picker-close:hover { color: var(--fg); }
.folder-picker-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 240px;
  overflow-y: auto;
}
.folder-picker-empty {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
  padding: 8px 0;
}
.folder-picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--secondary);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  transition: background 120ms, border-color 120ms;
}
.folder-picker-item:hover { background: var(--bg); border-color: var(--border); }
.folder-picker-item.selected {
  background: var(--primary);
  color: var(--bg);
  border-color: var(--primary);
}
.folder-picker-item-name { flex: 1; }
.folder-picker-item-count {
  background: rgba(0,0,0,0.08);
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 600;
}
.folder-picker-item.selected .folder-picker-item-count {
  background: rgba(245, 245, 240, 0.25);
}
.folder-picker-new {
  display: flex;
  gap: 6px;
}
.folder-picker-new input {
  flex: 1;
  background: var(--secondary);
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12px;
}
.folder-picker-new button {
  background: var(--primary);
  color: var(--bg);
  border: 0;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  cursor: pointer;
}
.folder-picker-new button:hover { background: var(--primary-dark); }

.area-group { display: block; }
.area-caret {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-left: 2px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  transition: transform 200ms ease, color 120ms, background 120ms;
  flex-shrink: 0;
  cursor: pointer;
}
.area-caret:hover { color: var(--fg); background: rgba(0,0,0,0.08); }
.area-chip.active .area-caret { color: inherit; }
.area-chip.active .area-caret:hover { background: rgba(245,245,240,0.2); }
.area-caret.open { transform: rotate(180deg); }
.area-chip.active .area-caret { color: inherit; }
.area-chip.active .area-caret:hover { background: rgba(245, 245, 240, 0.2); }

.modal-content {
  margin: 0;
  padding: 24px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--fg);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ============================================================ */
/*  RESPONSIVE — MOBILE / TABLET                                 */
/* ============================================================ */
@media (max-width: 960px) {
  .topbar-inner { padding: 12px 16px; gap: 12px; }
  .search-wrap { max-width: none; }
  .content-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .content-head h1 { font-size: 26px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
  .modal { padding: 0; }
  .modal-card {
    max-height: 100vh;
    height: 100vh;
    max-width: 100vw;
    width: 100vw;
    border-radius: 0;
  }
  .modal-head { padding: 24px 20px 16px; }
  .modal-head h2 { font-size: 22px; padding-right: 44px; }
  .modal-toolbar { padding: 12px 20px; flex-wrap: wrap; gap: 10px; }
  .modal-toolbar-actions { width: 100%; justify-content: flex-start; }
  .modal-content { padding: 20px; font-size: 12.5px; }
  .folder-picker { padding: 12px 20px; }
}

@media (max-width: 720px) {
  .topbar-inner { gap: 10px; }
  .brand { gap: 8px; }
  .search-input { padding: 11px 14px 11px 38px; font-size: 13.5px; }
  .search-kbd { display: none; }
  .topbar-meta { display: none; }
  .content-head h1 { font-size: 22px; }
  .grid { grid-template-columns: 1fr; gap: 12px; }
  .card { padding: 16px; gap: 10px; }
  .card-title { font-size: 16px; }
  .card-desc { font-size: 13.5px; }
  .modal-head { padding: 20px 18px 14px; }
  .modal-head h2 { font-size: 20px; }
  .modal-desc { font-size: 13.5px; }
  .modal-close { top: 12px; right: 12px; width: 32px; height: 32px; font-size: 20px; }
  .modal-content { padding: 18px 16px; font-size: 12px; line-height: 1.65; }
  .btn-copy { padding: 6px 10px; font-size: 10.5px; }
  .btn-copy span { display: inline; }
}

@media (max-width: 420px) {
  .topbar-inner { padding: 10px 12px; }
  .session-btn { padding: 4px 6px 4px 4px; }
  .session-avatar { width: 26px; height: 26px; }
  .layout { padding: 18px 12px 60px; }
  .sidebar { width: 88vw; padding: 16px 16px 32px; }
}

/* Filtros button — aparece só mobile, dentro do content-head */
.filters-mobile-btn {
  display: none;
  align-items: center;
  gap: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 99px;
  cursor: pointer;
  transition: border-color 120ms, background 120ms;
}
.filters-mobile-btn:hover { border-color: var(--primary); background: var(--secondary); }

/* ============================================================ */
/*  NAV RAIL — SessionNavBar portado (Código Zero)               */
/* ============================================================ */
:root {
  --rail-w: 60px;
  --rail-w-open: 260px;
  --rail-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

body.has-rail { padding-left: var(--rail-w); }
@media (max-width: 960px) {
  body.has-rail { padding-left: 0; }
}

.nav-rail {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--rail-w);
  background: var(--bg);
  border-right: 1px solid var(--border);
  z-index: 40;
  transition: width 240ms var(--rail-ease);
  overflow: hidden;
  display: flex;
}
.nav-rail:hover,
.nav-rail.is-open,
.nav-rail.is-pinned {
  width: var(--rail-w-open);
  box-shadow: 16px 0 48px rgba(26, 25, 21, 0.08);
}
.nav-rail-inner {
  width: var(--rail-w-open);
  min-width: var(--rail-w-open);
  display: flex;
  flex-direction: column;
  padding: 14px 10px 14px;
  gap: 4px;
  height: 100%;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-group--top { margin-bottom: 6px; }
.nav-group--bottom { margin-top: 0; }

.nav-sep {
  height: 1px;
  background: var(--border);
  margin: 10px 8px;
  border-radius: 1px;
}
.nav-spacer { flex: 1 1 auto; }

/* Org pill */
.nav-org {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 40px;
  padding: 0 8px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  color: var(--fg);
  transition: background 140ms ease, border-color 140ms ease;
  position: relative;
}
.nav-org:hover {
  background: var(--secondary);
  border-color: var(--border);
}
.nav-org-mark {
  width: 26px;
  height: 26px;
  background: var(--primary);
  color: var(--bg);
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 0;
}

/* Nav items */
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border-radius: 10px;
  background: transparent;
  border: 0;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 140ms ease, color 140ms ease;
  position: relative;
}
.nav-item:hover {
  background: var(--secondary);
  color: var(--fg);
}
.nav-item--active {
  background: var(--primary);
  color: var(--bg);
}
.nav-item--active:hover {
  background: var(--primary);
  color: var(--bg);
}
.nav-item--active .nav-ico { color: var(--bg); }

.nav-ico {
  flex-shrink: 0;
  color: currentColor;
}

/* Label wrapper — fade on collapse */
.nav-label {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
  flex: 1 1 auto;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 180ms ease 60ms, transform 200ms var(--rail-ease) 60ms;
  white-space: nowrap;
  overflow: hidden;
}
.nav-rail:hover .nav-label,
.nav-rail.is-open .nav-label,
.nav-rail.is-pinned .nav-label {
  opacity: 1;
  transform: translateX(0);
}
.nav-label-main {
  font-weight: 500;
  text-overflow: ellipsis;
  overflow: hidden;
}
.nav-label-sub {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted-2);
  letter-spacing: 0.04em;
  margin-top: 2px;
}
.nav-item--active .nav-label-sub { color: rgba(245, 245, 240, 0.7); }

.nav-chev {
  flex-shrink: 0;
  color: var(--muted-2);
  opacity: 0;
  transition: opacity 180ms ease 60ms;
}
.nav-rail:hover .nav-chev,
.nav-rail.is-open .nav-chev,
.nav-rail.is-pinned .nav-chev { opacity: 1; }

.nav-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--primary);
  color: var(--bg);
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 180ms ease 60ms;
}
.nav-item--active .nav-badge {
  background: var(--bg);
  color: var(--primary);
}
.nav-rail:hover .nav-badge,
.nav-rail.is-open .nav-badge,
.nav-rail.is-pinned .nav-badge { opacity: 1; }

/* Account button */
.nav-account {
  padding-left: 6px;
}
.nav-account-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}

/* Popovers (org / account) — fixed pra escapar do overflow:hidden do rail */
.nav-pop {
  position: fixed;
  left: calc(var(--rail-w-open) + 10px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  min-width: 260px;
  z-index: 60;
}
.nav-pop[hidden] { display: none; }
.nav-group--top .nav-pop { top: 16px; }
.nav-pop--account { bottom: 16px; }
@media (max-width: 960px) {
  .nav-pop {
    position: relative;
    left: auto;
    top: auto;
    bottom: auto;
    width: 100%;
    min-width: 0;
    box-shadow: none;
    border: 1px solid var(--border);
    margin-top: 4px;
  }
  .nav-pop--account {
    bottom: auto;
  }
}
.nav-pop-head {
  padding: 10px 10px 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-pop-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted-2);
}
.nav-pop-email {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg);
  word-break: break-all;
}
.nav-pop-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  background: transparent;
  border: 0;
  color: var(--fg);
  font-family: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background 120ms ease;
}
.nav-pop-item:hover { background: var(--secondary); }
.nav-pop-item--active { background: var(--secondary); }
.nav-pop-item--locked {
  opacity: 0.7;
  position: relative;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 6px,
    rgba(0,0,0,0.02) 6px,
    rgba(0,0,0,0.02) 12px
  );
  border: 1px dashed var(--border);
  padding: 10px 12px;
}
.nav-pop-item--locked .nav-pop-mark {
  background: #999;
}
.nav-pop-item--locked .nav-pop-sub {
  color: var(--primary);
  font-weight: 700;
  font-size: 11px;
  background: rgba(201, 120, 86, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
  margin-top: 4px;
}
.nav-pop-item--locked:hover {
  opacity: 1;
  background: rgba(201, 120, 86, 0.06);
  border-color: var(--primary);
}
.nav-pop-lock {
  margin-left: auto;
  opacity: 0.7;
  flex-shrink: 0;
  color: var(--primary);
}
.nav-pop-mark {
  width: 26px; height: 26px;
  background: var(--primary);
  color: var(--bg);
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 0;
}
.nav-pop-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  flex: 1 1 auto;
  min-width: 0;
}
.nav-pop-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted-2);
  letter-spacing: 0.04em;
  margin-top: 2px;
}

/* Mobile: rail becomes off-canvas */
.nav-rail-mobile-toggle {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 45;
  width: 40px;
  height: 40px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--fg);
  align-items: center;
  justify-content: center;
}
.nav-rail-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26, 25, 21, 0.35);
  z-index: 35;
  backdrop-filter: blur(3px);
}
@media (max-width: 960px) {
  .nav-rail {
    transform: translateX(-100%);
    transition: transform 240ms var(--rail-ease), width 0s;
    width: var(--rail-w-open);
    box-shadow: 24px 0 60px rgba(26, 25, 21, 0.18);
  }
  .nav-rail.is-open {
    transform: translateX(0);
  }
  .nav-rail:hover { width: var(--rail-w-open); }
  .nav-rail-inner {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  body.rail-open .nav-rail-backdrop { display: block; }
  body.rail-open { overflow: hidden; }
  .nav-rail-mobile-toggle { display: inline-flex; }
  .topbar-inner { padding-left: 64px; }
  .topbar .sidebar-toggle { display: none; }
  .filters-mobile-btn { display: inline-flex; }
  .content-head { position: relative; }
  .nav-label,
  .nav-chev,
  .nav-badge { opacity: 1 !important; transform: none !important; }
}

/* ============================================================ */
/*  SUBPAGES — single column layout                              */
/* ============================================================ */
.layout--single {
  grid-template-columns: 1fr;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 20px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border);
}
.page-head-main h1 {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 34px;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0 0 8px;
}
.page-head-main p {
  font-size: 15px;
  color: var(--muted);
  margin: 0;
  max-width: 640px;
}
.page-head-meta {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg);
  font-weight: 600;
  white-space: nowrap;
}
.page-head-meta .muted { color: var(--muted); font-weight: 400; }
@media (max-width: 640px) {
  .page-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .page-head-main h1 { font-size: 26px; }
}

.empty-state {
  text-align: center;
  padding: 80px 24px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
}
.empty-state .empty-icon {
  font-family: var(--font-mono);
  font-size: 44px;
  color: var(--muted);
  margin-bottom: 12px;
}
.empty-state h3 {
  font-size: 18px;
  margin: 0 0 6px;
  color: var(--fg);
}
.empty-state p {
  color: var(--muted);
  margin: 0 0 18px;
  font-size: 14px;
}
.empty-state .btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  text-decoration: none;
  transition: background 140ms, transform 140ms;
}
.empty-state .btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }

/* ---- Pastas page ---- */
.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.folder-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 150ms, box-shadow 150ms, transform 150ms;
  text-align: left;
  font: inherit;
  color: inherit;
}
.folder-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.folder-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.folder-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--secondary);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.folder-card-title {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 16px;
  margin: 0;
  color: var(--fg);
  line-height: 1.2;
  word-break: break-word;
}
.folder-card-meta {
  display: flex;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: auto;
}
.folder-card-meta strong {
  color: var(--fg);
  font-weight: 700;
  margin-right: 4px;
}
.folder-card-delete {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 140ms, color 140ms, background 140ms, border-color 140ms;
}
.folder-card:hover .folder-card-delete { opacity: 1; }
.folder-card-delete:hover {
  color: #b04a4a;
  background: rgba(176, 74, 74, 0.08);
  border-color: rgba(176, 74, 74, 0.2);
}

.folder-create {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  padding: 14px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
}
.folder-create input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  background: var(--bg);
  color: var(--fg);
  outline: none;
  transition: border-color 140ms, box-shadow 140ms;
}
.folder-create input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(201, 120, 86, 0.15);
}
.folder-create button {
  padding: 10px 18px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 140ms;
}
.folder-create button:hover { background: var(--primary-dark); }

/* ---- Histórico page ---- */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.history-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 140ms, transform 140ms, box-shadow 140ms;
  text-align: left;
  font: inherit;
  color: inherit;
  width: 100%;
}
.history-row:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.history-row-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--secondary);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.history-row-body h4 {
  margin: 0 0 2px;
  font-size: 15px;
  font-weight: 700;
  color: var(--fg);
  line-height: 1.2;
}
.history-row-body p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.history-row-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: right;
  white-space: nowrap;
}
@media (max-width: 560px) {
  .history-row { grid-template-columns: auto 1fr; }
  .history-row-date { grid-column: 1 / -1; text-align: left; padding-left: 52px; }
}

/* ---- Configurações page ---- */
.settings {
  display: grid;
  grid-template-columns: minmax(0, 680px);
  gap: 24px;
}
.settings-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
}
.settings-card h2 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 18px;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
.settings-card .settings-sub {
  color: var(--muted);
  font-size: 13.5px;
  margin: 0 0 20px;
}
.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.form-row label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.form-row input,
.form-row textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  background: var(--bg);
  color: var(--fg);
  outline: none;
  transition: border-color 140ms, box-shadow 140ms;
  box-sizing: border-box;
}
.form-row textarea {
  resize: vertical;
  min-height: 90px;
  font-family: inherit;
  line-height: 1.5;
}
.form-row input:focus,
.form-row textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(201, 120, 86, 0.15);
}
.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}
.btn-save {
  padding: 10px 20px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 140ms;
}
.btn-save:hover { background: var(--primary-dark); }
.btn-save:disabled { opacity: 0.5; cursor: not-allowed; }
.form-status {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.form-status.ok { color: #2c7c3f; }
.form-status.err { color: #b04a4a; }

.avatar-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.avatar-preview {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--secondary);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 26px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.avatar-row-info { font-size: 13px; color: var(--muted); line-height: 1.5; }
.avatar-row-info strong { display: block; color: var(--fg); font-size: 14px; margin-bottom: 2px; }
.avatar-upload {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--secondary);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  margin-top: 8px;
  transition: border-color 140ms, color 140ms;
}
.avatar-upload:hover { border-color: var(--primary); color: var(--primary); }
