:root {
    --bg-body: #f5f5f5; --bg-card: #ffffff; --bg-secondary: #f0f0f0; --bg-project: #f4f4f4;
    --text-main: #1a1a1a; --text-muted: #666666; --text-light: #999999;
    --border-color: #1a1a1a; --border-light: #e0e0e0; --accent-color: #000000;
    --header-height: 72px; --stats-bar-height: 40px; --logo-container-bg: transparent;
    --c-green: #107c10; --c-red: #d13438; --c-yellow: #d99e0b; --c-gray: #bebebe; --c-purple: #8764b8;
    --teams-purple: #5b5fc7;
}
[data-theme="dark"] {
    --bg-body: #121212; --bg-card: #1e1e1e; --bg-secondary: #2d2d2d; --bg-project: #2a2a2a;
    --text-main: #e0e0e0; --text-muted: #aaaaaa; --text-light: #888888;
    --border-color: #555555; --border-light: #333333; --accent-color: #ffffff;
    --logo-container-bg: rgba(255,255,255,0.08); --c-purple: #a78bfa;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background: var(--bg-body); min-height: 100vh; color: var(--text-main); transition: background 0.3s, color 0.3s; overflow-x: hidden; }
body.login-state { overflow: hidden; height: 100vh; width: 100vw; }
body.login-state header { display: none; }
body:not(.login-state) { display: flex; flex-direction: column; min-height: 100vh; }

/* Status Colors */
.stat-dot.green, .card-status-strip.Available, .status-indicator-dot.Available, .compact-status-dot.Available, .compact-status-strip.Available, .minimal-status-strip.Available { background: var(--c-green); }
.stat-dot.red, .card-status-strip.Busy, .card-status-strip.DoNotDisturb, .card-status-strip.InACall, .card-status-strip.InAMeeting, .card-status-strip.Presenting, .status-indicator-dot.Busy, .status-indicator-dot.DoNotDisturb, .status-indicator-dot.InACall, .compact-status-dot.Busy, .compact-status-dot.DoNotDisturb, .compact-status-dot.InACall, .compact-status-dot.InAMeeting, .compact-status-dot.Presenting, .compact-status-strip.Busy, .compact-status-strip.DoNotDisturb, .compact-status-strip.InACall, .compact-status-strip.InAMeeting, .compact-status-strip.Presenting, .minimal-status-strip.Busy, .minimal-status-strip.DoNotDisturb, .minimal-status-strip.InACall, .minimal-status-strip.InAMeeting, .minimal-status-strip.Presenting { background: var(--c-red); }
.stat-dot.yellow, .card-status-strip.Away, .card-status-strip.BeRightBack, .status-indicator-dot.Away, .compact-status-dot.Away, .compact-status-dot.BeRightBack, .compact-status-strip.Away, .compact-status-strip.BeRightBack, .minimal-status-strip.Away, .minimal-status-strip.BeRightBack { background: var(--c-yellow); }
.stat-dot.gray, .card-status-strip.Offline, .card-status-strip.PresenceUnknown, .status-indicator-dot.Offline, .compact-status-dot.Offline, .compact-status-dot.PresenceUnknown, .compact-status-strip.Offline, .compact-status-strip.PresenceUnknown, .minimal-status-strip.Offline, .minimal-status-strip.PresenceUnknown { background: var(--c-gray); }
.stat-dot.purple, .card-status-strip.OutOfOffice, .status-indicator-dot.OutOfOffice, .ooo-banner, .list-ooo-badge, .compact-status-dot.OutOfOffice, .compact-status-strip.OutOfOffice, .minimal-status-strip.OutOfOffice { background: var(--c-purple); }
.color-Available { color: var(--c-green); }
.color-Busy, .color-DoNotDisturb, .color-InACall, .color-InAMeeting, .color-Presenting { color: var(--c-red); }
.color-Away, .color-BeRightBack { color: #b87018; }
.color-Offline, .color-PresenceUnknown { color: var(--text-muted); }
.color-OutOfOffice { color: var(--c-purple); }

/* Header */
header { background: var(--bg-card); padding: 0 40px; height: var(--header-height); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(0,0,0,0.1); position: sticky; top: 0; z-index: 1000; }
[data-theme="dark"] header { border-bottom: 1px solid rgba(255,255,255,0.1); }
body.scrolled header { box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
.logo-container { flex: 0 1 auto; padding-right: 20px; z-index: 2; }
.brand-logo-wrapper { display: flex; align-items: center; gap: 14px; padding: 6px 12px; border-radius: 4px; background: var(--logo-container-bg); }
.brand-logo-img { display: none; }
.brand-logo-img.logo-single { display: block; width: 28px; height: 28px; object-fit: contain; }
.brand-logo-text { font-family: 'Manrope', sans-serif; font-weight: 800; font-size: clamp(16px, 1.5vw, 22px); text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-main); }
.header-compact-info { opacity: 0; pointer-events: none; display: flex; align-items: center; justify-content: center; gap: 20px; transition: opacity 0.4s; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 1; }
body.scrolled .header-compact-info { opacity: 1; }
.compact-title { font-weight: 700; font-size: 12px; text-transform: uppercase; color: var(--text-main); }
.compact-divider { width: 1px; height: 16px; background: var(--border-light); opacity: 0.5; }
.compact-meta { display: flex; align-items: center; gap: 16px; font-size: 11px; color: var(--text-muted); text-transform: uppercase; font-weight: 500; }
.compact-meta svg { width: 12px; height: 12px; margin-right: 5px; opacity: 0.6; }
.header-right-group { display: flex; align-items: center; gap: 20px; flex-shrink: 0; padding-left: 20px; background: var(--bg-card); z-index: 2; }
.header-stats { display: none !important; }
.stat-dot { width: 8px; height: 8px; border-radius: 50%; }
.compact-percent-stats { display: flex; align-items: center; gap: 12px; font-size: 11px; color: var(--text-muted); text-transform: uppercase; font-weight: 500; }
.compact-pct span { font-weight: 600; }
.compact-pct-divider { opacity: 0.25; font-size: 10px; }
@media (max-width: 1100px) { .compact-percent-stats, .compact-divider-pct { display: none !important; } }

/* Theme Switch */
.theme-switch { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 600; text-transform: uppercase; cursor: pointer; color: var(--text-light); }
.theme-switch .switch-icon { display: none; padding: 4px; }
.theme-switch .switch-icon svg { width: 18px; height: 18px; }
.theme-switch .switch-divider { opacity: 0.3; }
html[data-theme="light"] .switch-light.switch-text, html[data-theme="dark"] .switch-dark.switch-text { color: var(--text-main); border-bottom: 1px solid var(--text-main); }
#loginBtn { padding: 8px 16px; background: var(--text-main); color: var(--bg-card); border: 1px solid var(--text-main); cursor: pointer; font-size: 12px; font-weight: 600; text-transform: uppercase; }

/* Dashboard Header */
.dashboard-header { background: var(--bg-secondary); border-bottom: 1px solid var(--border-light); padding: 40px 20px; text-align: center; }
.dashboard-header h1 { font-size: 28px; font-weight: 800; color: var(--text-main); margin-bottom: 6px; text-transform: uppercase; }
.dashboard-header p { font-size: 14px; color: var(--text-muted); margin-bottom: 30px; }
.meta-row { display: flex; align-items: center; justify-content: center; gap: 20px; flex-wrap: wrap; color: var(--text-muted); font-size: 11px; text-transform: uppercase; }
.refresh-indicator { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border: 1px solid var(--border-light); background: var(--bg-card); font-size: 11px; color: var(--text-main); }
.refresh-indicator.refreshing { background: var(--bg-secondary); }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--text-main); animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.2; } }

/* Percent Banner */
.percent-banner { display: none; background: var(--bg-secondary); border-bottom: 1px solid var(--border-light); padding: 14px 40px 10px 40px; }
.percent-banner-inner { display: flex; justify-content: center; align-items: center; gap: 20px; max-width: 600px; margin: 0 auto; }
.percent-item { display: flex; align-items: center; gap: 5px; }
.percent-value { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.percent-label { font-size: 10px; text-transform: uppercase; color: var(--text-light); font-weight: 500; }
.percent-divider { width: 1px; height: 12px; background: var(--border-light); opacity: 0.4; }

/* Stats Bar */
.stats-bar { background: var(--bg-secondary); border-bottom: 1px solid rgba(0,0,0,0.06); padding: 6px 40px; display: none; min-height: var(--stats-bar-height); position: sticky; top: var(--header-height); z-index: 800; }
[data-theme="dark"] .stats-bar { border-bottom: 1px solid rgba(255,255,255,0.06); background: #252525; }
.stats-bar-inner { display: flex; justify-content: center; align-items: center; gap: 8px; max-width: 900px; margin: 0 auto; }
.stats-bar-item { display: flex; align-items: center; gap: 6px; padding: 0 12px; }
.stats-bar-label { font-size: 10px; text-transform: uppercase; color: var(--text-light); font-weight: 600; }
.stats-bar-value { font-size: 13px; font-weight: 700; color: var(--text-muted); }
[data-theme="dark"] .stats-bar-value { color: #fff; }
.stats-bar-item.clickable { cursor: pointer; transition: all 0.15s; border-radius: 6px; padding: 6px 10px; border: 1px solid transparent; min-width: 110px; justify-content: center; }
.stats-bar-item.clickable:hover { background: rgba(0,0,0,0.05); }
[data-theme="dark"] .stats-bar-item.clickable:hover { background: rgba(255,255,255,0.08); }
.stats-bar-item.clickable.filter-active { background: var(--bg-card); border-color: var(--border-color); box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.stats-bar-dot { width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; }
.stats-bar-dot.green { background: var(--c-green); }
.stats-bar-dot.red { background: var(--c-red); }
.stats-bar-dot.yellow { background: var(--c-yellow); }
.stats-bar-dot.purple { background: var(--c-purple); }
.stats-bar-dot.gray { background: var(--c-gray); }

/* Smart Filter */
.smart-filter-group { display: flex; gap: 0; }
.smart-filter-group select { appearance: none; padding: 10px 32px 10px 14px; border: 1px solid var(--border-light); font-size: 11px; font-weight: 600; text-transform: uppercase; font-family: inherit; background: var(--bg-card); color: var(--text-muted); cursor: pointer; min-width: 140px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.smart-filter-group select:first-child { border-right: 1px solid var(--border-light); margin-right: -1px; }
.smart-filter-group select:disabled { opacity: 0.5; cursor: not-allowed; }
.smart-filter-group select:focus { outline: none; border-color: var(--border-color); z-index: 1; }

/* Toolbar Chips */
.toolbar-chips { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; padding: 8px 0 0 0; width: 100%; }
.toolbar-chips:empty { display: none; padding: 0; }
.filter-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; background: var(--bg-secondary); border: 1px solid var(--border-light); border-radius: 12px; font-size: 10px; font-weight: 600; color: var(--text-main); text-transform: uppercase; animation: chipFadeIn 0.2s ease; }
@keyframes chipFadeIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
.chip-dot { width: 6px; height: 6px; border-radius: 50%; }
.chip-dot.green { background: var(--c-green); }
.chip-dot.red { background: var(--c-red); }
.chip-dot.yellow { background: var(--c-yellow); }
.chip-dot.purple { background: var(--c-purple); }
.chip-dot.gray { background: var(--c-gray); }
.chip-remove { width: 14px; height: 14px; border: none; background: transparent; color: var(--text-muted); cursor: pointer; padding: 0; font-size: 12px; border-radius: 50%; }
.chip-remove:hover { background: var(--text-main); color: var(--bg-card); }
.reset-all-btn { padding: 3px 8px; background: none; border: 1px dashed var(--border-color); border-radius: 12px; font-size: 9px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); cursor: pointer; }
.reset-all-btn:hover { border-style: solid; color: var(--text-main); }

/* Toolbar */
.toolbar-divider { width: 1px; height: 24px; background: var(--border-light); margin: 0 4px; }
.toolbar-count { display: none; font-size: 11px; color: var(--text-muted); font-weight: 600; margin-left: auto; }
.toolbar-count strong { color: var(--text-main); }
.mini-stats-group { display: none; }
.mini-stat { display: flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 4px; cursor: pointer; font-size: 11px; font-weight: 700; border: 1px solid transparent; }
.mini-stat:hover { background: rgba(0,0,0,0.05); }
[data-theme="dark"] .mini-stat:hover { background: rgba(255,255,255,0.08); }
.mini-stat.filter-active { background: var(--bg-card); border-color: var(--border-color); box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.mini-stat-dot { width: 8px; height: 8px; border-radius: 50%; }
.mini-stat-dot.green { background: var(--c-green); }
.mini-stat-dot.red { background: var(--c-red); }
.mini-stat-dot.yellow { background: var(--c-yellow); }
.mini-stat-dot.purple { background: var(--c-purple); }
.mini-stat-dot.gray { background: var(--c-gray); }

.toolbar { background: var(--bg-card); padding: 12px 20px; border-bottom: 1px solid var(--border-light); display: flex; flex-direction: column; align-items: center; gap: 12px; position: sticky; top: calc(var(--header-height) + var(--stats-bar-height)); z-index: 900; margin-top: -1px; }
body.scrolled .toolbar { box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.toolbar-top-row { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; width: 100%; }
.search-box { position: relative; width: 250px; max-width: 100%; }
.search-box input { width: 100%; padding: 10px 35px 10px 40px; border: 1px solid var(--border-light); font-size: 14px; font-family: inherit; background: var(--bg-card); color: var(--text-main); }
.search-box input:focus { outline: none; border-color: var(--border-color); }
.search-box .search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); width: 16px; height: 16px; }
.search-clear-btn { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--text-muted); cursor: pointer; display: none; }
.toggle-wrapper { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border-light); padding: 5px 12px; background: var(--bg-card); height: 40px; }
.toggle-label { font-size: 12px; font-weight: 600; text-transform: uppercase; color: var(--text-muted); }
.toggle-switch { position: relative; display: inline-block; width: 34px; height: 18px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--border-light); transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 14px; width: 14px; left: 2px; bottom: 2px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--text-main); }
input:checked + .slider:before { transform: translateX(16px); }

/* Main Content */
main { padding: 40px; max-width: 1600px; margin: 0 auto; min-height: calc(100vh - var(--header-height) - 50px); flex: 1; width: 100%; }
.content-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; padding-bottom: 10px; border-bottom: 1px solid var(--border-color); flex-wrap: wrap; gap: 10px; }
.result-count { font-size: 14px; color: var(--text-main); text-transform: uppercase; font-weight: 700; }
.view-switcher { display: flex; border: 1px solid var(--border-light); }
.view-btn { padding: 8px 12px; border: none; background: var(--bg-card); cursor: pointer; display: flex; align-items: center; gap: 6px; font-size: 12px; text-transform: uppercase; color: var(--text-muted); border-right: 1px solid var(--border-light); transition: all 0.15s ease; }
.view-btn:last-child { border-right: none; }
.view-btn:hover { background: var(--bg-secondary); color: var(--text-main); }
.view-btn.active { background: var(--text-main); color: var(--bg-card); }
.view-btn svg { width: 14px; height: 14px; transition: transform 0.15s ease; }
.view-btn:hover svg { transform: scale(1.1); }
.group-header { width: 100%; margin-top: 32px; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 2px solid var(--border-light); font-size: 16px; font-weight: 800; text-transform: uppercase; color: var(--text-main); display: flex; align-items: center; justify-content: space-between; }
.group-header:first-of-type { margin-top: 0; }
.group-count { font-size: 12px; font-weight: 600; color: var(--text-muted); background: var(--bg-secondary); padding: 2px 8px; border-radius: 4px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; margin-bottom: 40px; }

/* User Card (Grid View) */
.user-card { background: var(--bg-card); border: 1px solid var(--border-color); display: flex; flex-direction: column; position: relative; min-height: 320px; }
.user-card:hover { transform: translateY(-2px); box-shadow: 0 6px 12px rgba(0,0,0,0.05); }
.card-main-content { padding: 24px 20px 0 20px; flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; }
.card-status-strip { position: absolute; top: 0; left: 0; width: 100%; height: 4px; }
.avatar { width: 60px; height: 60px; border-radius: 50%; background: var(--bg-secondary); border: 1px solid var(--border-color); display: flex; align-items: center; justify-content: center; color: var(--text-main); font-weight: 600; font-size: 18px; margin-bottom: 14px; position: relative; }
.avatar-img-wrapper { width: 100%; height: 100%; border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.avatar img, .list-avatar img, .compact-avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar .initials { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.status-indicator-dot { position: absolute; bottom: -2px; right: -2px; width: 16px; height: 16px; border-radius: 50%; border: 3px solid var(--bg-card); }
.user-name { font-weight: 700; font-size: 15px; color: var(--text-main); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; }
.user-title { font-size: 11px; color: var(--text-muted); margin-bottom: 14px; text-transform: uppercase; overflow: hidden; width: 100%; }
.user-contact-info { font-size: 12px; color: var(--text-main); margin-bottom: 16px; display: flex; flex-direction: column; gap: 4px; min-height: 36px; justify-content: center; }
.contact-row { display: flex; align-items: center; justify-content: center; gap: 8px; }
.contact-row svg { width: 14px; height: 14px; color: var(--text-muted); }
.contact-row a { color: var(--text-main); text-decoration: none; }
.contact-row a:hover { text-decoration: underline; }
.status-text-row { font-size: 12px; font-weight: 600; margin-bottom: 16px; }
.user-actions { display: flex; justify-content: center; width: 100%; border: 1px solid var(--border-light); margin-bottom: 16px; }
.action-btn { flex: 1; padding: 8px 0; background: var(--bg-card); border: none; border-right: 1px solid var(--border-light); cursor: pointer; font-size: 10px; font-weight: 600; text-transform: uppercase; color: var(--text-main); text-decoration: none; display: flex; align-items: center; justify-content: center; gap: 6px; }
.action-btn:last-child { border-right: none; }
.action-btn:hover { background: var(--bg-secondary); }
.action-btn svg { width: 13px; height: 13px; stroke: var(--text-main); }
.project-box { background: var(--bg-project); border-top: 1px solid var(--border-light); padding: 10px 14px; font-size: 12px; color: var(--text-muted); text-align: center; width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: center; }
.project-box:empty { display: none; }
.ooo-banner { color: #fff; font-size: 10px; font-weight: 700; text-transform: uppercase; padding: 6px 12px; display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; }
.ooo-banner svg { width: 12px; height: 12px; stroke: currentColor; }
.ext-label { position: absolute; top: 12px; left: 12px; font-size: 10px; font-weight: 800; color: var(--text-muted); border: 1px solid var(--border-light); background: var(--bg-card); padding: 4px 8px; border-radius: 4px; z-index: 10; }

/* Compact View */
.compact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 10px; margin-bottom: 40px; }
.compact-card { background: var(--bg-card); border: 1px solid var(--border-light); display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 12px; padding: 10px 14px; position: relative; min-height: 76px; }
.compact-card:hover { border-color: var(--border-color); box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.compact-status-strip { position: absolute; top: 0; left: 0; width: 100%; height: 3px; }
.compact-ext-badge { display: inline-block; font-size: 9px; font-weight: 700; color: var(--text-muted); background: var(--bg-secondary); border: 1px solid var(--border-light); padding: 1px 4px; border-radius: 3px; margin-right: 6px; }
.compact-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--bg-secondary); border: 1px solid var(--border-light); display: flex; align-items: center; justify-content: center; position: relative; font-size: 12px; font-weight: 600; color: var(--text-main); }
.compact-avatar .avatar-img-wrapper { width: 100%; height: 100%; border-radius: 50%; overflow: hidden; }
.compact-status-dot { position: absolute; bottom: -1px; right: -1px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--bg-card); }
.compact-info { min-width: 0; display: flex; flex-direction: column; gap: 1px; overflow: hidden; }
.compact-name { font-weight: 600; font-size: 13px; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.compact-title { font-size: 10px; color: var(--text-muted); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.compact-status { font-size: 11px; font-weight: 600; }
.compact-message { font-size: 10px; color: var(--text-muted); font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; background: var(--bg-secondary); padding: 3px 8px; border-radius: 4px; max-width: 280px; }
.compact-phones { display: flex; flex-direction: column; gap: 2px; min-width: 120px; }
.compact-phone-row { display: flex; align-items: center; gap: 6px; font-size: 11px; }
.compact-phone-icon { display: flex; color: var(--text-muted); }
.compact-phone-icon svg { width: 12px; height: 12px; }
.compact-phone-row a { color: var(--text-main); text-decoration: none; }
.compact-phone-row a:hover { text-decoration: underline; }
.compact-actions { display: flex; gap: 6px; }
.compact-action-btn { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border-light); background: var(--bg-card); color: var(--text-main); text-decoration: none; border-radius: 2px; }
.compact-action-btn:hover { border-color: var(--text-main); background: var(--bg-secondary); }
.compact-action-btn svg { width: 14px; height: 14px; stroke: var(--text-main); }

/* Minimal View */
.minimal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 6px; margin-bottom: 40px; }
.minimal-card { background: var(--bg-card); border: 1px solid var(--border-light); display: flex; align-items: center; gap: 10px; padding: 10px 12px; position: relative; min-height: 72px; }
.minimal-card:hover { border-color: var(--border-color); box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.minimal-status-strip { position: absolute; top: 0; left: 0; width: 100%; height: 3px; }
.minimal-info { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.minimal-name { font-weight: 600; font-size: 13px; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.minimal-title { font-size: 9px; color: var(--text-muted); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.minimal-message { font-size: 9px; color: var(--text-muted); background: var(--bg-secondary); padding: 2px 6px; border-radius: 3px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.minimal-ext-badge { display: inline-block; font-size: 8px; font-weight: 700; color: var(--text-muted); background: var(--bg-secondary); border: 1px solid var(--border-light); padding: 1px 3px; border-radius: 2px; margin-right: 4px; }
.minimal-contact { display: flex; flex-direction: column; gap: 2px; }
.minimal-phone { display: flex; align-items: center; gap: 3px; font-size: 10px; color: var(--text-muted); text-decoration: none; }
.minimal-phone:hover { color: var(--text-main); }
.minimal-phone svg { width: 10px; height: 10px; }
.minimal-actions { display: flex; gap: 4px; }
.minimal-action-btn { width: 28px; height: 28px; border-radius: 4px; background: var(--bg-secondary); border: 1px solid var(--border-light); display: flex; align-items: center; justify-content: center; color: var(--text-muted); text-decoration: none; }
.minimal-action-btn:hover { background: var(--text-main); color: var(--bg-card); border-color: var(--text-main); }
.minimal-action-btn svg { width: 12px; height: 12px; }

/* List View */
.list-view { background: var(--bg-card); border: 1px solid var(--border-color); margin-bottom: 40px; width: 100%; overflow-x: auto; }
.list-header { display: grid; grid-template-columns: minmax(200px, 320px) 100px 140px 140px 80px 1fr; gap: 16px; padding: 12px 20px; background: var(--bg-secondary); border-bottom: 1px solid var(--border-color); font-size: 11px; font-weight: 700; color: var(--text-main); text-transform: uppercase; min-width: 900px; }
.list-item { display: grid; grid-template-columns: minmax(200px, 320px) 100px 140px 140px 80px 1fr; gap: 16px; padding: 12px 20px; border-bottom: 1px solid var(--border-light); align-items: center; min-width: 900px; }
.list-item:hover { background: var(--bg-secondary); }
.list-item.ooo-row { background: linear-gradient(90deg, rgba(135, 100, 184, 0.08) 0%, transparent 100%); border-left: 3px solid var(--c-purple); }
.list-user { display: flex; align-items: center; gap: 12px; overflow: hidden; min-width: 0; }
.list-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--bg-secondary); color: var(--text-main); font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border-light); overflow: hidden; }
.list-name-wrapper { display: flex; align-items: center; gap: 8px; min-width: 0; width: 100%; flex-wrap: wrap; }
.list-user-name-text { font-weight: 600; font-size: 13px; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-user-title { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-status { font-size: 12px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; color: var(--text-main); }
.list-contact-text { font-size: 12px; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-contact-text a { color: var(--text-main); text-decoration: none; }
.list-contact-text a:hover { text-decoration: underline; }
.list-actions { display: flex; gap: 8px; }
.list-action-btn { width: 32px; height: 28px; border: 1px solid var(--border-light); background: var(--bg-card); color: var(--text-main); text-decoration: none; display: flex; align-items: center; justify-content: center; border-radius: 2px; }
.list-action-btn:hover { border-color: var(--text-main); background: var(--bg-secondary); }
.list-action-btn svg { width: 14px; height: 14px; stroke: var(--text-main); }
.list-project { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-style: italic; }
.list-ooo-badge { display: none; color: #fff; font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 3px; text-transform: uppercase; }
.list-ooo-badge svg { width: 10px; height: 10px; stroke: currentColor; }
.list-ext-badge { display: inline-block; font-size: 9px; font-weight: 800; color: var(--text-muted); border: 1px solid var(--border-light); background: var(--bg-secondary); padding: 2px 5px; border-radius: 3px; }

/* Welcome / Login */
.welcome { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--bg-body); padding: 40px 20px; }
.welcome-card { background: var(--bg-card); padding: 48px 56px; border: 1px solid var(--border-light); border-radius: 4px; text-align: center; max-width: 400px; width: 100%; box-shadow: 0 2px 6px rgba(0,0,0,0.04); }
.welcome-logos { display: flex; flex-direction: column; align-items: center; justify-content: center; margin-bottom: 24px; }
.welcome-logo-teams { width: 64px; height: auto; object-fit: contain; }
.welcome-title { font-size: 18px; color: var(--text-main); font-weight: 600; margin-bottom: 8px; }
.welcome-subtitle { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; }
.welcome-btn { width: 100%; padding: 12px 20px; background: var(--teams-purple); color: #fff; border: none; border-radius: 4px; cursor: pointer; font-size: 14px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 10px; }
.welcome-btn:hover { filter: brightness(0.85); }
.welcome-btn svg { width: 20px; height: 20px; }
.welcome-request { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border-light); font-size: 13px; color: var(--text-muted); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.welcome-request a { color: var(--teams-purple); text-decoration: none; font-weight: 500; margin-left: 4px; }
.welcome-request a:hover { text-decoration: underline; }
.request-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; background: transparent; border: 2px solid var(--teams-purple); color: var(--teams-purple) !important; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; border-radius: 4px; text-decoration: none !important; transition: all 0.2s ease; margin-left: 0 !important; }
.request-btn:hover { background: var(--teams-purple); color: #fff !important; text-decoration: none !important; }
.request-btn svg { flex-shrink: 0; }
.welcome-footer { margin-top: 40px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.welcome-footer-brand { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); font-weight: 500; }
.welcome-footer-logo { width: 16px; height: 16px; opacity: 0.7; }
.welcome-footer-links { display: flex; align-items: center; gap: 20px; font-size: 11px; }
.welcome-footer-links a { color: var(--text-light); text-decoration: none; }
.welcome-footer-links a:hover { color: var(--text-main); }
.welcome-footer-version { color: var(--text-light); opacity: 0.4; font-size: 9px; margin-top: 4px; }
.welcome-theme-toggle { position: fixed; top: 20px; right: 20px; display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 600; text-transform: uppercase; cursor: pointer; color: var(--text-light); z-index: 10; }
.welcome-theme-toggle .switch-divider { opacity: 0.3; }
html[data-theme="light"] .welcome-theme-toggle .switch-light.switch-text, html[data-theme="dark"] .welcome-theme-toggle .switch-dark.switch-text { color: var(--text-main); border-bottom: 1px solid var(--text-main); }

/* Demo Login Form */
.demo-login-form { margin-top: 20px; }
.demo-badge { display: inline-block; background: var(--teams-purple); color: #fff; font-size: 10px; font-weight: 700; padding: 4px 12px; border-radius: 20px; margin-bottom: 16px; text-transform: uppercase; letter-spacing: 1px; }
.demo-hint { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; line-height: 1.5; }
.demo-hint code { background: var(--bg-secondary); padding: 2px 8px; border-radius: 4px; font-family: monospace; font-weight: 600; color: var(--text-main); }
.login-field { margin-bottom: 16px; text-align: left; }
.login-field label { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; letter-spacing: 0.5px; }
.login-field input { width: 100%; padding: 12px 14px; border: 1px solid var(--border-light); border-radius: 4px; font-size: 14px; font-family: inherit; background: var(--bg-card); color: var(--text-main); }
.login-field input:focus { outline: none; border-color: var(--teams-purple); }
.login-error { color: var(--c-red); font-size: 12px; margin-bottom: 16px; display: none; padding: 10px; background: rgba(209, 52, 56, 0.1); border-radius: 4px; }

/* Footer */
.app-footer { display: none; align-items: center; justify-content: space-between; padding: 10px 40px; font-size: 12px; color: var(--text-light); border-top: 1px solid var(--border-light); background: var(--bg-card); position: relative; flex-shrink: 0; margin-top: auto; }
body:not(.login-state) .app-footer { display: flex; }
.app-footer .footer-copy { display: flex; align-items: center; gap: 8px; }
.app-footer .footer-version { opacity: 0.6; font-size: 11px; }
.app-footer .footer-center { position: absolute; left: 50%; transform: translateX(-50%); }
.app-footer .footer-center img { width: 18px; height: 18px; opacity: 0.5; }
.app-footer .footer-links { display: flex; gap: 16px; }
.app-footer .footer-links a { color: var(--text-light); text-decoration: none; }
.app-footer .footer-links a:hover { color: var(--text-main); }

/* Cookie Banner */
.cookie-banner { position: fixed; bottom: 0; left: 0; right: 0; background: var(--bg-card); border-top: 1px solid var(--border-color); padding: 16px 24px; z-index: 10001; display: none; justify-content: center; box-shadow: 0 -4px 20px rgba(0,0,0,0.1); }
.cookie-content { max-width: 1200px; width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.cookie-text { flex: 1; min-width: 280px; }
.cookie-text strong { display: block; margin-bottom: 4px; font-size: 15px; }
.cookie-text p { color: var(--text-muted); font-size: 14px; margin: 0; }
.cookie-text a { color: var(--teams-purple); text-decoration: none; }
.cookie-icon { width: 20px; height: 20px; vertical-align: middle; margin-right: 6px; }
.cookie-buttons { display: flex; gap: 12px; }
.cookie-btn { padding: 10px 20px; font-size: 14px; font-weight: 600; border-radius: 8px; border: none; cursor: pointer; }
.cookie-btn-primary { background: var(--teams-purple); color: #fff; }
.cookie-btn-primary:hover { background: #5254a3; }
.cookie-btn-secondary { background: transparent; border: 1px solid var(--border-color); color: var(--text-main); }
.cookie-btn-secondary:hover { border-color: var(--text-main); }

/* Loading */
.loading-spinner { width: 40px; height: 40px; border: 4px solid var(--border-light); border-top-color: var(--text-main); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 20px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Content Fade Animation (View-Wechsel / Filter) */
#cards-container { transition: opacity 0.15s ease; }
#cards-container.content-fade { opacity: 0; }

/* Fade In Animation for cards */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.grid, .compact-grid, .minimal-grid, .list-view { animation: fadeIn 0.2s ease; }

/* ===================== */
/* ZOOM CONTROL */
/* ===================== */
.zoom-control {
    display: flex;
    align-items: center;
    gap: 2px;
    border: 1px solid var(--border-light);
    padding: 4px 6px;
    background: var(--bg-card);
    flex-shrink: 0;
}
.zoom-btn {
    width: 26px;
    height: 26px;
    border: none;
    background: transparent;
    color: var(--text-main);
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
    transition: background 0.15s;
    line-height: 1;
}
.zoom-btn:hover { background: var(--bg-secondary); }
.zoom-btn:active { background: var(--border-light); }
.zoom-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.zoom-btn:disabled:hover { background: transparent; }
.zoom-level {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    min-width: 38px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Zoom Control Responsive */
@media (max-width: 900px) {
    .zoom-control { padding: 3px 5px; }
    .zoom-btn { width: 24px; height: 24px; font-size: 16px; }
    .zoom-level { font-size: 9px; min-width: 34px; }
}

/* Zoom Control auf Mobile ausblenden */
@media (max-width: 700px) {
    .zoom-control { display: none; }
}

/* Disabled View Button */
.view-btn.disabled-view { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

/* Fullscreen Mode */
.fullscreen-toggle { display: none; }
@media (min-width: 1200px) { .fullscreen-toggle { display: flex; } }
body.fullscreen-mode main { max-width: none !important; padding: 40px 20px !important; }
body.fullscreen-mode .grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important; }
body.fullscreen-mode .compact-grid { grid-template-columns: repeat(auto-fill, minmax(450px, 1fr)) !important; }
body.fullscreen-mode .minimal-grid { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)) !important; }

/* ===================== */
/* SHOWCASE MODE */
/* ===================== */
body.showcase-mode .app-footer { display: none !important; }
body.showcase-mode .welcome-theme-toggle { display: none !important; }
body.showcase-mode .cookie-banner { display: none !important; }
body.showcase-mode .fullscreen-toggle { display: none !important; }
body.showcase-mode { pointer-events: none; } /* Keine Interaktion im Showcase */
body.showcase-mode a, body.showcase-mode button, body.showcase-mode input, body.showcase-mode select { pointer-events: none; }

/* Showcase visuelles Feedback für Aktionen */
body.showcase-mode .stats-bar-item.clickable { transition: all 0.2s ease; }
body.showcase-mode .view-btn { transition: all 0.2s ease; }
body.showcase-mode .filter-chip { transition: all 0.2s ease; }
body.showcase-mode #searchInput { transition: all 0.2s ease; }
body.showcase-mode .smart-filter-group select { transition: all 0.2s ease; }

/* Optional: Showcase-Badge in der Ecke */
body.showcase-mode::after {
    content: "LIVE DEMO";
    position: fixed;
    top: 12px;
    right: 12px;
    background: var(--teams-purple);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    letter-spacing: 1px;
    z-index: 9999;
    animation: showcasePulse 2s ease infinite;
}

@keyframes showcasePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Responsive */
@media (max-width: 1200px) { .header-compact-info { display: none; } .compact-grid { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); } }
@media (max-width: 900px) { header { padding: 0 20px; } .header-stats { display: none; } .stats-bar { padding: 6px 20px; } .compact-grid { grid-template-columns: 1fr; } .compact-card { grid-template-columns: auto 1fr auto; } .compact-phones { display: none; } .view-btn[data-view="compact"], .view-btn[data-view="minimal"] { display: none; } }
@media (max-width: 768px) { .dashboard-header p { font-size: 13px; margin-bottom: 20px; } main { padding: 20px; } }
@media (max-width: 640px) { .grid { grid-template-columns: 1fr; gap: 16px; } .minimal-grid { grid-template-columns: 1fr; } }
/* Percent Banner auf Mobile ausblenden */
@media (max-width: 700px) { .percent-banner { display: none !important; } }

@media (max-width: 600px) {
    header { padding: 0 12px; height: 60px; }
    :root { --header-height: 60px; }
    .compact-title { font-size: 11px; }
    .header-compact-info { justify-content: flex-start; }
    .brand-logo-text { font-size: 16px; }
    .header-right-group { gap: 12px; padding-left: 12px; }

    /* Stats-Bar und Toolbar NICHT mehr sticky auf Mobile */
    .stats-bar { position: relative; top: auto; }
    .toolbar { position: relative; top: auto; }

    /* Nur die Chips-Leiste sticky wenn Filter aktiv */
    .toolbar-chips:not(:empty) {
        position: sticky;
        top: var(--header-height);
        z-index: 850;
        background: var(--bg-card);
        margin: 0 -12px;
        padding: 8px 12px;
        border-bottom: 1px solid var(--border-light);
    }

    /* Toolbar responsive */
    .toolbar { padding: 12px; }
    .toolbar-top-row { flex-direction: column; gap: 10px; align-items: stretch; }
    .toolbar-divider { display: none; }

    /* Suche volle Breite */
    .search-box { width: 100%; max-width: none; }

    /* Smart-Filter Stack */
    .smart-filter-group { width: 100%; flex-direction: column; gap: 8px; }
    .smart-filter-group select { width: 100%; min-width: unset; }
    .smart-filter-group select:first-child { margin-right: 0; }

    /* Toggle volle Breite */
    .toggle-wrapper { width: 100%; justify-content: center; }

    /* Stats-Bar: nur Dots + Zahl, kein Label-Text, kompakt in einer Zeile */
    .stats-bar { padding: 8px 12px; height: auto; min-height: unset; }
    .stats-bar-inner { display: flex; justify-content: center; flex-wrap: nowrap; gap: 4px; max-width: none; }
    .stats-bar-item { padding: 6px 8px; min-width: unset; gap: 4px; }
    .stats-bar-item.clickable { min-width: unset; }
    .stats-bar-label { display: none; }
    .stats-bar-value { font-size: 12px; font-weight: 700; }
    .stats-bar-dot { width: 8px; height: 8px; margin-right: 0; }

    /* Chips */
    .toolbar-chips { justify-content: flex-start; gap: 6px; }
    .filter-chip { font-size: 9px; padding: 4px 8px; }

    /* Welcome */
    .welcome-card { padding: 28px 20px; }
    .welcome-title { font-size: 16px; }
    .welcome-btn { padding: 11px 18px; font-size: 13px; }

    /* Theme Switch Icons only - zeigt nur das relevante Icon */
    .theme-switch .switch-text,
    .welcome-theme-toggle .switch-text { display: none; }
    .theme-switch .switch-divider,
    .welcome-theme-toggle .switch-divider { display: none; }
    .theme-switch .switch-icon,
    .welcome-theme-toggle .switch-icon { display: flex; }
    .theme-switch,
    .welcome-theme-toggle { gap: 0; }
    html[data-theme="light"] .theme-switch .switch-light.switch-icon,
    html[data-theme="light"] .welcome-theme-toggle .switch-light.switch-icon { display: none; }
    html[data-theme="light"] .theme-switch .switch-dark.switch-icon,
    html[data-theme="light"] .welcome-theme-toggle .switch-dark.switch-icon { display: flex; opacity: 1; color: var(--text-main); }
    html[data-theme="dark"] .theme-switch .switch-dark.switch-icon,
    html[data-theme="dark"] .welcome-theme-toggle .switch-dark.switch-icon { display: none; }
    html[data-theme="dark"] .theme-switch .switch-light.switch-icon,
    html[data-theme="dark"] .welcome-theme-toggle .switch-light.switch-icon { display: flex; opacity: 1; color: var(--text-main); }
}

@media (max-width: 480px) { main { padding: 16px 12px; } .dashboard-header p { display: none; } .view-btn .view-label { display: none; } .list-item { padding: 14px 12px; } .list-user { padding-right: 100px; gap: 10px; } .list-avatar { width: 36px; height: 36px; font-size: 11px; } .list-user-name-text { font-size: 14px; } .list-user-title { font-size: 10px; } .list-actions { right: 12px; top: 50%; transform: translateY(-50%); gap: 6px; } .list-action-btn { width: 36px; height: 34px; } .list-action-btn svg { width: 16px; height: 16px; } .list-status { font-size: 10px; padding: 3px 8px; } .list-contact-text { font-size: 12px; } .stats-bar-inner { gap: 2px; } .stats-bar-item { padding: 5px 6px; gap: 3px; } .stats-bar-value { font-size: 11px; } .stats-bar-dot { width: 7px; height: 7px; } .compact-card { padding: 8px 10px; gap: 10px; } .compact-avatar { width: 36px; height: 36px; } .compact-name { font-size: 12px; } .compact-title { font-size: 9px; } .compact-status { font-size: 10px; } .compact-action-btn { width: 26px; height: 26px; } .compact-action-btn svg { width: 11px; height: 11px; } .minimal-action-btn { width: 24px; height: 24px; } .minimal-action-btn svg { width: 10px; height: 10px; } .brand-logo-text { font-size: 13px; } .brand-logo-wrapper { gap: 8px; padding: 4px 8px; } }

@media (max-width: 400px) { .compact-title { font-size: 10px; } .stats-bar-inner { gap: 1px; } .stats-bar-item { padding: 4px 5px; gap: 2px; } .stats-bar-value { font-size: 10px; } .stats-bar-dot { width: 6px; height: 6px; } .welcome-card { padding: 24px 16px; } .welcome-title { font-size: 15px; margin-bottom: 20px; } .welcome-logo-teams { width: 52px; } .welcome-btn { padding: 10px 14px; font-size: 12px; } .welcome-footer-links { gap: 12px; font-size: 10px; } .brand-logo-text { font-size: 11px; } .action-btn .action-label { display: none; } .action-btn { padding: 10px 0; gap: 0; } .action-btn svg { width: 14px; height: 14px; } .list-user { padding-right: 135px; } }
@media (max-width: 480px) { main { padding: 16px 12px; } .view-btn .view-label { display: none; } .action-btn .action-label { display: none; } }
@media (max-width: 1100px) { .list-view { overflow-x: visible; } .list-header { display: none; } .list-item { display: block; padding: 16px; position: relative; min-width: unset; } .list-user { display: flex; align-items: center; gap: 12px; padding-right: 110px; margin-bottom: 12px; } .list-actions { position: absolute; top: 50%; right: 16px; transform: translateY(-50%); } .list-status { display: inline-flex !important; font-size: 11px; border: 1px solid var(--border-light); padding: 4px 10px; border-radius: 4px; margin-bottom: 10px; background: var(--bg-secondary); } .list-contact-text { display: block; font-size: 13px; padding: 3px 0; } .list-contact-text.type-business::before { content: "Tel: "; font-weight: 600; color: var(--text-muted); } .list-contact-text.type-mobile::before { content: "Mobil: "; font-weight: 600; color: var(--text-muted); } .list-project { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border-light); white-space: normal; word-break: break-word; } .list-item .list-project:empty { display: none !important; } }
