*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-start: #301f3e;
  --bg-end: #c18297;
  --surface: rgba(255, 255, 255, 0.07);
  --surface2: rgba(255, 255, 255, 0.11);
  --surface3: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.12);
  --border2: rgba(255, 255, 255, 0.2);
  --tiffany: #69c5d7;
  --tiffany2: #89d8e8;
  --tiffany-bg: rgba(105, 197, 215, 0.12);
  --tiffany-bd: rgba(105, 197, 215, 0.3);
  --white: #ffffff;
  --text: rgba(255, 255, 255, 0.95);
  --text2: rgba(255, 255, 255, 0.7);
  --text3: rgba(255, 255, 255, 0.45);
  --text4: rgba(255, 255, 255, 0.28);
  --danger: #e87a7a;
  --r: 12px;
  --r-lg: 18px;
  --r-pill: 50px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.35);
}

body {
  font-family: "DM Sans", sans-serif;
  background: linear-gradient(
    135deg,
    var(--bg-start) 0%,
    #6b3a5a 50%,
    var(--bg-end) 100%
  );
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 15px;
  font-variant-emoji: text; /* emoji monochrome — herda cor do texto */
}

/* ── NOISE OVERLAY ── */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

/* ── TOP BAR ── */
.topbar-wrap {
  position: sticky;
  top: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px 0;
  gap: 14px;
}
.topbar {
  display: flex;
  align-items: center;
  background: rgba(30, 15, 45, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border2);
  border-radius: 30px;
  padding: 0 24px;
  width: 1050px;
  max-width: 1050px;
  height: 60px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
  box-sizing: border-box;
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-left: 0;
  margin-right: 20px;
}
.brand-logo-img {
  height: 23px;
  object-fit: contain;
  margin-left: 20px;
}
.brand-icon {
  width: 28px;
  height: 28px;
  position: relative;
  flex-shrink: 0;
}
.brand-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  animation: spin 10s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Nav tabs */
.tabs-nav {
  display: flex;
  gap: 2px;
  flex: 1;
  justify-content: center;
}
.tab-btn {
  padding: 9px 16px;
  font-size: 12.5px;
  font-weight: 500;
  font-family: inherit;
  border: none;
  border-radius: 40px;
  cursor: pointer;
  transition: all 0.2s;
  background: transparent;
  color: var(--text3);
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.tab-btn:hover {
  color: var(--text2);
  background: var(--surface);
}
.tab-btn.active {
  background: var(--tiffany);
  color: #1a0a2e;
  font-weight: 600;
}

/* Topbar side */
.topbar-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.topbar-btns {
  display: flex;
  flex-direction: row;
  gap: 8px;
  align-items: center;
}
.topbar-user {
  display: flex;
  flex-direction: row;
  gap: 4px;
  align-items: center;
  justify-content: center;
}
.topbar-username {
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text2);
  white-space: nowrap;
}
.topbar-role {
  font-size: 11px;
  font-weight: 500;
  color: var(--tiffany);
  white-space: nowrap;
}
.topbar-icon-btn {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 15px;
  color: var(--text3);
}
.topbar-icon-btn:hover {
  background: var(--surface2);
  color: var(--text2);
}
.topbar-icon-logout {
  border-color: rgba(232, 122, 122, 0.2);
  color: rgba(232, 122, 122, 0.5);
}
.topbar-icon-logout:hover {
  background: rgba(232, 122, 122, 0.1);
  color: #e87a7a;
  border-color: rgba(232, 122, 122, 0.35);
}

/* ── MAIN ── */
.main {
  flex: 1;
  position: relative;
  z-index: 1;
}
.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
}

/* ── PAGE LAYOUT ── */
.page-wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 44px 24px 80px;
}
.page-title {
  font-family: "Cormorant Garamond", serif;
  font-size: 36px;
  font-weight: 400;
  color: var(--white);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.page-sub {
  font-size: 13px;
  color: var(--text3);
  margin-bottom: 36px;
}

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar {
  width: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

/* ── TOAST ── */
#toastContainer {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  z-index: 9999; display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 10px 20px; border-radius: var(--r-pill);
  font-size: 13px; font-weight: 600;
  backdrop-filter: blur(12px);
  animation: toastIn .2s ease, toastOut .3s ease 1.7s forwards;
  white-space: nowrap;
}
.toast-ok      { background: rgba(52,211,153,.18); border: 1px solid rgba(52,211,153,.35); color: #34d399; }
.toast-info    { background: rgba(105,197,215,.18); border: 1px solid rgba(105,197,215,.35); color: var(--tiffany); }
.toast-error   { background: rgba(232,122,122,.18); border: 1px solid rgba(232,122,122,.35); color: var(--danger); }
@keyframes toastIn  { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:none; } }
@keyframes toastOut { from { opacity:1; } to { opacity:0; } }

/* ── CONFIRM DIALOG ── */
.confirm-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(0,0,0,.55); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn .15s ease;
}
.confirm-box {
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: var(--r-lg); padding: 28px 28px 24px;
  max-width: 360px; width: 90%; box-shadow: 0 20px 60px rgba(0,0,0,.4);
  animation: scaleIn .15s ease;
}
.confirm-msg {
  font-size: 14px; color: var(--text1); line-height: 1.6;
  margin: 0 0 22px; text-align: center;
}
.confirm-actions {
  display: flex; gap: 10px; justify-content: flex-end;
}
.btn-danger {
  background: var(--danger); color: #fff; border: none;
  padding: 9px 20px; border-radius: var(--r-pill);
  font-size: 13px; font-weight: 700; cursor: pointer; transition: opacity .15s;
}
.btn-danger:hover { opacity: .85; }
@keyframes scaleIn { from { opacity:0; transform: scale(.94); } to { opacity:1; transform: scale(1); } }
@keyframes fadeIn  { from { opacity:0; } to { opacity:1; } }

/* ── FOOTER ── */
.app-footer {
  text-align: center;
  padding: 20px 16px;
  font-family: "DM Sans", sans-serif;
  font-size: 11px;
  color: var(--text4);
  letter-spacing: 0.04em;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}
