@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;600;700&display=swap');

:root {
    --bg: #0f1d1f;
    --bg-soft: #162b2f;
    --accent: #00c2a8;
    --accent-2: #ffb347;
    --card: #f7f4ed;
    --text: #101717;
    --muted: #5a6a6a;
    --shadow: rgba(12, 32, 35, 0.2);
    --header-bg: linear-gradient(120deg, #0b2b33 0%, #0b3a52 55%, #0b4b63 100%);
    --footer-bg: linear-gradient(120deg, #0a1f28 0%, #0b2b33 100%);
    --header-shadow: 0 6px 24px rgba(8, 20, 22, 0.35);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Space Grotesk', sans-serif;
    min-height: 100vh;
    color: var(--text);
}

.dashboard-body {
    background: #f5f5f5;
}

.settings-body,
.users-body {
    background: radial-gradient(circle at top, #1b3a3f 0%, #0f1d1f 60%);
}

.auth-body {
    background: linear-gradient(135deg, #0f1d1f 0%, #1c3d40 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.dashboard-body,
.settings-body,
.users-body {
    padding-top: 84px;
    padding-bottom: 70px;
}

.auth-body {
    padding-bottom: 70px;
}

.header {
    padding: 1.25rem 2rem;
    color: white;
    height: 84px;
    display: flex;
    align-items: center;
}

.dashboard-body .header,
.settings-body .header,
.users-body .header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--header-bg);
    box-shadow: var(--header-shadow);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(0, 194, 168, 0.15);
}

.header.dashboard-header {
    background: var(--header-bg);
    color: white;
    box-shadow: var(--header-shadow);
}

.header-inner,
.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 1.5rem;
    margin: 0;
    font-weight: 700;
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand h1 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
}

.brand p {
    margin: 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.75);
}

.title {
    font-size: 2rem;
    font-weight: 700;
}

.subtitle {
    color: rgba(255,255,255,0.75);
    margin-top: 0.5rem;
}

.nav {
    display: flex;
    gap: 0.75rem;
}

.link {
    color: #fff;
    background: rgba(255,255,255,0.14);
    padding: 0.4rem 0.9rem;
    border-radius: 8px;
    text-decoration: none;
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(8px);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.link:hover {
    background: rgba(0, 194, 168, 0.25);
    border-color: rgba(0, 194, 168, 0.5);
    color: #00f5d4;
}

.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.container.spacious {
    margin: 0 auto 3rem;
    padding: 0 2rem 3rem;
}

.panel {
    background: var(--card);
    border-radius: 16px;
    box-shadow: 0 12px 30px var(--shadow);
    padding: 2rem;
    margin-top: -2rem;
}

.dashboard-body .panel,
.settings-body .panel,
.users-body .panel {
    margin-top: 0;
}

.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--footer-bg);
    color: #d2e6e6;
    padding: 1rem 2rem;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid rgba(0, 194, 168, 0.25);
    height: 70px;
    backdrop-filter: blur(8px);
}

.footer a {
    color: var(--accent);
    text-decoration: none;
}

.card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}

.card-title {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 1.5rem;
}

.nav-links {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.nav-link {
    background: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.nav-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    text-align: right;
}

.user-name {
    font-weight: 600;
}

.user-role {
    font-size: 0.875rem;
    opacity: 0.9;
}

.logout-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
}

.logout-btn:hover {
    background: rgba(255,255,255,0.3);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.25rem;
}

.stat-label {
    color: #666;
    font-size: 0.875rem;
}

.activity-list {
    list-style: none;
}

.activity-item {
    padding: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-user {
    font-weight: 600;
    color: #2f6c66;
}

.activity-action {
    color: #333;
    margin: 0.25rem 0;
}

.activity-time {
    color: #999;
    font-size: 0.875rem;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #999;
}

.guilds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.guild-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.guild-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-weight: 700;
    color: #475569;
}

.guild-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.guild-name {
    font-weight: 600;
    color: #0f172a;
}

.guild-meta {
    font-size: 0.85rem;
    color: #64748b;
}

.alert {
    padding: 1rem 1.25rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
}

.alert.success {
    background: #e7f7f3;
    color: #0a7a68;
}

.alert.error {
    background: #ffe8e8;
    color: #b32424;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.field {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.field label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.field small {
    color: var(--muted);
    display: block;
    margin-top: 0.5rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    border: 1px solid #d8d5ce;
    font-size: 0.95rem;
    font-family: inherit;
    background: #fffdf8;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.actions {
    margin-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.btn {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #10211f;
    border: none;
    padding: 0.9rem 2rem;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 194, 168, 0.35);
}

.hint {
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
}

.login-container,
.install-container,
.error-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    padding: 3rem 2.5rem;
    max-width: 500px;
    width: 100%;
    text-align: center;
}

.install-container {
    text-align: left;
}

.login-container h1,
.install-container h1 {
    color: #333;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.login-container .subtitle,
.install-container .subtitle {
    color: #666;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

label {
    display: block;
    color: #333;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.btn.full {
    width: 100%;
}

.error {
    background: #fee;
    color: #c33;
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    text-align: center;
}

.success {
    background: #efe;
    color: #3c3;
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    text-align: center;
}

.already-installed {
    text-align: center;
    padding: 2rem;
}

.already-installed h2 {
    color: #4CAF50;
    margin-bottom: 1rem;
}

.discord-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1rem;
    background: #5865F2;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.discord-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(88, 101, 242, 0.4);
    background: #4752C4;
}

.discord-icon {
    width: 24px;
    height: 24px;
}

.back-link {
    margin-top: 2rem;
}

.back-link a,
.link-plain {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.back-link a:hover,
.link-plain:hover {
    text-decoration: underline;
}

.info {
    background: #e3f2fd;
    color: #1976d2;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.error-message {
    color: #666;
    margin-bottom: 2rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    text-align: left;
    padding: 0.75rem;
    border-bottom: 1px solid #e1ded8;
}

th {
    font-weight: 600;
    color: var(--muted);
}

.badge {
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    background: #e7f7f3;
    color: #0a7a68;
    font-size: 0.8rem;
    font-weight: 600;
}

.role-form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.note {
    color: var(--muted);
    margin-top: 1rem;
    font-size: 0.9rem;
}

.error-container h1 {
    color: #c33;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.btn.small {
    padding: 0.35rem 0.8rem;
}

@media (max-width: 768px) {
    .header-inner,
    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .actions {
        flex-direction: column;
        align-items: stretch;
    }

    table {
        font-size: 0.9rem;
    }
}
