* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: #F3EEE3;
  font-family: 'Newsreader', Georgia, serif;
  color: #2E2718;
}

/* ---------- Auth (login/cadastro) ---------- */
.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #EFEAE0;
  background-image: radial-gradient(circle at 50% 0%, #F6F2E9 0%, #EFEAE0 60%);
}
.auth-wrap { width: 100%; padding: 20px; }
.auth-card {
  max-width: 360px;
  margin: 0 auto;
  background: #FFFFFF;
  border-radius: 16px;
  padding: 40px 34px 32px;
  border: 1px solid #E7E0CF;
  box-shadow: 0 20px 50px rgba(43,36,22,0.08), 0 2px 6px rgba(43,36,22,0.04);
}

.auth-icon-badge {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: #2B2416;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  box-shadow: inset 0 0 0 1px rgba(232,206,140,0.25);
}

.auth-title {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 19px;
  color: #2B2416;
  text-align: center;
  margin-bottom: 28px;
  letter-spacing: 0.01em;
}

.auth-tabs {
  display: flex;
  justify-content: center;
  gap: 28px;
  border-bottom: 1px solid #EDE6D5;
  margin-bottom: 22px;
}
.auth-tab {
  background: none;
  border: none;
  padding: 0 2px 10px;
  font-family: 'Newsreader', serif;
  font-size: 13.5px;
  font-weight: 500;
  color: #A79A78;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s;
}
.auth-tab.active { color: #2B2416; font-weight: 600; border-bottom-color: #8A6D1F; }

.auth-form { display: flex; flex-direction: column; gap: 4px; }
.auth-label { font-size: 11.5px; color: #8A7B54; margin-top: 14px; font-weight: 600; letter-spacing: 0.02em; }
.auth-input {
  border: 1px solid #E7E0CF;
  background: #FCFAF4;
  border-radius: 7px;
  padding: 11px 12px;
  font-size: 14px;
  font-family: 'Newsreader', serif;
  color: #2E2718;
  margin-top: 5px;
}
.auth-input:focus { outline: none; border-color: #8A6D1F; box-shadow: 0 0 0 3px rgba(138,109,31,0.12); }
.auth-input::placeholder { color: #C4B896; }

.auth-submit {
  margin-top: 24px;
  background: #2B2416;
  color: #EFE6CE;
  border: none;
  border-radius: 7px;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Newsreader', serif;
  letter-spacing: 0.01em;
}
.auth-submit:hover { background: #3A3220; }

.auth-error {
  background: #FBF0EE;
  color: #8A3E32;
  border: 1px solid #EAC9C0;
  border-radius: 7px;
  padding: 10px 12px;
  font-size: 12.5px;
  margin-bottom: 6px;
  text-align: center;
}

/* ---------- App shell ---------- */
.topbar-mobile {
  display: none;
  align-items: center;
  justify-content: space-between;
  background: #2B2416;
  color: #EFE6CE;
  padding: 12px 14px;
  position: sticky;
  top: 0;
  z-index: 30;
}
.menu-toggle {
  background: none;
  border: none;
  color: #EFE6CE;
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
}
.topbar-title { font-family: 'Fraunces', serif; font-weight: 600; font-size: 15px; }
.topbar-spacer { width: 34px; }

.app {
  display: flex;
  height: 100vh;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 19;
}
.sidebar-overlay.show { display: block; }

/* Sidebar */
.sidebar {
  width: 250px;
  flex-shrink: 0;
  background: #2B2416;
  color: #EFE6CE;
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 6px 18px 6px;
  border-bottom: 1px solid rgba(239,230,206,0.18);
  margin-bottom: 14px;
}

.brand-title { font-family: 'Fraunces', serif; font-weight: 600; font-size: 16.5px; letter-spacing: 0.01em; }
.brand-sub { font-size: 11px; color: #B8A87E; margin-top: 1px; }

.back-to-dashboard {
  display: block;
  font-size: 11.5px;
  color: #B8A87E;
  text-decoration: none;
  padding: 8px 6px 12px;
}
.back-to-dashboard:hover { color: #EFE6CE; }

.subject-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-right: 2px;
}
.subject-list::-webkit-scrollbar { width: 8px; }
.subject-list::-webkit-scrollbar-thumb { background: #4A4026; border-radius: 4px; }

.subject-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 8px;
  border-radius: 5px;
  cursor: pointer;
  border-left: 3px solid transparent;
}
.subject-item:hover { background: rgba(239,230,206,0.08); }
.subject-item.active { background: rgba(239,230,206,0.14); }

.subject-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.subject-meta { flex: 1; min-width: 0; }
.subject-name { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.subject-count { font-size: 10.5px; color: #9C8C63; font-family: 'IBM Plex Mono', monospace; }

.icon-btn-ghost {
  opacity: 0;
  background: none;
  border: none;
  color: #C9754A;
  cursor: pointer;
  padding: 4px;
  transition: opacity 0.15s;
}
.subject-item:hover .icon-btn-ghost { opacity: 1; }

.new-subject-row { display: flex; gap: 6px; padding: 6px 6px 2px; }
.new-subject-input {
  flex: 1;
  background: rgba(239,230,206,0.1);
  border: 1px solid rgba(239,230,206,0.3);
  border-radius: 4px;
  color: #EFE6CE;
  font-size: 12.5px;
  padding: 6px 8px;
  font-family: 'Newsreader', serif;
}
.new-subject-input:focus { outline: 2px solid #8A6D1F; outline-offset: 1px; }
.confirm-btn {
  background: #8A6D1F;
  color: #2B2416;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  padding: 0 10px;
  cursor: pointer;
}

.add-subject-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  background: none;
  border: 1px dashed rgba(239,230,206,0.35);
  color: #C9BC9F;
  border-radius: 5px;
  padding: 9px 10px;
  font-size: 12.5px;
  cursor: pointer;
  margin-top: 4px;
  font-family: 'Newsreader', serif;
}
.add-subject-btn:hover { background: rgba(239,230,206,0.06); }

.save-indicator {
  font-size: 10.5px;
  color: #8A7B54;
  font-family: 'IBM Plex Mono', monospace;
  text-align: center;
  padding-top: 10px;
}

.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(239,230,206,0.18);
  margin-top: 12px;
  padding-top: 12px;
}
.user-name { font-size: 11.5px; color: #C9BC9F; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout-btn {
  background: none;
  border: 1px solid rgba(239,230,206,0.3);
  color: #EFE6CE;
  border-radius: 4px;
  padding: 5px 9px;
  font-size: 11px;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: 8px;
}
.logout-btn:hover { background: rgba(239,230,206,0.1); }

/* Main */
.main { flex: 1; overflow-y: auto; padding: 36px 44px; min-width: 0; }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  height: 60vh;
  min-height: 220px;
  color: #8A7B54;
}
.empty-title { font-family: 'Fraunces', serif; font-size: 17px; color: #4A3F27; margin-top: 6px; }
.empty-text { font-size: 13px; max-width: 320px; line-height: 1.5; }

.entry-board { max-width: 900px; }
.board-title-row { margin-bottom: 6px; }

.view-tabs {
  display: flex;
  gap: 22px;
  border-bottom: 1px solid #DED2AF;
  margin-bottom: 18px;
}
.view-tab {
  background: none;
  border: none;
  padding: 0 2px 10px;
  font-family: 'Newsreader', serif;
  font-size: 13.5px;
  font-weight: 500;
  color: #A79A78;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.view-tab.active { font-weight: 600; }

.entry-board-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 26px;
  border-bottom: 2px solid #DED2AF;
  padding-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}
.subject-label { font-family: 'Fraunces', serif; font-weight: 700; font-size: 27px; }
.entry-board-hint { font-size: 12.5px; color: #8A7B54; }

.primary-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #F3EEE3;
  border: none;
  border-radius: 5px;
  padding: 9px 15px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Newsreader', serif;
}

.entry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}
.entry-card {
  background: #FBF8F0;
  border: 1px solid #DED2AF;
  border-radius: 6px;
  padding: 14px 15px;
  cursor: pointer;
  position: relative;
  min-height: 108px;
}
.entry-card:hover { background: #F5EFDC; }
.entry-card-title { font-family: 'Fraunces', serif; font-weight: 600; font-size: 15px; margin-bottom: 3px; }
.entry-card-date { font-size: 10.5px; color: #9C8C63; font-family: 'IBM Plex Mono', monospace; margin-bottom: 8px; }
.entry-card-preview { font-size: 12px; color: #5C5238; line-height: 1.45; }
.entry-card-img-badge { position: absolute; top: 12px; right: 12px; display: flex; align-items: center; gap: 3px; font-size: 10.5px; color: #8A7B54; }
.entry-card-public-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 10px;
  color: #3B5B45;
  background: #E1E9E2;
  padding: 2px 8px;
  border-radius: 10px;
}
.entry-card-img-badge + .entry-card-public-badge,
.entry-card-public-badge + .entry-card-img-badge { top: 34px; }

.pad { max-width: 760px; }
.pad-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.back-link { background: none; border: none; color: #8A7B54; font-size: 12.5px; cursor: pointer; font-family: 'Newsreader', serif; padding: 0; }
.delete-entry-btn { display: flex; align-items: center; gap: 5px; background: none; border: none; color: #A65B4A; font-size: 11.5px; cursor: pointer; }
.pad-title {
  width: 100%;
  background: transparent;
  border: none;
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 26px;
  padding: 2px 0;
}
.pad-title:focus { outline: 2px solid #8A6D1F; outline-offset: 1px; }
.pad-date { font-size: 11.5px; color: #9C8C63; font-family: 'IBM Plex Mono', monospace; margin-bottom: 18px; }

/* Toolbar do editor rico */
.pad-toolbar {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  background: #EFE6CE;
  border: 1px solid #DED2AF;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  padding: 6px;
}
.pad-toolbar button {
  background: #FBF8F0;
  border: 1px solid #DED2AF;
  color: #4A3F27;
  border-radius: 4px;
  font-size: 12.5px;
  padding: 6px 10px;
  cursor: pointer;
  font-family: 'Newsreader', serif;
}
.pad-toolbar button:hover { background: #F5EFDC; }
.pad-toolbar button.tb-highlight { background: #F5E08A; }

.pad-editable {
  width: 100%;
  min-height: 300px;
  background: #FBF8F0;
  border: 1px solid #DED2AF;
  border-top: none;
  border-radius: 0 0 6px 6px;
  padding: 16px 18px;
  font-family: 'Newsreader', serif;
  font-size: 15.5px;
  line-height: 1.7;
  color: #2E2718;
}
.pad-editable:focus { outline: 2px solid #8A6D1F; outline-offset: -1px; }
.pad-editable h3 { font-family: 'Fraunces', serif; font-size: 18px; margin: 14px 0 6px; }
.pad-editable mark { background: #F5E08A; padding: 0 2px; border-radius: 2px; }
.pad-editable ul { padding-left: 22px; }

.images-section { margin-top: 26px; }
.images-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: #8A7B54;
  margin-bottom: 12px;
  font-family: 'IBM Plex Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-wrap: wrap;
  gap: 8px;
}
.upload-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #EFE6CE;
  border: 1px solid #DED2AF;
  color: #4A3F27;
  border-radius: 5px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Newsreader', serif;
  text-transform: none;
  letter-spacing: 0;
}

.images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}
.img-wrap { position: relative; border-radius: 5px; overflow: hidden; border: 1px solid #DED2AF; background: #000; }
.img-thumb, .video-thumb { width: 100%; height: 100px; object-fit: cover; display: block; }
.img-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(20,16,8,0.65);
  border: none;
  color: #F3EEE3;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

button:focus-visible { outline: 2px solid #8A6D1F; outline-offset: 2px; }

/* ---------- Dashboard ---------- */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #2B2416;
  color: #EFE6CE;
  padding: 14px 28px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 15px;
}
.navbar-user { display: flex; align-items: center; gap: 12px; }
.navbar-username { font-size: 12.5px; color: #C9BC9F; }

.dashboard-wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 40px 28px 60px;
}
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 30px;
}
.dashboard-title { font-family: 'Fraunces', serif; font-weight: 700; font-size: 28px; color: #2B2416; }
.dashboard-subtitle { font-size: 13px; color: #8A7B54; margin-top: 4px; }
.dashboard-cta { text-decoration: none; display: inline-flex; }
.dashboard-section-title {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 17px;
  color: #2B2416;
  margin: 36px 0 14px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.stat-card {
  background: #FBF8F0;
  border: 1px solid #DED2AF;
  border-radius: 10px;
  padding: 20px 18px;
}
.stat-number { font-family: 'Fraunces', serif; font-weight: 700; font-size: 32px; color: #2B2416; }
.stat-label { font-size: 12px; color: #8A7B54; margin-top: 4px; }
.stat-card.stat-active .stat-number { color: #4A5C7A; }
.stat-card.stat-overdue .stat-number { color: #8A3E32; }
.stat-card.stat-done .stat-number { color: #3B5B45; }

.subject-mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}
.subject-mini-card {
  display: block;
  background: #FBF8F0;
  border: 1px solid #DED2AF;
  border-radius: 8px;
  padding: 16px 18px;
  text-decoration: none;
  color: inherit;
}
.subject-mini-card:hover { background: #F5EFDC; }
.subject-mini-name { font-family: 'Fraunces', serif; font-weight: 600; font-size: 15.5px; color: #2E2718; }
.subject-mini-meta { font-size: 11px; color: #9C8C63; font-family: 'IBM Plex Mono', monospace; margin: 4px 0 10px; }
.subject-mini-chips { display: flex; flex-wrap: wrap; gap: 6px; }

.chip {
  font-size: 10.5px;
  padding: 3px 9px;
  border-radius: 20px;
  background: #EFE6CE;
  color: #6B5E3F;
}
.chip-active { background: #E4E9F1; color: #3F4F6E; }
.chip-overdue { background: #F3DEDA; color: #8A3E32; }
.chip-done { background: #E1E9E2; color: #2F4A38; }

.public-feed-preview { font-size: 12px; color: #6B5E3F; line-height: 1.4; margin: 6px 0 8px; }
.public-feed-author { font-size: 10.5px; color: #9C8C63; font-family: 'IBM Plex Mono', monospace; }

.public-entry-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.public-entry-author, .public-entry-date { font-size: 12px; color: #8A7B54; }
.public-entry-title { font-family: 'Fraunces', serif; font-weight: 700; font-size: 26px; color: #2B2416; margin: 0 0 18px; }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20,16,8,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
}
.modal-card {
  background: #FFFFFF;
  border-radius: 16px;
  padding: 36px 32px 30px;
  max-width: 340px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}
.modal-icon-badge {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: #2B2416;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.modal-title { font-family: 'Fraunces', serif; font-weight: 600; font-size: 17px; color: #2B2416; margin-bottom: 8px; }
.modal-text { font-size: 13px; color: #8A7B54; line-height: 1.5; margin-bottom: 22px; }

/* ---------- Atividades ---------- */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.activity-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #FBF8F0;
  border: 1px solid #DED2AF;
  border-radius: 6px;
  padding: 12px 14px;
  cursor: pointer;
}
.activity-card:hover { background: #F5EFDC; }
.activity-card.done { opacity: 0.6; }

.activity-check {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid #C4B896;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #fff;
  cursor: pointer;
}
.activity-check.checked { background: #3B5B45; border-color: #3B5B45; }

.activity-body { flex: 1; min-width: 0; }
.activity-title { font-family: 'Fraunces', serif; font-weight: 600; font-size: 14.5px; color: #2E2718; }
.activity-title.strike { text-decoration: line-through; color: #8A7B54; }
.activity-desc {
  font-size: 12px;
  color: #8A7B54;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-due {
  flex-shrink: 0;
  font-size: 11px;
  font-family: 'IBM Plex Mono', monospace;
  color: #6B5E3F;
  background: #EFE6CE;
  border-radius: 4px;
  padding: 4px 8px;
}
.activity-due.overdue { background: #F3DEDA; color: #8A3E32; }

.activity-fields {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 4px 0 20px;
  flex-wrap: wrap;
}
.activity-field { display: flex; align-items: center; gap: 8px; }
.activity-field-label { font-size: 11.5px; color: #8A7B54; font-weight: 600; }
.activity-date-input {
  border: 1px solid #DED2AF;
  background: #FBF8F0;
  border-radius: 5px;
  padding: 7px 9px;
  font-size: 13px;
  font-family: 'Newsreader', serif;
  color: #2E2718;
}
.status-toggle-btn {
  background: #EFE6CE;
  border: 1px solid #DED2AF;
  color: #4A3F27;
  border-radius: 20px;
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Newsreader', serif;
}
.status-toggle-btn.done { background: #3B5B45; border-color: #3B5B45; color: #EFE6CE; }

.activity-textarea {
  width: 100%;
  min-height: 220px;
  background: #FBF8F0;
  border: 1px solid #DED2AF;
  border-radius: 6px;
  padding: 14px 16px;
  font-family: 'Newsreader', serif;
  font-size: 15px;
  line-height: 1.6;
  color: #2E2718;
  resize: vertical;
}
.activity-textarea:focus { outline: 2px solid #8A6D1F; outline-offset: -1px; }

/* ---------- Trabalhos ---------- */
.pad-header-actions { display: flex; align-items: center; gap: 16px; }
.print-link {
  font-size: 12px;
  color: #4A5C7A;
  text-decoration: none;
  font-weight: 600;
}
.print-link:hover { text-decoration: underline; }

.work-meta-row { display: flex; gap: 16px; margin-top: 6px; flex-wrap: wrap; }
.work-field { flex: 1; min-width: 200px; }
.work-text-input {
  width: 100%;
  border: 1px solid #DED2AF;
  background: #FBF8F0;
  border-radius: 6px;
  padding: 9px 11px;
  font-size: 14px;
  font-family: 'Newsreader', serif;
  color: #2E2718;
  margin-top: 5px;
}
.work-text-input:focus { outline: 2px solid #8A6D1F; outline-offset: -1px; }

.work-members-textarea {
  width: 100%;
  min-height: 70px;
  border: 1px solid #DED2AF;
  background: #FBF8F0;
  border-radius: 6px;
  padding: 9px 11px;
  font-size: 13.5px;
  font-family: 'Newsreader', serif;
  color: #2E2718;
  margin-top: 5px;
  resize: vertical;
}
.work-members-textarea:focus { outline: 2px solid #8A6D1F; outline-offset: -1px; }

.work-section-label {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 14.5px;
  color: #4A3F27;
  margin: 22px 0 8px;
}

.attachment-list { display: flex; flex-direction: column; gap: 6px; }
.attachment-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #FBF8F0;
  border: 1px solid #DED2AF;
  border-radius: 6px;
  padding: 9px 12px;
}
.attachment-kind { font-size: 12.5px; flex-shrink: 0; }
.attachment-name {
  flex: 1;
  font-size: 13px;
  color: #2E2718;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attachment-name:hover { text-decoration: underline; }
.attachment-remove {
  background: none;
  border: none;
  color: #A65B4A;
  cursor: pointer;
  font-size: 12px;
  flex-shrink: 0;
}

/* Sub-grupos */
.teams-section { margin-top: 22px; }
.teams-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.teams-progress {
  font-size: 11px;
  font-family: 'IBM Plex Mono', monospace;
  color: #8A7B54;
}

.team-quick-add {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 10px 0 14px;
}
.quick-add-btn {
  background: #EFE6CE;
  border: 1px dashed #C9BC9F;
  color: #4A3F27;
  border-radius: 20px;
  padding: 6px 13px;
  font-size: 12px;
  cursor: pointer;
  font-family: 'Newsreader', serif;
}
.quick-add-btn:hover { background: #E4D9B8; }

.team-list { display: flex; flex-direction: column; gap: 10px; }
.team-card {
  background: #FBF8F0;
  border: 1px solid #DED2AF;
  border-radius: 8px;
  padding: 12px 14px;
}
.team-card.done { border-color: #A9C0AC; background: #F4F8F4; }

.team-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.team-name-input {
  flex: 1;
  min-width: 140px;
  border: none;
  background: transparent;
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 14.5px;
  color: #2E2718;
  padding: 4px 2px;
}
.team-name-input:focus { outline: 2px solid #8A6D1F; outline-offset: 1px; border-radius: 3px; }

.team-status-btn { padding: 5px 12px; font-size: 11.5px; }
.team-remove-btn {
  background: none;
  border: none;
  color: #A65B4A;
  cursor: pointer;
  font-size: 12px;
  padding: 4px;
}

.team-members-textarea, .team-notes-textarea {
  width: 100%;
  border: 1px solid #E7E0CF;
  background: #FFFFFF;
  border-radius: 5px;
  padding: 7px 9px;
  font-size: 12.5px;
  font-family: 'Newsreader', serif;
  color: #2E2718;
  resize: vertical;
  min-height: 44px;
  margin-top: 6px;
}
.team-members-textarea:focus, .team-notes-textarea:focus { outline: 2px solid #8A6D1F; outline-offset: -1px; }

.team-add-custom { margin-top: 10px; border-color: #C9BC9F; color: #6B5E3F; }
.team-add-custom:hover { background: rgba(138,109,31,0.06); }

/* Seletor de integrantes (chips + busca) */
.member-picker-wrap { margin-top: 8px; }
.member-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 8px;
}
.no-members-text { font-size: 11.5px; color: #B8A87E; }
.member-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #EFE6CE;
  color: #4A3F27;
  border-radius: 14px;
  padding: 4px 6px 4px 11px;
  font-size: 12px;
}
.chip-remove {
  background: none;
  border: none;
  color: #8A6D1F;
  cursor: pointer;
  font-size: 10px;
  padding: 2px 4px;
}
.chip-remove:hover { color: #A65B4A; }

.member-search-box { position: relative; }
.member-search-input {
  width: 100%;
  border: 1px solid #E7E0CF;
  background: #FFFFFF;
  border-radius: 5px;
  padding: 7px 9px;
  font-size: 12.5px;
  font-family: 'Newsreader', serif;
  color: #2E2718;
}
.member-search-input:focus { outline: 2px solid #8A6D1F; outline-offset: -1px; }

.member-picker-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #FFFFFF;
  border: 1px solid #DED2AF;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  max-height: 200px;
  overflow-y: auto;
  z-index: 5;
}
.member-picker-dropdown.open { display: block; }
.member-option {
  display: flex;
  flex-direction: column;
  padding: 8px 11px;
  cursor: pointer;
  border-bottom: 1px solid #F0EBDB;
}
.member-option:last-child { border-bottom: none; }
.member-option:hover { background: #FBF6E9; }
.member-option-name { font-size: 12.5px; font-weight: 600; color: #2E2718; }
.member-option-email { font-size: 11px; color: #9C8C63; }
.member-option-empty { padding: 10px 11px; font-size: 12px; color: #B8A87E; }

/* ---------- Mobile ---------- */
@media (max-width: 820px) {
  .topbar-mobile { display: flex; }

  .app { height: calc(100vh - 47px); }

  .sidebar {
    position: fixed;
    top: 47px;
    bottom: 0;
    left: 0;
    width: 78%;
    max-width: 300px;
    z-index: 20;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 4px 0 20px rgba(0,0,0,0.25);
  }
  .sidebar.open { transform: translateX(0); }

  .main { padding: 20px 16px 60px; }

  .subject-label { font-size: 22px; }
  .pad-title { font-size: 21px; }
  .entry-board-header { align-items: flex-start; }
  .view-tabs { gap: 16px; }

  .pad-toolbar button { padding: 8px 10px; font-size: 13px; }

  .navbar { padding: 12px 16px; }
  .dashboard-wrap { padding: 24px 16px 50px; }
  .dashboard-title { font-size: 22px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-header { align-items: flex-start; }

  .pad-header-actions { flex-wrap: wrap; gap: 10px; }
}

/* ============================================================
   Tour guiado (passo a passo para novos alunos)
   ============================================================ */
.tour-mask {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: transparent;
  pointer-events: auto;
}
.tour-mask::before {
  content: '';
  position: fixed;
  top: var(--tour-top, -9999px);
  left: var(--tour-left, -9999px);
  width: var(--tour-width, 0px);
  height: var(--tour-height, 0px);
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(20, 16, 8, 0.68);
  outline: 2px solid #E8CE8C;
  outline-offset: 2px;
  transition: top 0.25s ease, left 0.25s ease, width 0.25s ease, height 0.25s ease;
  pointer-events: none;
}

.tour-tooltip {
  position: fixed;
  z-index: 201;
  width: 280px;
  max-width: calc(100vw - 24px);
  background: #FFFFFF;
  border-radius: 12px;
  padding: 18px 18px 14px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
  font-family: 'Newsreader', Georgia, serif;
  transition: top 0.25s ease, left 0.25s ease;
}
.tour-tooltip-title {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 16px;
  color: #2B2416;
  margin-bottom: 6px;
}
.tour-tooltip-text {
  font-size: 13px;
  line-height: 1.55;
  color: #5C5238;
  margin-bottom: 14px;
}
.tour-tooltip-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.tour-dots { display: flex; gap: 5px; }
.tour-dot { width: 6px; height: 6px; border-radius: 50%; background: #DED2AF; }
.tour-dot.active { background: #8A6D1F; }

.tour-tooltip-actions { display: flex; align-items: center; gap: 6px; }
.tour-btn {
  font-family: 'Newsreader', serif;
  font-size: 12px;
  border-radius: 5px;
  padding: 6px 11px;
  cursor: pointer;
  border: 1px solid transparent;
  background: none;
}
.tour-btn-skip { color: #A79A78; }
.tour-btn-skip:hover { color: #8A3E32; }
.tour-btn-back { color: #8A6D1F; border-color: #DED2AF; }
.tour-btn-back:hover { background: #F5EFDC; }
.tour-btn-next { background: #2B2416; color: #EFE6CE; font-weight: 600; }
.tour-btn-next:hover { background: #3A3220; }

.tour-restart-btn {
  background: none;
  border: 1px solid rgba(239,230,206,0.3);
  color: #EFE6CE;
  border-radius: 4px;
  padding: 5px 9px;
  font-size: 11px;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: 8px;
}
.tour-restart-btn:hover { background: rgba(239,230,206,0.1); }

@media (max-width: 640px) {
  .tour-tooltip { width: calc(100vw - 32px); }
}
