/* KPlus Style Modal */
.k-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 1050;
    display: none;
    justify-content: center;
    align-items: center;
}

.k-modal.show {
    display: flex;
}

.k-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.k-modal-content {
    position: relative;
    width: 100%;
    max-width: 400px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    margin: 20px;
    z-index: 1051;
    overflow: hidden;
}

.k-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f9fafb;
}

.k-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #111827;
    font-weight: 600;
}

.k-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.k-modal-close:hover {
    background-color: #f3f4f6;
    color: #374151;
}

.k-modal-body {
    padding: 20px;
    background: white;
}

.k-modal-footer {
    padding: 16px 20px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background-color: #f9fafb;
}

/* Radio Group Styles */
.k-radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 8px 0;
}

.k-radio {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.k-radio:hover {
    background-color: #f3f4f6;
}

.k-radio input[type="radio"] {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    appearance: none;
    position: relative;
    margin: 0;
    margin-right: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.k-radio input[type="radio"]:checked {
    border-color: #01873d;
    background-color: #01873d;
}

.k-radio input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

.k-radio-label {
    font-size: 14px;
    color: #374151;
}

/* Button Styles */
.k-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.k-btn-primary {
    background-color: #01873d;
    color: white;
}

.k-btn-primary:hover {
    background-color: #016d31;
}

.k-btn-primary:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
}

.k-btn-secondary {
    background-color: #f3f4f6;
    color: #374151;
}

.k-btn-secondary:hover {
    background-color: #e5e7eb;
}

/* Document Details Styles */
.rg-doc-details {
    margin-top: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease-in-out;
}

.rg-subtable {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    background: #fff;
}

.rg-subtable th,
.rg-subtable td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.rg-subtable th {
    background: #f9fafb;
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.rg-subtable td {
    color: #6b7280;
    font-size: 14px;
}

.k-add-row-action {
    margin: 12px;
    text-align: center;
}

.k-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: #01873d;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.k-add-btn:hover {
    background-color: #016d31;
    color: white;
    text-decoration: none;
}

.k-add-btn i {
    font-size: 14px;
}

/* Document Type Badge */
.doc-type {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background: rgba(1, 135, 61, 0.1);
    color: #01873d;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 500;
}

/* Toggle Button */
.rg-doc-details-toggle {
    margin-left: 12px;
    background: none;
    border: none;
    color: #01873d;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.rg-doc-details-toggle:hover {
    background-color: rgba(1, 135, 61, 0.1);
}

.rg-doc-details-toggle i {
    transition: transform 0.3s ease;
}

.rg-doc-details-toggle.active i {
    transform: rotate(180deg);
}

/* Add Document Button */
.k-add-document-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: #01873d;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.k-add-document-btn:hover {
    background-color: #016d31;
}

.k-add-document-btn i {
    font-size: 14px;
}


@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

.rg-doc-details.sliding-down {
    animation: slideDown 0.3s ease-out forwards;
}

.rg-doc-details.sliding-up {
    animation: slideUp 0.3s ease-out forwards;
}

/* Responsive Design */
@media (max-width: 480px) {
    .k-modal-content {
        max-width: calc(100% - 32px);
        margin: 16px;
    }

    .k-modal-header {
        padding: 12px 16px;
    }

    .k-modal-body {
        padding: 16px;
    }

    .k-modal-footer {
        padding: 12px 16px;
    }

    .rg-subtable th,
    .rg-subtable td {
        padding: 8px;
        font-size: 13px;
    }
}

/* Print Status */
.print-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.print-status.printed {
    color: #01873d;
}

.print-status.not-printed {
    color: #6b7280;
}

/* Loading State */
.k-loading {
    position: relative;
    pointer-events: none;
}

.k-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Toast Notifications */
.k-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1060;
    animation: slideIn 0.3s ease-out;
}

.k-toast-success {
    border-left: 4px solid #01873d;
}

.k-toast-error {
    border-left: 4px solid #dc2626;
}

.k-toast-warning {
    border-left: 4px solid #f59e0b;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}