/* ===== Package Detail Form Styles (scoped via sw-pdf prefix) ===== */

.sw-pdf-info-container {
    background: var(--bs-gray-50);
    border: 1px solid var(--bs-gray-200);
    border-radius: var(--px-8);
    padding: var(--px-12);
    margin-bottom: 16px;
}

.sw-pdf-info-container-last {
    background: var(--bs-gray-50);
    border: 1px solid var(--bs-gray-200);
    border-radius: var(--px-8);
    padding: var(--px-12);
    margin-bottom: var(--px-16);
}

.sw-pdf-section-title {
    font: normal normal 600 var(--s-12);
    color: var(--bs-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--px-8);
}

.sw-pdf-info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--px-8);
}

.sw-pdf-info-label {
    font: normal normal 400 var(--s-11);
    color: var(--bs-gray-400);
    margin-bottom: 2px;
}

.sw-pdf-info-value-bold {
    font: normal normal 500 var(--s-13);
    color: var(--text-color);
}

.sw-pdf-info-value {
    font: normal normal 500 var(--s-13);
    color: var(--text-color);
}

.sw-pdf-info-row-mt-6 {
    margin-top: var(--px-6);
}

.sw-pdf-info-row-mt-4 {
    margin-top: var(--px-4);
}

.sw-pdf-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--px-12);
}

.sw-pdf-form-label {
    display: block;
    font: normal normal 500 var(--s-12);
    color: #555;
    margin-bottom: var(--px-4);
}

.sw-pdf-input {
    width: 100%;
    padding: var(--px-8) var(--px-12);
    font: normal normal 400 var(--s-12);
    color: var(--text-color);
    border: 1px solid var(--bs-gray-200);
    border-radius: var(--px-6);
    outline: none;
    box-sizing: border-box;
    background-color: #ffffff;
}

/* ===== Daily Rate Drawer Table Sticky Column Styles ===== */

#sw_daily_rate_drawer .sw-drd-table thead tr:first-child th {
    position: sticky !important;
    top: 0px !important;
    background-color: #f9fafb !important;
    height: 32px !important;
    box-sizing: border-box !important;
    padding: 6px 8px !important;
}

#sw_daily_rate_drawer .sw-drd-table thead tr#drd_sub_head th {
    position: sticky !important;
    top: 32px !important;
    z-index: 18 !important;
    background-color: #f9fafb !important;
}

.sw-drd-th-date {
    position: sticky !important;
    left: 0px !important;
    top: 0px !important;
    z-index: 120 !important;
    background-color: #f3f4f6 !important;
    width: 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;
    box-sizing: border-box !important;
    border-bottom: none !important;
}

.sw-drd-th-date-sub {
    position: sticky !important;
    left: 0px !important;
    top: 32px !important;
    z-index: 120 !important;
    background-color: #f3f4f6 !important;
    width: 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;
    box-sizing: border-box !important;
    border-top: none !important;
    border-bottom: 2px solid #d1d5db !important;
}

.sw-drd-th-weekday {
    position: sticky !important;
    left: 120px !important;
    top: 0px !important;
    z-index: 100 !important;
    background-color: #f9fafb !important;
    width: 80px !important;
    min-width: 80px !important;
    max-width: 80px !important;
    box-sizing: border-box !important;
}

.sw-drd-th-type {
    position: sticky !important;
    left: 120px !important;
    top: 0px !important;
    z-index: 120 !important;
    background-color: #f9fafb !important;
    width: 60px !important;
    min-width: 60px !important;
    max-width: 60px !important;
    box-sizing: border-box !important;
    border-right: 2px solid #cbd5e1 !important;
    border-bottom: none !important;
}

.sw-drd-th-type-sub {
    position: sticky !important;
    left: 120px !important;
    top: 32px !important;
    z-index: 120 !important;
    background-color: #f9fafb !important;
    width: 60px !important;
    min-width: 60px !important;
    max-width: 60px !important;
    box-sizing: border-box !important;
    border-right: 2px solid #cbd5e1 !important;
    border-top: none !important;
    border-bottom: 2px solid #d1d5db !important;
}

.sw-drd-td-sticky-1 {
    position: sticky !important;
    left: 0px !important;
    z-index: 10 !important;
    background-color: #ffffff !important;
    width: 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;
    box-sizing: border-box !important;
}

.sw-tr-sun .sw-drd-td-sticky-1 {
    background-color: rgb(254 242 242) !important;
}

.sw-drd-td-sticky-2 {
    position: sticky !important;
    left: 120px !important;
    z-index: 10 !important;
    background-color: #ffffff !important;
    width: 80px !important;
    min-width: 80px !important;
    max-width: 80px !important;
    box-sizing: border-box !important;
}

.sw-tr-sun .sw-drd-td-sticky-2 {
    background-color: rgb(254 242 242) !important;
}

.sw-drd-td-sticky-3 {
    position: sticky !important;
    left: 120px !important;
    z-index: 10 !important;
    background-color: #ffffff !important;
    width: 60px !important;
    min-width: 60px !important;
    max-width: 60px !important;
    box-sizing: border-box !important;
    border-right: 2px solid #f3f4f6 !important;
}

.sw-tr-sun .sw-drd-td-sticky-3 {
    background-color: rgb(254 242 242) !important;
    border-right: 2px solid #fee2e2 !important;
}

/* ===== Daily Rate Drawer Mobile Responsive Fixes ===== */
@media (max-width: 768px) {
    .sw-drd-panel {
        right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        top: 48px !important;
        height: calc(100vh - 112px) !important;
        height: calc(100svh - 112px) !important;
        height: calc(100dvh - 112px) !important;
    }
}


/* ===== Transaction Definition Form Styles (scoped via sw-trn prefix) ===== */
.sw-trn-form {
    padding: 8px 4px;
}

.sw-trn-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.sw-trn-field-label {
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}

.sw-trn-input,
.sw-trn-select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    font-size: 13px;
    color: #334155;
    background: #fff;
    outline: none;
    box-sizing: border-box;
    transition: all 0.2s ease-in-out;
}

.sw-trn-input::placeholder {
    color: #94a3b8;
}

.sw-trn-input:focus,
.sw-trn-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.sw-trn-input[readonly],
.sw-trn-select[readonly],
.sw-trn-input[disabled],
.sw-trn-select[disabled] {
    background-color: #f1f5f9 !important;
    color: #64748b !important;
    border-color: #cbd5e1 !important;
    cursor: not-allowed;
}

.sw-trn-custom-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #334155;
    cursor: pointer;
    user-select: none;
}

.sw-trn-custom-checkbox input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border: 1.5px solid #cbd5e1;
    border-radius: 6px;
    outline: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    transition: all 0.2s ease-in-out;
    position: relative;
    flex-shrink: 0;
    visibility: visible;
    margin: 0;
}

.sw-trn-custom-checkbox input[type="checkbox"]:checked {
    border-color: #72bb38;
    background-color: #f7fee7;
}

.sw-trn-custom-checkbox input[type="checkbox"]:checked::after {
    content: "";
    display: block;
    width: 12px;
    height: 12px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2372bb38' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

.sw-trn-fieldset {
    position: relative;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px 16px 16px 16px;
    margin-top: 24px;
    margin-bottom: 20px;
}

.sw-trn-legend {
    position: absolute;
    top: -10px;
    left: 12px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    background-color: #fff;
    padding: 0 6px;
    line-height: 20px;
}

.sw-trn-grid-fields {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px 12px;
}

.sw-trn-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 8px;
}

.sw-trn-checkbox-new {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.sw-trn-checkbox-new input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
    pointer-events: none;
}

.sw-trn-checkbox-new .sw-trn-box-new {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background-color: #fff;
    transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.sw-trn-checkbox-new:hover input[type="checkbox"]:not(:checked)+.sw-trn-box-new {
    border-color: #9ca3af;
}

.sw-trn-checkbox-new input[type="checkbox"]:checked+.sw-trn-box-new {
    background-color: #f0fdf4;
    border-color: #16a34a;
}

.sw-trn-checkbox-new .sw-trn-icon-new {
    display: none;
    width: 12px;
    height: 12px;
    color: #15803d;
}

.sw-trn-checkbox-new input[type="checkbox"]:checked+.sw-trn-box-new .sw-trn-icon-new {
    display: block;
}

.sw-trn-checkbox-new .sw-trn-text-new {
    font-size: 14px;
    color: #374151;
}

.sw-trn-field-wrapper {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sw-trn-field-wrapper label {
    font-size: 12px;
    font-weight: 500;
    color: #475569;
}

/* ===== Update Rate Level CSS Classes ===== */
.sw-rl-container {
    padding: 4px 0;
}

.sw-rl-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.sw-rl-field-180 {
    flex: 1;
    min-width: 180px;
}

.sw-rl-field-120 {
    flex: 1;
    min-width: 120px;
}

.sw-rl-label {
    display: block;
    font-size: 12px;
    color: #555;
    margin-bottom: 4px;
    font-weight: 500;
}

.sw-rl-input {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
    background-color: #ffffff;
}

/* ===== Edit Package CSS Classes ===== */
.sw-pkg-field-150 {
    flex: 1;
    min-width: 150px;
}

.sw-pkg-field-200 {
    flex: 1;
    min-width: 200px;
}

.sw-pkg-input-readonly {
    background: #f0f0f0 !important;
    cursor: not-allowed;
}

.sw-pkg-textarea {
    resize: vertical;
}

.sw-pkg-flex-center {
    display: flex;
    align-items: center;
}

.sw-pkg-grid-full {
    grid-template-columns: 1fr;
    display: grid;
    align-items: center;
    gap: 16px;
    padding-top: 4px;
}

/* ===== New Rate Type Modal Styles (scoped via sw-rtc-modal prefix) ===== */
.sw-rtc-modal-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 16px;
}

.sw-rtc-modal-card {
    width: 100%;
    max-width: 28rem;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.sw-rtc-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.sw-rtc-modal-title {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.sw-rtc-modal-body {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sw-rtc-modal-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 4px;
}

.sw-rtc-modal-input {
    width: 100%;
    padding: 8px 14px;
    font-size: 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    outline: none;
    background: white;
    transition: all 0.2s;
    box-sizing: border-box;
}

.sw-rtc-modal-input:focus {
    border-color: var(--bs-main);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.sw-rtc-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.sw-rtc-modal-btn-cancel {
    padding: 8px 16px;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: background 0.2s;
}

.sw-rtc-modal-btn-cancel:hover {
    background-color: #f9fafb;
}

.sw-rtc-modal-btn-save {
    padding: 8px 20px;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
    border: none;
    background: var(--bs-main);
    color: white;
    cursor: pointer;
}

.sw-rtc-modal-btn-save:disabled {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
    box-shadow: none;
}

/* ===== New Rate Period sw-rtc- styles ===== */
.sw-rtc-modal-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 16px;
}

.sw-rtc-modal {
    width: 100%;
    max-width: 28rem;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.sw-rtc-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.sw-rtc-title {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.sw-rtc-body {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sw-rtc-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 4px;
}

.sw-rtc-input {
    width: 100%;
    padding: 8px 14px;
    font-size: 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    outline: none;
    background: white;
    transition: all 0.2s;
    box-sizing: border-box;
}

.sw-rtc-textarea {
    width: 100%;
    padding: 8px 12px;
    font-size: 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    outline: none;
    background: white;
    transition: all 0.2s;
    resize: vertical;
    box-sizing: border-box;
}

.sw-rtc-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.sw-rtc-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.sw-rtc-btn {
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s;
    box-sizing: border-box;
}

.sw-rtc-btn-cancel {
    padding: 8px 16px;
    background: white;
    border: 1px solid #d1d5db;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
}

.sw-rtc-btn-cancel:hover {
    background: #f9fafb;
}

.sw-rtc-btn-save {
    padding: 8px 20px;
    font-weight: 600;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
    border: none;
}