/* ===========================
   Invantia — Core Theme
   =========================== */

:root {
  --bg: #0b0b0d;
  --bg-elev: #141418;
  --text: #e7e7ee;
  --muted: #a4a4b0;
  --accent: #7c6cff;      /* logo violet */
  --accent-2: #8f7cff;
  --border: #2a2a33;
  --danger: #ff5d5d;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, "Helvetica Neue", Arial, "Apple Color Emoji","Segoe UI Emoji";
}

/* ===========================
   Topbar
   =========================== */
.topbar {
  height: 56px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #0d0d12, #0a0a0c 60%);
  position: sticky; top: 0; z-index: 50;
}

.hamburger { background:none; border:0; padding:.5rem; border-radius:.5rem; cursor:pointer; color: var(--text); }
.hamburger:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hamburger svg rect { fill: currentColor; }

.brand { display:flex; align-items:center; gap:10px; text-decoration:none; color:inherit; }
.logo { width:28px; height:28px; border-radius:6px; }
.brand-name { font-weight: 700; letter-spacing: .2px; }

/* Optional top-right actions (kept from your file) */
.top-actions { display: flex; align-items: center; gap: 8px; position: relative; }
.icon-btn {
  background: var(--bg-elev); border: 1px solid var(--border);
  color: var(--text); padding: 6px 10px; border-radius: 10px; cursor: pointer;
}
.icon-btn:hover { border-color: var(--accent); }
.user-pill { font-size: 13px; color: var(--muted); margin-right: 6px; }
.menu-dropdown {
  position: absolute; right: 0; top: 44px; min-width: 160px;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 12px;
  display: flex; flex-direction: column; overflow: hidden;
}
.menu-dropdown a {
  color: var(--text); text-decoration: none; padding: 10px 12px; border-bottom: 1px solid var(--border);
}
.menu-dropdown a:last-child { border-bottom: none; }
.menu-dropdown a:hover { background: #1a1a20; }

.hidden { display: none; }
.mobile-only { display: none; }


.topbar { display:flex; gap:12px; align-items:center; }
.auth-indicator { font-size: 1rem; line-height: 1; cursor: default; }

.flash { margin: 12px 0; padding: 10px 12px; border-radius: 6px; }
.flash-info { background:#e9f5ff; border:1px solid #b6e0fe; color:#084c7f; }
.flash-success { background:#e8f8f0; border:1px solid #b9efd0; color:#0f5132; }
.flash-error { background:#fdecea; border:1px solid #f5c2c7; color:#842029; }

/* ===========================
   Sidebar (off-canvas by default; opens with .open)
   =========================== */
.sidebar {
  position: fixed; left: 0; top: 56px; bottom: 0;
  width: 260px; padding: 12px;
  background: var(--bg); border-right: 1px solid var(--border);
  overflow: auto;
  transform: translateX(-100%);
  transition: transform .2s ease;
  z-index: 60;
}
.sidebar.open { transform: translateX(0); }

.sidebar .nav { display: flex; flex-direction: column; gap: 6px; }
.sidebar .nav a {
  display:block; padding:10px 12px; border-radius:10px;
  color: var(--text); text-decoration:none; border:1px solid transparent;
}
.sidebar .nav a:hover { background: var(--bg-elev); border-color: var(--border); }

.sidebar-footer { position: absolute; bottom: 12px; left: 12px; color: var(--muted); font-size: 12px; }

/* ===========================
   Content Area
   =========================== */
.content { padding: 18px 22px; margin-left: 0; }

.panel { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 16px; padding: 18px; }
.panel.narrow { max-width: 520px; margin: 2rem auto; }

.h1 { font-size: 22px; margin: 4px 0 12px; }
.h2 { font-size: 18px; margin: 0 0 10px; }
.muted { color: var(--muted); }
.sm { font-size: 12px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 12px; }
.card { background: #121218; border: 1px solid var(--border); border-radius: 14px; padding: 14px; }

/* ===========================
   Forms & Buttons
   =========================== */
.form { display: grid; gap: 10px; }
.form label { display: grid; gap: 6px; font-size: 14px; }
.form input[type="text"],
.form input[type="email"],
.form input[type="password"] {
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: #0f0f14; color: var(--text);
}
.form input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn {
  background: var(--accent); color: #0a0a0c; font-weight: 700;
  border: 0; border-radius: 12px; padding: 10px 14px; cursor: pointer;
}
.btn:hover { filter: brightness(1.05); }
.btn.ghost {
  background: transparent; color: var(--text); border: 1px solid var(--border);
}
.btn.ghost:hover { border-color: var(--accent); }

/* ===========================
   Flash Messages
   =========================== */
.flash { padding: .75rem 1rem; border-radius: .5rem; margin: .75rem 0; }
.flash.success { background: #d9f9e6; border: 1px solid #9ae6b4; color:#004d26; font-weight:500; }
.flash.error   { background:#8b0000; border:1px solid #ff4d4d; color:#fff; font-weight:bold; }

/* ===========================
   Chat Shell
   =========================== */
.chat-shell { display: grid; gap: 10px; }
.chat-window {
  height: 280px; overflow: auto; background: #0f0f14; border: 1px solid var(--border);
  border-radius: 12px; padding: 10px;
}
.msg { padding: 8px 10px; border-radius: 10px; margin: 6px 0; display: inline-block; }
.msg.bot  { background: #151523; border: 1px solid var(--border); }
.msg.user { background: var(--accent); color: #0a0a0c; font-weight: 700; }

.chat-input { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.chat-input input {
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: #0f0f14; color: var(--text);
}

/* ===========================
   Documents List
   =========================== */
.doc-list { list-style: none; padding: 0; margin: 0; }
.doc-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.doc-title { font-weight: 600; }

/* ===========================
   Responsive
   =========================== */

/* ≥1024px: keep sidebar open and reserve space; hide hamburger */
@media (min-width: 1024px) {
  .sidebar { transform: none; }
  .content { margin-left: 260px; }
  .hamburger { display: none; }
}

/* ≤980px tweaks from your original */
@media (max-width: 980px) {
  .sidebar .nav a { text-align: left; padding: 10px 10px; }
}

/* ≤720px: stack content, smaller padding */
@media (max-width: 720px) {
  .mobile-only { display: inline-block; }
  .content { padding: 14px; }
  .grid-2 { grid-template-columns: 1fr; }
}
