:root {
    --bg: #f5f7fb;
    --panel: #ffffff;
    --ink: #172033;
    --muted: #6d7587;
    --line: #dce2ea;
    --brand: #134ebf;
    --brand-dark: #0b347f;
    --danger: #b42318;
    --success: #0f7b44;
    --radius: 8px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    color: var(--ink);
    background: var(--bg);
    font-family: Arial, Helvetica, sans-serif;
}

a { color: var(--brand); text-decoration: none; }

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: linear-gradient(135deg, #0b347f 0%, #111827 100%);
}

.login-card, .public-card {
    width: min(440px, 100%);
    background: var(--panel);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .28);
}

.brand-mark {
    width: 76px;
    height: 76px;
    margin: 0 auto 14px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #101827;
    color: #fff;
    font-weight: 800;
    font-size: 24px;
}

h1, h2, h3 { margin: 0 0 12px; }
p { color: var(--muted); line-height: 1.5; }

.layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 244px 1fr;
}

.sidebar {
    padding: 24px;
    background: #111827;
    color: #fff;
}

.sidebar a {
    display: block;
    margin: 12px 0;
    color: #dbe8ff;
}

.content { padding: 28px; }

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 18px;
}

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

label {
    display: block;
    margin: 12px 0 6px;
    font-size: 13px;
    font-weight: 700;
    color: #344054;
}

input, select, textarea {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid #b8c1cf;
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
}

input[type="checkbox"] {
    width: auto;
    min-height: 0;
    margin-right: 6px;
}

button, .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    border: 0;
    border-radius: 6px;
    background: var(--brand);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.button.secondary { background: #344054; }
.button.danger, button.danger { background: var(--danger); }

.actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.badge.ok { background: #dcfae6; color: var(--success); }
.badge.off { background: #fee4e2; color: var(--danger); }

.flash {
    margin-bottom: 16px;
    padding: 12px;
    border-radius: 6px;
    background: #eaf2ff;
    color: #0b347f;
}

.flash.error {
    background: #fee4e2;
    color: var(--danger);
}

.icon-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.icon-preview img {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 50%;
    background: #111827;
}

.public-page {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 46px 18px;
    background:
        radial-gradient(circle at 18% 30%, rgba(0, 204, 255, .46), transparent 26%),
        radial-gradient(circle at 80% 58%, rgba(255, 51, 153, .28), transparent 24%),
        linear-gradient(135deg, #07131e 0%, #132938 46%, #080d10 100%);
    color: #fff;
}

.public-page::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px),
        linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px);
    background-size: 22px 22px;
    opacity: .15;
}

.public-card {
    position: relative;
    z-index: 1;
    width: min(560px, 100%);
    padding: 0;
    text-align: center;
    background: transparent;
    box-shadow: none;
}

.public-card h1 {
    margin: 8px 0 26px;
    color: #fff;
    font-size: 28px;
    text-transform: uppercase;
    text-shadow: 0 2px 14px rgba(0, 0, 0, .55);
}

.public-card p {
    color: rgba(255, 255, 255, .82);
}

.public-card .brand-mark {
    width: 118px;
    height: 118px;
    margin-bottom: 18px;
    background: #050607;
    border: 3px solid rgba(255, 255, 255, .14);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .38);
    font-size: 44px;
}

.whatsapp-button,
.telegram-button {
    display: inline-grid;
    place-items: center;
    color: #fff;
}

.whatsapp-button {
    width: 54px;
    height: 54px;
    margin: 0 auto 34px;
    border: 2px solid rgba(255, 255, 255, .86);
    border-radius: 50%;
    background: rgba(255, 255, 255, .1);
}

.whatsapp-button svg {
    width: 32px;
    height: 32px;
    fill: currentColor;
}

.public-link-row {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 82px;
    margin: 14px 0;
}

.public-link-main {
    position: relative;
    display: grid;
    grid-template-columns: 74px 1fr 48px;
    align-items: center;
    width: 100%;
    min-height: 70px;
    padding: 8px 12px;
    border-radius: 999px;
    color: #fff;
    font-weight: 800;
    background: linear-gradient(90deg, rgba(136, 200, 226, .72), rgba(20, 31, 33, .86));
    box-shadow: inset 0 0 34px rgba(255, 255, 255, .08), 0 16px 34px rgba(0, 0, 0, .28);
}

.service-icon {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 50%;
    background: #101417;
    color: #fff;
    font-size: 28px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .42);
}

.service-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.service-title {
    padding: 0 10px;
    font-size: 24px;
    text-transform: uppercase;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, .45);
    overflow-wrap: anywhere;
}

.telegram-button {
    position: absolute;
    right: 14px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #26a5e4;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .34);
}

.telegram-button svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.muted { color: var(--muted); }
.danger-text { color: var(--danger); }

@media (max-width: 760px) {
    .layout { grid-template-columns: 1fr; }
    .sidebar { position: static; }
    .grid { grid-template-columns: 1fr; }
    .topbar { align-items: flex-start; flex-direction: column; }
    .content { padding: 18px; }
    .public-page { padding: 32px 12px; }
    .public-card .brand-mark { width: 104px; height: 104px; font-size: 38px; }
    .public-card h1 { font-size: 24px; }
    .public-link-row { min-height: 76px; }
    .public-link-main {
        grid-template-columns: 64px 1fr 44px;
        min-height: 64px;
        padding: 7px 10px;
    }
    .service-icon { width: 56px; height: 56px; }
    .service-title { font-size: 20px; }
    .telegram-button { right: 12px; width: 38px; height: 38px; }
}
