* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    background-color: #f0f2f5;
    min-height: 100vh;
    padding: 0;
}

/* Header styles */
.header {
    background-color: #2c3e50;
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo {
    width: 180px;
    height: auto;
    margin-right: 20px;
}

.nav-menu {
    display: flex;
    gap: 15px;
}

.nav-btn {
    background-color: transparent;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
    text-decoration: none;
    display: inline-block;
}

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

.nav-btn.active {
    background-color: rgba(255, 255, 255, 0.2);
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #2c3e50;
    min-width: 180px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1000;
    border-radius: 4px;
    margin-top: 2px;
}

.dropdown-content a {
    color: white;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 14px;
    transition: background-color 0.3s;
}

.dropdown-content a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown .nav-btn:after {
    content: ' ▼';
    font-size: 10px;
    vertical-align: middle;
}

.logout-option {
    background-color: #e53e3e;
    color: white;
    border-radius: 0 0 4px 4px;
}

.logout-option:hover {
    background-color: #c53030 !important;
}

/* Main content */
.main-content {
    max-width: 1400px;
    margin: 30px auto;
    padding: 0 20px;
}

.card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 40px;
    width: 100%;
}

h1 {
    text-align: center;
    color: #2563eb;
    margin-bottom: 10px;
    font-size: 28px;
    font-weight: 600;
}

.subtitle {
    text-align: center;
    color: #6b7280;
    margin-bottom: 30px;
    font-size: 14px;
}

/* Filter container */
.filter-container {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
}

.filter-label {
    font-weight: bold;
    min-width: 80px;
}

.filter-input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.new-revision-btn {
    background-color: #ef4444;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-left: auto;
}

.new-revision-btn:hover {
    background-color: #dc2626;
}

/* Statistics Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #f0f2f5, #e5e7eb);
    border-radius: 8px;
}

.stat-item {
    text-align: center;
    padding: 10px;
}

.stat-value {
    display: block;
    font-size: 32px;
    font-weight: bold;
    color: #2563eb;
    margin-bottom: 5px;
}

.stat-label {
    display: block;
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Document Sections */
.document-section {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 30px;
    overflow: hidden;
}

.section-header {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: white;
    padding: 15px 20px;
    font-size: 18px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    transition: background 0.3s;
}

.section-header:hover {
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
}

.section-icon {
    font-size: 24px;
}

.collapse-arrow {
    margin-left: auto;
    font-size: 16px;
    transition: transform 0.3s;
}

.collapse-arrow.collapsed {
    transform: rotate(-90deg);
}

.section-content {
    max-height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
    transition: max-height 0.3s ease-out;
}

.section-content.collapsed {
    max-height: 0;
    overflow: hidden;
}

/* Custom scrollbar for section content */
.section-content::-webkit-scrollbar {
    width: 10px;
}

.section-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.section-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

.section-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.table-container {
    overflow-x: auto;
}

/* History Table */
.history-table {
    width: 100%;
    border-collapse: collapse;
}

.history-table thead {
    background-color: #f9fafb;
}

.history-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
}

.history-table td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
    color: #1f2937;
}

.history-table tbody tr {
    transition: background-color 0.2s;
}

.history-table tbody tr:hover {
    background-color: #f3f4f6;
}

/* Document Number */
.doc-number {
    font-weight: bold;
    color: #2563eb;
}

/* Revisions List */
.revisions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.revision-badge {
    background-color: #dbeafe;
    color: #1e40af;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.revision-badge.internal {
    background-color: #fef3c7;
    color: #92400e;
}

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

.btn-small {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-view-all {
    background-color: #3b82f6;
    color: white;
}

.btn-view-all:hover {
    background-color: #2563eb;
}

.btn-download-barcode {
    background-color: #8b5cf6;
    color: white;
}

.btn-download-barcode:hover {
    background-color: #7c3aed;
}

.btn-new-rev {
    background-color: #10b981;
    color: white;
}

.btn-new-rev:hover {
    background-color: #059669;
}

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

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

.empty-state h3 {
    margin-bottom: 8px;
    color: #374151;
}

/* PDF Viewer Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 2% auto;
    padding: 0;
    border-radius: 10px;
    width: 95%;
    max-width: 1000px;
    height: 90vh;
    overflow: hidden;
}

.modal-header {
    background: #2563eb;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    opacity: 0.7;
}

.modal-body {
    height: calc(90vh - 70px);
    padding: 0;
}

.pdf-viewer {
    width: 100%;
    height: 100%;
    border: none;
}

/* Revision Details Modal */
.revisions-modal {
    padding: 20px;
}

.revisions-modal h3 {
    margin-bottom: 20px;
    color: #1f2937;
}

.revision-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.revision-detail-item:hover {
    background-color: #f9fafb;
}

.revision-info {
    flex: 1;
}

.revision-number-large {
    font-weight: bold;
    font-size: 16px;
    color: #1f2937;
    margin-bottom: 4px;
}

.revision-date {
    font-size: 13px;
    color: #6b7280;
}

.revision-actions {
    display: flex;
    gap: 8px;
}

.btn-view {
    background-color: #3b82f6;
    color: white;
}

.btn-view:hover {
    background-color: #2563eb;
}

.btn-download {
    background-color: #10b981;
    color: white;
}

.btn-download:hover {
    background-color: #059669;
}

.btn-disabled {
    background-color: #9ca3af;
    color: white;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-disabled:hover {
    background-color: #9ca3af;
}

/* Footer */
.footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 40px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .dropdown-content {
        position: static;
        width: 100%;
        margin-top: 0;
        box-shadow: none;
    }

    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .filter-container {
        flex-direction: column;
        align-items: stretch;
    }

    .history-table {
        font-size: 14px;
    }

    .history-table th,
    .history-table td {
        padding: 8px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .modal-content {
        width: 98%;
        height: 95vh;
        margin: 1% auto;
    }
}