:root {
    --bg-color: #1e1f22;
    --card-bg: #2b2d31;
    --text-color: #e3e5e8;
    --accent-color: #5865F2;
    --green: #43b581;
    --red: #f04747;
    --surface-2: #23272a;
    --surface-3: #18191c;
    --border-color: #444;
    --muted-text: #ccc;
    --soft-text: #dcddde;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background:
        radial-gradient(1200px 600px at 10% -10%, rgba(88, 101, 242, 0.14), transparent 60%),
        radial-gradient(1000px 500px at 90% 120%, rgba(67, 181, 129, 0.1), transparent 60%),
        var(--bg-color);
    color: var(--text-color);
    margin: 0;
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 260px;
    background: var(--card-bg);
    border-right: 1px solid var(--border-color);
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    z-index: 1000;
    overflow-y: auto;
}

.sidebar-header {
    padding: 28px 20px 20px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.sidebar-title {
    color: var(--text-color);
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
}

.sidebar-nav {
    padding: 16px 12px;
}

.sidebar-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-nav li {
    margin: 0;
    padding: 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    margin-bottom: 6px;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 8px;
    border-left: 3px solid transparent;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.sidebar-nav a:hover {
    background: var(--surface-2);
    border-left-color: var(--accent-color);
    color: #fff;
}

.sidebar-nav a.active {
    background: var(--accent-color);
    border-left-color: var(--accent-color);
    color: #fff;
    font-weight: 600;
}

.sidebar-nav a i {
    width: 18px;
    text-align: center;
    display: inline-block;
}

.main-content {
    margin-left: 260px;
    min-height: 100vh;
    padding: 28px;
    background: transparent;
}

.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.container > .card,
.container > section,
.container > .panel-grid,
.container > .status-grid,
.container > .dashboard-hero,
.container > .header {
    margin-bottom: 18px;
}

header,
.header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 22px;
}

header h1,
.header h1 {
    margin: 0;
    font-size: 2rem;
}

header p,
.header p {
    margin: 0;
    color: var(--muted-text);
}

.sidebar-toggle {
    display: none;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.card:hover {
    border-color: rgba(88, 101, 242, 0.55);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.33);
    transform: translateY(-1px);
}

.card h2,
.card h3 {
    margin-top: 0;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.status-grid .card {
    grid-column: span 6;
}

.dashboard-hero {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

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

.quick-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    background: var(--surface-2);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.quick-link:hover {
    border-color: var(--accent-color);
    color: #fff;
    transform: translateY(-1px);
}

.stat-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 8px;
}

.mini-stat {
    background: var(--surface-2);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
}

.mini-stat .label {
    font-size: 0.85rem;
    color: var(--muted-text);
}

.mini-stat .value {
    margin-top: 4px;
    font-size: 1.2rem;
    font-weight: 700;
}

.panel-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 16px;
}

.panel-grid .card {
    grid-column: span 6;
}

.card-span-12 {
    grid-column: span 12 !important;
}

.panel-list {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.panel-row {
    background: var(--surface-2);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.panel-row span:last-child {
    color: var(--soft-text);
}

.page-section {
    margin-top: 24px;
}

.section-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.scroll-panel {
    max-height: 420px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: rgba(35, 39, 42, 0.65);
    padding: 6px;
}

.placeholder-state {
    text-align: center;
    padding: 22px;
    color: var(--muted-text);
}

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

.mt-12 {
    margin-top: 12px;
}

.card-note {
    background: rgba(35, 39, 42, 0.75);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 14px;
    margin: 12px 0;
    color: var(--soft-text);
}

.card-note code {
    color: #8af6bf;
    font-weight: 600;
}

.list-muted {
    color: var(--soft-text);
    padding-left: 18px;
}

.inline-check {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 10px 0;
}

.inline-check input[type="checkbox"] {
    width: auto;
}

.card-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.server-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    background: rgba(35, 39, 42, 0.5);
}

.server-table thead tr {
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    background: rgba(24, 25, 28, 0.75);
}

.server-table th,
.server-table td {
    padding: 10px;
}

.server-table th:nth-child(1) { width: 12%; }
.server-table th:nth-child(2) { width: 10%; }
.server-table th:nth-child(3) { width: 15%; }
.server-table th:nth-child(4) { width: 10%; }
.server-table th:nth-child(5) { width: 12%; }
.server-table th:nth-child(6) { width: 10%; }
.server-table th:nth-child(7) { width: 10%; }
.server-table th:nth-child(8) { width: 11%; }

.server-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.server-table tbody tr:hover {
    background: rgba(88, 101, 242, 0.08);
}

.server-address {
    font-size: 0.9em;
}

.server-status {
    font-weight: 700;
}

.status-online {
    color: #43b581;
}

.status-offline {
    color: #f04747;
}

.status-checking {
    color: #faa62a;
}

.btn-edit,
.btn-delete {
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.8em;
    color: #fff;
    cursor: pointer;
    margin-right: 6px;
}

.btn-edit {
    background: var(--accent-color);
}

.btn-delete {
    background: var(--red);
}

.table-empty {
    padding: 20px;
    text-align: center;
    color: #aaa;
}

.actions-left {
    justify-content: flex-start;
    margin-top: 0;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 10, 10, 0.6);
    backdrop-filter: blur(2px);
}

.modal-content {
    background-color: var(--card-bg);
    margin: 5% auto;
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 92%;
    max-width: 520px;
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.42);
}

.modal-header {
    font-size: 1.2rem;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
}

.close {
    color: #bbb;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #fff;
}

.module-card {
    background: rgba(44, 47, 51, 0.72);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
    margin: 10px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
}

.module-info h3 {
    margin: 0 0 5px 0;
    color: #fff;
}

.module-info p {
    margin: 0;
    color: #ccc;
    font-size: 0.9em;
}

.module-toggle {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 26px;
    flex-shrink: 0;
}

.module-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #7d7d7d;
    transition: .25s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .25s;
    border-radius: 50%;
}

.module-toggle input:checked + .slider {
    background-color: #43b581;
}

.module-toggle input:checked + .slider:before {
    transform: translateX(26px);
}

.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 10px;
}

.status-enabled {
    background-color: #43b581;
}

.status-disabled {
    background-color: #f04747;
}

.log-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.log-meta {
    color: var(--muted-text);
    font-size: 0.85rem;
}

.log-content {
    color: var(--soft-text);
    white-space: pre-wrap;
    word-break: break-word;
}

.text-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
}

.text-link:hover {
    color: #fff;
}

form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

input,
select,
textarea {
    width: 100%;
    padding: 11px 12px;
    background: var(--surface-3);
    border: 1px solid var(--border-color);
    color: #fff;
    border-radius: 6px;
    font: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.18);
}

.btn,
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-success {
    border: none;
    cursor: pointer;
    border-radius: 6px;
    padding: 10px 12px;
    font-weight: 600;
    transition: opacity 0.2s ease, transform 0.15s ease, filter 0.15s ease;
    box-shadow: 0 5px 14px rgba(0,0,0,0.22);
}

.btn-primary {
    background-color: var(--green);
    color: #fff;
}

.btn-secondary {
    background-color: var(--accent-color);
    color: #fff;
}

.btn-danger {
    background-color: var(--red);
    color: #fff;
}

.btn-success {
    background-color: var(--green);
    color: #fff;
}

.btn-primary:hover,
.btn-secondary:hover,
.btn-danger:hover,
.btn-success:hover {
    opacity: 0.95;
    transform: translateY(-1px);
    filter: brightness(1.04);
}

.btn-sm {
    padding: 6px 10px;
    font-size: 0.85rem;
}

.status-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #555;
}

.status-dot.active {
    background-color: var(--green);
    box-shadow: 0 0 10px var(--green);
}

.status-dot.offline {
    background-color: var(--red);
    box-shadow: 0 0 10px var(--red);
}

.message-preview {
    background: #36393f;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin: 10px 0;
}

.discord-message {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.discord-avatar {
    width: 40px;
    height: 40px;
    background: var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.discord-content {
    flex: 1;
}

.discord-username {
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.discord-text {
    color: var(--soft-text);
    line-height: 1.4;
    margin-bottom: 4px;
}

.message-list {
    max-height: 400px;
    overflow-y: auto;
    background: #2c2f33;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
}

.message-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    align-items: flex-start;
}

.message-item:last-child {
    border-bottom: none;
}

#rrMessagesList .message-item,
#tmMessagesList .message-item {
    display: block;
    width: 100%;
}

#rrMessagesList input,
#rrMessagesList select,
#tmMessagesList input,
#tmMessagesList select {
    min-height: 42px;
    padding: 12px;
}

#rrMessagesList textarea,
#tmMessagesList textarea {
    min-height: 110px;
    padding: 12px;
}

.message-number {
    background: var(--accent-color);
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.message-text {
    color: var(--soft-text);
    line-height: 1.4;
    flex: 1;
}

/* Alert Messages */
.message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-weight: 500;
    display: none;
}

.message-success {
    background-color: rgba(67, 181, 129, 0.2);
    border: 1px solid var(--green);
    color: var(--green);
}

.message-error {
    background-color: rgba(240, 71, 71, 0.2);
    border: 1px solid var(--red);
    color: var(--red);
}

.message-info {
    background-color: rgba(88, 101, 242, 0.2);
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
}

/* Form Styles */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.form-group label {
    font-weight: 600;
    color: var(--text-color);
}

.form-input {
    width: 100%;
    padding: 10px;
    background: var(--surface-3);
    border: 1px solid #333;
    color: #fff;
    border-radius: 6px;
    font: inherit;
    transition: border-color 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.form-group small {
    color: var(--muted-text);
    font-size: 0.85rem;
}

.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

/* Button Group */
.button-group {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.button-group .btn {
    flex: 1;
}

/* Header Styles */
.header {
    margin-bottom: 24px;
    text-align: left;
}

.header h1 {
    margin: 0 0 8px 0;
    font-size: 2rem;
    color: var(--text-color);
}

.subtitle {
    margin: 0;
    color: var(--muted-text);
    font-size: 0.95rem;
}

/* Status Item */
.status-item {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.status-item:last-child {
    border-bottom: none;
}

.status-item label {
    font-weight: 600;
    color: var(--muted-text);
}

.status-item span {
    color: var(--text-color);
}

/* Info Text */
.info-text {
    color: var(--muted-text);
    font-size: 0.95rem;
    margin-bottom: 16px;
}

/* Monospace */
.monospace {
    font-family: 'Courier New', monospace;
    background: var(--surface-3);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    word-break: break-all;
}

/* Select Dropdown */
select {
    width: 100%;
    padding: 10px;
    background: var(--surface-3);
    border: 1px solid #333;
    color: #fff;
    border-radius: 6px;
    font: inherit;
    transition: border-color 0.2s ease;
    cursor: pointer;
}

select:focus {
    outline: none;
    border-color: var(--accent-color);
}

select option {
    background: var(--card-bg);
    color: #fff;
}

select optgroup {
    background: var(--surface-3);
    color: var(--muted-text);
}

.login-page {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(1100px 550px at 15% 15%, rgba(88, 101, 242, 0.2), transparent 60%),
        radial-gradient(900px 500px at 85% 85%, rgba(67, 181, 129, 0.12), transparent 60%),
        var(--bg-color);
}

.login-shell {
    width: 100%;
    max-width: 520px;
}

.login-panel {
    width: 100%;
    background: rgba(43, 45, 49, 0.92);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 26px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.login-header {
    margin-bottom: 18px;
}

.login-header h1 {
    margin: 0 0 8px;
    font-size: 1.8rem;
}

.login-header p {
    margin: 0;
    color: var(--muted-text);
}

.btn-discord {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--accent-color);
    color: #fff;
    border-radius: 8px;
    padding: 12px 16px;
    text-decoration: none;
    font-weight: 700;
    border: 1px solid transparent;
    transition: opacity 0.2s ease;
}

.btn-discord:hover {
    opacity: 0.92;
}

.btn-discord svg {
    width: 20px;
    height: 20px;
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted-text);
    font-size: 0.85rem;
    margin: 16px 0;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.login-form {
    display: grid;
    gap: 10px;
}

.login-form .btn {
    width: 100%;
}

.login-help-text {
    font-size: 0.82rem;
    color: var(--muted-text);
    margin-top: 10px;
    margin-bottom: 0;
}

.error-banner {
    background: rgba(240, 71, 71, 0.12);
    border: 1px solid var(--red);
    color: var(--red);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.9em;
    margin-bottom: 14px;
    display: none;
}


@media (max-width: 1100px) {
    .dashboard-hero {
        grid-template-columns: 1fr;
    }

    .panel-grid .card,
    .status-grid .card {
        grid-column: span 12;
    }

    .stat-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 16px;
    }

    .sidebar-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: 10px;
        left: 10px;
        z-index: 1001;
        background: var(--accent-color);
        color: #fff;
        border: none;
        padding: 10px;
        border-radius: 6px;
        cursor: pointer;
    }

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

    .stat-strip {
        grid-template-columns: 1fr;
    }

    .section-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .card-actions {
        justify-content: stretch;
    }

    .card-actions .btn,
    .card-actions .btn-primary,
    .card-actions .btn-secondary,
    .card-actions .btn-danger {
        width: 100%;
    }
}

/* DCBot interface system -------------------------------------------------- */
:root {
    color-scheme: dark;
    --bg-color: #080d14;
    --card-bg: #111a24;
    --text-color: #f4f7f9;
    --accent-color: #3dd6c6;
    --green: #65d68d;
    --red: #ff6b6b;
    --warning: #ffbd59;
    --surface-2: #162230;
    --surface-3: #0b121b;
    --surface-4: #1b2a39;
    --border-color: #273646;
    --muted-text: #8fa2b5;
    --soft-text: #c5d0da;
    --accent: var(--accent-color);
    --border: var(--border-color);
    --text: var(--text-color);
    --text-muted: var(--muted-text);
    --input-bg: var(--surface-3);
    --sidebar-width: 286px;
    --radius-sm: 7px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.42);
}

html {
    background: var(--bg-color);
    scroll-behavior: smooth;
}

body {
    font-family: Aptos, "Segoe UI Variable", "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.55;
    letter-spacing: 0.005em;
    background-color: var(--bg-color);
    background-image:
        linear-gradient(rgba(61, 214, 198, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(61, 214, 198, 0.025) 1px, transparent 1px),
        radial-gradient(circle at 82% 0%, rgba(61, 214, 198, 0.09), transparent 32rem);
    background-size: 42px 42px, 42px 42px, auto;
}

::selection {
    color: #06100f;
    background: var(--accent-color);
}

* {
    scrollbar-width: thin;
    scrollbar-color: #34485b transparent;
}

*::-webkit-scrollbar {
    width: 9px;
    height: 9px;
}

*::-webkit-scrollbar-thumb {
    background: #34485b;
    border: 2px solid transparent;
    border-radius: 999px;
    background-clip: padding-box;
}

h1, h2, h3, h4 {
    line-height: 1.15;
    letter-spacing: -0.025em;
}

h1 {
    font-size: clamp(2rem, 4vw, 3rem);
}

h2 {
    font-size: clamp(1.35rem, 2.2vw, 1.7rem);
}

h3 {
    font-size: 1.08rem;
}

a, button, input, select, textarea {
    -webkit-tap-highlight-color: transparent;
}

:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 3px;
}

.sidebar {
    width: var(--sidebar-width);
    background: rgba(9, 15, 23, 0.98);
    border-right: 1px solid #1c2a37;
    box-shadow: 18px 0 60px rgba(0, 0, 0, 0.24);
    overscroll-behavior: contain;
}

.sidebar-header {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 19px 18px 17px;
    text-align: left;
    background: rgba(9, 15, 23, 0.96);
    border-bottom: 1px solid #1c2a37;
    backdrop-filter: blur(14px);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    color: var(--text-color);
    text-decoration: none;
}

.sidebar-brand-mark {
    display: grid;
    place-items: center;
    width: 39px;
    height: 39px;
    color: #061311;
    background: var(--accent-color);
    border-radius: 10px 10px 10px 3px;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: -0.04em;
    box-shadow: 0 0 26px rgba(61, 214, 198, 0.22);
}

.sidebar-brand strong,
.sidebar-brand small {
    display: block;
}

.sidebar-brand strong {
    font-size: 1.05rem;
    letter-spacing: 0.01em;
}

.sidebar-brand small {
    margin-top: 1px;
    color: var(--muted-text);
    font-size: 0.69rem;
    font-weight: 700;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.sidebar-nav {
    padding: 9px 10px 24px;
}

.sidebar-nav .nav-section-label {
    padding: 18px 11px 6px;
    color: #657b8e;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.sidebar-nav a {
    position: relative;
    gap: 11px;
    min-height: 41px;
    margin: 2px 0;
    padding: 9px 11px;
    color: #aebdcc;
    border: 1px solid transparent;
    border-left: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    transition: color 140ms ease, background 140ms ease, border-color 140ms ease;
}

.sidebar-nav a i {
    display: grid;
    place-items: center;
    width: 25px;
    height: 25px;
    color: #8ba1b4;
    background: #121e29;
    border: 1px solid #223343;
    border-radius: 6px;
    font-size: 0.78rem;
    font-style: normal;
    filter: grayscale(0.35);
}

.sidebar-nav a:hover {
    color: #fff;
    background: #121f2b;
    border-color: #223343;
    border-left-color: #223343;
}

.sidebar-nav a.active {
    color: #eafffc;
    background: rgba(61, 214, 198, 0.1);
    border-color: rgba(61, 214, 198, 0.24);
    border-left-color: var(--accent-color);
    font-weight: 750;
}

.sidebar-nav a.active::after {
    position: absolute;
    right: 10px;
    width: 5px;
    height: 5px;
    content: '';
    background: var(--accent-color);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-color);
}

.sidebar-nav a.active i {
    color: var(--accent-color);
    background: rgba(61, 214, 198, 0.1);
    border-color: rgba(61, 214, 198, 0.3);
    filter: none;
}

#sidebarLogoutItem {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #1c2a37;
}

#sidebarLogoutItem a:hover {
    color: #ff9b9b;
    background: rgba(255, 107, 107, 0.08);
    border-color: rgba(255, 107, 107, 0.16);
}

.main-content {
    margin-left: var(--sidebar-width);
    padding: 28px clamp(22px, 3.2vw, 48px) 60px;
}

.container {
    max-width: 1320px;
}

#sessionTopBar {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    min-height: 66px;
    margin: 0 0 28px;
    padding: 10px 12px 10px 14px;
    overflow: hidden;
    background: rgba(13, 22, 31, 0.88);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(14px);
}

#sessionTopBar::before {
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    content: '';
    background: var(--accent-color);
}

.session-server,
.session-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.session-server {
    min-width: 0;
}

.session-server-mark {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    color: var(--accent-color);
    background: rgba(61, 214, 198, 0.09);
    border: 1px solid rgba(61, 214, 198, 0.22);
    border-radius: 50%;
    font-weight: 800;
}

.session-server label small,
.session-server label strong {
    display: block;
    white-space: nowrap;
}

.session-server label small {
    color: var(--muted-text);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.session-server label strong {
    font-size: 0.86rem;
}

#sessionGuildSelect {
    width: auto;
    min-width: 220px;
    max-width: 340px;
    height: 40px;
    margin-left: 5px;
    padding-block: 7px;
    background-color: #0a121a;
}

header:not(.dashboard-hero),
.header {
    position: relative;
    padding: 4px 0 18px 19px;
    border-bottom: 1px solid var(--border-color);
}

header:not(.dashboard-hero)::before,
.header::before {
    position: absolute;
    top: 4px;
    bottom: 18px;
    left: 0;
    width: 4px;
    content: '';
    background: var(--accent-color);
    border-radius: 999px;
}

header h1,
.header h1 {
    color: var(--text-color);
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    font-weight: 770;
}

header p,
.header p,
.subtitle {
    max-width: 760px;
    color: var(--muted-text);
}

.card {
    background: rgba(16, 25, 35, 0.9);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: clamp(18px, 2.3vw, 26px);
    box-shadow: var(--shadow-sm);
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.card:hover {
    transform: none;
    border-color: #34495c;
    box-shadow: 0 13px 34px rgba(0, 0, 0, 0.25);
}

.card h2,
.card h3 {
    color: #f4f8fa;
}

.card h3 {
    display: flex;
    align-items: center;
    gap: 8px;
}

.card h3::before {
    width: 6px;
    height: 6px;
    flex: 0 0 auto;
    content: '';
    background: var(--accent-color);
    border-radius: 50%;
}

.panel-grid,
.status-grid,
.dashboard-hero {
    gap: 18px;
}

.dashboard-hero {
    grid-template-columns: minmax(0, 1.35fr) minmax(330px, 0.65fr);
    align-items: stretch;
}

.dashboard-hero .card {
    min-width: 0;
}

.hero-primary {
    position: relative;
    display: flex;
    min-height: 390px;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    background:
        linear-gradient(115deg, rgba(61, 214, 198, 0.11), transparent 42%),
        #101a24;
}

.hero-primary::after {
    position: absolute;
    top: -95px;
    right: -70px;
    width: 260px;
    height: 260px;
    content: '';
    border: 42px solid rgba(61, 214, 198, 0.055);
    border-radius: 50%;
    pointer-events: none;
}

.eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-color);
    font-size: 0.69rem;
    font-weight: 850;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.eyebrow > span {
    width: 7px;
    height: 7px;
    background: var(--accent-color);
    border-radius: 50%;
    box-shadow: 0 0 13px var(--accent-color);
}

.hero-primary h1 {
    position: relative;
    z-index: 1;
    max-width: 650px;
    margin: 20px 0 12px;
    font-size: clamp(2.6rem, 6vw, 5.25rem);
    font-weight: 780;
    line-height: 0.94;
    letter-spacing: -0.065em;
}

.hero-primary h1 em {
    color: var(--accent-color);
    font-style: normal;
}

.hero-copy {
    max-width: 610px;
    margin: 0 0 30px;
    color: #a9bac9;
    font-size: 1rem;
}

.stat-strip {
    position: relative;
    z-index: 1;
    gap: 1px;
    margin: 0;
    overflow: hidden;
    background: var(--border-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.mini-stat {
    min-width: 0;
    padding: 13px 14px;
    background: #0b141d;
    border: 0;
    border-radius: 0;
}

.mini-stat .label {
    overflow: hidden;
    color: #7f93a5;
    font-size: 0.67rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.mini-stat .value {
    color: #f7fafb;
    font-size: 1.45rem;
    font-variant-numeric: tabular-nums;
}

.quick-actions-card {
    display: flex;
    flex-direction: column;
}

.quick-actions-card h2 {
    margin: 14px 0 4px;
    font-size: 1.7rem;
}

.quick-actions-card .hero-actions {
    display: flex;
    margin-top: 19px;
    flex: 1;
    flex-direction: column;
    gap: 7px;
}

.quick-link {
    justify-content: space-between;
    min-height: 47px;
    padding: 11px 13px;
    color: #c8d4dd;
    border-left: 2px solid transparent;
    font-size: 0.87rem;
}

.quick-link b {
    color: #71879a;
    font-size: 0.82rem;
    transition: color 120ms ease, transform 120ms ease;
}

.quick-link:hover {
    color: #fff;
    background: #13212d;
    border-color: #2a4052;
    border-left-color: var(--accent-color);
    transform: none;
}

.quick-link:hover b {
    color: var(--accent-color);
    transform: translate(2px, -2px);
}

.panel-row,
.module-card,
.card-note,
.mini-stat,
.quick-link {
    background: #0d1721;
    border-color: #243546;
    border-radius: var(--radius-sm);
}

.panel-row {
    min-height: 45px;
    padding: 10px 13px;
}

.panel-row span:first-child {
    color: var(--soft-text);
}

.panel-row span:last-child {
    color: var(--text-color);
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.scroll-panel,
.message-list {
    background: #0a121a;
    border-color: var(--border-color);
    border-radius: var(--radius-md);
}

form {
    gap: 14px;
}

.form-group {
    gap: 7px;
    margin-bottom: 15px;
}

.form-group label,
label {
    color: var(--soft-text);
    font-size: 0.86rem;
    font-weight: 700;
}

.form-group small,
.info-text,
.muted-text,
.subtitle {
    color: var(--muted-text);
}

input,
select,
textarea,
.form-input,
.form-control {
    min-height: 43px;
    padding: 10px 12px;
    color: var(--text-color);
    background: #091119;
    border: 1px solid #2b3d4e;
    border-radius: var(--radius-sm);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.015);
}

textarea {
    min-height: 110px;
    line-height: 1.5;
    resize: vertical;
}

input::placeholder,
textarea::placeholder {
    color: #5f7487;
}

input:hover,
select:hover,
textarea:hover,
.form-input:hover,
.form-control:hover {
    border-color: #3a5064;
}

input:focus,
select:focus,
textarea:focus,
.form-input:focus,
.form-control:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(61, 214, 198, 0.12);
}

input[type="checkbox"],
input[type="radio"] {
    width: 17px;
    min-height: 17px;
    accent-color: var(--accent-color);
}

.btn,
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-success,
.btn-small,
.btn-edit,
.btn-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 40px;
    padding: 9px 14px;
    color: #dce7ed;
    background: #182635;
    border: 1px solid #304457;
    border-radius: var(--radius-sm);
    box-shadow: none;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 750;
    line-height: 1.1;
    text-decoration: none;
    transition: transform 120ms ease, filter 120ms ease, border-color 120ms ease;
}

.btn-primary,
.btn-success {
    color: #061311;
    background: var(--accent-color);
    border-color: var(--accent-color);
}

.btn-secondary,
.btn-edit {
    color: #dce7ed;
    background: #1b2a3a;
    border-color: #3a5065;
}

.btn-danger,
.btn-delete {
    color: #ffe3e3;
    background: rgba(255, 107, 107, 0.11);
    border-color: rgba(255, 107, 107, 0.4);
}

.btn:hover,
.btn-primary:hover,
.btn-secondary:hover,
.btn-danger:hover,
.btn-success:hover,
.btn-small:hover,
.btn-edit:hover,
.btn-delete:hover {
    opacity: 1;
    transform: translateY(-1px);
    filter: brightness(1.08);
}

.btn:active,
.btn-primary:active,
.btn-secondary:active,
.btn-danger:active,
.btn-success:active {
    transform: translateY(0);
}

.btn-sm,
.btn-small,
.btn-edit,
.btn-delete {
    min-height: 33px;
    padding: 7px 10px;
    font-size: 0.78rem;
}

button:disabled,
.btn:disabled,
input:disabled,
select:disabled,
textarea:disabled {
    cursor: not-allowed;
    opacity: 0.48;
}

.text-link {
    color: var(--accent-color);
    text-underline-offset: 3px;
}

.text-link:hover {
    color: #9ff9ef;
}

.message,
.error-banner {
    border-radius: var(--radius-sm);
    font-weight: 650;
}

.message-success {
    color: #9af0b7;
    background: rgba(101, 214, 141, 0.09);
    border-color: rgba(101, 214, 141, 0.35);
}

.message-error,
.error-banner {
    color: #ffaaaa;
    background: rgba(255, 107, 107, 0.09);
    border-color: rgba(255, 107, 107, 0.35);
}

.message-info {
    color: #8dece2;
    background: rgba(61, 214, 198, 0.08);
    border-color: rgba(61, 214, 198, 0.3);
}

.status-indicator {
    flex: 0 0 auto;
}

div.status-indicator {
    width: auto;
    height: auto;
    margin: 0;
    padding: 8px 11px;
    color: var(--soft-text);
    background: #0b141d;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 700;
}

div.status-indicator.status-enabled {
    color: #9af0b7;
    background: rgba(101, 214, 141, 0.09);
    border-color: rgba(101, 214, 141, 0.3);
}

div.status-indicator.status-disabled {
    color: #ffaaaa;
    background: rgba(255, 107, 107, 0.09);
    border-color: rgba(255, 107, 107, 0.3);
}

.status-enabled,
.status-online {
    color: var(--green);
}

.status-disabled,
.status-offline {
    color: var(--red);
}

.status-checking {
    color: var(--warning);
}

.module-card {
    padding: 16px 18px;
}

.module-toggle {
    width: 48px;
    height: 26px;
}

.slider {
    background: #344657;
    border: 1px solid #45596d;
}

.slider::before {
    background: #d7e2e9;
}

.module-toggle input:checked + .slider {
    background: rgba(61, 214, 198, 0.75);
    border-color: var(--accent-color);
}

.module-toggle input:checked + .slider::before {
    background: #071311;
}

.server-table {
    display: block;
    width: 100%;
    overflow-x: auto;
    background: #0b141d;
    border-color: var(--border-color);
    border-radius: var(--radius-md);
    white-space: nowrap;
}

.server-table thead tr {
    background: #0c151e;
}

.server-table th {
    color: #7f95a8;
    font-size: 0.71rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.server-table th,
.server-table td {
    padding: 13px 14px;
}

.server-table tbody tr:hover {
    background: rgba(61, 214, 198, 0.045);
}

.modal {
    display: none;
    padding: 20px;
    background: rgba(2, 6, 10, 0.78);
    backdrop-filter: blur(8px);
}

.modal-content {
    margin: min(9vh, 70px) auto;
    padding: 24px;
    background: #111b25;
    border-color: #34495a;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.close {
    display: grid;
    place-items: center;
    width: 35px;
    height: 35px;
    color: var(--muted-text);
    background: #172431;
    border-radius: 50%;
    font-size: 1.2rem;
}

.message-preview {
    background: #17202b;
    border-color: #2f4051;
    border-radius: var(--radius-md);
}

.discord-avatar,
.message-number {
    color: #061311;
    background: var(--accent-color);
}

.monospace,
code {
    color: #8dece2;
    background: #091119;
    border: 1px solid #203243;
    border-radius: 5px;
    font-family: "Cascadia Code", Consolas, monospace;
}

.login-page {
    position: relative;
    overflow: hidden;
    background-color: #070c12;
    background-image:
        linear-gradient(rgba(61, 214, 198, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(61, 214, 198, 0.035) 1px, transparent 1px),
        radial-gradient(circle at 50% 0%, rgba(61, 214, 198, 0.14), transparent 40rem);
    background-size: 42px 42px, 42px 42px, auto;
}

.login-shell {
    max-width: 460px;
}

.login-panel {
    position: relative;
    padding: clamp(24px, 5vw, 38px);
    overflow: hidden;
    background: rgba(13, 22, 31, 0.96);
    border-color: #304252;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.login-panel::before {
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    content: '';
    background: var(--accent-color);
}

.login-header h1 {
    font-size: 2rem;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 27px;
    color: var(--muted-text);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.login-brand span {
    display: grid;
    place-items: center;
    width: 31px;
    height: 31px;
    color: #061311;
    background: var(--accent-color);
    border-radius: 8px 8px 8px 3px;
    font-size: 0.66rem;
    letter-spacing: -0.03em;
}

.btn-discord {
    min-height: 48px;
    color: #fff;
    background: #5865f2;
    border-radius: var(--radius-sm);
}

.sidebar-overlay {
    display: none;
}

.access-page {
    min-height: 100vh;
    background-color: #070c12;
}

.access-shell {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
}

.access-panel {
    position: relative;
    width: 100%;
    max-width: 640px;
}

.access-panel .card {
    position: relative;
    z-index: 1;
    padding: clamp(28px, 6vw, 50px);
}

.access-code {
    position: absolute;
    top: -100px;
    right: -5px;
    color: rgba(61, 214, 198, 0.06);
    font-size: clamp(9rem, 30vw, 17rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.1em;
}

.access-mark {
    display: grid;
    width: 45px;
    height: 45px;
    margin-bottom: 24px;
    place-items: center;
    color: #190909;
    background: var(--red);
    border-radius: 12px 12px 12px 4px;
    font-size: 1.3rem;
    font-weight: 900;
}

.access-panel h1 {
    margin: 11px 0 12px;
}

.access-panel p {
    max-width: 510px;
}

.access-actions {
    display: flex;
    gap: 9px;
    margin-top: 25px;
    flex-wrap: wrap;
}

@media (max-width: 1100px) {
    .main-content {
        padding-inline: 24px;
    }

    #sessionTopBar {
        align-items: flex-start;
        flex-direction: column;
    }

    .session-server,
    .session-actions {
        width: 100%;
    }

    .session-actions {
        justify-content: flex-end;
    }

    .dashboard-hero {
        grid-template-columns: 1fr;
    }

    .hero-primary {
        min-height: 360px;
    }

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

@media (max-width: 768px) {
    body.sidebar-open {
        overflow: hidden;
    }

    .sidebar {
        width: min(86vw, 310px);
        transform: translateX(-105%);
        box-shadow: 24px 0 70px rgba(0, 0, 0, 0.55);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        z-index: 999;
        display: block;
        visibility: hidden;
        padding: 0;
        background: rgba(2, 7, 11, 0.68);
        border: 0;
        opacity: 0;
        pointer-events: none;
        backdrop-filter: blur(3px);
        transition: opacity 180ms ease, visibility 180ms ease;
    }

    body.sidebar-open .sidebar-overlay {
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
    }

    body:has(.sidebar.open) {
        overflow: hidden;
    }

    .sidebar.open ~ .sidebar-overlay {
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
    }

    .main-content {
        margin-left: 0;
        padding: 76px 14px 40px;
    }

    .sidebar-toggle {
        top: 16px;
        left: 16px;
        z-index: 1001;
        display: grid;
        place-content: center;
        gap: 4px;
        width: 43px;
        height: 43px;
        padding: 0;
        color: var(--text-color);
        background: #111c27;
        border: 1px solid #304456;
        border-radius: 10px;
        box-shadow: var(--shadow-sm);
    }

    .sidebar-toggle span {
        display: block;
        width: 18px;
        height: 2px;
        background: var(--accent-color);
        border-radius: 3px;
    }

    #sessionTopBar {
        gap: 13px;
        padding: 14px;
    }

    .session-server {
        display: grid;
        grid-template-columns: 36px 1fr;
    }

    #sessionGuildSelect {
        grid-column: 1 / -1;
        width: 100%;
        min-width: 0;
        max-width: none;
        margin: 2px 0 0;
    }

    .session-actions {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    }

    .session-actions .btn {
        width: 100%;
    }

    .card {
        padding: 18px;
    }

    .hero-primary {
        min-height: 430px;
    }

    .hero-primary h1 {
        font-size: clamp(2.6rem, 14vw, 4rem);
    }

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

    .quick-actions-card .hero-actions {
        grid-template-columns: 1fr;
    }

    .panel-grid,
    .status-grid {
        display: block;
    }

    .panel-grid > .card,
    .status-grid > .card {
        margin-bottom: 14px;
    }

    .module-card,
    .section-toolbar,
    .button-group {
        align-items: stretch;
        flex-direction: column;
    }

    .button-group .btn,
    .section-toolbar .btn {
        width: 100%;
    }

    .status-item {
        grid-template-columns: 1fr;
        gap: 3px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
