:root {
    --bg: #071a2f;
    --bg-2: #0e2e4f;
    --surface: #ffffff;
    --surface-2: #f4f7fb;
    --line: #d9e3ee;
    --text: #13283f;
    --muted: #5e7289;
    --accent: #ffbe1b;
    --accent-strong: #f29f05;
    --accent-soft: #fff4cf;
    --danger: #b42318;
    --success: #18794e;
    --shadow: 0 22px 48px rgba(6, 21, 38, 0.18);
    --radius: 20px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top right, rgba(255, 190, 27, 0.16), transparent 28%),
        linear-gradient(145deg, #061524 0%, #0a223b 55%, #11345a 100%);
}

a {
    color: #0d4a86;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container {
    max-width: 1080px;
    margin: 40px auto;
    padding: 28px 32px;
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(8px);
}

h1, h2, h3 {
    margin-top: 0;
    letter-spacing: -0.03em;
}

h1 {
    font-size: 2.35rem;
    margin-bottom: 8px;
}

h2 {
    font-size: 1.25rem;
    margin-top: 28px;
}

p, li, td, th, label, input, select, button {
    font-size: 0.97rem;
}

ul {
    padding-left: 20px;
}

.eyebrow {
    display: inline-block;
    align-self: start;
    margin-bottom: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 190, 27, 0.18);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.hero {
    display: flex;
    flex-direction: column;
    margin-bottom: 26px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(7, 26, 47, 0.98), rgba(17, 52, 90, 0.95));
    color: #fff;
    overflow: hidden;
}

.hero-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-wrap: wrap;
}

.hero-body {
    padding: 14px 20px 18px;
}

.hero p,
.hero a {
    color: rgba(255, 255, 255, 0.78);
    margin: 0;
}

.hero h1 {
    margin-bottom: 6px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
    color: #fff;
    text-decoration: none;
    flex-shrink: 0;
}

.brand img {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
}

.brand:hover {
    text-decoration: none;
    opacity: 0.85;
}

.hero-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.hero-nav a {
    padding: 5px 10px;
    border-radius: 8px;
    color: rgba(255,255,255,0.72);
    font-size: 0.88rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.hero-nav a:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
    text-decoration: none;
}

.hero-nav .nav-user {
    color: rgba(255,255,255,0.45);
    font-size: 0.82rem;
    padding: 5px 8px;
}

/* Dropdown menu */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    padding: 5px 10px;
    border-radius: 8px;
    color: rgba(255,255,255,0.72);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: background 0.15s, color 0.15s;
    user-select: none;
}

.nav-dropdown-toggle::after {
    content: '▾';
    font-size: 0.7rem;
    opacity: 0.7;
}

.nav-dropdown:hover .nav-dropdown-toggle,
.nav-dropdown-toggle:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 160px;
    background: #0e2e4f;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    padding: 4px;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}

.nav-dropdown:hover .nav-dropdown-menu {
    display: block;
}

.nav-dropdown-menu a {
    display: block;
    padding: 7px 12px;
    border-radius: 7px;
    color: rgba(255,255,255,0.78);
    font-size: 0.87rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.12s, color 0.12s;
}

.nav-dropdown-menu a:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
    text-decoration: none;
}

.actions,
.artifact-controls,
.inline-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.grid-two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.panel,
.artifact-section {
    margin-bottom: 20px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
}

.artifact-section {
    padding: 0;
    overflow: hidden;
}

.artifact-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 18px 20px;
    background: linear-gradient(180deg, #f7faff 0%, #eef4fb 100%);
    border-bottom: 1px solid var(--line);
}

.artifact-header h2 {
    margin: 0;
}

.artifact-body,
.empty {
    padding: 18px 20px 20px;
}

.empty {
    color: var(--muted);
}

.form-group {
    margin-bottom: 16px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #17324c;
}

input,
select {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #c7d4e2;
    border-radius: 12px;
    background: #fbfdff;
    color: var(--text);
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

input:focus,
select:focus {
    border-color: rgba(13, 74, 134, 0.55);
    box-shadow: 0 0 0 4px rgba(13, 74, 134, 0.12);
    background: #fff;
}

input[type="checkbox"] {
    width: auto;
    accent-color: #0d4a86;
}

button {
    padding: 11px 16px;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    color: #0c2340;
    background: linear-gradient(180deg, var(--accent) 0%, var(--accent-strong) 100%);
    font-weight: 700;
    letter-spacing: 0.01em;
    box-shadow: 0 8px 20px rgba(242, 159, 5, 0.22);
}

button:hover {
    filter: brightness(1.02);
}

button.secondary {
    color: #fff;
    background: linear-gradient(180deg, #21476f 0%, #133556 100%);
    box-shadow: 0 8px 18px rgba(14, 46, 79, 0.22);
}

.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 16px;
    border-radius: 999px;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-decoration: none;
}

.button-link.secondary {
    color: #fff;
    background: linear-gradient(180deg, #21476f 0%, #133556 100%);
    box-shadow: 0 8px 18px rgba(14, 46, 79, 0.22);
}

.auth-divider {
    margin: 18px 0 14px;
    color: var(--muted);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.82rem;
}

.flash {
    margin-bottom: 16px;
    padding: 13px 15px;
    border-radius: 14px;
    border: 1px solid transparent;
}

.flash.success {
    background: #eaf8f0;
    border-color: #b5e1c5;
    color: var(--success);
}

.flash.error {
    background: #fff0ef;
    border-color: #f4c7c3;
    color: var(--danger);
}

table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 14px;
}

th, td {
    padding: 12px 10px;
    border-bottom: 1px solid #e6edf5;
    text-align: left;
    vertical-align: middle;
}

th {
    color: #36516b;
    background: #f8fbfe;
    font-size: 0.84rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

tr:last-child td {
    border-bottom: none;
}

.status,
.messages,
.output {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-2);
}

.status,
.messages {
    padding: 14px;
}

.messages {
    max-height: 320px;
    overflow-y: auto;
    white-space: pre-wrap;
}

.progress-bar {
    width: 100%;
    height: 16px;
    margin: 20px 0;
    overflow: hidden;
    border-radius: 999px;
    background: #dbe7f4;
}

.progress-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #f5a800 0%, #ffd15a 100%);
}

.spinner {
    width: 48px;
    height: 48px;
    margin: 24px auto;
    border: 4px solid rgba(13, 74, 134, 0.12);
    border-top: 4px solid #f5a800;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.muted {
    color: var(--muted);
}

@media (max-width: 800px) {
    .container {
        margin: 18px;
        padding: 20px;
    }

    .grid-two {
        grid-template-columns: 1fr;
    }

    .hero-header,
    .artifact-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
