:root {
    --ink: #160d20;
    --muted: #756b7f;
    --purple-950: #240536;
    --purple-900: #351052;
    --purple-700: #612b84;
    --purple-500: #8c5ac4;
    --lavender: #eee5fb;
    --pink: #f568a1;
    --white: #ffffff;
    --line: #e9e0f1;
    --shadow: 0 22px 60px rgba(53, 16, 82, .13);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: #f8f5fb;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-width: 320px;
    background:
        radial-gradient(circle at 5% 30%, rgba(140, 90, 196, .12), transparent 30rem),
        linear-gradient(180deg, #f5effb 0, #fbf9fd 27rem, #f8f5fb 100%);
}

a { color: var(--purple-700); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.hero {
    position: relative;
    overflow: hidden;
    min-height: 225px;
    color: var(--white);
    background: linear-gradient(125deg, var(--purple-950), #4e196d 62%, #71318a);
}

.hero::after {
    content: "";
    position: absolute;
    inset: auto -8% -75px 42%;
    height: 150px;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 50%;
    transform: rotate(-7deg);
}

.hero__content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding-block: 42px 82px;
}

.hero__glow { position: absolute; border-radius: 999px; filter: blur(2px); opacity: .75; }
.hero__glow--one { width: 260px; height: 260px; right: 12%; top: -145px; background: rgba(245, 104, 161, .42); }
.hero__glow--two { width: 170px; height: 170px; right: 1%; bottom: -115px; background: rgba(205, 180, 241, .4); }

.brand { display: flex; align-items: center; gap: 22px; }
.brand__box {
    display: grid;
    place-items: center;
    width: 130px;
    height: 92px;
    padding: 15px 18px;
    border-radius: 24px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 14px 40px rgba(0, 0, 0, .18);
}
.brand__box img { display: block; max-width: 100%; max-height: 100%; }

.eyebrow {
    display: block;
    margin-bottom: 7px;
    color: #e8d7fa;
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}
.eyebrow--dark { color: var(--purple-500); }

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(2rem, 5vw, 3.6rem); line-height: .98; letter-spacing: -.045em; }
h2 { margin-bottom: 5px; font-size: clamp(1.4rem, 3vw, 2rem); letter-spacing: -.035em; }

.status {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 999px;
    color: #f5eefb;
    background: rgba(255, 255, 255, .1);
    font-size: .83rem;
    font-weight: 700;
    white-space: nowrap;
}
.status i { width: 9px; height: 9px; border-radius: 50%; background: #85efb2; box-shadow: 0 0 0 5px rgba(133, 239, 178, .12); }

.page { position: relative; z-index: 4; margin-top: -48px; padding-bottom: 30px; }

.flash {
    margin-bottom: 16px;
    padding: 14px 18px;
    border: 1px solid #bde8cc;
    border-radius: 15px;
    color: #1d6638;
    background: #effbf3;
    box-shadow: 0 10px 30px rgba(53, 16, 82, .08);
    font-size: .9rem;
    font-weight: 750;
}
.flash--error { border-color: #f1c3cc; color: #98243b; background: #fff2f4; }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; min-width: 0; }
.stat {
    min-width: 0;
    min-height: 154px;
    padding: 24px;
    border: 1px solid rgba(97, 43, 132, .1);
    border-radius: 24px;
    background: rgba(255, 255, 255, .96);
    box-shadow: var(--shadow);
}
.stat--primary { color: var(--white); background: linear-gradient(145deg, #5a2078, #321047); }
.stat span, .stat small { display: block; }
.stat span { margin-bottom: 12px; color: var(--muted); font-size: .8rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.stat--primary span, .stat--primary small { color: #eadcf4; }
.stat strong { display: block; margin-bottom: 6px; font-size: 2.45rem; line-height: 1; letter-spacing: -.04em; }
.stat strong.stat__date { font-size: 1.25rem; line-height: 1.25; letter-spacing: -.02em; }
.stat small { color: var(--muted); font-size: .78rem; }

.panel { min-width: 0; margin-top: 22px; overflow: hidden; border: 1px solid rgba(97, 43, 132, .1); border-radius: 26px; background: var(--white); box-shadow: var(--shadow); }
.panel__top { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; padding: 28px 30px 24px; border-bottom: 1px solid var(--line); }
.panel__top p { margin-bottom: 0; color: var(--muted); font-size: .9rem; }
.panel__controls { display: grid; gap: 11px; justify-items: end; }
.panel__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }

.search { display: flex; align-items: center; gap: 8px; }
.search input {
    width: min(310px, 32vw);
    height: 45px;
    padding: 0 15px;
    border: 1px solid #dbd0e5;
    border-radius: 13px;
    outline: 0;
    font: inherit;
    color: var(--ink);
    background: #fbf9fd;
}
.search input:focus { border-color: var(--purple-500); box-shadow: 0 0 0 4px rgba(140, 90, 196, .12); }
.search button {
    height: 45px;
    padding: 0 18px;
    border: 0;
    border-radius: 13px;
    color: #fff;
    background: var(--purple-900);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}
.search button:hover { background: var(--purple-700); }
.search > a { padding: 10px 4px; font-size: .82rem; font-weight: 700; }

.button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    border: 0;
    border-radius: 12px;
    font: inherit;
    font-size: .82rem;
    font-weight: 850;
    line-height: 1.1;
    text-align: center;
    cursor: pointer;
}
.button:hover { text-decoration: none; }
.button--export { color: #fff; background: linear-gradient(135deg, #6d3193, #9259bf); }
.button--export:hover { background: linear-gradient(135deg, #572475, #7d45a9); }
.button--danger { color: #fff; background: #c43651; }
.button--danger:hover { background: #a92740; }
.button--danger:disabled { cursor: not-allowed; opacity: .45; }
.button--secondary { color: var(--ink); background: #eee8f2; }
.button--secondary:hover { background: #e2d7e9; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 16px 18px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: #6d6077; background: #faf8fc; font-size: .72rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
td { font-size: .9rem; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fcfaff; }
td time { color: var(--muted); font-size: .82rem; white-space: nowrap; }
.id-pill { display: inline-grid; place-items: center; min-width: 32px; height: 28px; padding: 0 8px; border-radius: 9px; color: var(--purple-700); background: var(--lavender); font-size: .76rem; font-weight: 900; }
.delete-one {
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid #efc2cc;
    border-radius: 10px;
    color: #a5253e;
    background: #fff3f5;
    font: inherit;
    font-size: .76rem;
    font-weight: 850;
    cursor: pointer;
}
.delete-one:hover { border-color: #d76b7f; background: #ffe7eb; }

.empty { padding: 70px 24px; text-align: center; }
.empty > span { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 18px; border-radius: 50%; color: #fff; background: linear-gradient(145deg, var(--purple-500), var(--pink)); font-size: 1.45rem; }
.empty h3 { margin-bottom: 8px; }
.empty p { margin-bottom: 0; color: var(--muted); }

footer { display: flex; justify-content: space-between; gap: 15px; padding: 22px 4px 0; color: var(--muted); font-size: .8rem; }
footer span { font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

body.modal-open { overflow: hidden; }
.modal[hidden] { display: none; }
.modal { position: fixed; z-index: 1000; inset: 0; display: grid; place-items: center; padding: 20px; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(20, 5, 31, .72); backdrop-filter: blur(5px); }
.modal__dialog {
    position: relative;
    z-index: 1;
    width: min(100%, 470px);
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, .5);
    border-radius: 25px;
    background: #fff;
    box-shadow: 0 30px 100px rgba(22, 5, 34, .38);
    text-align: center;
}
.modal__icon { display: grid; place-items: center; width: 55px; height: 55px; margin: 0 auto 17px; border-radius: 50%; color: #fff; background: #c43651; font-size: 1.45rem; font-weight: 900; }
.modal__dialog h2 { margin-bottom: 8px; }
.modal__dialog > p { margin-bottom: 9px; color: var(--muted); }
.modal__target { min-height: 43px; padding: 12px; border-radius: 12px; color: var(--ink) !important; background: #f7f2fa; font-size: .9rem; font-weight: 750; overflow-wrap: anywhere; }
.modal__buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }

@media (max-width: 820px) {
    .hero__content { align-items: flex-start; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat:first-child { grid-column: 1 / -1; }
    .panel__top { align-items: stretch; flex-direction: column; gap: 18px; }
    .panel__controls { justify-items: stretch; }
    .panel__actions { justify-content: flex-start; }
    .search input { flex: 1; width: auto; min-width: 0; }
}

@media (max-width: 640px) {
    .container { width: min(calc(100% - 24px), 1180px); }
    .hero { min-height: 265px; }
    .hero__content { padding-block: 28px 74px; flex-direction: column; }
    .brand { align-items: center; gap: 14px; }
    .brand__box { width: 102px; height: 74px; border-radius: 18px; }
    h1 { font-size: 2.25rem; }
    .status { align-self: flex-start; }
    .page { margin-top: -42px; }
    .stats { grid-template-columns: 1fr; gap: 12px; }
    .stat { min-height: 132px; padding: 18px; border-radius: 19px; }
    .stat:first-child { grid-column: auto; }
    .stat strong { font-size: 2rem; }
    .stat strong.stat__date { font-size: 1rem; }
    .panel { border-radius: 21px; }
    .panel__top { padding: 23px 18px 20px; }
    .search { flex-wrap: wrap; }
    .search input { flex-basis: 100%; }
    .search button { flex: 1; }
    .panel__actions { display: grid; grid-template-columns: 1fr; }
    table, tbody, tr, td { display: block; width: 100%; }
    thead { display: none; }
    tbody { padding: 12px; }
    tbody tr { margin-bottom: 12px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 17px; background: #fdfbfe; }
    tbody tr:last-child { margin-bottom: 0; }
    tbody tr:hover { background: #fdfbfe; }
    td { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 10px; padding: 9px 0; border-bottom: 1px dashed #e7ddeb; overflow-wrap: anywhere; }
    td:last-child { border-bottom: 0; }
    td::before { content: attr(data-label); color: #7b6c84; font-size: .69rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
    .delete-one { justify-self: start; }
    .modal__dialog { padding: 24px 18px; border-radius: 21px; }
    .modal__buttons { grid-template-columns: 1fr; }
    footer { padding-inline: 2px; }
}
