* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #111;
    color: #eee;
}

body {
    min-height: 100vh;
}

.layout {
    display: flex;
    min-height: 100vh;
}

.page-top {
    position: sticky;
    top: 0;
    z-index: 10;
    padding-bottom: 20px;
    background: #111;
}

.page-tools {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
}

.page-tools .server-select {
    width: 280px;
    flex-shrink: 0;
    margin-bottom: 0;
}

.page-tools .search {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
}

/* Bot profile */

.bot-profile {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
    padding: 16px;
    background: #181818;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
}

.bot-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
}

.bot-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.bot-name {
    font-size: 18px;
    font-weight: 600;
}

.bot-status {
    color: #888;
    font-size: 13px;
}

/* Server select */

.server-select {
    position: relative;
    width: 280px;
    margin-bottom: 10px;
}

.server-select-current {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #333;
    border-radius: 6px;
    background: #202020;
    color: #eee;
    font-size: 14px;
}

.server-select-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border-radius: 50%;
    object-fit: cover;
}

.server-select-icon-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2a2a2a;
    color: #aaa;
    font-size: 12px;
}

.server-select-dropdown {
    position: absolute;
    inset: 0;
    width: 100%;
    opacity: 0;
    cursor: pointer;
}

/* Sidebar */

.sidebar {
    width: 220px;
    min-height: 100vh;
    padding: 20px 12px;
    background: #181818;
    border-right: 1px solid #2a2a2a;
    flex-shrink: 0;
}

.logo {
    padding: 0 10px 20px;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.nav a {
    display: block;
    padding: 8px 10px;
    border-radius: 6px;
    color: #999;
    text-decoration: none;
    font-size: 14px;
}

.nav a:hover {
    background: #242424;
    color: #fff;
}

.nav a.active {
    background: #2c2c2c;
    color: #fff;
}

/* Main content */

.content {
    flex: 1;
    min-width: 0;
    padding: 32px;
}

.header {
    margin-bottom: 28px;
}

.header h1 {
    margin: 0 0 6px;
    font-size: 26px;
    font-weight: 600;
}

.header p {
    margin: 0;
    color: #888;
    font-size: 14px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

/* Cards */

.cards {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 1rem;
}

.card {
    padding: 18px;
    background: #181818;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
}

.card-title {
    margin-bottom: 10px;
    color: #888;
    font-size: 13px;
}

.card-value {
    font-size: 22px;
    font-weight: 600;
}

/* User profile */

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 50%;
    object-fit: cover;
}

.user-avatar-default {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    overflow: hidden;
}

.user-avatar-default img {
    width: 70%;
    height: 70%;
    object-fit: contain;
}

.user-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    line-height: 18px;
}

.user-username {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 17px;
}

.user-action {
    margin-top: 1px;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 16px;
    text-decoration: none;
}

.user-action:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

/* Status */

.status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4caf50;
}

.status-dot.offline {
    background: #777;
}

/* Buttons */

.button {
    display: inline-block;
    padding: 7px 12px;
    border: 1px solid #333;
    border-radius: 6px;
    background: #202020;
    color: #eee;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
}

.button:hover {
    background: #292929;
}

.button-primary {
    background: #eee;
    border-color: #eee;
    color: #111;
}

.button-primary:hover {
    background: #ddd;
}

.button:disabled {
    opacity: 0.4;
    cursor: default;
}

.button:disabled:hover {
    background: #202020;
}

.button-primary:disabled:hover {
    background: #eee;
}

/* Editable tables */

.editable-table {
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    overflow: hidden;
}

.editable-table-header,
.editable-row {
    display: grid;
    grid-template-columns: 280px 1fr 48px;
}

.editable-table-header {
    padding: 10px 16px;
    background: #181818;
    border-bottom: 1px solid #2a2a2a;
    color: #888;
    font-size: 13px;
}

.editable-row {
    min-height: 64px;
    border-bottom: 1px solid #242424;
}

.editable-row:last-of-type {
    border-bottom: 0;
}

.editable-cell {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    min-width: 0;
}

.editable-cell input,
.editable-cell select {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #333;
    border-radius: 6px;
    background: #202020;
    color: #eee;
    font: inherit;
    font-size: 14px;
}

.editable-cell input:hover,
.editable-cell select:hover {
    border-color: #444;
}

.editable-cell input:focus,
.editable-cell select:focus {
    outline: none;
    border-color: #666;
}

.editable-actions {
    display: flex;
    align-items: center;
    justify-content: center;
}

.editable-remove {
    padding: 4px;
    border: 0;
    background: transparent;
    color: #777;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.editable-remove:hover {
    color: #fff;
}

.editable-add {
    width: 100%;
    padding: 10px;
    border: 0;
    border-top: 1px solid #2a2a2a;
    background: #181818;
    color: #888;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.editable-add:hover {
    background: #202020;
    color: #fff;
}

/* Passwords */

.password-input {
    position: relative;
    width: 100%;
}

.password-input input {
    padding-right: 40px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    padding: 4px;
    border: 0;
    background: transparent;
    color: #777;
    font-size: 15px;
    cursor: pointer;
}

.password-toggle:hover {
    color: #fff;
}

/* Guilds */

.guild-info,
.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.guild-icon,
.user-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 50%;
    background: #2a2a2a;
    color: #aaa;
    font-size: 14px;
}

.guild-name,
.user-name {
    font-size: 14px;
    font-weight: 500;
}

.features {
    display: flex;
    align-items: center;
    align-content: center;
    flex-wrap: wrap;
    gap: 6px;
}

.feature {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 7px 5px 9px;
    border: 1px solid #333;
    border-radius: 5px;
    background: #202020;
    color: #ccc;
    font-size: 13px;
}

.feature-remove {
    padding: 0;
    border: 0;
    background: transparent;
    color: #777;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
}

.feature-remove:hover {
    color: #fff;
}

.feature-add {
    width: 27px;
    height: 27px;
    padding: 0;
    border: 1px dashed #444;
    border-radius: 5px;
    background: transparent;
    color: #888;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.feature-add:hover {
    border-color: #666;
    color: #fff;
}

/* Page actions */

.page-actions {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 100;
    display: flex;
    gap: 8px;
}

.page-actions .button:not(.button-primary):hover {
    background: #292929;
    color: #eee;
}

.page-actions .button:not(.button-primary):disabled {
    opacity: 0.4;
    color: #eee;
    background: #202020;
}

.page-actions .button:not(.button-primary):disabled:hover {
    background: #202020;
    color: #eee;
}

/* Anime */

.anime-name {
    color: #ccc;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.anime-name:hover {
    color: #fff;
}

/* Logs */

.log-file {
    color: #ccc;
    text-decoration: none;
    font-size: 14px;
}

.log-file:hover {
    color: #fff;
}

/* Search */

.search {
    display: flex;
    gap: 8px;
}

.search input {
    flex: 1;
    min-width: 0;
    padding: 7px 10px;
    border: 1px solid #333;
    border-radius: 6px;
    background: #202020;
    color: #eee;
    font: inherit;
    font-size: 14px;
}

.search input:hover {
    border-color: #444;
}

.search input:focus {
    outline: none;
    border-color: #666;
}

.search input::placeholder {
    color: #666;
}

/* Mobile */

@media (max-width: 700px) {
    .sidebar {
        width: 180px;
    }

    .content {
        padding: 20px;
    }

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

    .editable-table-header {
        display: none;
    }

    .editable-row {
        grid-template-columns: 1fr 48px;
    }

    .editable-row .editable-cell:first-child {
        grid-column: 1;
    }

    .editable-row .editable-cell:nth-child(2) {
        grid-column: 1;
        padding-top: 0;
    }

    .editable-actions {
        grid-column: 2;
        grid-row: 1 / 3;
    }
}

