@import 'shared.css';

.main-content { max-width: 1400px; margin: 32px auto; padding: 0 24px; }
.card { padding: 36px; }

h1 {
    text-align: center;
    font-family: var(--serif);
    font-size: 24px;
    color: var(--text-1);
    margin-bottom: 6px;
}

.subtitle { text-align: center; color: var(--text-2); margin-bottom: 28px; font-size: 13px; }

.filter-container { display: flex; gap: 12px; margin-bottom: 20px; align-items: center; }
.filter-label { font-weight: 600; font-size: 13px; min-width: 70px; }

.filter-input {
    flex: 1;
    padding: 9px 13px;
    border: 1px solid var(--border-md);
    border-radius: var(--radius);
    font-size: 13px;
    font-family: var(--sans);
}

.filter-input:focus { outline: none; border-color: var(--blue); }

.new-revision-btn {
    background: var(--red);
    color: #fff;
    padding: 9px 16px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--sans);
    margin-left: auto;
    transition: background 0.15s;
}

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

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 28px;
    padding: 20px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

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

.stat-value {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: var(--blue);
    margin-bottom: 4px;
    font-family: var(--serif);
}

.stat-label {
    display: block;
    font-size: 11px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

.document-section {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    overflow: hidden;
}

.section-header {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 14px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-1);
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    transition: background 0.12s;
}

.section-header:hover { background: #f1f5f9; }
.section-icon { font-size: 18px; }

.collapse-arrow { margin-left: auto; font-size: 14px; transition: transform 0.2s; color: var(--text-3); }
.collapse-arrow.collapsed { transform: rotate(-90deg); }

.section-content { max-height: 500px; overflow-y: auto; overflow-x: hidden; transition: max-height 0.25s; }
.section-content.collapsed { max-height: 0; overflow: hidden; }

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

.history-table { width: 100%; border-collapse: collapse; }
.history-table thead { background: var(--bg); }

.history-table th {
    padding: 11px 14px;
    text-align: left;
    font-weight: 600;
    color: var(--text-2);
    border-bottom: 1px solid var(--border);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.history-table td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-1);
}

.history-table tbody tr { transition: background 0.12s; }
.history-table tbody tr:hover { background: var(--bg); }

.doc-number { font-weight: 600; color: var(--blue); }

.revisions-list { display: flex; flex-wrap: wrap; gap: 5px; }

.revision-badge {
    background: var(--blue-light);
    color: #1e40af;
    padding: 2px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.revision-badge.internal { background: var(--amber-light); color: var(--amber); }

.action-buttons { display: flex; gap: 5px; flex-wrap: wrap; }

.btn-small {
    padding: 5px 10px;
    border: none;
    border-radius: var(--radius);
    font-size: 11px;
    font-weight: 600;
    font-family: var(--sans);
    cursor: pointer;
    transition: opacity 0.15s;
    text-decoration: none;
    display: inline-block;
}

.btn-small:hover { opacity: 0.85; }
.btn-view-all          { background: var(--blue); color: #fff; }
.btn-download-barcode  { background: var(--purple); color: #fff; }
.btn-new-rev           { background: var(--green); color: #fff; }
.btn-view              { background: var(--blue); color: #fff; }
.btn-download          { background: var(--green); color: #fff; }
.btn-disabled          { background: var(--border); color: var(--text-3); cursor: not-allowed; opacity: 0.6; }
.btn-disabled:hover    { opacity: 0.6; }

.dropzone {
    border: 2px dashed var(--border-md);
    border-radius: var(--radius);
    padding: 12px;
    background: var(--white);
    transition: border-color 0.15s, background 0.15s;
}

.dropzone.dragover {
    border-color: var(--blue);
    background: var(--blue-light);
}

.dropzone .dz-hint {
    font-size: 11px;
    color: var(--text-3);
    margin-top: 6px;
    margin-bottom: 0;
}

.dropzone.dragover .dz-hint { color: var(--blue); font-weight: 600; }

.modal-content { max-width: 1000px; height: 90vh; overflow: hidden; padding: 0; }

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--white);
}

.close { color: var(--text-2); font-size: 26px; font-weight: 400; cursor: pointer; }
.close:hover { color: var(--text-1); }

.modal-body { height: calc(90vh - 65px); padding: 0; }
.pdf-viewer { width: 100%; height: 100%; border: none; }

.revisions-modal { padding: 20px; }
.revisions-modal h3 { margin-bottom: 18px; font-size: 15px; }

.revision-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid var(--border);
    transition: background 0.12s;
}

.revision-detail-item:hover { background: var(--bg); }

.revision-info { flex: 1; }
.revision-number-large { font-weight: 600; font-size: 14px; color: var(--text-1); margin-bottom: 3px; }
.revision-date { font-size: 12px; color: var(--text-3); }
.revision-actions { display: flex; gap: 6px; }

@media (max-width: 768px) {
    .filter-container { flex-direction: column; align-items: stretch; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .action-buttons { flex-direction: column; }
    .modal-content { width: 98%; height: 95vh; margin: 1% auto; }
}
