*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:           #060d1b;
    --surface:      #0d1829;
    --border:       #1a2c45;
    --text:         #d8e4f0;
    --text-muted:   #6882a0;
    --accent:       #4a8feb;
    --accent-hover: #60a0ff;
    --radius: 12px;
    --font: 'Segoe UI', system-ui, sans-serif;
}

[data-theme="light"] {
    --bg:           #edeae4;
    --surface:      #f8f6f1;
    --border:       #d4d0c8;
    --text:         #1c1a17;
    --text-muted:   #6b6460;
    --accent:       #1d6fd4;
    --accent-hover: #155cba;
}

html {
    min-height: 100%;
    background:
        radial-gradient(ellipse at 28% 0%,   rgba(56, 100, 220, 0.14) 0%, transparent 55%),
        radial-gradient(ellipse at 78% 105%, rgba(20,  55, 150, 0.10) 0%, transparent 55%),
        var(--bg);
    background-attachment: fixed;
}
[data-theme="light"] html {
    background:
        radial-gradient(ellipse at 20% 0%,   rgba(255, 220, 160, 0.28) 0%, transparent 50%),
        radial-gradient(ellipse at 85% 100%, rgba(160, 210, 180, 0.18) 0%, transparent 50%),
        var(--bg);
    background-attachment: fixed;
}
body {
    min-height: 100%;
    background: transparent;
    color: var(--text);
    font-family: var(--font);
    transition: color 0.2s;
}

/* ── HEADER ── */
.dash-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 60px;
    background: rgba(6, 13, 27, 0.70);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
[data-theme="light"] .dash-header {
    background: rgba(237, 234, 228, 0.75);
}
.dash-logo { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.5px; }
.dash-logo-img { height: 43px; width: auto; display: block; }
/* Swap logo based on theme */
[data-theme="ocean-light"]  .dash-logo-themed,
[data-theme="orchid-light"] .dash-logo-themed { content: url('/img/fritslabslogo-black1.png'); }
[data-theme="nature-dark"]  .dash-logo-themed,
[data-theme="ocean-dark"]   .dash-logo-themed { content: url('/img/fritslabslogo-white1.png'); }.dash-header-right { display: flex; align-items: center; gap: 10px; }

.dash-icon-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: border-color 0.15s;
}
.dash-icon-btn:hover { border-color: var(--accent); }

/* ── BUTTONS ── */
.dash-btn-primary {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.dash-btn-primary:hover { background: var(--accent-hover); }
.dash-btn-primary.full-width { width: 100%; padding: 12px; font-size: 1rem; margin-top: 8px; }

.dash-btn-outline {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s;
}
.dash-btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.link-btn {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: inherit;
    padding: 0;
}
.link-btn:hover { text-decoration: underline; }

/* ── USER AVATAR ── */
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    position: relative;
}
#user-area { position: relative; }
.user-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-width: 200px;
    padding: 12px;
    z-index: 200;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.user-dropdown hr { border: none; border-top: 1px solid var(--border); margin: 8px 0; }
.user-email { font-size: 0.85rem; color: var(--text-muted); word-break: break-all; }
.user-dropdown button {
    background: none;
    border: none;
    color: #f85149;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 4px 0;
    width: 100%;
    text-align: left;
}
.user-dropdown button:hover { text-decoration: underline; }

/* ── MAIN ── */
.dash-main { max-width: 960px; margin: 0 auto; padding: 48px 24px; }
.dash-hero { margin-bottom: 40px; }
.dash-hero h1 { font-size: 2rem; font-weight: 700; margin-bottom: 8px; }
.dash-hero p { color: var(--text-muted); font-size: 1.05rem; }

/* ── APP GRID ── */
.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.app-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.15s, transform 0.15s;
    cursor: pointer;
}
.app-card:not(.app-card-soon):hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}
.app-card-soon { opacity: 0.5; cursor: default; }
.app-card-featured {
    border-color: var(--accent);
    background: linear-gradient(135deg, var(--surface) 60%, rgba(47,129,247,0.08) 100%);
}
.app-card-featured .app-card-arrow { color: var(--accent); }
.app-card-icon { font-size: 2rem; flex-shrink: 0; }
.app-card-body { flex: 1; }
.app-card-body h2 { font-size: 1.05rem; font-weight: 600; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.app-card-body p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.4; }
.app-card-arrow { font-size: 1.3rem; color: var(--accent); flex-shrink: 0; }
.badge-soon {
    font-size: 0.65rem;
    background: var(--border);
    color: var(--text-muted);
    padding: 2px 7px;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    vertical-align: middle;
}

/* ── AUTH MODAL ── */
.auth-modal-box { max-width: 400px; width: 100%; }
.auth-fields { display: flex; flex-direction: column; gap: 14px; margin: 20px 0 4px; }
.auth-fields label { display: flex; flex-direction: column; gap: 6px; font-size: 0.9rem; color: var(--text-muted); }
.auth-fields input {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.15s;
}
.auth-fields input:focus { border-color: var(--accent); }
.auth-switch { text-align: center; font-size: 0.88rem; color: var(--text-muted); margin-top: 14px; }
.auth-error {
    background: rgba(248, 81, 73, 0.1);
    border: 1px solid #f85149;
    color: #f85149;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.88rem;
    margin-top: 12px;
}

/* ── MODAL (reuse from style.css pattern) ── */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex; align-items: center; justify-content: center;
    z-index: 500;
    padding: 16px;
}
.modal-overlay.hidden { display: none; }
.modal-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-header h2 { font-size: 1.2rem; font-weight: 700; }
.modal-close {
    background: none; border: none; color: var(--text-muted);
    font-size: 1.5rem; cursor: pointer; line-height: 1; padding: 0;
}
.modal-close:hover { color: var(--text); }

.hidden { display: none !important; }
