:root {
  --bg: #f0f2f5;
  --paper: #ffffff;
  --sidebar: #f8f9fa;
  --line: #e6e8eb;
  --text: #202124;
  --muted: #5f6368;
  --accent: #1a73e8;
  --accent-soft: #e8f0fe;
  --hover: #eef0f2;
  --shadow: 0 1px 2px rgba(60,64,67,.15), 0 2px 6px rgba(60,64,67,.08);
  --shadow-lg: 0 8px 28px rgba(32,33,36,.18);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  font-family: "Google Sans", "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}
.app { min-height: 100%; display: flex; flex-direction: column; }
.menubar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 18px; background: #fff; border-bottom: 1px solid var(--line);
}
.brand h1 { font-size: 16px; font-weight: 600; }
.brand .sub { color: var(--muted); font-size: 12px; }
.clock { font-size: 12px; color: var(--muted); }
.window { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.toolbar {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 16px; background: #fff; border-bottom: 1px solid var(--line);
}
.path { flex: 1; font-size: 13px; color: var(--muted); }
.path strong { color: var(--text); font-weight: 600; }
.toolbar-actions { display: flex; gap: 8px; }
.btn {
  border: 1px solid var(--line); background: #fff; color: var(--text);
  padding: 7px 12px; border-radius: 6px; font-size: 13px; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center;
}
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.danger { color: #c5221f; }
.body { flex: 1; display: grid; grid-template-columns: 260px 1fr; min-height: 0; }
.sidebar { background: var(--sidebar); border-right: 1px solid var(--line); overflow: auto; padding: 12px 10px 20px; }
.side-label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 8px 6px; font-weight: 600; }
.search { width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13px; outline: none; }
.search:focus { border-color: var(--accent); }
.folder { display: flex; align-items: center; gap: 8px; padding: 8px 9px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.folder:hover { background: #eceff1; }
.folder.active { background: var(--accent-soft); color: #174ea6; }
.folder .ico { width: 22px; text-align: center; }
.tags-mini { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 2px; }
.tag { font-size: 10px; padding: 1px 7px; border-radius: 99px; background: #e8eaed; color: #3c4043; }
.tag.filter { cursor: pointer; }
.tag.filter.on { background: var(--accent); color: #fff; }
.content { overflow: auto; padding: 22px 26px 40px; }
.section-head { margin-bottom: 16px; }
.section-head h2 { font-size: 22px; font-weight: 600; }
.section-head p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.notes-grid { display: grid; gap: 10px; max-width: 860px; }
.note-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; cursor: pointer; box-shadow: var(--shadow); }
.note-card:hover { border-color: #d0d4d9; }
.note-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.note-card .preview { color: var(--muted); font-size: 13px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.note-card footer { display: flex; justify-content: space-between; margin-top: 10px; font-size: 11px; color: var(--muted); }
.empty { color: var(--muted); text-align: center; padding: 48px 16px; }
.modal-bg { position: fixed; inset: 0; background: rgba(32,33,36,.45); display: none; align-items: center; justify-content: center; z-index: 20; }
.modal-bg.show { display: flex; }
.modal { width: min(420px, 92vw); background: #fff; border-radius: 12px; padding: 18px; box-shadow: var(--shadow-lg); }
.modal h3 { margin-bottom: 12px; }
.modal label { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 4px; }
.modal input { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.modal .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.docs-bg { position: fixed; inset: 0; background: #f9fbfd; display: none; flex-direction: column; z-index: 30; }
.docs-bg.show { display: flex; }
.docs-top { background: #fff; border-bottom: 1px solid var(--line); padding: 8px 12px 0; }
.docs-top-row { display: flex; align-items: center; gap: 10px; padding-bottom: 8px; }
.docs-title { flex: 1; border: 0; outline: none; font-size: 18px; font-weight: 500; color: #3c4043; min-width: 0; }
.docs-meta { font-size: 12px; color: var(--muted); white-space: nowrap; }
.docs-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 6px 8px 8px; border-top: 1px solid #f1f3f4; }
.docs-bar select, .docs-bar button, .docs-bar input[type="color"] {
  height: 28px; border: 0; background: transparent; border-radius: 4px; cursor: pointer; font-size: 13px; color: #3c4043;
}
.docs-bar button { min-width: 28px; padding: 0 7px; font-weight: 600; }
.docs-bar button:hover, .docs-bar select:hover { background: #f1f3f4; }
.docs-bar button.active { background: #d2e3fc; color: #174ea6; }
.docs-bar .sep { width: 1px; height: 18px; background: #dadce0; margin: 0 6px; }
.docs-bar input[type="color"] { width: 28px; padding: 2px; }
.docs-bar .hint { font-size: 12px; color: var(--muted); margin-left: 8px; }
.docs-stage { flex: 1; overflow: auto; background: #f9fbfd; padding: 18px 16px 40px; }
.page {
  width: min(816px, 100%); min-height: 1056px; margin: 0 auto; background: #fff;
  box-shadow: 0 0 0 1px #dadce0, 0 2px 6px rgba(60,64,67,.15);
  padding: 96px 96px 120px;
}
@media (max-width: 820px) { .page { padding: 36px 28px 60px; min-height: 70vh; } }
.page-editor { min-height: 800px; outline: none; font-family: Arial, Helvetica, sans-serif; font-size: 11pt; line-height: 1.5; color: #000; }
.page-editor h1 { font-size: 26pt; font-weight: 700; margin: 0 0 12px; }
.page-editor h2 { font-size: 20pt; font-weight: 700; margin: 16px 0 10px; }
.page-editor h3 { font-size: 16pt; font-weight: 700; margin: 14px 0 8px; }
.page-editor p { margin: 0 0 10px; }
.page-editor ul, .page-editor ol { margin: 0 0 10px 22px; }
.page-editor img { max-width: 100%; }
.docs-extra { display: flex; gap: 8px; align-items: center; padding: 0 12px 8px; }
.docs-extra input { border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; font-size: 12px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: #202124; color: #fff; padding: 8px 14px; border-radius: 99px; font-size: 12px; display: none; z-index: 40; }
.toast.show { display: block; }
.login-wrap { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: min(380px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 28px 24px; box-shadow: var(--shadow); }
.login-card h1 { font-size: 22px; margin-bottom: 4px; }
.login-card p { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.login-card label { display:block; font-size:12px; color: var(--muted); margin: 10px 0 4px; }
.login-card input { width:100%; border:1px solid var(--line); border-radius:8px; padding:10px 12px; }
.erro { color:#c5221f; font-size:12px; margin-top:10px; }
.login-card button { width:100%; margin-top:16px; padding:10px; justify-content:center; }

/* overlay forçado */
.docs-bg {
  position: fixed !important;
  inset: 0 !important;
  display: none;
  flex-direction: column !important;
  z-index: 9999 !important;
  background: #f9fbfd !important;
}
.docs-bg.show { display: flex !important; }
body { background: #f0f2f5 !important; color: #202124 !important; }
.app, .window, .toolbar, .menubar, .sidebar, .content, .note-card { color: #202124; }
.menubar, .toolbar, .note-card { background: #fff !important; }
.sidebar { background: #f8f9fa !important; }

.menu-btn { display: none; }
.sidebar-backdrop { display: none; }
.ctx {
  position: fixed;
  min-width: 180px;
  background: #fff;
  border: 1px solid #e6e8eb;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(32,33,36,.18);
  padding: 6px;
  z-index: 80;
  display: none;
}
.ctx.show { display: block; }
.ctx button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
}
.ctx button:hover { background: #f1f3f4; }
.ctx button.danger { color: #c5221f; }

@media (max-width: 900px) {
  .menu-btn { display: inline-flex; }
  .clock { display: none; }
  .body { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: min(86vw, 300px);
    z-index: 50;
    transform: translateX(-105%);
    transition: transform .2s ease;
    box-shadow: 8px 0 24px rgba(0,0,0,.12);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop.show {
    display: block;
    position: fixed; inset: 0;
    background: rgba(32,33,36,.35);
    z-index: 40;
  }
  .toolbar { flex-wrap: wrap; gap: 8px; }
  .toolbar-actions { width: 100%; justify-content: flex-end; flex-wrap: wrap; }
  .content { padding: 14px 14px 28px; }
  .section-head h2 { font-size: 18px; }
  .docs-top-row { flex-wrap: wrap; }
  .docs-title { width: 100%; order: 3; }
  .page { padding: 28px 18px 48px; min-height: 70vh; }
  .docs-bar { overflow-x: auto; flex-wrap: nowrap; }
  .docs-bar .hint { display: none; }
}

@media (max-width: 520px) {
  .menubar { padding: 8px 10px; }
  .btn { padding: 6px 9px; font-size: 12px; }
  .note-card { padding: 12px; }
}
