@import url("http://localhost:5601/css/portal.css");

:root {
    --ink: #0b1b2b;
    --muted: #5c6773;
    --bg: #f5f7fb;
    --card: #ffffff;
    --accent: #1f4e8f;
    --accent-strong: #163a6c;
    --warn: #d14b4b;
    --shadow: 0 18px 50px rgba(12, 32, 69, 0.08);
    --radius: 14px;
    --font: "Bahnschrift", "Segoe UI", "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    background: radial-gradient(circle at 20% 20%, #e7f4ff, #f5f7fb 35%),
                radial-gradient(circle at 80% 0%, #e6eefb, transparent 35%),
                linear-gradient(180deg, #f5f7fb 0%, #eef2f7 60%, #f5f7fb 100%);
    color: var(--ink);
    font-family: var(--font);
    line-height: 1.6;
    min-height: 100vh;
}

.page {
    max-width: 1100px;
    padding: 42px 28px 64px;
    margin: 0 auto;
}

.portal-shell {
    max-width: 1100px;
    margin: 22px auto 0;
    padding: 0 28px;
}

.portal-nav {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 12px 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 0.9rem;
    font-weight: 600;
}

.portal-nav a {
    color: #163a6c;
    text-decoration: none;
}

.portal-nav a:hover {
    text-decoration: underline;
}

.portal-title {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-top: 12px;
    padding: 14px 16px;
}

.portal-title h1 {
    margin: 0;
    font-size: 1rem;
    letter-spacing: 0.01em;
}

.portal-title p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.hero h1 {
    margin: 6px 0 10px;
    font-size: 2.4rem;
    letter-spacing: -0.02em;
}

.hero .lede {
    max-width: 760px;
    color: var(--muted);
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.25em;
    font-size: 0.75rem;
    color: var(--accent-strong);
    margin: 0;
}

.controls {
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 28px 0 20px;
}

.login-card h2 {
    margin: 0 0 12px;
    font-size: 1.2rem;
}

.login-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    align-items: end;
}

.login-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.login-card input[type="email"],
.login-card input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #d9dee8;
    background: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--ink);
}

.login-card input[type="email"]:focus,
.login-card input[type="password"]:focus {
    outline: 2px solid rgba(31, 78, 143, 0.35);
}

.btn-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn {
    border: none;
    padding: 12px 18px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 120ms ease, box-shadow 120ms ease, background 160ms ease;
}

.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn.disabled,
.btn[aria-disabled="true"] {
    pointer-events: none;
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

.btn.primary {
    background: linear-gradient(120deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: #fff;
    box-shadow: 0 10px 30px rgba(31, 78, 143, 0.25);
}

.btn.ghost {
    background: #0b1b2b;
    color: #f2fbf9;
}

.btn.secondary {
    background: #ffffff;
    color: var(--accent-strong);
    border: 1px solid rgba(11, 27, 43, 0.15);
}

.btn:hover:not(:disabled) { transform: translateY(-1px); }

.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px 16px 18px;
}

.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

thead {
    background: #f3f6fa;
}

thead th {
    text-align: left;
    font-weight: 700;
    padding: 12px 10px;
    letter-spacing: 0.01em;
}

tbody td {
    padding: 10px 8px;
    border-top: 1px solid #e4e8ef;
}

select, input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #d9dee8;
    background: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--ink);
}

select:focus, input[type="number"]:focus { outline: 2px solid rgba(31, 78, 143, 0.35); }

.action-cell {
    text-align: right;
}

.delete-btn {
    background: transparent;
    border: 1px solid #e0e4ec;
    border-radius: 10px;
    color: var(--warn);
    padding: 8px 12px;
    cursor: pointer;
    transition: background 120ms ease;
}

.delete-btn:hover { background: #fff1f1; }

.hint {
    margin: 10px 2px 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.feedback {
    margin-top: 22px;
    display: grid;
    gap: 10px;
}

.summary-card {
    margin-top: 20px;
}

.focus-card {
    margin-top: 20px;
}

.shocks-config-card {
    margin-top: 22px;
    border: 2px solid rgba(31, 78, 143, 0.25);
    box-shadow: 0 20px 52px rgba(10, 63, 69, 0.16);
    background: linear-gradient(180deg, #fcffff 0%, #f7fcfc 100%);
}

.shocks-config-head {
    margin-bottom: 12px;
}

.simulation-mode-grid {
    margin-bottom: 14px;
    display: grid;
    grid-template-columns: minmax(260px, 520px);
    gap: 12px;
}

.mode-select-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
}

.mode-help-btn {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid rgba(11, 27, 43, 0.2);
    background: #ffffff;
    color: var(--accent-strong);
    font-weight: 700;
    cursor: pointer;
}

.mode-help-btn:hover {
    background: #eef8f7;
}

.shocks-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
}

.shocks-actions #loader {
    margin-left: 6px;
}

.welcome-card {
    margin-top: 24px;
    padding: 24px;
}

.welcome-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.7fr);
    gap: 18px;
    align-items: stretch;
}

.welcome-copy {
    min-height: 48vh;
    background: linear-gradient(145deg, #f9fcff 0%, #eef4fb 100%);
    border: 1px solid #dbe5f2;
    border-radius: 14px;
    padding: 20px;
}

.welcome-copy h2 {
    margin-top: 0;
}

.welcome-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    justify-content: center;
}

.gateway-btn {
    width: 100%;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.section-subtitle {
    font-size: 1.2rem;
    color: var(--accent-strong);
    margin-top: 8px;
    font-weight: 700;
}

.focus-header h2 {
    margin: 0;
    font-size: 1.1rem;
}

.focus-subtitle {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.focus-grid {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.focus-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.9rem;
    color: var(--muted);
}

.focus-field span {
    font-weight: 600;
    color: var(--ink);
}

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
}

.summary-header h2 {
    margin: 0;
    font-size: 1.2rem;
}

.summary-subtitle {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.summary-count {
    background: rgba(31, 78, 143, 0.1);
    color: var(--accent-strong);
    border-radius: 999px;
    padding: 6px 14px;
    font-weight: 600;
}

.summary-grid {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.summary-item {
    border: 1px solid #e0e4ec;
    border-radius: 12px;
    padding: 12px 14px;
    background: #f9fbff;
}

.summary-item header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-weight: 600;
}

.summary-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.summary-tag {
    background: #fff;
    border-radius: 10px;
    padding: 4px 10px;
    font-size: 0.8rem;
    color: var(--muted);
    border: 1px solid #e3e8f2;
}

.summary-empty {
    margin: 8px 0;
    color: var(--muted);
}

#message {
    min-height: 22px;
    font-weight: 600;
    padding: 10px 14px;
    border-radius: 10px;
    background: #f3f6fa;
    color: var(--muted);
    box-shadow: var(--shadow);
}

#message.success { color: #0f6848; background: #e2f4ec; }
#message.error { color: #8c1d1d; background: #fdeaea; }

#result {
    background: #0b1b2b;
    color: #e5f0ff;
    padding: 16px;
    border-radius: 12px;
    overflow-x: auto;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
    min-height: 48px;
}

#loader { color: var(--muted); font-weight: 600; }

@media (max-width: 720px) {
    .controls { flex-direction: column; align-items: flex-start; }
    .btn-group { width: 100%; }
    .btn { width: 100%; text-align: center; }
    .shocks-actions { width: 100%; justify-content: stretch; }
    .welcome-layout { grid-template-columns: 1fr; }
    .welcome-copy { min-height: 320px; }
}
