/* hub.css — MellShops · ModulePicker-DNA (Fjellman produktionsplanering) */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    --bg: #1a1a1a;
    --bg-2: #151515;
    --bg-3: #111;
    --line: rgba(255,255,255,0.08);
    --line-strong: rgba(255,255,255,0.18);
    --line-soft: rgba(255,255,255,0.04);
    --text: #e5e5e5;
    --text-bright: #fafafa;
    --text-muted: #8a8a8a;
    --text-dim: #555;
    --accent: #c8102e;
    --max: 1320px;
}
html, body { height: 100%; }
body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-weight: 300; letter-spacing: -0.035em; line-height: 1; color: var(--text-bright); }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: #fff; }
.muted { color: var(--text-muted); }
code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.85em; }

.dot-period { color: var(--accent); }

/* ── Eyebrow ── */
.eyebrow {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    font-weight: 600;
    color: var(--text-muted);
    display: inline-block;
}

/* ── Brand ── */
.brand {
    display: inline-flex;
    align-items: baseline;
    gap: 0.18rem;
    font-size: 1.15rem;
    font-weight: 500;
    letter-spacing: -0.025em;
    color: var(--text-bright);
    line-height: 1;
}
.brand .brand-sub { font-weight: 300; color: var(--text-muted); }
.brand .accent-dot { color: var(--accent); }

/* ── Knappar ── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    border: 1px solid var(--line-strong);
    background: transparent;
    color: var(--text);
    padding: 0.6rem 1.3rem;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.18s, color 0.18s, background 0.18s;
}
.btn:hover { border-color: var(--text-bright); color: var(--text-bright); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #a90d26; border-color: #a90d26; }
.btn.ghost { border-color: var(--line); color: var(--text-muted); }
.btn.ghost:hover { color: var(--text-bright); border-color: var(--line-strong); }
.btn.danger { border-color: rgba(200,16,46,0.45); color: #e0697c; }
.btn.danger:hover { background: rgba(200,16,46,0.12); border-color: var(--accent); }
.btn.block { width: 100%; margin-top: 1.4rem; padding: 0.8rem; }
.btn.sm { padding: 0.45rem 0.9rem; font-size: 0.7rem; }
.btn.xs { padding: 0.3rem 0.65rem; font-size: 0.66rem; }

/* ── Fält ── */
label {
    display: block;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-weight: 600;
    color: var(--text-muted);
    margin: 1.1rem 0 0.45rem;
}
input[type="text"], input[type="email"], input[type="password"], input[type="number"], select {
    width: 100%;
    background: var(--bg-3);
    border: 1px solid var(--line);
    padding: 0.65rem 0.8rem;
    color: var(--text-bright);
    font-size: 0.92rem;
    font-family: inherit;
    border-radius: 0;
    transition: border-color 0.18s;
}
input:focus, select:focus { outline: none; border-color: var(--accent); }
.auth-err, .ok-msg { display: none; font-size: 0.85rem; padding: 0.65rem 0.85rem; margin-bottom: 0.5rem; border-left: 2px solid; }
.auth-err.show { display: block; background: rgba(200,16,46,0.08); border-color: var(--accent); color: #e0697c; }
.ok-msg.show { display: block; background: rgba(90,143,90,0.08); border-color: #5a8f5a; color: #9fc99f; }

/* ── Auth (first-run / login) ── */
.hub-login-page { display: flex; min-height: 100vh; align-items: center; justify-content: center; background: var(--bg); }
.auth-wrap { display: flex; width: 100%; justify-content: center; padding: 1.5rem; }
.auth-card {
    width: 100%; max-width: 400px;
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-top: 2px solid var(--accent);
    padding: 2.6rem 2.4rem 2.4rem;
}
.auth-logo { margin-bottom: 0.4rem; }
.auth-sub { color: var(--text-muted); font-size: 0.88rem; margin: 0.5rem 0 1.2rem; }

/* ── Modulväljare ── */
.launch-wrap { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.launch-head {
    border-bottom: 1px solid var(--line);
    background: rgba(26,26,26,0.92);
}
.launch-head-inner {
    max-width: var(--max); margin: 0 auto; padding: 0 3rem;
    height: 72px; display: flex; align-items: center; justify-content: space-between;
}
.launch-user { display: flex; align-items: center; gap: 1.2rem; font-size: 0.78rem; color: var(--text-muted); letter-spacing: 0.04em; }
.launch-user a { color: var(--text); }
.launch-user a:hover { color: var(--accent); }
.launch-main { flex: 1; max-width: var(--max); width: 100%; margin: 0 auto; padding: 4.5rem 3rem 4rem; }
.launch-title h1 { font-size: clamp(2.2rem, 4.5vw, 3.2rem); margin-top: 1rem; }
.launch-sub { color: var(--text-muted); font-size: 0.9rem; margin: 1.1rem 0 3rem; }

/* Modulrutnät: platta brickor med delade hairline-linjer. */
.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
}
.shop-card {
    position: relative;
    display: flex; flex-direction: column;
    padding: 2.5rem 2rem 2.25rem;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    min-height: 230px;
    color: inherit;
    transition: background 0.18s;
}
.shop-card::before {
    content: '';
    position: absolute;
    top: 1.5rem; left: 1.5rem;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.4;
    transition: opacity 0.18s;
}
.shop-card:hover { background: rgba(255,255,255,0.025); }
.shop-card:hover::before { opacity: 1; }
.shop-card .num {
    font-size: 0.66rem;
    letter-spacing: 0.22em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 1.5rem;
    margin-left: 1.25rem;
    font-variant-numeric: tabular-nums;
}
.shop-card-name {
    font-size: 1.4rem;
    font-weight: 400;
    color: var(--text-bright);
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin-bottom: 0.5rem;
}
.shop-card-url { font-size: 0.82rem; color: var(--text-muted); }
.shop-card-go {
    margin-top: auto;
    padding-top: 1.2rem;
    border-top: 1px solid var(--line-soft);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    font-weight: 600;
    color: var(--text-muted);
    transition: color 0.18s;
}
.shop-card:hover .shop-card-go { color: var(--accent); }

/* ── Konsol ── */
.hub-console-page { min-height: 100vh; background: var(--bg); }
.con-brand { display: inline-flex; align-items: baseline; gap: 0.4rem; }
.con-top-bar { border-bottom: 1px solid var(--line); background: rgba(26,26,26,0.92); }
.con-top {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 3rem; height: 72px; max-width: var(--max); margin: 0 auto;
}
.con-top-r { display: flex; align-items: center; gap: 1.2rem; font-size: 0.78rem; color: var(--text-muted); }
.con-top-r a { color: var(--text); }
.con-top-r a:hover { color: var(--accent); }
.con-wrap { max-width: var(--max); margin: 0 auto; padding: 2.5rem 3rem; }
.con-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin-bottom: 2rem; }
.con-tab {
    background: transparent; border: none; border-bottom: 2px solid transparent;
    color: var(--text-muted); padding: 0.85rem 1.4rem;
    font-size: 0.72rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
    font-family: inherit; cursor: pointer; transition: color 0.18s;
    margin-bottom: -1px;
}
.con-tab:hover { color: var(--text-bright); }
.con-tab.active { color: var(--text-bright); border-bottom-color: var(--accent); }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.4rem; }
.panel-head h2 { font-size: 1.7rem; font-weight: 300; }
.table-wrap { border: 1px solid var(--line); overflow: auto; background: var(--bg-2); }
.con-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.con-table th {
    text-align: left; font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.18em;
    color: var(--text-muted); padding: 0.85rem 1.1rem; border-bottom: 1px solid var(--line); font-weight: 600;
}
.con-table td { padding: 0.8rem 1.1rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.con-table tr:last-child td { border-bottom: none; }
.con-table tr:hover td { background: rgba(255,255,255,0.02); }
.row-actions { display: flex; gap: 0.45rem; justify-content: flex-end; }
.path { color: var(--text-muted); font-size: 0.76rem; }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; vertical-align: middle; margin-right: 0.45rem; }
.badge {
    display: inline-block; font-size: 0.62rem; padding: 0.22rem 0.6rem;
    text-transform: uppercase; letter-spacing: 0.14em; font-weight: 600;
    border: 1px solid var(--line-strong); color: var(--text);
}
.badge.gold { border-color: rgba(200,16,46,0.5); color: #e0697c; }
.badge.ok { border-color: rgba(90,143,90,0.5); color: #9fc99f; }
.badge.off { border-color: var(--line); color: var(--text-dim); }
.form-card { border: 1px solid var(--line); background: var(--bg-2); padding: 1.8rem; max-width: 460px; }
.form-card .btn { margin-top: 1.4rem; }

/* ── Modaler ── */
.modal-bg {
    position: fixed; inset: 0; background: rgba(0,0,0,0.65);
    display: none; align-items: flex-start; justify-content: center;
    padding: 5vh 1rem; z-index: 50; overflow: auto;
}
.modal-bg.open { display: flex; }
.modal {
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-top: 2px solid var(--accent);
    width: 100%; max-width: 480px;
}
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 1.2rem 1.6rem; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 1.25rem; font-weight: 400; letter-spacing: -0.02em; }
.modal-x { background: none; border: none; color: var(--text-muted); font-size: 1.5rem; line-height: 1; cursor: pointer; }
.modal-x:hover { color: var(--text-bright); }
.modal-body { padding: 0.6rem 1.6rem 1.4rem; }
.modal-foot { display: flex; justify-content: flex-end; gap: 0.6rem; padding: 1.1rem 1.6rem; border-top: 1px solid var(--line); }
.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.3rem; margin-top: 0.4rem; }
.check-line { display: flex; align-items: center; gap: 0.55rem; font-size: 0.88rem; text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--text); margin: 0.5rem 0 0; }
.check-line input { width: auto; accent-color: var(--accent); }
.color-in { width: 56px; height: 36px; padding: 2px; }

@media (max-width: 760px) {
    .launch-head-inner, .launch-main, .con-top, .con-wrap { padding-left: 1.4rem; padding-right: 1.4rem; }
    .shop-grid { grid-template-columns: 1fr; }
    .check-grid { grid-template-columns: 1fr; }
}
