/* Kiosk-Analyse Stylesheet */

:root {
    --secondary-color: #64748b;
    --success-color: #059669;
    --warning-color: #d97706;
    --error-color: #dc2626;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --text-color: #334155;
    --text-muted: #64748b;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Layout */
.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: var(--card-bg);
    border-right: 1px solid var(--border-color);
    padding: 1rem;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 1.5rem;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 1.5rem;
    left: 1.5rem;
    z-index: 1001;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: all 0.2s ease;
    min-width: 48px;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.mobile-menu-btn:hover,
.mobile-menu-btn:active {
    background: var(--secondary-color);
    color: white;
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.mobile-menu-btn i {
    font-size: 1.5rem;
    color: var(--text-color);
    transition: color 0.2s ease;
}

.mobile-menu-btn:hover i,
.mobile-menu-btn:active i {
    color: white;
}


/* Mobile Overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    transition: opacity 0.3s ease;
}

/* Sidebar Navigation */
.logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

.logo-image {
    width: 100%;
    height: unset;
    object-fit: contain;
    border-radius: 8px;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: bold;
    color: #39a95f;
    margin-top: 0.25rem;
}

.nav-menu {
    list-style: none;
}

.nav-item {
    margin-bottom: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.nav-link:hover,
.nav-link.active {
    background-color: #39a95f;
    color: white;
}

.nav-link i {
    margin-right: 0.75rem;
    width: 20px;
}

/* Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.page-title {
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-color);
}

.page-subtitle {
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

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

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

.card-title + .text-muted {
    margin-top: 0.5rem;
}

.card-body {
    padding: 0;
}

/* Grid System */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Mobile Responsive Design */
@media (max-width: 768px) {
    /* Show mobile menu button and hide sidebar by default */
    .mobile-menu-btn {
        display: flex;
    }
    
    
    .sidebar {
        transform: translateX(-100%);
    }
    
    /* When sidebar is active */
    .sidebar.active {
        transform: translateX(0);
    }
    
    .mobile-overlay.active {
        display: block;
        opacity: 1;
    }
    
    /* Adjust main content for mobile */
    .main-content {
        margin-left: 0;
        padding: 1rem;
        padding-top: 5rem; /* Extra space for mobile menu button */
    }
    
    /* Ensure page header has proper spacing */
    .page-header {
        margin-top: 1rem;
    }
    
    /* Responsive grid layouts */
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr;
    }
    
    /* Mobile page header adjustments */
    .page-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .filter-controls {
        width: 100%;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .filter-controls .form-select,
    .filter-controls .btn {
        width: 100%;
    }
    
    /* Mobile card adjustments */
    .card {
        margin-bottom: 1rem;
    }
    
    .kpi-value {
        font-size: 2rem;
    }
    
    /* Mobile table improvements */
    .table-container {
        overflow-x: auto;
    }
    
    table {
        min-width: 600px;
    }
    
    /* Modal adjustments for mobile */
    .modal-container {
        margin: 0.5rem;
        width: calc(100vw - 1rem);
        max-width: none;
        max-height: calc(100vh - 1rem);
        padding: 1rem;
    }
    
    .modal-header h2 {
        font-size: 1.25rem;
    }
}

/* KPI Cards */
.kpi-card {
    background: linear-gradient(135deg, #39a95f, #024f36);
    color: white;
    border: none;
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(30px, -30px);
}

.kpi-value {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.kpi-label {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-bottom: 0.25rem;
}

.kpi-change {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    background: rgba(255, 255, 255, 0.2);
    display: inline-block;
}

.kpi-change.positive { 
    color: #ffffff; 
    background: rgba(5, 150, 105, 0.9); 
    font-weight: 600;
}
.kpi-change.negative { 
    color: #ffffff; 
    background: rgba(220, 38, 38, 0.9); 
    font-weight: 600;
}

/* Weather Widget */
.weather-widget {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    color: white;
    text-align: center;
    border: none;
}

.weather-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.weather-temp {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.weather-desc {
    opacity: 0.9;
    margin-bottom: 1rem;
}

.weather-correlation {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    gap: 0.5rem;
}

.btn-primary {
    background: #39a95f;
    color: white;
}

.btn-primary:hover {
    background: #024f36;
}

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

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

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

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

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

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: #39a95f;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background: white;
    font-size: 0.875rem;
}

.form-select-sm {
    padding: 0.5rem;
    font-size: 0.8rem;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 1rem;
    align-items: end;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
}

.filter-group {
    flex: 1;
}

.filter-group.auto {
    flex: 0 0 auto;
}

/* Tables */
.table-container {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
}

.table th,
.table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--bg-color);
    font-weight: 600;
    color: var(--text-color);
}

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

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    border: 1px solid;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
    color: #1e40af;
}

.alert-success {
    background: rgba(5, 150, 105, 0.1);
    border-color: rgba(5, 150, 105, 0.2);
    color: #065f46;
}

.alert-warning {
    background: rgba(217, 119, 6, 0.1);
    border-color: rgba(217, 119, 6, 0.2);
    color: #92400e;
}

.alert-error {
    background: rgba(220, 38, 38, 0.1);
    border-color: rgba(220, 38, 38, 0.2);
    color: #991b1b;
}

/* Loading */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text-muted);
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top: 2px solid #39a95f;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 0.5rem;
}

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

/* Charts */
.chart-container {
    position: relative;
    height: 400px;
    margin: 1rem 0;
}

.chart-container.small {
    height: 250px;
}

.chart-container.large {
    height: 500px;
}

/* Upload */
.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: 0.75rem;
    padding: 3rem;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: #39a95f;
    background: rgba(37, 99, 235, 0.05);
}

.upload-icon {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.upload-text {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* Status Indicators */
.status {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-ok {
    background: rgba(5, 150, 105, 0.1);
    color: var(--success-color);
}

.status-warning {
    background: rgba(217, 119, 6, 0.1);
    color: var(--warning-color);
}

.status-critical {
    background: rgba(220, 38, 38, 0.1);
    color: var(--error-color);
}

.status-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 0.5rem;
    background: currentColor;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        flex: none;
    }
}

@media (max-width: 640px) {
    .main-content {
        padding: 1rem;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .kpi-value {
        font-size: 2rem;
    }
    
    .chart-container {
        height: 300px;
    }
}

/* Upload List Styles */
.upload-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.upload-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.upload-item:hover {
    background: #f1f5f9;
    border-color: #39a95f;
}

.upload-icon {
    font-size: 1.5rem;
    min-width: 2rem;
    text-align: center;
}

.upload-info {
    flex: 1;
}

.upload-name {
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

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

.upload-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.btn-danger:hover {
    background-color: #b91c1c;
    transform: translateY(-1px);
}

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.font-bold { font-weight: bold; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mt-2 { margin-top: 1rem; }
.hidden { display: none; }
.block { display: block; }

/* Profit/Loss Widget */
.profit-loss-widget .total-profit.profit {
    color: #10b981;
}

.profit-loss-widget .total-profit.loss {
    color: #ef4444;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

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

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

.empty-state .btn {
    margin-top: 1rem;
}

/* Correlation Matrix Styles */
.correlation-grid {
    font-size: 0.75rem;
}

.bg-green-100 { background-color: #dcfce7; }
.text-green-800 { color: #166534; }
.bg-yellow-100 { background-color: #fef3c7; }
.text-yellow-800 { color: #92400e; }
.bg-red-100 { background-color: #fee2e2; }
.text-red-800 { color: #991b1b; }
.bg-gray-100 { background-color: #f3f4f6; }
.text-gray-600 { color: #4b5563; }

/* Disabled inputs */
.form-input:disabled {
    background-color: #f3f4f6;
    color: #6b7280;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Category Products Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    max-width: 1200px;
    width: 95%;
    max-height: 90vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    background: linear-gradient(135deg, #39a95f, #024f36);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-content {
    padding: 1.5rem;
    max-height: calc(90vh - 120px);
    overflow-y: auto;
}

/* Modal Search Filter */
.modal-search {
    margin-bottom: 1.5rem;
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.modal-search input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.modal-search input:focus {
    outline: none;
    border-color: #39a95f;
    box-shadow: 0 0 0 3px rgba(57, 169, 95, 0.1);
}

.modal-search input::placeholder {
    color: #9ca3af;
}

/* Clickable table rows */
#cash-table .tabulator-table .tabulator-row {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#cash-table .tabulator-table .tabulator-row:hover {
    background-color: #f8f9fa !important;
}

/* Overridden values styling in products table */
.override-value {
    background-color: #fff3cd;
    color: #856404;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
    border: 1px solid #ffeaa7;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.override-value:hover {
    background-color: #ffeb9c;
    border-color: #ffcd02;
    transform: scale(1.02);
    box-shadow: 0 2px 4px rgba(255, 205, 2, 0.3);
}

.override-value::after {
    content: "↻";
    position: absolute;
    right: -12px;
    top: -2px;
    font-size: 10px;
    opacity: 0.7;
    color: #856404;
}

.override-value:hover::after {
    opacity: 1;
    animation: rotate 0.5s ease-in-out;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(180deg); }
}

/* Editable cells in products table */
#products-table .tabulator-cell[tabulator-field="avg_price"],
#products-table .tabulator-cell[tabulator-field="margin_percent"] {
    cursor: pointer;
    position: relative;
}

#products-table .tabulator-cell[tabulator-field="avg_price"]:hover,
#products-table .tabulator-cell[tabulator-field="margin_percent"]:hover {
    background-color: #f8f9fa !important;
}

/* Show edit hint on hover */
#products-table .tabulator-cell[tabulator-field="avg_price"]:hover::after,
#products-table .tabulator-cell[tabulator-field="margin_percent"]:hover::after {
    content: "📝";
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    opacity: 0.7;
}

.modal-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.stat-item {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.stat-item span:last-child {
    display: block;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
}

.modal-products {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Force 3 columns on large screens */
@media (min-width: 1024px) {
    .modal-products {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 2 columns on medium screens */
@media (max-width: 1023px) and (min-width: 768px) {
    .modal-products {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 1 column on small screens */
@media (max-width: 767px) {
    .modal-products {
        grid-template-columns: 1fr;
    }
}

.product-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.2s ease;
}

.product-card:hover {
    background: #f3f4f6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.product-name {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    line-height: 1.3;
}

.product-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    font-size: 0.8rem;
}

.product-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-stat-label {
    color: #6b7280;
}

.product-stat-value {
    font-weight: 500;
    color: #1f2937;
}

.revenue-highlight {
    color: #39a95f !important;
    font-weight: 600;
}

.margin-highlight {
    color: #059669 !important;
}

/* Profit/Loss Section Spacing */
#profit-loss-section {
    margin-top: 20px !important;
}

@media (max-width: 640px) {
    .modal-container {
        margin: 0.5rem;
        width: calc(100vw - 1rem);
        max-width: none;
        max-height: calc(100vh - 1rem);
    }
    
    .modal-products {
        grid-template-columns: 1fr;
    }
    
    .modal-stats {
        grid-template-columns: 1fr;
    }
}

/* Missing Days - Compact Cards */
#missing-days-list {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    margin: 10px 0 !important;
}

.missing-day-col {
    flex: 0 0 auto !important;
    width: 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}

.missing-day-card {
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 8px;
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    transition: all 0.2s ease;
    text-align: center;
    min-height: 100px;
    width: 120px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 0.85em;
}

.missing-day-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

.missing-day-card.recent {
    border-color: #fd7e14;
    background: linear-gradient(135deg, #ffecd1, #ffd69a);
}

.missing-day-card.critical {
    border-color: #dc3545;
    background: linear-gradient(135deg, #f8d7da, #ffc2c7);
    animation: pulse-warning 2s infinite;
}

@keyframes pulse-warning {
    0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(220, 53, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}

.missing-day-card.old {
    border-color: #6c757d;
    background: linear-gradient(135deg, #e2e3e5, #d6d8db);
}

.missing-day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.missing-day-date {
    font-weight: bold;
    font-size: 0.9em;
}

.missing-day-status {
    font-size: 1.1em;
}

.missing-day-weekday {
    font-size: 0.75em;
    color: #666;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.missing-day-types {
    margin-bottom: 6px;
    display: flex;
    justify-content: center;
    gap: 2px;
}

.missing-day-types .badge {
    font-size: 0.8em;
    padding: 2px 4px;
}

.missing-day-ago {
    font-size: 0.7em;
    color: #666;
    font-weight: 500;
}

.badge {
    display: inline-block;
    padding: 0.35em 0.6em;
    font-size: 0.75em;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.375rem;
}

.badge-warning {
    color: #000;
    background-color: #ffc107;
}

/* Affected Areas Info */
.affected-area {
    margin-bottom: 15px;
    padding: 10px;
    border-left: 4px solid #17a2b8;
    background-color: #f8f9fa;
    border-radius: 0 4px 4px 0;
}

.affected-area.critical {
    border-left-color: #dc3545;
    background-color: #fff5f5;
}

.affected-area h6 {
    margin-bottom: 8px;
    color: #495057;
    font-weight: 600;
}

.affected-area.critical h6 {
    color: #721c24;
}

.affected-area ul {
    margin-bottom: 0;
    padding-left: 20px;
}

.affected-area li {
    font-size: 0.9em;
    margin-bottom: 3px;
    color: #6c757d;
}

.affected-area.critical li {
    color: #856404;
}

/* Auto-Sync Page Styles */
.status-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.log-entry {
    padding: 0.25rem 0.5rem;
    margin: 0.125rem 0;
    border-radius: 0.25rem;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}

.log-time {
    color: #6c757d;
    margin-right: 0.5rem;
}

.log-info {
    color: #0d6efd;
}

.log-success {
    color: #198754;
}

.log-warning {
    color: #fd7e14;
}

.log-error {
    color: #dc3545;
}

#live-log {
    height: 300px;
    overflow-y: auto;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    padding: 0.5rem;
}

.config-section {
    margin-bottom: 2rem;
}

.sync-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    border-bottom: 1px solid #dee2e6;
}

.file-item:last-child {
    border-bottom: none;
}

.file-info {
    flex-grow: 1;
}

.file-size {
    color: #6c757d;
    font-size: 0.875rem;
}

.file-type {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: bold;
    margin-left: 0.5rem;
}

.file-type.sales { background-color: #d1ecf1; color: #0c5460; }
.file-type.cash { background-color: #d4edda; color: #155724; }
.file-type.articles { background-color: #fff3cd; color: #856404; }
.file-type.margin { background-color: #f8d7da; color: #721c24; }
.file-type.unknown { background-color: #e2e3e5; color: #383d41; }/**
 * Globales KI-Chat Widget CSS
 * Floating Chat Interface unten rechts
 */

/* Chat Toggle Button - Floating */
.chat-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #39a95f 0%, #024f36 100%);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(57, 169, 95, 0.4);
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(57, 169, 95, 0.5);
}

.chat-toggle i {
    color: white;
    font-size: 24px;
    transition: transform 0.3s ease;
}

.chat-toggle.active i {
    transform: rotate(180deg);
}

/* Chat Window - Floating Panel */
.chat-widget {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    height: 500px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    z-index: 999;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.chat-widget.open {
    display: flex;
    animation: chatSlideUp 0.3s ease-out;
}

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

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, #39a95f 0%, #024f36 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header-title {
    font-weight: 600;
    font-size: 16px;
    flex: 1;
}

.chat-header-subtitle {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 2px;
}

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

.chat-header-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-header-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Chat Messages Area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #f8fafc;
}

.chat-message {
    display: flex;
    margin-bottom: 15px;
}

.chat-message.user {
    justify-content: flex-end;
}

.chat-message.assistant {
    justify-content: flex-start;
}

.chat-message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.chat-message.user .chat-message-content {
    background: linear-gradient(135deg, #39a95f 0%, #024f36 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message.assistant .chat-message-content {
    background: white;
    color: #374151;
    border: 1px solid #e5e7eb;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chat-message-time {
    font-size: 11px;
    opacity: 0.6;
    margin-top: 4px;
    text-align: center;
}

/* Typing Indicator */
.typing-indicator {
    display: none;
    justify-content: flex-start;
    margin-bottom: 15px;
}

.typing-indicator.show {
    display: flex;
}

.typing-content {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    padding: 12px 16px;
    max-width: 80%;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #9ca3af;
    border-radius: 50%;
    animation: typingBounce 1.4s ease-in-out infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Chat Input Area */
.chat-input-area {
    padding: 20px;
    background: white;
    border-top: 1px solid #e5e7eb;
}

.chat-input-container {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.chat-input {
    flex: 1;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    padding: 12px 16px;
    font-size: 14px;
    resize: none;
    min-height: 20px;
    max-height: 80px;
    overflow-y: auto;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input:focus {
    border-color: #39a95f;
    box-shadow: 0 0 0 3px rgba(57, 169, 95, 0.1);
}

.chat-send-btn {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #39a95f 0%, #024f36 100%);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-send-btn:hover:not(:disabled) {
    transform: scale(1.05);
}

.chat-send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Empty State */
.chat-empty {
    text-align: center;
    color: #6b7280;
    font-size: 14px;
    padding: 40px 20px;
}

.chat-empty-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.chat-empty-title {
    font-weight: 600;
    margin-bottom: 8px;
}

.chat-empty-subtitle {
    opacity: 0.8;
    line-height: 1.4;
}

/* Error States */
.chat-error {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 12px 16px;
    border-radius: 10px;
    margin: 10px 20px;
    font-size: 13px;
}

/* Loading States */
.chat-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Responsive Design */
@media (max-width: 480px) {
    .chat-widget {
        width: calc(100vw - 20px);
        height: calc(100vh - 100px);
        bottom: 10px;
        right: 10px;
        left: 10px;
    }
    
    .chat-toggle {
        bottom: 15px;
        right: 15px;
    }
}

/* Scroll Styling */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Radio button options for worktime input */
.worktime-input-method {
    display: flex;
    gap: 16px;
    margin-bottom: 8px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    transition: all 0.2s ease;
}

.radio-option:hover {
    border-color: #39a95f;
    background: #f0f9f4;
}

.radio-option input[type="radio"] {
    margin: 0;
    accent-color: #39a95f;
}

.radio-option input[type="radio"]:checked + span {
    color: #39a95f;
    font-weight: 500;
}

/* Modal styling for worktime edit - specific class to avoid conflicts */
.worktime-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex !important;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    text-align: left;
}

.worktime-modal-overlay.show {
    opacity: 1;
}

.worktime-modal-overlay .modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.worktime-modal-overlay.show .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #39a95f 0%, #024f36 100%);
    color: white;
    border-radius: 8px 8px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

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

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 0 0 8px 8px;
}

.form-display {
    padding: 8px 12px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: #64748b;
    font-weight: 500;
}

/* Mobile modal adjustments */
@media (max-width: 640px) {
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .modal-header {
        padding: 16px 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-footer {
        padding: 12px 20px;
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
}