﻿:root {
    --bg-0: #05030d;
    --bg-1: #0c0620;
    --bg-2: #130a2f;
    --surface: rgba(24, 14, 48, 0.72);
    --surface-2: rgba(17, 10, 36, 0.86);
    --border: rgba(192, 132, 252, 0.34);
    --text: #f4ecff;
    --muted: #b9a7d8;
    --purple: #a855f7;
    --purple-2: #7c3aed;
    --gold: #fbbf24;
    --gold-2: #f59e0b;
    --ok: #22c55e;
    --danger: #ef4444;
    --radius: 14px;
    --shadow: 0 16px 44px rgba(5, 2, 20, 0.62);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(1400px 600px at 12% -15%, rgba(168, 85, 247, 0.35), transparent 45%),
        radial-gradient(1100px 560px at 88% -10%, rgba(251, 191, 36, 0.24), transparent 42%),
        linear-gradient(160deg, var(--bg-2), var(--bg-1) 45%, var(--bg-0));
    overflow-x: hidden;
}

a {
    color: #dfc5ff;
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: #ffe8a6;
}

.app-shell {
    min-height: 100vh;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 26px;
    background: rgba(14, 8, 29, 0.74);
    border-bottom: 1px solid rgba(192, 132, 252, 0.25);
    box-shadow: 0 0 35px rgba(124, 58, 237, 0.18);
    backdrop-filter: blur(11px);
    position: sticky;
    top: 0;
    z-index: 20;
}

.brand {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.045em;
    color: #fff4d0;
    text-shadow: 0 0 16px rgba(245, 158, 11, 0.4);
}

.nav-links {
    display: flex;
    gap: 14px;
    align-items: center;
    font-size: 13px;
}

.container {
    width: min(1220px, calc(100% - 40px));
    margin: 28px auto;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(9px);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(120deg, rgba(168, 85, 247, 0.24), rgba(251, 191, 36, 0.24));
    opacity: 0.34;
}

.card > * {
    position: relative;
    z-index: 1;
}

.card.nested {
    background: var(--surface-2);
    box-shadow: none;
}

.card.narrow {
    max-width: 520px;
    margin: clamp(34px, 9vh, 95px) auto;
    padding: 24px;
}

h1,
h2 {
    margin: 0 0 10px;
    letter-spacing: -0.01em;
}

h1 {
    font-size: clamp(28px, 3vw, 36px);
    color: #f9edff;
    text-shadow: 0 0 24px rgba(168, 85, 247, 0.32);
}

h2 {
    font-size: 18px;
    color: #f5d8ff;
}

.muted {
    color: var(--muted);
    line-height: 1.5;
    margin-bottom: 10px;
}

.form-grid {
    display: grid;
    gap: 12px;
}

label {
    display: grid;
    gap: 7px;
    font-size: 13px;
    color: #ebd9ff;
}

input,
select {
    width: 100%;
    background: rgba(9, 5, 21, 0.93);
    color: var(--text);
    border: 1px solid rgba(192, 132, 252, 0.42);
    border-radius: 10px;
    padding: 11px 12px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

input:focus,
select:focus {
    border-color: rgba(251, 191, 36, 0.82);
    box-shadow:
        0 0 0 3px rgba(245, 158, 11, 0.2),
        0 0 24px rgba(168, 85, 247, 0.22);
    transform: translateY(-1px);
    outline: none;
}

.chk {
    display: flex;
    gap: 8px;
    align-items: center;
    color: #f2e6ff;
}

.chk input {
    width: auto;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid rgba(192, 132, 252, 0.46);
    border-radius: 10px;
    padding: 9px 13px;
    background: linear-gradient(130deg, rgba(82, 36, 130, 0.9), rgba(124, 58, 237, 0.9));
    color: #fff7e6;
    cursor: pointer;
    transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
    box-shadow: 0 8px 22px rgba(81, 20, 140, 0.35);
}

.btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
    box-shadow:
        0 10px 28px rgba(81, 20, 140, 0.44),
        0 0 20px rgba(245, 158, 11, 0.2);
}

.btn.primary {
    background: linear-gradient(120deg, var(--purple), var(--purple-2), #6d28d9);
    border-color: rgba(216, 180, 254, 0.55);
}

.btn.warn {
    background: linear-gradient(120deg, #f59e0b, #d97706);
    border-color: rgba(251, 191, 36, 0.62);
    color: #1f1400;
    font-weight: 700;
}

.btn.tiny {
    padding: 6px 10px;
    font-size: 12px;
}

.btn-link {
    background: transparent;
    border: 0;
    color: #e4c7ff;
    font-size: 13px;
    cursor: pointer;
    padding: 0;
}

.table-wrap {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid rgba(192, 132, 252, 0.22);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: rgba(9, 5, 22, 0.56);
}

th,
td {
    border-bottom: 1px solid rgba(192, 132, 252, 0.16);
    padding: 11px 12px;
    text-align: left;
    vertical-align: top;
}

th {
    background: linear-gradient(120deg, rgba(81, 20, 140, 0.58), rgba(245, 158, 11, 0.17));
    color: #ffefcc;
    font-weight: 700;
    letter-spacing: 0.02em;
}

tr:hover td {
    background: rgba(124, 58, 237, 0.19);
}

.alert {
    padding: 11px 13px;
    border-radius: 10px;
    margin-bottom: 12px;
    border: 1px solid transparent;
}

.alert.success {
    background: rgba(22, 101, 52, 0.3);
    border-color: rgba(34, 197, 94, 0.45);
    color: #bbf7d0;
}

.alert.error {
    background: rgba(127, 29, 29, 0.34);
    border-color: rgba(239, 68, 68, 0.5);
    color: #fecaca;
}

.badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.25);
    border: 1px solid rgba(192, 132, 252, 0.35);
    color: #f3e8ff;
    font-size: 11px;
    letter-spacing: 0.01em;
}

.badge.role {
    background: linear-gradient(120deg, rgba(124, 58, 237, 0.4), rgba(245, 158, 11, 0.28));
    border-color: rgba(251, 191, 36, 0.46);
    color: #fff4d6;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.filters input,
.filters select {
    width: auto;
    min-width: 170px;
}

.pagination {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 13px;
    color: #f4dcff;
}

.row-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.grid-two {
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    gap: 14px;
}

.stack {
    display: grid;
    gap: 14px;
}

.inline-form {
    display: inline;
    margin: 0;
}

code {
    background: rgba(124, 58, 237, 0.24);
    border: 1px solid rgba(245, 158, 11, 0.28);
    border-radius: 8px;
    padding: 2px 6px;
    color: #ffedc2;
}

@media (max-width: 920px) {
    .container {
        width: calc(100% - 24px);
    }

    .topbar {
        padding: 14px 12px;
    }

    .brand {
        font-size: 13px;
    }

    .grid-two {
        grid-template-columns: 1fr;
    }

    .filters input,
    .filters select,
    .filters button {
        min-width: 0;
        width: 100%;
    }
}


/* ===== iOS-inspired login ===== */
.login-page {
    background:
        radial-gradient(900px 520px at 22% 10%, rgba(168, 85, 247, 0.34), transparent 60%),
        radial-gradient(900px 520px at 82% 80%, rgba(251, 191, 36, 0.2), transparent 60%),
        linear-gradient(160deg, #1a1231 0%, #140d2a 38%, #0b0a1f 100%);
}

.topbar-login {
    background: transparent;
    border-bottom-color: rgba(255,255,255,0.08);
    box-shadow: none;
}

.login-page .container {
    width: min(980px, calc(100% - 24px));
    margin-top: 34px;
}

.login-ui {
    position: relative;
    min-height: calc(100vh - 140px);
    display: grid;
    place-items: center;
}

.login-blur {
    position: absolute;
    filter: blur(60px);
    pointer-events: none;
    border-radius: 50%;
    opacity: 0.55;
}

.login-blur-a {
    width: 340px;
    height: 340px;
    left: 10%;
    top: 12%;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.62) 0%, rgba(168, 85, 247, 0.22) 70%);
}

.login-blur-b {
    width: 360px;
    height: 360px;
    right: 10%;
    bottom: 8%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.62) 0%, rgba(168, 85, 247, 0.18) 70%);
}

.login-card-ios {
    position: relative;
    z-index: 2;
    width: min(560px, 92vw);
    padding: 34px 36px 28px;
    border-radius: 36px;
    background: linear-gradient(145deg, rgba(255,255,255,0.16), rgba(255,255,255,0.06));
    border: 1px solid rgba(255,255,255,0.24);
    backdrop-filter: blur(18px) saturate(120%);
    box-shadow:
        0 24px 70px rgba(8, 6, 22, 0.56),
        inset 0 1px 0 rgba(255,255,255,0.25);
}

.login-card-ios h1 {
    margin: 8px 0 8px;
    font-size: 42px;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: #fff6e0;
}

.login-card-ios .muted {
    color: #ece1ff;
    margin-bottom: 18px;
}

.avatar-orb {
    width: 112px;
    height: 112px;
    margin: 2px auto 18px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 44px;
    color: #ffe7b6;
    background: linear-gradient(145deg, rgba(255,255,255,0.24), rgba(255,255,255,0.08));
    border: 1px solid rgba(255,255,255,0.28);
    box-shadow: inset 0 10px 18px rgba(255,255,255,0.08), 0 18px 34px rgba(20, 14, 40, 0.44);
}

.login-form-ios {
    display: grid;
    gap: 14px;
}

.line-field {
    display: grid;
    gap: 8px;
    color: #efe4ff;
    font-size: 13px;
}

.line-field input {
    border: none;
    border-bottom: 1px solid rgba(255,255,255,0.58);
    border-radius: 0;
    padding: 10px 2px 8px;
    background: transparent;
    color: #fff;
}

.line-field input:focus {
    box-shadow: none;
    border-bottom-color: #fbbf24;
}

.btn.ios-cta {
    margin-top: 8px;
    width: 100%;
    border-radius: 16px;
    padding: 13px 16px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: linear-gradient(90deg, #7c3aed 0%, #a855f7 55%, #fbbf24 130%);
    border: 1px solid rgba(255,255,255,0.28);
    color: #fffdf8;
}

@media (max-width: 760px) {
    .login-card-ios {
        padding: 24px 20px 20px;
        border-radius: 24px;
    }

    .login-card-ios h1 {
        font-size: 34px;
    }

    .avatar-orb {
        width: 92px;
        height: 92px;
        font-size: 34px;
    }
}
