/* ===========================================
   Общие стили
   =========================================== */
.icon16.ss {
    background-image: url(../img/ss-icon16.png);
}
.icon16.ss.payment-bw {
    background-position: -160px 0;
}
.photos {
    display: -webkit-inline-box;
    border: 1px solid;
    padding: 3px;
    margin: 5px;
}
h2.i-header.heading a {
    margin: 0 15px;
}
.heading a img {
    width: 24px;
}
hr {
    clear: inherit;
}
.inline {
    display: inline-block;
}
.hint-inline {
    font-weight: normal;
    color: #999;
    font-size: 13px;
}

/* Общие стили для форм */
.warranty-edit-form,
.certificate-form,
.settings-form,
.msc-forms {
    max-width: 600px;
}
.warranty-edit-form {
    max-width: 800px;
}
.settings-form {
    max-width: 500px;
}
.msc-forms {
    max-width: 400px;
}

.warranty-edit-form .wa-field,
.certificate-form .wa-field,
.settings-form .wa-field {
    margin-bottom: 20px;
}
.certificate-form .wa-field {
    margin-bottom: 15px;
}

.warranty-edit-form .wa-name,
.certificate-form .wa-name,
.settings-form .wa-name {
    font-weight: 600;
    margin-bottom: 6px;
}
.certificate-form .wa-name {
    font-size: 13px;
    color: #555;
    margin-bottom: 5px;
}

.warranty-edit-form .wa-submit,
.certificate-form .wa-submit,
.settings-form .wa-submit,
.form-submit {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}
.warranty-edit-form .wa-submit {
    margin-top: 30px;
    padding-top: 20px;
}
.settings-form .wa-submit {
    margin-top: 25px;
    padding-top: 20px;
}
.form-submit {
    border-color: #ddd;
    clear: both;
}

.warranty-edit-form .hint,
.settings-form .wa-value .hint {
    margin-top: 4px;
    font-size: 12px;
    color: #888;
}
.settings-form .wa-value .hint {
    margin-top: 5px;
}

/* Общие стили для полей ввода */
.warranty-edit-form .wa-value input[type="text"],
.warranty-edit-form .wa-value input[type="number"],
.warranty-edit-form .wa-value textarea,
.warranty-edit-form .wa-value select,
.certificate-form .wa-value input[type="text"],
.settings-form .wa-value input[type="text"],
.msc-form .field .value input[type="text"],
.search-input {
    padding: 8px 10px;
    box-sizing: border-box;
}

.warranty-edit-form .wa-value input[type="text"],
.warranty-edit-form .wa-value input[type="number"],
.warranty-edit-form .wa-value textarea,
.warranty-edit-form .wa-value select {
    width: 500px;
    max-width: 100%;
}

.certificate-form .wa-value input[type="text"],
.msc-form .field .value input[type="text"] {
    width: 100%;
    max-width: 100%;
}

.settings-form .wa-value input[type="text"] {
    width: 200px;
}
.settings-form .wa-value select {
    padding: 8px 10px;
    min-width: 120px;
}

.search-input {
    width: 300px;
}

.warranty-status-line {
    margin: 0 0 18px;
    color: #555;
}

.warranty-status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
}

.warranty-status-dot.is-active {
    background: #2e9d45;
}

.warranty-status-dot.is-inactive {
    background: #c53929;
}

.warranty-domain-inline {
    margin-left: 16px;
}

.warranty-domain-option {
    display: block;
    margin-bottom: 5px;
}

.warranty-sku-list {
    max-height: 200px;
    overflow: auto;
    border: 1px solid #ddd;
    padding: 8px;
}

.warranty-sku-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 0;
}

.warranty-sku-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
}

.warranty-sku-remove {
    color: #a00;
    text-decoration: underline;
}

.warranty-action-link {
    display: inline-block;
    margin-bottom: 10px;
}

.warranty-products-link {
    display: inline-flex;
    align-items: center;
    line-height: 1;
    vertical-align: middle;
}

.warranty-products-cell {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.warranty-products-link .icon16 {
    margin: 10px;
    vertical-align: middle;
}

.sert-log-table {
    width: 100%;
}

.sert-log-table th,
.sert-log-table td {
    padding: 10px 12px;
    vertical-align: top;
}

.warranty-products-dialog {
    width: 760px;
    max-width: 90vw;
}

.warranty-products-modal {
    display: none;
}

.certificate-form .wa-form {
    margin-top: 15px;
}
.certificate-form .wa-submit button {
    margin-right: 10px;
}
.respondent-table td a {
    padding-right: 10px;
}

.respondent-table td,
.respondent-search-results td {
    padding: 10px !important;
}
.respondent-table th,
.respondent-search-results th {
    padding: 5px 10px !important;
}

/* ===========================================
   Старые стили
   =========================================== */
.valign-wrapper {
    display: flex;
    align-items: center;
}
.sort, .delete {
    width: 10%;
    float: left;
}
.fields {
    float: left;
}
.shadowed {
    float: left;
    width: -webkit-fill-available;
    min-width: calc(100% - 200px);
}
.edit {
    clear: both;
    margin: 35px 15px;
    float: left;
    width: 100%;
}
.edit .form {
    width: 40%;
    float: left;
}
.edit .position {
    width: 60%;
    float: left;
}
#position {
    position: relative;
    top: 1px;
    float: left;
    background: #fff;
}
.cursor {
    position: absolute;
    border-radius: 50%;
    z-index: 2;
    display: block;
    width: 30px;
    height: 30px;
    background: #d95353;
    color: #fff;
    line-height: 30px;
    text-align: center;
    font-size: 28px;
    margin: -15px;
}

/* ===========================================
   Редактор в форме гарантии
   =========================================== */
.warranty-edit-form .redactor-box,
.warranty-edit-form .wa-editor-core-wrapper {
    max-width: 100%;
}
.warranty-edit-form .redactor-box {
    resize: both !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.warranty-edit-form .redactor-layer {
    flex: 1 1 auto;
    min-height: 150px;
    font-size: 14px !important;
    line-height: 1.4 !important;
}
.warranty-edit-form .redactor-layer p {
    margin: 0.3em 0 !important;
}
.warranty-edit-form .redactor-layer h1 {
    font-size: 1.4em !important;
    margin: 0.4em 0 0.2em !important;
}
.warranty-edit-form .redactor-layer h2 {
    font-size: 1.25em !important;
    margin: 0.35em 0 0.15em !important;
}
.warranty-edit-form .redactor-layer h3 {
    font-size: 1.1em !important;
    margin: 0.3em 0 0.1em !important;
}
.warranty-edit-form .redactor-layer h4 {
    font-size: 1em !important;
    margin: 0.25em 0 0.1em !important;
}
.warranty-edit-form .redactor-layer ul,
.warranty-edit-form .redactor-layer ol {
    margin: 0.3em 0 !important;
    padding-left: 1.5em !important;
}
.warranty-edit-form .redactor-layer li {
    margin: 0.1em 0 !important;
}

/* ===========================================
   Шаблоны сертификатов
   =========================================== */
.template-variables-hint {
    margin-top: 20px;
    padding: 12px 15px;
    margin-bottom: 15px;
    font-size: 13px;
}
.template-variables-hint ul {
    margin: 8px 0 0 20px;
    padding: 0;
}
.template-variables-hint li {
    margin: 4px 0;
}
.template-variables-hint code {
    background: #fff;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 12px;
}

.html-templates-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.html-templates-list > li {
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 15px 20px;
    margin-bottom: 15px;
    position: relative;
}
.html-templates-list .template-delete {
    position: absolute;
    top: 15px;
    right: 15px;
}
.html-templates-list .template-row {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 10px;
    padding-right: 40px;
}
.html-templates-list .template-name-field {
    width: 320px;
    flex-shrink: 0;
}
.html-templates-list .template-usage-hint {
    margin-top: 5px;
}
.html-templates-list .template-edit-toggle {
    margin-top: 22px;
}
.template-editor-content {
    margin-top: 10px;
}
.html-templates-list .template-name-field label,
.html-templates-list .template-code > label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
}
.html-templates-list .template-code {
    flex: 1;
}
.html-templates-list .template-code textarea {
    width: 100%;
    min-height: 120px;
    resize: vertical;
    font-family: monospace;
    font-size: 12px;
    padding: 10px;
    box-sizing: border-box;
}

.html-template-form .field {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 15px;
}
.html-template-form .field .name {
    width: 200px;
    flex-shrink: 0;
    padding-top: 8px;
}
.html-template-form .field .value {
    flex: 1;
}
.html-template-form .field .value input[type="text"] {
    width: 100%;
    max-width: 400px;
    padding: 8px 10px;
    box-sizing: border-box;
}
.html-template-form .field .value textarea {
    width: 100%;
    min-height: 150px;
    resize: vertical;
    font-family: monospace;
    font-size: 12px;
    padding: 10px;
    box-sizing: border-box;
}
.sert-template-builder {
    margin: 10px 0 15px;
    padding: 15px;
    background: #fff;
    border: 1px solid #ddd;
}
.sert-template-builder h3 {
    margin: 0 0 5px;
}
.sert-template-builder .field {
    margin-bottom: 10px;
}
.sert-template-builder textarea {
    min-height: 70px;
}
.html-templates-list .sert-template-builder {
    margin-top: 0;
}
.template-logo-preview img {
    display: block;
    max-width: 260px;
    max-height: 80px;
    margin-top: 8px;
    padding: 6px;
    background: #f7f7f7;
    border: 1px solid #ddd;
}
.template-table-fields {
    max-width: 900px;
}
.template-table-field {
    display: grid;
    grid-template-columns: 300px 360px max-content;
    gap: 10px;
    align-items: center;
    margin-bottom: 6px;
}
.template-table-field label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.template-table-field input[type="text"] {
    width: 100%;
    box-sizing: border-box;
}
.template-table-field .hint {
    white-space: nowrap;
    font-family: monospace;
}

/* ===========================================
   Страница инструкции
   =========================================== */
.instructions-page h2 {
    margin-bottom: 20px;
}
.instructions-page h3 {
    margin: 0 0 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}
.instructions-page .instruction-section {
    margin-bottom: 20px;
}
.instructions-page ul {
    margin: 5px 0 15px 20px;
}
.instructions-page li {
    margin: 5px 0;
}
.instructions-page code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
}

.old-logic-section {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 15px;
}

/* ===========================================
   Список полей формы
   =========================================== */
ul.form-fields-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
    float: none !important;
}
ul.form-fields-list > li.field-item {
    display: block !important;
    float: none !important;
    width: 100% !important;
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 10px;
    box-sizing: border-box;
}
.form-fields-list .field-item-content {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}
.form-fields-list .field-item-content > .sort {
    flex-shrink: 0;
    width: 20px;
    cursor: move;
}
.form-fields-list .field-item-content > .fields {
    flex: 1;
    float: none !important;
    width: auto !important;
}
.form-fields-list .field-item-content > .delete {
    flex-shrink: 0;
    width: 20px;
}
.form-fields-list .field-header {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 10px;
}
.form-fields-list .field-type {
    font-weight: 600;
    font-size: 14px;
}
.form-fields-list .field-required {
    font-size: 12px;
    color: #666;
}
.form-fields-list .field-row {
    display: flex;
    gap: 15px;
    margin-bottom: 8px;
}
.form-fields-list .field-col {
    flex: 1;
    max-width: 250px;
}
.form-fields-list .field-col label {
    display: block;
    font-size: 11px;
    color: #888;
    margin-bottom: 3px;
}
.form-fields-list .field-col input[type="text"] {
    width: 100%;
    padding: 6px 8px;
    box-sizing: border-box;
}
.form-fields-list .field-options {
    margin-top: 8px;
}
.form-fields-list .field-options > label {
    display: block;
    font-size: 11px;
    color: #888;
    margin-bottom: 5px;
}
.form-fields-list .field-options input[type="text"] {
    width: 200px;
    padding: 5px 8px;
    margin-right: 10px;
    margin-bottom: 5px;
}

/* ===========================================
   Поиск сертификатов
   =========================================== */
.search-section {
    margin-top: 15px;
    margin-bottom: 20px;
}
.search-form {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 15px;
}
.search_result {
    list-style: none;
    margin: 0;
    padding: 0;
}
.search_result li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}
.search_result .search-no-results {
    color: #888;
    font-style: italic;
    padding: 15px 0;
}

/* ===========================================
   МСЦ
   =========================================== */
.msc-form-row {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid #eee;
}
.msc-form-row:last-child {
    border-bottom: none;
}
.msc-form .field {
    margin-bottom: 10px;
}
.msc-form .field .name {
    font-weight: 600;
    margin-bottom: 5px;
}

/* ===========================================
   Список форм
   =========================================== */
.forms-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px !important;
}
.forms-list-name {
    font-weight: 500;
}
.forms-list-actions {
    display: flex;
    gap: 10px;
}
.forms-list-actions a {
    margin: 0 !important;
}

/* ===========================================
   PollEdit
   =========================================== */
.old-logic-section .value select,
form[action="?module=poll&action=addField"] .value select,
form[action="?module=poll&action=addField"] .value input[type="text"] {
    width: 300px;
    max-width: 100%;
    min-height: 32px;
    padding: 6px 10px;
    box-sizing: border-box;
}

#fields-bulk-form .field-col input[type="text"],
#fields-bulk-form .field-col select,
#fields-bulk-form .field-options input[type="text"] {
    width: 100%;
    min-height: 32px;
    padding: 6px 10px;
    box-sizing: border-box;
}
