/**
 * Naluvio Partner-Portal – Stylesheet
 * Dark Theme mit Naluvio-Blau, Glassmorphism, Premium-Design
 */

/* ── Font (gleich wie Landingpage) ────────────────── */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../../fonts/inter-400.woff2') format('woff2'),
        url('../../fonts/inter-400.ttf') format('truetype');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../../fonts/inter-600.woff2') format('woff2'),
        url('../../fonts/inter-600.ttf') format('truetype');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../../fonts/inter-700.woff2') format('woff2'),
        url('../../fonts/inter-700.ttf') format('truetype');
}

/* ── Design Tokens ────────────────────────────────── */
:root {
    --bg-body: #0c0e14;
    --bg-sidebar: #10131a;
    --bg-card: #161923;
    --bg-card-hover: #1c2030;
    --bg-input: #1a1e2e;
    --bg-input-focus: #1e2340;
    --border-color: #252a3a;
    --border-hover: #3a4060;
    --text-primary: #e8eaf0;
    --text-secondary: #8b93a7;
    --text-muted: #5a6178;
    --accent-blue: #3b6cf5;
    --accent-blue-hover: #4d7df7;
    --accent-blue-bg: rgba(59, 108, 245, 0.08);
    --accent-blue-border: rgba(59, 108, 245, 0.25);
    --accent-green: #22c55e;
    --accent-green-bg: rgba(34, 197, 94, 0.1);
    --accent-yellow: #eab308;
    --accent-yellow-bg: rgba(234, 179, 8, 0.1);
    --accent-red: #ef4444;
    --accent-red-bg: rgba(239, 68, 68, 0.1);
    --accent-purple: #a855f7;
    --accent-purple-bg: rgba(168, 85, 247, 0.1);
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.4);
    --sidebar-width: 260px;
    --mobile-header-height: 56px;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
}

/* ── Reset ────────────────────────────────────────── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-main);
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-blue-hover);
}

/* ── LOGIN PAGE ───────────────────────────────────── */
.login-page {
    background: var(--bg-body);
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(59, 108, 245, 0.11) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(30, 58, 138, 0.09) 0%, transparent 50%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-wrapper {
    width: 100%;
    max-width: 420px;
    padding: 1.5rem;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2.5rem 2rem 1.75rem 2rem;
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(20px);
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo img {
    height: 32px;
    width: auto;
    filter: brightness(0) invert(1);
}

.login-title {
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.login-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.75rem;
}

.login-form .form-group {
    margin-bottom: 1.25rem;
}

.login-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.input-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    pointer-events: none;
    z-index: 1;
}

.input-icon-wrapper input {
    width: 100%;
    padding: 12px 14px 12px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: var(--font-main);
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

.input-icon-wrapper .input-icon~input {
    padding-left: 44px;
}

.input-icon-wrapper input:focus {
    outline: none;
    border-color: var(--accent-blue);
    background: var(--bg-input-focus);
    box-shadow: 0 0 0 3px var(--accent-blue-bg);
}

.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    transition: color var(--transition-fast);
}

.toggle-password:hover {
    color: var(--text-secondary);
}

.toggle-password:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: -2px;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
}

.btn-login {
    width: 100%;
    padding: 13px 24px;
    background: var(--accent-blue);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 15px rgba(59, 108, 245, 0.25);
    margin-top: 1.5rem;
}

.btn-login:hover {
    background: var(--accent-blue-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(59, 108, 245, 0.35);
}

.login-footer {
    margin-top: 2rem;
    text-align: center;
}

.back-link {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    transition: color var(--transition-fast, 0.2s);
    position: relative;
    padding: 4px 8px;
}

.back-link::after {
    content: '';
    position: absolute;
    top: -8px;
    bottom: -15px;
    left: -30px;
    right: -30px;
    cursor: pointer;
}

.back-link:hover {
    color: #ffffff !important;
}

.back-to-web-button {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary) !important;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform var(--transition-fast, 0.2s), background-color var(--transition-fast, 0.2s), color var(--transition-fast, 0.2s), border-color var(--transition-fast, 0.2s);
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
}

.back-to-web-button:hover {
    background: #ffffff;
    border-color: #ffffff;
    transform: translateY(-1px);
    color: #0f172a !important;
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.15);
}

.login-footer-outside {
    margin-top: 1.5rem;
    text-align: center;
}

.forgot-password-link {
    text-align: center;
    margin-top: 1.25rem;
}

.forgot-password-link a {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.85rem;
    text-decoration: none;
    transition: color var(--transition-fast, 0.2s);
    display: inline-block;
    position: relative;
    padding: 4px 8px;
}

.forgot-password-link a::after {
    content: '';
    position: absolute;
    top: -6px;
    bottom: -15px;
    left: -30px;
    right: -30px;
    cursor: pointer;
}

.forgot-password-link a:hover {
    color: #ffffff !important;
}

/* Setup Warning */
.setup-warning {
    background: var(--accent-red-bg);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    color: #fca5a5;
    font-size: 0.85rem;
    line-height: 1.5;
}

.setup-warning svg {
    flex-shrink: 0;
    color: var(--accent-red);
    margin-top: 2px;
}

/* ── PORTAL LAYOUT ────────────────────────────────── */
.portal-page {
    display: flex;
    min-height: 100vh;
}

/* ── SIDEBAR ──────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-normal);
}

.sidebar-header {
    padding: 1.5rem 1.25rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo img {
    height: 24px;
    width: auto;
    filter: brightness(0) invert(1);
}

.sidebar-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--accent-blue-bg);
    color: var(--accent-blue);
    border: 1px solid var(--accent-blue-border);
}

.badge-admin {
    background: var(--accent-purple-bg);
    color: var(--accent-purple);
    border-color: rgba(168, 85, 247, 0.25);
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-blue-bg);
    color: var(--accent-blue);
    font-weight: 600;
}

.nav-item.active svg {
    stroke: var(--accent-blue);
}

.nav-logout {
    margin-top: auto;
    color: var(--text-muted);
}

.nav-logout:hover {
    color: var(--accent-red);
    background: var(--accent-red-bg);
}

.sidebar-footer {
    padding: 1rem 0.75rem;
    border-top: 1px solid var(--border-color);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    margin-bottom: 8px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-blue);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.admin-avatar {
    background: var(--accent-purple);
}

.user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ── MOBILE HEADER ────────────────────────────────── */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--mobile-header-height);
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-color);
    z-index: 99;
    padding: 0 1rem;
    align-items: center;
    justify-content: space-between;
}

.mobile-header img {
    height: 22px;
    filter: brightness(0) invert(1);
}

.mobile-sidebar-toggle {
    background: none;
    border: none;
    cursor: pointer;
    width: 28px;
    height: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0;
}

.mobile-sidebar-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-sidebar-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-sidebar-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-sidebar-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.mobile-logout {
    color: var(--text-muted);
    padding: 8px;
    display: flex;
    align-items: center;
}

.mobile-logout:hover {
    color: var(--accent-red);
}

/* ── MAIN CONTENT ─────────────────────────────────── */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    padding: 2rem;
}

.content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
}

/* ── PAGE HEADER ──────────────────────────────────── */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.page-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.back-link-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    transition: color var(--transition-fast);
}

.back-link-inline:hover {
    color: var(--accent-blue);
}

/* ── BUTTONS ──────────────────────────────────────── */
.btn-primary-portal {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--accent-blue);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: var(--font-main);
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(59, 108, 245, 0.2);
}

.btn-primary-portal:hover {
    background: var(--accent-blue-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(59, 108, 245, 0.3);
    color: #fff;
}

.btn-secondary-portal {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    font-family: var(--font-main);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

.btn-secondary-portal:hover {
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn-action:hover {
    border-color: var(--accent-blue-border);
    background: var(--accent-blue-bg);
    color: var(--accent-blue);
}

.btn-action-warn:hover {
    border-color: rgba(239, 68, 68, 0.3);
    background: var(--accent-red-bg);
    color: var(--accent-red);
}

.btn-action-success:hover {
    border-color: rgba(34, 197, 94, 0.3);
    background: var(--accent-green-bg);
    color: var(--accent-green);
}

.btn-action-danger {
    border-color: rgba(239, 68, 68, 0.2);
    color: var(--text-muted);
}

.btn-action-danger:hover {
    border-color: rgba(239, 68, 68, 0.5);
    background: var(--accent-red-bg);
    color: var(--accent-red);
}

.btn-filter {
    padding: 10px 20px;
    background: var(--accent-blue);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: var(--font-main);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.btn-filter:hover {
    background: var(--accent-blue-hover);
}

.btn-reset {
    padding: 10px 16px;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-radius: var(--radius-md);
    transition: color var(--transition-fast);
}

.btn-reset:hover {
    color: var(--text-primary);
}

/* ── STATS GRID ───────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: border-color var(--transition-fast);
}

.stat-card:hover {
    border-color: var(--border-hover);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon-blue {
    background: var(--accent-blue-bg);
    color: var(--accent-blue);
}

.stat-icon-green {
    background: var(--accent-green-bg);
    color: var(--accent-green);
}

.stat-icon-yellow {
    background: var(--accent-yellow-bg);
    color: var(--accent-yellow);
}

.stat-icon-purple {
    background: var(--accent-purple-bg);
    color: var(--accent-purple);
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

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

/* Admin mini stats */
.stats-admin {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.stat-mini {
    padding: 1rem;
    text-align: center;
    flex-direction: column;
    gap: 4px;
}

.stat-mini .stat-number {
    font-size: 1.3rem;
}

.stat-blue {
    color: var(--accent-blue);
}

.stat-yellow {
    color: var(--accent-yellow);
}

.stat-green {
    color: var(--accent-green);
}

.stat-purple {
    color: var(--accent-purple);
}

/* ── CARDS ────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h2 {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.card-header h2 svg {
    color: var(--text-muted);
}

.card-link {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--accent-blue);
}

.card-body {
    padding: 1.5rem;
}

.card-body.no-padding {
    padding: 0;
}

/* ── DATA TABLE ───────────────────────────────────── */
.table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.data-table thead {
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    vertical-align: middle;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.015);
}

.sort-link {
    color: var(--text-muted);
    text-decoration: none;
    white-space: nowrap;
}

.sort-link:hover {
    color: var(--accent-blue);
}

.date-main {
    display: block;
    color: var(--text-primary);
    font-weight: 500;
}

.date-sub {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
}

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

code {
    font-size: 0.85em;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    color: var(--accent-blue);
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar-small {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent-blue);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.row-disabled {
    opacity: 0.5;
}

.inline-form {
    display: inline;
}

/* ── STATUS BADGES ────────────────────────────────── */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-blue {
    background: var(--accent-blue-bg);
    color: var(--accent-blue);
    border: 1px solid var(--accent-blue-border);
}

.badge-yellow {
    background: var(--accent-yellow-bg);
    color: var(--accent-yellow);
    border: 1px solid rgba(234, 179, 8, 0.25);
}

.badge-green {
    background: var(--accent-green-bg);
    color: var(--accent-green);
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.badge-red {
    background: var(--accent-red-bg);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.badge-purple {
    background: var(--accent-purple-bg);
    color: var(--accent-purple);
    border: 1px solid rgba(168, 85, 247, 0.25);
}

.badge-gray {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.role-badge {
    display: inline-flex;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.role-partner {
    background: var(--accent-blue-bg);
    color: var(--accent-blue);
}

.role-admin {
    background: var(--accent-purple-bg);
    color: var(--accent-purple);
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-active {
    background: var(--accent-green);
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.4);
}

.status-inactive {
    background: var(--text-muted);
}

/* Status Select (Admin Inline) */
.status-select {
    padding: 6px 10px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.82rem;
    font-family: var(--font-main);
    cursor: pointer;
    transition: border-color var(--transition-fast);
    min-width: 140px;
}

.status-select:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.status-select.status-updated {
    border-color: var(--accent-green);
    box-shadow: 0 0 0 3px var(--accent-green-bg);
}

.status-select-large {
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: var(--font-main);
    cursor: pointer;
    min-width: 200px;
}

.status-select-large:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.status-form-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* File count badges */
.file-count-badge,
.file-count-badge-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.file-count-badge-inline {
    font-size: 0.75rem;
    margin-left: 6px;
    color: var(--accent-blue);
}

/* ── FILTER CARD ──────────────────────────────────── */
.filter-card {
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
}

.filter-form {
    width: 100%;
}

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

.filter-group {
    position: relative;
    flex-shrink: 0;
}

.filter-search {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.filter-search svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.filter-search input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.88rem;
    font-family: var(--font-main);
    transition: border-color var(--transition-fast);
}

.filter-search input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.filter-group select {
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: var(--font-main);
    cursor: pointer;
    min-width: 140px;
}

.filter-group select:focus {
    outline: none;
    border-color: var(--accent-blue);
}

/* ── FORM STYLES ──────────────────────────────────── */
.lead-form .form-group,
.login-form .form-group {
    margin-bottom: 1.25rem;
}

.form-section {
    border: none;
    padding: 0;
    margin-bottom: 2rem;
}

.form-section legend {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    width: 100%;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.lead-form label,
.form-group>label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.lead-form input[type="text"],
.lead-form input[type="email"],
.lead-form input[type="tel"],
.lead-form input[type="password"],
.lead-form select,
.lead-form textarea {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: var(--font-main);
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

.lead-form input:focus,
.lead-form select:focus,
.lead-form textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
    background: var(--bg-input-focus);
    box-shadow: 0 0 0 3px var(--accent-blue-bg);
}

.lead-form textarea {
    resize: vertical;
    min-height: 100px;
}

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

.form-hint {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

.input-error {
    border-color: var(--accent-red) !important;
    box-shadow: 0 0 0 3px var(--accent-red-bg) !important;
}

.form-error {
    font-size: 0.8rem;
    color: var(--accent-red);
    margin-top: 0.3rem;
}

/* Toggle Switch */
.toggle-group {
    display: flex;
    align-items: center;
}

.lead-form .toggle-label,
.toggle-label {
    display: flex !important;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 0 !important;
}

.toggle-switch {
    display: inline-block;
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--border-color);
    border-radius: 24px;
    cursor: pointer;
    transition: background var(--transition-normal);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    top: 3px;
    left: 3px;
    transition: transform var(--transition-normal);
}

.toggle-switch input:checked+.toggle-slider {
    background: var(--accent-blue);
}

.toggle-switch input:checked+.toggle-slider::before {
    transform: translateX(20px);
}

/* File Upload Zone */
.file-upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
}

.file-upload-zone:hover,
.file-upload-zone.drag-over {
    border-color: var(--accent-blue);
    background: var(--accent-blue-bg);
    color: var(--accent-blue);
}

.file-upload-zone svg {
    opacity: 0.5;
}

.file-upload-zone:hover svg {
    opacity: 1;
}

.upload-text {
    font-size: 0.9rem;
    line-height: 1.6;
}

.upload-text span {
    color: var(--accent-blue);
    font-weight: 500;
}

.upload-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.file-input-hidden {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

.file-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    font-size: 0.88rem;
}

.file-size-text {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.file-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all var(--transition-fast);
}

.file-remove:hover {
    color: var(--accent-red);
    background: var(--accent-red-bg);
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    margin-top: 1rem;
}

.btn-submit {
    padding: 12px 28px;
    font-size: 0.95rem;
}

/* ── DETAIL VIEW ──────────────────────────────────── */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.detail-grid .card {
    margin-bottom: 0;
}

.detail-list {
    display: grid;
    gap: 0;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    gap: 1rem;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row dt {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.detail-row dd {
    font-size: 0.9rem;
    color: var(--text-primary);
    text-align: right;
    word-break: break-word;
}

.detail-notes {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
    white-space: pre-wrap;
}

.detail-status-area {
    display: flex;
    align-items: center;
}

/* File List */
.file-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast);
}

.file-item:hover {
    border-color: var(--border-hover);
}

.file-item-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.file-item-info svg {
    flex-shrink: 0;
    color: var(--accent-blue);
}

.file-item-name {
    display: block;
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
}

.file-item-meta {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ── EMPTY STATE ──────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-state svg {
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* ── FLASH MESSAGES ───────────────────────────────── */
.flash-message {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-size: 0.88rem;
    font-weight: 500;
    position: relative;
}

.flash-icon {
    flex-shrink: 0;
    display: flex;
}

.flash-text {
    flex: 1;
}

.flash-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 4px;
    opacity: 0.6;
    transition: opacity var(--transition-fast);
}

.flash-close:hover {
    opacity: 1;
}

.flash-success {
    background: var(--accent-green-bg);
    color: var(--accent-green);
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.flash-error {
    background: var(--accent-red-bg);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.flash-warning {
    background: var(--accent-yellow-bg);
    color: var(--accent-yellow);
    border: 1px solid rgba(234, 179, 8, 0.25);
}

.flash-info {
    background: var(--accent-blue-bg);
    color: var(--accent-blue);
    border: 1px solid var(--accent-blue-border);
}

/* ── ANIMATIONS ───────────────────────────────────── */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* ── RESPONSIVE ───────────────────────────────────── */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    }

    .mobile-header {
        display: flex;
    }

    .main-content {
        margin-left: 0;
        padding-top: calc(var(--mobile-header-height) + 1.5rem);
    }

    body.sidebar-open::after {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 99;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
        padding-top: calc(var(--mobile-header-height) + 1rem);
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

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

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

    .form-grid {
        grid-template-columns: 1fr;
    }

    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-search {
        min-width: 0;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .status-form-row {
        flex-direction: column;
        align-items: stretch;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn-primary-portal,
    .form-actions .btn-secondary-portal {
        width: 100%;
        justify-content: center;
    }

    /* Responsive table */
    .data-table thead {
        display: none;
    }

    .data-table tbody tr {
        display: block;
        padding: 1rem;
        border-bottom: 1px solid var(--border-color);
    }

    .data-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 6px 0;
        border-bottom: none;
    }

    .data-table td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.78rem;
        color: var(--text-muted);
        text-transform: uppercase;
        margin-right: 1rem;
        flex-shrink: 0;
    }

    .data-table td:first-child {
        padding-top: 0;
    }

    .data-table td:last-child {
        padding-bottom: 0;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 2rem 1.25rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        gap: 0.75rem;
    }
}

/* ── SELECT STYLING ───────────────────────────────── */
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 10px center;
    background-repeat: no-repeat;
    background-size: 20px;
    padding-right: 36px !important;
}

/* ── DOCUMENT CARDS ──────────────────────────────── */
.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

.document-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.document-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.document-card-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
    width: 48px;
}

.document-ext {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.document-card-info {
    flex: 1;
    min-width: 0;
}

.document-icon-link {
    text-decoration: none;
    transition: opacity var(--transition-fast);
}

.document-icon-link:hover {
    opacity: 0.85;
}

.document-title-link {
    text-decoration: none;
    display: inline-block;
    max-width: 100%;
}

.document-title-link:hover .document-title {
    color: var(--accent-blue-hover);
    text-decoration: underline;
}

.document-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.document-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.document-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.document-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

.document-download-btn,
.document-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: all var(--transition-fast);
    flex-shrink: 0;
    justify-content: center;
}

.document-download-btn {
    background: var(--accent-blue-bg);
    color: var(--accent-blue);
    border: 1px solid var(--accent-blue-border);
}

.document-download-btn:hover {
    background: var(--accent-blue);
    color: #fff;
    border-color: var(--accent-blue);
}

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

.document-view-btn:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

/* ── EMPTY STATE ─────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-state svg {
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.9rem;
}

/* ── SCROLLBAR ────────────────────────────────────── */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

/* ── DESKTOP-ONLY HELPER ──────────────────────────── */
@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }
}

/* ── MOBILE UPLOAD ZONE AS BUTTON ─────────────────── */
@media (max-width: 768px) {
    #photoZone {
        display: inline-flex !important;
        flex-direction: row !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 8px !important;
        padding: 12px 20px !important;
        background: var(--accent-blue) !important;
        color: #fff !important;
        border: none !important;
        border-radius: var(--radius-md) !important;
        font-family: var(--font-main) !important;
        cursor: pointer !important;
        transition: all var(--transition-normal) !important;
        text-decoration: none !important;
        white-space: nowrap !important;
        box-shadow: 0 2px 8px rgba(59, 108, 245, 0.2) !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    #photoZone:hover {
        background: var(--accent-blue-hover) !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 4px 15px rgba(59, 108, 245, 0.3) !important;
    }

    #photoZone svg {
        width: 18px !important;
        height: 18px !important;
        opacity: 1 !important;
        color: #fff !important;
        margin: 0 !important;
    }

    #photoZone .upload-text {
        font-size: 0.9rem !important;
        margin: 0 !important;
        font-weight: 600 !important;
        color: #fff !important;
    }

    #photoZone .photo-btn-text {
        font-size: 0 !important;
    }

    #photoZone .photo-btn-text::before {
        content: "Foto aufnehmen / hochladen" !important;
        font-size: 0.9rem !important;
        font-weight: 600 !important;
        color: #fff !important;
    }

    #photoZone .upload-hint {
        display: none !important;
    }
}

/* ── iOS AUTO-ZOOM PREVENTION ─────────────────────── */
@media (max-width: 768px) {

    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="password"],
    input[type="search"],
    input[type="number"],
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* ── NOTIZEN BEREICH (CRUD) ───────────────────────── */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.note-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 200px;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-card);
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.note-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-word;
    margin: 0;
}

.note-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.note-content {
    font-size: 0.9rem;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-word;
    flex-grow: 1;
    margin-bottom: 20px;
}

.note-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
    margin-top: auto;
}

.btn-note-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
    font-family: inherit;
    line-height: 1.2;
    box-sizing: border-box;
    min-width: 90px;
}

.btn-note-edit {
    background: rgba(59, 108, 245, 0.1);
    color: var(--accent-blue);
    border-color: rgba(59, 108, 245, 0.2);
}

.btn-note-edit:hover {
    background: var(--accent-blue);
    color: #fff;
}

.btn-note-delete {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-red);
    border-color: rgba(239, 68, 68, 0.2);
}

.btn-note-delete:hover {
    background: var(--accent-red);
    color: #fff;
}

/* Notiz Formular & Editor */
.note-editor-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-card);
}

.note-editor-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.note-form-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.note-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 8px;
}

/* Modal Overlay & Animations */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 15, 30, 0.7);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    animation: fadeInModal var(--transition-fast) forwards;
}

@keyframes fadeInModal {
    to {
        opacity: 1;
    }
}

.modal-content-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    transform: translateY(20px);
    animation: slideUpModal var(--transition-normal) forwards;
}

@keyframes slideUpModal {
    to {
        transform: translateY(0);
    }
}

/* ── BAR CHART ────────────────────────────────────── */
.commission-chart-container {
    display: flex;
    gap: 16px;
    margin: 20px 0;
    min-height: 240px;
    height: 240px;
}

.chart-y-axis {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: right;
    min-width: 60px;
    padding-bottom: 24px;
}

.chart-wrapper-grid {
    flex-grow: 1;
    position: relative;
    border-left: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.chart-bars-area {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    height: 100%;
    padding: 0 10px;
}

.chart-bar-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: calc(100% / 12);
    height: 100%;
}

.chart-bar-wrapper {
    flex-grow: 1;
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    position: relative;
    padding-bottom: 8px;
}

.chart-bar {
    width: 60%;
    max-width: 24px;
    min-width: 12px;
    background: linear-gradient(180deg, var(--accent-blue) 0%, rgba(59, 108, 245, 0.4) 100%);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    position: relative;
    transition: height var(--transition-normal) ease;
    cursor: pointer;
}

.chart-bar:hover {
    background: linear-gradient(180deg, var(--accent-blue-hover) 0%, rgba(59, 108, 245, 0.7) 100%);
}

.chart-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 6px;
    font-weight: 500;
    text-transform: uppercase;
}

.chart-label .desktop-label {
    display: inline;
}

.chart-label .mobile-label {
    display: none;
}

/* Tooltips */
.chart-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    white-space: nowrap;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast) ease, transform var(--transition-fast) ease;
}

.chart-bar:hover .chart-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

.tooltip-month {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.tooltip-value {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ── RESPONSIVE CHART OVERRIDES (Defined at bottom of file to cascade correctly) ── */
@media (max-width: 768px) {
    .commission-chart-container {
        gap: 8px;
    }

    .chart-y-axis {
        min-width: 45px;
        font-size: 0.7rem;
    }

    .chart-label .desktop-label {
        display: none !important;
    }

    .chart-label .mobile-label {
        display: inline !important;
    }
}