:root {
  --hermes-blue: #0099da;
  --hermes-blue-dark: #0073b3;
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 70px;
  --glass-bg: rgba(255, 255, 255, 0.65);
  --glass-border: rgba(255, 255, 255, 0.85);
  --glass-shadow: 0 12px 35px 0 rgba(0, 115, 179, 0.15);
  --text-main: #0c2a3e;
  --text-sub: #4b6b82;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: radial-gradient(circle at 5% 5%, #e0f2fe 0%, #b9e6fe 45%, #e0f7fa 100%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* Shared Glassmorphism Styling */
.glass-panel,
.glass-popover,
.modal-glass {
  background: var(--glass-bg) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border) !important;
  box-shadow: var(--glass-shadow) !important;
  border-radius: 1.25rem;
}

/* Sidebar */
.sidebar-glass {
  width: var(--sidebar-width);
  height: calc(100vh - 2rem);
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 120;
  padding: 1.5rem 0.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1), padding 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.sidebar-glass.collapsed {
  width: var(--sidebar-collapsed-width);
  padding: 1.5rem 0.5rem;
}

.brand-logo {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--hermes-blue-dark);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 0.5rem;
  white-space: nowrap;
}

.sidebar-glass.collapsed .brand-logo { justify-content: center; padding: 0; }
.sidebar-glass.collapsed .brand-logo span { display: none; }
.brand-logo i { font-size: 1.5rem; }

.nav-list {
  list-style: none;
  padding: 0;
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.nav-link-custom {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  color: var(--text-main);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 0.75rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.sidebar-glass.collapsed .nav-link-custom { justify-content: center; padding: 0.75rem 0; }
.sidebar-glass.collapsed .nav-link-custom span { display: none; }

.nav-link-custom i {
  font-size: 1.2rem;
  min-width: 1.5rem;
  text-align: center;
}

.nav-link-custom:hover, .nav-link-custom.active {
  background: rgba(0, 153, 218, 0.15);
  color: var(--hermes-blue-dark);
}

/* Main Workspace */
.main-wrapper {
  flex: 1;
  margin-left: calc(var(--sidebar-width) + 2rem);
  padding: 1rem 1.5rem 2rem 0.5rem;
  transition: margin-left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-wrapper.expanded {
  margin-left: calc(var(--sidebar-collapsed-width) + 2rem);
}

/* Top Bar */
.top-bar {
  padding: 0.85rem 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.toggle-btn {
  background: rgba(0, 153, 218, 0.12);
  border: 1px solid rgba(0, 153, 218, 0.25);
  color: var(--hermes-blue-dark);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.toggle-btn:hover { background: var(--hermes-blue); color: #fff; }

.search-field { position: relative; width: 320px; }

.search-field input {
  width: 100%;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(0, 153, 218, 0.25);
  padding: 0.5rem 1rem 0.5rem 2.5rem;
  border-radius: 2rem;
  outline: none;
  font-size: 0.875rem;
  font-weight: 500;
}

.search-field i {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--hermes-blue);
}

/* Workspace Grid & Cards */
.workspace-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.5rem;
}

@media (max-width: 1100px) {
  .workspace-grid { grid-template-columns: 1fr; }
}

.card-deck {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.parcel-card {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  cursor: pointer;
}

.parcel-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0, 153, 218, 0.22) !important;
}

.parcel-card .card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.parcel-card .tracking-id {
  font-weight: 800;
  font-size: 1rem;
  color: var(--hermes-blue-dark);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.parcel-info-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  margin-bottom: 0.35rem;
}

.parcel-info-row .lbl { color: var(--text-sub); }
.parcel-info-row .val { font-weight: 700; color: var(--text-main); }

/* Badges */
.status-pill {
  padding: 0.25rem 0.75rem;
  border-radius: 2rem;
  font-size: 0.725rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.status-erledigt {
  background: rgba(16, 185, 129, 0.15);
  color: #065f46;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-offen {
  background: rgba(245, 158, 11, 0.15);
  color: #92400e;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.regress-yes {
  background: rgba(239, 68, 68, 0.15);
  color: #991b1b;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.regress-no {
  background: rgba(148, 163, 184, 0.15);
  color: #475569;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

/* Suggestions Panel */
.suggestions-panel {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: fit-content;
}

.suggestions-panel h6 {
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--hermes-blue-dark);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.suggestion-item {
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(0, 153, 218, 0.18);
  border-radius: 0.85rem;
  padding: 0.85rem;
  transition: all 0.2s ease;
  cursor: pointer;
}

.suggestion-item:hover {
  background: rgba(255, 255, 255, 0.85);
  border-color: var(--hermes-blue);
  transform: translateX(3px);
}

.suggestion-item .title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--hermes-blue-dark);
}

.suggestion-item .desc {
  font-size: 0.775rem;
  color: var(--text-sub);
  margin-top: 0.2rem;
}

/* Popovers */
.glass-popover {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  width: 250px;
  padding: 1.25rem;
  z-index: 150;
  display: none;
  animation: popupFade 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.glass-popover.active { display: block; }

.glass-popover-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.glass-popover-item:hover { background: rgba(0, 153, 218, 0.12); }
.glass-popover-item input[type="checkbox"] { accent-color: var(--hermes-blue); }

/* Modal Overlay & Card */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(12, 42, 62, 0.35);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active { display: flex; }

.modal-glass {
  width: 92%;
  max-width: 650px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 2rem;
  animation: popupFade 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popupFade {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem 1.5rem;
  background: rgba(0, 153, 218, 0.08);
  padding: 1.25rem;
  border-radius: 1rem;
  border: 1px solid rgba(0, 153, 218, 0.15);
  margin: 1.25rem 0;
}

.modal-grid .lbl { font-size: 0.75rem; color: var(--text-sub); }
.modal-grid .val { font-size: 0.875rem; font-weight: 700; color: var(--text-main); }

.filter-btn {
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(0, 153, 218, 0.25);
  color: var(--hermes-blue-dark);
  padding: 0.45rem 1.1rem;
  border-radius: 2rem;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn:hover, .filter-btn.active {
  background: var(--hermes-blue);
  color: #fff;
}

/* Dropdown im Filter-Look */
select.filter-btn, .filter-select {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(0, 153, 218, 0.25);
  color: var(--hermes-blue-dark);
  padding: 0.45rem 2rem 0.45rem 1.1rem;
  border-radius: 2rem;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%230073b3' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
}
select.filter-btn:hover, .filter-select:hover {
  border-color: var(--hermes-blue);
  background-color: rgba(255, 255, 255, 0.95);
  color: var(--hermes-blue-dark);
}

/* Formular im Modal */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem 1.25rem;
  margin: 1.25rem 0;
}

.form-grid label {
  font-size: 0.75rem;
  color: var(--text-sub);
  font-weight: 600;
  display: block;
  margin-bottom: 0.2rem;
}

.form-grid input, .form-grid select {
  width: 100%;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 153, 218, 0.25);
  border-radius: 0.6rem;
  padding: 0.45rem 0.7rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  outline: none;
}

.form-grid input:focus, .form-grid select:focus {
  border-color: var(--hermes-blue);
  box-shadow: 0 0 0 3px rgba(0, 153, 218, 0.15);
}

/* Sektionstitel & Tabellenansichten */
.view-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--hermes-blue-dark);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.list-panel { padding: 1.25rem; }

.data-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.data-table th {
  text-align: left;
  color: var(--text-sub);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid rgba(0, 153, 218, 0.2);
}
.data-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid rgba(0, 153, 218, 0.08);
  font-weight: 600;
}
.data-table tr:last-child td { border-bottom: none; }

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--hermes-blue-dark);
  padding: 0.25rem 0.4rem;
  border-radius: 0.4rem;
}
.icon-btn:hover { background: rgba(0, 153, 218, 0.12); }
.icon-btn.danger { color: #b91c1c; }
.icon-btn.danger:hover { background: rgba(239, 68, 68, 0.12); }

.empty-state {
  text-align: center;
  color: var(--text-sub);
  padding: 3rem 1rem;
  font-weight: 600;
}

/* Toast */
.toast-note {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 300;
  padding: 0.75rem 1.25rem;
  border-radius: 0.85rem;
  font-weight: 700;
  font-size: 0.85rem;
  display: none;
}
.toast-note.active { display: block; animation: toastIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); }
.toast-note.ok { color: #065f46; }
.toast-note.err { color: #991b1b; }

/* ===================== Pagination ===================== */

.pager {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  justify-content: flex-end;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.pager .info {
  font-size: 0.78rem;
  color: var(--text-sub);
  font-weight: 600;
  margin-right: auto;
}

.pager button {
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(0, 153, 218, 0.25);
  color: var(--hermes-blue-dark);
  min-width: 34px;
  height: 34px;
  padding: 0 0.5rem;
  border-radius: 0.6rem;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pager button:hover:not(:disabled) {
  background: var(--hermes-blue);
  border-color: var(--hermes-blue);
  color: #fff;
  transform: translateY(-1px);
}

.pager button.current {
  background: var(--hermes-blue);
  border-color: var(--hermes-blue);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 153, 218, 0.35);
}

.pager button:disabled { opacity: 0.4; cursor: default; }

/* ===================== Footer ===================== */

.app-footer {
  text-align: center;
  padding: 1.5rem 1rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-sub);
}

.app-footer a {
  color: var(--hermes-blue-dark);
  font-weight: 700;
  text-decoration: none;
  transition: color 0.2s ease;
}

.app-footer a:hover {
  color: var(--hermes-blue);
  text-decoration: underline;
}

/* ===================== Effekte & Animationen ===================== */

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}

.parcel-card { animation: fadeInUp 0.45s ease both; }

.data-table tbody tr { transition: background 0.15s ease; }
.data-table tbody tr:hover { background: rgba(0, 153, 218, 0.07); }

.filter-btn, .toggle-btn, .icon-btn, .login-btn {
  transition: all 0.2s ease;
}
.filter-btn:active, .toggle-btn:active, .icon-btn:active { transform: scale(0.94); }

.nav-link-custom { position: relative; }
.nav-link-custom.active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%;
  height: 60%; width: 3px;
  border-radius: 2px;
  background: var(--hermes-blue);
}

.modal-glass { scrollbar-width: thin; }

input:focus, select:focus {
  border-color: var(--hermes-blue) !important;
  box-shadow: 0 0 0 3px rgba(0, 153, 218, 0.15) !important;
  outline: none;
}

/* ===================== Responsive ===================== */

@media (max-width: 900px) {
  .main-wrapper {
    margin-left: calc(var(--sidebar-collapsed-width) + 1.5rem);
    padding: 1rem 1rem 2rem 0;
  }
  .main-wrapper.expanded {
    margin-left: calc(var(--sidebar-collapsed-width) + 1.5rem);
  }
  .search-field { width: 220px; }
}

@media (max-width: 600px) {
  .sidebar-glass {
    height: calc(100vh - 1rem);
    top: 0.5rem; left: 0.5rem;
  }
  .main-wrapper {
    margin-left: calc(var(--sidebar-collapsed-width) + 1rem);
    padding: 0.5rem 0.5rem 1.5rem 0;
  }
  .top-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
  }
  .top-bar > div { flex-wrap: wrap; }
  .search-field { width: 100%; }
  .form-grid { grid-template-columns: 1fr !important; }
  .modal-glass { padding: 1.25rem; max-height: 94vh; }
  .modal-grid { grid-template-columns: 1fr; }
  .card-deck { grid-template-columns: 1fr; }
  .data-table { font-size: 0.78rem; }
  .data-table th, .data-table td { padding: 0.45rem 0.5rem; }
  .list-panel { padding: 0.85rem; }
}
