/* EV10 Application Shell */

.ev10-app,
.app-shell {
  min-height: 100vh;
  display: flex;
  width: 100%;
  background: var(--ev10-bg);
}

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

.ev10-content,
.app-content {
  flex: 1 0 auto;
  width: 100%;
  min-width: 0;
}

.ev10-content-inner,
.content,
.page-container {
  width: min(100%, var(--ev10-content-max));
  margin: 0 auto;
  padding: 28px 32px 40px;
  min-width: 0;
}

/* Sidebar */
.ev10-sidebar,
.sidebar,
.app-sidebar {
  position: sticky;
  top: 0;
  flex-shrink: 0;
  height: 100vh;
  width: var(--ev10-sidebar-w);
  padding: 0;
  background: var(--ev10-surface);
  border-right: 1px solid var(--ev10-border);
  display: flex;
  flex-direction: column;
  z-index: 80;
  overflow: hidden;
  transition: width var(--t-slow);
}

body.sidebar-collapsed .ev10-sidebar,
body.sidebar-collapsed .sidebar,
body.sidebar-collapsed .app-sidebar {
  width: var(--ev10-sidebar-collapsed);
}

.sidebar__inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  padding: 18px 14px;
  gap: 8px;
}

.sidebar__toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 4px 16px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--ev10-border);
}

.sidebar__toolbar .brand { border: 0; margin: 0; padding: 0; flex: 1; min-width: 0; }

.sidebar__collapse {
  width: 32px;
  height: 32px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ev10-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: var(--ev10-t);
}
.sidebar__collapse:hover {
  background: var(--ev10-soft-blue);
  color: var(--ev10-primary);
  border-color: #C7D7FE;
}
.sidebar__collapse svg { width: 16px; height: 16px; transition: transform var(--ev10-t); }
body.sidebar-collapsed .sidebar__collapse svg { transform: rotate(180deg); }

.brand { display: flex; align-items: center; gap: 12px; }
.brand__logo {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--ev10-ink);
  color: #fff;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: -0.02em;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: none;
}
.brand__name {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.03em;
  color: var(--ev10-text);
  line-height: 1.2;
}
.brand__sub {
  font-size: 11px;
  color: var(--ev10-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 2px;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}
.nav:hover { scrollbar-color: #D0D5DD transparent; }
.nav::-webkit-scrollbar { width: 4px; }
.nav::-webkit-scrollbar-thumb { background: transparent; border-radius: 99px; }
.nav:hover::-webkit-scrollbar-thumb { background: #D0D5DD; }

.nav__section {
  margin: 16px 10px 6px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #98A2B3;
}

.nav__item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--ev10-muted);
  font-weight: 600;
  font-size: 13.5px;
  transition: background var(--ev10-t), color var(--ev10-t);
  white-space: nowrap;
}
.nav__item:hover {
  background: #F9FAFB;
  color: var(--ev10-text);
  transform: none;
}
.nav__item.is-active {
  background: var(--ev10-soft-blue);
  color: var(--ev10-ink);
  box-shadow: none;
  animation: none;
}
.nav__item.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 99px;
  background: var(--ev10-primary);
}
.nav__item.is-active .nav__icon {
  background: transparent;
  color: var(--ev10-primary);
  border-color: transparent;
}
.nav__item--danger { color: var(--ev10-danger); }
.nav__item--danger:hover { background: var(--ev10-soft-red); }

.nav__icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: transparent;
  color: inherit;
}
.nav__icon svg { width: 17px; height: 17px; }

.sidebar__bottom {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--ev10-border);
}
.account-card {
  padding: 12px;
  border-radius: 12px;
  background: #F9FAFB;
  border: 1px solid var(--ev10-border);
}
.account-card__title {
  font-weight: 700;
  font-size: 12px;
  color: var(--ev10-text);
}
.account-card__meta {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--ev10-muted);
  line-height: 1.45;
}

body.sidebar-collapsed .brand__text,
body.sidebar-collapsed .nav__section,
body.sidebar-collapsed .nav__label,
body.sidebar-collapsed .account-card__meta,
body.sidebar-collapsed .account-card__title,
body.sidebar-collapsed .sidebar__bottom { opacity: 0; width: 0; overflow: hidden; height: 0; padding: 0; margin: 0; border: 0; }
body.sidebar-collapsed .brand { justify-content: center; }
body.sidebar-collapsed .nav__item { justify-content: center; padding: 10px; }
body.sidebar-collapsed .nav__item.is-active::before { display: none; }
body.sidebar-collapsed .sidebar__toolbar { flex-direction: column; align-items: center; border: 0; }

/* Topbar */
.ev10-topbar,
.topbar,
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 70;
  margin: 0;
  min-height: var(--ev10-topbar-h);
  height: auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 0;
  border-bottom: 1px solid var(--ev10-border);
  box-shadow: none;
}

.topbar__row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.topbar__left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar__titlewrap { min-width: 0; }
.topbar__title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ev10-text);
  margin: 0;
}
.topbar__desc {
  font-size: 12.5px;
  color: var(--ev10-muted);
  margin: 2px 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar__right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-wrap: nowrap;
}

.topbar__search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  background: #F9FAFB;
  border: 1px solid var(--ev10-border);
  width: min(280px, 30vw);
  transition: var(--ev10-t);
  position: relative;
}
.topbar__search:focus-within {
  background: #fff;
  border-color: #B2CCFF;
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.topbar__search input {
  border: 0;
  outline: 0;
  background: transparent;
  width: 100%;
  font-size: 13px;
  font-weight: 500;
  color: var(--ev10-text);
}
.topbar__search input::placeholder { color: #98A2B3; }

.globalsearch {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: auto;
  width: min(420px, 70vw);
  max-height: 420px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--ev10-border);
  border-radius: 12px;
  box-shadow: var(--ev10-shadow-sm);
  z-index: 40;
  padding: 8px;
}
.globalsearch__group {
  padding: 6px 8px 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ev10-muted);
}
.globalsearch__item {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--ev10-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}
.globalsearch__item:hover,
.globalsearch__item:focus {
  background: var(--ev10-soft-blue);
}
.globalsearch__item span {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--ev10-muted);
}
.globalsearch__empty {
  padding: 12px 10px;
  font-size: 13px;
  color: var(--ev10-muted);
}

.topbar__date {
  font-size: 12px;
  font-weight: 600;
  color: var(--ev10-muted);
  padding: 8px 12px;
  border-radius: 10px;
  background: #F9FAFB;
  border: 1px solid var(--ev10-border);
}

.topbar__notify-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--ev10-border);
  background: #fff;
  color: var(--ev10-muted);
  display: grid;
  place-items: center;
  transition: var(--ev10-t);
}
.topbar__notify-btn:hover {
  background: var(--ev10-soft-blue);
  color: var(--ev10-primary);
  border-color: #C7D7FE;
}
.topbar__notify-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--ev10-danger);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
}

.pill,
.pill--role {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.userchip { display: flex; align-items: center; gap: 10px; }
.userchip__avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--ev10-ink);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  display: grid;
  place-items: center;
}
.userchip__name {
  font-weight: 650;
  font-size: 13px;
  color: var(--ev10-text);
  letter-spacing: -0.01em;
}
.userchip__role {
  font-size: 11px;
  font-weight: 600;
  color: var(--ev10-muted);
  text-transform: none;
  letter-spacing: 0;
}

/* Footer */
.ev10-footer,
.app-footer {
  flex-shrink: 0;
  position: static;
  width: 100%;
  margin-top: auto;
  padding: 18px 32px;
  border-top: 1px solid var(--ev10-border);
  background: var(--ev10-surface);
}
.app-footer__inner {
  width: min(100%, var(--ev10-content-max));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--ev10-muted);
  font-size: 13px;
  font-weight: 550;
  flex-wrap: wrap;
}
.app-footer__brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.app-footer__brand strong {
  color: var(--ev10-text);
  font-weight: 700;
}
.app-footer__brand span {
  font-size: 12px;
  color: var(--ev10-muted);
}
.app-footer__pill {
  padding: 6px 12px;
  border-radius: 999px;
  background: #F9FAFB;
  border: 1px solid var(--ev10-border);
  color: var(--ev10-muted);
  font-size: 12px;
  white-space: nowrap;
}

/* Page header */
.pagehead {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.breadcrumbs {
  font-size: 12px;
  font-weight: 600;
  color: var(--ev10-muted);
  margin-bottom: 8px;
}
.breadcrumbs a:hover { color: var(--ev10-primary); }
.crumb { display: inline-flex; align-items: center; gap: 8px; }
.crumb__sep { opacity: 0.45; }
.pagehead__title,
.hero-title {
  font-size: 28px;
  font-weight: 750;
  letter-spacing: -0.035em;
  color: var(--ev10-text);
  margin: 0;
  line-height: 1.15;
}
.pagehead__sub,
.hero-sub {
  margin: 6px 0 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--ev10-muted);
  max-width: 640px;
  line-height: 1.5;
}
.pagehead__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

/* Dropdown menus */
.menu { position: relative; }
.menu__panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 260px;
  max-width: min(360px, 92vw);
  background: #fff;
  border: 1px solid var(--ev10-border);
  border-radius: 14px;
  box-shadow: var(--ev10-shadow-md);
  padding: 8px;
  display: none;
  z-index: 100;
}
.menu.is-open { z-index: 80; }
.menu.is-open .menu__panel { display: block; }
.menu__head {
  padding: 10px 12px 8px;
  font-size: 12px;
  color: var(--ev10-muted);
  border-bottom: 1px solid var(--ev10-border);
  margin-bottom: 6px;
}
.menu__item {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 550;
  color: var(--ev10-text);
}
.menu__item:hover { background: #F9FAFB; }
.menu__item--danger { color: var(--ev10-danger); }
.menu__item--static { cursor: default; }
.menu__title { font-weight: 650; font-size: 13px; }
.menu__preview {
  margin-top: 2px;
  font-size: 12px;
  color: var(--ev10-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
