/* Αριστερό μενού — Fluent / Διαχείριση Παραγγελιών (reference) */

.app-shell {
  --sidebar-w: 17.5rem;
}

.app-shell.sidebar-collapsed {
  --sidebar-w: 4.75rem;
}

.app-sidebar {
  width: var(--sidebar-w);
  transition: width 0.22s ease;
  background: linear-gradient(180deg, #f4f6fb 0%, #eef1f8 100%);
  border-right: 1px solid rgba(192, 199, 212, 0.45);
  box-shadow: 4px 0 20px rgba(15, 23, 42, 0.04);
  --nav-icon-slot: 2rem;
  --nav-trail-slot: 1.375rem;
  --nav-row-h: 2.5rem;
  --nav-subnav-indent: calc(0.875rem + var(--nav-icon-slot) + 0.625rem);
}

.app-sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1rem 0.75rem 0.85rem;
  min-height: 0;
}

/* Brand card — όπως στο reference zip */
.app-sidebar-brand-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  margin-bottom: 0.65rem;
  border-radius: 0.75rem;
  background: rgba(224, 226, 234, 0.35);
  border: 1px solid rgba(192, 199, 212, 0.25);
}

.app-sidebar-brand-mark {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  background: var(--brand-primary, #005faa);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.app-sidebar-brand-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

.app-sidebar-brand-text {
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.app-sidebar-brand-kicker {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--brand-primary, #005faa);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-sidebar-brand-sub {
  margin: 0.2rem 0 0;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #404752;
  opacity: 0.72;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-sidebar-collapse-btn {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.7);
  color: #404752;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.app-sidebar-collapse-btn:hover {
  background: #fff;
  color: #005faa;
}

.app-sidebar-nav-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0.1rem;
}

.app-sidebar-section-label {
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #6b7280;
  padding: 0.75rem 0.5rem 0.3rem;
  margin: 0;
  pointer-events: none;
  user-select: none;
}

.app-sidebar-section-label:first-child {
  padding-top: 0.15rem;
}

.app-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.sidebar-nav-row {
  display: grid;
  grid-template-columns: 0 minmax(0, 1fr);
  align-items: stretch;
  min-width: 0;
  transition: grid-template-columns 0.15s ease;
}

.sidebar-nav-row:hover,
#sidebarNav.is-reordering .sidebar-nav-row {
  grid-template-columns: 0.875rem minmax(0, 1fr);
}

.sidebar-nav-row > a,
.sidebar-nav-row > details {
  grid-column: 2;
  min-width: 0;
}

.sidebar-drag-handle {
  grid-column: 1;
  flex-shrink: 0;
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 0.875rem;
  min-height: var(--nav-row-h);
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: #9ca3af;
  cursor: grab;
  opacity: 0;
  overflow: hidden;
  transition: opacity 0.15s ease, color 0.15s ease;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.sidebar-drag-handle .material-symbols-outlined {
  font-size: 1rem;
}

.sidebar-nav-row:hover .sidebar-drag-handle,
#sidebarNav.is-reordering .sidebar-drag-handle {
  opacity: 0.55;
}

.sidebar-drag-handle:hover {
  opacity: 1 !important;
  color: #005faa;
}

.sidebar-drag-handle:active {
  cursor: grabbing;
}

.app-shell.sidebar-collapsed .sidebar-drag-handle {
  display: none;
}

/* Nav items — 3-column grid: icon | label | chevron/spacer */
.app-sidebar-nav-item,
.app-sidebar-link {
  position: relative;
  display: grid;
  grid-template-columns: var(--nav-icon-slot) minmax(0, 1fr) var(--nav-trail-slot);
  align-items: center;
  column-gap: 0.625rem;
  min-height: var(--nav-row-h);
  padding: 0 0.5rem 0 0.375rem;
  border-radius: 0.5rem;
  text-decoration: none;
  color: #404752;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: none;
  background: transparent;
  transition: background 0.15s ease, color 0.15s ease;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
}

.app-sidebar-nav-item:not(.app-sidebar-group-toggle)::after {
  content: "";
  grid-column: 3;
  width: var(--nav-trail-slot);
  height: 1px;
}

.app-sidebar-nav-item:hover,
.app-sidebar-link:hover {
  background: rgba(224, 226, 234, 0.85);
  color: #181c22;
}

.app-sidebar-nav-item.is-active,
.app-sidebar-link.is-active {
  background: rgba(0, 95, 170, 0.1);
  color: #005faa;
}

.app-sidebar-nav-item.is-active::before,
.app-sidebar-link.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18%;
  bottom: 18%;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: #005faa;
}

.app-sidebar-nav-icon {
  grid-column: 1;
  width: var(--nav-icon-slot);
  height: var(--nav-icon-slot);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.3125rem;
  line-height: 1;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}

.app-sidebar-nav-label,
.app-sidebar-link-label {
  grid-column: 2;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

/* Υποστήριξη */
.app-sidebar-group {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.app-sidebar-group-toggle {
  width: 100%;
  text-align: left;
  list-style: none;
  padding: 0 0.5rem 0 0.375rem;
  cursor: pointer;
}

.app-sidebar-group-toggle::-webkit-details-marker {
  display: none;
}

.app-sidebar-group > summary {
  list-style: none;
}

.app-sidebar-chevron {
  grid-column: 3;
  justify-self: center;
  align-self: center;
  margin: 0;
  font-size: 1.125rem;
  line-height: 1;
  opacity: 0.45;
  transition: transform 0.2s ease, opacity 0.15s ease;
}

.app-sidebar-group-toggle:hover .app-sidebar-chevron {
  opacity: 0.65;
}

.app-sidebar-group.is-expanded .app-sidebar-chevron,
.app-sidebar-group[open] .app-sidebar-chevron {
  transform: rotate(180deg);
}

.app-sidebar-subnav {
  display: none;
  flex-direction: column;
  gap: 0.0625rem;
  margin: 0.125rem 0 0.25rem;
  padding: 0.125rem 0 0.125rem var(--nav-subnav-indent);
  border-left: 2px solid rgba(0, 95, 170, 0.14);
  position: relative;
  z-index: 2;
}

.app-sidebar-group.is-expanded .app-sidebar-subnav,
.app-sidebar-group[open] .app-sidebar-subnav {
  display: flex;
}

.app-sidebar-sublink {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2rem;
  padding: 0.375rem 0.625rem;
  border-radius: 0.45rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #5c6370;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
  position: relative;
  z-index: 1;
  pointer-events: auto;
  cursor: pointer;
}

.app-sidebar-sublink:hover {
  background: #e0e2ea;
  color: #005faa;
}

.app-sidebar-sublink.is-active {
  background: rgba(0, 95, 170, 0.1);
  color: #005faa;
  font-weight: 700;
}

.app-sidebar-sublink-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.45;
  flex-shrink: 0;
}

.app-sidebar-sublink.is-active .app-sidebar-sublink-dot {
  opacity: 1;
}

.app-sidebar-hint {
  font-size: 0.625rem;
  color: #9ca3af;
  text-align: center;
  padding: 0.5rem 0.35rem 0;
  line-height: 1.35;
}

/* CTA — Νέο σέρβις */
.app-sidebar-cta {
  padding: 0.65rem 0.25rem 0.5rem;
  flex-shrink: 0;
}

.app-sidebar-cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0.65rem 1rem;
  border-radius: 0.5rem;
  background: #005faa;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 95, 170, 0.28);
  transition: background 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}

.app-sidebar-cta-btn:hover {
  background: #0078d4;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 95, 170, 0.32);
}

/* Footer */
.app-sidebar-footer {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(192, 199, 212, 0.45);
  flex-shrink: 0;
}

.app-sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.25rem;
  min-width: 0;
}

.app-sidebar-user-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.65rem;
  background: linear-gradient(145deg, #d3e3ff, #a3c9ff);
  color: #004883;
  font-size: 0.7rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.app-sidebar-user-meta {
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.app-sidebar-user-meta p {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #181c22;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-sidebar-user-meta span {
  font-size: 0.625rem;
  color: #6b7280;
}

.app-sidebar-footer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.35rem;
  margin-top: 0.4rem;
}

.app-sidebar-footer-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.28rem 0.5rem;
  border-radius: 0.4rem;
  border: 1px solid rgba(192, 199, 212, 0.5);
  background: rgba(255, 255, 255, 0.65);
  color: #404752;
  text-decoration: none;
  font-size: 0.625rem;
  font-weight: 600;
  line-height: 1.2;
  transition: background 0.15s ease, color 0.15s ease;
}

.app-sidebar-footer-btn:hover {
  background: #fff;
  color: #005faa;
}

.app-sidebar-footer-btn--danger:hover {
  color: #ba1a1a;
  background: #ffdad6;
}

/* Collapsed */
.app-shell.sidebar-collapsed .app-sidebar-brand-text,
.app-shell.sidebar-collapsed .app-sidebar-nav-label,
.app-shell.sidebar-collapsed .app-sidebar-link-label,
.app-shell.sidebar-collapsed .app-sidebar-section-label,
.app-shell.sidebar-collapsed .app-sidebar-user-meta,
.app-shell.sidebar-collapsed .app-sidebar-hint,
.app-shell.sidebar-collapsed .app-sidebar-cta,
.app-shell.sidebar-collapsed .app-sidebar-footer-btn span:not(.material-symbols-outlined),
.app-shell.sidebar-collapsed .app-sidebar-chevron,
.app-shell.sidebar-collapsed .app-sidebar-subnav {
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  pointer-events: none;
  position: absolute;
  width: 0;
  height: 0;
}

.app-shell.sidebar-collapsed .app-sidebar-brand-card {
  justify-content: center;
  padding: 0.65rem 0.35rem;
}

.app-shell.sidebar-collapsed .app-sidebar-collapse-btn {
  position: absolute;
  right: 0.25rem;
  top: 0.25rem;
}

.app-shell.sidebar-collapsed .app-sidebar-nav-item,
.app-shell.sidebar-collapsed .app-sidebar-link {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.5rem;
  min-height: var(--nav-row-h);
}

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

.app-shell.sidebar-collapsed .app-sidebar-nav-icon {
  width: auto;
  height: auto;
}

.app-shell.sidebar-collapsed .app-sidebar-group-toggle {
  justify-content: center;
}

.app-shell.sidebar-collapsed .app-sidebar-footer-actions {
  flex-direction: column;
}

.app-shell.sidebar-collapsed .app-sidebar-collapse-btn .material-symbols-outlined {
  transform: rotate(180deg);
}

/* Flyout υπομενού όταν collapsed */
.app-shell.sidebar-collapsed .app-sidebar-group[open] {
  position: relative;
}

.app-shell.sidebar-collapsed .app-sidebar-group[open] .app-sidebar-subnav {
  position: fixed;
  left: var(--sidebar-w);
  top: 0;
  width: 11.5rem;
  margin: 0;
  padding: 0.5rem;
  border-left: none;
  border-radius: 0.5rem;
  background: #fff;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.14);
  opacity: 1;
  max-width: none;
  height: auto;
  overflow: visible;
  pointer-events: auto;
  z-index: 12050;
}

.app-sidebar-sublink .material-symbols-outlined.app-sidebar-sublink-icon {
  font-size: 0.875rem;
  width: 0.875rem;
  height: 0.875rem;
  line-height: 1;
  opacity: 0.72;
  flex-shrink: 0;
}

.app-sidebar-sublink.is-active .material-symbols-outlined.app-sidebar-sublink-icon {
  opacity: 1;
}

/* Κλικ στο εικονίδιο ομάδας όταν το sidebar είναι στενό */
.app-shell.sidebar-collapsed .app-sidebar-group > summary {
  cursor: pointer;
}

/* Drag reorder */
#sidebarNav.is-reordering {
  user-select: none;
}

#sidebarNav .sidebar-nav-row.is-dragging {
  opacity: 0.65;
  z-index: 2;
}

#sidebarNav .sidebar-nav-row.is-dragging > a,
#sidebarNav .sidebar-nav-row.is-dragging > details {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

#sidebarNav .sidebar-nav-row.is-drag-over > a,
#sidebarNav .sidebar-nav-row.is-drag-over > details {
  outline: 2px dashed rgba(0, 95, 170, 0.4);
  outline-offset: 1px;
}

@media (min-width: 768px) {
  .app-main,
  main.app-main,
  main.md\:ml-sidebar_width {
    margin-left: var(--sidebar-w) !important;
    transition: margin-left 0.22s ease;
  }
}
