/* ===== Documents Page ===== */

.docs-page-wrap {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 100px 24px 80px;
}

/* Header */
.docs-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 28px;
}

.docs-page-tabs {
    display: flex;
    gap: 4px;
    background: #f0f2f7;
    border-radius: 14px;
    padding: 4px;
}

.docs-page-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #5a6a7e;
    text-decoration: none;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    white-space: nowrap;
    cursor: pointer;
}

.docs-page-tab:hover {
    color: #12294B;
    text-decoration: none;
}

.docs-page-tab--active {
    background: #ffffff;
    color: #12294B;
    box-shadow: 0 1px 4px rgba(18, 41, 75, 0.1);
    pointer-events: none;
}

.docs-page-tab svg {
    flex-shrink: 0;
    opacity: 0.5;
}

.docs-page-tab--active svg {
    opacity: 1;
}

/* Add button */
.docs-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #3657CD 0%, #12294B 100%);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
    white-space: nowrap;
}

.docs-add-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Search card */
.docs-search-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(18, 41, 75, 0.04);
    border: 1px solid rgba(18, 41, 75, 0.06);
    margin-bottom: 20px;
}

.docs-search-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.docs-search-input {
    flex: 1;
    min-width: 140px;
    padding: 10px 14px;
    border: 1px solid #e0e6ee;
    border-radius: 10px;
    font-size: 14px;
    color: #12294B;
    background: #f8f9fb;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.docs-search-input:focus {
    border-color: #3657CD;
    box-shadow: 0 0 0 3px rgba(54, 87, 205, 0.08);
    background: #fff;
}

.docs-search-input::placeholder {
    color: #9aa5b4;
}

.docs-search-btn {
    padding: 10px 28px;
    background: var(--color-blue-dark, #12294B);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    white-space: nowrap;
}

.docs-search-btn:hover {
    opacity: 0.9;
}

/* Reset search button */
.docs-search-reset-btn {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: 1px solid #e0e6ee;
    background: #f8f9fb;
    color: #9aa5b4;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    flex-shrink: 0;
    padding: 0;
}

.docs-search-reset-btn:hover {
    background: #fef2f2;
    border-color: #f5c6c6;
    color: #c62828;
}

.docs-search-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Search toggle wrap (input + mode button) */
.docs-search-toggle-wrap {
    position: relative;
    flex: 1;
    min-width: 180px;
}

.docs-search-toggle-wrap .docs-search-input {
    width: 100%;
    padding-right: 42px;
}

.docs-search-mode-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid #e0e6ee;
    background: #f0f2f7;
    color: #5a6a7e;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    padding: 0;
}

.docs-search-mode-btn:hover {
    background: #e0e6ee;
    border-color: #c8d0dc;
    color: #12294B;
}

/* Status filters */
.docs-status-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f0f2f7;
}

.docs-status-chip {
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #5a6a7e;
    background: #f0f2f7;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    white-space: nowrap;
    border: 1px solid transparent;
    user-select: none;
}

.docs-status-chip:hover {
    background: #e0e6ee;
    color: #12294B;
}

.docs-status-chip--active {
    background: var(--color-blue-dark, #12294B);
    color: #ffffff;
    border-color: var(--color-blue-dark, #12294B);
}

.docs-status-chip--active:hover {
    background: var(--color-blue-dark, #12294B);
    color: #ffffff;
    opacity: 0.9;
}

/* Allocation checkbox */
.docs-allocation-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    font-size: 13px;
    color: #5a6a7e;
}

.docs-allocation-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--color-blue-dark, #12294B);
    cursor: pointer;
}

.docs-allocation-row label {
    cursor: pointer;
}

/* Group / User filter chips */
.docs-group-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.docs-group-chip {
    padding: 6px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #e0e6ee;
    background: #f8f9fb;
    color: #3a4a5e;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    white-space: nowrap;
}

.docs-group-chip:hover {
    border-color: var(--color-blue-dark, #3657CD);
    color: var(--color-blue-dark, #3657CD);
}

.docs-group-chip--active {
    background: var(--color-blue-dark, #12294B);
    color: #ffffff;
    border-color: var(--color-blue-dark, #12294B);
}

.docs-group-chip--active:hover {
    background: var(--color-blue-dark, #12294B);
    color: #ffffff;
    border-color: var(--color-blue-dark, #12294B);
    opacity: 0.9;
}

.docs-user-chip {
    padding: 6px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #e8dfb0;
    background: #fdf8e8;
    color: #6b5e2d;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.docs-user-chip:hover {
    background: #f5edd0;
    border-color: #c9b85c;
}

.docs-user-chip--active {
    background: var(--color-blue-dark, #12294B);
    color: #ffffff;
    border-color: var(--color-blue-dark, #12294B);
}

.docs-user-chip--active:hover {
    background: var(--color-blue-dark, #12294B);
    color: #ffffff;
    border-color: var(--color-blue-dark, #12294B);
    opacity: 0.9;
}

/* Table */
.docs-table-card {
    background: #ffffff;
    border-radius: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 2px 8px rgba(18, 41, 75, 0.04);
    border: 1px solid rgba(18, 41, 75, 0.06);
    margin-bottom: 24px;
}

.docs-table {
    width: 100%;
    min-width: 800px;
    border-collapse: separate;
    border-spacing: 0;
}

.docs-table th {
    background: #f5f7fa;
    padding: 14px 20px;
    font-weight: 600;
    font-size: 13px;
    color: #12294B;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 2px solid #e0e6ee;
    text-align: left;
    white-space: nowrap;
}

.docs-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
}

.docs-table th.sortable:hover {
    color: #3657CD;
}

.docs-table td {
    padding: 14px 20px;
    font-size: 14px;
    color: #3a4a5e;
    border-bottom: 1px solid #f0f2f7;
    vertical-align: top;
}

.docs-table tbody tr {
    transition: background 0.15s;
}

.docs-table tbody tr:hover {
    background: #f8f9fb;
}

.docs-table tbody tr:last-child td {
    border-bottom: none;
}

/* Document name link */
.docs-doc-link {
    color: var(--color-blue-dark, #12294B);
    text-decoration: none;
    font-weight: 500;
    word-wrap: normal;
    transition: color 0.2s;
}

.docs-doc-link:hover {
    color: #3657CD;
    text-decoration: underline;
}

/* Executor info */
.docs-executor {
    font-size: 12px;
    color: #8a95a5;
    margin-top: 4px;
}

.docs-executor--warning {
    color: #e67e22;
    cursor: pointer;
    text-decoration: underline dotted;
}

/* Status badge */
.docs-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.docs-status--signed {
    background: #e8f5e9;
    color: #2e7d32;
}

.docs-status--awaiting {
    background: #fff3e0;
    color: #e65100;
}

.docs-status--approval {
    background: #e3f2fd;
    color: #1565c0;
}

.docs-status--new {
    background: #f0f2f7;
    color: #5a6a7e;
}

.docs-status--not_signed {
    background: #ede7f6;
    color: #4527a0;
}

.docs-status--deleted {
    background: #fce4ec;
    color: #c62828;
}

.docs-status--working {
    background: #e0f2f1;
    color: #00695c;
}

.docs-status--fulfilled {
    background: #e8f5e9;
    color: #1b5e20;
}

.docs-status--canceled {
    background: #fce4ec;
    color: #b71c1c;
}

.docs-status--trial {
    background: #fff8e1;
    color: #f57f17;
}

/* Status dropdown trigger */
.docs-status-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    cursor: pointer;
    color: #8a95a5;
    transition: background 0.2s, color 0.2s;
}

.docs-status-trigger:hover {
    background: #f0f2f7;
    color: #12294B;
}

/* Status dropdown menu */
.docs-status-menu {
    position: absolute;
    display: none;
    background: #ffffff;
    border: 1px solid rgba(18, 41, 75, 0.08);
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(18, 41, 75, 0.1);
    left: 0;
    top: 28px;
    z-index: 100;
    padding: 4px;
    min-width: 200px;
}

.docs-status-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #3a4a5e;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.docs-status-menu-item:hover {
    background: #f0f2f7;
    color: #12294B;
}

.docs-menu-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Action links */
.docs-action-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: opacity 0.2s;
    white-space: nowrap;
}

.docs-action-link:hover {
    opacity: 0.8;
}

.docs-action-link svg {
    flex-shrink: 0;
}

.docs-action-link--download {
    color: var(--color-blue-dark, #12294B);
}

.docs-action-link--delete {
    color: #d32f2f;
    cursor: pointer;
}

/* Phone column */
.docs-phone {
    font-size: 13px;
    color: #2e7d32;
    white-space: nowrap;
}

.docs-phone-request {
    font-size: 12px;
    color: #3657CD;
    cursor: pointer;
    text-decoration: underline dashed;
    transition: color 0.2s;
}

.docs-phone-request:hover {
    color: #12294B;
}

/* ===== Mobile cards (redesigned) ===== */
.docs-mobile-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.docs-mobile-card {
    background: #fff;
    border-radius: 14px;
    border: 1px solid rgba(18, 41, 75, 0.06);
    box-shadow: 0 2px 8px rgba(18, 41, 75, 0.04);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Top row: status + date */
.docs-mcard-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.docs-mcard-date {
    font-size: 12px;
    color: #9aa5b4;
    font-weight: 500;
}

/* Title */
.docs-mcard-title {
    margin-bottom: 12px;
}

.docs-mcard-link {
    font-size: 15px;
    font-weight: 600;
    color: #12294B;
    text-decoration: none;
    line-height: 1.35;
    display: block;
}

.docs-mcard-link:hover {
    color: #3657CD;
}

/* Sides */
.docs-mcard-sides {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 0;
    border-top: 1px solid #f0f2f7;
    border-bottom: 1px solid #f0f2f7;
    margin-bottom: 10px;
}

.docs-mcard-side {
    display: flex;
    align-items: center;
    gap: 8px;
}

.docs-mcard-side-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f0f2f7;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #5a6a7e;
}

.docs-mcard-side-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.docs-mcard-side-name {
    font-size: 13px;
    font-weight: 600;
    color: #12294B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.docs-mcard-side-phone {
    font-size: 12px;
    color: #5a6a7e;
    line-height: 1.3;
}

/* Action buttons */
.docs-mcard-actions {
    display: flex;
    gap: 8px;
}

.docs-mcard-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
    border: none;
}

.docs-mcard-btn--download {
    background: #f0f2f7;
    color: #5a6a7e;
}

.docs-mcard-btn--download:hover {
    background: #e0e6ee;
    color: #12294B;
}

.docs-mcard-btn--delete {
    background: #fef2f2;
    color: #d32f2f;
}

.docs-mcard-btn--delete:hover {
    background: #fce4ec;
}

/* Pagination bar */
.docs-pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    gap: 16px;
    flex-wrap: wrap;
}

/* Per-page selector */
.docs-per-page {
    display: flex;
    align-items: center;
    gap: 4px;
}

.docs-per-page-label {
    font-size: 13px;
    color: #9aa5b4;
    margin-right: 4px;
    white-space: nowrap;
}

.docs-per-page-btn {
    padding: 5px 10px;
    border-radius: 8px;
    border: 1px solid #e0e6ee;
    background: #fff;
    font-size: 13px;
    font-weight: 500;
    color: #5a6a7e;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.docs-per-page-btn:hover {
    background: #f0f2f7;
    color: #12294B;
}

.docs-per-page-btn--active {
    background: #12294B;
    color: #fff;
    border-color: #12294B;
}

.docs-per-page-btn--active:hover {
    background: #1a3766;
    border-color: #1a3766;
    color: #fff;
}

/* Pagination */
.docs-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.docs-pagination-input {
    width: 64px;
    text-align: center;
    padding: 8px 12px;
    border: 1px solid #e0e6ee;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #12294B;
    background: #fff;
    outline: none;
    transition: border-color 0.2s;
}

.docs-pagination-input:focus {
    border-color: #3657CD;
}

.docs-pagination-text {
    font-size: 14px;
    color: #5a6a7e;
}

.docs-pagination-link {
    font-size: 14px;
    font-weight: 600;
    color: #3657CD;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s;
}

.docs-pagination-link:hover {
    color: #12294B;
}

/* Tooltip override */
.docs-executor-tooltip {
    position: relative;
    display: inline;
}

.docs-executor-tooltip .tooltip-text {
    font-size: 12px;
}

/* ===== Modals ===== */
.docs-modal {
    z-index: 9999 !important;
}

.docs-modal .modal-dialog {
    max-width: 480px;
}

.docs-modal .modal-content {
    border: none;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(18, 41, 75, 0.12);
    padding: 32px;
    position: relative;
}

.docs-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: none;
    background: #f0f2f7;
    color: #5a6a7e;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.docs-modal-close:hover {
    background: #e0e6ee;
    color: #12294B;
}

.docs-modal-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.docs-modal-icon--danger {
    background: #fce4ec;
    color: #d32f2f;
}

.docs-modal-icon--info {
    background: #e3f2fd;
    color: #1565c0;
}

.docs-modal-icon--warning {
    background: #fff8e1;
    color: #f9a825;
}

.docs-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #12294B;
    text-align: center;
    margin-bottom: 16px;
}

.docs-modal-text {
    font-size: 14px;
    color: #5a6a7e;
    line-height: 1.6;
    margin-bottom: 24px;
}

.docs-modal-actions {
    display: flex;
    gap: 12px;
}

.docs-modal-btn {
    flex: 1;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
    text-align: center;
}

.docs-modal-btn:hover {
    transform: translateY(-1px);
}

.docs-modal-btn--danger {
    background: #d32f2f;
    color: #ffffff;
}

.docs-modal-btn--danger:hover {
    opacity: 0.9;
}

.docs-modal-btn--primary {
    background: linear-gradient(135deg, #3657CD 0%, #12294B 100%);
    color: #ffffff;
}

.docs-modal-btn--primary:hover {
    opacity: 0.9;
}

.docs-modal-btn--outline {
    background: #ffffff;
    color: #5a6a7e;
    border: 1px solid #e0e6ee;
}

.docs-modal-btn--outline:hover {
    background: #f8f9fb;
    color: #12294B;
}

.docs-modal-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.docs-modal-btn--full {
    width: 100%;
}

.docs-modal-field {
    text-align: left;
    width: 100%;
    margin-bottom: 16px;
}

.docs-modal-desc--center {
    text-align: center;
}

.docs-modal-hint {
    font-size: 12px;
    color: #5a6a7e;
    margin-top: 2px;
}

.docs-modal-side-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.docs-modal-btn--sm {
    flex: unset;
    padding: 8px 16px;
    font-size: 13px;
    margin-top: 10px;
}

.docs-modal-link {
    color: #3657CD;
    text-decoration: none;
}

.docs-modal-link:hover {
    text-decoration: underline;
}

/* Modal checkbox items */
.docs-modal-check-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: #3a4a5e;
    line-height: 1.5;
    cursor: pointer;
}

.docs-modal-checkbox {
    width: 18px;
    height: 18px;
    min-width: 18px;
    accent-color: var(--color-blue-dark, #12294B);
    cursor: pointer;
    margin-top: 2px;
}

/* Modal form elements */
.docs-modal-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e0e6ee;
    border-radius: 10px;
    font-size: 14px;
    color: #12294B;
    background: #f8f9fb;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.docs-modal-input:focus {
    border-color: #3657CD;
    box-shadow: 0 0 0 3px rgba(54, 87, 205, 0.08);
    background: #fff;
}

.docs-modal-label {
    font-size: 13px;
    font-weight: 600;
    color: #3a4a5e;
    margin-bottom: 6px;
    display: block;
}

/* Modal select (dropdown arrow) */
select.docs-modal-input {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 36px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235a6a7e' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    cursor: pointer;
}

/* Select2 inside modal — match modal styles */
.docs-modal .select2-container--default .select2-selection--single {
    height: 42px;
    padding: 6px 14px;
    border: 1px solid #e0e6ee;
    border-radius: 10px;
    background: #f8f9fb;
    font-size: 14px;
}
.docs-modal .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #12294B;
    line-height: 28px;
    padding-left: 0;
}
.docs-modal .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px;
    right: 8px;
}
.docs-modal .select2-container--default.select2-container--focus .select2-selection--single,
.docs-modal .select2-container--default.select2-container--open .select2-selection--single {
    border-color: #3657CD;
    box-shadow: 0 0 0 3px rgba(54, 87, 205, 0.08);
    background: #fff;
}

/* Add doc modal file upload */
.docs-file-upload-area {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 2px dashed #e0e6ee;
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    margin-top: 12px;
}

.docs-file-upload-area:hover {
    border-color: #3657CD;
    background: rgba(54, 87, 205, 0.03);
}

.docs-file-upload-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #e3f2fd;
    color: #1565c0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.docs-file-upload-text {
    font-size: 13px;
    color: #5a6a7e;
}

.docs-file-name {
    font-size: 13px;
    color: #3657CD;
    word-break: break-all;
    margin-top: 6px;
}

/* Side blocks in add modal */
.docs-side-block {
    padding: 14px 16px;
    border: 1px solid #e0e6ee;
    border-radius: 12px;
    background: #f8f9fb;
}

.docs-side-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    background: transparent;
}

.docs-side-remove:hover {
    background: #fce4ec;
}

/* Modal checkbox */
.docs-modal-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}

.docs-modal-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--color-blue-dark, #12294B);
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
}

.docs-modal-check label {
    font-size: 13px;
    color: #5a6a7e;
    cursor: pointer;
    line-height: 1.4;
}

/* Modal header row (icon + title) */
.docs-modal-header-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.docs-modal-header-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.docs-modal-header-icon--info {
    background: #f0f4ff;
}

.docs-modal-header-icon--warning {
    background: #fff3e0;
}

.docs-modal-header-icon--danger {
    background: #fce4ec;
}

.docs-modal-header-title {
    font-size: 18px;
    font-weight: 700;
    color: #12294B;
    margin: 0;
}

.docs-modal-desc {
    font-size: 14px;
    color: #5a6a7e;
    margin: 0 0 24px;
    line-height: 1.6;
}

.docs-modal-desc a {
    color: #3657CD;
    text-decoration: underline;
}

/* Revoke modal sections */
.docs-modal-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 16px 0;
}

.docs-modal-otp-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.docs-modal-otp-title {
    font-size: 16px;
    font-weight: 600;
    color: #12294B;
}

.docs-modal-otp-hint {
    text-align: center;
    font-size: 13px;
    color: #5a6a7e;
    margin-top: 4px;
}

.docs-modal-otp-hint .text-danger {
    color: #d32f2f;
    font-weight: 600;
}

.docs-modal-otp-input {
    width: 120px;
    font-size: 1.3rem;
    text-align: center;
    letter-spacing: 6px;
}

.docs-modal-code-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
    width: 100%;
}

.docs-modal-countdown {
    text-align: center;
    font-size: 13px;
    color: #5a6a7e;
}

.docs-modal-submit-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
    gap: 8px;
    width: 100%;
}

/* Side block header row */
.docs-side-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.docs-side-label {
    font-size: 13px;
    font-weight: 600;
    color: #3a4a5e;
}

/* Form field group */
.docs-modal-field {
    margin-bottom: 16px;
}

.docs-modal-field:last-child {
    margin-bottom: 0;
}

/* File upload checkboxes (template add modal) */
.docs-modal-legal-note {
    font-size: 12px;
    color: #8a96a8;
    text-align: center;
    margin: 8px 0 0;
    line-height: 1.4;
}

/* File upload area for template modal */
.docs-tpl-upload-area {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1.5px dashed #d0d8e4;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.docs-tpl-upload-area:hover {
    border-color: #3657CD;
    background: #f0f4ff;
}

.docs-tpl-upload-text {
    font-size: 14px;
    color: #5a6a7e;
}

.docs-tpl-upload-hint {
    font-size: 11px;
    color: #a0aab8;
    margin-top: 4px;
}

/* File attached state */
.docs-tpl-file-attached {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(54, 87, 205, 0.04);
    border: 1.5px solid rgba(54, 87, 205, 0.2);
    border-radius: 10px;
}

.docs-tpl-file-info {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.docs-tpl-file-name-text {
    font-size: 13px;
    font-weight: 600;
    color: #12294B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.docs-tpl-file-change {
    background: none;
    border: none;
    color: #8a96a8;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    flex-shrink: 0;
    transition: color 0.15s, background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.docs-tpl-file-change:hover {
    color: #3657CD;
    background: rgba(54, 87, 205, 0.08);
}

/* Divider line */
.docs-modal-divider {
    border-top: 1px solid #f0f2f7;
    padding-top: 16px;
    margin-bottom: 16px;
}

/* Docs table/cards visibility toggle at 768px */
@media (max-width: 768px) {
    .docs-hide-mobile {
        display: none !important;
    }
}
@media (min-width: 769px) {
    .docs-hide-desktop {
        display: none !important;
    }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .docs-page-wrap {
        padding: 90px 16px 48px;
    }

    .docs-page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .docs-page-tabs {
        width: 100%;
    }

    .docs-page-tab {
        flex: 1;
        justify-content: center;
        padding: 10px 12px;
        font-size: 13px;
    }

    .docs-add-btn {
        width: 100%;
        justify-content: center;
    }

    .docs-search-row {
        flex-direction: column;
    }

    .docs-search-input {
        min-width: unset;
    }

    .docs-search-actions {
        display: flex;
        gap: 8px;
    }

    .docs-search-actions .docs-search-btn {
        flex: 1;
    }

    .docs-status-filters {
        gap: 6px;
    }

    .docs-status-chip {
        padding: 5px 10px;
        font-size: 12px;
    }

    .docs-modal .modal-content {
        padding: 24px 20px;
        margin: 16px;
    }
}

@media (max-width: 400px) {
    .docs-page-tab {
        padding: 8px 10px;
        font-size: 12px;
        gap: 5px;
    }

    .docs-page-tab svg {
        width: 15px;
        height: 15px;
    }
}

/* === Tier Selection Cards (Phase 2 / redesign) === */

/* Label for the tier group */
.tier-group-label {
  font-size: 12px;
  font-weight: 600;
  color: #8a96a8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

/* Vertical stack — better fit for a 480px modal */
.tier-cards-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 0;
}

/* Each card is a horizontal row: [radio indicator] [name + duration] [price badge] */
.tier-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f8f9fb;
  border: 1.5px solid #e0e6ee;
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
  min-height: 0;
  text-align: left;
  position: relative;
}

.tier-card:hover:not(.tier-card--disabled) {
  border-color: #3657CD;
  background: #ffffff;
}

.tier-card--selected {
  border: 2px solid #3657CD;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(54, 87, 205, 0.10);
}

.tier-card--disabled {
  opacity: 0.38;
  cursor: not-allowed;
  pointer-events: none;
}

/* Radio dot */
.tier-card__radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #c8d0da;
  flex-shrink: 0;
  transition: border-color 0.18s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tier-card__radio::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3657CD;
  opacity: 0;
  transition: opacity 0.15s;
}

.tier-card--selected .tier-card__radio {
  border-color: #3657CD;
}

.tier-card--selected .tier-card__radio::after {
  opacity: 1;
}

/* Text group: name + duration */
.tier-card__info {
  flex: 1;
  min-width: 0;
}

.tier-card__name {
  font-size: 14px;
  font-weight: 700;
  color: #12294B;
  line-height: 1.2;
}

.tier-card__duration {
  font-size: 12px;
  font-weight: 400;
  color: #8a96a8;
  margin-top: 2px;
}

/* Price badge — right side */
.tier-card__price {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  color: #12294B;
  background: #f0f2f7;
  border-radius: 8px;
  padding: 4px 10px;
  white-space: nowrap;
  transition: background 0.18s, color 0.18s;
}

.tier-card--selected .tier-card__price {
  background: rgba(54, 87, 205, 0.10);
  color: #3657CD;
}

/* Free tier badge */
.tier-card__price--free {
  background: rgba(43, 172, 32, 0.10);
  color: #186d10;
  font-size: 13px;
  font-weight: 700;
}

.tier-card--selected .tier-card__price--free {
  background: rgba(43, 172, 32, 0.15);
  color: #0D5A00;
}

/* Balance row */
.tier-balance-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding: 10px 12px;
  background: #f8f9fb;
  border: 1px solid #e0e6ee;
  border-radius: 10px;
}

.tier-balance-row__label {
  font-size: 13px;
  font-weight: 400;
  color: #5a6a7e;
}

.tier-balance-row__value {
  font-size: 13px;
  font-weight: 700;
  color: #12294B;
}

.tier-balance-error {
  font-size: 13px;
  color: #d32f2f;
  margin-top: 8px;
  display: none;
  padding: 8px 12px;
  background: rgba(211, 47, 47, 0.06);
  border-radius: 8px;
}

.tier-balance-error a {
  color: #d32f2f;
  font-weight: 600;
  text-decoration: underline;
}

/* Tier cards on very small screens — no layout change needed (already vertical) */
@media (max-width: 400px) {
  .tier-card {
    padding: 10px 12px;
    gap: 10px;
  }
  .tier-card__name {
    font-size: 13px;
  }
  .tier-card__duration {
    font-size: 11px;
  }
  .tier-card__price {
    font-size: 12px;
    padding: 3px 8px;
  }
}

/* === Moderation Countdown Timer (Phase 2) === */
.tpl-moderation-timer {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.tpl-moderation-timer--green {
  background: rgba(43, 172, 32, 0.1);
  color: #0D5A00;
}

.tpl-moderation-timer--orange {
  background: rgba(229, 148, 25, 0.12);
  color: #a06800;
}

.tpl-moderation-timer--red {
  background: rgba(211, 47, 47, 0.1);
  color: #d32f2f;
}

/* === Tier schedule hint (CSS tooltip) === */

.tier-schedule-hint {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: .78rem;
    color: #8a96a8;
    margin-top: 6px;
    line-height: 1.4;
}

.tier-hint-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    color: #8a96a8;
    cursor: pointer;
    transition: color 0.15s;
}

.tier-hint-trigger:hover,
.tier-hint-trigger:focus {
    color: #3657CD;
    outline: none;
}

.tier-hint-popup {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: 280px;
    padding: 10px 12px;
    background: #1e293b;
    color: #fff;
    font-size: .76rem;
    line-height: 1.45;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
    z-index: 1060;
    pointer-events: none;
}

.tier-hint-popup::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1e293b;
}

.tier-hint-trigger:hover .tier-hint-popup,
.tier-hint-trigger:focus .tier-hint-popup {
    display: block;
}

/* === Surcharge Alerts (Phase 4 / redesign) === */

.surcharge-alert {
    font-size: 13px;
    line-height: 1.55;
    border-radius: 10px;
    padding: 0;
    margin-top: 10px;
    margin-bottom: 0;
    border: none;
    background: transparent;
    color: inherit;
}

/* Default state: grey info box — "countdown starts next working day" */
.surcharge-alert--info {
    background: #f0f2f7;
    border-radius: 10px;
    padding: 10px 14px;
    color: #5a6a7e;
}

.surcharge-alert--info .surcharge-alert__icon {
    color: #8a96a8;
}

/* Action row for the "pay now" option */
.surcharge-alert__main-text {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.surcharge-alert__main-text svg {
    flex-shrink: 0;
    margin-top: 1px;
}

.surcharge-alert__default-msg {
    font-size: 13px;
    color: #5a6a7e;
    line-height: 1.5;
}

.surcharge-alert__default-msg strong {
    color: #12294B;
    font-weight: 600;
}

/* Optional upgrade row */
.surcharge-alert__upgrade {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e0e6ee;
}

.surcharge-alert__upgrade-text {
    font-size: 12px;
    color: #8a96a8;
    flex: 1;
    min-width: 0;
}

.surcharge-alert__upgrade-text strong {
    color: #5a6a7e;
    font-weight: 600;
}

.surcharge-alert__reason {
    font-size: 11px;
    color: #a0aab8;
    margin-top: 1px;
}

.surcharge-alert__reason:empty {
    display: none;
}

.surcharge-alert__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.surcharge-alert__actions .btn {
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 8px;
    white-space: nowrap;
}

.surcharge-alert__no-balance {
    font-size: 11px;
    color: #d32f2f;
}

.surcharge-alert__actions .btn-pay {
    background: #12294B;
    color: #ffffff;
    border: none;
}

.surcharge-alert__actions .btn-pay:hover {
    background: #0e1f38;
    color: #ffffff;
}

/* Confirmed state */
.surcharge-alert--confirmed-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(43, 172, 32, 0.08);
    border-radius: 10px;
}

.surcharge-alert--confirmed {
    font-size: 13px;
    color: #186d10;
    font-weight: 600;
    flex: 1;
}

.surcharge-alert__cancel {
    background: none;
    border: none;
    color: #8a96a8;
    font-size: 12px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    flex-shrink: 0;
    transition: color 0.15s, background 0.15s;
}

.surcharge-alert__cancel:hover {
    color: #d32f2f;
    background: rgba(211, 47, 47, 0.06);
}

.surcharge-alert__actions .btn-pay:disabled,
.surcharge-alert__actions .btn-pay--disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Batch limit alert */
#batch-limit-alert.surcharge-alert {
    background: #fff8e1;
    padding: 10px 14px;
    color: #7a5d00;
    border-radius: 10px;
}

/* Dual price annotation inside tier card price */
.tier-card__price small {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: #5a6a7e;
    margin-top: 2px;
}

/* === Step 2: Confirmation === */
.confirm-step-summary {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: #f8f9fb;
    border: 1px solid #e0e6ee;
    border-radius: 12px;
    padding: 4px 0;
    margin-bottom: 12px;
}

.confirm-step-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 8px 14px;
    gap: 12px;
}

.confirm-step-row + .confirm-step-row {
    border-top: 1px solid #eef1f5;
}

.confirm-step-label {
    font-size: 13px;
    color: #8a96a8;
    flex-shrink: 0;
}

.confirm-step-value {
    font-size: 13px;
    font-weight: 600;
    color: #12294B;
    text-align: right;
    word-break: break-all;
    min-width: 0;
}

.confirm-step-deadline {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(54, 87, 205, 0.05);
    border: 1.5px solid rgba(54, 87, 205, 0.15);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 16px;
}

.confirm-step-deadline-icon {
    flex-shrink: 0;
}

.confirm-step-deadline-label {
    font-size: 12px;
    color: #5a6a7e;
}

.confirm-step-deadline-value {
    font-size: 16px;
    font-weight: 700;
    color: #12294B;
    margin-top: 2px;
}

.confirm-step-actions {
    display: flex;
    gap: 10px;
}

.confirm-step-actions .docs-modal-btn {
    flex: 1;
}
