:root {
  --bg: #f0f4fa;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #013179;
  --accent: #ff6b00;
  --ok: #15803d;
  --warn: #b45309;
  --danger: #dc2626;
  --sidebar-bg: #0a1628;
  --sidebar-text: #e2e8f0;
  --sidebar-muted: #94a3b8;
  --sidebar-active: rgba(255, 107, 0, 0.15);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.auth-page {
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: linear-gradient(165deg, #eef2ff 0%, #f8fafc 45%, #fff7ed 100%);
}

.auth-card {
  width: min(420px, 100%);
  background: var(--surface);
  color: var(--text);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 20px 50px rgba(1, 49, 121, 0.08);
  border: 1px solid var(--border);
}

.auth-card-wide { width: min(520px, 100%); }

.auth-title { margin: 0 0 0.35rem; font-size: 1.35rem; color: var(--primary); }

.auth-sub { color: var(--muted); margin-top: -0.25rem; line-height: 1.5; }

.auth-footer { margin-top: 1rem; font-size: 0.9rem; text-align: center; }

.auth-footer a { color: var(--primary); font-weight: 600; text-decoration: none; }

.auth-footer a:hover { color: var(--accent); }

.stack { display: flex; flex-direction: column; gap: 0.85rem; }

label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.9rem; font-weight: 500; }

input, select, textarea {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  font: inherit;
  background: #fff;
  color: var(--text);
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(1, 49, 121, 0.25);
  border-color: var(--primary);
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 0.65rem 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn-sm { padding: 0.4rem 0.65rem; font-size: 0.85rem; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--ok); color: #fff; }

.alert { padding: 0.75rem; border-radius: 8px; font-size: 0.9rem; }
.alert-error { background: #fee2e2; color: #991b1b; }
.alert-success { background: #dcfce7; color: #166534; }

.platform-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1.25rem;
  background: #fff7ed;
  border-bottom: 1px solid #fed7aa;
  font-size: 0.88rem;
  font-weight: 500;
  color: #9a3412;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 0.75rem;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.topbar-brand { display: flex; align-items: center; gap: 0.65rem; }
.topbar-sep { color: var(--muted); font-weight: 600; }
.topbar-meta { display: flex; align-items: center; gap: 0.75rem; font-size: 0.9rem; }
.empresa-name { color: var(--accent); font-weight: 600; }
.user-name { color: var(--muted); }

.tabs {
  display: flex;
  gap: 0.35rem;
  padding: 0.65rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.tab {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
}

.tab:hover { color: var(--primary); }
.tab.active { background: var(--primary); color: #fff; }

.main { padding: 1rem 1.25rem 2rem; max-width: 1100px; margin: 0 auto; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.stat b { display: block; font-size: 1.6rem; color: var(--primary); }
.stat span { color: var(--muted); font-size: 0.85rem; }

.card-list { display: flex; flex-direction: column; gap: 0.65rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
}

.card-light { background: var(--surface); }
.card-compact { padding: 0.75rem 1rem; }

.card h4 { margin: 0 0 0.25rem; }
.card p { margin: 0.15rem 0; color: var(--muted); font-size: 0.9rem; }

.card-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.inline-form { display: inline; margin: 0; }

.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-disponivel { background: #dcfce7; color: #166534; }
.badge-em_rota { background: #dbeafe; color: #1e40af; }
.badge-manutencao { background: #fef3c7; color: #92400e; }
.badge-planeado { background: #f1f5f9; color: #475569; }
.badge-em_curso { background: #1d4ed8; color: #fff; }
.badge-concluido { background: #dcfce7; color: #166534; }
.badge-cancelado { background: #fee2e2; color: #991b1b; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-active { background: #dcfce7; color: #166534; }
.badge-suspended { background: #fee2e2; color: #991b1b; }

.toolbar { margin-bottom: 0.85rem; }

.modal {
  border: none;
  border-radius: 16px;
  padding: 0;
  max-width: 520px;
  width: calc(100% - 2rem);
  color: var(--text);
  box-shadow: 0 24px 60px rgba(1, 49, 121, 0.15);
}

.modal::backdrop { background: rgba(15, 23, 42, 0.35); }
.modal-body { padding: 1.25rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 0.5rem; }
.hint { font-weight: 400; color: var(--muted); font-size: 0.8rem; }

.toast {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.75rem 1rem;
  border-radius: 10px;
  max-width: 320px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.empty { color: var(--muted); padding: 1rem 0; }

.btn-accent { background: var(--accent); color: #fff; }

.toolbar-frota {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.frota-search {
  flex: 1 1 220px;
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
}

.frota-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0.85rem;
}

.v-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
}

.v-img-area {
  position: relative;
  background: linear-gradient(135deg, #013179 0%, #1e4a8a 55%, #ff6b00 120%);
  min-height: 88px;
  display: grid;
  place-items: center;
}

.v-no-img { font-size: 2rem; color: rgba(255, 255, 255, 0.85); }

.v-estado-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: none;
  max-width: 70%;
  text-align: right;
}

.v-content { padding: 0.85rem 1rem; flex: 1; }

.v-plate {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--primary);
}

.v-model { color: var(--muted); font-size: 0.9rem; margin-top: 0.15rem; }

.v-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 0.75rem;
  margin-top: 0.75rem;
}

.v-info-item label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.v-info-item span { font-weight: 600; font-size: 0.95rem; }

.v-notas { margin: 0.5rem 0 0; font-size: 0.85rem; color: var(--muted); }

.v-doc-alert {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
}

.v-doc-alert-warn { background: #fef3c7; color: #92400e; }
.v-doc-alert-danger { background: #fee2e2; color: #991b1b; }

.v-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.65rem 0.85rem 0.85rem;
  border-top: 1px solid var(--border);
  background: #f8fafc;
}

.v-btn {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 0.45rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.v-btn-utilizar { border-color: var(--primary); color: var(--primary); }
.v-btn-estacionar { border-color: var(--muted); color: var(--text); }
.v-btn-fuel { border-color: var(--accent); color: #c2410c; }
.v-btn-danger { border-color: #fecaca; color: #b91c1c; }

.util-mat { font-weight: 700; margin: 0; color: var(--text); }

.platform-panel .platform-view { display: none; }
.platform-panel .platform-view.active { display: block; }

.platform-panel .platform-section { margin-bottom: 1.5rem; }
.platform-panel .platform-section:last-child { margin-bottom: 0; }

.platform-panel .platform-form-card {
  margin-top: 1.25rem;
  box-shadow: none;
  border: 1px dashed var(--border);
  background: var(--surface);
}

.platform-panel .platform-role-hint {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.platform-panel .platform-role-hint strong { color: var(--primary); }

#sidebar .nav-link .nav-count {
  margin-left: auto;
  min-width: 1.35rem;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.25);
  color: #fde68a;
}

#sidebar .nav-link.active .nav-count {
  background: rgba(15, 23, 42, 0.2);
  color: var(--sidebar-link-active);
}

.platform-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
}

.platform-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.platform-table th,
.platform-table td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.platform-table th {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: #f8fafc;
}

.platform-table tr:last-child td { border-bottom: none; }

.platform-table tbody tr:hover td { background: #f8fafc; }

.platform-table .platform-td-actions {
  white-space: nowrap;
  text-align: right;
}

.platform-table .platform-td-actions .inline-form + .inline-form { margin-left: 0.25rem; }

.platform-sidebar-role {
  margin-bottom: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #22c55e;
}

.abast-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.abast-list li { padding: 0.25rem 0; border-bottom: 1px solid var(--border); }

.viatura-abast-wrap h4 { margin: 0.5rem 0 0.25rem; font-size: 0.95rem; }

.login-brand-wrap { display: flex; justify-content: center; margin-bottom: 0.5rem; }

/* ——— Fleet app shell ——— */
.fleet-app { overflow-x: hidden; }

.app-shell {
  display: flex;
  min-height: calc(100vh - 0px);
}

.platform-bar + .app-shell {
  min-height: calc(100vh - 42px);
}

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
}

.platform-bar ~ .app-shell .sidebar {
  height: calc(100vh - 42px);
  top: 42px;
}

.sidebar-brand {
  padding: 1.25rem 1rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-product {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sidebar-muted);
}

.sidebar-nav {
  flex: 1;
  padding: 0.75rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  border: none;
  background: transparent;
  color: var(--sidebar-text);
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  text-align: left;
}

.sidebar-link i { font-size: 1.1rem; opacity: 0.85; }

.sidebar-link:hover:not(.disabled) {
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-link.active {
  background: var(--sidebar-active);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--accent);
}

.sidebar-link.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.sidebar-badge {
  margin-left: auto;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--sidebar-muted);
}

.sidebar-foot {
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.82rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-empresa { color: var(--accent); font-weight: 600; }
.sidebar-user { color: var(--sidebar-muted); }
.sidebar-foot-link { color: var(--sidebar-muted); text-decoration: none; font-weight: 600; }
.sidebar-foot-link:hover { color: #fff; }

.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.content-header-left { display: flex; align-items: center; gap: 0.65rem; }

.btn-icon {
  display: none;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  padding: 0.4rem 0.55rem;
  cursor: pointer;
}

.breadcrumb {
  font-weight: 700;
  color: var(--primary);
  font-size: 1.05rem;
}

.content-header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.content-body {
  flex: 1;
  padding: 1rem 1.25rem 2rem;
  overflow-y: auto;
}

.app-view { display: none; }
.app-view.active { display: block; }

.frota-subnav {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.frota-subnav-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}

.frota-subnav-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.frota-panel { display: none; }
.frota-panel.active { display: block; }

.section-title {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  color: var(--primary);
}

.frota-grid-compact { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

.embed-pane {
  padding: 1.25rem clamp(1rem, 3vw, 1.75rem) 2.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.embed-title {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
}

.embed-subtitle {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  color: #334155;
}

.gestao-layout {
  display: grid;
  grid-template-columns: minmax(160px, 220px) 1fr;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 767px) {
  .gestao-layout {
    grid-template-columns: 1fr;
  }
}

.gestao-side-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gestao-nav-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  border: none;
  background: transparent;
  color: #4b5563;
  font-weight: 500;
  border-radius: 8px;
  padding: 10px 15px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
}

.gestao-nav-btn:hover {
  background: #f9fafb;
  color: #15803d;
}

.gestao-nav-btn.active {
  background: #ecfdf5;
  color: #15803d;
  border-left: 4px solid #22c55e;
  border-radius: 4px 8px 8px 4px;
  font-weight: 600;
}

.gestao-panel { display: none; }
.gestao-panel.active { display: block; }

.gestao-form {
  margin-top: 1rem;
  max-width: 480px;
}

.gestao-form + .gestao-form {
  margin-top: 1.25rem;
}

body.vm5-app .frota-subnav-btn.active {
  background: #22c55e;
  border-color: #22c55e;
  color: #0f172a;
}

body.vm5-app .btn-primary {
  background: #013179;
}

body.vm5-app .toast {
  z-index: 600;
}

.v-card { cursor: pointer; transition: box-shadow 0.15s, transform 0.15s; }
.v-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Vehicle detail overlay */
.vehicle-detail {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: var(--embed-bg);
  display: flex;
  flex-direction: column;
}

.vehicle-detail[hidden] { display: none !important; }

.vd-header {
  display: grid;
  grid-template-columns: 1fr auto auto;
  grid-template-areas:
    "main meta close"
    "actions actions actions";
  gap: 0.5rem 1rem;
  align-items: center;
  padding: 0.85rem 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.vd-header-main { grid-area: main; }
.vd-plate { font-size: 1.5rem; font-weight: 800; letter-spacing: 0.04em; color: var(--primary); }
.vd-model { color: var(--muted); font-size: 0.95rem; margin-top: 0.1rem; }

.vd-header-meta {
  grid-area: meta;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.vd-gps-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: #f1f5f9;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.vd-close {
  grid-area: close;
  border: none;
  background: #f1f5f9;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.vd-close:hover { background: #e2e8f0; }

.vd-header-actions {
  grid-area: actions;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.vd-tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 0.5rem;
}

.vd-tab {
  border: none;
  background: transparent;
  padding: 0.75rem 1rem;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.vd-tab:hover { color: var(--primary); }
.vd-tab.active { color: var(--primary); border-bottom-color: var(--accent); }

.vd-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

.vd-panel { display: none; }
.vd-panel.active { display: block; }

.form-section {
  margin-bottom: 1.5rem;
}

.form-section h3 {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.85rem 1rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field span {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.field-full { margin-top: 0.5rem; }

.vd-form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.btn-save { padding: 0.7rem 1.35rem; }

.coming-soon {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
}

.coming-soon i { font-size: 2.5rem; display: block; margin-bottom: 0.75rem; opacity: 0.5; }

.vd-abast-toolbar { margin-bottom: 1rem; }

.abast-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  font-size: 0.88rem;
}

.abast-table th,
.abast-table td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.abast-table th {
  background: #f8fafc;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.abast-table tr:last-child td { border-bottom: none; }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.notif-wrap { position: relative; }

.btn-notif {
  position: relative;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.55rem;
  color: var(--text);
  cursor: pointer;
}

.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notif-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  width: min(360px, 92vw);
  max-height: 420px;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
  z-index: 120;
}

.notif-dropdown-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
}

.notif-list { display: flex; flex-direction: column; }

.notif-item {
  text-align: left;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  padding: 0.75rem 0.85rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.notif-item:hover { background: #f8fafc; }
.notif-item.is-read { opacity: 0.65; }
.notif-item small { color: var(--muted); font-size: 0.75rem; }
.notif-empty { padding: 1rem; margin: 0; }

.stack-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
}

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: 0;
    transform: translateX(-100%);
    transition: transform 0.2s;
  }

  .sidebar.open { transform: translateX(0); }

  .btn-icon { display: inline-flex; }

  .vd-header {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "main close"
      "meta meta"
      "actions actions";
  }
}
