:root {
    --brand-yellow: #FFE000;
    --brand-black: #000;
}

body {
    background: #f8f9fa;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    background: var(--brand-black);
    color: #fff;
    overflow-y: auto;
    z-index: 1000;
}

.sidebar-brand {
    padding: 1.5rem 1rem;
    background: var(--brand-yellow);
    color: var(--brand-black);
}

.sidebar-brand .brand {
    font-size: 1.25rem;
    font-weight: 700;
}

.sidebar-brand .subtitle {
    font-size: .8rem;
    opacity: .8;
}

.sidebar-nav {
    padding: .5rem 0;
}

.sidebar-nav .nav-link {
    color: rgba(255, 255, 255, .7);
    padding: .6rem 1rem;
    font-size: .9rem;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
    color: var(--brand-yellow);
    background: rgba(255, 255, 255, .05);
}

.sidebar-nav .nav-link i {
    margin-right: .5rem;
}

.sidebar-divider {
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, .1);
    margin: .5rem 1rem;
}

.main-content {
    margin-left: 260px;
    padding: 2rem;
}

/* Login page */
body.login-page {
    display: flex;
    align-items: center;
}

.login-card {
    max-width: 420px;
    width: 100%;
    margin: 0 auto;
}

.login-card.login-card-wide {
    max-width: 640px;
}

.login-header {
    background: var(--brand-black);
    color: var(--brand-yellow);
    padding: 2rem 1.5rem 1.5rem;
    text-align: center;
    border-radius: .5rem .5rem 0 0;
}

.login-header .brand {
    font-size: 1.5rem;
    font-weight: 700;
}

.login-header .subtitle {
    font-size: .875rem;
    opacity: .8;
}

.login-body {
    background: #fff;
    padding: 2rem 1.5rem;
    border-radius: 0 0 .5rem .5rem;
    box-shadow: 0 .125rem .25rem rgba(0, 0, 0, .075);
}

.btn-login {
    background: var(--brand-yellow);
    border-color: var(--brand-yellow);
    color: var(--brand-black);
    font-weight: 600;
}

.btn-login:hover {
    background: #e6ca00;
    border-color: #e6ca00;
    color: var(--brand-black);
}

.oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .6rem .75rem;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: .375rem;
    text-decoration: none;
    color: #212529;
    font-weight: 500;
}
.oauth-btn:hover {
    background: #f8f9fa;
    color: #212529;
}
.oauth-btn-img {
    height: 24px;
    width: auto;
}

.separator {
    display: flex;
    align-items: center;
    text-align: center;
    color: #6c757d;
    font-size: .875rem;
}
.separator::before,
.separator::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #dee2e6;
}
.separator span {
    padding: 0 .75rem;
    background: #fff;
}

/* Hamburger toggle (mobile only) */
.sidebar-toggle {
    display: none;
}

.sidebar-backdrop {
    display: none;
}

/* Wizard */
.wizard-container {
    max-width: 720px;
}

.wizard-steps {
    display: flex;
    gap: .75rem;
}

.wizard-step {
    flex: 1;
    text-align: center;
    padding: .75rem .5rem;
    background: #fff;
    border-radius: .375rem;
    color: #6c757d;
    font-size: .875rem;
    border: 1px solid #dee2e6;
}

.wizard-step .step-number {
    display: inline-block;
    width: 24px;
    height: 24px;
    line-height: 24px;
    border-radius: 50%;
    background: #dee2e6;
    color: #6c757d;
    font-size: .75rem;
    font-weight: 600;
    margin-right: .25rem;
    text-align: center;
}

.wizard-step.active {
    border-color: var(--brand-yellow);
    color: var(--brand-black);
    font-weight: 500;
}

.wizard-step.active .step-number {
    background: var(--brand-yellow);
    color: var(--brand-black);
}

.wizard-step.done {
    border-color: #198754;
    color: #198754;
}

.wizard-step.done .step-number {
    background: #198754;
    color: #fff;
}

/* Combobox */
.search-select {
    position: relative;
}

.search-select-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1020;
    max-height: 200px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0 0 .375rem .375rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.search-select-menu li {
    padding: .5rem .75rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-select-menu li:hover,
.search-select-menu li.active {
    background: var(--brand-yellow);
    color: var(--brand-black);
}

/* Dashboard cards */
.fair-card {
    cursor: pointer;
    transition: box-shadow .2s;
}

.fair-card:hover {
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15) !important;
}

/* Detail page */
.detail-container {
    /* full width — no max-width constraint */
}

/* Breadcrumb */

.detail-container .breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    color: #adb5bd;
}

.detail-container .breadcrumb .breadcrumb-item a {
    text-decoration: none;
    color: #6c757d;
}

.detail-container .breadcrumb .breadcrumb-item a:hover {
    color: #000;
}

.detail-container .breadcrumb .breadcrumb-item.active {
    color: #000;
    font-weight: 600;
}

/* Alpine cloak */
[x-cloak] {
    display: none !important;
}

/* Filter bar */
.filter-bar .btn-group .btn {
    border-radius: 0;
}

.filter-bar .btn-group .btn:first-child {
    border-radius: .375rem 0 0 .375rem;
}

.filter-bar .btn-group .btn:last-child {
    border-radius: 0 .375rem .375rem 0;
}

.filter-bar .btn-group .btn.active {
    background: var(--brand-black);
    color: var(--brand-yellow);
    border-color: var(--brand-black);
}

/* Pagination */
.pagination {
    gap: .125rem;
}

.pagination .page-link {
    color: var(--brand-black);
    padding: .375rem .75rem;
    font-size: .875rem;
}

.pagination .page-item.active .page-link {
    background: var(--brand-black);
    border-color: var(--brand-black);
    color: var(--brand-yellow);
}

/* Sidebar sub-nav */
.sidebar-sub-nav {
    padding-left: 1.5rem;
}

.sidebar-sub-nav .nav-link {
    font-size: .8rem;
    padding: .35rem 1rem;
}

.sidebar-nav .nav-link.has-submenu::after {
    content: '';
    display: inline-block;
    margin-left: .5rem;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid rgba(255, 255, 255, .4);
    vertical-align: middle;
    transition: transform .2s;
}

.sidebar-nav .nav-link.collapsed::after {
    transform: rotate(-90deg);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        display: none;
        transform: translateX(-100%);
        transition: transform .3s ease-in-out;
        z-index: 1040;
    }

    .sidebar.offcanvas {
        display: block;
    }

    .sidebar.offcanvas.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: flex;
        position: fixed;
        top: .75rem;
        left: .75rem;
        z-index: 1050;
        width: 40px;
        height: 40px;
        align-items: center;
        justify-content: center;
        background: var(--brand-black);
        color: var(--brand-yellow);
        border: none;
        border-radius: .375rem;
        font-size: 1.25rem;
    }

    .sidebar-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, .5);
        z-index: 1030;
    }

    .sidebar-backdrop.show {
        display: block;
    }
}

/* ============================================================
   Job Tabs
   ============================================================ */

.job-tabs {
    border-bottom: 2px solid #dee2e6;
}

.job-tabs .nav-link {
    border: none;
    color: #6c757d;
    padding: .5rem 1rem;
    font-size: .875rem;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.job-tabs .nav-link:hover {
    color: #000;
    border-color: transparent;
}

.job-tabs .nav-link.active {
    color: #000;
    font-weight: 600;
    border-bottom-color: var(--brand-yellow, #FFE000);
    background: transparent;
}

.tab-content-scroll {
    min-height: 300px;
    overflow-y: auto;
    padding-right: .25rem;
}

.tab-content-scroll > .tab-pane {
    min-height: 200px;
}

.no-page-scroll {
    overflow: hidden;
}

/* ============================================================
   Checklist
   ============================================================ */

.checklist-items .form-check {
    padding-left: 2rem;
}

.checklist-items .form-check:last-child {
    margin-bottom: 0;
}

/* ============================================================
   Job Cards
   ============================================================ */

.job-card-img {
    max-height: 120px;
    width: auto;
    border-radius: .25rem;
}

/* ============================================================
   Customer Picker (wizard Step 1)
   ============================================================ */

.customer-picker .dropdown-results {
    position: absolute;
    z-index: 1050;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: .375rem;
    max-height: 200px;
    overflow-y: auto;
    width: 100%;
}

.customer-picker .dropdown-item {
    cursor: pointer;
    padding: .375rem .75rem;
}

.customer-picker .dropdown-item:hover {
    background: #f8f9fa;
}

.customer-picker .selected-customers .badge {
    font-size: .85rem;
    padding: .35em .5em;
}

.customer-picker .selected-customers .btn-close-sm {
    font-size: .5rem;
    padding: 0;
    margin-left: .25rem;
}

/* Tab 5: Standfotos / Tab 6: Abnahme Gallery */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.gallery-placeholder {
    background: #f8f9fa;
    border-radius: 4px;
}

/* Tab 2: Organisation collapsible cards */

/* Tab 3: Produktion material table */
.material-table td {
    vertical-align: middle;
}

.material-table td .form-control-sm,
.material-table td .form-select-sm {
    min-width: 80px;
}

.lead-magnet-badge {
    margin: 2px;
}

.print-production-row {
    border-left: 3px solid var(--brand-yellow);
    padding-left: 1rem;
}

/* Gantt chart */
.gantt-chart {
    padding-top: 8px;
}

.gantt-bar-wrapper {
    position: relative;
    margin: 0 40px;
}

.gantt-period {
    position: absolute;
    top: 0;
    height: 100%;
}

.gantt-period-bar {
    position: absolute;
    top: 16px;
    height: 8px;
    left: 0;
    right: 0;
    border-radius: 2px;
}

.gantt-period-label {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 0.7rem;
    color: #6c757d;
    line-height: 1;
}

.gantt-setup .gantt-period-bar { background: #adb5bd; }
.gantt-fair .gantt-period-bar { background: var(--brand-yellow); }
.gantt-destruct .gantt-period-bar { background: #adb5bd; }

.gantt-marker {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
}

.gantt-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin: 14px auto 0;
}

.gantt-label {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 0.75rem;
    line-height: 1.2;
    text-align: center;
    color: #6c757d;
}

.gantt-Strom .gantt-dot { background: #0d6efd; }
.gantt-WLAN .gantt-dot { background: #198754; }
.gantt-Reinigung .gantt-dot { background: #fd7e14; }
.gantt-Rigging .gantt-dot { background: #6f42c1; }
.gantt-Druck .gantt-dot { background: #dc3545; }
.gantt-Catering .gantt-dot { background: #20c997; }
.gantt-Checkliste .gantt-dot { background: #0dcaf0; }

/* Calendar */
.calendar-grid {
    border: 1px solid #dee2e6;
    border-radius: 4px;
    overflow: hidden;
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.calendar-header-cell {
    padding: 6px 4px;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
}

.calendar-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.calendar-row:not(:last-child) {
    border-bottom: 1px solid #dee2e6;
}

.calendar-cell {
    min-height: 80px;
    padding: 4px 4px 28px 4px;
    border-right: 1px solid #dee2e6;
    position: relative;
    overflow: hidden;
}

.calendar-cell:last-child {
    border-right: none;
}

.calendar-cell.muted {
    background: #fafafa;
    color: #adb5bd;
}

.calendar-cell.today {
    background: #fffde7;
}

.calendar-cell.today .calendar-day-num {
    font-weight: 700;
    background: var(--brand-yellow);
    color: #000;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.calendar-day-num {
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 2px;
}

.calendar-fair-bar {
    height: 3px;
    margin: 1px 0;
}

.calendar-events {
    position: absolute;
    bottom: 4px;
    left: 4px;
    right: 4px;
}

.calendar-event {
    display: block;
    font-size: 0.65rem;
    line-height: 1.3;
    padding: 1px 4px;
    border-radius: 2px;
    margin-bottom: 1px;
    text-decoration: none;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-event:hover {
    opacity: 0.85;
    color: #fff;
}

.calendar-event-blue { background: #0d6efd; }
.calendar-event-green { background: #198754; }
.calendar-event-orange { background: #fd7e14; }
.calendar-event-purple { background: #6f42c1; }
.calendar-event-red { background: #dc3545; }
.calendar-event-secondary { background: #6c757d; }
.calendar-event-teal { background: #20c997; }
.calendar-event-cyan { background: #0dcaf0; }
.calendar-event-indigo { background: #6610f2; }

.needs-review-row {
    background-color: #fff3f3 !important;
}

.gantt-Ressourcen .gantt-dot {
    background: #6610f2;
}

.resource-grid {
    font-size: .875rem;
}

.resource-grid td {
    vertical-align: middle;
}

.resource-grid .badge {
    font-size: .75rem;
    font-weight: 500;
}
