@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap');

:root {
    --bg: #0f172a; /* slate-900 */
    --panel: #111827; /* gray-900 */
    --card: #0b1220; /* custom dark */
    --text: #e5e7eb; /* gray-200 */
    --muted: #9ca3af; /* gray-400 */
    --primary: #6366f1; /* indigo-500 */
    --primary-600: #5458ee;
    --accent: #22c55e; /* green-500 */
    --danger: #ef4444; /* red-500 */
    --warning: #f59e0b; /* amber-500 */
    --border: #1f2937; /* gray-800 */
    --input-bg: rgba(255,255,255,0.03);
    --input-border: #263041;
    --input-focus: #3b82f6;
}

* {
    box-sizing: border-box
}

html, body {
    height: 100%
}

body {
    margin: 0;
    background: linear-gradient(180deg,#0b1020 0%, #0f172a 100%);
    color: var(--text);
    font-family: 'Inter',system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
}

.hero {
    position: relative;
    overflow: hidden;
    background: radial-gradient(1000px 400px at 20% 0%, rgba(99,102,241,0.25), rgba(99,102,241,0) 60%),radial-gradient(1000px 400px at 80% 0%, rgba(34,197,94,0.2), rgba(34,197,94,0) 60%);
    border-bottom: 1px solid var(--border)
}

.hero__content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px 30px 20px
}

.hero__title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: .3px
}

.hero__subtitle {
    margin-top: 6px;
    color: var(--muted)
}

.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px
}

.nav a {
    color: var(--text);
    text-decoration: none;
    margin-left: 12px;
    opacity: .9
}

    .nav a:hover {
        opacity: 1
    }

.card {
    background: rgba(255,255,255,0.03);
    backdrop-filter: blur(6px);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 16px 12px 16px;
    margin-bottom: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25)
}

.table-wrap {
    border-radius: 8px;
    border: 1px solid var(--border)
}

.table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed
}

    .table th, .table td {
        border-bottom: 1px solid var(--border);
        padding: 10px 12px;
        vertical-align: top;
        word-break: break-word
    }

    .table th {
        color: var(--muted);
        font-weight: 600;
        background: rgba(255,255,255,0.02)
    }

.table--striped tbody tr:nth-child(odd) {
    background: rgba(255,255,255,0.02)
}

.table--hover tbody tr {
    transition: background .2s ease
}

    .table--hover tbody tr:hover {
        background: rgba(255,255,255,0.04)
    }

.no-scroll {
    overflow: visible
}

.btn {
    appearance: none;
    border: 1px solid var(--primary);
    color: white;
    background: linear-gradient(180deg,var(--primary),var(--primary-600));
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform .06s ease, box-shadow .2s ease
}

    .btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 8px 20px rgba(99,102,241,.35)
    }

    .btn:disabled {
        opacity: .4;
        cursor: not-allowed
    }

.btn--ghost {
    border-color: transparent;
    background: transparent
}

.badge {
    display: inline-block;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 12px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,.05)
}

.badge--admin {
    border-color: var(--accent);
    color: #c7ffd9
}

.badge--mode {
    border-color: #3b82f6;
    background: rgba(59,130,246,.1)
}

.badge--count {
    border-color: #10b981;
    background: rgba(16,185,129,.1)
}

.badge--info {
    border-color: rgba(56, 189, 248, .5);
    background: rgba(56, 189, 248, .12);
    color: #075985;
}

.badge--warn {
    border-color: rgba(245, 158, 11, .6);
    background: rgba(245, 158, 11, .14);
    color: #b45309;
}

.badge--error {
    border-color: #ef4444;
    background: rgba(239,68,68,.12)
}

.badge--queued {
    border-color: rgba(245, 158, 11, .6);
    background: rgba(245, 158, 11, .14);
    color: #b45309;
}

.badge--delivered {
    border-color: rgba(56, 189, 248, .5);
    background: rgba(56, 189, 248, .12);
    color: #075985;
}

.badge--applied {
    border-color: #10b981;
    background: rgba(16,185,129,.1);
}

.badge--failed {
    border-color: #ef4444;
    background: rgba(239,68,68,.12);
}

code {
    background: rgba(255,255,255,.04);
    border: 1px solid var(--border);
    padding: 2px 6px;
    border-radius: 6px
}

.alert {
    padding: 10px 12px;
    border-radius: 8px;
    margin: 10px 0;
    border: 1px solid var(--border)
}

.alert--error {
    border-color: var(--danger);
    background: rgba(239,68,68,.1)
}

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

.title-cell .title {
    font-weight: 600
}

.title-cell .sub {
    color: var(--muted);
    font-size: 12px;
    margin-top: 2px
}

.input {
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    color: var(--text);
    outline: none;
    transition: border .15s ease, box-shadow .15s ease
}

    .input::placeholder {
        color: #6b7280
    }

    .input:focus {
        border-color: var(--input-focus);
        box-shadow: 0 0 0 3px rgba(59,130,246,.15)
    }

.list--compact {
    margin: 6px 0 0 16px;
    padding: 0
}

    .list--compact li {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        align-items: center;
        margin: 2px 0
    }

/* Pretty details/summary styling */
details {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255,255,255,.03);
    padding: 6px 8px;
    box-shadow: 0 6px 18px rgba(0,0,0,.15);
    transition: background .2s ease, border-color .2s ease
}

    details:hover {
        border-color: #2a3550
    }

summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
    color: var(--text);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px
}

    summary::-webkit-details-marker {
        display: none
    }

    summary::before {
        content: '';
        width: 10px;
        height: 10px;
        border-right: 2px solid var(--muted);
        border-bottom: 2px solid var(--muted);
        transform: rotate(-45deg);
        transition: transform .2s ease, border-color .2s ease;
        margin-right: 4px
    }

details[open] summary::before {
    transform: rotate(45deg);
    border-color: var(--primary)
}

summary:hover {
    color: #fff
}

/* Content animation when opened */
details[open] .list--compact {
    animation: detailsIn .25s ease
}

@keyframes detailsIn {
    from {
        opacity: 0;
        transform: translateY(-3px)
    }

    to {
        opacity: 1;
        transform: none
    }
}

.fade-in {
    animation: fade .35s ease
}

@keyframes fade {
    from {
        opacity: 0;
        transform: translateY(6px)
    }

    to {
        opacity: 1;
        transform: none
    }
}

@media (max-width: 1100px) {
    .table th, .table td {
        padding: 8px 8px;
        font-size: 14px
    }
}

@media (max-width: 800px) {
    .table th, .table td {
        padding: 6px 6px;
        font-size: 13px
    }

    .nav a {
        margin-left: 8px
    }
}

details > summary { cursor: pointer; color: var(--text); }
details > summary:hover { text-decoration: underline; }
