@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:wght@300;400;500&display=swap');

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

:root {
    --bg:        #0b0f1a;
    --surface:   #111827;
    --card:      #1a2235;
    --border:    #1e2d45;
    --accent:    #3b82f6;
    --accent2:   #06b6d4;
    --success:   #10b981;
    --danger:    #ef4444;
    --text:      #f1f5f9;
    --muted:     #64748b;
    --radius:    12px;
}

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

/* TOPBAR */
.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}
.topbar-brand {
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: 1.2rem;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.topbar-user {
    font-size: 0.85rem;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 10px;
}
.topbar-user .logout-btn {
    color: var(--danger);
    text-decoration: none;
    font-size: 0.8rem;
    padding: 4px 10px;
    border: 1px solid var(--danger);
    border-radius: 6px;
    transition: all 0.2s;
    background: transparent;
}
.topbar-user .logout-btn:hover { background: var(--danger); color: white; }

/* LAYOUT */
.page { max-width: 900px; margin: 0 auto; padding: 32px 20px; }

/* HEADINGS */
.page-title { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 1.6rem; margin-bottom: 4px; }
.page-subtitle { color: var(--muted); font-size: 0.9rem; margin-bottom: 28px; }

/* DASHBOARD GRID */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.dash-btn {
    display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
    padding: 20px; background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); text-decoration: none; color: var(--text);
    transition: border-color 0.2s, transform 0.15s, background 0.2s; cursor: pointer;
    font-family: inherit;
}
.dash-btn:hover { border-color: var(--accent); background: #1e2d45; transform: translateY(-2px); }
.dash-btn.danger:hover { border-color: var(--danger); }
.dash-btn .icon { font-size: 1.4rem; width: 42px; height: 42px; background: var(--border); border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.dash-btn .label { font-family: 'Syne', sans-serif; font-weight: 600; font-size: 0.92rem; }
.dash-btn .desc { font-size: 0.77rem; color: var(--muted); }

/* FORMS */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.78rem; color: var(--muted); margin-bottom: 6px; font-weight: 500; letter-spacing: 0.4px; text-transform: uppercase; }
.form-group input {
    width: 100%; background: var(--surface); border: 1px solid var(--border);
    border-radius: 8px; padding: 10px 14px; color: var(--text);
    font-family: 'DM Sans', sans-serif; font-size: 0.95rem; outline: none; transition: border-color 0.2s;
}
.form-group input:focus { border-color: var(--accent); }

/* BUTTONS */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 20px; border-radius: 8px; border: none;
    font-family: 'DM Sans', sans-serif; font-size: 0.9rem; font-weight: 500;
    cursor: pointer; text-decoration: none; transition: all 0.2s;
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: #2563eb; }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--accent); }
.btn-full { width: 100%; justify-content: center; padding: 12px; margin-top: 8px; }

/* TABLE */
.tbl-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
thead { background: var(--surface); }
th { padding: 12px 16px; font-family: 'Syne', sans-serif; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); text-align: left; border-bottom: 1px solid var(--border); }
td { padding: 11px 16px; font-size: 0.87rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(59,130,246,0.04); }
td.no-link { color: var(--muted); font-style: italic; }
td.has-link { color: var(--accent2); word-break: break-all; }
.node-badge { display: inline-block; background: var(--border); font-family: 'Syne', sans-serif; font-size: 0.78rem; padding: 2px 8px; border-radius: 4px; }

/* ASSIGN INPUTS */
.assign-input {
    width: 100%; background: var(--surface); border: 1px solid var(--border);
    border-radius: 6px; padding: 7px 10px; color: var(--text);
    font-size: 0.84rem; font-family: 'DM Sans', sans-serif; outline: none; transition: border-color 0.2s;
}
.assign-input:focus { border-color: var(--accent); }

/* ALERT */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 0.88rem; margin-bottom: 20px; border-left: 3px solid var(--success); background: rgba(16,185,129,0.08); color: #34d399; }
.alert.error { border-color: var(--danger); background: rgba(239,68,68,0.08); color: #f87171; }

/* LOGIN */
.login-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
    background: radial-gradient(ellipse at 30% 20%, rgba(59,130,246,0.08) 0%, transparent 60%),
                radial-gradient(ellipse at 70% 80%, rgba(6,182,212,0.06) 0%, transparent 60%), var(--bg);
}
.login-card { width: 100%; max-width: 400px; background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 36px 32px; }
.login-logo { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 1.9rem; background: linear-gradient(135deg, var(--accent), var(--accent2)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; margin-bottom: 4px; }
.login-tagline { color: var(--muted); font-size: 0.84rem; margin-bottom: 28px; }
.login-error { color: #f87171; font-size: 0.85rem; margin-bottom: 14px; }
.login-footer { text-align: center; margin-top: 20px; font-size: 0.83rem; color: var(--muted); }
.login-footer a { color: var(--accent); text-decoration: none; }

/* NODE PAGE */
.node-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
    background: var(--bg);
}
.node-card { width: 100%; max-width: 860px; }

/* CARD */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }

/* RESPONSIVE */
@media (max-width: 600px) {
    .topbar { padding: 0 14px; }
    .page { padding: 20px 14px; }
    .page-title { font-size: 1.25rem; }
    .login-card { padding: 28px 20px; }
    .dash-grid { grid-template-columns: 1fr 1fr; }
    th, td { padding: 9px 10px; font-size: 0.82rem; }
}
