:root {
    --bg: #f5f7f7;
    --surface: #ffffff;
    --ink: #172325;
    --muted: #657174;
    --line: #dfe6e7;
    --primary: #126b62;
    --primary-dark: #0b3f3b;
    --danger: #b3261e;
    --warning: #9a6b00;
    --ok: #127a3a;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.5;
}
a { color: var(--primary); text-decoration: none; font-weight: 700; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 10px; line-height: 1.2; }
p { margin: 0 0 12px; }
code { background: #eef3f3; padding: 3px 6px; border-radius: 4px; }

.admin-shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar {
    background: #102225;
    color: #fff;
    padding: 22px;
}
.brand { font-size: 26px; font-weight: 800; }
.tagline { color: #b9c9ca; font-size: 13px; margin: 4px 0 20px; }
.nav { display: flex; flex-direction: column; gap: 6px; }
.nav a, .nav button {
    display: block;
    width: 100%;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #eaf1f1;
    padding: 9px 10px;
    text-align: left;
    font: inherit;
    cursor: pointer;
}
.nav a:hover, .nav button:hover { background: rgba(255,255,255,.09); text-decoration: none; }
.main { padding: 28px; min-width: 0; }

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}
.muted { color: var(--muted); font-size: 14px; }
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    overflow-x: auto;
}
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
}
.metric { font-size: 32px; font-weight: 800; color: var(--primary-dark); }
.metric.small { font-size: 20px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { border-bottom: 1px solid var(--line); padding: 10px; text-align: left; vertical-align: top; }
th { color: #3d4a4d; background: #f7faf9; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full, .check.full, .actions { grid-column: 1 / -1; }
label { font-weight: 700; font-size: 14px; }
input, select, textarea {
    width: 100%;
    border: 1px solid #cbd5d6;
    border-radius: 6px;
    padding: 10px;
    font: inherit;
    background: #fff;
}
textarea { min-height: 110px; resize: vertical; }
.check { display: flex; align-items: flex-start; gap: 8px; font-weight: 500; }
.check input { width: auto; margin-top: 4px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }

button, .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 6px;
    background: var(--primary);
    color: #fff;
    padding: 10px 14px;
    font-weight: 800;
    cursor: pointer;
}
.button-secondary, .button-light { background: #e8eeee; color: var(--primary-dark); }
button:disabled { opacity: .5; cursor: not-allowed; }
.danger-form { margin-top: 16px; }

.alert {
    border-radius: 6px;
    border: 1px solid #d9b46b;
    background: #fff7e6;
    color: #684700;
    padding: 12px;
    margin-bottom: 16px;
}
.alert.success { border-color: #a7d7b5; background: #edf8f0; color: #11572b; }
.alert.error { border-color: #e0a19d; background: #fff0ef; color: var(--danger); }
.status { display: inline-block; border-radius: 999px; padding: 4px 8px; background: #edf1f1; }
.status-ok { color: var(--ok); }
.status-warning { color: var(--warning); }
.status-error, .status-offline { color: var(--danger); }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tabs a { border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; color: var(--ink); }
.tabs a.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.site-body {
    background: #f4f7f6;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 72px;
    padding: 14px max(20px, calc((100% - 1120px) / 2));
    border-bottom: 1px solid rgba(16, 34, 37, .08);
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 8px 24px rgba(16, 34, 37, .06);
}

.site-brand {
    flex: 0 0 auto;
    color: var(--primary-dark);
    font-size: 28px;
    font-weight: 900;
    letter-spacing: 0;
}

.site-brand:hover {
    text-decoration: none;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.site-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    border-radius: 6px;
    color: #213235;
    padding: 8px 10px;
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
}

.site-nav a:hover {
    background: #edf3f2;
    color: var(--primary-dark);
    text-decoration: none;
}

.site-nav .site-login {
    border: 1px solid var(--primary);
    color: var(--primary-dark);
    padding-inline: 14px;
}

.hero {
    min-height: 500px;
    display: flex;
    align-items: center;
    background: linear-gradient(90deg, rgba(11, 30, 35, .92), rgba(18, 107, 98, .72)), url('../img/mt5-monitoring.svg');
    background-size: cover;
    background-position: center;
    color: #fff;
}
.hero-inner, .site-section { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.hero-inner { padding: 80px 0; }
.hero h1 { font-size: clamp(34px, 5vw, 58px); max-width: 760px; }
.hero p { max-width: 700px; color: #dbe8e8; font-size: 18px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-weight: 800; }
.site-section { padding: 48px 0; }
.site-section.band { width: 100%; padding-left: max(16px, calc((100% - 1120px) / 2)); padding-right: max(16px, calc((100% - 1120px) / 2)); background: #e9f0ef; }
.section-heading { max-width: 760px; margin-bottom: 22px; }
.public-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.public-grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.public-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    box-shadow: 0 10px 28px rgba(16, 34, 37, .05);
}
.public-card h3 { color: var(--primary-dark); }
.public-card dl { margin: 14px 0; }
.public-card dt { color: #3d4a4d; font-size: 13px; font-weight: 800; }
.public-card dd { margin: 0 0 8px; color: var(--ink); }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.steps div { display: flex; gap: 10px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
.steps strong { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: #fff; }
.bot-detail { padding-top: 36px; }
.detail-list { display: grid; grid-template-columns: 160px 1fr; gap: 8px 12px; }
.detail-list dt { font-weight: 800; }
.auth-card, .setup-card {
    width: min(430px, calc(100% - 32px));
    margin: 60px auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 24px;
}

.site-footer {
    background: #102225;
    color: #dce8e8;
    padding: 34px max(20px, calc((100% - 1120px) / 2));
}

.site-footer-inner {
    display: grid;
    gap: 16px;
}

.site-footer strong {
    display: block;
    color: #fff;
    font-size: 22px;
}

.site-footer span,
.site-footer p {
    color: #b9c9ca;
}

.site-footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
}

.site-footer a {
    color: #fff;
    font-size: 14px;
}

.client-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
    border-radius: 8px;
    padding: 24px;
    background: linear-gradient(135deg, #103236, #126b62);
    color: #fff;
}

.client-hero h1 {
    font-size: clamp(28px, 4vw, 44px);
}

.client-hero p {
    max-width: 620px;
    color: #d7e7e5;
}

.client-section {
    margin-top: 22px;
}

.section-line {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.object-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 14px;
}

.object-grid.compact {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.object-card {
    position: relative;
    display: flex;
    min-height: 170px;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid #d9e4e2;
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    padding: 18px;
    box-shadow: 0 12px 28px rgba(16, 34, 37, .07);
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.object-card:hover {
    border-color: rgba(18, 107, 98, .35);
    box-shadow: 0 18px 38px rgba(16, 34, 37, .12);
    text-decoration: none;
    transform: translateY(-2px);
}

.object-card strong {
    color: var(--primary-dark);
    font-size: 22px;
    line-height: 1.15;
}

.object-card p {
    color: var(--muted);
    font-weight: 500;
}

.object-card small,
.object-kicker {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.object-metrics,
.modal-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.object-metrics span,
.modal-metrics div {
    border-radius: 8px;
    background: #edf3f2;
    padding: 9px;
}

.object-metrics b,
.modal-metrics strong {
    display: block;
    color: var(--primary-dark);
    font-size: 18px;
}

.slot-meter {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #e5eeee;
}

.slot-meter span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #126b62;
}

.empty-card {
    border: 1px dashed #bdcccc;
    border-radius: 8px;
    background: #f9fbfb;
    color: var(--muted);
    padding: 22px;
}

.micro-link {
    font-size: 13px;
}

.badge-owned,
.slot-summary {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border-radius: 999px;
    background: #e7f4ed;
    color: #11572b;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    padding: 18px;
}

.modal:target {
    display: grid;
    place-items: center;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(8, 18, 20, .62);
}

.modal-panel {
    position: relative;
    z-index: 1;
    width: min(620px, 100%);
    max-height: min(86vh, 760px);
    overflow: auto;
    border-radius: 8px;
    background: #fff;
    padding: 24px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .28);
}

.modal-panel.large {
    width: min(860px, 100%);
}

.modal-close {
    float: right;
    border-radius: 6px;
    background: #edf3f2;
    color: var(--primary-dark);
    padding: 7px 10px;
    font-size: 13px;
}

.tabbed {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.tabbed a {
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--primary-dark);
    padding: 9px 12px;
}

.tab-panel {
    margin-bottom: 18px;
    scroll-margin-top: 90px;
}

@media (max-width: 800px) {
    .site-header {
        position: static;
        display: block;
        min-height: 0;
        padding: 14px 16px;
    }
    .site-brand {
        display: inline-block;
        margin-bottom: 10px;
        font-size: 26px;
    }
    .site-nav {
        justify-content: flex-start;
    }
    .site-nav a {
        min-height: 34px;
        padding: 7px 8px;
        font-size: 13px;
    }
    .hero {
        min-height: 440px;
    }
    .hero-inner {
        padding: 56px 0;
    }
    .client-hero,
    .section-line {
        display: block;
    }
    .client-hero .button {
        margin-top: 12px;
    }
    .object-grid,
    .object-grid.compact {
        grid-template-columns: 1fr;
    }
    .modal {
        padding: 10px;
    }
    .modal-panel {
        padding: 18px;
    }
    .object-metrics,
    .modal-metrics {
        grid-template-columns: 1fr;
    }
    .admin-shell { grid-template-columns: 1fr; }
    .sidebar { position: static; }
    .main { padding: 18px; }
    .page-header { display: block; }
    .form-grid { grid-template-columns: 1fr; }
    .detail-list { grid-template-columns: 1fr; }
}
