* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0a0a0a;
    color: #e0e0e0;
    line-height: 1.6;
}

/* Nav */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid #1a1a1a;
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: white;
    font-weight: 400;
    font-size: 1.2rem;
}

.nav-logo img {
    height: 32px;
    width: auto;
    border-radius: 4px;
}

#auth-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #aaa;
    font-size: 0.85rem;
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

/* Main */
main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 80px 24px 40px;
}

.loading {
    text-align: center;
    color: #666;
    padding: 60px 0;
    font-size: 1rem;
}

/* Login screen */
.login-screen {
    text-align: center;
    padding: 80px 0;
}

.login-screen h1 {
    font-size: 2rem;
    color: white;
    margin-bottom: 8px;
}

.login-screen p {
    color: #888;
    margin-bottom: 24px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-discord {
    background: #5865f2;
    color: white;
}

.btn-discord:hover {
    background: #4752c4;
}

.btn-primary {
    background: #b44aff;
    color: white;
}

.btn-primary:hover {
    background: #9a3de0;
}

.btn-secondary {
    background: #1a1a1a;
    color: #ccc;
    border: 1px solid #333;
}

.btn-secondary:hover {
    border-color: #555;
    color: white;
}

.btn-danger {
    background: #ff4444;
    color: white;
}

.btn-danger:hover {
    background: #cc3333;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

.btn-logout {
    background: none;
    border: 1px solid #333;
    color: #888;
    padding: 6px 14px;
    font-size: 0.8rem;
}

.btn-logout:hover {
    border-color: #ff4444;
    color: #ff4444;
}

/* Guild select */
.guild-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.guild-card {
    background: #1a1a1a;
    border: 1px solid #252525;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.guild-card:hover {
    border-color: #b44aff;
    box-shadow: 0 0 20px rgba(180, 74, 255, 0.1);
}

.guild-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #252525;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.guild-icon img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.guild-name {
    font-weight: 500;
    color: white;
    font-size: 0.95rem;
}

.guild-status {
    font-size: 0.75rem;
    color: #666;
}

/* Dashboard layout */
.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.dashboard-header h1 {
    font-size: 1.5rem;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dashboard-header h1 img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.section-tabs {
    display: flex;
    gap: 4px;
    background: #111;
    padding: 4px;
    border-radius: 10px;
    margin-bottom: 24px;
}

.section-tab {
    padding: 8px 18px;
    border: none;
    background: none;
    color: #888;
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}

.section-tab:hover {
    color: #ccc;
}

.section-tab.active {
    background: #1a1a1a;
    color: white;
}

/* Cards */
.card {
    background: #1a1a1a;
    border: 1px solid #252525;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: white;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

/* Setting row */
.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #1f1f1f;
}

.setting-row:last-child {
    border-bottom: none;
}

.setting-label {
    font-size: 0.85rem;
    color: #aaa;
}

.setting-value {
    font-size: 0.85rem;
    color: white;
    text-align: right;
}

.setting-value .badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
}

.badge-on {
    background: rgba(0, 222, 59, 0.15);
    color: #00de3b;
}

.badge-off {
    background: rgba(255, 68, 68, 0.15);
    color: #ff4444;
}

/* Toggle */
.toggle {
    width: 40px;
    height: 22px;
    background: #333;
    border-radius: 11px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
    border: none;
}

.toggle.active {
    background: #b44aff;
}

.toggle::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
}

.toggle.active::after {
    transform: translateX(18px);
}

/* Input / Select */
.input, .select {
    background: #111;
    border: 1px solid #333;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-family: inherit;
    width: 100%;
    transition: border-color 0.2s;
}

.input:focus, .select:focus {
    outline: none;
    border-color: #b44aff;
}

.textarea {
    background: #111;
    border: 1px solid #333;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-family: inherit;
    width: 100%;
    min-height: 80px;
    resize: vertical;
}

.textarea:focus {
    outline: none;
    border-color: #b44aff;
}

.form-group {
    margin-bottom: 12px;
}

.form-label {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 4px;
    display: block;
}

/* Category cards */
.cat-card {
    background: #111;
    border: 1px solid #252525;
    border-radius: 8px;
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cat-emoji {
    font-size: 1.4rem;
}

.cat-info {
    flex: 1;
}

.cat-name {
    font-weight: 500;
    color: white;
    font-size: 0.9rem;
}

.cat-meta {
    font-size: 0.75rem;
    color: #666;
}

.cat-actions {
    display: flex;
    gap: 6px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.modal {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 14px;
    padding: 24px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    margin-bottom: 16px;
}

.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 16px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 10px;
    padding: 12px 20px;
    color: white;
    font-size: 0.85rem;
    z-index: 3000;
    animation: slideIn 0.3s ease;
}

.toast.success { border-color: #00de3b; }
.toast.error { border-color: #ff4444; }

@keyframes slideIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Server list (Pro Plan style) */
.server-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: #b44aff;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.server-card {
    background: #1a1a1a;
    border: 1px solid #252525;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transition: border-color 0.2s;
}

.server-card:hover {
    border-color: #333;
}

.server-card-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.server-id {
    font-size: 0.75rem;
    color: #555;
}

.server-status {
    font-size: 0.8rem;
}

.server-card-actions {
    flex-shrink: 0;
}

/* Discord links */
.link-icon {
    color: #b44aff;
    margin-left: 6px;
    font-size: 0.75rem;
    text-decoration: none;
    transition: color 0.2s;
}

.link-icon:hover {
    color: #d080ff;
}

/* Form layout */
.form-row {
    display: flex;
    gap: 12px;
}

.form-half {
    flex: 1;
}

.form-third {
    flex: 1;
    min-width: 0;
}

.form-hint {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 12px;
}

.form-hint-inline {
    font-size: 0.75rem;
    color: #555;
    font-weight: 400;
}

.form-hint-block {
    display: block;
    font-size: 0.75rem;
    color: #555;
    margin-top: 2px;
}

/* Section tab icons */
.section-tab i {
    margin-right: 4px;
    font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 600px) {
    .dashboard-header { flex-direction: column; align-items: flex-start; }
    .section-tabs { overflow-x: auto; }
    .guild-grid { grid-template-columns: 1fr; }
    .card-grid { grid-template-columns: 1fr; }
    .form-row { flex-direction: column; }
}
