/* Fantastical Portal */
:root {
    --bg: #0f1117;
    --surface: #1a1d27;
    --surface2: #232733;
    --surface3: #2a2e3d;
    --border: #2d3142;
    --border-light: #3a3f54;
    --text: #e4e4e7;
    --text-muted: #8b8fa3;
    --text-sm: 0.8rem;
    --accent: #6c63ff;
    --accent-hover: #5a52e0;
    --accent-dim: rgba(108, 99, 255, 0.12);
    --green: #34d399;
    --green-dim: rgba(52, 211, 153, 0.12);
    --red: #f87171;
    --red-dim: rgba(248, 113, 113, 0.12);
    --yellow: #fbbf24;
    --radius: 8px;
    --radius-sm: 5px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ── Login ─────────────────────────────────────────── */

.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.login-error {
    background: var(--red-dim);
    color: var(--red);
    border: 1px solid rgba(248, 113, 113, 0.25);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 0.85rem;
    margin-bottom: 20px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.form-group input {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-group input::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.login-btn {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 4px;
}

.login-btn:hover {
    background: var(--accent-hover);
}

.login-footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 24px;
}

/* ── Dashboard Header ──────────────────────────────── */

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.header-brand h1 {
    font-size: 1.15rem;
    font-weight: 600;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-name {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.logout-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    padding: 4px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.logout-link:hover {
    color: var(--text);
    border-color: var(--border-light);
}

/* ── Dashboard Main ────────────────────────────────── */

.dashboard-main {
    padding: 48px 32px;
    max-width: 1200px;
    margin: 0 auto;
}

.app-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.app-tile {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    display: block;
}

.app-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.app-tile-accent {
    height: 4px;
}

.app-tile-body {
    padding: 24px;
}

.app-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 12px;
}

.app-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.app-desc {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 16px;
    line-height: 1.4;
}

.app-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    flex-shrink: 0;
}

.status-dot.online {
    background: var(--green);
    box-shadow: 0 0 6px var(--green);
}

.status-dot.offline {
    background: var(--red);
}

.status-text {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* ── Responsive ────────────────────────────────────── */

@media (max-width: 900px) {
    .app-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .app-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-header {
        padding: 12px 16px;
    }

    .dashboard-main {
        padding: 24px 16px;
    }

    .login-card {
        padding: 28px 24px;
    }
}
