.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.button-secondary {
    background: #eef2f6;
    color: #344054;
}

.form-stack {
    display: grid;
    gap: 18px;
}

.form-section {
    padding: 24px;
}

.form-section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.form-section-heading > div:first-child {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.form-section-heading h2 {
    margin: 0;
}

.form-step {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #eaf2ff;
    color: #2563eb;
    font-weight: 800;
}

.form-section-help {
    max-width: 320px;
    color: #667085;
    font-size: 12px;
    text-align: right;
}

.form-grid {
    display: grid;
    gap: 18px;
}

.form-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-span-2 {
    grid-column: 1 / -1;
}

.form-field {
    display: grid;
    gap: 7px;
}

.form-field > span {
    color: #344054;
    font-size: 12px;
    font-weight: 800;
}

.form-field small,
.form-note {
    margin: 0;
    color: #667085;
    font-size: 11px;
    line-height: 1.45;
}

.form-field input,
.form-field select {
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    background: #ffffff;
    color: #172033;
    font: inherit;
    outline: none;
}

.form-field input:focus,
.form-field select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}

.form-field input[readonly] {
    background: #f8fafc;
    color: #667085;
}

.safety-banner,
.admin-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 10px;
}

.safety-banner {
    border: 1px solid #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.safety-icon {
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #dcfce7;
    font-weight: 900;
}

.safety-banner strong,
.safety-banner span,
.admin-alert strong,
.admin-alert span {
    display: block;
}

.safety-banner span,
.admin-alert span {
    margin-top: 3px;
    font-size: 12px;
}

.admin-alert-error {
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.admin-alert-success {
    border: 1px solid #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.form-section-heading-toggle {
    align-items: center;
}

.toggle-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #344054;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.toggle-row input {
    width: 16px;
    height: 16px;
}

.publisher-fields {
    transition: opacity 0.15s ease;
}

.publisher-fields.is-disabled {
    opacity: 0.45;
}

.form-note {
    margin-top: 14px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 4px 0 26px;
}

@media (max-width: 760px) {
    .form-grid-2 {
        grid-template-columns: 1fr;
    }

    .form-span-2 {
        grid-column: auto;
    }

    .form-section-heading,
    .form-section-heading-toggle {
        display: grid;
    }

    .form-section-help {
        text-align: left;
    }

    .form-actions {
        display: grid;
    }
}


.admin-alert-warning {
    border: 1px solid #fed7aa;
    background: #fff7ed;
    color: #9a3412;
}

.inline-action {
    display: inline-flex;
    margin-top: 8px;
    color: inherit;
    font-size: 12px;
    font-weight: 800;
    text-decoration: underline;
}

.masterdata-form {
    max-width: 900px;
}


.button-danger {
    background: #b42318;
    border-color: #b42318;
    color: #ffffff;
}

.button-danger:hover:not(:disabled) {
    background: #912018;
    border-color: #912018;
}

.button-small {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 12px;
}

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-panel { width: min(480px, 100%); }
.topbar-user { margin-left: auto; font-weight: 600; }
.topbar-logout { margin-left: 10px; }

/* Keep account actions within their column; stack each account on narrow screens. */
.users-table {
    table-layout: fixed;
}
.users-table th,
.users-table td {
    white-space: normal;
    overflow-wrap: anywhere;
    vertical-align: top;
}
.users-table .form-field,
.users-table form {
    min-width: 0;
}
.users-table .form-field {
    grid-template-columns: minmax(0, 1fr);
}
.users-table input,
.users-table select,
.users-table .button {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
}
.user-delete-section {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    /* Deletion content must not contribute to the account column's width. */
    contain: inline-size;
    min-width: 0;
    max-width: 100%;
    gap: 10px;
    margin: 16px 0;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}
.user-delete-section form {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
}
@media (max-width: 1100px) {
    .users-table,
    .users-table tbody,
    .users-table tr,
    .users-table td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }
    .users-table thead {
        display: none;
    }
    .users-table tr + tr {
        border-top: 2px solid #d0d5dd;
    }
    .users-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 8px;
        color: #667085;
        font-size: 11px;
        font-weight: 800;
        text-transform: uppercase;
    }
}
