.app-container {
    display: grid;
    grid-template-columns: 260px 1fr;
    grid-template-rows: 60px 1fr;
    grid-template-areas:
                "topbar topbar"
                "sidebar main";
    height: 100vh;
    transition: grid-template-columns 0.2s ease;
}

/* Left Sidebar */
.sidebar {
    grid-area: sidebar;
    background: white;
    border-right: 1px solid #e2e8f0;
    overflow-y: auto;
    width: 260px;
    transition: width 0.2s ease;
    flex-shrink: 0;
    position: relative;
    z-index: 100;
}

/* Toggle */
#sidebar-toggle {
  position: relative;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  margin: 0.5rem 0.5rem 0;
  display: flex;
  justify-self: end;
}

.sidebar-toggle-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.icon-expanded {
  opacity: 1;
  transform: translateX(0);
}

.icon-collapsed {
  opacity: 0;
  transform: translateX(-6px);
}

.sidebar.sidebar-collapsed .icon-expanded {
  opacity: 0;
  transform: translateX(6px);
}

.sidebar.sidebar-collapsed .icon-collapsed {
  opacity: 1;
  transform: translateX(0);
}

.sidebar .nav-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar-header {
  padding: 0 20px;
  border-bottom: 1px solid #e2e8f0;
  height: var(--navbar-height);
}

/* Collapsed sidebar */
.sidebar.sidebar-collapsed {
  width: 70px;
  position: relative;
  overflow: visible;
}

.sidebar .nav-item.dropup .dropdown-menu {
  z-index: 1050;
}

.sidebar.sidebar-collapsed .nav-item {
  display: flex;
  justify-content: center;
  position: relative;
}

.sidebar.sidebar-collapsed .me-3 {
  margin-right: 0 !important;
}

.sidebar.sidebar-collapsed .gap-4 {
  gap: 0 !important;
}

.sidebar.sidebar-collapsed .nav-item .label,
.sidebar.sidebar-collapsed .nav-item .nav-badge,
.sidebar.sidebar-collapsed .nav-section-title {
  display: none;
}

.sidebar.sidebar-collapsed .nav-item .nav-item-icon {
  margin-right: 0;
}

.sidebar.sidebar-collapsed .nav-section {
  border-bottom: 1px solid var(--aradoo-light-grey);
}

.sidebar.sidebar-collapsed .dropdown-toggle {
  justify-content: center!important;
  border: none;
}

.sidebar.sidebar-collapsed .nav-item {
  padding: 12px;
}

.sidebar.sidebar-collapsed .nav-item.dropup {
  padding: 12px;
}

/* Tooltip bij hover */
.sidebar.sidebar-collapsed .nav-item::after {
  content: attr(title);
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  background: #1f2937;
  color: white;
  padding: 4px 8px;
  font-size: 13px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  margin-left: 6px;
}

.sidebar.sidebar-collapsed .nav-item:hover::after {
  opacity: 1;
}

.app-container.sidebar-collapsed {
  grid-template-columns: 70px 1fr;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo::before {
    content: "";
    width: 20px;
    height: 20px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 21h18"/><path d="M5 21V7l8-4v18"/><path d="M19 21V11l-6-4"/></svg>') no-repeat center;
    background-size: contain;
}

.nav-section-title {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 20px 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #64748b;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.nav-item:hover:not(.dropup, .active) {
    background: var(--aradoo-light-grey);
    color: var(--aradoo-black);
}

.nav-item.active {
    background: #f0f9ff;
    color: #0f172a;
    border-right: 3px solid var(--primary);
}

.nav-item-icon {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.nav-badge {
    background: var(--primary);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: auto;
}

.nav-badge.blue,
.nav-badge.orange,
.nav-badge.gray {
    background: #03acff;
}

/* Topbar */
.topbar {
    grid-area: topbar;
    background: white;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 32px;
    height: var(--navbar-height)
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #64748b;
}

.breadcrumb-current {
    color: #0f172a;
    font-weight: 600;
}

.search-bar {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 8px 36px 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f8fafc;
    font-size: 14px;
}

.search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.notification-icon {
    position: relative;
    background: none;
    border: none;
    font-size: 18px;
    color: #64748b;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.notification-icon:hover {
    background: #f8fafc;
}

.notification-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 6px;
    height: 6px;
    background: #ef4444;
    border-radius: 50%;
}

.profile-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.profile-menu:hover {
    background: #f8fafc;
}

.profile-avatar {
    width: 32px;
    height: 32px;
    background: #3b82f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.profile-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.profile-name {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.2;
}

.profile-role {
    font-size: 12px;
    color: #64748b;
    line-height: 1.2;
}

/* Drag-drop states for nav */
tr.dragging {
  opacity: .6;
  cursor: grabbing;
  user-select: none;
}

.nav-item.drop-hover {
  outline: 2px dashed var(--bs-primary);
  outline-offset: 4px;
  border-radius: 8px;
  background: rgba(13,110,253,.06);
}

.nav-item.pulse {
  animation: dnd-pulse .25s ease;
}

@keyframes dnd-pulse {
  from { transform: scale(1.00); }
  to   { transform: scale(1.02); }
}

.nav-item {
  cursor: pointer;
  transition: background-color .15s ease, transform .15s ease, outline-color .15s ease;
}

/* Small sidebar layout helpers */
.small-sidebar {
    padding: 0 !important;
    position: static;
}
.small-sidebar > .page-header,
.small-sidebar * .search-bar,
.small-sidebar * .sidebar-header,
.small-sidebar > div.importexportfilters {
    display: none;
}

.small-sidebar > .card {
    max-width: 300px;
    min-width: 300px;
    border-radius: 0;
    border-top: 0;
    border-left: 0;
    height: 100%;
}

.small-sidebar * .small-sidebar-dnone {
    display: none!important;
}

.small-sidebar * .tc-summary {
    display: none;
}
