:root {
    font-family: Segoe UI, Arial, sans-serif;
    color: #26352f;
    background: #e9f0ec;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(135deg, #e8f0eb 0%, #f2eee6 100%);
}

.container { max-width: 1280px; margin: auto; padding: 0 20px; }
.topbar { background: #36594d; color: #fff; }
.topbar-inner { min-height: 62px; padding-top: 10px; padding-bottom: 10px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.brand { color: #fff; text-decoration: none; font-size: 20px; font-weight: 700; }
.userbox { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; min-width: 0; max-width: 100%; }
.userbox span { min-width: 0; overflow-wrap: anywhere; }
.userbox form { flex-shrink: 0; }
.authenticated { font-size: 14px; line-height: 1.45; }
.authenticated h1 { font-size: 24px; overflow-wrap: anywhere; }
.authenticated .brand { font-size: 18px; }
.page { padding-top: 24px; padding-bottom: 40px; }
.workspace-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.workspace-tabs a { padding: 10px 14px; border-radius: 8px; border: 1px solid #b9ccc1; text-decoration: none; color: #36594d; background: #f8fbf9; font-weight: 600; overflow-wrap: anywhere; }
.workspace-tabs a.active { background: #36594d; color: #fff; }
.code-reference { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.code-reference-item { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 10px 12px; font-size: 13px; }
.code-reference-item strong { color: #36594d; }
.code-reference-item span { overflow-wrap: anywhere; }
.code-reference-item label { font-weight: 600; }
.password-field { display: flex; gap: 6px; min-width: 0; }
.password-field input { flex: 1 1 0; min-width: 0; width: 0; }
.password-toggle { min-width: 54px; }
input[readonly] { background: #e4ebe7; color: #596a62; }

.card {
    background: #f8fbf9;
    border: 1px solid #cfddd5;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(54, 89, 77, .08);
}

.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.toolbar > div { min-width: 0; }
.toolbar h1, .login-card h1 { margin: 0 0 4px; }
.muted { color: #66766e; margin: 0; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #b9ccc1;
    border-radius: 8px;
    padding: 9px 14px;
    text-decoration: none;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    flex-shrink: 0;
    white-space: nowrap;
    background: #f8fbf9;
    color: #26352f;
}

.btn-primary { background: #4f7f6d; color: #fff; border-color: #4f7f6d; }
.btn-primary:hover { background: #416d5d; }
.btn-light { background: #f8fbf9; }
.btn-small { padding: 6px 10px; }
.full { width: 100%; }

.searchbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.searchbar input { flex: 1 1 220px; min-width: 0; }
.table-wrap { max-width: 100%; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 6px 7px; border-bottom: 1px solid #d8e3dc; text-align: left; white-space: normal; overflow-wrap: anywhere; }
th { background: #e3ede7; font-size: 13px; }
.partners-table { table-layout: fixed; background: #f8fbf9; font-size: 13px; }
.partner-actions { text-align: center; }
.partner-actions .btn { padding: 7px 10px; }
.partners-table td > span { min-width: 0; }

.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; }
.pagination-summary { color: #66766e; font-size: 13px; }
.pagination-pages { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.pagination-pages a, .pagination-pages span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 36px;
    padding: 5px 9px;
    border: 1px solid #b9ccc1;
    border-radius: 8px;
    background: #f8fbf9;
    color: #36594d;
    text-decoration: none;
    font-weight: 600;
}
.pagination-pages .active { background: #4f7f6d; border-color: #4f7f6d; color: #fff; }
.pagination-pages .disabled { color: #9aaba3; background: #e4ebe7; }
.pagination-pages .ellipsis { min-width: auto; padding-inline: 3px; border-color: transparent; background: transparent; }

.badge { padding: 4px 8px; border-radius: 999px; font-size: 12px; }
.badge.ok { background: #d8eadf; color: #245b3e; }
.badge.off { background: #f3dddd; color: #8a3434; }

.section { padding: 18px; margin-bottom: 16px; }
.section h3 { margin-top: 0; color: #36594d; }
.grid-2, .grid-3, .grid-4 { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.field label { font-size: 13px; font-weight: 700; color: #3f5149; }

input, textarea, select {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    border: 1px solid #b9ccc1;
    border-radius: 8px;
    padding: 10px 11px;
    background: #fbfdfb;
    color: #26352f;
    font: inherit;
}

input:focus, textarea:focus, select:focus {
    outline: 2px solid #91b7a7;
    outline-offset: 1px;
}

input:disabled, select:disabled {
    background: #e4ebe7;
    color: #596a62;
}

.uppercase { text-transform: uppercase; }
.checks { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 16px; }
.checks label { display: flex; align-items: center; gap: 7px; }
.checks input { width: auto; }
.option-note { margin-bottom: 14px; }
.form-grid .section { padding: 12px 14px; margin-bottom: 10px; }
.form-grid .section h3 { margin: 0 0 8px; }
.form-grid .grid-2, .form-grid .grid-3, .form-grid .grid-4 { row-gap: 8px; }
.form-grid .field { gap: 2px; }
.form-grid .field .validation:empty { display: none; }
.form-grid .option-note { margin-bottom: 8px; }
.form-grid .checks { row-gap: 8px; margin-bottom: 8px; }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.validation { color: #a63838; font-size: 13px; }
.alert { padding: 12px 14px; border-radius: 8px; margin-bottom: 16px; }
.alert.success { background: #d8eadf; color: #245b3e; }

.login-wrap { min-height: 70vh; display: grid; place-items: center; }
.login-card { width: min(420px, 100%); padding: 26px; }
.login-card form { margin-top: 20px; }
.login-card .field { margin-bottom: 15px; }
.captcha-row { display: flex; gap: 8px; align-items: center; }
.captcha-row img { border: 1px solid #b9ccc1; border-radius: 8px; height: 60px; }

@media (max-width: 1000px) {
    .partners-table, .partners-table tbody { display: block; }
    .partners-table { background: transparent; }
    .partners-table colgroup { display: none; }
    .partners-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        clip-path: inset(50%);
    }
    .partners-table tbody { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .partners-table tr {
        display: flex;
        flex-direction: column;
        min-width: 0;
        padding: 9px 12px;
        background: #f8fbf9;
        border: 1px solid #cfddd5;
        border-radius: 12px;
    }
    .partners-table td {
        display: grid;
        grid-template-columns: 100px minmax(0, 1fr);
        gap: 6px;
        align-items: start;
        padding: 3px 0;
    }
    .partners-table td[data-label]::before { content: attr(data-label); font-weight: 600; color: #3f5149; }
    .partners-table td .badge { justify-self: start; }
    .partners-table .partner-actions { display: block; border: 0; padding-bottom: 0; margin-top: auto; }
    .partner-actions .btn { width: 100%; min-height: 44px; }
}

@media (max-width: 800px) {
    .code-reference { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
    .partners-table tbody { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
    .code-reference { grid-template-columns: minmax(0, 1fr); }
    .container { padding-left: 12px; padding-right: 12px; }
    .section { padding: 14px; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
    .span-2 { grid-column: span 1; }
    .toolbar { align-items: flex-start; gap: 12px; }
    .searchbar input { flex-basis: 100%; }
    .searchbar .btn, .form-actions .btn { flex: 1 1 auto; min-height: 44px; }
    .btn { min-height: 44px; }
    .pagination { align-items: stretch; }
    .pagination-summary { flex-basis: 100%; text-align: center; }
    .pagination-pages { justify-content: center; width: 100%; }
    input, textarea, select { font-size: 16px; }
}
