html,
body {
    margin: 0;
    min-height: 100%;
    font-family: "Segoe UI", Arial, sans-serif;
    color: #16241a;
    background: #edf4ec;
}

.admin-shell {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

.admin-side {
    padding: 24px;
    background: #17331f;
    color: rgba(255,255,255,.78);
}

.brand {
    color: #fff;
    font-size: 22px;
    font-weight: 900;
}

.admin-side span {
    display: block;
    margin: 6px 0 24px;
    color: #e0a53b;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.admin-side a {
    display: block;
    padding: 10px 12px;
    border-radius: 7px;
    background: rgba(255,255,255,.08);
    color: #fff;
    text-decoration: none;
    font-weight: 800;
}

.admin-main {
    padding: 28px;
}

.admin-page {
    display: grid;
    gap: 20px;
}

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.admin-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.admin-tabs button {
    border-color: #d5ded3;
    background: #fff;
    color: #17331f;
}

.admin-tabs button.is-active {
    border-color: #1d5a2d;
    background: #1d5a2d;
    color: #fff;
}

.eyebrow {
    margin: 0 0 8px;
    color: #1d5a2d;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 8px;
    color: #253c66;
    font-size: 34px;
    font-weight: 900;
}

.login-card,
.panel {
    border: 1px solid #d6e2d4;
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 14px 35px rgba(16, 45, 23, .08);
}

.login-card {
    max-width: 440px;
    padding: 26px;
}

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

label {
    display: grid;
    gap: 6px;
    color: #263929;
    font-size: 12px;
    font-weight: 900;
}

input,
select {
    min-height: 43px;
    border: 1px solid #cbd9ca;
    border-radius: 7px;
    padding: 0 12px;
    font-size: 14px;
}

button {
    min-height: 38px;
    border: 1px solid #1d5a2d;
    border-radius: 7px;
    padding: 0 13px;
    background: #1d5a2d;
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}

button.secondary {
    border-color: #d5ded3;
    background: #fff;
    color: #16241a;
}

.message {
    margin: 0;
    padding: 10px 12px;
    border-radius: 7px;
    background: #fff7e8;
    color: #7b4a00;
    font-size: 13px;
    font-weight: 750;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    min-width: 920px;
    border-collapse: collapse;
    background: #fff;
}

th,
td {
    padding: 12px;
    border-bottom: 1px solid #e4ece3;
    text-align: left;
    font-size: 13px;
    vertical-align: top;
}

th {
    color: #15381f;
    background: #f7fbf6;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.status {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 999px;
    background: #edf7ef;
    color: #1d5a2d;
    font-size: 11px;
    font-weight: 900;
}

.row-actions {
    display: flex;
    gap: 8px;
}

.mf-toast-zone {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 10050;
    display: grid;
    gap: 10px;
    width: min(390px, calc(100vw - 36px));
    pointer-events: none;
}

.mf-toast {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 24px;
    gap: 10px;
    align-items: start;
    padding: 12px;
    border: 1px solid #d8e4d6;
    border-left-width: 4px;
    border-radius: 8px;
    background: rgba(255,255,255,.96);
    box-shadow: 0 16px 42px rgba(17, 38, 22, .18);
    color: #17241a;
    pointer-events: auto;
}

.mf-toast.success { border-left-color: #1d5a2d; }
.mf-toast.error { border-left-color: #b72b2b; }
.mf-toast.info { border-left-color: #253c66; }
.mf-toast.loading { border-left-color: #e0a53b; }

.mf-toast-icon {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #edf4ec;
    color: #1d5a2d;
    font-weight: 900;
}

.mf-toast.error .mf-toast-icon {
    background: #fff1f1;
    color: #b72b2b;
}

.mf-toast-text strong {
    display: block;
    margin-bottom: 3px;
    color: #18361f;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.mf-toast-text p {
    margin: 0;
    color: #4d5c52;
    font-size: 13px;
    line-height: 1.45;
}

.mf-toast button {
    min-height: 0;
    border: 0;
    background: transparent;
    color: #607067;
    font-size: 16px;
    font-weight: 900;
    cursor: pointer;
}

.mf-toast-spinner,
.mf-reconnect-spinner,
.admin-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(29, 90, 45, .25);
    border-top-color: #1d5a2d;
    border-radius: 50%;
    animation: admin-spin .8s linear infinite;
}

.admin-spinner {
    width: 30px;
    height: 30px;
    border-width: 3px;
}

.loading-panel {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border: 1px solid #d8e4d6;
    border-radius: 8px;
    background: #fff;
    color: #17331f;
    font-weight: 800;
    box-shadow: 0 14px 35px rgba(16, 45, 23, .08);
}

.mf-reconnect-toast {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 10060;
    display: none;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    width: min(420px, calc(100vw - 36px));
    padding: 12px;
    border: 1px solid #d8e4d6;
    border-left: 4px solid #e0a53b;
    border-radius: 8px;
    background: rgba(255,255,255,.97);
    box-shadow: 0 16px 42px rgba(17, 38, 22, .18);
    color: #17241a;
}

.components-reconnect-show,
.components-reconnect-failed,
.components-reconnect-rejected {
    display: none;
}

.mf-reconnect-toast.components-reconnect-show,
.mf-reconnect-toast.components-reconnect-failed,
.mf-reconnect-toast.components-reconnect-rejected {
    display: grid;
}

.mf-reconnect-toast.components-reconnect-show .components-reconnect-show,
.mf-reconnect-toast.components-reconnect-failed .components-reconnect-failed,
.mf-reconnect-toast.components-reconnect-rejected .components-reconnect-rejected {
    display: block;
}

.mf-reconnect-toast strong {
    display: block;
    color: #18361f;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.mf-reconnect-toast p {
    margin: 3px 0 0;
    color: #4d5c52;
    font-size: 13px;
}

.mf-reconnect-toast .reload {
    color: #1d5a2d;
    font-size: 12px;
    font-weight: 900;
}

@keyframes admin-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 860px) {
    .admin-shell {
        grid-template-columns: 1fr;
    }

    .admin-side {
        position: static;
        padding: 18px;
    }

    .admin-side span {
        margin-bottom: 14px;
    }

    .admin-main {
        padding: 18px;
    }

    .page-head {
        display: grid;
    }

    h1 {
        font-size: 28px;
    }

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

    .row-actions button {
        width: 100%;
    }
}

@media (max-width: 560px) {
    .admin-side {
        padding: 14px;
    }

    .brand {
        font-size: 19px;
    }

    .admin-main {
        padding: 14px 10px;
    }

    h1 {
        font-size: 24px;
    }

    .login-card,
    .panel {
        border-radius: 8px;
    }

    .login-card {
        max-width: none;
        padding: 18px;
    }

    th,
    td {
        padding: 10px;
    }

    .row-actions {
        grid-template-columns: 1fr;
    }

    .mf-toast-zone,
    .mf-reconnect-toast {
        right: 10px;
        bottom: 10px;
        width: calc(100vw - 20px);
    }
}
