body {
  background: var(--surface-page);
  color: var(--text-primary);
}

.app-navbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  height: 56px;
  background: var(--surface-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
}

.btn-icon {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 1.1rem;
  padding: .25rem .5rem;
}
.btn-icon:hover { color: var(--primary); }

.app-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  transition: grid-template-columns .2s ease;
}
.app-shell.sidebar-collapsed {
  grid-template-columns: 64px 1fr;
}

.app-sidebar {
  background: var(--surface-card);
  border-right: 1px solid var(--border);
  min-height: calc(100vh - 56px);
  position: sticky;
  top: 56px;
}

.sidebar-brand {
  padding: 1rem;
  font-weight: 700;
  font-size: 1.1rem;
}
.brand-mini { display: none; }
.app-shell.sidebar-collapsed .brand-full { display: none; }
.app-shell.sidebar-collapsed .brand-mini { display: inline; }

.sidebar-nav .nav-link {
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem 1rem;
}
.sidebar-nav .nav-link i { width: 20px; text-align: center; }
.sidebar-nav .nav-link:hover { background: var(--surface-hover); }
.sidebar-nav .nav-link.active { background: var(--primary-subtle); color: var(--primary); }

.app-shell.sidebar-collapsed .sidebar-nav .label { display: none; }

.app-content { min-width: 0; }

.stat-card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  text-align: center;
}
.stat-value { font-size: 2rem; font-weight: 700; color: var(--primary); }
.stat-label { color: var(--text-secondary); }

.help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1px solid var(--text-muted);
  color: var(--text-muted);
  font-size: .68rem;
  line-height: 1;
  margin-left: 4px;
  cursor: help;
  user-select: none;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.table-toolbar .filters {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  flex: 1;
  min-width: 220px;
  max-width: 420px;
}
.table-toolbar .filters .form-control { flex: 1 1 auto; min-width: 0; }

.btn-group-with-form { display: inline-flex; }
.btn-group-with-form > .btn:not(:last-child),
.btn-group-with-form > form:not(:last-child) > .btn {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.btn-group-with-form > .btn:not(:first-child),
.btn-group-with-form > form:not(:first-child) > .btn {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  margin-left: -1px;
}
.btn-group-with-form > .btn,
.btn-group-with-form > form > .btn { position: relative; }
.btn-group-with-form > .btn:hover, .btn-group-with-form > .btn:focus,
.btn-group-with-form > form > .btn:hover, .btn-group-with-form > form > .btn:focus { z-index: 1; }

.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
  background-color: var(--surface-page);
}
.login-card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  width: 100%;
  max-width: 380px;
}
.login-logo { max-width: 160px; display: block; margin: 0 auto 1rem; }
.login-title { font-size: 1.25rem; text-align: center; margin-bottom: 1.5rem; }

.agac-sidebar {
  position: fixed;
  top: 56px;
  left: 0;
  bottom: 0;
  width: 280px;
  background: var(--surface-card);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  z-index: 1020;
}

table td, table th { vertical-align: middle; }
.table .text-end { text-align: right; }

@media (max-width: 768px) {
  .app-shell { grid-template-columns: 0 1fr; }
  .app-sidebar { display: none; }
  .app-shell.sidebar-mobile-open .app-sidebar {
    display: block;
    position: fixed;
    top: 56px;
    left: 0;
    bottom: 0;
    width: 240px;
    z-index: 1040;
  }
}
