.staff-documents-container {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .staff-documents-container {
        padding: 8px 8px 100px 8px; /* Extra bottom padding to avoid navbar */
    }
}

.staff-documents-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
}

.staff-documents-section h2 {
    color: #333;
    margin: 0 0 20px 0;
    font-size: 1.5rem;
    font-weight: 600;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.staff-documents-section h3 {
    color: #555;
    margin: 0 0 15px 0;
    font-size: 1.2rem;
    font-weight: 500;
}

.info-message {
    color: #6c757d;
    font-size: 0.95rem;
    margin: 0 0 25px 0;
    padding: 12px 15px;
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    border-radius: 4px;
}

/* Upload Panel */
.upload-panel {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 35px;
    border: 1px solid #e9ecef;
}

.upload-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.upload-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 0;
}

.form-group label {
    font-weight: 500;
    color: #333;
    font-size: 0.95rem;
}

.form-input {
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: border-color 0.2s ease;
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Hide native calendar icon so all open/close is handled by our JS */
input[type="date"].form-input::-webkit-calendar-picker-indicator {
    display: none;
    -webkit-appearance: none;
}

input[type="date"].form-input {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 36px;
}

.file-input-hidden {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
}

.upload-dropzone {
    text-align: center;
}

.dropzone-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 16px;
    border: 2px dashed #667eea;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.dropzone-label:hover {
    background: rgba(102, 126, 234, 0.04);
    border-color: #5a6fd8;
}

.dropzone-icon {
    width: 30px;
    height: 30px;
    color: #667eea;
}

.dropzone-browse-btn {
    display: inline-block;
    padding: 6px 22px;
    background: #667eea;
    color: white;
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: 500;
}

.dropzone-hint {
    color: #9ca3af;
    font-size: 0.8rem;
}

.dropzone-supported {
    color: #667eea;
    font-size: 0.75rem;
    font-weight: 500;
    margin: 8px 0 0 0;
}

.file-name {
    font-size: 0.85rem;
    color: #6c757d;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    display: inline-block;
}

.renewal-row {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.renewal-row .form-group {
    flex: 1;
}

.upload-btn {
    align-self: flex-end;
    width: auto;
    padding: 8px 20px;
    justify-content: center;
    font-size: 0.85rem;
}

.error-message {
    color: #dc3545;
    font-size: 0.85rem;
    margin: 0;
    padding: 10px 12px;
    background: #f8d7da;
    border-radius: 6px;
    border: 1px solid #f5c6cb;
}

/* Credentials List Section */
.staff-documents-list-section {
    margin-top: 40px;
}

.staff-documents-list {
    display: grid;
    gap: 15px;
    position: relative;
}

.staff-document-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.staff-document-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.staff-document-card.menu-open {
    position: relative;
    z-index: 10;
}

.file-icon {
    font-size: 2rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
}

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

.staff-document-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 6px 0;
    word-break: break-word;
}

.staff-document-meta {
    font-size: 0.85rem;
    color: #6c757d;
    margin: 0;
}

.uploader-name {
    font-weight: 500;
    color: #667eea;
}

.staff-document-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    z-index: 0;
    align-self: stretch;
    margin: -18px -18px -18px 0;
}

.more-options-wrapper {
    position: relative;
    z-index: 100;
    display: flex;
}

.more-options-wrapper > .btn-secondary {
    background: transparent;
    color: #333;
    border-radius: 0 10px 10px 0;
    padding: 6px 14px;
    height: 100%;
    display: flex;
    align-items: center;
}

.more-options-wrapper > .btn-secondary:hover {
    background: #ced4da;
}

.more-options-wrapper > .btn-secondary:focus,
.more-options-wrapper > .btn-secondary:active {
    outline: none;
    box-shadow: none;
}

.doc-options-menu {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 4px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    min-width: 120px;
    overflow: hidden;
}

.doc-options-menu button {
    display: block;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: none;
    text-align: left;
    font-size: 0.9rem;
    cursor: pointer;
    color: #333;
    font-family: inherit;
}

.doc-options-menu button:hover {
    background: #f5f5f5;
}

.doc-options-menu button.danger {
    color: #e53e3e;
}

.doc-options-menu button.danger:hover {
    background: #fee;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    font-family: inherit;
}

.btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

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

.btn-small {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #5a6fd8;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #ced4da;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #c82333;
}

.loading-message,
.empty-message {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-style: italic;
}

.loading-message p,
.empty-message p {
    margin: 0;
    font-size: 1.1rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .staff-documents-container {
        padding: 15px 15px 100px 15px;
    }

    .staff-documents-section {
        padding: 20px 15px;
    }

    .staff-documents-section h2 {
        font-size: 1.3rem;
    }

    .staff-documents-section h3 {
        font-size: 1.05rem;
    }

    .upload-panel {
        padding: 20px 15px;
        margin-bottom: 25px;
    }

    .form-group {
        gap: 5px;
    }

    .form-group label {
        font-size: 0.9rem;
    }

    .renewal-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .renewal-row input[type="date"].form-input {
        padding: 8px 30px 8px 8px;
        font-size: 0.85rem;
        background-size: 14px 14px;
        background-position: right 8px center;
    }

    .renewal-row .form-input {
        width: 100%;
        box-sizing: border-box;
    }

    .renewal-row .notify-toggle-group {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    .renewal-row .notify-label-row > label {
        font-size: 0.9rem;
        margin: 0;
    }

    .staff-document-card {
        gap: 12px;
        padding: 15px;
    }

    .file-icon {
        min-width: 40px;
        font-size: 1.8rem;
    }

    .staff-document-actions {
        gap: 6px;
        margin: -15px -15px -15px 0;
    }

    .btn {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .btn-small {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .staff-document-meta {
        font-size: 0.8rem;
    }

    .info-message {
        font-size: 0.9rem;
    }

    .upload-btn {
        align-self: stretch;
        width: 100%;
    }
}

/* Document Viewer Modal */
.doc-viewer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.doc-viewer-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 1200px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.doc-viewer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid #e9ecef;
    flex-shrink: 0;
}

.doc-viewer-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

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

.doc-viewer-more-wrapper {
    position: relative;
}

.doc-viewer-more-btn {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    color: #6c757d;
    transition: all 0.2s ease;
    line-height: 1;
}

.doc-viewer-more-btn:hover {
    background: #f8f9fa;
    color: #495057;
}

.doc-viewer-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 4px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10;
    min-width: 200px;
    overflow: hidden;
}

.doc-viewer-dropdown button {
    display: block;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: none;
    text-align: left;
    font-size: 0.9rem;
    cursor: pointer;
    color: #333;
    font-family: inherit;
}

.doc-viewer-dropdown button:hover {
    background: #f5f5f5;
}

.doc-viewer-dropdown button.danger {
    color: #e53e3e;
}

.doc-viewer-dropdown button.danger:hover {
    background: #fee;
}

.doc-viewer-body {
    flex: 1;
    overflow: hidden;
    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;
}

.doc-viewer-fallback {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.doc-viewer-fallback p {
    margin: 0 0 16px 0;
    font-size: 1rem;
}

/* ── Renewal Date & Notify Toggle ── */

.renewal-date {
    font-size: 0.8rem;
    color: #667eea;
    margin: 2px 0 0 0;
}

.renewal-date.expired {
    color: #dc3545;
    font-weight: 600;
}

.notify-badge {
    font-size: 0.8rem;
    margin-left: 4px;
}

.notify-toggle-group {
    margin-bottom: 0.5rem;
}

.notify-label-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.notify-label-row > label {
    margin: 0;
}

.notify-info-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    color: #9ca3af;
    cursor: pointer;
    transition: color 0.2s ease;
}

.notify-info-icon:hover {
    color: #667eea;
}

.notify-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #f0f1f3;
    color: #333;
    font-size: 0.75rem;
    font-weight: 400;
    padding: 8px 12px;
    border-radius: 6px;
    width: 200px;
    z-index: 100;
    pointer-events: none;
    line-height: 1.4;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.notify-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #f0f1f3;
}

.upload-form .notify-toggle-group > .toggle-switch {
    display: flex;
    align-items: center;
    margin-left: 0;
}

.upload-form .toggle-switch input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.upload-form .toggle-label {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    background: #ced4da;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-bottom: 0;
}

.upload-form .toggle-label:before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.upload-form .toggle-switch input[type="checkbox"]:checked + .toggle-label {
    background: #667eea;
}

.upload-form .toggle-switch input[type="checkbox"]:checked + .toggle-label:before {
    transform: translateX(26px);
}

.notify-hint {
    display: none;
    font-size: 0.75rem;
    color: #9ca3af;
    margin: 0;
}

/* Delete Confirmation Modal */
.delete-confirm-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.delete-confirm-modal.show {
    opacity: 1;
    visibility: visible;
}

.delete-confirm-modal .modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 480px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.delete-confirm-modal.show .modal-content {
    transform: scale(1);
}

.delete-confirm-modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem 1rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

.delete-confirm-modal .modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: #495057;
}

.delete-confirm-modal .close-button {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6c757d;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.delete-confirm-modal .close-button:hover {
    background: #f8f9fa;
    color: #495057;
}

.delete-confirm-modal .modal-body {
    /* Override unscoped .modal-body grid leak from analytics.css on >=768px */
    display: block;
    padding: 1.5rem;
}

.delete-confirm-modal .modal-body p {
    margin: 0 0 0.75rem 0;
    color: #495057;
    font-size: 1rem;
    word-break: break-word;
}

.delete-confirm-modal .warning-text {
    color: #dc3545;
    font-size: 0.875rem;
    font-weight: 500;
}

.delete-confirm-modal .actions-section {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.delete-confirm-modal .actions-section .btn {
    width: auto;
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.delete-confirm-modal .btn:disabled { opacity: 0.6; cursor: not-allowed; }
.delete-confirm-modal .btn-secondary { background: #6c757d; color: white; }
.delete-confirm-modal .btn-secondary:hover:not(:disabled) { background: #545b62; }
.delete-confirm-modal .btn-danger { background: #dc3545; color: white; }
.delete-confirm-modal .btn-danger:hover:not(:disabled) { background: #c82333; }

@media (min-width: 769px) {
    .delete-confirm-modal {
        padding-left: 250px;
    }
}


