/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:          #0f1117;
    --surface:     #181c27;
    --surface2:    #1f2435;
    --border:      #2a2f45;
    --accent:      #4f79ff;
    --accent-hover:#3a62e8;
    --accent-glow: rgba(79,121,255,.18);
    --text:        #e8eaf0;
    --text-muted:  #7a819a;
    --danger:      #e05252;
    --success:     #4caf7d;
    --radius:      12px;
    --radius-sm:   8px;
    --font-sans:   'Manrope', system-ui, sans-serif;
    --font-mono:   'IBM Plex Mono', 'Courier New', monospace;
    --shadow:      0 4px 24px rgba(0,0,0,.45);
}

html { font-size: 16px; -webkit-font-smoothing: antialiased; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Typography ── */
h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 1.25rem; font-weight: 600; letter-spacing: -.01em; }

/* ── Card ── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

/* ── Button ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    padding: .75rem 1.5rem;
    border-radius: var(--radius-sm);
    border: none;
    font-family: var(--font-sans);
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, box-shadow .15s, transform .1s;
    text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 2px 12px var(--accent-glow);
}
.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.btn-ghost:hover {
    background: var(--surface2);
    color: var(--text);
}

/* ── Alert ── */
.alert {
    padding: .8rem 1.1rem;
    border-radius: var(--radius-sm);
    font-size: .875rem;
    border-left: 3px solid;
    margin-bottom: 1.5rem;
}
.alert-error   { background: rgba(224,82,82,.1);  border-color: var(--danger);  color: #f09090; }
.alert-success { background: rgba(76,175,125,.1); border-color: var(--success); color: #80c9a0; }

/* ── Login page ── */
.login-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    background:
        radial-gradient(ellipse 60% 50% at 20% 20%, rgba(79,121,255,.12) 0%, transparent 60%),
        radial-gradient(ellipse 50% 60% at 80% 80%, rgba(120,80,255,.08) 0%, transparent 60%),
        var(--bg);
}

.login-card {
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    margin-bottom: 1.25rem;
}

.login-logo-fallback {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--accent), #a066ff);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

.login-card h1 { margin-bottom: .4rem; }

.login-sub {
    color: var(--text-muted);
    font-size: .9rem;
    margin-bottom: 2rem;
}

.login-card .btn {
    width: 100%;
    justify-content: center;
    padding: .85rem 1.5rem;
    font-size: 1rem;
}

.google-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.login-footer {
    margin-top: 2rem;
    color: var(--text-muted);
    font-size: .78rem;
}

/* ── Dashboard layout ── */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15,17,23,.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    height: 60px;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-logo {
    height: 28px;
    object-fit: contain;
}

.header-logo-text {
    font-family: var(--font-mono);
    font-size: .95rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -.01em;
}

.header-logo-text span { color: var(--accent); }

.header-spacer { flex: 1; }

.user-badge {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-size: .85rem;
    color: var(--text-muted);
}

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
}

.user-avatar-fallback {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #a066ff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.main-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2.5rem 2rem;
}

.page-title {
    margin-bottom: .4rem;
}

.page-sub {
    color: var(--text-muted);
    font-size: .9rem;
    margin-bottom: 2.5rem;
}

/* ── Tool grid ── */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.tool-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text);
    display: flex;
    flex-direction: column;
    gap: .6rem;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}

.tool-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent), 0 6px 24px var(--accent-glow);
    transform: translateY(-2px);
    text-decoration: none;
    color: var(--text);
}

.tool-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), #a066ff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.tool-name {
    font-weight: 600;
    font-size: 1rem;
}

.tool-type {
    font-size: .78rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    letter-spacing: .02em;
    text-transform: uppercase;
}

/* ── Section heading ── */
.section-label {
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1rem;
    margin-top: 2rem;
    display: flex;
    align-items: center;
    gap: .6rem;
}

.section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ── Empty state ── */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
    font-size: .9rem;
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .app-header { padding: 0 1rem; }
    .main-content { padding: 1.5rem 1rem; }
    .user-name { display: none; }
    h1 { font-size: 1.4rem; }
}
