
/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Raynet Color Scheme */
--primary-color: #7C3AED;
--primary-dark:  #5B21B6;
--primary-light: #C084FC;


    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
    
    /* Backgrounds */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-dark: #1e293b;
    
    /* Text Colors */
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-white: #ffffff;
    
    /* Borders */
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    
    /* Layout */
    --header-height: 60px;
    --sidebar-width: 240px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Extension Badge */
.extension-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: var(--success-color);
    color: white;
    border-radius: 50%;
    font-size: 10px;
}

/* Extension Info Banner */
.extension-info-banner {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 25px;
    background: linear-gradient(135deg, #dcfce7 0%, #f0fdf4 100%);
    border-bottom: 1px solid var(--border-color);
}

.extension-info-banner i {
    font-size: 24px;
    color: var(--success-color);
}

.extension-info-banner strong {
    color: var(--success-color);
    font-size: 14px;
}

.extension-info-banner p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

/* Expiring Contracts Widget */
.expiring-contracts-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.expiring-contract-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    transition: all 0.2s;
}

.expiring-contract-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-sm);
}

.expiring-contract-item.urgency-critical {
    border-left-color: var(--danger-color);
    background: #fef2f2;
}

.expiring-contract-item.urgency-warning {
    border-left-color: var(--warning-color);
    background: #fffbeb;
}

.expiring-contract-item.urgency-safe {
    border-left-color: var(--success-color);
}

.expiring-contract-item.urgency-expired {
    border-left-color: #6b7280;
    background: #f9fafb;
    opacity: 0.7;
}

.contract-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.expiring-contract-item.urgency-critical .contract-icon {
    background: #fee2e2;
    color: var(--danger-color);
}

.expiring-contract-item.urgency-warning .contract-icon {
    background: #fef3c7;
    color: var(--warning-color);
}

.contract-info {
    flex: 1;
}

.contract-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.contract-date {
    font-size: 12px;
    color: var(--text-muted);
}

.contract-status {
    flex-shrink: 0;
}

/* Urgency Badges */
.urgency-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.urgency-badge.urgency-critical {
    background: #fee2e2;
    color: #991b1b;
}

.urgency-badge.urgency-warning {
    background: #fef3c7;
    color: #92400e;
}

.urgency-badge.urgency-safe {
    background: #dcfce7;
    color: #166534;
}

.urgency-badge.urgency-expired {
    background: #f3f4f6;
    color: #6b7280;
}

/* Extension Date Styling */
.extension-date {
    font-weight: 600;
}

.extension-date.urgency-critical {
    color: var(--danger-color);
}

.extension-date.urgency-warning {
    color: var(--warning-color);
}

.extension-date.urgency-safe {
    color: var(--success-color);
}

.extension-date.urgency-expired {
    color: #6b7280;
}

/* Top Header */
.top-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

.logo i {
    font-size: 24px;
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.main-nav {
    display: flex;
    gap: 5px;
}

.nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    font-size: 13px;
    position: relative;
}

.nav-link i {
    font-size: 18px;
}

.nav-link:hover {
    background: var(--bg-secondary);
    color: var(--primary-color);
}

.nav-link.active {
    color: var(--primary-color);
    background: var(--bg-secondary);
}

.nav-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--danger-color);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.header-btn:hover {
    background: var(--bg-secondary);
    color: var(--primary-color);
}

.notification-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--danger-color);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 8px;
    transition: all 0.2s;
}

.user-menu:hover {
    background: var(--bg-secondary);
}

.user-menu img {
    height: 36px;
    width: auto;
    border-radius: 0px; /* alebo 0, ak nechceš zaoblenie */
    object-fit: contain;
}


.user-menu span {
    font-size: 14px;
    font-weight: 500;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: var(--header-height);
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    z-index: 900;
}

.sidebar-search {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-secondary);
    padding: 10px 15px;
    border-radius: 8px;
    margin: 15px;
}

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

.sidebar-search input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    font-size: 14px;
}

.sidebar-nav {
    padding: 10px 0;
}

.nav-section {
    margin-bottom: 20px;
}

.nav-section-title {
    padding: 10px 20px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 14px;
    position: relative;
}

.sidebar-item i {
    width: 20px;
    font-size: 16px;
}

.sidebar-item:hover {
    background: var(--bg-secondary);
    color: var(--primary-color);
}

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

.sidebar-item .badge {
    margin-left: auto;
    background: var(--danger-color);
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-footer {
    position: sticky;
    bottom: 0;
    padding: 15px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
}

.btn-new-record {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-new-record:hover {
    background: var(--primary-dark);
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    padding: 30px;
    min-height: calc(100vh - var(--header-height));
}

.page {
    display: none;
}

.page.active {
    display: block;
}

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

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

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

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
}

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

.btn-danger:hover {
    background: #dc2626;
}

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

.btn-success:hover {
    background: #059669;
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background: #d97706;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-link {
    background: transparent;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-link:hover {
    color: var(--primary-dark);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 20px;
}

.dashboard-panel {
    background: var(--bg-primary);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.panel-body {
    padding: 20px;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 15px;
}

.activity-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
    transition: all 0.2s;
}

.activity-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-sm);
}

.activity-time {
    font-size: 12px;
    color: var(--text-muted);
    min-width: 100px;
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.activity-description {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Content Card */
.content-card {
    background: var(--bg-primary);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 8px 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    min-width: 300px;
}

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

.search-box input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    font-size: 14px;
}

.toolbar-actions {
    display: flex;
    gap: 10px;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    cursor: pointer;
    background: white;
}

/* Data Table */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--bg-secondary);
}

.data-table th {
    text-align: left;
    padding: 15px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
}

.data-table td {
    padding: 15px;
    font-size: 14px;
    border-bottom: 1px solid var(--border-light);
}

.data-table tbody tr:hover {
    background: var(--bg-secondary);
}

.data-table tbody tr {
    transition: all 0.2s;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}
.status-active, .status-vybavene, .status-done {
    background: #dcfce7; color: #166534;
}
.status-inactive {
    background: #fee2e2; color: #991b1b;
}
.status-vybavuje_sa, .status-in_progress, .priority-medium {
    background: #fef3c7; color: #92400e;
}
.status-todo, .priority-low {
    background: #dbeafe; color: #1e40af;
}
.priority-high {
    background: #fee2e2; color: #991b1b;
}


/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-state i {
    font-size: 48px; margin-bottom: 15px; opacity: 0.3;
}
.empty-state p {
    font-size: 14px;
}
.empty-state-large {
    text-align: center; padding: 100px 20px;
}
.empty-state-large i {
    font-size: 64px; color: var(--text-muted); opacity: 0.3; margin-bottom: 20px;
}
.empty-state-large h3 {
    font-size: 24px; margin-bottom: 10px;
}
.empty-state-large p {
    color: var(--text-muted);
}

/* Calendar */
.calendar-container { display: flex; gap: 20px; background: var(--bg-primary); border-radius: 12px; box-shadow: var(--shadow-sm); overflow: hidden; }
.calendar-sidebar { width: 280px; border-right: 1px solid var(--border-color); padding: 20px; background: var(--bg-secondary); }
.calendar-mini { margin-bottom: 20px; }
.mini-calendar-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px;
}
.mini-calendar-header button { background: transparent; border: none; cursor: pointer; color: var(--text-secondary); padding: 5px; transition: all 0.2s; }
.mini-calendar-header button:hover { color: var(--primary-color); }
.mini-calendar-header span { font-size: 14px; font-weight: 600; }
.mini-calendar-grid {
    display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px;
}
.mini-calendar-day {
    aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: 12px; border-radius: 4px; cursor: pointer; transition: all 0.2s;
}
.mini-calendar-day:hover { background: var(--bg-tertiary); }
.mini-calendar-day.today { background: var(--primary-color); color: white; }

.calendar-main { flex: 1; padding: 20px; }
.calendar-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.calendar-nav { display: flex; align-items: center; gap: 15px; }
.calendar-nav button { background: transparent; border: 1px solid var(--border-color); border-radius: 6px; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s; }
.calendar-nav button:hover { background: var(--bg-secondary); border-color: var(--primary-color); color: var(--primary-color); }
.calendar-nav span { font-size: 16px; font-weight: 600; }
.calendar-week-view { display: flex; border: 1px solid var(--border-color); border-radius: 8px; overflow: auto; }
.calendar-time-column { width: 80px; border-right: 1px solid var(--border-color); background: var(--bg-secondary); }
.time-slot { height: 60px; padding: 5px 10px; font-size: 11px; color: var(--text-muted); border-bottom: 1px solid var(--border-light); text-align: right; }
.calendar-days-grid { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); }
.calendar-day-column { border-right: 1px solid var(--border-light); min-width: 120px; }
.calendar-day-column:last-child { border-right: none; }
.calendar-day-header { padding: 10px; text-align: center; border-bottom: 1px solid var(--border-color); background: var(--bg-secondary); font-size: 12px; font-weight: 600; }
.calendar-day-header.today { background: var(--primary-color); color: white; }
.calendar-hour-slot { height: 60px; border-bottom: 1px solid var(--border-light); position: relative; cursor: pointer; transition: background 0.2s; }
.calendar-hour-slot:hover { background: var(--bg-secondary); }
.calendar-event { position: absolute; left: 2px; right: 2px; border-radius: 4px; padding: 4px 6px; font-size: 11px; cursor: pointer; overflow: hidden; z-index: 10; font-weight: 500; }
.calendar-event:hover { box-shadow: var(--shadow-md); z-index: 20; }

/* Modal */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 2000; animation: fadeIn 0.2s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-content { background: var(--bg-primary); border-radius: 12px; width: 90%; max-width: 900px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); animation: slideUp 0.3s; }
@keyframes slideUp { from { transform: translateY(50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-header { padding: 20px 25px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.modal-header h2 { font-size: 20px; font-weight: 600; }
.modal-close { background: transparent; border: none; font-size: 24px; cursor: pointer; color: var(--text-muted); width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 6px; transition: all 0.2s; }
.modal-close:hover { background: var(--bg-secondary); color: var(--text-primary); }
.modal-body { padding: 25px; }
.modal-footer { padding: 20px 25px; border-top: 1px solid var(--border-color); display: flex; justify-content: flex-end; gap: 10px; }

/* Form */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 14px; color: var(--text-primary); }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 10px 15px; border: 1px solid var(--border-color); border-radius: 8px; font-size: 14px; outline: none; transition: all 0.2s; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1); }
.form-group textarea { resize: vertical; min-height: 100px; }
.search-results-dropdown { display: none; position: absolute; top: 100%; left: 0; right: 0; background: white; border: 1px solid var(--border-color); border-radius: 8px; max-height: 200px; overflow-y: auto; z-index: 1001; box-shadow: var(--shadow-md); }
.search-item-row { padding: 10px; cursor: pointer; border-bottom: 1px solid var(--border-light); transition: background 0.2s; }
.search-item-row:hover { background: var(--bg-secondary); }
.search-item-row:last-child { border-bottom: none; }

/* Activity Types Management */
.activity-types-list { display: flex; flex-direction: column; gap: 10px; }
.activity-type-item { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--bg-secondary); border-radius: 8px; }
.activity-type-drag-handle { color: var(--text-muted); cursor: move; }
.activity-type-color { width: 24px; height: 24px; border-radius: 4px; flex-shrink: 0; }
.activity-type-name { flex: 1; font-size: 14px; font-weight: 500; }
.activity-type-actions { display: flex; gap: 8px; }

/* Color Picker */
.color-picker-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-top: 10px; }
.color-option { width: 50px; height: 50px; border-radius: 8px; cursor: pointer; transition: all 0.2s; border: 3px solid transparent; }
.color-option:hover { transform: scale(1.1); box-shadow: var(--shadow-md); }
.color-option.selected { border-color: var(--text-primary); transform: scale(1.05); }

/* Contact Detail Modal Styles */
.contact-detail-modal { width: 100%; }
.contact-header { display: flex; align-items: center; gap: 20px; padding: 25px; border-bottom: 1px solid var(--border-color); background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%); }
.contact-avatar-large { width: 80px; height: 80px; border-radius: 50%; background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%); color: white; display: flex; align-items: center; justify-content: center; font-size: 32px; font-weight: 700; flex-shrink: 0; }
.contact-info { flex: 1; }
.contact-info h2 { font-size: 24px; margin-bottom: 5px; }
.contact-info p { color: var(--text-secondary); margin-bottom: 10px; }
.contact-actions { display: flex; gap: 10px; }
.contact-tabs { display: flex; gap: 5px; padding: 0 25px; border-bottom: 1px solid var(--border-color); background: var(--bg-secondary); flex-wrap: wrap; }
.tab-btn { padding: 15px 20px; background: transparent; border: none; border-bottom: 3px solid transparent; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--text-secondary); transition: all 0.2s; }
.tab-btn:hover { color: var(--primary-color); }
.tab-btn.active { color: var(--primary-color); border-bottom-color: var(--primary-color); }
.contact-tab-content { padding: 25px; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }
.detail-section { margin-bottom: 30px; }
.detail-section h3 { font-size: 16px; font-weight: 600; margin-bottom: 15px; color: var(--text-primary); }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.detail-item label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 5px; }
.detail-item p, .detail-item a { font-size: 14px; color: var(--text-primary); text-decoration: none; }
.detail-item a:hover { text-decoration: underline; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 15px; }
.stat-card { background: var(--bg-secondary); padding: 20px; border-radius: 8px; text-align: center; }
.stat-card i { font-size: 24px; color: var(--primary-color); margin-bottom: 10px; }
.stat-value { font-size: 32px; font-weight: 700; color: var(--text-primary); margin-bottom: 5px; }
.stat-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

/* Timeline */
.activities-timeline { position: relative; }
.timeline-item { display: flex; gap: 15px; margin-bottom: 20px; position: relative; }
.timeline-item:not(:last-child)::after { content: ''; position: absolute; left: 19px; top: 40px; bottom: -20px; width: 2px; background: var(--border-color); }
.timeline-icon { width: 40px; height: 40px; border-radius: 50%; background: var(--primary-light); color: var(--primary-color); display: flex; align-items: center; justify-content: center; flex-shrink: 0; z-index: 1; }
.timeline-content { flex: 1; padding: 10px 0; }
.timeline-title { font-size: 14px; font-weight: 600; margin-bottom: 5px; }
.timeline-description { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; white-space: pre-wrap; }
.timeline-meta { display: flex; justify-content: space-between; align-items: center; }
.timeline-time { font-size: 12px; color: var(--text-muted); }
.timeline-actions .btn-link { padding: 2px 5px; font-size: 12px; }
.timeline-actions .btn-link:last-child { color: var(--danger-color); }
.email-body-preview { margin-top: 5px; font-style: italic; color: #64748b; }


/* Mail Styles */
.mail-container { display: flex; background: var(--bg-primary); border-radius: 12px; box-shadow: var(--shadow-sm); overflow: hidden; height: calc(100vh - 200px); }
.mail-sidebar { width: 250px; border-right: 1px solid var(--border-color); background: var(--bg-secondary); padding: 20px; }
.mail-folders { display: flex; flex-direction: column; gap: 5px; }
.mail-folder { display: flex; align-items: center; gap: 12px; padding: 12px 15px; border-radius: 8px; text-decoration: none; color: var(--text-secondary); transition: all 0.2s; }
.mail-folder:hover { background: var(--bg-tertiary); }
.mail-folder.active { background: var(--primary-color); color: white; }
.folder-count { margin-left: auto; background: var(--danger-color); color: white; font-size: 11px; padding: 2px 8px; border-radius: 10px; font-weight: 600; }
.mail-main { flex: 1; display: flex; flex-direction: column; }
.mail-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; border-bottom: 1px solid var(--border-color); }
.mail-list { flex: 1; overflow-y: auto; }
.mail-item { display: flex; align-items: center; gap: 15px; padding: 15px 20px; border-bottom: 1px solid var(--border-light); cursor: pointer; }
.mail-item:hover { background: var(--bg-secondary); }
.mail-item.unread { background: var(--bg-secondary); font-weight: 600; }
.mail-from { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.mail-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--primary-color); color: white; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; flex-shrink: 0; }
.mail-subject { flex: 1; display: flex; align-items: center; gap: 10px; }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary-color); flex-shrink: 0; }
.mail-preview { color: var(--text-muted); font-size: 13px; margin-left: 10px; font-weight: 400; }
.mail-meta { color: var(--text-muted); font-size: 13px; }

/* Email Account Switcher */
#accountSwitcher { margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid var(--border-color); }
.account-switcher label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; }
#accountSelect { width: 100%; }

/* Email Modal */
.email-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 2000; }
.email-modal-content { background: var(--bg-primary); border-radius: 12px; width: 90%; max-width: 800px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.email-header-info { padding: 20px 25px; border-bottom: 1px solid var(--border-color); background: var(--bg-secondary); }
.email-from { display: flex; align-items: center; gap: 15px; margin-bottom: 15px; }
.mail-avatar-large { width: 50px; height: 50px; border-radius: 50%; background: var(--primary-color); color: white; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; }
.email-address { color: var(--text-muted); font-size: 13px; }
.email-to, .email-date { font-size: 13px; color: var(--text-secondary); margin-bottom: 5px; }
.email-body { padding: 20px 0; line-height: 1.8; }

/* Search Modal */
.search-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); display: flex; align-items: flex-start; justify-content: center; padding-top: 100px; z-index: 2000; }
.search-modal-content { background: var(--bg-primary); border-radius: 12px; width: 90%; max-width: 700px; max-height: 80vh; overflow: hidden; box-shadow: var(--shadow-lg); }
.search-modal-header { display: flex; align-items: center; gap: 15px; padding: 20px; border-bottom: 1px solid var(--border-color); }
.search-box-large { flex: 1; display: flex; align-items: center; gap: 15px; }
.search-box-large i { color: var(--text-muted); font-size: 20px; }
.search-box-large input { flex: 1; border: none; outline: none; font-size: 18px; }
.search-modal-body { max-height: calc(80vh - 80px); overflow-y: auto; padding: 20px; }
.search-section h4 { font-size: 14px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; margin-bottom: 15px; }
.search-item { display: flex; align-items: center; gap: 15px; padding: 15px; background: var(--bg-secondary); border-radius: 8px; cursor: pointer; transition: all 0.2s; }
.search-item:hover { background: var(--bg-tertiary); transform: translateX(5px); }
.search-item-icon { width: 40px; height: 40px; border-radius: 50%; background: var(--primary-light); color: var(--primary-color); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.search-item-title { font-size: 14px; font-weight: 600; margin-bottom: 5px; }
.search-item-title mark { background: #fef08a; padding: 1px 3px; border-radius: 3px; }
.search-item-meta { font-size: 12px; color: var(--text-muted); }

/* Notifications Panel */
.notifications-panel { position: fixed; right: 20px; top: 70px; width: 400px; max-height: 600px; background: var(--bg-primary); border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 1500; overflow: hidden; }
.notifications-header { display: flex; justify-content: space-between; align-items: center; padding: 20px; border-bottom: 1px solid var(--border-color); }
.notifications-body { max-height: 500px; overflow-y: auto; }
.notification-item { display: flex; gap: 15px; padding: 15px 20px; border-bottom: 1px solid var(--border-light); cursor: pointer; position: relative; }
.notification-item:hover { background: var(--bg-secondary); }
.notification-item.unread { background: var(--bg-secondary); }
.notification-icon { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.notification-icon.task { background: #dbeafe; color: #1e40af; }
.notification-icon.deal { background: #dcfce7; color: #166534; }
.notification-icon.email { background: #fef3c7; color: #92400e; }
.notification-icon.contact { background: #e0e7ff; color: #4338ca; }
.notification-unread-dot { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); width: 8px; height: 8px; border-radius: 50%; background: var(--primary-color); }

/* Notification Toast */
.notification { position: fixed; top: 80px; right: 20px; padding: 15px 20px; background: var(--bg-primary); border-radius: 8px; box-shadow: var(--shadow-lg); z-index: 9999; animation: slideInRight 0.3s; border-left: 4px solid var(--success-color); }
@keyframes slideInRight { from { transform: translateX(400px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOutRight { to { transform: translateX(400px); opacity: 0; } }
.notification.error { border-left-color: var(--danger-color); }

/* Daily Info Header */
#dailyInfo { display: flex; flex-direction: column; justify-content: center; line-height: 1.25; }
#dailyInfo .daily-date { font-size: 13px; font-weight: 500; color: #555; }
#dailyInfo .daily-name { font-size: 13px; font-weight: 500; color: #333; }
#dailyInfo .daily-name strong { font-weight: 600; color: var(--primary-color); }
#dailyInfo .daily-holiday, #dailyInfo .daily-special { font-size: 12px; font-weight: 600; margin-top: 1px; }
#dailyInfo .daily-holiday { color: #d63333; }
#dailyInfo .daily-special { color: #ff9900; }
#dailyInfo .heart { color: var(--primary-color); font-size: 14px; margin-left: 4px; }
.badge-assigned { display: inline-block; padding: 6px 12px; background-color: #f3e8ff; color: #6b21a8; font-size: 13px; font-weight: 600; border-radius: 20px; border: 1px solid #e9d5ff; }

/* Table cell ellipsis */
td.description-cell { max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-badge { white-space: nowrap; }

/* Pagination */
.pagination { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 20px; padding: 10px 0; }
.pagination button { color: var(--primary-color); border: 1px solid var(--primary-light); background: white; padding: 6px 12px; border-radius: 6px; font-weight: 500; cursor: pointer; transition: 0.2s; }
.pagination button:hover:not(.active):not(.disabled) { background: #f5f3ff; }
.pagination button.active { background: var(--primary-color); color: white; border-color: var(--primary-color); }
.pagination button.disabled { opacity: 0.4; cursor: not-allowed; }

.notes-link {
    color: var(--primary-color);
    text-decoration: underline;
    cursor: pointer;
}

/* Specific table cell styling for multiline content */
.companies-table-address-cell {
    white-space: normal;
}

.companies-table-address-cell div {
    display: block;
    margin: 0;
    padding: 0;
    line-height: 1.2;
}


/* Responsive & Fixes */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); transition: transform 0.3s; }
    .sidebar.active { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .main-nav, .header-center { display: none; }
    .header-left { flex: 1; }
    .calendar-container { flex-direction: column; }
    .calendar-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border-color); }
    .detail-grid, .stats-grid { grid-template-columns: 1fr; }
}

#dailyInfo {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4px 12px;
    margin: 0;
    gap: 0;
    line-height: 1.15;
}
#dailyInfo .daily-date,
#dailyInfo .daily-name,
#dailyInfo .daily-holiday,
#dailyInfo .daily-special {
    margin: 0;
    padding: 0;
}


/* === Restore nice calendar event preview & task detail styles === */

/* Selected day in mini calendar */
.mini-calendar-day.selected {
    background: var(--primary-light);
    color: #fff;
}

/* Tighter event box inside hour slot (like original) */
.calendar-hour-slot {
    padding: 2px;
}

/* Event card offset + compact look */
.calendar-event {
    top: 2px;
}

/* Event Detail Modal – header with icon & gradient like before */
.event-detail-modal {
    width: 100%;
}

.event-detail-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 25px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

.event-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    flex-shrink: 0;
}

.event-info {
    flex: 1;
}

.event-info h2 {
    font-size: 24px;
    margin-bottom: 5px;
}

.event-info p {
    color: var(--text-secondary);
}

.event-actions {
    display: flex;
    gap: 10px;
}

.event-detail-body {
    padding: 25px;
}

.related-line {
    display: inline-block;
    margin-bottom: 4px;
}

.related-line strong {
    margin-right: 4px;
}

/* === Moderný vzhľad IBA pre modály s formulárom === */
.modal-content:has(form) {
    background: #fff !important;
    border-radius: 16px !important;
    padding: 0 !important;
    max-height: 90vh;
    display: flex;
    flex-direction: column; /* aby footer ostal dole */
    box-shadow: 0 12px 40px rgba(0,0,0,0.18);
}

/* Header */
.modal-content:has(form) .modal-header {
    padding: 20px 26px !important;
    border-bottom: 1px solid rgba(0,0,0,0.07);
    background: #fafafa;
    flex-shrink: 0;
}

/* Scrollovateľné telo */
.modal-content:has(form) .modal-body {
    padding: 26px !important;
    overflow-y: auto;
    max-height: calc(90vh - 150px); /* header + footer miesto */
    flex-grow: 1;
}

/* FOOTER – aby bolo viditeľné */
.modal-content:has(form) .modal-footer {
    padding: 16px 22px !important;
    border-top: 1px solid rgba(0,0,0,0.07);
    background: #fafafa;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-shrink: 0;
}

/* Form groups */
.modal-content:has(form) .form-group {
    margin-bottom: 20px;
}

/* Inputs */
.modal-content:has(form) input,
.modal-content:has(form) select,
.modal-content:has(form) textarea {
    width: 100%;
    border: 1px solid #d9d9d9;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 15px;
    background: #fff;
    transition: 0.2s;
}

/* Focus efekt */
.modal-content:has(form) input:focus,
.modal-content:has(form) textarea:focus,
.modal-content:has(form) select:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139,92,246,0.25);
    outline: none;
}

/* Tlačidlá */
.modal-content:has(form) .btn-primary {
    background: #8b5cf6 !important;
    border-radius: 10px;
    padding: 10px 20px;
    font-size: 15px;
}

.modal-content:has(form) .btn-secondary {
    border-radius: 10px;
    padding: 10px 20px;
}


/* Oprava checkboxu v modale */
.modal-content:has(form) input[type="checkbox"] {
    width: auto !important;
    display: inline-block;
    margin-right: 10px;
    box-shadow: none !important;
}






/* Formátovanie bunky s viacerými emailami */
.companies-table-address-cell {
    white-space: normal !important; /* Povoliť zalomenie riadkov */
    vertical-align: top; /* Zarovnanie nahor, ak je riadok vyšší */
    min-width: 200px; /* Minimálna šírka pre lepšiu čitateľnosť */
}

.companies-table-address-cell a {
    display: inline-block;
    line-height: 1.5;
    margin-bottom: 2px;
    color: var(--primary-color);
    text-decoration: none;
}

.companies-table-address-cell a:hover {
    text-decoration: underline;
}









/* === Štýlovanie odkazov v tabuľke (Web, atď.) === */
.data-table td a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.data-table td a:hover {
    text-decoration: underline;
    color: var(--primary-dark);
}


/* === Modern Email Form Styles (Nový klient) === */
.modern-email-form {
    display: flex;
    flex-direction: column;
    height: 70vh; /* Fixná výška pre editor */
}

.email-form-header {
    padding: 15px 25px;
    background: #fff;
    border-bottom: 1px solid var(--border-light);
}

.form-group-inline {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.form-group-inline label {
    width: 80px;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 14px;
}

.clean-input, .clean-select {
    flex: 1;
    border: none;
    border-bottom: 1px solid transparent;
    padding: 8px 0;
    font-size: 14px;
    outline: none;
    transition: border 0.2s;
}

.clean-input:focus, .clean-select:focus {
    border-bottom-color: var(--primary-color);
}

.email-editor-container {
    flex: 1;
    padding: 20px 25px;
    overflow-y: auto;
    background: #fff;
    cursor: text;
}

.email-editor {
    outline: none;
    min-height: 100%;
    font-size: 15px;
    line-height: 1.6;
}




/* === Pridané pre vylepšený Email Klient (Podpisy, Prílohy, Hromadné akcie) === */

/* Tlačidlo nastavení (ozubené koliesko) */
#mailSettingsBtn { 
    color: var(--text-secondary); 
}
#mailSettingsBtn:hover { 
    color: var(--primary-color); 
    background: var(--bg-tertiary); 
}

/* Zobrazenie príloh pri písaní správy */
.attachments-area { 
    margin-top: 10px; 
    padding-top: 10px; 
    border-top: 1px dashed var(--border-light); 
    display: flex; 
    gap: 8px; 
    flex-wrap: wrap; 
}

.attachment-chip {
    background: #e2e8f0; 
    padding: 4px 10px; 
    border-radius: 15px;
    font-size: 12px; 
    font-weight: 500; 
    color: var(--text-primary);
    display: inline-flex; 
    align-items: center; 
    gap: 6px; 
    transition: all 0.2s;
    border: 1px solid #cbd5e1;
}

.attachment-chip:hover { 
    background: #cbd5e1; 
}

.attachment-chip i { 
    color: var(--text-secondary); 
    cursor: pointer; 
}

.attachment-chip i:hover { 
    color: var(--danger-color); 
}

/* Štýl pre označený e-mail (checkbox) */
.mail-item.selected { 
    background-color: #f3e8ff !important; /* Jemne fialová */
    border-left: 3px solid var(--primary-color);
}

/* Checkbox v toolbare */
.mail-toolbar input[type="checkbox"] { 
    width: 16px; 
    height: 16px; 
    cursor: pointer; 
    margin-right: 10px; 
    accent-color: var(--primary-color);
}


/* === Vylepšený vzhľad pre históriu emailov (Vizitky vo firmách) === */
.email-history-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
    cursor: pointer;
}

.email-history-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.email-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 12px;
    color: var(--text-muted);
}

.email-card-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
}

.email-card-badge.sent { background: #e0e7ff; color: #4338ca; }
.email-card-badge.received { background: #dcfce7; color: #166534; }

.email-card-subject {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.email-body-preview { 
    font-size: 13px; 
    color: var(--text-secondary); 
    line-height: 1.5;
    max-height: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    word-break: break-word; /* Toto opravuje rozbitý text */
}

/* === Oprava tabuľky (viac emailov pod sebou) === */
.companies-table-address-cell {
    white-space: normal !important;
    vertical-align: top;
    min-width: 200px;
}

.companies-table-address-cell a {
    display: inline-block;
    line-height: 1.5;
    margin-bottom: 2px;
    color: var(--primary-color);
    text-decoration: none;
}

.companies-table-address-cell a:hover {
    text-decoration: underline;
}

/* === Štýly pre prílohy a e-mailové nástroje === */
#mailSettingsBtn { 
    color: var(--text-secondary); 
}
#mailSettingsBtn:hover { 
    color: var(--primary-color); 
    background: var(--bg-tertiary); 
}

.attachments-area { 
    margin-top: 10px; 
    padding-top: 10px; 
    border-top: 1px dashed var(--border-light); 
    display: flex; 
    gap: 8px; 
    flex-wrap: wrap; 
}

.attachment-chip {
    background: #e2e8f0; 
    padding: 4px 10px; 
    border-radius: 15px;
    font-size: 12px; 
    font-weight: 500; 
    color: var(--text-primary);
    display: inline-flex; 
    align-items: center; 
    gap: 6px; 
    transition: all 0.2s;
    border: 1px solid #cbd5e1;
}

.attachment-chip:hover { 
    background: #cbd5e1; 
}

.attachment-chip i { 
    color: var(--text-secondary); 
    cursor: pointer; 
}

.attachment-chip i:hover { 
    color: var(--danger-color); 
}

.mail-item.selected { 
    background-color: #f3e8ff !important;
    border-left: 3px solid var(--primary-color);
}

.mail-toolbar input[type="checkbox"] { 
    width: 16px; 
    height: 16px; 
    cursor: pointer; 
    margin-right: 10px; 
    accent-color: var(--primary-color);
}


/* Editor Toolbar */
.editor-toolbar {
    padding: 8px 15px;
    border-bottom: 1px solid var(--border-light);
    background: #fafafa;
    display: flex;
    gap: 5px;
    align-items: center;
}

.editor-toolbar button {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    color: #666;
    transition: all 0.2s;
}

.editor-toolbar button:hover {
    background: #e5e7eb;
    color: var(--primary-color);
}

.editor-toolbar .toolbar-divider {
    width: 1px;
    height: 20px;
    background: #ddd;
    margin: 0 5px;
}








/* Improved Mail Item Styling */
.mail-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.1s;
    position: relative;
}

.mail-item:hover {
    background: #f8fafc;
    box-shadow: inset 2px 0 0 var(--primary-color);
}

.mail-item.unread {
    background: #ffffff;
    font-weight: 600;
}

.mail-item.unread .subject-text {
    color: #1e293b;
    font-weight: 700;
}

.mail-item.unread .mail-time {
    font-weight: 700;
    color: var(--primary-color);
}

.mail-item.selected {
    background-color: #f3e8ff;
}

.mail-checkbox {
    display: flex;
    align-items: center;
}

.mail-star {
    color: #cbd5e1;
    cursor: pointer;
    font-size: 16px;
    padding: 5px;
}

.mail-star.starred {
    color: #f59e0b; /* Gold/Yellow */
}

.mail-star:hover {
    color: #94a3b8;
}

.mail-content-wrapper {
    flex: 1;
    min-width: 0; /* allows text truncation */
    display: flex;
    flex-direction: column;
    gap: 2px;
}

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

.mail-from {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #334155;
}

.unread-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
    flex-shrink: 0;
}

.mail-time {
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
}

.mail-subject-line {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #475569;
}

.attachment-icon {
    font-size: 12px;
    color: #64748b;
}

.mail-preview-line {
    font-size: 13px;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 400;
}

.mail-actions-hover {
    opacity: 0;
    transition: opacity 0.2s;
}

.mail-item:hover .mail-actions-hover {
    opacity: 1;
}
























/* === Mail User Stats (in Header) === */
.mail-user-stats {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-right: 20px;
    margin-left: 20px;
    flex: 1; /* zaber kolko vies miesta */
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 15px;
    color: #94a3b8;
    font-weight: 500;
}

.stat-item.has-unread {
    color: #ef4444; /* Red for emphasis */
    font-weight: 700;
}

.stat-name {
    /* Normal weight unless unread */
}

/* === Styled Account Select in Sidebar (Modern Look) === */
.account-switcher-wrapper {
    margin-bottom: 20px;
}

.account-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.select-container {
    position: relative;
}

.modern-account-select {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background-color: white;
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
    appearance: none; /* Remove default arrow */
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2364748b%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 10px auto;
    transition: all 0.2s ease;
}

.modern-account-select:hover {
    border-color: #cbd5e1;
}

.modern-account-select:focus {
    border-color: #8B5CF6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
    outline: none;
}

.custom-select-wrapper {
    position: relative;
    margin-bottom: 10px;
}



/* === Mail User Stats (in Header) === */
.mail-user-stats {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-right: 20px;
    margin-left: 20px;
    flex: 1; /* zaber kolko vies miesta */
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 15px;
    color: #94a3b8;
    font-weight: 500;
}

.stat-item.has-unread {
    color: #ef4444; /* Red for emphasis */
    font-weight: 700;
}

.stat-name {
    /* Normal weight unless unread */
}

/* === Styled Account Select in Sidebar (Modern Look) === */
.account-switcher-wrapper {
    margin-bottom: 20px;
}

.account-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- CUSTOM DROPDOWN UI --- */
.custom-dropdown {
    position: relative;
    width: 100%;
}

.custom-dropdown-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid #8B5CF6; /* Purple border like screenshot */
    background-color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.custom-dropdown-trigger:hover {
    background-color: #f8fafc;
}

.trigger-content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.trigger-name {
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.trigger-email {
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.custom-dropdown-trigger i {
    color: #8B5CF6; /* Purple Icon */
    margin-left: 10px;
    font-size: 14px;
}

/* Dropdown Options */
.custom-dropdown-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-top: 6px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    z-index: 100;
    display: none;
    max-height: 300px;
    overflow-y: auto;
}

.custom-dropdown.open .custom-dropdown-options {
    display: block;
    animation: fadeIn 0.1s ease-out;
}

.custom-option {
    padding: 12px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.1s;
    display: flex;
    flex-direction: column;
}

.custom-option:last-child {
    border-bottom: none;
}

.custom-option:hover {
    background-color: #f8fafc;
}

.custom-option.active {
    background-color: #f3e8ff; /* Light purple bg */
    border-left: 3px solid #8B5CF6;
}

.custom-option.active .option-name {
    color: #8B5CF6;
}

.option-name {
    font-size: 14px;
    font-weight: 500;
    color: #334155;
}

.option-email {
    font-size: 12px;
    color: #94a3b8;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.custom-select-wrapper {
    position: relative;
    margin-bottom: 10px;
}














/* New Compose Email Layout - appended to fix layout issues */
.compose-email-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
    /* Ensure modal body has enough height for the editor */
    min-height: 600px;
}

.compose-header {
    padding: 15px 20px 5px 20px;
    background: #fff;
    flex-shrink: 0;
}

.compose-row {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
    align-items: center;
}

.compose-field {
    display: flex;
    align-items: center;
    gap: 10px;
}

.compose-field.from-field { width: 30%; }
.compose-field.to-field { width: 70%; }
.compose-field.subject-field { width: 100%; }

.compose-field label {
    width: auto;
    margin: 0;
    font-size: 13px;
    color: #64748b;
    font-weight: 600;
    white-space: nowrap;
}

.compose-field input, .compose-field select {
    flex: 1;
    border: none;
    border-bottom: 1px solid #e2e8f0;
    padding: 5px 0;
    font-size: 14px;
    outline: none;
    background: transparent;
}

.subject-input {
    font-size: 16px !important;
    font-weight: 500;
}

/* Toolbar compaction */
.editor-toolbar {
    padding: 8px 20px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

/* The Editor Area - Takes remaining space */
.compose-body {
    flex: 1; 
    display: flex;
    flex-direction: column;
    overflow: visible !important;
    
    padding: 0;
}

.email-editor {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    outline: none;
    font-size: 15px;
    line-height: 1.6;
}

/* === COMPACT EMAIL MODAL STYLES === */

.compose-email-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 60vh; /* Ensure it feels big */
}

/* Header Compact */
.compose-header.compact {
    padding: 10px 15px;
    background: #fff;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border-light);
}

.compose-compact-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 5px;
}

.compose-compact-row:last-child {
    margin-bottom: 0;
}

.field-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.field-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    margin: 0;
}

.clean-input, .clean-select {
    width: 100%;
    border: 1px solid transparent;
    border-bottom: 1px solid #e2e8f0;
    padding: 4px 0;
    font-size: 14px;
    background: transparent;
    transition: all 0.2s;
}

.clean-input:focus, .clean-select:focus {
    border-bottom-color: var(--primary-color);
    background: #fff;
}

.subject-input {
    font-weight: 600;
    font-size: 15px !important;
    padding: 6px 0;
}

/* Toolbar Compact */
.compact-toolbar {
    display: flex;
    align-items: center;
    padding: 5px 15px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    gap: 5px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.toolbar-section {
    display: flex;
    align-items: center;
    gap: 2px;
}

.toolbar-sep {
    width: 1px;
    height: 18px;
    background: #cbd5e1;
    margin: 0 8px;
}

.compact-toolbar button {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: 4px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}

.compact-toolbar button:hover {
    background: #e2e8f0;
    color: var(--primary-color);
}

.compact-toolbar i {
    font-size: 13px;
}



.toolbar-select:hover {
    background: #e2e8f0;
}

.toolbar-select.narrow {
    width: 45px;
}

.color-wrapper {
    position: relative;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 4px;
}

.color-wrapper:hover {
    background: #e2e8f0;
}

.color-wrapper input[type="color"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* Body & Editor */
.compose-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
}

.email-editor {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    outline: none;
    font-size: 15px;
    line-height: 1.6;
}

.attachments-area {
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px dashed #e2e8f0;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}


/* Vylepšenie dropdownov v toolbare (Písmo a Veľkosť) */
.toolbar-select {
    appearance: none;
    -webkit-appearance: none;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px 28px 6px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    height: 42px;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    /* Vlastná SVG šípka pre čistý vzhľad */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 14px;
    box-shadow: var(--shadow-sm);
    font-family: inherit;
    /* FIX: Dostatočná šírka pre názvy fontov */
    min-width: 130px; 
}

.toolbar-select:hover {
    border-color: var(--primary-light);
    background-color: var(--bg-secondary);
}

.toolbar-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.toolbar-select.narrow {
    /* FIX: Dostatočná šírka pre veľkosť písma */
    min-width: 110px; 
}

/* Vylepšenie polí "Od" a "Komu" */
.field-group {
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 6px 12px;
    transition: all 0.2s ease;
    height: 46px; /* Vyšší element pre lepší vizuál */
}

.field-group:focus-within {
    background: var(--bg-primary);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.field-group label {
    font-size: 13px;
    font-weight: 500;      /* menej agresívne */
    color: var(--text-muted);
    letter-spacing: 0px;   /* UX – šetrenie očí */
    margin-right: 8px;     /* menšia medzera */
    white-space: nowrap;
}


/* Štýlovanie samotných inputov/selectov vo vnútri */
.clean-select, 
.clean-input {
    width: 100%;
    background: transparent !important;
    border: none !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: var(--text-primary) !important;
    outline: none !important;
    box-shadow: none !important;
    font-family: inherit;
    padding: 0 !important;
    height: 100%;
}

.clean-select {
    cursor: pointer;
}

.clean-input::placeholder {
    color: var(--text-muted);
    opacity: 0.8;
}

/* Zarovnanie riadkov v hlavičke editora */
.compose-compact-row {
    gap: 15px;
    margin-bottom: 12px;
}


.field-group label {
    font-size: 14px;
    font-weight: 500;      /* menej agresívne */
    color: var(--text-muted);
    letter-spacing: 0px;   /* UX – šetrenie očí */
    margin-right: 8px;     /* menšia medzera */
    white-space: nowrap;
}


/* New Refresh Button in Header */
.header-refresh-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 22px;
    cursor: pointer;
    margin-left: 39px; /* Separate from Daily Info */
    padding: 5px;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.header-refresh-btn:hover {
    color: var(--primary-color);
    background-color: var(--bg-secondary);
}

.header-refresh-btn:active {
    transform: scale(0.95);
}








