body {
    margin: 0;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top right, rgba(31, 111, 235, 0.12), transparent 26%),
        linear-gradient(180deg, #f4f7fb 0%, #edf1f7 100%);
    color: #182433;
}

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

.sidebar {
    background:
        radial-gradient(circle at top left, rgba(64, 156, 255, 0.24), transparent 34%),
        linear-gradient(180deg, #12233b 0%, #0d1727 100%);
    color: #fff;
    padding: 24px 20px;
    box-shadow: 18px 0 45px rgba(15, 27, 46, 0.12);
}

.brand {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-grid;
    place-items: center;
    color: #08213f;
    background: linear-gradient(135deg, #ffffff 0%, #bce0ff 100%);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
    font-size: 14px;
    letter-spacing: 0.08em;
}

.menu {
    display: grid;
    gap: 10px;
}

.menu a {
    color: #d7e6f8;
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 10px;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.menu a:hover,
.menu a.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    transform: translateX(3px);
}

.content {
    padding: 28px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 24px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(214, 225, 239, 0.78);
    border-radius: 24px;
    box-shadow: 0 16px 45px rgba(17, 33, 61, 0.08);
    padding: 18px 20px;
    backdrop-filter: blur(12px);
}

.topbar h1 {
    margin: 0;
    font-size: 34px;
    line-height: 1.1;
}

.topbar-title p {
    margin: 8px 0 0;
    color: #66768a;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.account-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid #dbe6f6;
    border-radius: 16px;
    background: #f8fbff;
    min-width: 210px;
}

.account-card strong,
.account-card span {
    display: block;
}

.account-card span {
    color: #66768a;
    font-size: 13px;
    margin-top: 2px;
}

.account-avatar {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #1f6feb, #0ba678);
    color: #fff;
    font-weight: 800;
}

.logout-form {
    margin: 0;
}

.logout-btn {
    background: #182433;
}

.logout-btn:hover {
    background: #0f1723;
}

.stats,
.card-grid,
.two-col {
    display: grid;
    gap: 16px;
}

.stats {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.card-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.two-col {
    grid-template-columns: 1.3fr 1fr;
}

.card,
.stat,
.panel {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(17, 33, 61, 0.08);
    padding: 18px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
}

.muted {
    color: #66768a;
}

.toolbar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 16px 0 24px;
}

.btn,
button {
    border: 0;
    border-radius: 10px;
    padding: 11px 14px;
    background: #1f6feb;
    color: #fff;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.btn.secondary {
    background: #dbe6f6;
    color: #17304d;
}

.btn.danger {
    background: #b42318;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
}

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

th {
    background: #f8fbff;
}

.status {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eef4ff;
    color: #194a9e;
    font-size: 12px;
    font-weight: 600;
}

.alert {
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 16px;
}

.alert.success {
    background: #e7f8ec;
    color: #18663a;
}

.alert.error {
    background: #ffe9e9;
    color: #9b2121;
}

input,
select,
textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d8e1ef;
    border-radius: 10px;
    padding: 10px 12px;
    margin-top: 6px;
    margin-bottom: 14px;
    background: #fff;
}

label {
    display: block;
    font-weight: 600;
}

.service-card {
    display: grid;
    gap: 10px;
}

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

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

.adapt-card {
    background: #f8fbff;
    border: 1px solid #dce8f7;
    border-radius: 16px;
    padding: 14px;
    display: grid;
    gap: 10px;
}

.warning-list {
    padding-top: 6px;
    border-top: 1px solid #dce8f7;
}

.hint-box {
    background: #f7fafc;
    border: 1px dashed #bfd3ee;
    border-radius: 12px;
    padding: 12px;
    margin-top: 8px;
    margin-bottom: 14px;
}

.ajax-message {
    margin-bottom: 16px;
    padding: 14px 16px;
    border-radius: 12px;
}

.ajax-message.success {
    background: #e7f8ec;
    color: #18663a;
}

.ajax-message.error {
    background: #ffe9e9;
    color: #9b2121;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.detail-block {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #edf1f7;
}

.service-targets {
    display: grid;
    gap: 14px;
    margin-bottom: 18px;
}

.service-target-group {
    border: 1px solid #e3ebf6;
    border-radius: 16px;
    padding: 14px;
    background: #fbfdff;
}

.service-target-group.is-disabled {
    opacity: 0.55;
    background: #f5f7fb;
}

.target-item.is-disabled {
    opacity: 0.55;
}

.service-target-header {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #edf1f7;
}

.service-target-list {
    display: grid;
    gap: 10px;
}

.target-toggle,
.target-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.login-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(31, 111, 235, 0.22), transparent 28%),
        radial-gradient(circle at bottom right, rgba(11, 166, 120, 0.18), transparent 30%),
        linear-gradient(135deg, #0f1c2f 0%, #1a2f4f 45%, #edf3fb 45%, #f4f7fb 100%);
}

.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.15fr 520px;
    align-items: center;
    gap: 32px;
    padding: 32px;
    box-sizing: border-box;
}

.login-hero {
    color: #f4f8ff;
    padding: 24px;
}

.login-hero h1 {
    font-size: 48px;
    line-height: 1.05;
    margin: 18px 0 16px;
    max-width: 680px;
}

.login-hero p {
    max-width: 620px;
    font-size: 18px;
    line-height: 1.6;
    color: #d2def0;
}

.login-badge {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.16);
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.login-hints {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 26px;
}

.login-hints .panel {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    backdrop-filter: blur(8px);
}

.login-hints .muted {
    color: #d7e4f6;
}

.login-card {
    width: 100%;
}

.login-panel {
    padding: 28px;
    border-radius: 24px;
    box-shadow: 0 18px 50px rgba(11, 21, 42, 0.22);
}

.login-panel h2 {
    margin-top: 0;
    margin-bottom: 8px;
}

.debug-card {
    margin-top: 18px;
    padding: 16px;
    border-radius: 16px;
    background: #f6f9fe;
    border: 1px solid #d9e5f5;
}

.debug-card h3 {
    margin-top: 0;
    margin-bottom: 12px;
}

.debug-grid {
    display: grid;
    gap: 8px;
}

@media (max-width: 900px) {
    .app-shell,
    .two-col {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .topbar h1 {
        font-size: 28px;
    }

    .login-shell {
        grid-template-columns: 1fr;
        padding: 18px;
    }

    .login-hero {
        padding: 0;
    }

    .login-hero h1 {
        font-size: 34px;
    }
}
