.app-shell {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 33px 20px 18px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.wordmark {
  display: flex;
  align-items: center;
  text-decoration: none;
}
.login-story .brand-logo {
  width: 280px;
}
.sidebar .wordmark {
  margin-bottom: 40px;
}
.workspace-label {
  font-size: 9px;
  letter-spacing: 1.7px;
  color: #88918b;
  padding: 0 14px;
  margin-bottom: 14px;
  font-weight: 650;
}
.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.sidebar nav a {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 43px;
  border-radius: 8px;
  padding: 10px 13px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}
.sidebar nav a > span:first-child {
  height: 18px;
}
.sidebar nav a:hover {
  background: var(--canvas);
}
.sidebar nav a.active {
  color: var(--brand);
  background: #ecf2e7;
  font-weight: 650;
}
.nav-count {
  margin-left: auto;
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 10px;
  border-radius: 4px;
  padding: 1px 6px;
}
.sidebar-bottom {
  margin-top: auto;
  padding-top: 30px;
}
.channel-card {
  background: #f4f6ef;
  border: 1px solid #e7ebdc;
  border-radius: 12px;
  padding: 18px 15px;
  margin-bottom: 20px;
}
.channel-symbol {
  background: var(--accent);
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  margin-bottom: 13px;
  color: var(--brand);
}
.channel-card strong {
  font-size: 12px;
}
.channel-card p {
  font-size: 11px;
  color: var(--muted);
  margin: 7px 0 13px;
}
.channel-card a {
  font-size: 11px;
  font-weight: 650;
  text-decoration: none;
}
.admin-user {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.admin-user strong {
  font-size: 11px;
  display: block;
}
.admin-user div > span {
  font-size: 10px;
  color: var(--muted);
}
.admin-user button {
  margin-left: auto;
  padding: 4px;
}
.admin-user button > span {
  height: 18px;
}
.main-shell {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  height: 77px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 36px;
  background: #fcfdfb;
}
.breadcrumb {
  font-size: 12px;
  color: var(--muted);
}
.breadcrumb span {
  padding: 0 13px;
  color: #adb5ab;
}
.breadcrumb strong {
  font-weight: 500;
  color: var(--ink);
}
.admin-avatar {
  width: 31px;
  height: 31px;
  font-size: 10px;
  border-radius: 50%;
  border: 1px solid var(--line);
  margin-left: 8px;
}
main#main {
  padding: 34px 36px;
  flex: 1;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
}
.page-heading .eyebrow {
  margin-bottom: 9px;
}
.page-heading p {
  margin-top: 9px;
  font-size: 13px;
  color: var(--muted);
}
#page-error {
  margin-bottom: 20px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 24px 0;
}
.stat {
  padding: 21px 22px;
}
.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}
.stat-icon {
  height: 30px;
  width: 30px;
  background: var(--surface-soft);
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--brand);
}
.stat-value {
  font-size: 32px;
  letter-spacing: -1px;
  font-weight: 600;
  line-height: 1.5;
  margin-top: 8px;
}
.stat-foot {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}
.stat-foot b {
  color: var(--brand);
  font-weight: 500;
}
.welcome-banner {
  background: #eaf0dd;
  border: 1px solid #dce5ca;
  border-radius: var(--radius);
  padding: 24px 27px;
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.welcome-banner h2 {
  font-size: 21px;
  margin-bottom: 5px;
}
.welcome-banner p {
  font-size: 12px;
  color: #5e7053;
  max-width: 520px;
}
.banner-icon {
  border-radius: 16px;
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  background: #dbe8bd;
  color: #466136;
  transform: rotate(-8deg);
  flex-shrink: 0;
}
.banner-icon .icon {
  width: 32px;
  height: 32px;
  transform: rotate(8deg);
}
.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(270px, 1fr);
  gap: 22px;
  align-items: start;
}
.overview-grid .table-wrap td,
.overview-grid .table-wrap th {
  padding-left: 22px;
  padding-right: 18px;
}
.overview-grid .table-wrap td:first-child {
  max-width: 270px;
}
.overview-grid .table-wrap td strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-subtitle {
  color: var(--muted);
  font-size: 11px;
  margin-top: 4px;
}
.section-link {
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.activity-list {
  list-style: none;
  margin: 0;
  padding: 2px 22px 16px;
}
.activity-list li {
  display: flex;
  gap: 12px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.activity-list li:last-child {
  border: 0;
}
.event-dot {
  width: 8px;
  height: 8px;
  background: #8eac74;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 6px;
}
.event-dot.error {
  background: var(--danger);
}
.activity-list p {
  font-size: 12px;
}
.activity-list time {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
}
.progress-item {
  margin-top: 18px;
}
.progress-item .row {
  font-size: 12px;
  margin-bottom: 7px;
}
progress {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 7px;
  border: 0;
  background: var(--surface-soft);
  border-radius: 10px;
  display: block;
  overflow: hidden;
}
progress::-webkit-progress-bar {
  background: var(--surface-soft);
}
progress::-webkit-progress-value {
  background: #7eaa67;
  border-radius: 10px;
}
progress::-moz-progress-bar {
  background: #7eaa67;
  border-radius: 10px;
}
.progress-warning::-webkit-progress-value {
  background: #d6b36b;
}
.progress-danger::-webkit-progress-value {
  background: #c57b71;
}
.summary-note {
  font-size: 11px;
  color: var(--muted);
  padding-top: 17px;
  margin-top: 20px;
  border-top: 1px solid var(--line);
}
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.toolbar select {
  width: auto;
  min-width: 160px;
  font-size: 12px;
  padding: 9px 12px;
}
.table-footer {
  padding: 16px 22px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 11px;
}
.job-cell {
  max-width: 450px;
}
.job-cell a {
  color: var(--ink);
  text-decoration: none;
}
.job-cell a:hover {
  text-decoration: underline;
}
.filters-cell {
  max-width: 270px;
}
.filters-cell .chip {
  margin: 2px;
}
.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr);
  gap: 22px;
}
.settings-grid .field {
  margin-bottom: 20px;
}
.rule-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.rule-list .field {
  margin: 0;
}
.rule-list textarea {
  font-size: 12px;
  min-height: 88px;
}
.settings-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 12px;
}
.app-footer {
  padding: 8px 36px 22px;
  display: flex;
  justify-content: space-between;
  color: #89928b;
  font-size: 10px;
}
.detail-list {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 13px;
  margin: 22px 0;
}
.detail-list dt {
  font-size: 12px;
  color: var(--muted);
}
.detail-list dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}
.login-shell {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  min-height: 100vh;
}
.login-story {
  background: #eaf0dd;
  padding: 60px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
}
.login-story h1 {
  font-size: clamp(38px, 4vw, 60px);
  margin: 20px 0;
  letter-spacing: -2px;
}
.login-story p {
  max-width: 350px;
  color: var(--muted);
  font-size: 16px;
}
.login-story > span {
  color: #738063;
}
.login-form {
  display: grid;
  place-items: center;
  padding: 40px;
}
.login-form form {
  width: 100%;
  max-width: 350px;
}
.login-form h1 {
  font-size: 32px;
}
.login-form .field {
  margin-top: 16px;
}
.record-error {
  color: var(--danger);
  font-size: 11px;
  max-width: 260px;
  overflow-wrap: anywhere;
}
.page-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}
@media (min-width: 1600px) {
  main#main {
    max-width: 1500px;
    width: 100%;
    margin: auto;
  }
}
@media (max-width: 1150px) {
  .app-shell {
    grid-template-columns: 210px minmax(0, 1fr);
  }
  .sidebar {
    padding-left: 14px;
    padding-right: 14px;
  }
  main#main {
    padding: 28px 24px;
  }
  .topbar {
    padding: 0 24px;
  }
  .overview-grid {
    grid-template-columns: 1fr;
  }
  .overview-aside {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
  .stat {
    padding: 18px 15px;
  }
  .stats {
    gap: 12px;
  }
  .stat-top {
    font-size: 11px;
  }
  .stat-icon {
    display: none;
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 760px) {
  .app-shell {
    display: block;
  }
  .sidebar {
    position: relative;
    height: auto;
    padding: 18px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .sidebar .wordmark {
    margin: 0 0 18px;
    padding: 0;
    font-size: 25px;
  }
  .workspace-label,
  .sidebar-bottom {
    display: none;
  }
  .sidebar nav {
    flex-direction: row;
    overflow: auto;
    gap: 5px;
  }
  .sidebar nav a {
    font-size: 11px;
    padding: 8px;
    gap: 6px;
    white-space: nowrap;
    min-height: 36px;
  }
  .sidebar nav .icon {
    width: 15px;
  }
  .topbar {
    height: 55px;
    padding: 0 18px;
  }
  main#main {
    padding: 25px 18px;
  }
  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 15px;
  }
  .page-heading h1 {
    font-size: 29px;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
  }
  .welcome-banner {
    padding: 20px;
  }
  .welcome-banner h2 {
    font-size: 18px;
  }
  .banner-icon {
    display: none;
  }
  .overview-aside {
    display: flex;
    flex-direction: column;
  }
  .toolbar {
    align-items: stretch;
    flex-direction: column;
    padding: 16px;
  }
  .search {
    min-width: 0;
  }
  .toolbar select {
    width: 100%;
  }
  .rule-list {
    grid-template-columns: 1fr;
  }
  .app-footer {
    padding: 10px 18px 20px;
  }
  .app-footer span:last-child {
    display: none;
  }
  .login-shell {
    display: block;
  }
  .login-story {
    min-height: 0;
    padding: 30px;
    gap: 40px;
  }
  .login-story h1 {
    font-size: 36px;
  }
  .login-story > span,
  .login-story p {
    display: none;
  }
  .login-form {
    padding: 40px 24px;
  }
  .table-footer {
    flex-wrap: wrap;
  }
  td,
  th {
    padding: 14px 18px;
  }
  .toast {
    left: 18px;
    right: 18px;
    bottom: 18px;
  }
  .card-body {
    padding: 20px;
  }
}
.overview-grid > *,
.settings-grid > *,
.overview-aside,
.card {
  min-width: 0;
}
.mobile-logout {
  display: none;
}
@media (max-width: 760px) {
  .mobile-logout {
    display: inline-flex;
  }
  .admin-avatar {
    display: none;
  }
  .card-heading {
    flex-wrap: wrap;
  }
}
@media (max-width: 760px) {
  .topbar {
    gap: 10px;
  }
  .topbar .row {
    flex-wrap: nowrap;
    gap: 5px;
  }
  .breadcrumb {
    white-space: nowrap;
    font-size: 11px;
  }
  .breadcrumb span {
    padding: 0 5px;
  }
  .topbar .badge {
    font-size: 10px;
  }
  .mobile-logout {
    padding: 4px 6px;
  }
}

.company-profile { margin-bottom: 20px; display: grid; gap: 16px; }
.company-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.company-summary strong, .company-summary span { display: block; }
.company-summary span { color: var(--muted); font-size: 12px; margin-top: 6px; }
.company-categories { flex-wrap: wrap; }
@media (max-width: 700px) { .company-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
