/* ======================================================
   FORM CARD STYLING
====================================================== */
.ms3rema-form-card {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 20px;
    margin: 20px 0 30px;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

.ms3rema-form-card h2 {
    margin: 0 0 18px;
    padding: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1d2327;
}

/* ======================================================
   FORM GRID LAYOUT
====================================================== */
.ms3rema-form-grid {
    display: grid;
    grid-template-columns: 2fr 2fr 170px 110px 130px;
    gap: 12px;
    align-items: start;
}

.ms3rema-form-field {
    display: flex;
    flex-direction: column;
}

.ms3rema-form-field label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    font-size: 13px;
    color: #1d2327;
    min-height: 18px;
    line-height: 18px;
}

.ms3rema-form-field input[type="text"],
.ms3rema-form-field select {
    width: 100%;
    height: 36px;
    padding: 0 12px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.4;
    box-sizing: border-box;
}

.ms3rema-form-field input[type="text"]:focus,
.ms3rema-form-field select:focus {
    border-color: #2271b1;
    outline: none;
    box-shadow: 0 0 0 1px #2271b1;
}

.ms3rema-field-desc {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: #646970;
    font-style: italic;
    line-height: 1.3;
}

.ms3rema-label-spacer {
    visibility: hidden;
    min-height: 18px !important;
    line-height: 18px !important;
    margin-bottom: 6px !important;
    display: block !important;
    font-size: 13px;
}

.ms3rema-form-field-status {
    display: flex;
    flex-direction: column;
}

.ms3rema-checkbox-label {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: 36px;
    margin: 0;
    padding: 0;
    font-weight: normal;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    color: #1d2327;
}

.ms3rema-form-field-status input[type="checkbox"] {
    margin: 0 8px 0 0;
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

.ms3rema-form-submit {
    display: flex;
    flex-direction: column;
}

.ms3rema-form-submit button {
    height: 36px;
    padding: 0 24px;
    font-size: 13px;
    font-weight: 500;
    width: 100%;
}

/* ======================================================
   TOGGLE SWITCH STYLING
====================================================== */
.ms3rema-toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

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

.ms3rema-toggle-slider {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    background-color: #8c8f94;
    border-radius: 24px;
    transition: background-color 0.3s;
    margin-right: 8px;
}

.ms3rema-toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s;
}

.ms3rema-status-toggle:checked + .ms3rema-toggle-slider {
    background-color: #2271b1;
}

.ms3rema-status-toggle:checked + .ms3rema-toggle-slider::before {
    transform: translateX(20px);
}

.ms3rema-toggle-label {
    font-size: 13px;
    font-weight: 500;
}

/* ======================================================
   ACTIONS COLUMN
====================================================== */
.ms3rema-actions {
    white-space: nowrap;
}

.ms3rema-actions .button {
    margin-right: 4px;
}

.ms3rema-edit-btn {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

.ms3rema-edit-btn:hover {
    background: #135e96;
    border-color: #135e96;
    color: #fff;
}

.ms3rema-delete-btn {
    background: #d63638;
    color: #fff;
    border-color: #d63638;
}

.ms3rema-delete-btn:hover {
    background: #b32d2e;
    border-color: #b32d2e;
    color: #fff;
}

/* ======================================================
   INLINE EDIT STYLING
====================================================== */
.ms3rema-inline-edit {
    background: #f6f7f7;
    padding: 16px !important;
}

.ms3rema-inline-form {
    display: grid;
    grid-template-columns: 1fr 1fr 150px auto auto auto;
    gap: 12px;
    align-items: center;
}

.ms3rema-inline-form input[type="text"],
.ms3rema-inline-form select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 14px;
}

.ms3rema-inline-form input[type="checkbox"] {
    margin-right: 6px;
}

.ms3rema-inline-form label {
    display: flex;
    align-items: center;
    white-space: nowrap;
    font-size: 13px;
}

.ms3rema-save-inline {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

.ms3rema-save-inline:hover {
    background: #135e96;
    border-color: #135e96;
    color: #fff;
}

.ms3rema-cancel-inline {
    background: #f6f7f7;
    border-color: #8c8f94;
}

/* ======================================================
   RESPONSIVE ADJUSTMENTS
====================================================== */
@media screen and (max-width: 1200px) {
    .ms3rema-form-grid {
        grid-template-columns: 1fr 1fr;
    }

    .ms3rema-form-field-submit {
        grid-column: span 2;
    }

    .ms3rema-inline-form {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 782px) {
    .ms3rema-form-grid {
        grid-template-columns: 1fr;
    }

    .ms3rema-form-field-submit {
        grid-column: 1;
    }
}

/* ======================================================
   NOTICES
====================================================== */
.notice {
    margin: 15px 0 5px;
}
