.modal-backdrop { --bs-backdrop-zindex: auto; }

/* ── Document grid ──────────────────────── */
.doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

/* ── Document card ──────────────────────── */
.doc-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,.05);
    transition: box-shadow .25s, transform .2s;
}
.doc-card:hover { box-shadow: 0 8px 28px rgba(0,0,0,.1); transform: translateY(-3px); }

.doc-card-thumb {
    height: 130px;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-bottom: 1px solid #f1f5f9;
}
.doc-type-icon {
    font-size: 40px;
    color: #cbd5e1;
}
.doc-approval-badge {
    position: absolute;
    top: 10px; right: 10px;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: .3px;
}
.doc-badge-approved { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.doc-badge-rejected { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.doc-badge-pending  { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }

.doc-card-body { padding: 14px 16px; }
.doc-card-type {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 4px;
}
.doc-card-comment {
    font-size: 12px;
    color: #dc2626;
    display: flex;
    align-items: flex-start;
    gap: 5px;
    margin-bottom: 10px;
    line-height: 1.4;
}
.doc-card-actions {
    display: flex;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
}
.doc-btn {
    flex: 1;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    font-family: 'Outfit', sans-serif;
    transition: all .2s;
}
.doc-btn-view { background: #f0f9ff; color: #0369a1; }
.doc-btn-view:hover { background: #0369a1; color: #fff; }
.doc-btn-delete { background: #fef2f2; color: #dc2626; }
.doc-btn-delete:hover { background: #dc2626; color: #fff; }

/* Empty state */
.doc-empty {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 72px 20px;
    text-align: center;
}
.doc-empty i { font-size: 52px; color: #cbd5e1; display: block; margin-bottom: 16px; }
.doc-empty p { font-size: 14px; color: #64748b; margin: 0; }

/* Add doc button */
.doc-add-btn {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(249,115,22,.18);
    color: #f97316;
    border: 1.5px solid rgba(249,115,22,.3);
    border-radius: 10px;
    padding: 10px 20px;
    font-size: 13px; font-weight: 700;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    transition: all .2s;
}
.doc-add-btn:hover { background: #f97316; color: #fff; border-color: #f97316; }

/* Modal */
.doc-modal .modal-content {
    border: none !important;
    border-radius: 18px !important;
    box-shadow: 0 20px 60px rgba(0,0,0,.18) !important;
    overflow: hidden;
}
.doc-modal .modal-header {
    background: linear-gradient(135deg, #0f172a, #1e3a5f) !important;
    border-radius: 0 !important;
    padding: 20px 24px !important;
    border: none !important;
}
.doc-modal .modal-title { color: #fff !important; font-size: 15px; font-weight: 700; }
.doc-modal .btn-close { filter: invert(1) !important; opacity: 1 !important; }
.doc-modal .modal-body { padding: 24px; }
.doc-modal .modal-footer { padding: 16px 24px; border-top: 1px solid #f1f5f9; }

/* Upload preview */
.doc-preview-zone {
    width: 100%;
    height: 180px;
    border: 2px dashed #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    margin-bottom: 16px;
    transition: border-color .2s;
}
.doc-preview-zone:hover { border-color: #f97316; }
.doc-preview-zone img { width: 100%; height: 100%; object-fit: cover; }
.doc-preview-zone iframe { width: 100%; height: 100%; }
.doc-preview-placeholder { text-align: center; color: #94a3b8; }
.doc-preview-placeholder i { font-size: 32px; display: block; margin-bottom: 8px; }
.doc-preview-placeholder span { font-size: 13px; }

.doc-field-label {
    font-size: 11.5px; font-weight: 700; color: #475569;
    text-transform: uppercase; letter-spacing: .6px;
    display: block; margin-bottom: 6px;
}
.doc-select {
    width: 100%;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13.5px;
    color: #0f172a;
    font-family: 'Outfit', sans-serif;
    background: #f8fafc;
    outline: none;
    transition: border-color .2s;
}
.doc-select:focus { border-color: #f97316; background: #fff; }
.doc-error { font-size: 12px; color: #dc2626; margin-top: 4px; }

.doc-modal-submit {
    display: inline-flex; align-items: center; gap: 6px;
    background: #f97316; color: #fff; border: none;
    border-radius: 9px; padding: 10px 22px;
    font-size: 13px; font-weight: 700;
    font-family: 'Outfit', sans-serif;
    cursor: pointer; transition: background .2s;
}
.doc-modal-submit:hover { background: #ea6c0a; }
.doc-modal-cancel {
    display: inline-flex; align-items: center; gap: 6px;
    background: #f8fafc; color: #64748b;
    border: 1.5px solid #e2e8f0;
    border-radius: 9px; padding: 10px 20px;
    font-size: 13px; font-weight: 600;
    font-family: 'Outfit', sans-serif;
    cursor: pointer; transition: all .2s;
}
.doc-modal-cancel:hover { border-color: #334155; color: #334155; }
