:root {
    --bg: #f6f7fb;
    --surface: #ffffff;
    --text: #181820;
    --muted: #6f7280;
    --accent: #6b4eff;
    --accent-2: #ffb300;
    --border: #e5e7ef;
    --danger: #b42318;
    --success: #067647;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
}

a { color: var(--accent); text-decoration: none; }

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    background: #101016;
    color: #fff;
    padding: 16px 0;
}

.nav-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.brand {
    color: #fff;
    font-weight: 800;
    letter-spacing: .08em;
}

nav {
    display: flex;
    align-items: center;
    gap: 18px;
}

nav a { color: #fff; }

main { padding: 36px 0 60px; }

.hero, .page-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    margin-bottom: 28px;
}

.hero {
    padding: 34px;
    border-radius: 22px;
    color: #fff;
    background: linear-gradient(135deg, #6b4eff, #a34cff);
}

.hero h1, .page-heading h1 {
    margin: 0 0 8px;
    font-size: clamp(2rem, 4vw, 3.4rem);
}

.hero p { max-width: 700px; }

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent-2);
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.card, .detail-card, .asset-form, .filters, .table-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(25, 25, 40, .05);
}

.card {
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.card-link { color: var(--text); transition: transform .15s ease, box-shadow .15s ease; }
.card-link:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(25, 25, 40, .1); }

.metric {
    font-size: 2.1rem;
    font-weight: 800;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 16px;
    border: 0;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.button.small { padding: 8px 12px; }
.button.secondary { background: #ececf5; color: var(--text); }
.button.danger { background: var(--danger); }

.filters {
    display: grid;
    grid-template-columns: 1fr 240px auto;
    gap: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

input, select, textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 11px 12px;
    font: inherit;
    background: #fff;
}

label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-weight: 700;
}

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

.asset-form {
    padding: 24px;
    display: grid;
    gap: 20px;
}

.actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: #fafafe;
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.badge {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 999px;
    background: #eeeaff;
    color: var(--accent);
    font-size: .8rem;
    font-weight: 700;
}

.detail-card { padding: 26px; }

.detail-card section {
    padding: 18px 0;
    border-bottom: 1px solid var(--border);
}

.detail-card section:last-child { border-bottom: 0; }

.meta-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--border);
}

.meta-grid div {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.meta-grid span { color: var(--muted); }

.alert {
    padding: 14px 16px;
    border-radius: 10px;
    margin-bottom: 18px;
}

.alert.success { background: #ecfdf3; color: var(--success); }
.alert.error { background: #fef3f2; color: var(--danger); }

.site-footer {
    padding: 24px 0;
    color: var(--muted);
    border-top: 1px solid var(--border);
}

@media (max-width: 760px) {
    .nav-wrap, .hero, .page-heading {
        flex-direction: column;
        align-items: flex-start;
    }

    nav { flex-wrap: wrap; }

    .filters, .form-grid, .meta-grid {
        grid-template-columns: 1fr;
    }
}


.inline-form { margin: 0; }
.clickable-row { cursor: pointer; }
.clickable-row:hover { background: #f7f5ff; }
.clickable-row:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.field-help { color: var(--muted); font-size: .85rem; font-weight: 400; }
.media-section { margin-top: 24px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.media-card { overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.media-card img { display: block; width: 100%; height: 180px; object-fit: cover; background: #eee; }
.media-file { display: grid; place-items: center; height: 180px; background: #f0edff; font-weight: 700; }
.media-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px; }
.media-meta > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-button { padding: 0; border: 0; background: transparent; cursor: pointer; font: inherit; }
.danger-text { color: var(--danger); }
.checkbox-label { flex-direction: row; align-items: center; font-weight: 500; }
.checkbox-label input { width: auto; }
.permissions-fieldset { border: 1px solid var(--border); border-radius: 12px; padding: 18px; }
.permissions-fieldset legend { padding: 0 8px; font-weight: 700; }
.permissions-grid { display: grid; grid-template-columns: repeat(2, minmax(220px, 1fr)); gap: 14px; margin-top: 16px; }
.empty-state { padding: 24px; background: var(--surface); border: 1px dashed var(--border); border-radius: 14px; color: var(--muted); }
.nav-button {
    border: 0;
    background: transparent;
    color: #fff;
    font: inherit;
    cursor: pointer;
    padding: 0;
}

.auth-main {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px;
    background:
        radial-gradient(circle at top left, rgba(107, 78, 255, .2), transparent 38%),
        radial-gradient(circle at bottom right, rgba(255, 179, 0, .16), transparent 34%),
        var(--bg);
}

.login-shell {
    width: min(440px, 100%);
}

.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: 0 24px 70px rgba(25, 25, 40, .12);
    padding: 34px;
}

.login-card h1 {
    margin: 0 0 8px;
    font-size: 2.4rem;
}

.login-form {
    display: grid;
    gap: 18px;
    margin-top: 24px;
}

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