/* TableMoment – Edel, modern, Hotel & Gastronomie */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
    /* Farbpalette: zurückhaltend, edel */
    --color-bg: #F7F6F3;
    --color-bg-card: #FFFFFF;
    --color-text: #1C1B1F;
    --color-text-muted: #5C5B60;
    --color-primary: #2D4A3E;
    --color-primary-hover: #1E3329;
    --color-primary-soft: rgba(45, 74, 62, 0.08);
    --color-accent: #B8860B;
    --color-accent-hover: #9A7209;
    --color-accent-soft: rgba(184, 134, 11, 0.12);
    --color-border: rgba(28, 27, 31, 0.08);
    --color-border-focus: var(--color-primary);
    --color-success: #2D6A4F;
    --color-success-soft: rgba(45, 106, 79, 0.1);
    --color-error: #B91C1C;
    --color-error-soft: rgba(185, 28, 28, 0.1);
    --color-info: #1E3A5F;
    --color-info-soft: rgba(30, 58, 95, 0.08);
    /* Schatten: weich, mehrstufig */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 24px 48px rgba(0, 0, 0, 0.1);
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 22px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px 24px;
}

/* ========== Login ========== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(160deg, #1a2f26 0%, #2D4A3E 50%, #1e3329 100%);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(184, 134, 11, 0.15), transparent),
                radial-gradient(ellipse 60% 40% at 100% 100%, rgba(255,255,255,0.04), transparent);
    pointer-events: none;
}

.login-container {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

.login-box {
    background: var(--color-bg-card);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.login-box h1 {
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    color: var(--color-primary);
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

.login-box .subtitle {
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.95rem;
    margin-bottom: 32px;
    font-weight: 500;
}

.login-info {
    margin-top: 28px;
    padding: 20px;
    background: var(--color-primary-soft);
    border-radius: var(--radius-md);
    text-align: center;
    font-size: 13px;
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
}

.login-info p {
    margin: 4px 0;
}

/* ========== Forms ========== */
.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--color-text);
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    background: var(--color-bg-card);
    color: var(--color-text);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input:hover,
.form-group textarea:hover,
.form-group select:hover {
    border-color: rgba(28, 27, 31, 0.18);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--color-text-muted);
    opacity: 0.8;
}

/* ========== Buttons ========== */
.btn,
a.btn {
    display: inline-block;
    padding: 14px 26px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    font-weight: 500;
    font-weight: 600;
    font-family: inherit;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition), background-color var(--transition);
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary,
a.btn-primary {
    background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-primary-hover) 100%);
    color: #fff !important;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(45, 74, 62, 0.35);
}

.btn-secondary {
    background: var(--color-bg-card);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background: var(--color-primary-soft);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.btn-success,
a.btn-success {
    background: linear-gradient(180deg, #2D6A4F 0%, #1B4332 100%);
    color: #fff !important;
    box-shadow: var(--shadow-sm);
}

.btn-success:hover {
    box-shadow: 0 6px 20px rgba(45, 106, 79, 0.3);
}

.btn-danger,
a.btn-danger {
    background: var(--color-error);
    color: #fff !important;
}

.btn-block {
    width: 100%;
    display: block;
    padding: 16px;
}

.btn-small {
    padding: 10px 18px;
    font-size: 0.875rem;
}

.btn-outline {
    background: transparent;
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn-outline:hover {
    background: var(--color-bg-elevated);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

a.btn-outline {
    color: var(--color-text) !important;
}

a.btn-outline:hover {
    color: var(--color-primary) !important;
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

.quick-actions .btn {
    flex-shrink: 0;
}

.input-with-btn {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.input-with-btn input {
    flex: 1;
    min-width: 160px;
}

.form-group-with-action .input-with-btn .btn {
    white-space: nowrap;
}

.label-muted {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    margin-right: 8px;
}

.text-muted {
    color: var(--color-text-muted);
}

.card-danger {
    margin-top: 24px;
    border-color: rgba(185, 28, 28, 0.35);
}

.card-danger h3 {
    margin-bottom: 8px;
}

.visit-notes {
    margin-top: 8px;
    color: var(--color-text-muted);
}

.page-header-sub {
    color: var(--color-text-muted);
    font-size: 1rem;
    margin-top: 4px;
}

.location-cover {
    margin-bottom: 24px;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    max-height: 280px;
    background: var(--color-bg-elevated);
}

.location-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    max-height: 280px;
    display: block;
}

.location-photo-small {
    max-width: 200px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 4px;
}

.location-photo-small img {
    width: 100%;
    height: auto;
    display: block;
}

.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.quick-link-card {
    text-decoration: none;
    color: inherit;
    text-align: center;
}

.quick-link-card h3 {
    margin-bottom: 4px;
}

.quick-link-card p {
    font-size: 14px;
}

/* ========== Alerts ========== */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-weight: 500;
    border: 1px solid transparent;
}

.alert-error {
    background: var(--color-error-soft);
    color: var(--color-error);
    border-color: rgba(185, 28, 28, 0.2);
}

.alert-success {
    background: var(--color-success-soft);
    color: var(--color-success);
    border-color: rgba(45, 106, 79, 0.2);
}

.alert-info {
    background: var(--color-info-soft);
    color: var(--color-info);
    border-color: rgba(30, 58, 95, 0.2);
}

/* ========== Navigation ========== */
.nav {
    background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-primary-hover) 100%);
    color: #fff;
    padding: 0;
    margin-bottom: 0;
    box-shadow: var(--shadow-md);
    position: relative;
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 64px;
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    letter-spacing: -0.02em;
    transition: opacity var(--transition);
}

.nav-brand:hover {
    opacity: 0.92;
}

.nav-menu {
    display: flex;
    gap: 6px;
    list-style: none;
}

.nav-menu a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    transition: background-color var(--transition), color var(--transition);
}

.nav-menu a:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.nav-menu a.active {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-weight: 600;
}

.nav-sep {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.3);
    margin: 0 8px;
    padding: 0;
    list-style: none;
}

.nav-logout {
    opacity: 0.9;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 10px;
    border-radius: var(--radius-sm);
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-toggle-icon {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    box-shadow: 0 6px 0 #fff, 0 12px 0 #fff;
}

.nav-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Schließen-Button nur auf Mobilgeräten (Hamburger-Menü) */
.nav-close {
    display: none;
}

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: min(320px, 100vw);
        height: 100vh;
        background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-primary-hover) 100%);
        flex-direction: column;
        gap: 0;
        padding: 72px 24px 32px;
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
        box-shadow: -8px 0 32px rgba(0, 0, 0, 0.15);
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-menu li {
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .nav-menu a {
        display: block;
        padding: 18px 0;
        font-size: 1rem;
        border-radius: 0;
    }

    .nav-close {
        display: block;
        position: absolute;
        top: 18px;
        right: 18px;
        background: rgba(255, 255, 255, 0.1);
        border: none;
        color: #fff;
        font-size: 1.5rem;
        cursor: pointer;
        padding: 10px;
        border-radius: var(--radius-sm);
        transition: background var(--transition);
    }

    .nav-close:hover {
        background: rgba(255, 255, 255, 0.2);
    }

    .nav-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 999;
        backdrop-filter: blur(2px);
    }

    .nav-overlay.active {
        display: block;
    }
}

/* ========== Cards ========== */
.card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition), border-color var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

/* ========== Stats Grid ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 36px;
}

.stat-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(45, 74, 62, 0.15);
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 12px;
    opacity: 0.9;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

/* ========== Badges ========== */
.badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

/* ========== Page Header ========== */
.page-header {
    margin-bottom: 36px;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
    color: var(--color-text);
}

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

/* ========== Section ========== */
.section {
    margin-bottom: 48px;
}

.section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 18px;
    color: var(--color-text);
    letter-spacing: -0.01em;
}

/* ========== Responsive ========== */
/* ========== Map Page ========== */
.map-page {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 64px);
}

.map-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 14px;
}

.map-toolbar label {
    font-weight: 600;
    margin-right: 6px;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.map-toolbar select,
.map-toolbar input[type="text"] {
    padding: 10px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    min-width: 140px;
    font-family: inherit;
    background: var(--color-bg-card);
    transition: border-color var(--transition);
}

.map-toolbar input[type="text"] {
    width: 200px;
}

.map-toolbar .filter-status {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.map-toolbar .filter-status span {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.map-content {
    display: flex;
    flex: 1;
    min-height: 0;
    gap: 20px;
}

.map-list {
    width: 320px;
    min-width: 280px;
    overflow-y: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-bg-card);
    box-shadow: var(--shadow-sm);
}

.map-list-item {
    padding: 16px 18px;
    border-bottom: 1px solid var(--color-border);
    cursor: pointer;
    transition: background-color var(--transition);
}

.map-list-item:hover,
.map-list-item.active {
    background: var(--color-primary-soft);
}

.map-list-item h4 {
    margin: 0 0 6px 0;
    font-size: 0.95rem;
    font-weight: 600;
}

.map-list-item p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.map-list-item .status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
}

.map-list-item .map-list-type {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.map-list-item .btn-route {
    margin-top: 8px;
    font-size: 0.8rem;
    padding: 6px 12px;
}

.map-list-item .btn-route.in-route {
    background: var(--color-success);
    color: #fff;
    border-color: var(--color-success);
}

#map {
    flex: 1;
    min-height: 300px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.map-result-count {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-left: auto;
    font-weight: 500;
}

.map-address-search {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.map-address-search input {
    width: 220px;
}

.map-route-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 14px 18px;
    background: var(--color-success-soft);
    border: 1px solid rgba(45, 106, 79, 0.25);
    border-radius: var(--radius-md);
    margin-top: 10px;
}

.map-route-bar .route-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.map-route-bar .route-actions .btn {
    font-size: 0.85rem;
    padding: 8px 16px;
}

.marker-popup h3 {
    margin-bottom: 8px;
    font-size: 1.1rem;
    font-weight: 600;
}

.marker-popup p {
    margin: 4px 0;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.marker-popup .btn {
    margin-top: 10px;
    margin-right: 8px;
}

.marker-teardrop {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 44px;
    position: relative;
}

.marker-teardrop::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    bottom: -8px;
    border-left: 18px solid transparent;
    border-right: 18px solid transparent;
    border-top: 12px solid rgba(0, 0, 0, 0.2);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}

.marker-teardrop .pin {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.marker-teardrop .pin i {
    transform: rotate(45deg);
    color: #fff;
    font-size: 16px;
}

.marker-cluster {
    background-color: rgba(45, 74, 62, 0.45);
}

.marker-cluster div {
    background-color: var(--color-primary);
    color: #fff;
    font-weight: 600;
}

/* Adress-Autovervollständigung (add_location) */
.address-suggestions {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 260px;
    overflow-y: auto;
    z-index: 100;
    margin-top: 6px;
}

.address-suggestions div {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.9rem;
    transition: background-color var(--transition);
}

.address-suggestions div:hover {
    background: var(--color-primary-soft);
}

.address-suggestions div:last-child {
    border-bottom: none;
}

@media (max-width: 768px) {
    .map-content {
        flex-direction: column;
    }

    .map-list {
        width: 100%;
        max-height: 220px;
    }

    #map {
        min-height: 50vh;
        border-radius: 0;
    }

    .map-toolbar .filter-status {
        display: none;
    }
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .container {
        padding: 20px 16px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .stat-card {
        padding: 20px 16px;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .page-header h1 {
        font-size: 1.5rem;
    }

    .btn {
        font-size: 0.9rem;
        padding: 12px 22px;
    }

    .login-box {
        padding: 36px 24px;
    }
}
