body {
    font-family: Arial, sans-serif;
    background: #05070d;
    color: #e2e8f0;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 600px;
    margin: 120px auto;
    background: #0e1526;
    padding: 32px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid #2b3a5c;
}

.logo {
    width: 96px;
    height: fit-content;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    object-fit: contain;
    margin-bottom: 16px;
    border-radius: 50%;
    background: #0f172a;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 40px;
    background: #0e1526;
    border-bottom: 1px solid #2b3a5c;
}

.header-sticky {
    position: sticky;
    top: 0;
    z-index: 30;
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.panel {
    max-width: 900px;
    margin: 40px auto;
    padding: 24px;
    background: #0e1526;
    border-radius: 12px;
    border: 1px solid #2b3a5c;
    box-shadow: 0 12px 36px rgba(2, 6, 23, 0.6);
}

.settings-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 20px;
    margin-top: 16px;
}

.settings-sidebar {
    background: #0f172a;
    border: 1px solid #2b3a5c;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: sticky;
    top: 24px;
    height: calc(100vh - 40px);
    max-height: calc(100vh - 40px);
    overflow-y: scroll;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.has-sidebar .settings-layout {
    display: block;
    margin-top: 0;
}

.has-sidebar .settings-sidebar {
    position: fixed;
    left: 0;
    top: 96px;
    bottom: 0;
    width: 220px;
    border-radius: 0;
    border-left: none;
    border-top: none;
    border-bottom: none;
    height: calc(100vh - 96px);
    overflow-y: scroll;
    padding-bottom: 16px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    z-index: 20;
}

.settings-sidebar::-webkit-scrollbar {
    width: 8px;
}

.settings-sidebar::-webkit-scrollbar-thumb {
    background: #1f2f54;
    border-radius: 999px;
}

.settings-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.has-sidebar .header {
    margin-left: 0;
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 40;
}

.has-sidebar .panel {
    max-width: none;
    margin: 24px 40px 40px 260px;
}

@media (max-width: 1024px) {
    .has-sidebar .header {
        margin-left: 0;
    }

    .has-sidebar .panel {
        margin: 24px 16px;
    }

    .has-sidebar .settings-sidebar {
        position: relative;
        width: auto;
        height: auto;
        max-height: none;
        overflow: visible;
        border-radius: 12px;
        border: 1px solid #2b3a5c;
    }

    .settings-layout {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }
}

@media (max-width: 640px) {
    .header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
        padding: 16px;
    }

    .panel {
        padding: 16px;
    }

    .settings-sidebar {
        padding: 12px;
    }

    .sidebar-link {
        font-size: 0.9rem;
        padding: 8px 10px;
    }
}

.sidebar-title {
    margin: 0 0 6px;
    font-size: 0.9rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.sidebar-link {
    text-decoration: none;
    color: #e2e8f0;
    padding: 10px 12px;
    border-radius: 8px;
    background: #0f1f3d;
    border: 1px solid #1f2f54;
    font-weight: 600;
    letter-spacing: 0.2px;
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.05);
    position: relative;
}

.sidebar-link:hover {
    border-color: #60a5fa;
    background: #162a52;
    color: #ffffff;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.sidebar-link.active {
    border-color: #3b82f6;
    background: #1a2f5f;
    color: #ffffff;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35);
}

.sidebar-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 6px;
    background: #3b82f6;
    opacity: 0.6;
}

.module-section {
    display: none;
}

.module-section.active {
    display: block;
}

.settings-content {
    min-width: 0;
}

.section-title {
    margin: 18px 0 8px;
    font-size: 1.1rem;
    border-bottom: 1px solid #2b3a5c;
    padding-bottom: 6px;
}

.inline-fields {
    display: flex;
    gap: 10px;
    align-items: center;
}

.inline-fields input {
    flex: 1;
}

.image-preview {
    background: #0b1324;
    border: 1px dashed #2b3a5c;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 120px;
}

.image-preview img {
    max-width: 100%;
    max-height: 360px;
    border-radius: 10px;
    display: block;
}

.notice {
    padding: 10px 14px;
    border-radius: 8px;
    margin: 12px 0 18px;
    font-size: 0.95rem;
}

.notice-warn {
    background: #f59e0b;
    color: #0f172a;
    font-weight: 600;
}

.notice-ok {
    background: #22c55e;
    color: #0f172a;
    font-weight: 600;
}

.button {
    display: inline-block;
    padding: 10px 18px;
    background: #3b82f6;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
}

.button-secondary {
    background: #334155;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.guilds {
    list-style: none;
    padding: 0;
    margin: 20px 0 0;
}

.guilds li {
    padding: 12px 16px;
    background: #16233d;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #2b3a5c;
}

.guild-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.guild-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #111827;
}

.muted {
    display: block;
    color: #94a3b8;
    font-size: 0.85rem;
    margin-top: 2px;
}

.badge {
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #0f172a;
}

.badge-ok {
    background: #22c55e;
}

.badge-off {
    background: #f59e0b;
}

.stats-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stats-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
    background: #111c34;
    border: 1px solid #2b3a5c;
    border-radius: 8px;
}

.export-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
    align-items: flex-end;
}

.chart {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.chart-row {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr) 60px;
    align-items: center;
    gap: 10px;
    background: #111c34;
    border: 1px solid #2b3a5c;
    border-radius: 8px;
    padding: 8px 10px;
}

.chart-label {
    font-size: 0.9rem;
    color: #cbd5f5;
}

.chart-bar {
    height: 10px;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    border-radius: 999px;
    display: block;
}

.chart-value {
    text-align: right;
    font-weight: 600;
    color: #e2e8f0;
}

.table {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.table-head,
.table-row {
    display: grid;
    grid-template-columns: 120px 1fr 1fr 1fr 180px;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    background: #111c34;
    border: 1px solid #2b3a5c;
    border-radius: 8px;
    font-size: 0.9rem;
}

.table.economy-table .table-head,
.table.economy-table .table-row {
    grid-template-columns: 180px 90px 140px 90px 90px 180px;
}

.table.audit-table .table-head,
.table.audit-table .table-row {
    grid-template-columns: 160px 120px 180px 1fr;
}

.table-head {
    background: #0f172a;
    font-weight: 700;
}

.row-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.95rem;
}

.field input,
.field select,
.field textarea {
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #3b4c74;
    background: #1b2a49;
    color: #e2e8f0;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.3);
}

.field textarea {
    resize: vertical;
}

.checkbox {
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
}

.hint {
    color: #94a3b8;
    font-size: 0.85rem;
}

@media (max-width: 1024px) {
    .settings-layout {
        grid-template-columns: 1fr;
    }

    .settings-sidebar {
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
    }
}

.mention-suggestions {
    position: absolute;
    z-index: 1000;
    background: #0f131a;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    max-height: 240px;
    overflow-y: auto;
}

.mention-suggestions .mention-item {
    padding: 8px 12px;
    cursor: pointer;
    color: #e2e8f0;
    font-size: 14px;
}

.mention-suggestions .mention-item:hover,
.mention-suggestions .mention-item.active {
    background: rgba(56, 189, 248, 0.15);
    color: #7dd3fc;
}
