/* ============================================================
   LD WeddingOffice — Stylesheet
   Florales, warmes Design: Creme + Altrosa + Dunkelgrün
   Fonts: Playfair Display (Headlines), Source Sans 3 (Body)
   ============================================================ */

:root {
    --color-primary: #C4748A;
    --color-primary-dark: #A85C72;
    --color-primary-light: #E8B4C4;
    --color-accent: #3D5A3E;
    --color-accent-light: #5A7A5C;
    --color-success: #3D5A3E;
    --color-warning: #D4A04A;
    --color-danger: #B85450;
    --color-bg: #FAF7F2;
    --color-bg-card: #FFFFFF;
    --color-bg-hover: #F5F0E8;
    --color-border: #E6DDD3;
    --color-text: #2C2C2C;
    --color-text-light: #6B6560;
    --color-text-muted: #A09890;
    --font-heading: 'Playfair Display', Georgia, serif;
    --font-body: 'Source Sans 3', 'Segoe UI', -apple-system, sans-serif;
    --radius: 8px;
    --radius-sm: 4px;
    --shadow: 0 2px 8px rgba(44, 44, 44, 0.06);
    --shadow-lg: 0 8px 24px rgba(44, 44, 44, 0.10);
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; }

body {
    font-family: var(--font-body);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.65;
    min-height: 100vh;
    font-weight: 400;
}

a { color: var(--color-primary-dark); text-decoration: none; }
a:hover { color: var(--color-primary); text-decoration: underline; }

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--color-text);
    letter-spacing: -0.01em;
}
h1 { font-size: 1.7rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }

/* ---- Layout ---- */
.app-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-header {
    background: linear-gradient(135deg, #2D4A2E 0%, var(--color-accent) 50%, #4A6B4C 100%);
    color: #fff;
    padding: 0 1.75rem;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 3px 16px rgba(45, 74, 46, 0.25);
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Brand: Blume + Titel */
.header-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.header-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.header-logo:hover {
    transform: rotate(15deg) scale(1.1);
    text-decoration: none;
}

.header-logo-img {
    width: 32px;
    height: 32px;
    filter: brightness(1.3) drop-shadow(0 1px 2px rgba(0,0,0,0.15));
}

.header-title {
    color: #fff;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-decoration: none;
}

.header-title:hover {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
}

/* Navigation Links */
.app-header nav {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.nav-link {
    color: rgba(255,255,255,0.85);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.12);
    text-decoration: none;
}

.nav-link-highlight {
    background: var(--color-primary);
    color: #fff;
    font-weight: 600;
}

.nav-link-highlight:hover {
    background: var(--color-primary-dark);
}

.nav-link-logout {
    color: rgba(255,255,255,0.6);
    font-size: 0.82rem;
    margin-left: 0.25rem;
    padding-left: 0.75rem;
    border-left: 1px solid rgba(255,255,255,0.15);
}

.nav-link-logout:hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
}

/* ---- KPI Dashboard Cards ---- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.kpi-card {
    background: var(--color-bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.1rem 1.25rem;
    border-left: 4px solid var(--color-border);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.kpi-value {
    font-family: var(--font-body);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.2;
}

.kpi-value small {
    font-size: 0.85rem;
    font-weight: 400;
}

.kpi-label {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    margin-top: 0.2rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.kpi-open { border-left-color: var(--color-warning); }
.kpi-open .kpi-value { color: var(--color-warning); }

.kpi-confirmed { border-left-color: var(--color-success); }
.kpi-confirmed .kpi-value { color: var(--color-success); }

.kpi-revenue { border-left-color: var(--color-primary); }
.kpi-revenue .kpi-value { color: var(--color-primary-dark); }

.kpi-deposit { border-left-color: var(--color-danger); }
.kpi-deposit .kpi-value { color: var(--color-danger); }

.kpi-next { border-left-color: var(--color-accent); }
.kpi-next .kpi-value { color: var(--color-accent); font-size: 1.2rem; }

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

/* ---- Nav Dropdown ---- */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    color: rgba(255,255,255,0.85);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.nav-dropdown-toggle:hover,
.nav-dropdown:hover .nav-dropdown-toggle {
    color: #fff;
    background: rgba(255,255,255,0.12);
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 0.3rem);
    right: 0;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    min-width: 200px;
    padding: 0.4rem 0;
    z-index: 200;
    border-top: 3px solid var(--color-primary);
}

.nav-dropdown:hover .nav-dropdown-menu {
    display: block;
}

.nav-dropdown-menu a {
    display: block;
    padding: 0.55rem 1rem;
    color: var(--color-text) !important;
    font-size: 0.86rem;
    font-weight: 500;
    transition: all 0.15s;
    white-space: nowrap;
    text-decoration: none;
}

.nav-dropdown-menu a:hover {
    background: var(--color-bg-hover);
    color: var(--color-primary-dark) !important;
    padding-left: 1.15rem;
}

.nav-dropdown-divider {
    height: 1px;
    background: var(--color-border);
    margin: 0.35rem 0.75rem;
}

.app-main {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

.app-footer {
    text-align: center;
    padding: 1.1rem 2rem;
    color: var(--color-text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--color-border);
    background: var(--color-bg-card);
    letter-spacing: 0.01em;
}

/* ---- Login Page ---- */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--color-bg);
}

.login-container {
    background: var(--color-bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    border-top: 4px solid var(--color-primary);
}

.login-logo-img {
    display: block;
    width: 56px;
    height: 56px;
    margin: 0 auto 0.5rem auto;
    filter: drop-shadow(0 2px 6px rgba(181, 99, 123, 0.3));
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 0.2rem;
    color: var(--color-text);
}

.login-header p {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    font-weight: 300;
}

.login-form .form-group {
    margin-bottom: 1.25rem;
}

.login-footer {
    text-align: center;
    margin-top: 2rem;
    color: var(--color-text-muted);
}

/* ---- Toast Notifications (oben rechts, CSS-only fade) ---- */
.toast {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.35s ease-out, toastOut 0.5s 3s ease-in forwards;
    max-width: 400px;
}

.toast-success {
    background: var(--color-accent);
    color: #fff;
    border-left: 4px solid #2D4A2E;
}

.toast-error {
    background: var(--color-danger);
    color: #fff;
    border-left: 4px solid #8A3A37;
}

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

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

/* Flash (Login-Seite inline) */
.flash {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    border: 1px solid;
}

.flash-success {
    background: #EFF6EF;
    color: var(--color-success);
    border-color: #C4DBC4;
}

.flash-error {
    background: #FDF2F2;
    color: var(--color-danger);
    border-color: #E5C4C3;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.3rem;
    font-size: 0.88rem;
    font-family: var(--font-body);
    font-weight: 600;
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    gap: 0.4rem;
    line-height: 1.4;
    min-height: 44px;
}

.btn:hover { text-decoration: none; }

.btn-primary {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}
.btn-primary:hover {
    background: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    color: #fff;
}

.btn-success {
    background: var(--color-success);
    color: #fff;
}
.btn-success:hover { background: #2D4A2E; color: #fff; }

.btn-warning {
    background: var(--color-warning);
    color: #fff;
}
.btn-warning:hover { background: #BF8A35; color: #fff; }

.btn-danger {
    background: var(--color-danger);
    color: #fff;
}
.btn-danger:hover { background: #9A403D; color: #fff; }

.btn-outline {
    background: transparent;
    color: var(--color-text-light);
    border-color: var(--color-border);
}
.btn-outline:hover {
    background: var(--color-bg-hover);
    border-color: var(--color-primary-light);
    color: var(--color-primary-dark);
}

.btn-sm {
    padding: 0.38rem 0.8rem;
    font-size: 0.82rem;
    min-height: 36px;
}

.btn-block { width: 100%; }

.btn-group {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

/* ---- Forms ---- */
.form-group {
    margin-bottom: 1.1rem;
}

.form-group label {
    display: block;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--color-text-light);
    margin-bottom: 0.3rem;
    letter-spacing: 0.01em;
}

.form-group label .required {
    color: var(--color-primary);
    font-weight: 700;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
select,
textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    font-size: 0.9rem;
    font-family: var(--font-body);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius);
    background: #fff;
    color: var(--color-text);
    transition: border-color 0.2s, box-shadow 0.2s;
    min-height: 44px;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(196, 116, 138, 0.15);
}

textarea { resize: vertical; min-height: 80px; }

select { cursor: pointer; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
}

/* ---- Card ---- */
.card {
    background: var(--color-bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 0.85rem;
    border-bottom: 2px solid var(--color-bg);
}

.card-header h2 {
    margin: 0;
    font-family: var(--font-heading);
}

/* ---- Tables ---- */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Items-Tabelle: overflow sichtbar für Autocomplete-Dropdown */
.table-wrapper:has(.items-table) {
    overflow: visible;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

table th {
    text-align: left;
    padding: 0.7rem 0.8rem;
    font-weight: 600;
    color: var(--color-text-light);
    background: var(--color-bg);
    border-bottom: 2px solid var(--color-border);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    font-family: var(--font-body);
}

table td {
    padding: 0.7rem 0.8rem;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}

table tbody tr {
    transition: background 0.15s ease;
}

table tbody tr:hover {
    background: var(--color-bg-hover);
}

/* Hochzeits-Countdown Zeilen */
table tbody tr.row-urgent {
    background: rgba(184, 84, 80, 0.07);
}

table tbody tr.row-urgent:hover {
    background: rgba(184, 84, 80, 0.12);
}

table tbody tr.row-soon {
    background: rgba(212, 160, 74, 0.07);
}

table tbody tr.row-soon:hover {
    background: rgba(212, 160, 74, 0.12);
}

/* Ausgeliefert / Abgerechnet — kräftigeres Grün */
table tbody tr.row-done {
    background: rgba(61, 140, 62, 0.12);
}

table tbody tr.row-done:hover {
    background: rgba(61, 140, 62, 0.18);
}

/* Stornierte Zeilen abgedimmt */
table tbody tr[data-status="storniert"] {
    opacity: 0.5;
}

table tbody tr[data-status="storniert"]:hover {
    opacity: 0.8;
}

table .text-right { text-align: right; }
table .text-center { text-align: center; }

/* ---- Legend (aufklappbar) ---- */
.legend-details {
    margin-top: 0.5rem;
    background: var(--color-bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.legend-summary {
    padding: 0.7rem 1.25rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-text-muted);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    user-select: none;
    transition: color 0.15s;
}

.legend-summary::-webkit-details-marker { display: none; }

.legend-summary::before {
    content: '\25B6';
    font-size: 0.6rem;
    transition: transform 0.2s;
}

.legend-details[open] .legend-summary::before {
    transform: rotate(90deg);
}

.legend-summary:hover {
    color: var(--color-text-light);
}

.legend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    padding: 0 1.25rem 1.1rem;
}

.legend-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    margin-bottom: 0.4rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid var(--color-border);
}

.legend-items {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.78rem;
    color: var(--color-text-light);
}

.legend-items > div {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.legend-swatch {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 1px solid rgba(0,0,0,0.08);
    flex-shrink: 0;
}

/* Sortable columns */
.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 1.2rem !important;
}

.sortable:hover {
    color: var(--color-primary-dark);
}

.sortable::after {
    content: '\2195';
    position: absolute;
    right: 0.3rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7rem;
    opacity: 0.3;
}

.sortable.sort-asc::after {
    content: '\25B2';
    opacity: 0.8;
    color: var(--color-primary);
}

.sortable.sort-desc::after {
    content: '\25BC';
    opacity: 0.8;
    color: var(--color-primary);
}

/* Offer number in monospace */
.offer-number {
    font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--color-accent);
    letter-spacing: 0.03em;
}

/* ---- Status Badges ---- */
.badge {
    display: inline-block;
    padding: 0.22rem 0.7rem;
    font-size: 0.76rem;
    font-weight: 600;
    border-radius: 50px;
    line-height: 1.4;
    letter-spacing: 0.02em;
    text-transform: capitalize;
}

.badge-offen {
    background: #FFF5E0;
    color: #C4880A;
    border: 1px solid #EEDD99;
}

.badge-bestätigt,
.badge-bestatigt {
    background: #E8F5E8;
    color: var(--color-success);
    border: 1px solid #B8D8B8;
}

.badge-storniert {
    background: #FDF2F2;
    color: var(--color-danger);
    border: 1px solid #E5BFBE;
}

/* ---- Toolbar / Filter ---- */
.toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.toolbar .search-input {
    flex: 1;
    min-width: 200px;
    max-width: 350px;
}

.filter-group {
    display: flex;
    gap: 0;
}

.filter-btn {
    padding: 0.45rem 0.9rem;
    font-size: 0.82rem;
    font-family: var(--font-body);
    font-weight: 500;
    border: 1.5px solid var(--color-border);
    background: var(--color-bg-card);
    color: var(--color-text-light);
    cursor: pointer;
    transition: all 0.2s;
    min-height: 38px;
}

.filter-btn:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.filter-btn:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.filter-btn:not(:first-child) { border-left: 0; }

.filter-btn.active {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.filter-btn:hover:not(.active) {
    background: var(--color-bg-hover);
    color: var(--color-text);
}

/* ---- Steps Indicator ---- */
.steps {
    display: flex;
    gap: 0;
    margin-bottom: 2rem;
    position: relative;
}

.step {
    flex: 1;
    text-align: center;
    padding: 0.9rem 1rem;
    background: var(--color-bg);
    border-bottom: 3px solid var(--color-border);
    color: var(--color-text-muted);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    font-family: var(--font-body);
}

.step .step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--color-border);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    margin-right: 0.5rem;
    transition: background 0.25s ease;
    vertical-align: middle;
}

.step.active {
    background: var(--color-bg-card);
    border-bottom-color: var(--color-primary);
    color: var(--color-text);
}

.step.active .step-num {
    background: var(--color-primary);
}

.step-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    color: var(--color-text-muted);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.step-content {
    display: none;
}

.step-content.active {
    display: block;
}

/* ---- Offer Items Table ---- */
.items-table {
    width: 100%;
}

.items-table input,
.items-table select {
    font-size: 0.85rem;
    padding: 0.4rem 0.5rem;
    min-height: 38px;
}

.items-table .col-pos { width: 50px; }
.items-table .col-desc { min-width: 200px; }
.items-table .col-qty { width: 80px; }
.items-table .col-price { width: 110px; }
.items-table .col-tax { width: 90px; }
.items-table .col-total { width: 110px; }
.items-table .col-action { width: 50px; }

.items-table tbody tr {
    transition: background 0.15s ease;
}

.items-table tbody tr:hover {
    background: #FFF9F4;
}

.btn-remove-row {
    background: none;
    border: none;
    color: var(--color-danger);
    cursor: pointer;
    font-size: 1.3rem;
    padding: 0.25rem;
    line-height: 1;
    transition: color 0.15s;
    min-height: 38px;
    min-width: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-remove-row:hover {
    color: #9A403D;
}

.btn-add-row {
    margin-top: 0.75rem;
    border-style: dashed;
    border-width: 2px;
    font-weight: 600;
    color: var(--color-primary);
    border-color: var(--color-primary-light);
    background: rgba(196, 116, 138, 0.04);
    min-height: 44px;
    padding: 0.55rem 1.5rem;
}

.btn-add-row:hover {
    background: rgba(196, 116, 138, 0.1);
    border-color: var(--color-primary);
    color: var(--color-primary-dark);
}

/* ---- Totals Box ---- */
.totals-box {
    background: var(--color-bg);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-top: 1.25rem;
    max-width: 450px;
    margin-left: auto;
}

.totals-row {
    display: flex;
    justify-content: space-between;
    padding: 0.32rem 0;
    font-size: 0.9rem;
}

.totals-row.total-gross {
    font-weight: 700;
    font-size: 1.05rem;
    border-top: 2px solid var(--color-primary);
    margin-top: 0.5rem;
    padding-top: 0.65rem;
    color: var(--color-text);
}

.totals-row.deposit {
    color: var(--color-primary-dark);
    border-top: 1px solid var(--color-border);
    margin-top: 0.3rem;
    padding-top: 0.5rem;
}

/* ---- Autocomplete ---- */
.autocomplete-wrapper {
    position: relative;
}

.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg-card);
    border: 1.5px solid var(--color-border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow-lg);
    max-height: 200px;
    overflow-y: auto;
    z-index: 50;
    display: none;
}

.autocomplete-list.show {
    display: block;
}

.autocomplete-item {
    padding: 0.55rem 0.8rem;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    transition: background 0.1s;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
    background: var(--color-bg-hover);
}

.autocomplete-item .price {
    color: var(--color-text-muted);
    font-size: 0.8rem;
}

/* ---- Inline Edit (Admin) ---- */
.inline-edit {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.inline-edit input,
.inline-edit select {
    width: auto;
}

/* ---- Offer View ---- */
.offer-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.meta-group {
    font-size: 0.9rem;
}

.meta-group dt {
    font-weight: 600;
    color: var(--color-text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 0.5rem;
}

.meta-group dt:first-child {
    margin-top: 0;
}

.meta-group dd {
    margin: 0.15rem 0 0 0;
    color: var(--color-text);
}

/* ---- Internal Notes ---- */
.internal-notes-box {
    background: #FFF8EE;
    border: 1px solid #EEE0C8;
    border-left: 4px solid var(--color-warning);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
}

.internal-notes-box strong {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ---- Status Actions ---- */
.status-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.status-actions .badge {
    font-size: 0.88rem;
    padding: 0.38rem 0.9rem;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .app-header {
        flex-direction: column;
        height: auto;
        padding: 0.75rem 1rem;
        gap: 0.5rem;
    }
    .app-header nav {
        flex-wrap: wrap;
        gap: 0.75rem;
        justify-content: center;
    }
    .nav-dropdown-menu {
        right: auto;
        left: 50%;
        transform: translateX(-50%);
    }
    .app-main { padding: 1rem; }
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .toolbar .search-input { max-width: none; }
    .offer-meta { grid-template-columns: 1fr; }
    .totals-box { max-width: none; }
    .card { padding: 1.25rem; }
    .card-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
    .status-actions { flex-wrap: wrap; }
}

/* ---- Utility ---- */
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.hidden { display: none !important; }

/* ---- Modal ---- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(44, 44, 44, 0.5);
    backdrop-filter: blur(3px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-box {
    background: var(--color-bg-card);
    border-radius: var(--radius);
    box-shadow: 0 16px 48px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 620px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.5rem;
    border-bottom: 2px solid var(--color-bg);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-text-muted);
    padding: 0.25rem;
    line-height: 1;
    transition: color 0.15s;
}

.modal-close:hover {
    color: var(--color-danger);
}

.modal-body {
    padding: 1.25rem 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* ---- Action Bar (offer_view) ---- */
.action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 2px solid var(--color-bg);
}

.action-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding-right: 1rem;
    border-right: 1px solid var(--color-border);
}

.action-group:last-child {
    border-right: none;
    padding-right: 0;
    margin-left: auto;
}

.action-group-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
}

.action-group-buttons {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .action-group {
        border-right: none;
        padding-right: 0;
    }
    .action-group:last-child {
        margin-left: 0;
    }
}

/* ---- Timeline / Aktionsprotokoll ---- */
.timeline {
    padding: 0;
}

.timeline-entry {
    display: flex;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--color-bg);
}

.timeline-entry:last-child {
    border-bottom: none;
}

.timeline-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    background: var(--color-bg);
    border-radius: 50%;
    flex-shrink: 0;
}

.timeline-content {
    flex: 1;
    min-width: 0;
}

.timeline-text {
    font-size: 0.88rem;
    color: var(--color-text);
}

.timeline-meta {
    font-size: 0.76rem;
    color: var(--color-text-muted);
    margin-top: 0.1rem;
}
