/* style.css */
/* Professional Braun Connect CRM Stylesheet with CSS Variables for Light & Dark Mode */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    /* Společné barvy */
    --primary: #4f46e5;
    --primary-light: #818cf8;
    --primary-dark: #3730a3;
    --primary-bg: rgba(79, 70, 229, 0.08);
    
    --success: #16a34a;
    --success-light: #4ade80;
    --success-dark: #15803d;
    --success-bg: rgba(22, 163, 74, 0.08);
    
    --warning: #ea580c;
    --warning-light: #fb923c;
    --warning-bg: rgba(234, 88, 12, 0.08);
    
    --danger: #dc2626;
    --danger-light: #fca5a5;
    --danger-bg: rgba(220, 38, 38, 0.08);
    
    --purple: #9333ea;
    --purple-light: #c084fc;
    --purple-bg: rgba(147, 51, 234, 0.08);

    --font: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.08);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.12), 0 8px 10px -6px rgba(0,0,0,0.12);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);

    /* SVĚTLÝ MOTIV (Výchozí) */
    --bg: #f1f5f9;
    --card-bg: #ffffff;
    --text: #0f172a;
    --text-muted: #475569;
    --border: #e2e8f0;
    --input-bg: #f8fafc;
    --table-hdr-bg: #f8fafc;
    --sidebar-bg: #0f172a;
    --sidebar-text: #94a3b8;
}

/* TMAVÝ MOTIV */
body.dark-theme {
    --bg: #0b0f19;
    --card-bg: #131c2e;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --border: #1e293b;
    --input-bg: #1e293b;
    --table-hdr-bg: #1e293b;
    --sidebar-bg: #090d16;
    --sidebar-text: #64748b;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.5;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}
a:hover {
    color: var(--primary-dark);
}

/* App Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

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

.sidebar-brand {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-brand-logo {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    color: white;
}

.sidebar-brand-name {
    font-size: 1.25rem;
    font-weight: 600;
    background: linear-gradient(135deg, #ffffff, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-menu {
    flex: 1;
    padding: 24px 16px;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
}

.sidebar-menu-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--sidebar-text);
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
}

.sidebar-menu-item a:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: white;
}

.sidebar-menu-item.active a {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    background-color: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background-color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    color: white;
}

.user-info {
    flex: 1;
    overflow: hidden;
}

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

.user-role {
    font-size: 0.7rem;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--sidebar-text);
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font);
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
}

.btn-logout:hover {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* Main Area */
.main-wrapper {
    flex: 1;
    margin-left: 280px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Navbar */
.navbar {
    height: 72px;
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 90;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.search-box {
    display: flex;
    align-items: center;
    background-color: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 16px;
    width: 360px;
    transition: var(--transition);
}

.search-box:focus-within {
    border-color: var(--primary);
    background-color: var(--card-bg);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.search-input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    margin-left: 8px;
    font-family: var(--font);
    font-size: 0.9rem;
    color: var(--text);
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Theme Switcher Button */
.btn-theme-toggle {
    background: var(--input-bg);
    border: 1px solid var(--border);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition);
}

.btn-theme-toggle:hover {
    border-color: var(--primary);
    background: var(--card-bg);
}

/* Content Body */
.content-body {
    padding: 32px;
    flex: 1;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text);
}

.page-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-family: var(--font);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
}

.btn-primary { background-color: var(--primary); color: white; }
.btn-primary:hover { background-color: var(--primary-dark); box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2); }

.btn-secondary { background-color: var(--card-bg); color: var(--text-muted); border: 1px solid var(--border); }
.btn-secondary:hover { background-color: var(--input-bg); color: var(--text); }

.btn-success { background-color: var(--success); color: white; }
.btn-success:hover { background-color: var(--success-dark); }

.btn-purple { background-color: var(--purple); color: white; }
.btn-purple:hover { background-color: #7c3aed; }

.btn-danger { background-color: var(--danger); color: white; }
.btn-danger:hover { background-color: #b91c1c; }

.btn-sm { padding: 6px 12px; font-size: 0.8rem; border-radius: 6px; }

/* Section Cards */
.section-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 24px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* KPI Metriky */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.kpi-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    font-size: 1.5rem;
}

.kpi-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    margin-top: 4px;
}

/* KPI Barevné variace */
.kpi-blue .kpi-icon-wrapper { background-color: rgba(37, 99, 235, 0.1); color: #2563eb; }
.kpi-green .kpi-icon-wrapper { background-color: rgba(22, 163, 74, 0.1); color: #16a34a; }
.kpi-orange .kpi-icon-wrapper { background-color: rgba(234, 88, 12, 0.1); color: #ea580c; }
.kpi-red .kpi-icon-wrapper { background-color: rgba(220, 38, 38, 0.1); color: #dc2626; }
.kpi-purple .kpi-icon-wrapper { background-color: rgba(147, 51, 234, 0.1); color: #9333ea; }
.kpi-cyan .kpi-icon-wrapper { background-color: rgba(8, 145, 178, 0.1); color: #0891b2; }

/* Dashboard Funnel trychtýř (Pure HTML/CSS) */
.funnel-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.funnel-stage {
    display: flex;
    align-items: center;
    height: 40px;
    border-radius: 6px;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0 16px;
    transition: var(--transition);
    position: relative;
}

.funnel-stage:hover {
    filter: brightness(1.1);
}

.funnel-stage-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.funnel-stage-val {
    margin-left: 12px;
}

/* Tables */
.table-container {
    overflow-x: auto;
    margin-top: 8px;
}

.table-custom {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.table-custom th {
    padding: 14px 16px;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
    background-color: var(--table-hdr-bg);
}

.table-custom td {
    padding: 16px;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: middle;
}

.table-custom tbody tr {
    transition: var(--transition);
}

.table-custom tbody tr:hover {
    background-color: var(--input-bg);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
}

/* Stavy firem */
.status-new { background-color: var(--border); color: var(--text-muted); }
.status-call-today { background-color: rgba(37, 99, 235, 0.15); color: #2563eb; border: 1px solid rgba(37, 99, 235, 0.2); }
.status-unreachable { background-color: rgba(217, 119, 6, 0.15); color: #d97706; }
.status-call-later { background-color: rgba(234, 88, 12, 0.15); color: #ea580c; }
.status-interested { background-color: var(--success-bg); color: var(--success); border: 1px solid rgba(22, 163, 74, 0.2); }
.status-wants-info { background-color: rgba(8, 145, 178, 0.15); color: #0891b2; }
.status-email-sent { background-color: rgba(2, 132, 199, 0.15); color: #0284c7; }
.status-wants-demo { background-color: var(--purple-bg); color: var(--purple); border: 1px solid rgba(147, 51, 234, 0.2); }
.status-demo-preparing { background-color: rgba(162, 28, 175, 0.15); color: #a21caf; }
.status-demo-sent { background-color: rgba(124, 58, 237, 0.15); color: #7c3aed; }
.status-demo-waiting { background-color: rgba(219, 39, 119, 0.15); color: #db2777; }
.status-ordered { background-color: #bbf7d0; color: #166534; font-weight: bold; border: 1px solid rgba(22, 101, 52, 0.2); }
body.dark-theme .status-ordered { background-color: rgba(22, 101, 52, 0.3); color: #4ade80; }
.status-no-interest { background-color: rgba(71, 85, 105, 0.15); color: var(--text-muted); }
.status-do-not-call { background-color: var(--danger-bg); color: var(--danger); }

/* Stavy ukázek */
.demo-new { background-color: var(--purple-bg); color: var(--purple); }
.demo-preparing { background-color: rgba(162, 28, 175, 0.15); color: #a21caf; }
.demo-ready { background-color: var(--success-bg); color: var(--success); }
.demo-sent { background-color: rgba(2, 132, 199, 0.15); color: #0284c7; }
.demo-waiting { background-color: rgba(234, 88, 12, 0.15); color: #ea580c; }
.demo-ordered { background-color: rgba(22, 101, 52, 0.2); color: #166534; font-weight: bold; }
.demo-cancelled { background-color: var(--danger-bg); color: var(--danger); }

/* Priority */
.priority-high { background-color: var(--danger-bg); color: var(--danger); border: 1px solid rgba(220, 38, 38, 0.2); }
.priority-medium { background-color: var(--warning-bg); color: var(--warning); border: 1px solid rgba(234, 88, 12, 0.2); }
.priority-low { background-color: var(--border); color: var(--text-muted); }

/* Filters Panel */
.filters-panel {
    background-color: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

.filter-select, .filter-input {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background-color: var(--input-bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.85rem;
    outline: none;
    min-width: 160px;
    transition: var(--transition);
}

.filter-select:focus, .filter-input:focus {
    border-color: var(--primary);
    background-color: var(--card-bg);
}

/* Detail page grid layout */
.detail-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 32px;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 24px;
    list-style: none;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background-color: var(--border);
}

.timeline-item {
    position: relative;
    margin-bottom: 24px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-circle {
    position: absolute;
    left: -22px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--card-bg);
    border: 2px solid var(--primary);
    z-index: 1;
}

.timeline-item.status-changed .timeline-circle { border-color: var(--warning); }
.timeline-item.email-sent .timeline-circle { border-color: var(--primary-light); }
.timeline-item.demo-action .timeline-circle { border-color: var(--purple); }

.timeline-content {
    background-color: var(--input-bg);
    padding: 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 500;
}

.timeline-user {
    font-weight: 600;
    color: var(--text);
}

.timeline-body {
    font-size: 0.9rem;
    color: var(--text);
    white-space: pre-wrap;
}

/* Quick Action Call Result Buttons */
.quick-results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.btn-quick-result {
    padding: 10px 6px;
    font-size: 0.8rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background-color: var(--card-bg);
    color: var(--text-muted);
    font-family: var(--font);
    cursor: pointer;
    font-weight: 600;
    text-align: center;
    transition: var(--transition);
}

.btn-quick-result:hover {
    border-color: var(--primary);
    background-color: var(--primary-bg);
    color: var(--primary);
}

/* Form controls */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.form-group-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.form-control {
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background-color: var(--input-bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
    width: 100%;
}

.form-control:focus {
    border-color: var(--primary);
    background-color: var(--card-bg);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-control:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

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

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background-color: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    animation: modalFadeIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
}

.modal-close {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 24px;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success { background-color: var(--success-bg); color: var(--success); border: 1px solid rgba(22, 163, 74, 0.1); }
.alert-danger { background-color: var(--danger-bg); color: var(--danger); border: 1px solid rgba(220, 38, 38, 0.1); }
.alert-warning { background-color: var(--warning-bg); color: var(--warning); border: 1px solid rgba(234, 88, 12, 0.1); }
.alert-info { background-color: var(--primary-bg); color: var(--primary); border: 1px solid rgba(79, 70, 229, 0.1); }

/* Import / Drag and Drop */
.import-card {
    border: 2px dashed var(--border);
    background-color: var(--input-bg);
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.import-card:hover {
    border-color: var(--primary);
    background-color: var(--primary-bg);
}

.import-icon {
    font-size: 2.5rem;
    color: var(--primary-light);
    margin-bottom: 16px;
}

/* Login Card style */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top right, var(--primary-bg), var(--bg));
    padding: 20px;
}

.login-card {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 440px;
    padding: 40px;
    border: 1px solid var(--border);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.login-logo {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.5rem;
    color: white;
    margin: 0 auto 24px;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
    color: var(--text);
}

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

/* Toast */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1100;
}

.toast {
    background-color: #0f172a;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.pagination-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background-color: var(--card-bg);
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

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

.pagination-item.active {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
}

.pagination-item.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Mobile toggler */
.btn-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text);
}

/* Live audit logs feed style */
.feed-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.feed-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--input-bg);
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.feed-item:hover {
    transform: translateX(4px);
}

.feed-icon {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feed-body {
    flex: 1;
}

.feed-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.feed-desc {
    font-size: 0.88rem;
    color: var(--text);
}

/* Mobile & Responsive adjustments */
@media (max-width: 1024px) {
    .dashboard-sections, .detail-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-wrapper {
        margin-left: 0;
    }
    
    .navbar {
        padding: 0 16px;
    }
    
    .btn-menu-toggle {
        display: block;
    }
    
    .search-box {
        width: 160px;
    }
    
    .content-body {
        padding: 16px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .filters-panel {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-select, .filter-input {
        min-width: 100%;
    }
    
    .quick-results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==================================================== */
/* FLOATING REMINDER TOAST NOTIFICATION */
/* ==================================================== */
.reminder-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 320px;
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border);
    border-left: 5px solid var(--purple);
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: slideInReminder 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInReminder {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.reminder-toast-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.reminder-toast-icon {
    font-size: 1.25rem;
    margin-right: 8px;
}

.reminder-toast-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
    flex-grow: 1;
}

.reminder-toast-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
}

.reminder-toast-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.reminder-company-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.reminder-time {
    font-size: 0.8rem;
    color: var(--purple);
    font-weight: 600;
}

.reminder-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
    max-height: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reminder-toast-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.reminder-toast-actions button {
    flex: 1;
    padding: 8px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ==================================================== */
/* CALENDAR LAYOUT STYLES */
/* ==================================================== */
.calendar-wrapper {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 32px;
    display: flex;
    flex-direction: column;
}

.calendar-days-header {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    background-color: var(--input-bg);
    border-bottom: 1px solid var(--border);
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text);
    padding: 12px 0;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    grid-auto-rows: minmax(110px, auto);
}

.calendar-day-cell {
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background-color: var(--card-bg);
    position: relative;
    transition: background-color 0.2s;
}

.calendar-day-cell:nth-child(7n) {
    border-right: none;
}

.calendar-grid .calendar-day-cell:nth-last-child(-n+7) {
    border-bottom: none;
}

.calendar-day-cell.empty-cell {
    background-color: var(--body-bg);
    opacity: 0.4;
}

.calendar-day-cell:not(.empty-cell):hover {
    background-color: var(--primary-bg);
}

.today-cell {
    background-color: rgba(99, 102, 241, 0.05);
}

.today-cell::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background-color: var(--primary);
}

.day-number {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    align-self: flex-end;
}

.today-cell .day-number {
    color: var(--primary);
}

.calendar-events-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-grow: 1;
    overflow-y: auto;
    max-height: 90px;
}

.calendar-event-item {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 4px 6px;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: transform 0.15s, filter 0.15s;
}

.calendar-event-item:hover {
    transform: translateY(-1px);
    filter: brightness(0.95);
}

.calendar-event-call {
    background-color: rgba(79, 70, 229, 0.12);
    color: var(--primary-light);
    border-left: 3px solid var(--primary);
}

body.dark-theme .calendar-event-call {
    background-color: rgba(99, 102, 241, 0.2);
}

.calendar-event-demo {
    background-color: rgba(139, 92, 246, 0.12);
    color: var(--purple);
    border-left: 3px solid var(--purple);
}

body.dark-theme .calendar-event-demo {
    background-color: rgba(139, 92, 246, 0.2);
}

.event-time {
    font-weight: 700;
    opacity: 0.85;
}

.event-title {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Mobilní Agenda Styl (Optimalizace kalendáře pro mobilní zařízení) */
.calendar-empty-state-mobile {
    display: none;
    text-align: center;
    padding: 32px 16px;
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 500;
    border-top: 1px dashed var(--border);
}

@media (max-width: 768px) {
    .calendar-days-header {
        display: none;
    }
    
    .calendar-grid {
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding: 12px;
        background-color: var(--body-bg);
    }
    
    .calendar-day-cell.empty-cell {
        display: none !important;
    }
    
    /* Na mobilu skryjeme dny, které nemají události (a nejsou Dnes) */
    .calendar-day-cell:not(.today-cell):not(.has-events) {
        display: none !important;
    }
    
    .calendar-day-cell {
        border: 1px solid var(--border) !important;
        border-radius: 12px !important;
        padding: 16px !important;
        min-height: auto !important;
        flex-direction: row !important;
        align-items: center;
        gap: 16px;
        background-color: var(--card-bg);
        box-shadow: var(--shadow-sm);
    }
    
    .day-number {
        font-size: 1.3rem;
        font-weight: 800;
        color: var(--text);
        min-width: 44px;
        height: 44px;
        background-color: var(--input-bg);
        border: 1px solid var(--border);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        align-self: center;
    }
    
    .today-cell .day-number {
        background-color: var(--primary);
        color: white;
        border-color: var(--primary);
    }
    
    .calendar-events-container {
        flex-grow: 1;
        max-height: none !important;
    }
    
    .calendar-event-item {
        font-size: 0.8rem;
        padding: 6px 10px;
        margin-bottom: 4px;
        white-space: normal;
        word-break: break-word;
    }
    
    .calendar-event-item:last-child {
        margin-bottom: 0;
    }
    
    .calendar-empty-state-mobile {
        display: block;
    }
}

/* ==================================================== */
/* WEBMAIL INTEGRATION STYLES */
/* ==================================================== */
.webmail-layout {
    display: grid;
    grid-template-columns: 220px 320px 1fr;
    gap: 16px;
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    min-height: calc(100vh - 180px);
    overflow: hidden;
    margin-bottom: 24px;
}

@media (max-width: 1200px) {
    .webmail-layout {
        grid-template-columns: 180px 280px 1fr;
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .webmail-layout {
        grid-template-columns: 1fr;
        min-height: auto;
        gap: 0;
    }
    
    .webmail-sidebar {
        border-right: none !important;
        border-bottom: 1px solid var(--border);
    }
    
    .webmail-list-pane {
        border-right: none !important;
        border-bottom: 1px solid var(--border);
        max-height: 350px;
    }
    
    .webmail-messages-container {
        max-height: 280px !important;
    }
}

.webmail-sidebar {
    background-color: var(--primary-bg);
    border-right: 1px solid var(--border);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

body.dark-theme .webmail-sidebar {
    background-color: rgba(30, 41, 59, 0.5);
}

.webmail-list-pane {
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    background-color: var(--card-bg);
}

.webmail-messages-container {
    overflow-y: auto;
    flex-grow: 1;
    max-height: calc(100vh - 240px);
}

.webmail-item {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background-color 0.2s, border-left-color 0.2s;
    border-left: 4px solid transparent;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.webmail-item:hover {
    background-color: var(--input-bg);
}

.webmail-item.active {
    background-color: var(--primary-bg);
    border-left-color: var(--purple);
}

body.dark-theme .webmail-item.active {
    background-color: rgba(99, 102, 241, 0.1);
}

.webmail-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.webmail-item-sender {
    display: inline-block;
    min-width: 0;
    flex-grow: 1;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.webmail-item-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.webmail-item-subject {
    display: block;
    min-width: 0;
    width: 100%;
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.webmail-item.unseen .webmail-item-subject {
    font-weight: 700;
    color: var(--text);
}

.webmail-item.unseen {
    border-left-color: var(--purple);
}

.webmail-reading-pane {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background-color: var(--card-bg);
    overflow-y: auto;
    max-height: calc(100vh - 200px);
}

.webmail-empty-reading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    text-align: center;
    padding: 64px 24px;
    color: var(--text-muted);
}

.webmail-reading-header {
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px;
}

.webmail-reading-subject {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    line-height: 1.3;
}

.webmail-crm-bar {
    background-color: var(--primary-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
}

body.dark-theme .webmail-crm-bar {
    background-color: rgba(30, 41, 59, 0.4);
}

.webmail-reading-body {
    font-size: 0.95rem;
    color: var(--text);
    line-height: 1.6;
    white-space: pre-wrap;
    padding: 20px;
    background-color: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    min-height: 200px;
    flex-shrink: 0;
    font-family: inherit;
}

/* Citace a blockquotes v těle e-mailů */
.webmail-reading-body blockquote,
.webmail-reading-body .gmail_quote,
.webmail-reading-body .email-quote {
    display: block;
    border-left: 3px solid var(--purple);
    padding-left: 12px;
    margin-left: 4px;
    margin-right: 0;
    color: var(--text-muted);
    font-style: italic;
}

/* Kruhový avatar */
.user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    text-transform: uppercase;
}

/* Sekce příloh a Quill editoru */
.webmail-attachments-section {
    margin-top: 16px;
    padding: 16px;
    background-color: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
}

/* Quill Editor Overrides */
.ql-toolbar.ql-snow {
    border-color: var(--border) !important;
    border-radius: 8px 8px 0 0 !important;
    background-color: var(--input-bg) !important;
}
.ql-container.ql-snow {
    border-color: var(--border) !important;
    border-radius: 0 0 8px 8px !important;
    background-color: var(--card-bg) !important;
    font-family: inherit !important;
}

body.dark-theme .ql-toolbar.ql-snow {
    background-color: rgba(30, 41, 59, 0.5) !important;
    border-color: var(--border) !important;
}
body.dark-theme .ql-toolbar.ql-snow .ql-stroke {
    stroke: var(--text) !important;
}
body.dark-theme .ql-toolbar.ql-snow .ql-fill {
    fill: var(--text) !important;
}
body.dark-theme .ql-toolbar.ql-snow .ql-picker {
    color: var(--text) !important;
}
body.dark-theme .ql-container.ql-snow {
    border-color: var(--border) !important;
    background-color: var(--card-bg) !important;
    color: var(--text) !important;
}
body.dark-theme .ql-editor.ql-blank::before {
    color: var(--text-muted) !important;
}
