/* ============ DASHBOARD CORE ============= */
/* Basis für ALLE Dashboards (Klient & Händler): Layout, Header, Sidebar, Footer, Widgets, Responsive */
/* Keine Bereichs-spezifischen Anpassungen! */

/* Reset & Foundation */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  width: 100%;
  box-sizing: border-box;
  background: #f8fbff;
}
*, *:before, *:after {
  box-sizing: inherit;
}

/* Layout-Grundstruktur */
.ad-dashboard-root {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}


/* HEADER */
.ad-dashboard-headerbar {
    width: 100%;
    background: transparent;
    /* Weniger Abstand oben/unten! */
    padding: 0.6em 0 0.3em 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 1600;
    box-sizing: border-box;
}
.ad-headerbar-left {
    display: flex;
    align-items: center;
}
/* HEADER */
.ad-dashboard-headerbar {
  width: 100%;
  padding: 0.6em 0 0.3em 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ad-header-logo-img {
  max-height: 180px;
  max-width: 220px;
  object-fit: contain;

}

/* Hamburger Menü */
.ad-burger-menu-btn {
    display: none;
    width: 46px;
    height: 46px;
    background: #fff;
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(60,80,110,0.09);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    margin-left: 1em;
    position: static;
}
.ad-burger-menu-btn span {
    display: block;
    width: 28px;
    height: 4px;
    border-radius: 2px;
    background: #273b56;
    transition: all 0.2s;
}
@media (max-width: 950px) {
    .ad-burger-menu-btn {
        display: flex;
        position: absolute;
        top: 18px;
        right: 30px;
        z-index: 1102;
        margin-left: 0;
        margin-right: 0;
    }
}

/* ICONBAR */
.ad-dashboard-iconbar-outer {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto 0 auto;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}
.ad-dashboard-iconbar-inner {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-right: 1.5em;
}
.ad-dashboard-icons {
    display: flex;
    align-items: center;
    gap: 1.5em;
}
.ad-header-icon,
.ad-sidebar-nav a svg,
.ad-sidebar-settings svg,
.ad-logout-link svg {
    width: 32px;
    height: 32px;
    min-width: 24px;
    min-height: 24px;
    max-width: 38px;
    max-height: 38px;
    display: inline-block;
    vertical-align: middle;
    fill: #222a3c;
    stroke: #222a3c;
    stroke-width: 1.5;
    transition: fill 0.18s, stroke 0.18s;
    margin-right: 0.3em;
}
.ad-header-icon:hover svg,
.ad-sidebar-nav a:hover svg,
.ad-sidebar-nav a.active svg,
.ad-sidebar-settings:hover svg,
.ad-logout-link:hover svg {
    fill: #2787c6;
    stroke: #2787c6;
}
@media (max-width: 700px) {
    .ad-header-icon,
    .ad-sidebar-nav a svg,
    .ad-sidebar-settings svg,
    .ad-logout-link svg {
        width: 26px;
        height: 26px;
        min-width: 20px;
        min-height: 20px;
        max-width: 30px;
        max-height: 30px;
    }
    .ad-dashboard-icons {
        gap: 1em;
    }
}

/* WRAPPER: Sidebar + Content */
.ad-dashboard-wrapper {
    flex: 1 1 auto;
    display: flex;
    flex-direction: row;
    max-width: 1600px;
	min-width: 1600;
    width: 100%;
    margin: 1.2rem auto 1rem auto; /* Weniger Abstand oben/unten */
    min-height: 60vh;
    gap: 2.5rem;
    position: relative;
    background: transparent;
}
@media (max-width: 1600px) {
    .ad-dashboard-wrapper {
        max-width: 99vw;
    }
}
@media (max-width: 1600px) {
    .ad-dashboard-wrapper { flex-direction: column; gap: 0.6rem; min-height: 65vh; }
}

/* SIDEBAR */
.ad-dashboard-sidebar {
    min-width: 220px;
    max-width: 240px;
    background: #f7f9fc;
    border-radius: 1.2em;
    box-shadow: 0 4px 24px rgba(90,110,160,0.07);
    padding: 1.1em 1.1em 1.1em 1.1em; /* Weniger Padding oben! */
    display: flex;
    flex-direction: column;
    gap: 1.1em;
    align-self: flex-start;
    position: relative;
    z-index: 1603;
    transition: transform 0.24s cubic-bezier(.4,.11,.38,1.02);
}
.ad-sidebar-profile {
    display: flex;
    align-items: center;
    gap: 0.8em;
    margin-bottom: 1.1em;
}
.ad-sidebar-avatar {
    width: 54px; height: 54px;
    border-radius: 50%;
    object-fit: cover;
    background: #e4ebeb;
    box-shadow: 0 1px 5px rgba(70,110,140,0.06);
}
.ad-sidebar-user { display: flex; flex-direction: column; }
.ad-sidebar-name { font-weight: 700; color: #18324c; font-size: 0.8em; }
.ad-sidebar-role { color: #4b7766; font-size: 0.96em; }
.ad-sidebar-nav ul { list-style: none; margin: 0; padding: 0; }
.ad-sidebar-nav li { margin-bottom: 0.63em; }
.ad-sidebar-nav a {
    display: flex; align-items: center; gap: 0.8em;
    font-size: 0.8em; font-weight: 500; color: #273b56; text-decoration: none;
    padding: 0.66em 0.7em 0.66em 0.7em; border-radius: 0.8em;
    transition: background 0.14s, color 0.13s;
}
.ad-sidebar-nav a.active,
.ad-sidebar-nav a:hover,
.ad-sidebar-nav a:focus { background: #e7f7e8; color: #186c41; }
.ad-sidebar-bottom { margin-top: 2em; border-top: 1px solid #e6eaf2; padding-top: 1.2em; display: flex; flex-direction: column; gap: 0.4em; }
.ad-sidebar-settings { margin-bottom: 0.7em; }
.ad-settings-link {
    display: flex; align-items: center; gap: 0.7em; font-size: 1.11em;
    color: #273b56; text-decoration: none; font-weight: 500;
    border-radius: 0.7em; padding: 0.62em 1em 0.62em 0.7em;
    transition: background 0.13s, color 0.13s;
}
.ad-settings-link:hover, .ad-settings-link:focus { background: #e7f7e8; color: #186c41; }
.ad-logout-link {
    display: flex; align-items: center; gap: 0.6em; font-size: 1.07em;
    color: #cd3f3f; font-weight: 500; text-decoration: none;
    padding: 0.62em 1em 0.62em 0.7em; border-radius: 0.7em;
    transition: background 0.13s, color 0.13s;
}
.ad-logout-link:hover { background: #faeaea; color: #af2323; }

/* Sidebar Responsive */
@media (max-width: 950px) {
    .ad-dashboard-sidebar {
        position: fixed; left: 0; top: 0; height: 100vh;
        width: 90vw; max-width: 320px;
        border-radius: 0 1.2em 1.2em 0;
        box-shadow: 2px 0 32px rgba(60,80,110,0.16);
        transform: translateX(-120%);
        margin-bottom: 0;
        padding: 1.1em 0.8em 1.1em 0.8em;
    }
    .ad-dashboard-sidebar.is-mobile-open {
        transform: translateX(0);
        transition: transform 0.26s cubic-bezier(.68,-0.06,.37,1.15);
    }
}
.ad-sidebar-overlay { display: none; }
@media (max-width: 950px) {
    .ad-sidebar-overlay {
        display: none; position: fixed; inset: 0; z-index: 1101;
        background: rgba(24,36,44,0.19);
    }
    .ad-sidebar-overlay.active { display: block; }
}

/* MAIN CONTENT */
.ad-dashboard-haendler-main, .ad-dashboard-klient-main {
    flex: 1 1 0; display: flex; flex-direction: column; gap: 1.5em;
    background: #fff; border-radius: 1.4em;
    box-shadow: 0 2px 18px rgba(28, 44, 75, 0.09);
    padding: 1.4em 1.3em 1.1em 1.3em; /* Weniger Padding oben/unten! */
    z-index: 0; min-width: 0;
}
@media (max-width: 1600px) {
    .ad-dashboard-wrapper { flex-direction: column; gap: 0.6rem; min-height: 65vh; }
    .ad-dashboard-sidebar { padding: 0.7em 0.1em 1.1em 0.2em; min-width: 0; }
    .ad-dashboard-haendler-main, .ad-dashboard-klient-main { padding: 0.7em 0.1em 1em 0.2em; }
    .ad-dashboard-title { font-size: 1.3em; }
    .ad-dashboard-welcome { flex-direction: column; gap: 0.7em; padding: 1em 0.6em 0.7em 0.7em; }
    .ad-dashboard-welcome-avatar { margin-right: 0; }
}
@media (max-width: 410px) {
    .ad-dashboard-shortcut { font-size: 0.98em; padding: 0.65em 1em; }
}

/* FOOTER */
.ad-dashboard-footer {
    background: #f7f9fc; color: #25394a;
    border-top: 1px solid #e3e6ed;
    box-shadow: 0 -2px 16px rgba(44, 72, 98, 0.04);
    width: 100%;
    padding: 1em 0 1em 0;
    font-size: 1em;
    margin-top: auto;
    flex-shrink: 0;
}
.ad-footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.2em;
    width: 95%;
}
.ad-footer-left { display: flex; align-items: center; gap: 1em; }
.ad-footer-logo-img {
    max-height: 90px; max-width: 120px; min-width: 60px;
    height: auto; width: auto; display: block; object-fit: contain;
}
.ad-footer-copy { color: #7d8da1; margin-left: 0.4em; }
.ad-footer-links a {
    color: #2787c6; margin-right: 1.1em; text-decoration: none;
    font-weight: 500; transition: color 0.17s;
}
.ad-footer-links a:last-child { margin-right: 0; }
.ad-footer-links a:hover { color: #1c476c; }
@media (max-width: 800px) {
    .ad-footer-content {
        flex-direction: column; gap: 0.7em; text-align: center;
    }
    .ad-footer-left { justify-content: center; }
}

/* WIDGETS/SECTIONS/LISTEN */
.ad-dashboard-section {
    background: #fff;
    border-radius: 1em;
    box-shadow: 0 2px 16px rgba(28, 44, 75, 0.09);
    padding: 1.3em 1.3em 1.6em 1.3em;
    margin-bottom: 1.6em;
    display: flex;
    flex-direction: column;
    gap: 0.55em;
}
.ad-dashboard-list { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4em; }
@media (max-width: 960px) {
    .ad-dashboard-list { grid-template-columns: 1fr; }
}

/* Willkommen Widget */
.ad-dashboard-welcome {
    background: linear-gradient(95deg, #e7f6e7 0%, #f8faf7 100%);
    border-radius: 1em;
    padding: 1.1em 1.1em 1.1em 2em;
    margin-bottom: 1.2em;
    box-shadow: 0 2px 14px rgba(48, 77, 108, 0.09);
    display: flex;
    align-items: center;
    gap: 1.2em;
}
.ad-dashboard-welcome-avatar {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: #e4ebeb;
    object-fit: cover;
    margin-right: 1em;
    box-shadow: 0 1px 5px rgba(70,110,140,0.06);
}
.ad-dashboard-welcome-info { flex: 1 1 0; min-width: 0; }
.ad-dashboard-welcome-name {
    font-size: 1.11em; font-weight: 700; color: #277150; margin-bottom: 0.05em;
}
.ad-dashboard-welcome-role {
    font-size: 0.97em; color: #70846e; margin-bottom: 0.14em;
}

/* =============== MODAL ================== */
.ad-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background-color: rgba(24, 17, 43, 0.45);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}

.ad-modal[style*="display: none"] {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Modal-Inhalt */
.ad-modal-content {
  background: #fff;
  border-radius: 1rem;
  padding: 2rem 2rem 1.6rem 2rem;
  max-width: 430px;
  width: 94vw;
  box-shadow: 0 16px 40px rgba(44,36,81, 0.18);
  font-family: "Inter", Arial, sans-serif;
  animation: fadeInModal 0.23s cubic-bezier(.42,0,.41,1.04);
  position: relative;
  overflow: visible;
}

@keyframes fadeInModal {
  from { transform: scale(0.96) translateY(16px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}

/* Überschrift & Text */
.ad-modal-content h4 {
  font-size: 1.35rem;
  font-weight: 700;
  color: #251955;
  margin: 0 0 0.35em 0;
  letter-spacing: 0.02em;
}

.ad-modal-content p {
  font-size: 0.99rem;
  color: #343645;
  margin-bottom: 1.2rem;
  line-height: 1.55;
}

/* Eingabefelder */
.ad-modal-content input[type="password"],
.ad-modal-content input[type="text"],
.ad-modal-content input[type="email"],
.ad-modal-content input[type="tel"],
.ad-modal-content input[type="file"] {
  width: 100%;
  padding: 0.68rem 1.06rem;
  font-size: 1rem;
  border: 2px solid #dbe1ea;
  border-radius: 0.55rem;
  margin-bottom: 1.12rem;
  font-family: "Inter", Arial, sans-serif;
  background: #f9f9fc;
  transition: border-color 0.18s;
}

.ad-modal-content input:focus {
  border-color: #7a24ae;
  background: #f5f1fa;
  outline: none;
}

/* Buttons-Gruppe */
.ad-modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 1.5rem;
}

/* Buttons */
.ad-modal-buttons .ad-btn,
.ad-btn.ad-btn-primary {
  background: linear-gradient(90deg, #6d20ba 0%, #52017a 95%);
  color: #fff;
  font-weight: 700;
  padding: 0.66rem 1.34rem;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 1rem;
  box-shadow: 0 2px 8px rgba(80,32,134,0.06);
  transition: background 0.17s, box-shadow 0.16s;
}
.ad-modal-buttons .ad-btn:hover,
.ad-btn.ad-btn-primary:hover {
  background: linear-gradient(90deg, #8542c4 0%, #7a24ae 95%);
  box-shadow: 0 4px 12px rgba(80,32,134,0.13);
}

/* Sekundärbutton */
.ad-btn-secondary {
  background: #ece9f5;
  color: #372972;
  font-weight: 600;
  padding: 0.66rem 1.34rem;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.17s, color 0.14s;
  font-size: 1rem;
}
.ad-btn-secondary:hover {
  background: #ded5f0;
  color: #251955;
}

/* Success-/Fehlermeldungen */
.ad-modal-success {
  margin-top: 1rem;
  font-size: 0.97rem;
  font-weight: 500;
  color: #2e7d32;
  background: #eaf8ea;
  border-radius: 0.35rem;
  padding: 0.45em 0.7em;
  display: block;
}

.ad-modal-error {
  margin-top: 1rem;
  font-size: 0.97rem;
  font-weight: 500;
  color: #d32f2f;
  background: #faeaea;
  border-radius: 0.35rem;
  padding: 0.45em 0.7em;
  display: block;
}

/* Modal Close (optional X in der Ecke) */
.ad-modal-close {
  position: absolute;
  top: 1.15rem;
  right: 1.25rem;
  font-size: 1.38rem;
  background: none;
  border: none;
  color: #b6a9d5;
  cursor: pointer;
  transition: color 0.2s;
}
.ad-modal-close:hover {
  color: #52017a;
}

/* File Upload Anpassung */
.ad-modal-content input[type="file"] {
  background: transparent;
  border: none;
  padding: 0.2rem 0;
  margin-bottom: 0.7rem;
}

/* Responsives Verhalten */
@media (max-width: 560px) {
  .ad-modal-content {
    padding: 1.25rem 0.6rem 1.05rem 0.6rem;
    max-width: 99vw;
    font-size: 0.99rem;
  }
  .ad-modal-content h4 {
    font-size: 1.09rem;
  }
  .ad-modal-buttons .ad-btn,
  .ad-btn-secondary {
    font-size: 0.97rem;
    padding: 0.58rem 1.02rem;
  }
}

/* Deaktivierter Button */
.ad-modal-buttons .ad-btn[disabled],
.ad-btn-secondary[disabled] {
  background: #d2d2d9 !important;
  color: #fff !important;
  cursor: not-allowed !important;
  opacity: 0.64;
  box-shadow: none !important;
}


/* SHORTCUTS */
.ad-dashboard-shortcuts { display: flex; gap: 1em; flex-wrap: wrap; margin-bottom: 1.1em; }
.ad-dashboard-shortcut {
    background: #eef9ee; border-radius: 0.8em; padding: 0.8em 1.6em;
    color: #29895d; font-weight: 600; font-size: 1.05em;
    cursor: pointer; transition: background 0.14s, color 0.13s;
    display: flex; align-items: center; gap: 0.65em; border: none;
}
.ad-dashboard-shortcut:hover, .ad-dashboard-shortcut:focus {
    background: #d4f7d7; color: #186c41;
}

/* Hilfsklassen (optional, falls noch nicht in base.css) */
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
