/* Machine Types Page Styles */

/* =====================================================
   Content Wrapper Fix
   ===================================================== */
.content-wrapper {
    height: auto !important;
    min-height: calc(100vh - 15px);
    overflow-y: visible;
}

/* =====================================================
   Overview Cards Container
   ===================================================== */
.overview-cards-container {
    border-radius: var(--card-radius);
    margin-bottom: var(--spacing-m);
}

/* =====================================================
   Stats Grid - Key Metrics
   ===================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-l);
    margin-bottom: 0;
}

.overview-cards-container .stats-grid {
    margin-bottom: 0;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--card-radius);
    padding: var(--spacing-l);
    display: flex;
    align-items: center;
    gap: var(--spacing-m);
    border: 2px solid var(--border-color);
    transition: var(--transition-smooth);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--green-primary);
}

.stat-card.stat-primary {
    border-color: var(--info-blue);
}

.stat-card.stat-success {
    border-color: var(--green-success);
}

.stat-card.stat-warning {
    border-color: var(--warning-orange);
}

.stat-card.stat-error {
    border-color: var(--error-red);
}

.stat-icon {
    font-size: 48px;
    color: var(--text-secondary);
}

.stat-card.stat-primary .stat-icon {
    color: var(--info-blue);
}

.stat-card.stat-success .stat-icon {
    color: var(--green-success);
}

.stat-card.stat-warning .stat-icon {
    color: var(--warning-orange);
}

.stat-card.stat-error .stat-icon {
    color: var(--error-red);
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: var(--spacing-xs);
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* =====================================================
   Connected Sections
   ===================================================== */
.content-wrapper > .section:nth-of-type(1) {
    border-radius: var(--card-radius) var(--card-radius) 0 0;
    margin-bottom: 0;
    box-shadow: none;
}

.content-wrapper > .section:nth-of-type(2) {
    border-radius: 0 0 var(--card-radius) var(--card-radius);
    box-shadow: var(--shadow-sm);
}

/* =====================================================
   Filters
   ===================================================== */
.filters-container {
    display: flex;
    gap: var(--spacing-m);
    flex-wrap: wrap;
}

.filter-select {
    padding: var(--spacing-s) var(--spacing-m);
    border: 2px solid var(--border-color);
    border-radius: var(--input-radius);
    font-size: 14px;
    font-family: var(--font-primary);
    background: var(--surface);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-smooth);
    min-width: 150px;
}

.filter-select:hover {
    border-color: var(--green-primary);
}

.filter-select:focus {
    outline: none;
    border-color: var(--green-primary);
    box-shadow: 0 0 0 3px rgba(94, 138, 61, 0.1);
}

/* =====================================================
   Modal Styles
   ===================================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--surface);
    border-radius: var(--card-radius);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-content.modal-large {
    max-width: 800px;
}

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

.modal-header {
    padding: var(--spacing-l);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--green-dark);
    margin: 0;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 32px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-smooth);
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--error-red);
    transform: rotate(90deg);
}

.modal-body {
    padding: var(--spacing-l);
}

.modal-footer {
    padding: var(--spacing-l);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-m);
}

/* =====================================================
   Form Styles
   ===================================================== */
.form-group {
    margin-bottom: var(--spacing-l);
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-s);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: var(--spacing-m);
    border: 2px solid var(--border-color);
    border-radius: var(--input-radius);
    font-size: 14px;
    font-family: var(--font-primary);
    color: var(--text-primary);
    background: var(--surface);
    transition: var(--transition-smooth);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--green-primary);
    box-shadow: 0 0 0 3px rgba(94, 138, 61, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* =====================================================
   Buttons
   ===================================================== */
.btn-primary,
.btn-secondary {
    padding: var(--spacing-m) var(--spacing-l);
    border: none;
    border-radius: var(--button-radius);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-s);
}

.btn-primary {
    background: linear-gradient(135deg, var(--green-primary), var(--green-success));
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--background);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--surface);
    border-color: var(--text-secondary);
}

/* =====================================================
   Pagination
   ===================================================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-l);
    padding: var(--spacing-l) 0;
}

.btn-page {
    padding: var(--spacing-s) var(--spacing-l);
    background: var(--surface);
    border: 2px solid var(--border-color);
    border-radius: var(--button-radius);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-page:hover:not(:disabled) {
    background: var(--green-primary);
    border-color: var(--green-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.btn-page:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 600;
}

.page-info span {
    color: var(--green-primary);
    font-weight: 700;
}

/* =====================================================
   Responsive - Stats Grid
   ===================================================== */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .filters-container {
        flex-direction: column;
    }

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

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

/* =====================================================
   Search Container
   ===================================================== */
.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    color: #94a3b8;
    font-size: 16px;
}

.search-input {
    padding: 8px 12px 8px 36px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    width: 200px;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: #5e8a3d;
    box-shadow: 0 0 0 3px rgba(94, 138, 61, 0.1);
}

/* =====================================================
   Types Grid
   ===================================================== */
.types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 16px;
}

/* =====================================================
   Type Card
   ===================================================== */
.type-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}

.type-card:hover {
    border-color: #5e8a3d;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.type-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 16px 16px 0;
}

.type-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: linear-gradient(135deg, #5e8a3d 0%, #7aa85d 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.type-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.type-card:hover .type-actions {
    opacity: 1;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border: none;
    background: #f1f5f9;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: #e2e8f0;
    color: #334155;
}

.btn-icon-danger:hover {
    background: #fee2e2;
    color: #dc2626;
}

.type-card-body {
    padding: 16px;
}

.type-name {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.type-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.type-category {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: #f0fdf4;
    color: #15803d;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.type-manufacturer {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: #eff6ff;
    color: #1d4ed8;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.type-model {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 8px;
}

.type-description {
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
    margin: 0;
}

.type-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-top: 1px solid #f1f5f9;
    background: #f8fafc;
}

.machine-count {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #64748b;
}

.machine-count i {
    font-size: 16px;
    color: #5e8a3d;
}

.view-details {
    font-size: 13px;
    color: #5e8a3d;
    font-weight: 500;
}

/* =====================================================
   Empty State
   ===================================================== */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: #f8fafc;
    border-radius: 12px;
    border: 2px dashed #e2e8f0;
}

.empty-icon {
    font-size: 64px;
    color: #94a3b8;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 18px;
    color: #334155;
    margin: 0 0 8px 0;
}

.empty-state p {
    font-size: 14px;
    color: #64748b;
    margin: 0 0 20px 0;
}

/* =====================================================
   Loading State
   ===================================================== */
.loading-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #64748b;
}

.loading-spinner {
    font-size: 32px;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}

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

/* =====================================================
   Modal Enhancements
   ===================================================== */
.modal-medium {
    max-width: 600px;
}

.modal-small {
    max-width: 400px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Specifications Container */
.specs-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}

.spec-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.spec-row .spec-key,
.spec-row .spec-value {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
}

.spec-row .spec-key:focus,
.spec-row .spec-value:focus {
    outline: none;
    border-color: #5e8a3d;
}

.btn-remove-spec {
    width: 32px;
    height: 32px;
    border: none;
    background: #fee2e2;
    color: #dc2626;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.btn-remove-spec:hover {
    background: #fecaca;
}

.btn-add-spec {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px dashed #5e8a3d;
    background: transparent;
    color: #5e8a3d;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-add-spec:hover {
    background: #f0fdf4;
}

/* =====================================================
   Detail Modal
   ===================================================== */
.detail-section {
    margin-bottom: 24px;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 12px 0;
}

.detail-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.detail-icon {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    background: linear-gradient(135deg, #5e8a3d 0%, #7aa85d 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
}

.detail-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.detail-category {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background: #f0fdf4;
    color: #15803d;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    width: fit-content;
}

.detail-manufacturer {
    font-size: 14px;
    color: #1d4ed8;
    font-weight: 500;
}

.detail-model {
    font-size: 13px;
    color: #64748b;
}

.detail-section p {
    font-size: 14px;
    color: #475569;
    line-height: 1.6;
    margin: 0;
}

/* Specifications Grid */
.specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.spec-item {
    display: flex;
    flex-direction: column;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.spec-item .spec-label {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 4px;
}

.spec-item .spec-value {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.no-specs,
.no-machines {
    color: #94a3b8;
    font-style: italic;
    font-size: 14px;
}

/* Machines List */
.machines-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.machine-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.machine-name {
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
}

.machine-code {
    font-size: 13px;
    color: #64748b;
    font-family: monospace;
}

.machine-status {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.machine-status.status-available {
    background: #dcfce7;
    color: #15803d;
}

.machine-status.status-active {
    background: #dbeafe;
    color: #1d4ed8;
}

.machine-status.status-maintenance {
    background: #fef3c7;
    color: #b45309;
}

.machine-status.status-inactive,
.machine-status.status-decommissioned {
    background: #f1f5f9;
    color: #64748b;
}

/* =====================================================
   Delete Modal
   ===================================================== */
.delete-warning {
    text-align: center;
    padding: 20px 0;
}

.delete-warning i {
    font-size: 48px;
    color: #f59e0b;
    margin-bottom: 16px;
}

.delete-warning p {
    font-size: 15px;
    color: #334155;
    margin: 0 0 8px 0;
}

.delete-note {
    font-size: 13px;
    color: #94a3b8;
}

.btn-danger {
    background: #dc2626;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-danger:hover {
    background: #b91c1c;
}

/* =====================================================
   Responsive
   ===================================================== */
@media (max-width: 768px) {
    .types-grid {
        grid-template-columns: 1fr;
    }

    .filters-container {
        flex-direction: column;
        width: 100%;
    }

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

    .section-header {
        flex-direction: column;
        gap: 12px;
    }

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

    .form-row {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   Type Count Badge
   ===================================================== */
.type-count {
    font-size: 13px;
    color: #64748b;
    background: #f1f5f9;
    padding: 4px 12px;
    border-radius: 20px;
}

/* =====================================================
   Document Management Styles
   ===================================================== */

/* Documents Section in Detail Modal */
.documents-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.documents-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-upload-doc {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: linear-gradient(135deg, #5e8a3d 0%, #7aa85d 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-upload-doc:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(94, 138, 61, 0.3);
}

.btn-upload-doc i {
    font-size: 16px;
}

/* Documents Grid - Grouped by Category */
.documents-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.doc-category {
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.doc-category-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
}

.doc-category-header i {
    font-size: 18px;
    color: #5e8a3d;
}

.doc-category-header span {
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}

.doc-category-count {
    margin-left: auto;
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    background: white;
    padding: 2px 8px;
    border-radius: 10px;
}

/* Document List */
.doc-list {
    display: flex;
    flex-direction: column;
}

.doc-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    transition: background 0.15s ease;
}

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

.doc-item:hover {
    background: #f0fdf4;
}

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

.doc-icon.pdf {
    background: #fee2e2;
    color: #dc2626;
}

.doc-icon.doc {
    background: #dbeafe;
    color: #2563eb;
}

.doc-icon.xls {
    background: #dcfce7;
    color: #16a34a;
}

.doc-icon.ppt {
    background: #ffedd5;
    color: #ea580c;
}

.doc-icon.img {
    background: #fae8ff;
    color: #c026d3;
}

.doc-icon.txt {
    background: #f1f5f9;
    color: #475569;
}

.doc-icon.default {
    background: #f1f5f9;
    color: #64748b;
}

.doc-info {
    flex: 1;
    min-width: 0;
}

.doc-name {
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doc-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: #94a3b8;
}

.doc-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.doc-actions {
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.doc-item:hover .doc-actions {
    opacity: 1;
}

.btn-doc-action {
    width: 32px;
    height: 32px;
    border: none;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    transition: all 0.15s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-doc-action:hover {
    background: #5e8a3d;
    color: white;
    transform: translateY(-1px);
}

.btn-doc-action.btn-delete:hover {
    background: #dc2626;
}

/* No Documents State */
.no-documents {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    background: #f8fafc;
    border: 2px dashed #e2e8f0;
    border-radius: 10px;
}

.no-documents i {
    font-size: 48px;
    color: #cbd5e1;
    margin-bottom: 12px;
}

.no-documents p {
    font-size: 14px;
    color: #94a3b8;
    margin: 0 0 16px 0;
}

/* =====================================================
   Upload Document Modal
   ===================================================== */
.file-upload-area {
    border: 2px dashed #e2e8f0;
    border-radius: 10px;
    padding: 32px 20px;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
    background: #f8fafc;
    position: relative;
}

.file-upload-area input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

.file-upload-area:hover,
.file-upload-area.drag-over {
    border-color: #5e8a3d;
    background: #f0fdf4;
}

.file-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.file-upload-placeholder i {
    font-size: 48px;
    color: #94a3b8;
}

.file-upload-placeholder p {
    font-size: 14px;
    color: #64748b;
    margin: 0;
}

.file-upload-placeholder .browse-link {
    color: #5e8a3d;
    font-weight: 600;
    cursor: pointer;
}

.file-upload-placeholder .browse-link:hover {
    text-decoration: underline;
}

.file-upload-placeholder small,
.file-upload-placeholder .file-types {
    font-size: 12px;
    color: #94a3b8;
}

.btn-remove-file {
    width: 28px;
    height: 28px;
    border: none;
    background: #fee2e2;
    color: #dc2626;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    position: relative;
    z-index: 20;
}

.btn-remove-file:hover {
    background: #fecaca;
    transform: scale(1.1);
}

/* File Selected State */
.file-selected {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.file-upload-area.has-file .file-upload-placeholder {
    display: none;
}

.file-upload-area.has-file .file-selected {
    display: flex;
}

.file-selected-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    background: #dcfce7;
    color: #16a34a;
}

.file-selected-name {
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-selected-size {
    font-size: 12px;
    color: #94a3b8;
}

.btn-change-file {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 12px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-change-file:hover {
    border-color: #5e8a3d;
    color: #5e8a3d;
}

/* Upload Progress */
.upload-progress {
    display: none;
    margin-top: 16px;
}

.upload-progress.active {
    display: block;
}

.progress-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #5e8a3d, #7aa85d);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 12px;
    color: #64748b;
    text-align: center;
}

/* =====================================================
   Document Viewer Modal - Fullscreen
   ===================================================== */
.modal-fullscreen {
    max-width: 95vw;
    max-height: 95vh;
    width: 95vw;
    height: 95vh;
}

.doc-viewer-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.doc-viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.doc-viewer-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.doc-viewer-title i {
    font-size: 24px;
    color: #5e8a3d;
}

.doc-viewer-title h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.doc-viewer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-icon-header {
    width: 36px;
    height: 36px;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    transition: all 0.15s ease;
}

.btn-icon-header:hover {
    border-color: #5e8a3d;
    color: #5e8a3d;
}

.btn-viewer-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 6px;
    font-size: 13px;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-viewer-action:hover {
    border-color: #5e8a3d;
    color: #5e8a3d;
}

.btn-viewer-action i {
    font-size: 16px;
}

.doc-viewer-body {
    flex: 1;
    padding: 0;
    overflow: hidden;
    background: #1e293b;
    display: flex;
    align-items: center;
    justify-content: center;
}

.doc-viewer-body iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.doc-viewer-body img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Document Loading State */
.doc-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 60px 40px;
    color: #94a3b8;
}

.doc-loading .loading-spinner {
    font-size: 32px;
    animation: spin 1s linear infinite;
}

/* Unsupported File Type in Viewer */
.doc-unsupported,
.unsupported-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 60px 40px;
    text-align: center;
    color: white;
}

.unsupported-preview i {
    font-size: 64px;
    color: #94a3b8;
}

.unsupported-preview h4 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: #f1f5f9;
}

.unsupported-preview p {
    font-size: 14px;
    color: #94a3b8;
    margin: 0;
}

/* =====================================================
   Delete Document Confirmation Modal
   ===================================================== */
.delete-doc-warning {
    text-align: center;
    padding: 20px 0;
}

.delete-doc-warning i {
    font-size: 48px;
    color: #f59e0b;
    margin-bottom: 16px;
}

.delete-doc-warning p {
    font-size: 15px;
    color: #334155;
    margin: 0 0 8px 0;
}

.delete-doc-name {
    font-weight: 600;
    color: #1e293b;
    padding: 8px 16px;
    background: #f1f5f9;
    border-radius: 6px;
    display: inline-block;
    margin: 8px 0;
}

.delete-doc-note {
    font-size: 13px;
    color: #94a3b8;
    margin-top: 8px;
}

/* =====================================================
   Responsive - Document Styles
   ===================================================== */
@media (max-width: 768px) {
    .documents-header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .btn-upload-doc {
        width: 100%;
        justify-content: center;
    }

    .doc-item {
        flex-wrap: wrap;
    }

    .doc-actions {
        opacity: 1;
        width: 100%;
        justify-content: flex-end;
        margin-top: 8px;
    }

    .modal-fullscreen {
        max-width: 100vw;
        max-height: 100vh;
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }

    .doc-viewer-header {
        flex-direction: column;
        gap: 12px;
    }

    .doc-viewer-actions {
        width: 100%;
        justify-content: center;
    }
}
