/**
 * Django admin dashboard — searchable accordion app list.
 */

.nilfish-app-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-width: 0;

  --nilfish-app-icon-folder: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath stroke='%23000' stroke-width='1.4' stroke-linejoin='round' d='M2 4.2h4.2l1.2 1.3H14v6.3H2z'/%3E%3C/svg%3E");
  --nilfish-app-icon-ledger: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Crect x='3' y='2.5' width='10' height='11' rx='1.2' stroke='%23000' stroke-width='1.4'/%3E%3Cpath stroke='%23000' stroke-width='1.4' stroke-linecap='round' d='M5.5 5.5h5M5.5 8h5M5.5 10.5h3'/%3E%3C/svg%3E");
  --nilfish-app-icon-users: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Ccircle cx='6' cy='5.5' r='2' stroke='%23000' stroke-width='1.4'/%3E%3Cpath stroke='%23000' stroke-width='1.4' stroke-linecap='round' d='M2.5 12.5c.4-2 1.8-3 3.5-3s3.1 1 3.5 3'/%3E%3Ccircle cx='11' cy='6' r='1.5' stroke='%23000' stroke-width='1.3'/%3E%3Cpath stroke='%23000' stroke-width='1.3' stroke-linecap='round' d='M13.5 12.2c-.2-1.4-1.1-2.2-2.4-2.2'/%3E%3C/svg%3E");
  --nilfish-app-icon-spark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath stroke='%23000' stroke-width='1.4' stroke-linejoin='round' d='M8 2.2 9.2 6.2 13.2 7.4 9.2 8.6 8 12.6 6.8 8.6 2.8 7.4 6.8 6.2z'/%3E%3C/svg%3E");
  --nilfish-app-icon-key: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Ccircle cx='6' cy='6' r='2.6' stroke='%23000' stroke-width='1.4'/%3E%3Cpath stroke='%23000' stroke-width='1.4' stroke-linecap='round' d='M8.2 8.2 13 13M11.2 11.2h2'/%3E%3C/svg%3E");
  --nilfish-app-icon-box: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath stroke='%23000' stroke-width='1.4' stroke-linejoin='round' d='M2.5 5.2 8 2.5l5.5 2.7v5.6L8 13.5 2.5 10.8z'/%3E%3Cpath stroke='%23000' stroke-width='1.4' d='M2.5 5.2 8 8l5.5-2.8M8 8v5.5'/%3E%3C/svg%3E");
  --nilfish-app-icon-gear: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Ccircle cx='8' cy='8' r='2.2' stroke='%23000' stroke-width='1.4'/%3E%3Cpath stroke='%23000' stroke-width='1.4' stroke-linejoin='round' d='M8 2.3v1.6M8 12.1v1.6M2.3 8h1.6M12.1 8h1.6M3.9 3.9l1.1 1.1M11 11l1.1 1.1M12.1 3.9 11 5M5 11l-1.1 1.1'/%3E%3C/svg%3E");
  --nilfish-app-icon-handshake: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath stroke='%23000' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round' d='M2.5 8.5 5 6l2 2 2-2 2.5 2.5M6.5 10.5l1.5 1.5 2-2'/%3E%3C/svg%3E");
  --nilfish-app-icon-doc: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath stroke='%23000' stroke-width='1.4' stroke-linejoin='round' d='M4 2.5h5.2L12 5.3V13.5H4z'/%3E%3Cpath stroke='%23000' stroke-width='1.4' d='M9.2 2.5V5.3H12'/%3E%3C/svg%3E");
  --nilfish-app-icon-car: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath stroke='%23000' stroke-width='1.4' stroke-linejoin='round' d='M3 10.5h10l-.8-3.2L10.5 5H5.5L3.8 7.3z'/%3E%3Ccircle cx='5' cy='11.2' r='1.1' stroke='%23000' stroke-width='1.3'/%3E%3Ccircle cx='11' cy='11.2' r='1.1' stroke='%23000' stroke-width='1.3'/%3E%3C/svg%3E");
  --nilfish-app-icon-cart: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath stroke='%23000' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round' d='M2.5 3h1.5l1.2 6.2h6.6L13.5 5H5'/%3E%3Ccircle cx='7' cy='12.2' r='1' stroke='%23000' stroke-width='1.3'/%3E%3Ccircle cx='11' cy='12.2' r='1' stroke='%23000' stroke-width='1.3'/%3E%3C/svg%3E");
  --nilfish-app-icon-clock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Ccircle cx='8' cy='8' r='5.2' stroke='%23000' stroke-width='1.4'/%3E%3Cpath stroke='%23000' stroke-width='1.4' stroke-linecap='round' d='M8 5v3.2l2 1.2'/%3E%3C/svg%3E");
  --nilfish-app-icon-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Crect x='2.5' y='2.5' width='11' height='11' rx='2' stroke='%23000' stroke-width='1.4'/%3E%3Cpath stroke='%23000' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round' d='m5 8.2 2 2 4-4'/%3E%3C/svg%3E");
  --nilfish-app-icon-wrench: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath stroke='%23000' stroke-width='1.4' stroke-linejoin='round' d='M10.2 3.2a3 3 0 0 0-3.8 3.8L3.2 10.2l2.6 2.6 3.2-3.2a3 3 0 0 0 3.8-3.8L11.2 7.4 10.2 6.4 11.8 4.8z'/%3E%3C/svg%3E");
  --nilfish-app-icon-sync: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath stroke='%23000' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round' d='M12.5 6A4.8 4.8 0 0 0 4.2 5.2L3 3.8v3.5h3.5'/%3E%3Cpath stroke='%23000' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round' d='M3.5 10a4.8 4.8 0 0 0 8.3.8L13 12.2V8.7H9.5'/%3E%3C/svg%3E");
  --nilfish-app-icon-invoice: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath stroke='%23000' stroke-width='1.4' stroke-linejoin='round' d='M4 2.5h8v11l-1.2-.8-1.2.8-1.2-.8-1.2.8-1.2-.8-1.2.8z'/%3E%3Cpath stroke='%23000' stroke-width='1.4' stroke-linecap='round' d='M6 6h4M6 8.5h4'/%3E%3C/svg%3E");
  --nilfish-app-icon-pos: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Crect x='2.5' y='3' width='11' height='8' rx='1.2' stroke='%23000' stroke-width='1.4'/%3E%3Cpath stroke='%23000' stroke-width='1.4' stroke-linecap='round' d='M5 13h6M8 11v2'/%3E%3C/svg%3E");
  --nilfish-app-icon-fitment: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Ccircle cx='8' cy='8' r='5.2' stroke='%23000' stroke-width='1.4'/%3E%3Ccircle cx='8' cy='8' r='1.6' stroke='%23000' stroke-width='1.3'/%3E%3Cpath stroke='%23000' stroke-width='1.3' d='M8 2.8v1.6M8 11.6v1.6M2.8 8h1.6M11.6 8h1.6'/%3E%3C/svg%3E");
  --nilfish-app-icon-truck: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath stroke='%23000' stroke-width='1.4' stroke-linejoin='round' d='M2.5 4.5h7v6h-7zM9.5 7h2.8L14 9.2V10.5H9.5z'/%3E%3Ccircle cx='5' cy='11.5' r='1.1' stroke='%23000' stroke-width='1.3'/%3E%3Ccircle cx='12' cy='11.5' r='1.1' stroke='%23000' stroke-width='1.3'/%3E%3C/svg%3E");
}

.nilfish-app-list__toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  padding-bottom: 0.15rem;
  background: var(--body-bg, #fff);
}

.nilfish-app-list__search {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--nilfish-border, #e2e8f0);
  border-radius: 6px;
  font: inherit;
  font-size: 0.875rem;
  color: var(--nilfish-body, #334155);
  background: #fff;
}

.nilfish-app-list__search:focus {
  outline: 2px solid var(--nilfish-accent, #a2c609);
  outline-offset: 1px;
  border-color: var(--nilfish-accent, #a2c609);
}

.nilfish-app-list__search.no-results {
  border-color: #e74c3c;
}

.nilfish-app-list__empty {
  margin: 0;
  padding: 0.5rem 0.15rem;
  color: var(--nilfish-muted, #64748b);
  font-size: 0.875rem;
}

.nilfish-app-list__apps {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.nilfish-app-list__app.module {
  margin: 0 !important;
  padding: 0;
  border: 1px solid var(--nilfish-border, #e2e8f0);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  box-shadow: none;
}

.nilfish-app-list__summary {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  list-style: none;
  cursor: pointer;
  user-select: none;
  padding: 0.55rem 0.7rem;
  background: #e8edf2;
  color: var(--nilfish-primary, #0d1117);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.nilfish-app-list__summary:hover {
  background: #dfe5ec;
}

.nilfish-app-list__app[open] > .nilfish-app-list__summary {
  background: #d8dee6;
  border-bottom: 1px solid var(--nilfish-border, #e2e8f0);
}

.nilfish-app-list__summary::-webkit-details-marker {
  display: none;
}

.nilfish-app-list__summary::marker {
  content: "";
}

.nilfish-app-list__summary-icon {
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
  background-color: var(--nilfish-accent, #a2c609);
  -webkit-mask: var(--nilfish-app-icon-folder) center / contain no-repeat;
  mask: var(--nilfish-app-icon-folder) center / contain no-repeat;
}

.nilfish-app-list__app[data-app-label="accounting"] .nilfish-app-list__summary-icon {
  -webkit-mask-image: var(--nilfish-app-icon-ledger);
  mask-image: var(--nilfish-app-icon-ledger);
}
.nilfish-app-list__app[data-app-label="agency"] .nilfish-app-list__summary-icon {
  -webkit-mask-image: var(--nilfish-app-icon-handshake);
  mask-image: var(--nilfish-app-icon-handshake);
}
.nilfish-app-list__app[data-app-label="ai"] .nilfish-app-list__summary-icon {
  -webkit-mask-image: var(--nilfish-app-icon-spark);
  mask-image: var(--nilfish-app-icon-spark);
}
.nilfish-app-list__app[data-app-label="auth"] .nilfish-app-list__summary-icon,
.nilfish-app-list__app[data-app-label="sessions"] .nilfish-app-list__summary-icon {
  -webkit-mask-image: var(--nilfish-app-icon-key);
  mask-image: var(--nilfish-app-icon-key);
}
.nilfish-app-list__app[data-app-label="catalog"] .nilfish-app-list__summary-icon {
  -webkit-mask-image: var(--nilfish-app-icon-box);
  mask-image: var(--nilfish-app-icon-box);
}
.nilfish-app-list__app[data-app-label="core"] .nilfish-app-list__summary-icon,
.nilfish-app-list__app[data-app-label="master"] .nilfish-app-list__summary-icon,
.nilfish-app-list__app[data-app-label="contenttypes"] .nilfish-app-list__summary-icon {
  -webkit-mask-image: var(--nilfish-app-icon-gear);
  mask-image: var(--nilfish-app-icon-gear);
}
.nilfish-app-list__app[data-app-label="crm"] .nilfish-app-list__summary-icon {
  -webkit-mask-image: var(--nilfish-app-icon-users);
  mask-image: var(--nilfish-app-icon-users);
}
.nilfish-app-list__app[data-app-label="documents"] .nilfish-app-list__summary-icon {
  -webkit-mask-image: var(--nilfish-app-icon-doc);
  mask-image: var(--nilfish-app-icon-doc);
}
.nilfish-app-list__app[data-app-label="fitment"] .nilfish-app-list__summary-icon {
  -webkit-mask-image: var(--nilfish-app-icon-fitment);
  mask-image: var(--nilfish-app-icon-fitment);
}
.nilfish-app-list__app[data-app-label="invoicing"] .nilfish-app-list__summary-icon {
  -webkit-mask-image: var(--nilfish-app-icon-invoice);
  mask-image: var(--nilfish-app-icon-invoice);
}
.nilfish-app-list__app[data-app-label="pos"] .nilfish-app-list__summary-icon {
  -webkit-mask-image: var(--nilfish-app-icon-pos);
  mask-image: var(--nilfish-app-icon-pos);
}
.nilfish-app-list__app[data-app-label="purchasing"] .nilfish-app-list__summary-icon {
  -webkit-mask-image: var(--nilfish-app-icon-truck);
  mask-image: var(--nilfish-app-icon-truck);
}
.nilfish-app-list__app[data-app-label="time_tracking"] .nilfish-app-list__summary-icon {
  -webkit-mask-image: var(--nilfish-app-icon-clock);
  mask-image: var(--nilfish-app-icon-clock);
}
.nilfish-app-list__app[data-app-label="todos"] .nilfish-app-list__summary-icon {
  -webkit-mask-image: var(--nilfish-app-icon-check);
  mask-image: var(--nilfish-app-icon-check);
}
.nilfish-app-list__app[data-app-label="vehicle_sales"] .nilfish-app-list__summary-icon {
  -webkit-mask-image: var(--nilfish-app-icon-car);
  mask-image: var(--nilfish-app-icon-car);
}
.nilfish-app-list__app[data-app-label="webshop_sync"] .nilfish-app-list__summary-icon {
  -webkit-mask-image: var(--nilfish-app-icon-sync);
  mask-image: var(--nilfish-app-icon-sync);
}
.nilfish-app-list__app[data-app-label="workshop"] .nilfish-app-list__summary-icon {
  -webkit-mask-image: var(--nilfish-app-icon-wrench);
  mask-image: var(--nilfish-app-icon-wrench);
}
.nilfish-app-list__app[data-app-label="admin"] .nilfish-app-list__summary-icon {
  -webkit-mask-image: var(--nilfish-app-icon-cart);
  mask-image: var(--nilfish-app-icon-cart);
}

.nilfish-app-list__summary-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nilfish-app-list__summary-count {
  flex: 0 0 auto;
  min-width: 1.5rem;
  margin-left: auto;
  padding: 0.12rem 0.42rem;
  border-radius: 999px;
  background: var(--nilfish-accent, #a2c609);
  color: var(--nilfish-primary, #0d1117);
  font-size: 0.7rem;
  font-weight: 700;
  text-align: center;
  text-transform: none;
  letter-spacing: 0;
}

.nilfish-app-list__summary-chevron {
  flex: 0 0 auto;
  width: 0.65rem;
  height: 0.65rem;
  border-right: 2px solid #64748b;
  border-bottom: 2px solid #64748b;
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
  opacity: 0.85;
}

.nilfish-app-list__app[open] > .nilfish-app-list__summary .nilfish-app-list__summary-chevron {
  transform: rotate(45deg);
  margin-top: -0.15rem;
}

.nilfish-app-list__app > table {
  width: 100%;
  margin: 0 !important;
  border: 0 !important;
  border-collapse: collapse;
}

.nilfish-app-list__app > table caption {
  display: none;
}

.nilfish-app-list__app > table th,
.nilfish-app-list__app > table td {
  padding: 0.35rem 0.55rem;
  font-size: 0.8125rem;
  vertical-align: middle;
  border-top: 1px solid var(--nilfish-border, #e2e8f0);
}

.nilfish-app-list__app > table tr:first-child th,
.nilfish-app-list__app > table tr:first-child td {
  border-top: 0;
}

.nilfish-app-list__app > table th {
  width: 100%;
  font-weight: 500;
}

.nilfish-app-list__app > table th a {
  color: var(--nilfish-body, #334155);
  text-decoration: none;
}

.nilfish-app-list__app > table th a:hover,
.nilfish-app-list__app > table th a:focus {
  color: var(--nilfish-primary, #0d1117);
  text-decoration: underline;
}

.nilfish-app-list__app > table td {
  width: 1%;
  white-space: nowrap;
  text-align: right;
}

.nilfish-app-list__app > table td a {
  font-size: 0.75rem;
}

body.nilfish-admin-dashboard-page.dashboard .nilfish-app-list__app.module > h2,
body.nilfish-admin-dashboard-page.dashboard .nilfish-app-list__app.module caption {
  display: none;
}

/* Global nav-sidebar uses the same accordion. */
#nav-sidebar.nilfish-nav-sidebar {
  padding: 0.65rem 0.55rem 1rem;
  box-sizing: border-box;
}

#nav-sidebar.nilfish-nav-sidebar #nav-filter[hidden] {
  display: none !important;
}

#nav-sidebar .nilfish-app-list__toolbar {
  position: static;
  background: transparent;
}

#nav-sidebar .nilfish-app-list__summary {
  font-size: 0.72rem;
  padding: 0.45rem 0.55rem;
}

#nav-sidebar .nilfish-app-list__app > table th,
#nav-sidebar .nilfish-app-list__app > table td {
  padding: 0.28rem 0.45rem;
  font-size: 0.78rem;
}

#nav-sidebar .nilfish-app-list__app > table td a.addlink {
  /* Keep compact text links in sidebar (icons optional via nilfish_admin.css). */
  padding-left: 0;
}
