/* ==========================================================================
   DESIGN SYSTEM & CONSTANTS
   ========================================================================== */
:root {
    --bg-darker: #06070a;
    --bg-dark: #0b0d16;
    --bg-card: rgba(18, 22, 38, 0.65);
    --bg-card-hover: rgba(26, 31, 54, 0.85);
    
    --border-light: rgba(255, 255, 255, 0.07);
    --border-glow: rgba(139, 92, 246, 0.25);
    
    --primary: #8b5cf6;       /* Violet */
    --primary-glow: rgba(139, 92, 246, 0.15);
    --secondary: #6366f1;     /* Indigo */
    --accent: #a78bfa;        /* Light Violet */
    
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dim: #6b7280;
    
    --success: #10b981;       /* Emerald */
    --success-bg: rgba(16, 185, 129, 0.15);
    --warning: #f59e0b;       /* Amber */
    --warning-bg: rgba(245, 158, 11, 0.15);
    --info: #3b82f6;          /* Blue */
    --info-bg: rgba(59, 130, 246, 0.15);
    --error: #ef4444;         /* Red */
    --error-bg: rgba(239, 68, 68, 0.15);
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
    
    --shadow-main: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --shadow-glow: 0 0 20px 0 rgba(139, 92, 246, 0.12);
}

/* ==========================================================================
   RESET & GLOBAL STYLES
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-darker);
    background-image: 
        radial-gradient(at 10% 20%, rgba(99, 102, 241, 0.08) 0px, transparent 50%),
        radial-gradient(at 90% 80%, rgba(139, 92, 246, 0.08) 0px, transparent 50%);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    height: 100vh;
    overflow: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: -0.02em;
}

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

a:hover {
    color: var(--text-main);
    text-shadow: var(--shadow-glow);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   APP STRUCTURE (LAYOUT)
   ========================================================================== */
.app-container {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar Styling */
.sidebar {
    width: 280px;
    background-color: rgba(6, 7, 10, 0.85);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    padding: 24px;
    backdrop-filter: blur(15px);
    z-index: 10;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.logo-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glow);
    color: white;
}

.logo-icon i {
    width: 22px;
    height: 22px;
}

.logo-text h1 {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.1;
    background: linear-gradient(to right, #ffffff, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-text span {
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 500;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 10px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 14px;
    transition: var(--transition-fast);
}

.nav-item i {
    width: 18px;
    height: 18px;
}

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

.nav-item.active {
    color: white;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(99, 102, 241, 0.05));
    border: 1px solid rgba(139, 92, 246, 0.3);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.1);
}

.nav-item .badge {
    margin-left: auto;
    background: var(--primary);
    color: white;
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 8px;
    font-weight: 600;
}

.sidebar-footer {
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--text-muted);
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot.green { background-color: var(--success); }
.dot.pulse {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse 1.6s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Main Content Workspace */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
    background-color: var(--bg-dark);
    padding: 30px 40px;
}

/* ==========================================================================
   COMPONENTS
   ========================================================================== */

/* Header Area */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 20px;
}

.page-title h2 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 4px;
    background: linear-gradient(135deg, white 40%, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.page-title p {
    font-size: 13px;
    color: var(--text-muted);
}

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

.search-box {
    position: relative;
    width: 300px;
}

.search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    padding: 11px 16px 11px 40px;
    border-radius: 10px;
    border: 1px solid var(--border-light);
    background: rgba(10, 11, 20, 0.5);
    color: white;
    font-family: var(--font-body);
    font-size: 13px;
    transition: var(--transition-smooth);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.2);
    background: rgba(10, 11, 20, 0.7);
}

.custom-select {
    padding: 11px 16px;
    border-radius: 10px;
    border: 1px solid var(--border-light);
    background: rgba(10, 11, 20, 0.5);
    color: white;
    font-family: var(--font-body);
    font-size: 13px;
    cursor: pointer;
    outline: none;
    transition: var(--transition-fast);
}

.custom-select:focus {
    border-color: var(--primary);
}

/* Checkbox Filter Styles */
.checkbox-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-muted);
    user-select: none;
    transition: var(--transition-fast);
}

.checkbox-filter:hover {
    color: white;
}

.checkbox-filter input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    background: rgba(10, 11, 20, 0.5);
    cursor: pointer;
    display: grid;
    place-content: center;
    transition: var(--transition-fast);
}

.checkbox-filter input[type="checkbox"]:hover {
    border-color: rgba(255, 255, 255, 0.3);
}

.checkbox-filter input[type="checkbox"]:checked {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-filter input[type="checkbox"]::before {
    content: "";
    width: 10px;
    height: 10px;
    transform: scale(0);
    transition: 120ms transform ease-in-out;
    box-shadow: inset 1em 1em white;
    transform-origin: center;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.checkbox-filter input[type="checkbox"]:checked::before {
    transform: scale(1);
}

/* Glass Panels */
.glass-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-main);
    backdrop-filter: blur(20px);
    transition: var(--transition-smooth);
}

.glass-panel:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

/* Statistics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 35px;
}

.stat-card {
    background: rgba(18, 22, 38, 0.4);
    border: 1px solid var(--border-light);
    border-radius: 14px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    backdrop-filter: blur(10px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon i {
    width: 22px;
    height: 22px;
}

.stat-icon.purple { background: rgba(139, 92, 246, 0.12); color: var(--accent); }
.stat-icon.blue { background: rgba(59, 130, 246, 0.12); color: #60a5fa; }
.stat-icon.green { background: rgba(16, 185, 129, 0.12); color: #34d399; }
.stat-icon.orange { background: rgba(245, 158, 11, 0.12); color: #fbbf24; }

.stat-info h3 {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.stat-number {
    font-size: 24px;
    font-weight: 700;
    font-family: var(--font-heading);
    color: white;
}

/* Tab Panels Visibility */
.tab-panel {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-panel.active {
    display: block;
}

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

/* ==========================================================================
   ORDERS GRID (ZAKÁZKY)
   ========================================================================== */
.orders-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.section-header h3 {
    font-size: 16px;
    color: var(--text-main);
    font-weight: 600;
}

.path-display {
    font-size: 12px;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.2);
    padding: 4px 10px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: monospace;
}

.path-display i {
    width: 14px;
    height: 14px;
}

.orders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    min-height: 200px;
}

/* visual Folder Card design */
.folder-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 22px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: var(--shadow-main);
    transition: var(--transition-smooth);
}

.folder-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    opacity: 0;
    transition: var(--transition-smooth);
}

.folder-card:hover {
    transform: translateY(-4px);
    background: var(--bg-card-hover);
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: var(--shadow-glow);
}

.folder-card:hover::before {
    opacity: 1;
}

.folder-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.folder-icon-glow {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}

.folder-icon-glow i {
    width: 22px;
    height: 22px;
    filter: drop-shadow(0 0 4px rgba(139, 92, 246, 0.4));
}

/* Status Badge Styles */
.status-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.status-badge.new { color: var(--info); background: var(--info-bg); }
.status-badge.pending { color: var(--warning); background: var(--warning-bg); }
.status-badge.inprogress { color: #c084fc; background: rgba(192, 132, 252, 0.15); }
.status-badge.done { color: var(--success); background: var(--success-bg); }
.status-badge.nerealizovano { color: var(--text-muted); background: rgba(255, 255, 255, 0.07); border: 1px solid var(--border-light); }

.folder-info h4 {
    font-size: 17px;
    font-weight: 600;
    color: white;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.folder-info .client {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.folder-info .client i {
    width: 12px;
    height: 12px;
}

.folder-meta {
    border-top: 1px solid var(--border-light);
    padding-top: 12px;
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-muted);
}

.folder-meta .deadline {
    display: flex;
    align-items: center;
    gap: 6px;
}

.folder-meta .deadline.danger {
    color: var(--error);
}

.folder-meta .deadline i {
    width: 14px;
    height: 14px;
}

.folder-meta .price {
    font-weight: 600;
    color: var(--accent);
    font-size: 13px;
}

.progress-container {
    width: 100%;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-dim);
    margin-bottom: 4px;
}

.progress-bar-bg {
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    border-radius: 3px;
    transition: width 0.6s ease;
}

/* Loading, Empty, Error states */
.loading-state, .empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted);
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.05);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s infinite linear;
    margin-bottom: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.empty-state i {
    width: 48px;
    height: 48px;
    color: var(--text-dim);
    margin-bottom: 14px;
}

/* ==========================================================================
   INBOX & INGESTION TAB
   ========================================================================== */
.inbox-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 30px;
    height: calc(100vh - 150px);
}

.inbox-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.flex-col {
    display: flex;
    flex-direction: column;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.card-header i {
    width: 22px;
    height: 22px;
    color: var(--accent);
}

.card-header h3 {
    font-size: 18px;
    color: white;
}

.card-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

#ingest-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 4px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

textarea {
    width: 100%;
    height: 140px;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--border-light);
    background: rgba(0, 0, 0, 0.2);
    color: white;
    font-family: var(--font-body);
    font-size: 13px;
    resize: none;
    outline: none;
    transition: var(--transition-smooth);
}

textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.15);
}

.file-dropzone {
    border: 2px dashed var(--border-light);
    border-radius: 10px;
    padding: 24px;
    text-align: center;
    background: rgba(255, 255, 255, 0.01);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.file-dropzone:hover, .file-dropzone.dragover {
    border-color: var(--primary);
    background: rgba(139, 92, 246, 0.02);
}

.file-dropzone i {
    width: 32px;
    height: 32px;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.file-dropzone p {
    font-size: 13px;
    color: var(--text-muted);
}

.file-dropzone span {
    color: var(--accent);
    font-weight: 500;
}

.file-list {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 100px;
    overflow-y: auto;
}

.file-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
}

.file-list-item span {
    color: var(--text-main);
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    max-width: 80%;
}

.file-list-item button {
    background: transparent;
    border: none;
    color: var(--error);
    cursor: pointer;
    font-size: 14px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 10px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition-smooth);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-light);
    color: white;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

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

/* Watcher Console */
.watcher-status-box {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 15px;
}

.watcher-path {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.watcher-path i {
    width: 16px;
    height: 16px;
    color: var(--primary);
}

.watcher-path strong {
    color: var(--text-main);
    font-family: monospace;
}

.log-console {
    flex-grow: 1;
    background: #020305;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.console-header {
    background: #0b0d16;
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.console-title {
    font-family: monospace;
    font-size: 10px;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.console-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.console-dot.green {
    background-color: var(--success);
    box-shadow: 0 0 6px var(--success);
}

.console-body {
    flex-grow: 1;
    padding: 14px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.log-line {
    line-height: 1.4;
    word-break: break-all;
}

.log-line.system { color: #60a5fa; }
.log-line.ai { color: #c084fc; }
.log-line.success { color: #34d399; }
.log-line.error { color: #f87171; }

/* ==========================================================================
   SETTINGS TAB
   ========================================================================== */
.settings-container {
    max-width: 650px;
    margin: 0 auto;
}

.alert {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-radius: 10px;
    margin-bottom: 24px;
    font-size: 13px;
}

.alert-info {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

.alert-info i {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.input-with-icon {
    position: relative;
    width: 100%;
}

.input-with-icon i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.input-with-icon input {
    width: 100%;
    padding: 12px 16px 12px 42px;
    border-radius: 10px;
    border: 1px solid var(--border-light);
    background: rgba(0, 0, 0, 0.2);
    color: white;
    font-family: var(--font-body);
    font-size: 14px;
    outline: none;
    transition: var(--transition-smooth);
}

.input-with-icon input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.15);
}

.help-text {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 4px;
}

.settings-details {
    margin: 24px 0;
    border-top: 1px solid var(--border-light);
    padding-top: 20px;
}

.settings-details h4 {
    font-size: 13px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.path-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 12px;
}

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

.path-item code {
    font-family: monospace;
    color: var(--accent);
}

/* ==========================================================================
   DETAIL DRAWER (ZAKÁZKA DETAIL)
   ========================================================================== */
.detail-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 100;
    pointer-events: none;
}

.drawer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(3, 4, 7, 0.6);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: var(--transition-smooth);
    pointer-events: none;
}

.drawer-content {
    position: absolute;
    top: 0;
    right: -550px; /* Hidden initially */
    width: 550px;
    height: 100%;
    background: rgba(12, 14, 25, 0.95);
    border-left: 1px solid var(--border-light);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(25px);
    display: flex;
    flex-direction: column;
    transition: var(--transition-smooth);
    pointer-events: auto;
}

/* Drawer Open State Class (toggled via JS) */
.detail-drawer.open {
    pointer-events: auto;
}

.detail-drawer.open .drawer-overlay {
    opacity: 1;
    pointer-events: auto;
}

.detail-drawer.open .drawer-content {
    right: 0;
}

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

.drawer-title-area {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 85%;
}

.drawer-title-area h2 {
    font-size: 20px;
    color: white;
    line-height: 1.2;
}

.drawer-title-area p {
    font-size: 13px;
    color: var(--text-muted);
}

.btn-close {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-close:hover {
    color: white;
    background: rgba(255, 255, 255, 0.08);
}

.drawer-body {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.drawer-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--border-light);
    padding: 0 10px;
}

.drawer-tab {
    flex-grow: 1;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 14px 10px;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.drawer-tab:hover {
    color: white;
}

.drawer-tab.active {
    color: var(--accent);
    border-bottom-color: var(--primary);
}

.drawer-tab-content {
    display: none;
    padding: 24px;
    flex-grow: 1;
    overflow-y: auto;
}

.drawer-tab-content.active {
    display: block;
}

/* Info Tab */
.info-section-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.info-card {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 16px;
}

.info-card h4, .description-box h4, .checklist-box h4 {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 14px;
    font-weight: 600;
}

.contact-detail-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.contact-item i {
    width: 16px;
    height: 16px;
    color: var(--accent);
}

.contact-item div {
    display: flex;
    flex-direction: column;
}

.contact-item .label {
    font-size: 11px;
    color: var(--text-dim);
}

.contact-item strong {
    font-size: 13px;
    color: var(--text-main);
}

.contact-item code {
    font-family: monospace;
    font-size: 11px;
    color: var(--success);
    background: rgba(16, 185, 129, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
}

.description-box, .checklist-box {
    margin-bottom: 24px;
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 16px;
}

.description-box p {
    font-size: 13px;
    color: var(--text-main);
    white-space: pre-wrap;
}

.task-checklist {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.task-checklist li {
    font-size: 13px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: var(--text-main);
}

.task-checklist li i {
    width: 16px;
    height: 16px;
    margin-top: 2px;
}

.task-checklist li.todo i { color: var(--text-dim); }
.task-checklist li.done { color: var(--text-muted); text-decoration: line-through; }
.task-checklist li.done i { color: var(--success); }

/* Timeline Tab (WhatsApp & Email bubbles) */
.timeline-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    padding-left: 10px;
}

/* Timeline Layout elements */
.timeline-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.timeline-item-meta {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.timeline-item-meta .source-badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
}

.source-badge.email { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.source-badge.whatsapp { background: rgba(34, 197, 94, 0.15); color: #4ade80; }

.timeline-bubble {
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 13px;
    max-width: 90%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Email Bubble Styling */
.timeline-bubble.email-type {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(59, 130, 246, 0.15);
    color: var(--text-main);
    border-left: 3px solid #3b82f6;
}

/* WhatsApp Bubble Styling */
.timeline-bubble.wa-type {
    background: rgba(20, 83, 45, 0.25);
    border: 1px solid rgba(34, 197, 94, 0.15);
    color: var(--text-main);
    border-left: 3px solid #22c55e;
    align-self: flex-start;
}

.timeline-bubble h5 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 4px;
}

.timeline-bubble p {
    white-space: pre-wrap;
}

/* Files Tab */
.job-uploader-box {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 24px;
}

.job-uploader-box h4 {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
    font-weight: 600;
}

.upload-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.upload-row input[type="file"] {
    font-family: var(--font-body);
    font-size: 12px;
    color: var(--text-muted);
    flex-grow: 1;
}

.files-group {
    margin-bottom: 24px;
}

.files-group-title {
    font-size: 13px;
    color: var(--text-main);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.files-group-title i {
    width: 16px;
    height: 16px;
    color: var(--accent);
}

.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

.photo-thumb {
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-light);
    cursor: pointer;
    background: rgba(0, 0, 0, 0.3);
    transition: var(--transition-fast);
}

.photo-thumb:hover {
    transform: scale(1.04);
    border-color: var(--primary);
}

.photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-thumb-empty, .docs-empty {
    font-size: 12px;
    color: var(--text-dim);
    font-style: italic;
    grid-column: 1 / -1;
}

.docs-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.doc-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition-fast);
}

.doc-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.15);
}

.doc-info {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 80%;
}

.doc-info i {
    width: 18px;
    height: 18px;
    color: #3b82f6;
    flex-shrink: 0;
}

.doc-name {
    font-size: 13px;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-download {
    color: var(--accent);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: var(--transition-fast);
}

.btn-download:hover {
    background: rgba(139, 92, 246, 0.1);
    color: white;
}

.btn-download i {
    width: 16px;
    height: 16px;
}

/* ==========================================================================
   IMAGE MODAL (PREVIEW)
   ========================================================================== */
.img-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    padding-top: 60px;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    overflow: auto;
    background-color: rgba(6, 7, 10, 0.95);
    backdrop-filter: blur(10px);
}

.img-modal-content {
    margin: auto;
    display: block;
    max-width: 85%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: zoom 0.25s ease-out;
}

@keyframes zoom {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.close-img-modal {
    position: absolute;
    top: 25px;
    right: 35px;
    color: var(--text-muted);
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition-fast);
}

.close-img-modal:hover {
    color: white;
}

#img-modal-caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: var(--text-muted);
    padding: 10px 0;
    font-size: 13px;
    font-weight: 500;
}

/* Custom Table and Client Grid styling for Finance Tab */
.custom-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    color: var(--text-main);
}

.custom-table th {
    padding: 12px 10px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.5px;
}

.custom-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--border-light);
}

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

.custom-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.finance-clients-grid .glass-panel {
    border: 1px solid var(--border-light);
    background: var(--bg-card);
    transition: all var(--transition-fast) !important;
}

.finance-clients-grid .glass-panel:hover {
    border-color: rgba(139, 92, 246, 0.3) !important;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.15) !important;
}

/* ==========================================================================
   VEHICLE PARK (CAR) TAB
   ========================================================================== */
.car-grid {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 24px;
    margin-bottom: 24px;
    align-items: start;
}

@media (max-width: 1024px) {
    .car-grid {
        grid-template-columns: 1fr;
    }
}

.car-tab:hover {
    color: white !important;
}

.car-tab.active {
    color: var(--accent) !important;
    border-bottom-color: var(--primary) !important;
}

/* Generator Table Inputs focus styling */
#gen-items-table input:focus {
    background: rgba(255, 255, 255, 0.05) !important;
    outline: none;
    border-radius: 4px;
}


