/* =============================
   PartnerPlus CRM – Layout
   ============================= */

body {
  margin:0; display:grid;
  grid-template-areas:
    "header header"
    "sidebar content"
    "footer footer";
  grid-template-columns:260px 1fr;
  grid-template-rows:60px 1fr 40px;
  min-height:100vh;
  background:var(--vk-gray);
}

/* HEADER */
.app-header {
  grid-area:header;
  background:var(--vk-black);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 1.2rem;
  box-shadow:0 2px 8px rgba(0,0,0,.25);
}
.app-header img { height:34px; }
.app-header .user { font-size:14px; }
.app-header a { color:var(--vk-gold); text-decoration:none; }
.app-header a:hover { text-decoration:underline; }

/* SIDEBAR */
.app-sidebar {
  grid-area:sidebar;
  background:var(--vk-dark);
  color:#fff;
  padding:1.4rem 1rem;
  border-right:2px solid var(--vk-gold);
}
.app-sidebar nav ul { list-style:none; padding:0; margin:0; }
.app-sidebar nav li { margin-bottom:.8rem; }
.app-sidebar nav a {
  display:block;
  padding:.7rem .9rem;
  color:#ddd;
  text-decoration:none;
  border-radius:8px;
  transition:.2s;
}
.app-sidebar nav a:hover,
.app-sidebar nav a.active {
  background:var(--vk-gold);
  color:#fff;
}

/* CONTENT */
.app-content {
  grid-area:content;
  padding:2rem;
}

/* FOOTER */
.app-footer {
  grid-area:footer;
  background:var(--vk-black);
  color:#ccc;
  text-align:center;
  font-size:13px;
  padding:.6rem;
}

/* MOBILE */
.sidebar-toggle {
  position:fixed;
  bottom:60px; right:20px;
  background:var(--vk-gold);
  color:#fff;
  border:none;
  border-radius:50%;
  width:46px; height:46px;
  display:none;
  box-shadow:0 4px 10px rgba(0,0,0,.2);
  cursor:pointer;
}
@media(max-width:900px){
  body {
    grid-template-areas:
      "header"
      "content"
      "footer";
    grid-template-columns:1fr;
  }
  .app-sidebar {
    position:fixed;
    left:-290px;
    top:0;
    bottom:0;
    width:240px;
    transition:.3s;
    z-index:999;
  }
  .app-sidebar.open { left:0; }
  .sidebar-toggle { display:block; }
}

/*  Icons */
/* Einheitliche Darstellung für alle Icons */
img[class^="icon-"], img[class*=" icon-"] {
  display: inline-block;
  vertical-align: middle;
  object-fit: contain;
  width: 1em;    /* Basisgröße = Schriftgröße (überschreibbar durch Klassengröße) */
  height: 1em;
  max-width: none;
}

/* Feste Größenklassen */
.icon-xs { width: 12px !important; height: 12px !important; }
.icon-sm { width: 16px !important; height: 16px !important; }
.icon-md { width: 20px !important; height: 20px !important; }
.icon-lg { width: 28px !important; height: 28px !important; }
.icon-xl { width: 36px !important; height: 36px !important; }

/* Optional: wenn du willst, dass Icons nie größer als Container werden */
.icon-fluid { width: 100%; height: auto; }

.menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Menü-Button oben im Header */
.menu-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px;
  margin-right: 12px;
  transition: opacity 0.2s;
}

.menu-btn:hover {
  opacity: 0.7;
}

/* --- Popup Message --- ALT EVTL. LÖSCHEN - NEU: TOAST*/
.popup-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.55);
    display: flex;
    justify-content: center;
    align-items: center;
	z-index: 99999 !important;
    backdrop-filter: blur(3px);
}

.popup-box {
    background: #ffffff;
    color: #222;
    padding: 24px 30px;
    border-radius: 14px;
    max-width: 380px;
    width: 85%;
    text-align: center;
    box-shadow: 0 5px 22px rgba(0,0,0,0.3);
    animation: popupFadeIn .25s ease;
	position: relative;
    z-index: 100000 !important;
}

.popup-box.success {
    border-left: 6px solid #28a745;
}

.popup-box.error {
    border-left: 6px solid #dc3545;
}

.popup-close {
    margin-top: 18px;
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    background: var(--vk-gold);
    color: #fff;
    font-weight: bold;
    cursor: pointer;
}

@keyframes popupFadeIn {
    from { transform: scale(.82); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}


/* =============================================
   Modernes Toast-Popup (oben zentriert)
   ============================================= */

.toast {
    position: fixed;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    background: #43a047;
    color: #fff;
    padding: 20px 36px;
    border-radius: 16px;
    box-shadow: 0 8px 22px rgba(0,0,0,0.25);
    font-size: 17px;
    font-weight: 600;
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s ease;
    min-width: 340px;
    text-align: center;
}

/* Fehler-Toast */
.toast.error {
    background: #d9534f;
}

/* Sichtbar */
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Combo Wrapper muss positioniert sein */
#contactCombo {
    position: relative;
}

/* Dropdown zuverlässig anzeigen */
#contactDropdown {
    position: absolute;
    top: 44px;
    left: 0;
    width: 100%;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 99999; /* sehr hoch setzen */
    display: none;
}

/* Einträge */
#contactDropdown div {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

#contactDropdown div:hover {
    background: #f0f0f0;
}
