/* ReRent CRM — brand tokens (indigo/violet identity). */
:root {
  --brand: #818cf8;
  --brand-soft: #a5b4fc;
  --brand-tint: #eef2ff;
  --brand-tint2: #e0e7ff;
  --accent: #6366f1;
  --accent-dark: #4f46e5;
  --deep: #4338ca;

  --bg: #eef3f8;
  --card: #ffffff;
  --card2: #f1f6fb;
  --card3: #e8f0f7;
  --side: #ffffff;
  --border: #e4eaf1;
  --border-s: #cfdbe7;

  --text: #10212d;
  --muted: #5d7388;
  --dim: #93a5b6;

  --green: #15a34a;   --green-bg: #e7f7ed;
  --red: #e23047;     --red-bg: #fdeaed;
  --amber: #c2710a;   --amber-bg: #fdf2dd;
  --info: #0b6fa4;    --info-bg: #eaf6fe;
  --violet: #7c5cff;  --violet-bg: #efeaff;
  --teal: #0d9488;    --teal-bg: #e3f6f3;
  --pink: #db2777;    --pink-bg: #fce7f1;

  --font: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --shadow: 0 1px 2px rgba(15,40,60,.04), 0 1px 3px rgba(15,40,60,.06);
  --shadow-lg: 0 12px 34px rgba(15,40,60,.12), 0 2px 8px rgba(15,40,60,.06);

  --sidebar-w-open: 244px;
  --sidebar-w-closed: 66px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-dark); text-decoration: none; }

@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--border-s); border-radius: 5px; }
::-webkit-scrollbar-track { background: transparent; }

/* table-layout: fixed makes every table strictly honor its container's
   width (100%) instead of growing as wide as its widest row's content —
   long text wraps inside cells instead of pushing the table sideways, so
   pages never need a right/horizontal scrollbar. */
table { border-collapse: collapse; width: 100%; table-layout: fixed; }
th { text-align: left; font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; padding: 11px 14px; border-bottom: 1px solid var(--border); font-weight: 700; overflow-wrap: break-word; }
td { padding: 12px 14px; font-size: 13.5px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; overflow-wrap: break-word; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--card2); }

input::placeholder, textarea::placeholder { color: var(--dim); }
input, select, textarea, button { font-family: inherit; }
input:focus, select:focus, textarea:focus { border-color: var(--accent) !important; box-shadow: 0 0 0 3px rgba(56,189,248,.2); outline: none; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); }

.input {
  background: var(--card); border: 1px solid var(--border-s); border-radius: 9px;
  padding: 10px 12px; color: var(--text); font-size: 14px; width: 100%;
}

/* An empty <input type="date" value=""> would otherwise show the browser's
   own placeholder segments as literal gray "dd-mm-yyyy" text — reads as a
   broken/unset value rather than a clean blank field. Hides that text only
   while empty and unfocused; a real value, or the field while focused,
   renders normally. Chromium/Edge-specific pseudo-elements — acceptable
   here since this app targets Chromium-based browsers. */
input[type="date"][value=""]:not(:focus) { color: transparent; }
input[type="date"][value=""]:not(:focus)::-webkit-datetime-edit { color: transparent; }

.btn {
  padding: 9px 16px; border-radius: 9px; font-size: 13.5px; font-weight: 600;
  cursor: pointer; border: 1px solid transparent; display: inline-flex;
  align-items: center; justify-content: center; gap: 7px; white-space: nowrap;
  transition: filter .15s;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(14,165,233,.3); }
.btn-ghost { background: var(--card); color: var(--text); border: 1px solid var(--border-s); }
.btn-soft { background: var(--brand-tint); color: var(--accent-dark); }
.btn-danger { background: var(--red); color: #fff; }
.btn-success { background: var(--green); color: #fff; }
.btn-dark { background: var(--text); color: #fff; }
.btn:hover { filter: brightness(0.96); }

.pill { background: var(--card2); color: var(--muted); border-radius: 20px; padding: 3px 10px; font-size: 11.5px; font-weight: 700; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.tag-pill { background: var(--violet-bg); color: var(--violet); margin-right: 4px; }

.star-toggle { background: none; border: none; cursor: pointer; color: var(--border-s); font-size: 15px; padding: 4px; display: flex; align-items: center; justify-content: center; transition: color .12s, transform .12s; }
.star-toggle:hover { color: var(--amber); transform: scale(1.15); }
.star-toggle.active { color: var(--amber); }

/* ===== App shell ===== */
.app-shell { display: flex; height: 100vh; min-height: 600px; overflow: hidden; }

.sidebar {
  width: var(--sidebar-w-open);
  background: var(--side);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; flex-shrink: 0;
  transition: width .2s; overflow: hidden;
}
.sidebar.collapsed { width: var(--sidebar-w-closed); }

.sidebar-head { height: 88px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.sidebar.collapsed .sidebar-head { justify-content: center; padding: 0; }
.sidebar-brand { display: flex; flex-direction: column; gap: 5px; }
.sidebar-logo { height: 52px; display: block; }
.sidebar-tagline { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.sidebar-badge-d {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff; display: none; align-items: center; justify-content: center; font-weight: 800;
}
.sidebar.collapsed .sidebar-brand { display: none; }
.sidebar.collapsed .sidebar-badge-d { display: flex; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px; }
.nav-section { margin-bottom: 10px; }
.nav-section-head { font-size: 10.5px; font-weight: 700; color: var(--dim); text-transform: uppercase; letter-spacing: .08em; padding: 8px 10px 4px; }
.sidebar.collapsed .nav-section-head { display: none; }

.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px;
  border-radius: 9px; background: transparent; border: none; color: var(--muted);
  cursor: pointer; font-weight: 500; font-size: 13.5px; width: 100%;
  position: relative; margin-bottom: 1px; text-align: left;
  transition: background .12s, color .12s;
}
.sidebar.collapsed .nav-item { justify-content: center; padding: 9px 0; }
.nav-item:hover { background: var(--card2); }
.nav-item.active { background: var(--brand-tint); color: var(--accent-dark); font-weight: 700; }
.nav-item.active::before { content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; width: 3px; border-radius: 3px; background: var(--accent); }
.sidebar.collapsed .nav-item.active::before { display: none; }
.nav-item-icon {
  font-size: 13px; width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; transition: transform .12s;
}
.nav-item:hover .nav-item-icon { transform: scale(1.06); }
.nav-item-label { flex: 1; text-align: left; }
.sidebar.collapsed .nav-item-label { display: none; }
.nav-badge { background: var(--red); color: #fff; border-radius: 10px; padding: 1px 7px; font-size: 11px; font-weight: 700; }
.sidebar.collapsed .nav-badge { display: none; }
.nav-badge-dot { display: none; position: absolute; top: 6px; right: 12px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
.sidebar.collapsed .nav-badge-dot.has-badge { display: block; }

.sidebar-foot { padding: 10px; border-top: 1px solid var(--border); }
.sidebar-me { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--card2); border-radius: 10px; }
.sidebar.collapsed .sidebar-me { justify-content: center; padding: 8px 0; }
.sidebar-me-info { flex: 1; overflow: hidden; }
.sidebar.collapsed .sidebar-me-info { display: none; }
.sidebar-collapse-btn { width: 100%; margin-top: 8px; padding: 7px; background: var(--card2); border: none; border-radius: 8px; color: var(--muted); cursor: pointer; font-size: 12px; }
.sidebar-collapse-icon { display: inline-block; transition: transform 0.15s ease; }
.sidebar-collapse-btn.collapsed .sidebar-collapse-icon { transform: rotate(180deg); }

.avatar { border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.topbar { height: 88px; flex-shrink: 0; background: var(--card); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 22px; gap: 16px; }
.topbar-title-wrap { display: flex; align-items: center; gap: 12px; }
.hamburger-btn { display: none; width: 38px; height: 38px; border-radius: 10px; background: var(--card2); border: 1px solid var(--border); cursor: pointer; font-size: 17px; flex-shrink: 0; }
.topbar-eyebrow { font-size: 10.5px; color: var(--dim); font-weight: 700; letter-spacing: .05em; }
.topbar-title { font-size: 16px; font-weight: 800; line-height: 1.1; }
.topbar-right { display: flex; align-items: center; gap: 12px; flex: 1; justify-content: flex-end; }
.topbar-search { position: relative; max-width: 320px; flex: 1; display: flex; align-items: center; }
.topbar-search-icon { position: absolute; left: 12px; font-size: 14px; color: var(--dim); }
.topbar-search input { padding-left: 34px; background: var(--card2); border-radius: 10px; }
.lang-toggle { display: inline-flex; background: var(--card2); border: 1px solid var(--border); border-radius: 9px; padding: 3px; gap: 2px; flex-shrink: 0; }
.lang-toggle button { padding: 5px 11px; border-radius: 7px; border: none; background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer; }
.lang-toggle button.active { background: var(--accent); color: #fff; }
.bell-btn { width: 38px; height: 38px; border-radius: 10px; background: var(--card2); border: 1px solid var(--border); cursor: pointer; font-size: 15px; position: relative; flex-shrink: 0; }
.bell-dot { position: absolute; top: -3px; right: -3px; width: 9px; height: 9px; border-radius: 50%; background: var(--red); border: 2px solid var(--card); }

/* ===== Notification bell panel (Phase 6) ===== */
.notif-wrap { position: relative; flex-shrink: 0; }
.notif-panel { display: none; position: absolute; top: 46px; right: 0; width: 340px; max-width: 90vw; background: var(--card); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); z-index: 1001; overflow: hidden; }
.notif-panel.open { display: block; }
.notif-panel-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 700; }
.notif-panel-head form { margin: 0; }
.notif-panel-head button { background: none; border: none; color: var(--accent-dark); font-size: 11.5px; font-weight: 700; cursor: pointer; }
.notif-list { max-height: 360px; overflow-y: auto; }
.notif-row { display: flex; align-items: center; gap: 8px; padding: 11px 14px; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.notif-row:last-child { border-bottom: none; }
.notif-row.unread { background: var(--brand-tint); }
.notif-row a { flex: 1; color: var(--text); }
.notif-dismiss { background: none; border: none; color: var(--dim); cursor: pointer; font-size: 12px; width: 22px; height: 22px; border-radius: 6px; flex-shrink: 0; }
.notif-dismiss:hover { background: var(--card2); color: var(--muted); }
.notif-empty { padding: 20px 14px; text-align: center; font-size: 12.5px; color: var(--dim); }

/* ===== AI Assistant chat panel — slide-in from the right, same overlay
   mechanism as the notification bell panel above, sized as a real chat
   interface rather than a small dropdown. ===== */
.chat-panel { display: none; flex-direction: column; position: fixed; top: 0; right: 0; bottom: 0; width: 380px; max-width: 92vw; background: var(--card); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg); z-index: 1050; }
.chat-panel.open { display: flex; }
.chat-panel-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 14px; font-weight: 700; flex-shrink: 0; }
.chat-panel-head button { background: none; border: none; cursor: pointer; color: var(--muted); width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 7px; font-size: 14px; }
.chat-panel-head button:hover { background: var(--card2); color: var(--text); }
.chat-messages { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.chat-empty { color: var(--muted); font-size: 12.5px; text-align: center; padding: 30px 10px; }
.chat-message { max-width: 85%; padding: 10px 13px; border-radius: 12px; font-size: 13px; line-height: 1.45; white-space: pre-wrap; }
.chat-message.user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 3px; }
.chat-message.assistant { align-self: flex-start; background: var(--card2); color: var(--text); border-bottom-left-radius: 3px; }
.chat-message p { margin: 0 0 8px; }
.chat-message p:last-child { margin-bottom: 0; }
.chat-message ul { margin: 4px 0 8px; padding-left: 18px; }
.chat-message ul:last-child { margin-bottom: 0; }
.chat-message li { margin-bottom: 2px; }
.chat-message strong { font-weight: 700; }
.chat-message-meta { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--dim); margin-top: 4px; }
.chat-tool-row { align-self: flex-start; font-size: 11px; color: var(--dim); display: flex; align-items: center; gap: 5px; padding: 2px 6px; }
.chat-typing { align-self: flex-start; background: var(--card2); border-radius: 12px; padding: 12px 14px; }
.chat-typing span { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--dim); margin-right: 3px; animation: chat-typing-bounce 1s infinite; }
.chat-typing span:nth-child(2) { animation-delay: .15s; }
.chat-typing span:nth-child(3) { animation-delay: .3s; margin-right: 0; }
@keyframes chat-typing-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-4px); opacity: 1; } }
.chat-input-row { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--border); flex-shrink: 0; }
.chat-input-row .input { flex: 1; }
.chat-sessions-list { flex: 1; overflow-y: auto; padding: 8px; }
.chat-session-row { padding: 10px 12px; border-radius: 9px; cursor: pointer; font-size: 12.5px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.chat-session-row:hover { background: var(--card2); }
.chat-session-row .chat-session-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.chat-session-empty { padding: 24px 14px; text-align: center; font-size: 12.5px; color: var(--dim); }
.chat-session-row.active { background: var(--brand-tint); }
@media (max-width: 900px) {
  .chat-panel { width: 100vw; max-width: 100vw; }
}

.chat-attach-btn { background: none; border: none; cursor: pointer; color: var(--muted); width: 38px; height: 38px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border-radius: 9px; font-size: 15px; }
.chat-attach-btn:hover { background: var(--card2); color: var(--text); }
.chat-attach-preview { display: flex; padding: 0 14px 10px; }
.chat-attach-chip { display: flex; align-items: center; gap: 6px; background: var(--card2); border: 1px solid var(--border); border-radius: 9px; padding: 4px 8px 4px 4px; font-size: 12px; }
.chat-attach-chip img { width: 26px; height: 26px; border-radius: 6px; object-fit: cover; }
.chat-attach-chip button { background: none; border: none; cursor: pointer; color: var(--dim); display: flex; padding: 0; }
.chat-attach-chip button:hover { color: var(--red); }
.chat-message-image { display: block; max-width: 100%; border-radius: 9px; margin-bottom: 6px; }
.chat-message-file { display: flex; align-items: center; gap: 6px; font-size: 12.5px; margin-bottom: 4px; }
.chat-message-file a { color: inherit; text-decoration: underline; }

/* ===== Full-page "AI Assistant" nav item — same components as the
   floating panel above, laid out as a real two-pane chat page instead of
   a small slide-in, plus a ChatGPT-style welcome/empty state (below). ===== */
/* height (not a hard cap) with min-height:0 on every flex child that needs
   to shrink+scroll internally — the earlier version used a hard `height`
   without min-height:0 on its children, which is the classic flexbox
   overflow bug: children ignore their intended shrink/scroll behavior and
   grow past the container instead, which is what caused the bottom input
   bar to visually collide with the welcome content above it. */
.chat-page { display: flex; max-height: calc(100vh - 170px); min-height: 620px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.chat-page-sidebar { width: 280px; flex-shrink: 0; min-height: 0; border-right: 1px solid var(--border); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.chat-sidebar-head { display: flex; align-items: center; justify-content: space-between; font-size: 13.5px; font-weight: 700; padding: 2px 2px 4px; flex-shrink: 0; }
.chat-sidebar-head span { display: flex; align-items: center; gap: 7px; }
.chat-sidebar-head button { background: none; border: none; cursor: pointer; color: var(--muted); width: 26px; height: 26px; border-radius: 7px; display: flex; align-items: center; justify-content: center; }
.chat-sidebar-head button:hover { background: var(--card2); color: var(--text); }
.chat-page-sidebar .chat-sessions-list { padding: 0; flex: 1; min-height: 0; overflow-y: auto; }
.chat-session-group-label { font-size: 10.5px; font-weight: 700; color: var(--dim); text-transform: uppercase; letter-spacing: .04em; padding: 10px 8px 4px; }
.chat-session-group-label:first-child { padding-top: 2px; }
.chat-session-view-all { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--accent-dark); cursor: pointer; padding: 10px 8px 2px; }
.chat-page-thread { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
@media (max-width: 900px) {
  .chat-page { flex-direction: column; max-height: none; }
  .chat-page-sidebar { width: auto; border-right: none; border-bottom: 1px solid var(--border); max-height: 260px; }
}

/* ===== AI Assistant welcome/empty state (assistant.html only — the
   floating panel's #chat-empty stays the plain one-line text it always
   was; this richer markup only exists inside that page's own template).
   Left-aligned, wide, with the illustration as a top-right decorative
   accent — matches the reference design rather than a narrow centered
   column. No justify-content:center trick (that's the other half of the
   overflow bug above — centering a possibly-overflowing flex container
   clips its start instead of scrolling to it); generous top padding gives
   the same "centered" feel without fighting scroll behavior. ===== */
.assistant-welcome { position: relative; max-width: 900px; margin: 0 auto; padding: 36px 32px 28px; }
.assistant-illustration { position: absolute; top: 20px; right: 24px; opacity: .95; }
.assistant-welcome h2 { font-size: 26px; font-weight: 800; color: var(--text); margin-bottom: 6px; max-width: 70%; }
.assistant-subtitle { font-size: 14.5px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.assistant-tagline { font-size: 13px; color: var(--dim); margin-bottom: 26px; max-width: 70%; }
.assistant-hero-input-row { display: flex; align-items: center; gap: 10px; width: 100%; background: var(--card); border: 1px solid var(--border-s); border-radius: 999px; padding: 8px 8px 8px 18px; box-shadow: var(--shadow-lg); margin-bottom: 28px; }
.assistant-hero-input-row .input { flex: 1; border: none; background: none; padding: 10px 0; box-shadow: none; font-size: 14px; }
.assistant-hero-input-row .input:focus { outline: none; }
.assistant-hero-input-row .chat-attach-btn { flex-shrink: 0; }
.assistant-hero-input-row .btn { border-radius: 999px; flex-shrink: 0; width: 42px; height: 42px; padding: 0; display: flex; align-items: center; justify-content: center; }
.assistant-suggestions { width: 100%; margin-bottom: 24px; }
.assistant-suggestions-label { font-size: 11.5px; font-weight: 700; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 12px; }
.assistant-chip-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.assistant-chip { display: flex; align-items: center; gap: 9px; text-align: left; background: var(--card2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; font-size: 12.5px; font-weight: 600; color: var(--text); cursor: pointer; }
.assistant-chip:hover { background: var(--brand-tint); border-color: var(--brand-soft); }
.assistant-chip i { color: var(--accent-dark); flex-shrink: 0; font-size: 14px; }
.assistant-context-strip { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; padding: 14px 16px; background: var(--card2); border-radius: 12px; margin-bottom: 20px; }
.assistant-context-label { font-size: 11px; font-weight: 700; color: var(--dim); text-transform: uppercase; letter-spacing: .04em; margin-right: 4px; }
.assistant-context-pill { background: var(--card3); color: var(--muted); font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.assistant-started-card { display: flex; align-items: flex-start; gap: 14px; background: var(--brand-tint); border-radius: 14px; padding: 18px 20px; margin-bottom: 16px; }
.assistant-started-card .assistant-started-icon { width: 40px; height: 40px; border-radius: 50%; background: var(--violet); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.assistant-started-card h3 { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.assistant-started-card p { font-size: 12.5px; color: var(--muted); }
.assistant-footer { text-align: center; font-size: 11px; color: var(--dim); }
@media (max-width: 900px) {
  .assistant-chip-grid { grid-template-columns: repeat(2, 1fr); }
  .assistant-illustration { display: none; }
  .assistant-welcome h2, .assistant-tagline { max-width: 100%; }
}
@media (max-width: 560px) {
  .assistant-chip-grid { grid-template-columns: 1fr; }
}

/* ===== Direct messages (Messages nav item) — same two-pane shell as the
   AI Assistant's full page, plus presence dots, reply/delete affordances,
   an emoji grid, and a company/contact "send contact" picker. ===== */
.dm-page { display: flex; max-height: calc(100vh - 170px); min-height: 620px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.dm-sidebar { width: 280px; flex-shrink: 0; min-height: 0; border-right: 1px solid var(--border); overflow-y: auto; }
.dm-contact-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; }
.dm-contact-row:hover, .dm-contact-row.active { background: var(--card2); }
.dm-contact-avatar-wrap { position: relative; flex-shrink: 0; }
.dm-contact-avatar { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #fff; object-fit: cover; }
.dm-presence-dot { position: absolute; bottom: -1px; right: -1px; width: 11px; height: 11px; border-radius: 50%; background: var(--dim); border: 2px solid var(--card); }
.dm-presence-dot.online { background: var(--green); }
.dm-contact-info { flex: 1; min-width: 0; }
.dm-contact-name { font-size: 13px; font-weight: 700; }
.dm-contact-preview { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-unread-badge { background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; border-radius: 20px; min-width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; padding: 0 5px; flex-shrink: 0; }
.dm-thread { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.dm-thread-empty { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--dim); font-size: 13px; }
.dm-thread-active { flex: 1; display: none; flex-direction: column; min-width: 0; min-height: 0; }
.dm-thread-head { padding: 12px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.dm-messages { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.dm-message-wrap { display: flex; flex-direction: column; margin-bottom: 8px; }
.dm-message-wrap.mine { align-items: flex-end; }
.dm-message-wrap.theirs { align-items: flex-start; }
.dm-message-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .1s; }
.dm-message-wrap:hover .dm-message-actions { opacity: 1; }
.dm-message-actions button { background: none; border: none; cursor: pointer; color: var(--dim); width: 24px; height: 24px; border-radius: 6px; font-size: 11px; }
.dm-message-actions button:hover { background: var(--card2); color: var(--text); }
.dm-reply-ref { font-size: 11.5px; opacity: .8; border-left: 2px solid currentColor; padding-left: 6px; margin-bottom: 5px; }
.dm-reply-preview { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 14px; background: var(--card2); border-top: 1px solid var(--border); font-size: 12px; }
.dm-reply-preview button { background: none; border: none; cursor: pointer; color: var(--dim); }
.dm-shared-card { display: flex; align-items: center; gap: 10px; background: var(--card3); border-radius: 9px; padding: 8px 10px; margin-bottom: 4px; font-size: 12.5px; }
.dm-shared-card i { font-size: 18px; color: var(--accent-dark); }
.dm-emoji-picker { display: none; grid-template-columns: repeat(9, 1fr); gap: 2px; padding: 10px 14px; border-top: 1px solid var(--border); max-height: 140px; overflow-y: auto; }
.dm-emoji-picker button { background: none; border: none; cursor: pointer; font-size: 18px; padding: 4px; border-radius: 6px; }
.dm-emoji-picker button:hover { background: var(--card2); }
.chat-attach-btn.recording { color: var(--red); animation: chat-typing-bounce 1s infinite; }

.dm-contact-picker { display: flex; position: fixed; inset: 0; background: rgba(15,15,20,.5); z-index: 2000; align-items: center; justify-content: center; }
.dm-contact-picker-box { width: min(420px, 92vw); max-height: 70vh; background: var(--card); border-radius: 14px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; }
.dm-contact-picker-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 14px 0; }
.dm-contact-picker-head button { background: none; border: none; cursor: pointer; color: var(--muted); width: 30px; height: 30px; }
.dm-contact-picker-results { flex: 1; overflow-y: auto; padding: 0 8px 8px; }

@media (max-width: 900px) {
  .dm-page { flex-direction: column; max-height: none; }
  .dm-sidebar { width: auto; border-right: none; border-bottom: 1px solid var(--border); max-height: 220px; }
}

.content-area { flex: 1; overflow: auto; background: var(--bg); }
.content-inner { padding: 24px; max-width: 1480px; margin: 0 auto; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; font-weight: 800; }
.page-head p { font-size: 13.5px; color: var(--muted); margin-top: 3px; }

.toasts { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--card); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 11px 16px; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; border-left: 3px solid var(--green); animation: slideIn .2s ease; }
.toast.error { border-left-color: var(--red); }

.phase-note { background: var(--brand-tint); border: 1px dashed var(--accent); color: var(--accent-dark); border-radius: 12px; padding: 14px 18px; font-size: 13px; font-weight: 600; margin-bottom: 18px; }

/* ===== Auth pages ===== */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 20px; }
.auth-card { width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 32px; }
.auth-logo { height: 52px; display: block; margin: 0 auto 8px; }
.auth-tagline { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); text-align: center; margin-bottom: 22px; }
.auth-card h1 { font-size: 19px; font-weight: 800; text-align: center; margin-bottom: 22px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 12.5px; color: var(--muted); font-weight: 600; }

/* Type-to-filter company picker (Add Task modal) — a plain <select> with
   one <option> per company is unusable once there are thousands of them. */
.company-search-results { display: none; position: absolute; top: 100%; left: 0; right: 0; margin-top: 4px; max-height: 220px; overflow-y: auto; background: var(--card); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); z-index: 20; }
.company-search-results.open { display: block; }
.company-search-row { padding: 9px 12px; font-size: 13px; cursor: pointer; }
.company-search-row:hover { background: var(--card3); }

/* ===== Onboarding tour (see static/js/tour.js + tour-config.js) ===== */
.tour-overlay { position: fixed; inset: 0; background: rgba(15,15,20,.6); z-index: 9997; }
.tour-spotlight { position: fixed; z-index: 9998; background: transparent; box-shadow: 0 0 0 9999px rgba(15,15,20,.6); border-radius: 12px; cursor: pointer; transition: top .15s ease, left .15s ease, width .15s ease, height .15s ease; }
.tour-popover { position: fixed; z-index: 9999; width: min(320px, 90vw); background: var(--card); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 18px; }
.tour-popover-center { top: 50%; left: 50%; transform: translate(-50%, -50%); }
.tour-popover-title { font-size: 15px; font-weight: 800; margin-bottom: 8px; }
.tour-popover-body { font-size: 13px; color: var(--muted); line-height: 1.5; margin-bottom: 12px; }
.tour-popover-progress { font-size: 11px; color: var(--dim); font-weight: 700; margin-bottom: 14px; }
.tour-popover-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tour-skip-link { background: none; border: none; color: var(--muted); font-size: 12.5px; font-weight: 600; cursor: pointer; padding: 0; }
.tour-skip-link:hover { color: var(--text); text-decoration: underline; }

.password-field-wrap { position: relative; display: flex; align-items: center; }
.password-field-wrap input { padding-right: 40px; }
.password-toggle { position: absolute; right: 4px; background: none; border: none; cursor: pointer; color: var(--dim); width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 7px; }
.password-toggle:hover { background: var(--card2); color: var(--muted); }
.form-errors { background: var(--red-bg); color: var(--red); border-radius: 9px; padding: 10px 12px; font-size: 12.5px; font-weight: 600; margin-bottom: 14px; }

/* ===== Modal (Add company / Import / Add deal / Deal detail) ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,40,60,.4); backdrop-filter: blur(2px); z-index: 1000; display: none; align-items: center; justify-content: center; padding: 16px; }
.modal-overlay.open { display: flex; }
.modal-box { background: var(--card); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 24px; width: 100%; max-width: 480px; max-height: 88vh; overflow-y: auto; }
.modal-box.wide { max-width: 720px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.modal-head h3 { font-size: 17px; font-weight: 800; color: var(--text); }
.modal-close { background: var(--card2); border: none; color: var(--muted); cursor: pointer; font-size: 16px; width: 30px; height: 30px; border-radius: 8px; }
.modal-form { display: flex; flex-direction: column; gap: 13px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 4px; }
.dropzone { border: 2px dashed var(--border-s); background: var(--card2); border-radius: 12px; padding: 18px; text-align: center; cursor: pointer; color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.dropzone.drag { border-color: var(--accent); background: var(--brand-tint); }

/* ===== Drawer (Company detail slide-over) ===== */
.drawer-overlay { position: fixed; inset: 0; background: rgba(15,40,60,.4); z-index: 1000; display: none; justify-content: flex-end; }
.drawer-overlay.open { display: flex; }
.drawer-panel { width: 440px; max-width: 100%; background: var(--card); height: 100%; overflow-y: auto; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; }
.drawer-head { padding: 20px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 14px; }
.drawer-body { padding: 22px; display: flex; flex-direction: column; gap: 20px; }
.company-icon { border-radius: 9px; display: flex; align-items: center; justify-content: center; font-weight: 800; flex-shrink: 0; }
.list-row { display: flex; align-items: center; gap: 10px; padding: 9px 11px; background: var(--card2); border-radius: 9px; }

/* ===== Companies page ===== */
.coverage-strip { padding: 14px 18px; margin-bottom: 16px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.coverage-bar-track { height: 10px; background: var(--card2); border-radius: 5px; overflow: hidden; }
.coverage-bar-fill { height: 100%; background: linear-gradient(90deg, var(--brand), var(--accent)); }
.filters-row { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.filters-row select, .filters-row input[type="search"], .filters-row input[type="text"] { width: auto; padding: 8px 11px; font-size: 13px; }
.filters-row .results-count { margin-left: auto; font-size: 12.5px; color: var(--muted); font-weight: 600; }
tr.clickable-row { cursor: pointer; }

/* ===== Pipeline / kanban ===== */
.kanban-board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; }
.kanban-col { width: 268px; flex-shrink: 0; background: var(--card2); border-radius: 14px; border: 1px solid var(--border); display: flex; flex-direction: column; max-height: calc(100vh - 230px); transition: background .12s, border-color .12s; }
.kanban-col.drag-over { background: var(--brand-tint); border-color: var(--accent); }
.kanban-col-highlight { border-color: var(--accent); box-shadow: 0 0 0 3px var(--brand-tint); }
.kanban-col-head { padding: 12px 14px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: inherit; }
.kanban-col-body { padding: 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.deal-card { background: var(--card); border: 1px solid var(--border); border-radius: 11px; padding: 12px; cursor: grab; box-shadow: var(--shadow); transition: box-shadow .15s, transform .15s; }

.health-pill { font-size: 10.5px; padding: 2px 8px; flex-shrink: 0; }
.health-pill.health-hot { background: var(--green-bg); color: var(--green); }
.health-pill.health-warm { background: var(--amber-bg); color: var(--amber); }
.health-pill.health-cold { background: var(--red-bg); color: var(--red); }

.ai-badge { background: var(--violet-bg); color: var(--violet); font-size: 10.5px; padding: 2px 9px; }
.ai-badge-fallback { background: var(--card2); color: var(--dim); }
.deal-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.deal-card.dragging { opacity: .5; box-shadow: var(--shadow-lg); }
.deal-card-progress { margin-top: 8px; height: 5px; background: var(--card2); border-radius: 3px; overflow: hidden; }

/* ===== KPI cards (Calling, Email, Meetings, Dashboard) ===== */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi-card { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.kpi-card.clickable { text-decoration: none; color: inherit; transition: box-shadow .15s, border-color .15s; }
.kpi-card.clickable:hover { box-shadow: var(--shadow-lg); border-color: var(--border-s); }
.kpi-icon { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.kpi-value { font-size: 25px; font-weight: 800; letter-spacing: -0.5px; }
.kpi-label { font-size: 12px; color: var(--muted); font-weight: 600; }

/* ===== Tabs (Email: Campaigns / AI Composer) ===== */
.tab-row { display: flex; gap: 6px; margin-bottom: 18px; }
.tab-btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px; border-radius: 9px; border: 1px solid var(--border-s); background: var(--card); color: var(--muted); font-weight: 600; font-size: 13.5px; cursor: pointer; transition: border-color .12s, background .12s, transform .12s; }
.tab-btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.tab-btn.active { border-color: var(--accent); background: var(--brand-tint); color: var(--accent-dark); font-weight: 700; }
.tab-btn .pill { background: rgba(0,0,0,.06); color: inherit; }
.tab-btn.active .pill { background: rgba(255,255,255,.6); }

/* ===== Cold Calling ===== */
.call-phone-display { border-radius: 12px; padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; background: var(--card2); }
.call-phone-display.active { background: var(--green-bg); }
.call-phone-number { font-size: 22px; font-weight: 800; font-family: ui-monospace, monospace; }
.call-phone-number.active { color: var(--green); }
.disposition-btn { flex: 1 1 auto; padding: 10px 12px; border-radius: 9px; border: 1px solid var(--border-s); background: var(--card); cursor: pointer; font-weight: 700; font-size: 12.5px; display: flex; align-items: center; gap: 6px; justify-content: center; }
.call-log-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--card2); border-radius: 9px; }

.call-info-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.call-info-strip > div { background: var(--card2); border-radius: 9px; padding: 9px 11px; font-size: 11px; color: var(--dim); display: flex; flex-direction: column; gap: 2px; }
.call-info-label { font-weight: 600; }
.call-info-value { font-size: 13px; font-weight: 700; color: var(--text); }

.call-timeline { display: flex; flex-direction: column; }
.call-timeline-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.call-timeline-row:last-child { border-bottom: none; }
.call-timeline-icon { width: 30px; height: 30px; border-radius: 50%; background: var(--card2); display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; }

.insight-card { padding: 16px; display: flex; align-items: flex-start; gap: 12px; }
.insight-icon { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }

/* ===== AI Composer ===== */
.composer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.composer-mode-btn { padding: 7px 11px; border-radius: 8px; border: 1px solid var(--border-s); background: var(--card); color: var(--muted); font-size: 12.5px; font-weight: 700; cursor: pointer; }
.composer-mode-btn.active { border-color: var(--violet); background: var(--violet-bg); color: var(--violet); }
.composer-result { flex: 1; background: var(--card2); border-radius: 11px; padding: 16px; font-size: 13.5px; line-height: 1.65; white-space: pre-wrap; color: var(--dim); min-height: 300px; }
.composer-result.has-text { color: var(--text); }
.spinner { width: 13px; height: 13px; border: 2px solid #fff; border-top-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }

/* ===== Sequences ===== */
.sequence-toggle { width: 44px; height: 24px; border-radius: 13px; border: none; background: var(--border-s); position: relative; cursor: pointer; }
.sequence-toggle.active { background: var(--accent); }
.sequence-toggle-knob { position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--shadow); transition: left .2s; }
.sequence-toggle.active .sequence-toggle-knob { left: 22px; }
.sequence-steps { display: flex; align-items: center; gap: 0; overflow-x: auto; padding-bottom: 4px; }
.sequence-step { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 110px; }
.sequence-step-icon { width: 44px; height: 44px; border-radius: 11px; background: var(--card2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.sequence-step-connector { flex: 0 0 28px; height: 2px; background: var(--border); margin-top: -22px; }

/* ===== Meetings ===== */
.meeting-date-badge { text-align: center; min-width: 60px; padding: 8px 0; background: var(--brand-tint); border-radius: 11px; }
.meeting-row { padding: 18px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.meeting-past-row { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--border); }
.meeting-past-row:last-child { border-bottom: none; }

/* ===== Dashboard activity feed ===== */
.activity-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; }
.activity-row:hover { background: var(--card2); }
.activity-icon { width: 34px; height: 34px; border-radius: 9px; background: var(--card2); display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; color: var(--muted); }
.activity-overview-tile { display: flex; align-items: center; gap: 10px; }

/* ===== Dashboard charts / Reports (Phase 4) ===== */
.bar-chart { display: flex; align-items: flex-end; gap: 8px; }
.bar-chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.bar-chart-col-fill { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.bar-chart-bar { width: 100%; min-height: 3px; border-radius: 6px 6px 0 0; background: linear-gradient(180deg, var(--brand), var(--accent)); }
.funnel-row { margin-bottom: 9px; }
.funnel-track { height: 9px; background: var(--card2); border-radius: 5px; overflow: hidden; }
.funnel-fill { height: 100%; border-radius: 5px; }
.region-row { display: flex; align-items: center; gap: 12px; margin-bottom: 11px; }
.region-track { flex: 1; height: 18px; background: var(--card2); border-radius: 5px; overflow: hidden; display: flex; }
.rep-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.rep-track { height: 9px; background: var(--card2); border-radius: 5px; overflow: hidden; }
.rep-fill { height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--brand), var(--accent)); }
.donut-legend-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }

/* ===== Lists / Tasks (Phase 4) ===== */
.task-row { display: flex; align-items: center; gap: 11px; padding: 11px 13px; background: var(--card2); border-radius: 10px; }
.task-checkbox { width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--border-s); background: var(--card); cursor: pointer; flex-shrink: 0; }
.task-checkbox.done { border: none; background: var(--green); color: #fff; font-size: 12px; }

.task-card { background: var(--card2); border-radius: 10px; padding: 12px 13px; border: 1px solid transparent; transition: border-color .12s; }
.task-card:hover { border-color: var(--border-s); }
.priority-pill { font-size: 10px; padding: 2px 8px; flex-shrink: 0; }
.priority-pill.priority-high { background: var(--red-bg); color: var(--red); }
.priority-pill.priority-medium { background: var(--amber-bg); color: var(--amber); }
.priority-pill.priority-low { background: var(--teal-bg); color: var(--teal); }
.task-mini-btn { width: 24px; height: 24px; border-radius: 7px; border: 1px solid var(--border-s); background: var(--card); color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 11px; transition: background .12s, color .12s; }
.task-mini-btn:hover { background: var(--brand-tint); color: var(--accent-dark); }
.task-mini-btn-success:hover { background: var(--green-bg); color: var(--green); }

/* ===== Reusable split grids (Dashboard/Reports/Calling — were ad-hoc
   inline grid-template-columns; named so the mobile media query below
   can stack them to 1 column) ===== */
.grid-split-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 16px; }
.grid-split-14-1 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.grid-split-13-1 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; margin-bottom: 16px; }

/* ===== Mobile navigation (off-canvas sidebar + hamburger) ===== */
.mobile-nav-backdrop { display: none; position: fixed; inset: 0; background: rgba(15,40,60,.4); z-index: 1001; }
.mobile-nav-backdrop.open { display: block; }

@media (max-width: 900px) {
  .hamburger-btn { display: flex; align-items: center; justify-content: center; }

  .sidebar {
    position: fixed; top: 0; left: 0; z-index: 1002; height: 100vh;
    width: 264px; transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg);
  }
  .sidebar.mobile-open { transform: translateX(0); }
  /* The desktop icon-only "collapsed" mode doesn't apply on mobile — the
     off-canvas drawer is either fully open or fully hidden, always showing
     labels, so a state persisted from a desktop session doesn't leave the
     mobile drawer half-broken. */
  .sidebar.collapsed { width: 264px; }
  .sidebar-collapse-btn { display: none; }
  .sidebar.collapsed .sidebar-head { justify-content: space-between; padding: 0 16px; }
  .sidebar.collapsed .sidebar-brand { display: flex; }
  .sidebar.collapsed .sidebar-badge-d { display: none; }
  .sidebar.collapsed .nav-section-head { display: block; }
  .sidebar.collapsed .nav-item { justify-content: flex-start; padding: 9px 11px; }
  .sidebar.collapsed .nav-item-label { display: block; }
  .sidebar.collapsed .nav-badge { display: inline-block; }
  .sidebar.collapsed .sidebar-me { justify-content: flex-start; padding: 8px 10px; }
  .sidebar.collapsed .sidebar-me-info { display: block; }

  .topbar { height: auto; min-height: 68px; flex-wrap: wrap; padding: 10px 14px; }
  .topbar-right { flex-wrap: wrap; justify-content: flex-start; width: 100%; }
  .topbar-search { order: 10; width: 100%; max-width: none; margin-top: 8px; flex-basis: 100%; }
  .content-inner { padding: 16px; }

  .grid-split-2-1, .grid-split-14-1, .grid-split-13-1 { grid-template-columns: 1fr; }
  .grid-2, .composer-grid { grid-template-columns: 1fr; }
  .modal-box.wide { max-width: 100%; }
  .kpi-value { font-size: 21px; }
}

/* ===== Settings (Phase 5) ===== */
.integration-card { padding: 18px; display: flex; align-items: center; gap: 13px; }
.integration-icon { width: 44px; height: 44px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.stage-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: var(--card2); border-radius: 9px; margin-bottom: 8px; }
.stage-row:last-child { margin-bottom: 0; }
.stage-dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
