/* Custom styles goes here */
div.dataTables_filter {
    padding-bottom: 10px;
}

div.dt-buttons {
    padding-bottom: 10px;
}

.bg-label-mvm {
    background-color: #fed8b1 !important;
    color: #ff681f !important;
}

.bg-label-tgm {
    background-color: #d8e8c9 !important;
    color: #007236 !important;
}

.bg-label-skm {
    background-color: #badbff !important;
    color: #002e61 !important;
}

.bg-label-tier {
    background-color: #e0b0ff !important;
    color: #5d3fd3 !important;
}
.bg-label-concluded {
    background-color: #d1e7dd !important;
    color: #0f5132 !important;
}

.bg-label-completed {
    background-color: #d1e7dd !important;
    color: #0f5132 !important;
}

.bg-label-ongoing {
    background-color: #d1e7dd !important;
    color: #0f5132 !important;
}

.bg-label-active {
    background-color: #e8fadf !important;
    color: #71dd37 !important;
}

.bg-label-inactive {
    background-color: #ffe0db !important;
    color: #ff3e1d !important;
}

.bg-label-upcoming {
    background-color: #fff3cd !important;
    color: #664d03 !important;
}

.bg-label-expired {
    background-color: #d3d3d4 !important;
    color: #141619 !important;
}

.bg-label-archived {
    background-color: #f8d7da !important;
    color: #842029 !important;
}

.bg-label-deleted {
    background-color: #e2e3e5 !important;
    color: #34383c !important;
}

.my-swal {
    z-index: 999999\ !important;
}

.border-head {
    border-left: solid 1px #212529;
    /*font-size: 11pt;*/
}

.border-finish {
    border-right: solid 1px #212529;
    border-left: solid 1px #212529;
    /*font-size: 11pt;*/
}

.bg-primary-subtle-darker {
    background-color: #c8c9ff;
}

.stage-card {
    margin-bottom: 1.5rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stage-header {
    padding: 12px 20px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stage-header.stage-pending {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    color: #212529;
}

.stage-header.stage-returned {
    background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
    color: white;
}

.stage-header.stage-approved {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.stage-header.stage-closed {
    background: linear-gradient(135deg, #6c757d 0%, #adb5bd 100%);
    color: white;
}

.stage-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    background-color: rgba(255,255,255,0.25);
}

.stage-pending-message {
    padding: 30px 20px;
    text-align: center;
    color: #6c757d;
    background-color: #f8f9fa;
}

.stage-pending-message i {
    font-size: 2.5rem;
    margin-bottom: 10px;
    display: block;
    color: #adb5bd;
}

.stage-empty-state-icon {
    font-size: 2rem;
}

.stage-header.stage-inprogress {
    background: linear-gradient(135deg, #0dcaf0 0%, #0d6efd 100%);
    color: white;
}

.stage-header.stage-open {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.stage-badge.open,
.stage-badge.closed {
    background-color: rgba(255,255,255,0.2);
}

/* Shared status badges (used by dashboard tables) */
.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 4px;
}

.status-primary {
    background-color: #cfe2ff;
    color: #084298;
    border: 1px solid #9ec5fe;
}

.status-secondary {
    background-color: #e2e3e5;
    color: #41464b;
    border: 1px solid #bfc4c9;
}

.status-success {
    background-color: #d1e7dd;
    color: #0f5132;
    border: 1px solid #badbcc;
}

.status-warning {
    background-color: #fff3cd;
    color: #664d03;
    border: 1px solid #ffecb5;
}

.status-danger {
    background-color: #f8d7da;
    color: #842029;
    border: 1px solid #f5c2c7;
}

.status-info {
    background-color: #cff4fc;
    color: #055160;
    border: 1px solid #9eeaf9;
}

.status-default {
    background-color: #f1f3f5;
    color: #495057;
    border: 1px solid #ced4da;
}

/* StageDocumentDetails styles */
.stage-tabs .nav-tabs {
    border-bottom: 3px solid #e9ecef;
    gap: 6px;
}

.stage-tabs .nav-link {
    border: none;
    border-radius: 10px 10px 0 0;
    padding: 14px 28px;
    font-weight: 600;
    font-size: 14px;
    color: #6c757d;
    background-color: #f1f3f5;
    transition: all 0.25s ease;
    position: relative;
}

.stage-tabs .nav-link:hover {
    background-color: #e9ecef;
    color: #495057;
}

.stage-tabs .nav-link.active {
    background: linear-gradient(135deg, #696cff 0%, #5f61e6 100%);
    color: white;
    border: none;
}

.stage-tabs .nav-link .stage-badge {
    font-size: 10px;
    padding: 3px 10px;
    border-radius: 15px;
    margin-left: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stage-tabs .nav-link .stage-badge.badge-pending {
    background-color: rgba(255, 193, 7, 0.2);
    color: #856404;
}

.stage-tabs .nav-link .stage-badge.badge-approved {
    background-color: rgba(40, 167, 69, 0.2);
    color: #155724;
}

.stage-tabs .nav-link .stage-badge.badge-locked {
    background-color: rgba(108, 117, 125, 0.2);
    color: #6c757d;
}

.stage-tabs .nav-link .stage-badge.badge-waiting {
    background-color: rgba(23, 162, 184, 0.2);
    color: #0c5460;
}

.stage-tabs .nav-link.active .stage-badge {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.tab-content {
    border: 1px solid #e9ecef;
    border-top: none;
    border-radius: 0 0 10px 10px;
    background-color: #fff;
    padding: 25px;
}

.section-header {
    font-size: 18px;
    font-weight: 600;
    color: #1f2d3d;
    margin-bottom: 20px;
    padding: 10px 14px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header i {
    font-size: 22px;
    color: #1f2d3d;
}

.document-details-card {
    margin-bottom: 1.5rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
}

.document-header {
    color: #1f2d3d;
    padding: 10px 16px;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 1px solid #e9ecef;
}

.document-header-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.document-header-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.version-card {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
    background-color: #ffffff;
    margin-bottom: 10px;
}

.version-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #f8f9fa;
    padding: 8px 12px;
    font-weight: 600;
    font-size: 13px;
    color: #495057;
    border-bottom: 1px solid #e9ecef;
}

.version-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-button {
    border: none;
    background: transparent;
    color: #495057;
    padding: 4px;
    line-height: 1;
    cursor: pointer;
}

.toggle-icon {
    display: inline-block;
    transition: transform 0.2s ease;
}

.toggle-button[aria-expanded="true"] .toggle-icon {
    transform: rotate(180deg);
}

.version-body {
    padding: 0;
}

.details-table {
    width: 100%;
    margin: 0;
    font-size: 13px;
}

.details-table td {
    padding: 6px 16px;
    border-bottom: 1px dashed #e9ecef;
    vertical-align: top;
}

.details-table tr:last-child td {
    border-bottom: none;
}

.details-table .label-col {
    width: 120px;
    font-weight: 500;
    color: #6c757d;
    background-color: #fafbfc;
}

.details-table .value-col {
    color: #212529;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
}

.status-approved {
    background-color: #d4edda;
    color: #155724;
}

.status-rejected {
    background-color: #f8d7da;
    color: #721c24;
}

.status-waiting {
    background-color: #e2e3e5;
    color: #6c757d;
}

.status-inactive {
    background-color: #e2e3e5;
    color: #6c757d;
}

.document-link {
    color: #4a6cf7;
    text-decoration: none;
}

.document-link:hover {
    text-decoration: underline;
}

.no-data {
    color: #adb5bd;
    font-style: italic;
}

.back-link {
    color: #6c757d;
    text-decoration: none;
    font-size: 14px;
}

.back-link:hover {
    color: #4a6cf7;
}

.back-link i {
    margin-right: 5px;
}

.document-checkbox {
    cursor: pointer;
    background-color: #ffffff;
    border-color: #adb5bd;
}

.document-checkbox:checked {
    background-color: #4a6cf7;
    border-color: #4a6cf7;
}

.document-header .checkbox-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.version-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
}

.documents-section {
    margin-bottom: 40px;
}

.approval-section {
    background-color: #f6f8fb;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e6ebf2;
    box-shadow: 0 6px 14px rgba(31, 45, 61, 0.06);
}

.approval-flow-timeline {
    position: relative;
    padding-left: 26px;
}

.approval-flow-timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #dfe6f2;
    border-radius: 2px;
}

.approval-step {
    position: relative;
    padding: 14px 16px;
    margin-bottom: 14px;
    background: #fff;
    border: 1px solid #e6ebf2;
    border-radius: 10px;
    margin-left: 10px;
    box-shadow: 0 6px 12px rgba(31, 45, 61, 0.06);
}

.approval-step::before {
    content: '';
    position: absolute;
    left: -18px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e9ecef;
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px #e9ecef;
}

.approval-step.step-approved::before {
    background: #28a745;
    box-shadow: 0 0 0 2px #28a745;
}

.approval-step.step-rejected::before {
    background: #dc3545;
    box-shadow: 0 0 0 2px #dc3545;
}

.approval-step.step-pending::before {
    background: #ffc107;
    box-shadow: 0 0 0 2px #ffc107;
    animation: pulse 2s infinite;
}

.approval-step-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    gap: 12px;
}

.approval-step-user {
    font-weight: 600;
    color: #343a40;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.approval-step-body {
    font-size: 12px;
    color: #6c757d;
}

.approval-step-remark {
    background: #f8f9fa;
    padding: 10px 12px;
    border-radius: 8px;
    margin-top: 12px;
    border: 1px solid #edf1f7;
    font-style: italic;
}

.approval-forward-card {
    background: #ffffff;
    border: 1px solid #e6ebf2;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 14px;
    box-shadow: 0 4px 10px rgba(31, 45, 61, 0.05);
}

.approval-forward-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px 16px;
    align-items: start;
    font-size: 12px;
    color: #495057;
}

.approval-forward-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: flex-start;
}

.approval-forward-label {
    font-weight: 600;
    color: #3b3f46;
}

.approval-forward-value {
    color: #212529;
}

.approval-forward-divider {
    color: #c4c9d4;
}

.approval-layer-line {
    margin-top: 8px;
    font-size: 12px;
    color: #6c757d;
}

.approval-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 8px 16px;
}

.approval-meta-item {
    display: flex;
    gap: 6px;
}

.approval-meta-label {
    font-weight: 600;
    color: #495057;
}

.approval-doc-block {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #f7f9fc;
    border: 1px dashed #dde3ee;
}

.document-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px 14px;
    align-items: start;
}

.document-meta-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: flex-start;
}

.document-meta-label {
    font-weight: 600;
    color: #495057;
}

.document-meta-value {
    color: #212529;
}

.approval-accordion .accordion-item {
    border: 1px solid #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 12px;
    background: #fff;
}

.approval-accordion .accordion-button {
    background: linear-gradient(135deg, #696cff 0%, #5f61e6 100%);
    color: #fff;
    font-weight: 600;
    padding: 10px 14px;
    font-size: 13px;
}

.approval-accordion .accordion-button:not(.collapsed) {
    color: #fff;
    box-shadow: none;
}

.approval-accordion .accordion-button::after {
    filter: brightness(0) invert(1);
}

.approval-accordion .accordion-body {
    padding: 14px;
}

.stage-locked-message {
    padding: 50px 20px;
    text-align: center;
    color: #6c757d;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.stage-locked-message i {
    font-size: 3.5rem;
    margin-bottom: 15px;
    display: block;
    color: #adb5bd;
}

.empty-state {
    padding: 40px 20px;
    text-align: center;
    color: #6c757d;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
    color: #adb5bd;
}

.reset-history-section {
    padding: 10px;
}

.reset-history-accordion {
    border-radius: 12px;
    overflow: hidden;
}

.reset-accordion-item {
    border: 1px solid #e6ebf2;
    border-radius: 10px !important;
    margin-bottom: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(31, 45, 61, 0.06);
}

.reset-accordion-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-weight: 600;
    padding: 16px 20px;
    border: none;
    width: 100%;
}

.reset-accordion-button:not(.collapsed) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    box-shadow: none;
}

.reset-accordion-button.collapsed {
    background: #f8f9fa;
    color: #495057;
}

.reset-accordion-button::after {
    filter: brightness(0) invert(1);
}

.reset-accordion-button.collapsed::after {
    filter: none;
}

.reset-accordion-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding-right: 15px;
}

.reset-header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.reset-header-right {
    display: flex;
    align-items: center;
}

.reset-number-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.collapsed .reset-number-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.reset-date-text {
    font-size: 13px;
    opacity: 0.9;
    display: flex;
    align-items: center;
}

.reset-by-text {
    font-size: 13px;
    opacity: 0.9;
    display: flex;
    align-items: center;
}

.reset-accordion-body {
    padding: 20px;
    background: #fff;
}

.reset-details-card {
    background: #f8f9fc;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e6ebf2;
}

.reset-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.reset-info-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.reset-info-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.reset-info-icon i {
    font-size: 20px;
    color: #fff;
}

.reset-info-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.reset-info-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    font-weight: 600;
}

.reset-info-value {
    font-size: 14px;
    font-weight: 600;
    color: #1f2d3d;
}

.reset-info-subtext {
    font-size: 12px;
    color: #6c757d;
}

.reset-remark-section {
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    overflow: hidden;
}

.reset-remark-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 12px 16px;
    font-weight: 600;
    font-size: 13px;
    display: flex;
    align-items: center;
}

.reset-remark-content {
    padding: 16px;
}

/* Memo editor: keep template look and avoid Quill defaults overpowering layout */
.memo-editor-page .ql-editor {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
}

.memo-editor-page .ql-editor img {
    max-width: 100%;
    height: auto;
}

.memo-editor-page .ql-editor table,
.memo-editor-page .ql-editor td,
.memo-editor-page .ql-editor th {
    border: none;
    padding: 0;
}

/* Custom utility for stacking badges above text */
.stacked-cell-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stacked-badge {
    font-size: 0.65rem;
    padding: 0.25rem 0.4rem;
    align-self: flex-start;
    margin-bottom: 0.25rem;
}