/* ===============================================
   DOKUMENTE TABLE VIEW
   Redesign: Table/List statt Card-Grid
   =============================================== */

/* Container */
.documents-table-container {
    width: 100%;
    overflow-x: auto;
    margin-top: 1.5rem;
}

/* Table Styles */
.documents-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.documents-table thead {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
}

.documents-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.documents-table th i {
    margin-right: 0.5rem;
    opacity: 0.9;
}

.documents-table th.text-center {
    text-align: center;
}

/* Table Body */
.documents-table tbody tr {
    border-bottom: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.documents-table tbody tr:hover {
    background: #f8fafc;
}

.documents-table tbody tr.row-new {
    background: #eff6ff;
}

.documents-table tbody tr.row-new:hover {
    background: #dbeafe;
}

.documents-table td {
    padding: 1rem;
    vertical-align: middle;
    font-size: 0.9rem;
}

/* Document Title Column */
.doc-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 250px;
}

.doc-title i {
    font-size: 1.2rem;
}

.title-text {
    font-weight: 500;
    color: #1e293b;
    word-break: break-word;
}

/* Category Badge */
.doc-category {
    min-width: 150px;
}

.category-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #e0e7ff;
    color: #3730a3;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}

/* Customer Column (Admin only) */
.doc-customer {
    min-width: 150px;
    color: #475569;
    font-weight: 500;
}

/* Date Column */
.doc-date {
    min-width: 120px;
    color: #64748b;
}

/* Size Column */
.doc-size {
    min-width: 100px;
    color: #64748b;
    font-family: 'Courier New', monospace;
}

/* Status Badge */
.doc-status {
    min-width: 100px;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.status-new {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.status-read {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.status-archived {
    background: #e5e7eb;
    color: #4b5563;
}

/* Actions Column */
.doc-actions {
    min-width: 80px;
}

.btn-action {
    padding: 0.5rem 0.75rem;
    border: none;
    background: #3b82f6;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.btn-action:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.btn-action i {
    margin: 0;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1.1rem;
    margin: 0;
}

/* Filter Section */
.documents-filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
}

.documents-filters select,
.documents-filters input[type="text"] {
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
    background: white;
    transition: all 0.2s ease;
}

.documents-filters select:focus,
.documents-filters input[type="text"]:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.documents-filters input[type="text"] {
    flex: 1;
    min-width: 200px;
}

.documents-filters #searchCustomer {
    min-width: 200px;
    flex: 0 0 auto;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .documents-table th,
    .documents-table td {
        padding: 0.75rem;
        font-size: 0.85rem;
    }
    
    .doc-title {
        min-width: 200px;
    }
}

@media (max-width: 768px) {
    .documents-table-container {
        border-radius: 0;
        margin: 0 -1rem;
    }
    
    .documents-table {
        font-size: 0.8rem;
    }
    
    .documents-table th,
    .documents-table td {
        padding: 0.5rem;
    }
    
    /* Stack filters vertically */
    .documents-filters {
        flex-direction: column;
    }
    
    .documents-filters select,
    .documents-filters input[type="text"] {
        width: 100%;
    }
    
    /* Hide less important columns on mobile */
    .doc-size,
    .doc-date {
        display: none;
    }
    
    .doc-title {
        min-width: auto;
        max-width: 150px;
    }
    
    .title-text {
        font-size: 0.85rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    /* Mobile: Show as card-style rows */
    .documents-table thead {
        display: none;
    }
    
    .documents-table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        padding: 1rem;
    }
    
    .documents-table td {
        display: block;
        padding: 0.5rem 0;
        border: none;
        text-align: left !important;
    }
    
    .documents-table td::before {
        content: attr(data-label);
        font-weight: 600;
        display: inline-block;
        width: 100px;
        color: #64748b;
    }
    
    .doc-title,
    .doc-category,
    .doc-customer,
    .doc-date,
    .doc-size,
    .doc-status {
        min-width: auto;
        max-width: none;
    }
    
    .doc-title {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .doc-actions {
        text-align: center;
    }
    
    .btn-action {
        width: 100%;
    }
}

/* Print Styles */
@media print {
    .documents-filters,
    .doc-actions {
        display: none;
    }
    
    .documents-table {
        box-shadow: none;
    }
    
    .documents-table tbody tr:hover {
        background: white;
    }
}
