/* =====================================================================
   Reifenretter Partner-Dashboard – Styles
   Alles ist unter .rrd-app gescoped, damit nichts im restlichen
   wp-admin ueberschrieben wird. Farben kommen aus CSS-Variablen
   (per PHP injiziert) – mit konkreten Defaults als Fallback.
   Markenfarben: #405FF2 (Akzent) / #050B20 (Navy). Flache Flaechen.
   ===================================================================== */

.rrd-app {
    /* Default-Werte = Reifenretter-Marke. Per Plugin-Inline-Style ueberschreibbar. */
    --rrd-primary: #405FF2;
    --rrd-primary-dark: #2a40c9;
    --rrd-navy: #050B20;
    --rrd-tint: #eef1fe;
    --rrd-ink: #0c1326;
    --rrd-muted: #6b7280;
    --rrd-bg: #f5f6f9;
    --rrd-card: #ffffff;
    --rrd-border: #e7e9f0;
    --rrd-font: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    font-family: var(--rrd-font);
    color: var(--rrd-ink);
    background: var(--rrd-bg);
    margin: 16px 20px 40px 2px;
    border-radius: 24px;
    -webkit-font-smoothing: antialiased;
    line-height: 1.4;
}
.rrd-app *,
.rrd-app *::before,
.rrd-app *::after { box-sizing: border-box; }

/* ---- Shell ---- */
.rrd-shell {
    display: flex;
    min-height: 720px;
    background: var(--rrd-bg);
    border-radius: 24px;
    overflow: hidden;
}

/* ---- Sidebar ---- */
.rrd-sidebar {
    width: 232px;
    flex: 0 0 232px;
    background: var(--rrd-card);
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--rrd-border);
}
.rrd-nav-label {
    font-size: 11px; font-weight: 700; letter-spacing: .12em;
    color: var(--rrd-muted); text-transform: uppercase;
    padding: 16px 10px 8px;
}
.rrd-nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 12px; border-radius: 12px;
    color: var(--rrd-muted); font-weight: 600; font-size: 14.5px;
    text-decoration: none; cursor: pointer; position: relative;
    transition: background .15s ease, color .15s ease;
}
.rrd-nav-item .dashicons, .rrd-nav-item .ti { font-size: 18px; width: 18px; height: 18px; }
.rrd-nav-item:hover { background: var(--rrd-tint); color: var(--rrd-primary-dark); }
.rrd-nav-item.is-active { background: var(--rrd-tint); color: var(--rrd-primary-dark); }
.rrd-nav-item.is-active::before {
    content: ""; position: absolute; left: -18px; top: 8px; bottom: 8px;
    width: 4px; border-radius: 0 4px 4px 0; background: var(--rrd-primary);
}
.rrd-nav-item.is-soon { opacity: .55; cursor: default; }
.rrd-nav-item.is-soon:hover { background: transparent; color: var(--rrd-muted); }
.rrd-pill-soon {
    margin-left: auto; font-size: 10px; font-weight: 700;
    background: var(--rrd-border); color: var(--rrd-muted);
    padding: 2px 7px; border-radius: 20px;
}
/* ---- Premium ---- */
.rrd-nav-premium .dashicons { color: var(--rrd-primary); }
.rrd-nav-premium.is-active .dashicons { color: var(--rrd-primary-dark); }
.rrd-premium-badge {
    display: inline-flex; align-items: center; gap: 7px;
    background: var(--rrd-tint); color: var(--rrd-primary-dark);
    font-weight: 700; font-size: 12.5px;
    padding: 7px 14px; border-radius: 20px;
}
.rrd-premium-badge .dashicons { font-size: 15px; width: 15px; height: 15px; }

/* Premium-Platzhalter */
.rrd-premium-empty { text-align: center; padding: 48px 28px; }
.rrd-premium-empty .rrd-premium-badge { margin-bottom: 18px; }
.rrd-premium-h { margin: 0 0 8px; font-size: 20px; font-weight: 700; color: var(--rrd-ink); }
.rrd-premium-p { margin: 0 auto; max-width: 46ch; color: var(--rrd-muted); font-size: 14.5px; line-height: 1.6; }

/* Gebietsschutz – derzeit deaktiviert. Bausteine bleiben fuer eine spaetere
   Reaktivierung erhalten (siehe assets/gebietsschutz.js und rrd_partner_coords()). */
.rrd-gs-card .rrd-card-head { align-items: center; }
.rrd-gs-hero {
    display: flex; flex-direction: column; gap: 2px;
    padding: 18px 0 6px;
}
.rrd-gs-num {
    font-size: 40px; font-weight: 800; line-height: 1; color: var(--rrd-ink);
    letter-spacing: -.02em;
}
.rrd-gs-unit { font-size: 20px; font-weight: 700; color: var(--rrd-muted); margin-left: 6px; }
.rrd-gs-cap { font-size: 13.5px; color: var(--rrd-muted); margin-top: 6px; }
.rrd-gs-map {
    height: 400px; width: 100%; margin-top: 18px;
    border: 1px solid var(--rrd-border); border-radius: 14px; overflow: hidden;
    background: var(--rrd-bg); z-index: 0;
}
.rrd-gs-foot {
    display: flex; align-items: flex-start; gap: 8px;
    margin: 14px 0 0; font-size: 13px; color: var(--rrd-muted); line-height: 1.5;
}
.rrd-gs-foot .dashicons { font-size: 16px; width: 16px; height: 16px; color: var(--rrd-primary); flex: 0 0 16px; margin-top: 1px; }
.rrd-gs-noloc {
    display: flex; align-items: center; gap: 12px; margin-top: 18px;
    background: var(--rrd-tint); border: 1px solid var(--rrd-border);
    border-radius: 14px; padding: 18px 20px; color: var(--rrd-ink); font-size: 14px; line-height: 1.5;
}
.rrd-gs-noloc .dashicons { font-size: 26px; width: 26px; height: 26px; color: var(--rrd-primary); flex: 0 0 26px; }
.rrd-sidebar-foot {
    margin-top: auto; background: var(--rrd-navy); color: #aeb8e0;
    border-radius: 16px; padding: 16px; font-size: 12.5px; line-height: 1.5;
}
.rrd-sidebar-foot strong { color: #fff; display: block; margin-bottom: 4px; font-size: 13px; }

/* ---- Main ---- */
.rrd-main { flex: 1; padding: 22px 26px 30px; min-width: 0; }

.rrd-topbar { display: flex; align-items: center; gap: 18px; margin-bottom: 24px; }
.rrd-search {
    flex: 1; max-width: 420px; display: flex; align-items: center; gap: 10px;
    background: var(--rrd-card); border: 1px solid var(--rrd-border);
    border-radius: 14px; padding: 11px 16px; color: var(--rrd-muted);
}
.rrd-search input {
    border: 0; background: transparent; outline: none; flex: 1;
    font: inherit; font-size: 14px; color: var(--rrd-ink);
}
.rrd-topbar-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.rrd-icon-btn {
    width: 42px; height: 42px; border-radius: 12px; background: var(--rrd-card);
    border: 1px solid var(--rrd-border); display: grid; place-items: center;
    color: var(--rrd-muted);
}
.rrd-user { display: flex; align-items: center; gap: 11px; }
.rrd-user-name { font-weight: 700; font-size: 14px; line-height: 1.2; }
.rrd-user-mail { font-size: 12px; color: var(--rrd-muted); }
.rrd-avatar {
    width: 44px; height: 44px; border-radius: 50%; overflow: hidden;
    background: var(--rrd-primary); color: #fff; display: grid; place-items: center;
    font-weight: 700; font-size: 16px;
}
.rrd-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---- Header ---- */
.rrd-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.rrd-title { font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.rrd-subtitle { color: var(--rrd-muted); font-size: 14px; margin: 6px 0 0; }
.rrd-header-actions { display: flex; gap: 10px; }
.rrd-btn {
    border: 1px solid var(--rrd-border); background: var(--rrd-card);
    color: var(--rrd-ink); font: inherit; font-weight: 700; font-size: 13.5px;
    padding: 11px 18px; border-radius: 12px; cursor: pointer;
    display: inline-flex; align-items: center; gap: 8px;
}
.rrd-btn.is-primary { background: var(--rrd-primary); color: #fff; border-color: var(--rrd-primary); }

/* ---- Zeitraum-Wähler (Kalender) ---- */
.rrd-cal { position: relative; }
.rrd-cal > summary { list-style: none; user-select: none; }
.rrd-cal > summary::-webkit-details-marker { display: none; }
.rrd-cal-caret { font-size: 16px !important; width: 16px; height: 16px; transition: transform .2s; opacity: .7; }
.rrd-cal[open] > summary .rrd-cal-caret { transform: rotate(180deg); }
.rrd-cal-current { white-space: nowrap; }
.rrd-cal-pop {
    position: absolute; top: calc(100% + 8px); right: 0; z-index: 60;
    width: 320px; max-width: 86vw;
    background: var(--rrd-card); border: 1px solid var(--rrd-border);
    border-radius: 14px; box-shadow: 0 12px 34px rgba(5,11,32,.14);
    padding: 16px; animation: rrd-cal-in .16s ease; text-align: left;
}
@keyframes rrd-cal-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.rrd-cal-sec { padding: 2px 0; }
.rrd-cal-sec + .rrd-cal-sec { border-top: 1px solid var(--rrd-border); margin-top: 10px; padding-top: 12px; }
.rrd-cal-h { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--rrd-muted); margin: 0 0 9px; }
.rrd-cal-form .rrd-cal-h + .rrd-cal-input,
.rrd-cal-form .rrd-cal-input + .rrd-cal-h { margin-top: 2px; }
.rrd-cal-presets { display: flex; flex-wrap: wrap; gap: 7px; }
.rrd-cal-chip {
    font-size: 13px; font-weight: 600; color: var(--rrd-ink); text-decoration: none;
    background: var(--rrd-bg); border: 1px solid var(--rrd-border);
    padding: 7px 12px; border-radius: 9px; transition: .15s;
}
.rrd-cal-chip:hover { border-color: var(--rrd-primary); color: var(--rrd-primary); }
.rrd-cal-chip.is-active { background: var(--rrd-primary); border-color: var(--rrd-primary); color: #fff; }
.rrd-cal-input {
    width: 100%; font: inherit; font-size: 13.5px; color: var(--rrd-ink);
    background: var(--rrd-card); border: 1px solid var(--rrd-border);
    border-radius: 9px; padding: 9px 10px; margin-bottom: 10px; box-sizing: border-box;
}
.rrd-cal-input:focus { outline: none; border-color: var(--rrd-primary); box-shadow: 0 0 0 3px var(--rrd-tint); }
.rrd-cal-range { display: flex; gap: 10px; }
.rrd-cal-range label { flex: 1; min-width: 0; font-size: 11.5px; font-weight: 600; color: var(--rrd-muted); display: flex; flex-direction: column; gap: 5px; }
.rrd-cal-range .rrd-cal-input { min-width: 0; max-width: 100%; }
.rrd-cal-apply {
    width: 100% !important; box-sizing: border-box !important; margin: 4px 0 0 !important;
    display: inline-flex !important; align-items: center !important; justify-content: center !important; gap: 8px !important;
    padding: 11px 18px !important; border-radius: 12px !important;
    font-family: var(--rrd-font) !important; font-size: 13.5px !important; font-weight: 700 !important;
    line-height: 1.2 !important; letter-spacing: 0 !important; text-transform: none !important; text-decoration: none !important;
    background: var(--rrd-primary) !important; border: 1px solid var(--rrd-primary) !important; color: #fff !important;
    box-shadow: none !important; cursor: pointer !important;
}
.rrd-cal-apply:hover { background: var(--rrd-primary-dark) !important; border-color: var(--rrd-primary-dark) !important; color: #fff !important; }
.rrd-cal-apply .dashicons { color: #fff !important; }

/* --- Picker theme-fest: identisches Aussehen im Frontend wie im wp-admin ---
   Der Zeitraum-Picker ist in Admin und Partner derselbe Baustein. Im wp-admin
   rendert er sauber; im Frontend kann das Theme Buttons/Selects/Inputs
   überschreiben (wie zuvor beim Anwenden-Button). Diese Regeln erzwingen das
   beabsichtigte (= Admin-)Aussehen, eng auf den Picker begrenzt. */
.rrd-cal > summary.rrd-cal-toggle {
    background: var(--rrd-card) !important; color: var(--rrd-ink) !important;
    border: 1px solid var(--rrd-border) !important; border-radius: 12px !important;
    box-shadow: none !important; text-decoration: none !important; font-weight: 700 !important;
}
.rrd-cal .rrd-cal-chip {
    display: inline-block !important; line-height: 1.2 !important;
    font-size: 13px !important; font-weight: 600 !important; text-transform: none !important;
    color: var(--rrd-ink) !important; text-decoration: none !important; box-shadow: none !important;
    background: var(--rrd-bg) !important; border: 1px solid var(--rrd-border) !important;
    padding: 7px 12px !important; border-radius: 9px !important;
}
.rrd-cal .rrd-cal-chip:hover {
    color: var(--rrd-primary) !important; border-color: var(--rrd-primary) !important; background: var(--rrd-bg) !important;
}
.rrd-cal .rrd-cal-chip.is-active,
.rrd-cal .rrd-cal-chip.is-active:hover {
    color: #fff !important; background: var(--rrd-primary) !important; border-color: var(--rrd-primary) !important;
}
.rrd-cal .rrd-cal-input {
    width: 100% !important; box-sizing: border-box !important; height: auto !important; min-height: 0 !important;
    font: inherit !important; font-size: 13.5px !important; line-height: 1.3 !important;
    color: var(--rrd-ink) !important; background-color: var(--rrd-card) !important;
    border: 1px solid var(--rrd-border) !important; border-radius: 9px !important;
    padding: 9px 10px !important; margin: 0 0 10px !important; box-shadow: none !important;
}
.rrd-cal .rrd-cal-input:focus {
    border-color: var(--rrd-primary) !important; box-shadow: 0 0 0 3px var(--rrd-tint) !important; outline: none !important;
}
/* Select: einheitlicher Pfeil statt Theme-/Browser-Default */
.rrd-cal select.rrd-cal-input {
    -webkit-appearance: none !important; -moz-appearance: none !important; appearance: none !important;
    padding-right: 34px !important;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23647189' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important; background-position: right 12px center !important; background-size: 12px 12px !important;
}
.rrd-cal input[type="date"].rrd-cal-input::-webkit-calendar-picker-indicator { opacity: .55; cursor: pointer; }

/* Dichte Balken (viele Tage im Zeitraum) */
.rrd-bars.is-dense { gap: 5px; }
.rrd-bars.is-dense .rrd-bar-label { font-size: 9px; font-weight: 600; }

/* ---- KPI cards ---- */
.rrd-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.rrd-kpi {
    background: var(--rrd-card); border: 1px solid var(--rrd-border);
    border-radius: 18px; padding: 20px; position: relative; overflow: hidden;
}
.rrd-kpi-top { display: flex; align-items: flex-start; justify-content: space-between; }
.rrd-kpi-label { font-size: 14px; font-weight: 600; color: var(--rrd-muted); }
.rrd-kpi-arrow {
    width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--rrd-border);
    display: grid; place-items: center; color: var(--rrd-muted); flex: none;
}
.rrd-kpi-value { font-size: 38px; font-weight: 800; letter-spacing: -.03em; margin: 14px 0 8px; }
.rrd-kpi-sub { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; row-gap: 3px; font-size: 12.5px; color: var(--rrd-muted); }
.rrd-delta { font-weight: 700; display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px; border-radius: 20px; font-size: 11.5px; }
.rrd-delta.up { color: var(--rrd-primary-dark); background: var(--rrd-tint); }
.rrd-delta.down { color: #b4452f; background: #fbe9e4; }
.rrd-delta.flat { color: var(--rrd-muted); background: var(--rrd-border); }

.rrd-kpi.is-hero { background: var(--rrd-navy); border-color: transparent; color: #eaeefb; }
.rrd-kpi.is-hero .rrd-kpi-label { color: #aeb8e0; }
.rrd-kpi.is-hero .rrd-kpi-value { color: #fff; }
.rrd-kpi.is-hero .rrd-kpi-sub { color: #aeb8e0; }
.rrd-kpi.is-hero .rrd-kpi-arrow { border-color: rgba(255,255,255,.3); color: #eaeefb; }
.rrd-kpi.is-hero .rrd-delta.up { color: #fff; background: rgba(64,95,242,.45); }
.rrd-kpi.is-hero::after {
    content: ""; position: absolute; right: -40px; bottom: -60px;
    width: 160px; height: 160px; border-radius: 50%;
    background: rgba(64,95,242,.14);
}

/* ---- Grids ---- */
.rrd-grid-2 { display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px; margin-bottom: 16px; }
.rrd-card {
    background: var(--rrd-card); border: 1px solid var(--rrd-border);
    border-radius: 18px; padding: 22px;
}
.rrd-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.rrd-card-title { font-size: 17px; font-weight: 800; letter-spacing: -.01em; margin: 0; }
.rrd-card-sub { font-size: 12.5px; color: var(--rrd-muted); }

/* ---- Bar chart ---- */
.rrd-legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--rrd-muted); }
.rrd-legend-item { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.rrd-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.rrd-dot.tel { background: var(--rrd-primary); }
.rrd-dot.auf { background: var(--rrd-navy); }

.rrd-bars { display: flex; align-items: flex-end; gap: 14px; height: 200px; padding-top: 26px; }
.rrd-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 10px; height: 100%; }
.rrd-bar-track {
    position: relative; width: 100%; max-width: 46px; flex: 1;
    background: repeating-linear-gradient(135deg, var(--rrd-tint), var(--rrd-tint) 6px, #fff 6px, #fff 12px);
    border-radius: 14px; display: flex; align-items: flex-end; overflow: visible;
}
.rrd-bar-fill {
    width: 100%; border-radius: 14px; overflow: hidden;
    display: flex; flex-direction: column; justify-content: flex-end;
    transform-origin: bottom; transform: scaleY(0);
    animation: rrd-grow .6s cubic-bezier(.2,.8,.2,1) forwards;
}
.rrd-seg-tel { background: var(--rrd-primary); width: 100%; }
.rrd-seg-auf { background: var(--rrd-navy); width: 100%; }
.rrd-bubble {
    position: absolute; top: -24px; left: 50%; transform: translateX(-50%);
    background: var(--rrd-card); border: 1px solid var(--rrd-border);
    border-radius: 20px; padding: 3px 9px; font-size: 11px; font-weight: 700;
    color: var(--rrd-primary-dark); white-space: nowrap;
}
.rrd-bar-label { font-size: 12px; font-weight: 600; color: var(--rrd-muted); }
@keyframes rrd-grow { to { transform: scaleY(1); } }

/* ---- Donut ---- */
.rrd-donut-wrap { display: flex; flex-direction: column; align-items: center; }
.rrd-donut { position: relative; width: 200px; height: 200px; }
.rrd-donut svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.rrd-donut-center {
    position: absolute; inset: 0; display: flex; flex-direction: column;
    align-items: center; justify-content: center; text-align: center;
}
.rrd-donut-num { font-size: 34px; font-weight: 800; letter-spacing: -.02em; }
.rrd-donut-cap { font-size: 12px; color: var(--rrd-muted); font-weight: 600; }
.rrd-donut-legend { display: flex; gap: 22px; margin-top: 18px; }
.rrd-donut-legend .rrd-legend-item { flex-direction: column; align-items: center; gap: 4px; }
.rrd-donut-legend b { font-size: 16px; color: var(--rrd-ink); }

/* ---- Top partner list ---- */
.rrd-top-item { display: flex; align-items: center; gap: 13px; padding: 11px 0; border-bottom: 1px solid var(--rrd-border); }
.rrd-top-item:last-child { border-bottom: 0; }
.rrd-rank { width: 22px; font-weight: 800; color: var(--rrd-muted); font-size: 14px; text-align: center; }
.rrd-ava { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 14px; flex: none; }
.rrd-top-body { flex: 1; min-width: 0; }
.rrd-top-name { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rrd-top-meta { font-size: 12px; color: var(--rrd-muted); }
.rrd-top-count { font-weight: 800; font-size: 15px; }
.rrd-top-count small { display: block; font-weight: 600; font-size: 11px; color: var(--rrd-muted); text-align: right; }

/* ---- Activity feed ---- */
.rrd-feed-item { display: flex; align-items: center; gap: 13px; padding: 10px 0; border-bottom: 1px solid var(--rrd-border); }
.rrd-feed-item:last-child { border-bottom: 0; }
.rrd-feed-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.rrd-feed-icon.tel { background: var(--rrd-tint); color: var(--rrd-primary-dark); }
.rrd-feed-icon.auf { background: var(--rrd-navy); color: #aeb8e0; }
.rrd-feed-body { flex: 1; min-width: 0; }
.rrd-feed-name { font-weight: 700; font-size: 13.5px; }
.rrd-feed-sub { font-size: 12px; color: var(--rrd-muted); }
.rrd-feed-time { font-size: 12px; color: var(--rrd-muted); white-space: nowrap; }

/* ---- Empty state ---- */
.rrd-empty { text-align: center; color: var(--rrd-muted); padding: 40px 10px; font-size: 14px; }
.rrd-empty .dashicons { font-size: 34px; width: 34px; height: 34px; opacity: .5; margin-bottom: 8px; }

/* ---- Tooltip ---- */
.rrd-tip {
    position: fixed; z-index: 99999; pointer-events: none; opacity: 0;
    background: var(--rrd-ink); color: #fff; font-size: 12px; font-weight: 600;
    padding: 7px 10px; border-radius: 8px; transform: translate(-50%, -8px);
    transition: opacity .12s ease; white-space: nowrap;
}
.rrd-tip.show { opacity: 1; }

/* ---- Responsive ---- */

/* Tab-Leiste standardmäßig versteckt (Desktop nutzt die Sidebar).
   MUSS vor der 782px-Query stehen, sonst überschreibt sie das display:flex. */
.rrd-tabnav { display: none; }

@media (max-width: 1100px) {
    .rrd-kpis { grid-template-columns: repeat(2, 1fr); }
    .rrd-grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 782px) {
    .rrd-sidebar { display: none; }
    .rrd-app { margin: 10px; }
    .rrd-frontend .rrd-app { margin: 10px; }

    /* Drei Übersichts-Karten auf Mobil ausblenden (Wunsch: schlankere Ansicht) */
    .rrd-hide-mobile { display: none !important; }

    /* Tab-Leiste einblenden – ersetzt die ausgeblendete Sidebar (kein Hamburger) */
    .rrd-tabnav { display: flex; }
}

/* ===================================================================
   Mobile Tab-Navigation (segmentierte Leiste, nur < 782px sichtbar)
   =================================================================== */
.rrd-tabnav {
    display: flex; align-items: center; gap: 8px;
    margin: 0 0 20px; padding: 6px;
    background: var(--rrd-bg); border: 1px solid var(--rrd-border);
    border-radius: 16px;
}
.rrd-tabnav-scroll {
    display: flex; gap: 6px; flex: 1 1 auto;
    overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.rrd-tabnav-scroll::-webkit-scrollbar { display: none; }
.rrd-tab {
    display: inline-flex; align-items: center; gap: 8px;
    flex: 1 0 auto; justify-content: center; white-space: nowrap;
    padding: 11px 18px; border-radius: 11px;
    font-size: 14.5px; font-weight: 650; text-decoration: none;
    color: var(--rrd-navy); transition: background .14s, color .14s, box-shadow .14s;
}
.rrd-tab .dashicons { font-size: 18px; width: 18px; height: 18px; }
.rrd-tab:hover { color: var(--rrd-primary-dark); }
.rrd-tab.is-active {
    background: var(--rrd-card); color: var(--rrd-primary);
    box-shadow: 0 2px 8px rgba(5, 11, 32, .08);
}
.rrd-tab.is-soon { opacity: .5; cursor: default; }
.rrd-tab-logout {
    flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; border-radius: 11px;
    color: #b42318; background: var(--rrd-card); text-decoration: none;
    border: 1px solid var(--rrd-border); transition: background .14s;
}
.rrd-tab-logout:hover { background: #fef3f2; }
.rrd-tab-logout .dashicons { font-size: 19px; width: 19px; height: 19px; }


/* =====================================================================
   INKREMENT A – Login-Seite, Frontend-Rahmen, Logout, "Auf einen Blick"
   ===================================================================== */

/* Frontend-Rahmen (zentriert die App auf einer Canvas-Seite) */
.rrd-frontend { width: 100%; margin: 0; }
.rrd-frontend .rrd-app { margin: 24px; }

/* Logout-Eintrag in der Sidebar */
.rrd-nav-item.rrd-logout { color: var(--rrd-muted); text-decoration: none; margin-top: 6px; }
.rrd-nav-item.rrd-logout:hover { background: #fbe9e4; color: #b4452f; }

/* "Auf einen Blick" Liste */
.rrd-glance-item { display: flex; align-items: center; justify-content: space-between; padding: 13px 0; border-bottom: 1px solid var(--rrd-border); }
.rrd-glance-item:last-child { border-bottom: 0; }
.rrd-glance-label { display: flex; align-items: center; gap: 11px; font-size: 13.5px; font-weight: 600; color: var(--rrd-muted); }
.rrd-glance-ico { width: 34px; height: 34px; border-radius: 10px; background: var(--rrd-tint); color: var(--rrd-primary-dark); display: grid; place-items: center; }
.rrd-glance-val { font-weight: 800; font-size: 18px; }

/* =====================================================================
   Login-Seite
   ===================================================================== */
.rrd-login {
    --rrd-primary: #405FF2; --rrd-primary-dark: #2a40c9; --rrd-navy: #050B20;
    --rrd-tint: #eef1fe; --rrd-ink: #0c1326; --rrd-muted: #6b7280;
    --rrd-bg: #f5f6f9; --rrd-card: #ffffff; --rrd-border: #e7e9f0;
    --rrd-font: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-family: var(--rrd-font); color: var(--rrd-ink);
    min-height: 78vh; display: flex; align-items: center; justify-content: center;
    padding: 40px 20px;
}
.rrd-login * { box-sizing: border-box; }
.rrd-login-card {
    width: 100%; max-width: 400px; background: var(--rrd-card);
    border: 1px solid var(--rrd-border); border-radius: 22px; padding: 38px 34px;
}
.rrd-login-title { font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 6px; }
.rrd-login-sub { color: var(--rrd-muted); font-size: 14px; margin: 0 0 22px; }
.rrd-login-error { background: #fbe9e4; color: #b4452f; border-radius: 10px; padding: 11px 14px; font-size: 13px; font-weight: 600; margin-bottom: 18px; }
.rrd-login-label { display: block; font-size: 13px; font-weight: 700; margin: 14px 0 6px; }
.rrd-login-input { width: 100%; border: 1px solid var(--rrd-border); border-radius: 12px; padding: 12px 14px; font: inherit; font-size: 15px; color: var(--rrd-ink); background: #fff; }
.rrd-login-input:focus { outline: none; border-color: var(--rrd-primary); box-shadow: 0 0 0 3px rgba(64,95,242,.15); }
.rrd-login-remember { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--rrd-muted); margin: 16px 0; }
.rrd-login-btn { width: 100%; background: var(--rrd-primary); color: #fff; border: 0; border-radius: 12px; padding: 13px; font: inherit; font-weight: 800; font-size: 15px; cursor: pointer; transition: background .15s ease; }
.rrd-login-btn:hover { background: var(--rrd-primary-dark); }
.rrd-login-forgot { display: block; text-align: center; margin-top: 16px; font-size: 13px; color: var(--rrd-muted); text-decoration: none; }
.rrd-login-forgot:hover { color: var(--rrd-primary-dark); }

/* =====================================================================
   THEME-OVERRIDE-SCHUTZ
   Unsere Frontend-Bereiche gegen fremde Theme-Styles absichern. Scope
   bleibt strikt auf .rrd-login / .rrd-frontend. Dashicons werden von der
   Schrift-Erzwingung ausgenommen, sonst brechen die Icon-Glyphen.
   ===================================================================== */
.rrd-login, .rrd-login *,
.rrd-frontend, .rrd-frontend *:not(.dashicons) {
    font-family: var(--rrd-font) !important;
    box-sizing: border-box;
}

/* Login-Karte / Felder / Button gegen Theme-Regeln festschreiben */
.rrd-login .rrd-login-card { background: #ffffff !important; }

.rrd-login .rrd-login-input {
    background: #ffffff !important;
    color: var(--rrd-ink) !important;
    border: 1px solid var(--rrd-border) !important;
    border-radius: 12px !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    box-shadow: none !important;
    padding: 12px 14px !important;
    font-size: 15px !important;
    line-height: 1.4 !important;
    width: 100% !important;
}
.rrd-login .rrd-login-input:focus {
    border-color: var(--rrd-primary) !important;
    box-shadow: 0 0 0 3px rgba(64,95,242,.15) !important;
}
/* Autofill-Gelb (Chrome/Safari) entfernen */
.rrd-login .rrd-login-input:-webkit-autofill,
.rrd-login .rrd-login-input:-webkit-autofill:hover,
.rrd-login .rrd-login-input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--rrd-ink) !important;
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
    box-shadow: 0 0 0 1000px #ffffff inset !important;
    border: 1px solid var(--rrd-border) !important;
}

.rrd-login .rrd-login-remember { margin: 16px 0 0 !important; }
.rrd-login .rrd-login-btn {
    margin-top: 18px !important;
    background: var(--rrd-primary) !important;
    color: #ffffff !important;
    border: 0 !important;
    border-radius: 12px !important;
    box-shadow: none !important;
    text-shadow: none !important;
    padding: 13px !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    width: 100% !important;
    cursor: pointer !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}
.rrd-login .rrd-login-btn:hover { background: var(--rrd-primary-dark) !important; }

.rrd-login a.rrd-login-forgot {
    color: var(--rrd-muted) !important;
    box-shadow: none !important;
    background: none !important;
}
.rrd-login a.rrd-login-forgot:hover { color: var(--rrd-primary-dark) !important; }

/* dezente Status-/Erfolgsmeldung */
.rrd-login-msg {
    background: var(--rrd-tint);
    color: var(--rrd-navy);
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 18px;
}


/* =====================================================================
   PLATTFORM-STATISTIK-KARTE (Partner-Dashboard)
   ===================================================================== */
.rrd-platform-hero { text-align: center; padding: 6px 0 16px; margin-bottom: 6px; border-bottom: 1px solid var(--rrd-border); }
.rrd-platform-num { display: block; font-size: 44px; font-weight: 800; letter-spacing: -.03em; color: var(--rrd-navy); line-height: 1; }
.rrd-platform-cap { display: block; margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--rrd-muted); }

/* =====================================================================
   PROFIL TEILEN (WhatsApp / Telegram / E-Mail) – Partner-Dashboard-Topbar
   ===================================================================== */
.rrd-share { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rrd-share-label { font-size: 13px; font-weight: 600; color: var(--rrd-muted); }
.rrd-share-btn {
    width: 38px; height: 38px; border-radius: 10px;
    background: var(--rrd-tint); color: var(--rrd-navy);
    display: grid; place-items: center;
    transition: background .15s ease, color .15s ease;
    text-decoration: none;
}
.rrd-share-btn svg { width: 18px; height: 18px; fill: currentColor; display: block; }
.rrd-share-btn:hover { color: #ffffff; }
.rrd-share-wa:hover   { background: #25D366; }
.rrd-share-tg:hover   { background: #229ED9; }
.rrd-share-mail:hover { background: var(--rrd-primary); }

@media (max-width: 600px) {
    .rrd-main { padding: 18px 16px 24px; }

    /* Topbar: Identität in einer Zeile oben, Teilen-Buttons darunter */
    .rrd-topbar { flex-wrap: wrap; gap: 14px; margin-bottom: 18px; }
    .rrd-topbar-right { order: 1; width: 100%; margin-left: 0; justify-content: space-between; }
    .rrd-share { order: 2; width: 100%; gap: 8px; }
    .rrd-share-label { display: none; }

    /* Header: Titel und Bedien-Buttons untereinander */
    .rrd-header { flex-direction: column; align-items: stretch; gap: 14px; }
    .rrd-header-actions { flex-wrap: wrap; }
    /* Da der Aktualisieren-Button auf Mobil entfällt, nutzt der Datums-Picker
       die volle Breite – wirkt ruhiger und vermeidet halbleere Zeilen. */
    .rrd-header-actions .rrd-cal { width: 100%; }
    .rrd-header-actions .rrd-cal-toggle { width: 100%; justify-content: flex-start; }

    /* Kalender-Panel am linken Rand verankern (läuft sonst aus dem Bild) */
    .rrd-cal-pop { left: 0; right: auto; width: min(320px, 90vw); }

    /* KPI-Karten kompakter */
    .rrd-kpi { padding: 16px; }
    .rrd-kpi-label { font-size: 13px; }
    .rrd-kpi-value { font-size: 30px; margin: 10px 0 7px; }

    /* Diagramm-Kopf: Titel und Legende dürfen umbrechen */
    .rrd-card-head { flex-wrap: wrap; gap: 8px 14px; }

    /* Diagramm: bei vielen Tagen horizontal scrollen statt aus der Karte zu laufen.
       Wenige Tage füllen weiter die Breite (flex-grow), viele behalten 24px und scrollen. */
    .rrd-bars { overflow-x: auto; overflow-y: hidden; gap: 9px; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
    .rrd-bars.is-dense { gap: 7px; }
    .rrd-bar-col { flex: 1 0 24px; min-width: 24px; }
}

/* ===================================================================
   Aufträge – Liste & Detailseite (Partner-Frontend, Premium)
   =================================================================== */
.rrd-btn-sm { padding: 6px 12px; font-size: 13px; }

/* --- Liste --- */
.rrd-auftrag-list { display: flex; flex-direction: column; gap: 8px; }
.rrd-auftrag-row {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 16px; border-radius: 14px;
    background: var(--rrd-card); border: 1px solid var(--rrd-border);
    text-decoration: none; color: var(--rrd-ink);
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.rrd-auftrag-row:hover {
    transform: translateY(-1px);
    border-color: var(--rrd-primary);
    box-shadow: 0 6px 18px rgba(5, 11, 32, .07);
}
.rrd-auftrag-icon {
    flex: 0 0 40px; width: 40px; height: 40px; border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    background: var(--rrd-tint); color: var(--rrd-primary);
}
.rrd-auftrag-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.rrd-auftrag-name { font-weight: 650; color: var(--rrd-navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rrd-auftrag-meta { font-size: 13px; color: var(--rrd-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rrd-auftrag-date {
    flex: 0 0 auto; font-size: 12.5px; color: var(--rrd-muted); white-space: nowrap;
    background: var(--rrd-bg); padding: 5px 10px; border-radius: 8px;
}
.rrd-auftrag-arrow { flex: 0 0 auto; color: var(--rrd-muted); display: flex; transition: transform .12s, color .12s; }
.rrd-auftrag-row:hover .rrd-auftrag-arrow { transform: translateX(2px); color: var(--rrd-primary); }

/* --- Detailseite: modernes randloses Grid (keine table → kein Theme-Zebra) --- */
.rrd-detail-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}
.rrd-detail-item {
    display: flex; flex-direction: column; gap: 5px;
    padding: 14px 16px; border-radius: 14px;
    background: var(--rrd-card); border: 1px solid var(--rrd-border);
}
.rrd-detail-item--full { grid-column: 1 / -1; }
.rrd-detail-item.is-empty { opacity: .55; }
.rrd-detail-label {
    font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
    color: var(--rrd-muted);
}
.rrd-detail-value { font-size: 15px; font-weight: 550; color: var(--rrd-navy); word-break: break-word; line-height: 1.45; }

@media (max-width: 700px) {
    .rrd-detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .rrd-auftrag-date { display: none; }
}

/* ===================================================================
   Auftrags-Uploads (Fotos + Unterschrift) in der Detailseite
   =================================================================== */
.rrd-af-photos { display: flex; flex-wrap: wrap; gap: 10px; }
.rrd-af-photo {
    display: block; width: 92px; height: 92px; border-radius: 10px; overflow: hidden;
    border: 1px solid var(--rrd-border); background: var(--rrd-bg);
    transition: transform .12s, box-shadow .12s;
}
.rrd-af-photo:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(5, 11, 32, .12); }
.rrd-af-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rrd-af-sig {
    max-width: 260px; width: 100%; border: 1px solid var(--rrd-border);
    border-radius: 10px; background: #fff; padding: 6px;
}
