.files-page {
    max-width: 1240px;
    margin: 0 auto;
    color: var(--text-primary);
}

.files-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.files-card {
    background: rgba(15, 23, 42, 0.6);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(148, 163, 184, 0.15);
}

.files-card-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 16px;
}

.files-card-title {
    margin: 0;
    font-size: 18px;
}

.files-note {
    margin: 6px 0 0;
    color: var(--text-muted);
    font-size: 13px;
}

.files-refresh {
    min-width: 120px;
}

.files-upload-panel {
    margin-bottom: 12px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(2, 6, 23, 0.5);
    border-radius: 12px;
    padding: 12px;
}

.files-upload-label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.files-upload-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.files-upload-input {
    flex: 1 1 280px;
    min-width: 220px;
    padding: 8px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.7);
    color: var(--text-primary);
    font-size: 13px;
}

.files-upload-input::file-selector-button {
    margin-right: 10px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 7px;
    background: rgba(30, 41, 59, 0.7);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 10px;
    cursor: pointer;
}

.files-upload-btn {
    min-width: 120px;
}

.files-upload-note {
    margin: 8px 0 0;
    color: var(--text-muted);
    font-size: 12px;
}

.files-upload-note code {
    color: #cbd5e1;
}

.files-success {
    margin-bottom: 12px;
    border: 1px solid rgba(16, 185, 129, 0.42);
    background: rgba(16, 185, 129, 0.14);
    color: #6ee7b7;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
}

.files-error {
    margin-bottom: 12px;
    border: 1px solid rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
}

.files-table-wrap {
    overflow-x: auto;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 12px;
}

.files-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
}

.files-table th,
.files-table td {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    font-size: 14px;
    vertical-align: middle;
}

.files-table thead th {
    background: rgba(15, 23, 42, 0.92);
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-size: 12px;
}

.files-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.files-col-name {
    font-weight: 600;
    color: var(--text-primary);
}

.files-col-path {
    font-family: "IBM Plex Mono", "Consolas", "Courier New", monospace;
    color: var(--text-secondary);
    word-break: break-all;
    font-size: 12px;
}

.files-col-size,
.files-col-date {
    color: var(--text-secondary);
    white-space: nowrap;
}

.files-actions-inline {
    display: flex;
    align-items: center;
    gap: 8px;
}

.files-action-btn {
    padding: 7px 10px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: rgba(15, 23, 42, 0.6);
    color: var(--text-primary);
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
}

.files-action-btn:hover {
    background: rgba(15, 23, 42, 0.85);
}

.files-action-btn.danger {
    border-color: rgba(239, 68, 68, 0.4);
    color: #f87171;
}

.files-empty-row td {
    text-align: center;
    color: var(--text-muted);
    padding: 18px 12px;
}

.files-meta {
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.files-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.files-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 8, 14, 0.75);
}

.files-modal-card {
    position: relative;
    width: min(980px, 95vw);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 26px 44px rgba(0, 0, 0, 0.45);
}

.files-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

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

.files-view-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.files-view-meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: rgba(2, 6, 23, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 10px;
    padding: 8px 10px;
}

.files-view-meta-item span {
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.files-view-meta-item strong {
    color: var(--text-primary);
    font-size: 12px;
    word-break: break-all;
}

.files-view-warning {
    border: 1px solid rgba(245, 158, 11, 0.4);
    background: rgba(245, 158, 11, 0.14);
    color: #fbbf24;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 13px;
}

.files-view-content {
    margin: 0;
    overflow: auto;
    background: rgba(2, 6, 23, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 10px;
    padding: 12px;
    min-height: 220px;
    max-height: calc(90vh - 250px);
    color: #dbeafe;
    font-family: "IBM Plex Mono", "Consolas", "Courier New", monospace;
    font-size: 12px;
    white-space: pre-wrap;
    word-break: break-word;
}

@media (max-width: 900px) {
    .files-actions {
        justify-content: flex-start;
    }

    .files-upload-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .files-upload-input {
        width: 100%;
        min-width: 0;
    }

    .files-upload-btn {
        width: 100%;
    }

    .files-view-meta {
        grid-template-columns: 1fr;
    }
}
