﻿/* SpargelCRM – Hyper Theme Overrides */
/* Nur Ergänzungen, die Hyper nicht abdeckt */

/* ===== Text-Logo (Sidebar + Topbar) ===== */
:root {
    --ct-logo-lg-height: auto;
    --ct-logo-sm-height: auto;
}

.logo-text {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #48b860;
    white-space: nowrap;
    line-height: 70px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.logo-text i {
    font-size: 1.4rem;
}

.logo-text-dark {
    color: #1B6B2E;
}

.logo-text-sm {
    font-size: 1.3rem;
    font-weight: 800;
    color: #48b860;
    white-space: nowrap;
    line-height: 70px;
}

.logo-text-sm-dark {
    color: #1B6B2E;
}

.leftside-menu .logo {
    text-align: left;
    padding-left: 20px;
}

/* ===== Sidebar B2B / B2C Sektionen ===== */
.side-nav-title--b2b {
    color: #5DCAA5 !important;
    font-weight: 600 !important;
    display: flex;
    align-items: center;
    gap: 0;
}

.side-nav-title--b2c {
    color: #F0997B !important;
    font-weight: 600 !important;
    display: flex;
    align-items: center;
    gap: 0;
}

.side-nav-title--b2b i,
.side-nav-title--b2c i {
    font-size: 1.4rem;
    line-height: 1;
    margin-right: -2px;
}

.side-nav-item--b2b > .side-nav-link {
    border-left: 3px solid #1D9E75;
}

.side-nav-item--b2c > .side-nav-link {
    border-left: 3px solid #D85A30;
}

.side-nav .badge--b2b {
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(29, 158, 117, 0.2);
    color: #5DCAA5;
    margin-left: auto;
    line-height: 1.3;
}

.side-nav .badge--b2c {
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(216, 90, 48, 0.2);
    color: #F0997B;
    margin-left: auto;
    line-height: 1.3;
}

.side-nav-item--b2b > .side-nav-link,
.side-nav-item--b2c > .side-nav-link {
    display: flex;
    align-items: center;
}

/* ===== B2B/B2C Badges (global) ===== */
.badge--b2b {
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(29, 158, 117, 0.2);
    color: #1D9E75;
    line-height: 1.3;
}

.badge--b2c {
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(216, 90, 48, 0.2);
    color: #D85A30;
    line-height: 1.3;
}

/* ===== Sortierbare Spaltenköpfe (Hyper DataTable Style) ===== */
th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 1.5rem !important;
}

th.sortable:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

th.sortable::after {
    content: '\2195';
    position: absolute;
    right: 0.5rem;
    opacity: 0.3;
    font-size: 0.75rem;
}

th.sorting_asc::after {
    content: '\2191';
    opacity: 0.8;
}

th.sorting_desc::after {
    content: '\2193';
    opacity: 0.8;
}

/* ===== SearchableSelect ===== */
.searchable-select .form-select {
    cursor: pointer;
    background-color: var(--ct-input-bg);
    color: var(--ct-body-color);
}

.searchable-select .dropdown-menu {
    box-shadow: var(--ct-box-shadow);
    border: 1px solid var(--ct-border-color);
    z-index: 1050;
}

.searchable-select .dropdown-item:hover,
.searchable-select .dropdown-item:focus {
    background-color: var(--ct-tertiary-bg);
    color: var(--ct-body-color);
}

.searchable-select .dropdown-item.active {
    background-color: var(--ct-primary) !important;
    color: #fff !important;
}

/* ===== Topbar Year-Picker ===== */
.year-picker {
    display: inline-flex;
    align-items: center;
    background: var(--ct-topbar-search-bg);
    border: 1px solid var(--ct-border-color);
    border-radius: 8px;
    height: 36px;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.year-picker:hover {
    border-color: var(--ct-primary);
    box-shadow: 0 0 0 1px rgba(var(--ct-primary-rgb, 59,125,63), 0.15);
}

.year-picker__arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 100%;
    border: none;
    background: transparent;
    color: var(--ct-topbar-item-color);
    font-size: 1.15rem;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
    padding: 0;
    line-height: 1;
}

.year-picker__arrow:hover:not(:disabled) {
    color: var(--ct-topbar-item-hover-color);
    background: rgba(0, 0, 0, 0.05);
}

.year-picker__arrow:disabled {
    opacity: 0.25;
    cursor: default;
}

.year-picker__display {
    position: relative;
}

.year-picker__value {
    display: flex;
    align-items: center;
    gap: 6px;
    border: none;
    background: transparent;
    color: var(--ct-topbar-item-color);
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    padding: 0 6px;
    height: 100%;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    line-height: 36px;
}

.year-picker__value::after {
    display: none; /* Bootstrap caret ausblenden */
}

.year-picker__value:hover {
    color: var(--ct-topbar-item-hover-color);
    background: rgba(0, 0, 0, 0.04);
}

.year-picker__icon {
    font-size: 0.95rem;
    opacity: 0.55;
}

.year-picker__label {
    font-variant-numeric: tabular-nums;
}

/* Dropdown-Menü */
.year-picker__menu {
    min-width: 140px;
    padding: 6px;
    border-radius: 8px;
    border: 1px solid var(--ct-border-color);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
    margin-top: 4px !important;
}

.year-picker__menu .dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background 0.12s;
}

.year-picker__menu .dropdown-item:hover {
    background: var(--ct-tertiary-bg);
}

.year-picker__menu .dropdown-item.active {
    background: var(--ct-primary) !important;
    color: #fff !important;
    font-weight: 600;
}

.year-picker__menu-year {
    font-variant-numeric: tabular-nums;
}

.year-picker__menu-badge {
    font-size: 0.675rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(72, 184, 96, 0.12);
    color: #2E7D32;
    padding: 1px 6px;
    border-radius: 4px;
    line-height: 1.5;
}

.year-picker__menu .dropdown-item.active .year-picker__menu-badge {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* --- Brand / Dark Topbar Override --- */
html[data-topbar-color="brand"] .year-picker,
html[data-topbar-color="dark"] .year-picker {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
}

html[data-topbar-color="brand"] .year-picker:hover,
html[data-topbar-color="dark"] .year-picker:hover {
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

html[data-topbar-color="brand"] .year-picker__arrow,
html[data-topbar-color="dark"] .year-picker__arrow {
    color: rgba(255, 255, 255, 0.55);
}

html[data-topbar-color="brand"] .year-picker__arrow:hover:not(:disabled),
html[data-topbar-color="dark"] .year-picker__arrow:hover:not(:disabled) {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

html[data-topbar-color="brand"] .year-picker__value,
html[data-topbar-color="dark"] .year-picker__value {
    color: #fff;
}

html[data-topbar-color="brand"] .year-picker__value:hover,
html[data-topbar-color="dark"] .year-picker__value:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* --- Dark Mode (bs-theme) Override --- */
html[data-bs-theme="dark"] .year-picker {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}

html[data-bs-theme="dark"] .year-picker:hover {
    border-color: rgba(255, 255, 255, 0.25);
}

html[data-bs-theme="dark"] .year-picker__arrow {
    color: rgba(255, 255, 255, 0.5);
}

html[data-bs-theme="dark"] .year-picker__arrow:hover:not(:disabled) {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

html[data-bs-theme="dark"] .year-picker__value {
    color: rgba(255, 255, 255, 0.85);
}

html[data-bs-theme="dark"] .year-picker__value:hover {
    background: rgba(255, 255, 255, 0.08);
}

html[data-bs-theme="dark"] .year-picker__menu-badge {
    background: rgba(72, 184, 96, 0.2);
    color: #66BB6A;
}

/* ===== Geo-Toolbar (Kunden-Geocoding) ===== */
.geo-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    background: var(--ct-tertiary-bg, #f8f9fa);
    border: 1px solid var(--ct-border-color);
    border-radius: 6px;
    padding: 0.4rem 0.5rem 0.4rem 0.75rem;
    margin-bottom: 0.75rem;
}

.geo-toolbar__status {
    flex: 1;
    min-width: 0;
}

.geo-toolbar__indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
}

.geo-toolbar__indicator i {
    font-size: 1.1rem;
    line-height: 1;
}

.geo-toolbar__indicator--ok {
    color: #2E7D32;
}

.geo-toolbar__indicator--ok i {
    color: #43A047;
}

.geo-toolbar__indicator--ok span {
    font-variant-numeric: tabular-nums;
    color: var(--ct-secondary-color, #6c757d);
    font-weight: 400;
    font-size: 0.78rem;
}

.geo-toolbar__indicator--error {
    color: #C62828;
}

.geo-toolbar__indicator--none {
    color: var(--ct-secondary-color, #98a6ad);
}

.geo-toolbar__actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.geo-toolbar__actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.78rem;
    font-weight: 500;
    padding: 0.2rem 0.55rem;
    border-color: var(--ct-border-color);
    white-space: nowrap;
}

.geo-toolbar__actions .btn i {
    font-size: 1rem;
    line-height: 1;
}

.geo-toolbar__actions .btn:hover {
    background: var(--ct-input-bg, #fff);
    border-color: var(--ct-primary, #3b7d3f);
    color: var(--ct-primary, #3b7d3f);
}

/* ===== Leaflet Map Marker ===== */
.spargelcrm-marker {
    background: none !important;
    border: none !important;
}

/* ===== Toast-Einblendung ===== */
.toast-container .toast {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ===== Telefonie ===== */

/* --- Topbar Icon Pulse --- */
@keyframes phone-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.08); }
}
.phone-active {
    animation: phone-pulse 1.5s ease-in-out infinite;
    color: var(--ct-success) !important;
}

/* --- Offcanvas --- */
.phone-offcanvas {
    width: 420px !important;
    z-index: 1055;
}

/* --- Incoming Call Popup (bottom-right) --- */
.phone-popup {
    position: fixed;
    bottom: 0;
    right: 0;
    margin: 1rem;
    z-index: 1060;
    width: 400px;
    animation: phoneSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes phoneSlideUp {
    from { transform: translateY(100%) scale(0.95); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}
.phone-popup .card {
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2), 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--ct-border-color);
    overflow: hidden;
}

/* --- Ringing Card (Popup + Offcanvas) --- */
.call-ringing {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}
.call-ringing::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(72, 184, 96, 0.08) 0%, rgba(72, 184, 96, 0.02) 100%);
    pointer-events: none;
}
.call-ringing--active::before {
    background: linear-gradient(135deg, rgba(72, 184, 96, 0.12) 0%, rgba(72, 184, 96, 0.04) 100%);
}

/* Animated ring indicator bar */
.call-ring-bar {
    height: 3px;
    background: linear-gradient(90deg, #48b860 0%, #3b9d4f 50%, #48b860 100%);
    background-size: 200% 100%;
    animation: ringBarSlide 1.2s ease-in-out infinite;
}
@keyframes ringBarSlide {
    0%   { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* Connected → solid green bar */
.call-ring-bar--connected {
    animation: none;
    background: #48b860;
}

/* Ring icon animation */
@keyframes ringShake {
    0%, 100% { transform: rotate(0deg); }
    10%      { transform: rotate(-12deg); }
    20%      { transform: rotate(12deg); }
    30%      { transform: rotate(-10deg); }
    40%      { transform: rotate(10deg); }
    50%      { transform: rotate(0deg); }
}
.call-ring-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(72, 184, 96, 0.12);
    color: #48b860;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.call-ring-icon--ringing {
    animation: ringShake 1s ease-in-out infinite;
    background: rgba(72, 184, 96, 0.18);
}
.call-ring-icon--ringing::after {
    content: '';
    position: absolute;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid rgba(72, 184, 96, 0.3);
    animation: ringRipple 1.5s ease-out infinite;
}
@keyframes ringRipple {
    0%   { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.8); opacity: 0; }
}

/* Extension pills in call card */
.call-ext-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    background: rgba(72, 184, 96, 0.1);
    color: #2E7D32;
    border: 1px solid rgba(72, 184, 96, 0.2);
}
.call-ext-pill i {
    font-size: 0.8rem;
}
.call-ext-pill--active {
    background: rgba(72, 184, 96, 0.2);
    border-color: rgba(72, 184, 96, 0.4);
    color: #1B6B2E;
}

/* --- Call Timer --- */
.call-timer {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    font-size: 0.85rem;
}

/* --- Missed Call Groups --- */
.missed-group + .missed-group {
    border-top: 1px solid var(--ct-border-color);
    padding-top: 0.75rem;
    margin-top: 0.75rem;
}
.missed-group__times {
    font-size: 0.78rem;
    color: var(--ct-secondary-color, #6c757d);
}

/* --- Order context mini-list in call card --- */
.call-orders-mini {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.78rem;
}
.call-orders-mini li {
    padding: 2px 0;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    color: var(--ct-secondary-color, #6c757d);
}
.call-orders-mini li .order-date {
    color: var(--ct-body-color);
    font-weight: 500;
    flex-shrink: 0;
}

/* --- Dark mode overrides --- */
html[data-bs-theme="dark"] .call-ringing::before {
    background: linear-gradient(135deg, rgba(72, 184, 96, 0.1) 0%, rgba(72, 184, 96, 0.03) 100%);
}
html[data-bs-theme="dark"] .call-ring-icon {
    background: rgba(72, 184, 96, 0.15);
}
html[data-bs-theme="dark"] .call-ext-pill {
    background: rgba(72, 184, 96, 0.12);
    color: #66BB6A;
    border-color: rgba(72, 184, 96, 0.25);
}

/* ===== Number-Input ohne Spinner ===== */
input.no-spinners::-webkit-outer-spin-button,
input.no-spinners::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input.no-spinners {
    -moz-appearance: textfield;
}
