* {
    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;
    flex-wrap: wrap;
}

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

.filter-input {
    flex: 1;
    min-width: 200px;
    padding: 10px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
}

.filter-select {
    padding: 10px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    background-color: white;
    cursor: pointer;
    min-width: 150px;
}

.new-form-btn {
    background-color: #10b981;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    margin-left: auto;
    transition: background-color 0.3s;
}

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

/* 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;
}

/* Table Container */
.table-container {
    overflow-x: auto;
    margin-top: 20px;
}

.forms-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
}

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

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

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

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

.forms-table tbody tr:hover {
    background-color: #f9fafb;
}

/* Form Number */
.form-number {
    font-weight: 600;
    color: #2563eb;
}

/* Type Badge */
.type-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.type-badge.part {
    background-color: #dbeafe;
    color: #1e40af;
}

.type-badge.asm {
    background-color: #fef3c7;
    color: #92400e;
}

/* Template Revision Badge */
.template-revision {
    background-color: #2563eb;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    text-transform: uppercase;
}

/* Status Badge */
.status-badge {
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    text-transform: uppercase;
}

.status-badge.draft {
    background-color: #f3f4f6;
    color: #6b7280;
}

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

.status-badge.approved {
    background-color: #dcfce7;
    color: #166534;
}

.status-badge.rejected {
    background-color: #fee2e2;
    color: #b91c1c;
}

/* Approval Progress */
.approval-progress {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background-color: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
    border-radius: 4px;
    transition: width 0.3s;
}

.progress-text {
    font-size: 11px;
    color: #6b7280;
}

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

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

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

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

.btn-view-form {
    background-color: #8b5cf6;
    color: white;
}

.btn-view-form:hover {
    background-color: #7c3aed;
}

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

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

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

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

.empty-state h3 {
    margin-bottom: 10px;
    color: #374151;
    font-size: 20px;
}

.empty-state p {
    margin-bottom: 20px;
    font-size: 14px;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

.modal-header {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: white;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 22px;
}

.close {
    color: white;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    opacity: 0.7;
}

.modal-body {
    padding: 25px;
    max-height: calc(90vh - 80px);
    overflow-y: auto;
}

/* Form Details Content */
#formDetailsContent {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.detail-section {
    background-color: #f9fafb;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.detail-section h3 {
    margin-bottom: 15px;
    color: #1f2937;
    font-size: 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e7eb;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.detail-label {
    font-weight: 600;
    color: #6b7280;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    color: #1f2937;
    font-size: 15px;
}

/* Approver Timeline */
.approver-timeline {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
}

.approver-step {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    background-color: white;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
    position: relative;
}

.approver-step.current {
    border-color: #fbbf24;
    background-color: #fffbeb;
}

.approver-step.approved {
    border-color: #10b981;
    background-color: #f0fdf4;
}

.approver-step.rejected {
    border-color: #ef4444;
    background-color: #fef2f2;
}

.step-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.approver-step.pending .step-icon {
    background-color: #f3f4f6;
    color: #9ca3af;
}

.approver-step.current .step-icon {
    background-color: #fef3c7;
    color: #f59e0b;
}

.approver-step.approved .step-icon {
    background-color: #dcfce7;
    color: #16a34a;
}

.approver-step.rejected .step-icon {
    background-color: #fee2e2;
    color: #dc2626;
}

.approver-info {
    flex: 1;
}

.approver-name {
    font-weight: 600;
    color: #1f2937;
    font-size: 16px;
    margin-bottom: 3px;
}

.approver-role {
    color: #6b7280;
    font-size: 13px;
    margin-bottom: 5px;
}

.approver-email {
    color: #9ca3af;
    font-size: 12px;
}

.step-status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.step-status.pending {
    background-color: #f3f4f6;
    color: #6b7280;
}

.step-status.current {
    background-color: #fef3c7;
    color: #92400e;
}

.step-status.approved {
    background-color: #dcfce7;
    color: #166534;
}

.step-status.rejected {
    background-color: #fee2e2;
    color: #b91c1c;
}

/* View Form Content */
.view-form-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-preview-section {
    background-color: #f9fafb;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.form-preview-section h3 {
    margin-bottom: 15px;
    color: #1f2937;
}

.form-fields-display {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.field-display {
    background-color: white;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.field-label {
    font-weight: 600;
    color: #6b7280;
    font-size: 12px;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.field-value {
    color: #1f2937;
    font-size: 14px;
    word-break: break-word;
}

/* 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;
    }

    .card {
        padding: 20px;
    }

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

    .filter-input,
    .filter-select {
        width: 100%;
    }

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

    .forms-table {
        font-size: 12px;
    }

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

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

    .modal-content {
        width: 95%;
        margin: 5% auto;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .form-fields-display {
        grid-template-columns: 1fr;
    }
}
/* Loading Indicator */
.loading-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.loading-spinner {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #2563eb;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

.loading-indicator p {
    color: white;
    font-size: 18px;
    font-weight: 600;
}