*, *::before, *::after { box-sizing: border-box; }

:root {
    --bg: #07070a;
    --bg-soft: #0c0c11;
    --panel: #111116;
    --panel-2: #17171f;
    --ink: #f6f2f4;
    --muted: #a0a0ad;
    --line: #2a222a;
    --brand: #e11d48;
    --brand-2: #ff5c72;
    --brand-dark: #9f1239;
    --brand-soft: rgba(225, 29, 72, .15);
    --ok: #34d399;
    --danger: #f87171;
    --warn: #fbbf24;
    --radius: 16px;
    --radius-sm: 11px;
    --ring: 0 0 0 4px rgba(225, 29, 72, .16);
}

html, body { height: 100%; }

::selection { background: rgba(225, 29, 72, .4); color: #fff; }

body {
    margin: 0;
    font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.app {
    color: var(--ink);
    background:
        radial-gradient(1000px 560px at 8% -12%, rgba(225, 29, 72, .20), transparent 62%),
        radial-gradient(820px 480px at 104% -6%, rgba(159, 18, 57, .16), transparent 60%),
        radial-gradient(900px 700px at 50% 120%, rgba(120, 12, 38, .14), transparent 62%),
        var(--bg);
    background-attachment: fixed;
}

a { color: #fda4af; }

.shell { width: min(1120px, 100%); margin: 0 auto; padding: 0 20px; }

.topbar {
    position: sticky; top: 0; z-index: 30;
    background: rgba(8, 8, 11, .80);
    backdrop-filter: blur(14px) saturate(140%);
    border-bottom: 1px solid var(--line);
}

.topbar-inner { display: flex; align-items: center; gap: 16px; height: 66px; }

.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: inherit; }

.brand-mark {
    min-width: 36px; height: 36px; padding: 0 8px; border-radius: 11px;
    display: grid; place-items: center;
    color: #fff; font-weight: 800; font-size: 13px; letter-spacing: .02em;
    background: linear-gradient(140deg, #ff5c72, #e11d48 55%, #7f0d24);
    box-shadow: 0 8px 20px rgba(225, 29, 72, .38), inset 0 1px 0 rgba(255, 255, 255, .22);
}

.brand-mark.lg { min-width: 56px; height: 56px; border-radius: 16px; font-size: 19px; }

.brand-name {
    font-size: 17px; font-weight: 800; letter-spacing: -.015em;
    background: linear-gradient(180deg, #ffffff 5%, #ffe1e5 48%, #ff6b81 100%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
    filter: drop-shadow(0 2px 10px rgba(225, 29, 72, .28));
}

.search { position: relative; flex: 1; max-width: 420px; }

.search-icon {
    position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
    width: 16px; height: 16px; fill: none; stroke: #7d7480;
    stroke-width: 2; stroke-linecap: round;
}

.search input {
    width: 100%; padding: 10px 14px 10px 37px;
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: rgba(23, 23, 31, .78); color: var(--ink); font: inherit; font-size: 14px;
    outline: none; transition: .16s;
}

.search input::placeholder { color: #7d7480; }
.search input:focus { background: var(--panel-2); border-color: var(--brand); box-shadow: var(--ring); }

.user-menu { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.nav-link {
    font-size: 13px; font-weight: 600; color: #cfc6cb;
    text-decoration: none; padding: 8px 11px; border-radius: 9px;
    border: 1px solid transparent; transition: .15s;
}

.nav-link:hover { color: #fff; background: var(--panel-2); border-color: var(--line); }
.nav-link.owner-link { color: #fcd34d; }
.nav-link.owner-link:hover { border-color: rgba(251, 191, 36, .35); background: rgba(251, 191, 36, .08); }
.nav-link.security-link { color: #fda4af; }
.nav-link.security-link:hover { border-color: rgba(225, 29, 72, .4); background: rgba(225, 29, 72, .08); }

.avatar {
    width: 35px; height: 35px; border-radius: 50%;
    background: var(--brand-soft); color: #ffc9d1;
    display: grid; place-items: center; font-size: 11px; font-weight: 800;
    border: 1px solid rgba(225, 29, 72, .42);
}

.user-name { font-size: 14px; font-weight: 600; color: #cfc6cb; }
.logout-form { margin: 0; }

.btn { border: 0; border-radius: var(--radius-sm); font: inherit; font-weight: 600; cursor: pointer; transition: .16s; }

.btn-primary {
    padding: 12px 16px; color: #fff;
    background: linear-gradient(140deg, #f43f5e, #c8103a 60%, #9f1239);
    box-shadow: 0 10px 24px rgba(225, 29, 72, .32), inset 0 1px 0 rgba(255, 255, 255, .18);
}

.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-primary:active { transform: none; }
.btn-block { display: block; width: 100%; }

.btn-ghost {
    padding: 8px 12px; font-size: 13px;
    background: transparent; border: 1px solid var(--line); color: #cfc6cb;
}

.btn-ghost:hover { background: var(--panel-2); color: #fff; border-color: #40313a; }

.btn-sm { padding: 7px 10px; font-size: 12px; border-radius: 9px; }

.btn-danger {
    background: rgba(248, 113, 113, .12); color: #fca5a5;
    border: 1px solid rgba(248, 113, 113, .32);
}

.btn-danger:hover { background: rgba(248, 113, 113, .2); color: #fecaca; }

.page { padding: 30px 0 60px; }

.hero {
    position: relative; overflow: hidden;
    display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
    padding: 30px; border-radius: 20px;
    background:
        linear-gradient(135deg, rgba(225, 29, 72, .24), rgba(80, 7, 22, .55) 52%, rgba(30, 6, 12, .9)),
        var(--panel);
    border: 1px solid #3d1622;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .04);
}

.hero::before {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(115deg, transparent 55%, rgba(255, 92, 114, .08));
    pointer-events: none;
}

.hero::after {
    content: ""; position: absolute; right: -90px; top: -110px;
    width: 300px; height: 300px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 92, 114, .30), transparent 68%);
    pointer-events: none;
}

.eyebrow {
    margin: 0 0 9px; font-size: 11px; font-weight: 700;
    letter-spacing: .16em; text-transform: uppercase; color: #ffb3bf;
}

.hero h1 { margin: 0 0 8px; font-size: clamp(24px, 3.4vw, 34px); letter-spacing: -.02em; }
.lead { position: relative; z-index: 1; margin: 0; max-width: 58ch; color: #c9bcc2; font-size: 14px; line-height: 1.6; }

.stats { display: flex; gap: 12px; position: relative; z-index: 1; }

.stat {
    min-width: 108px; padding: 14px 16px; text-align: center;
    border-radius: 14px; border: 1px solid rgba(255, 255, 255, .10);
    background: rgba(10, 6, 9, .45);
    backdrop-filter: blur(6px);
}

.stat strong { display: block; font-size: 20px; letter-spacing: -.02em; }
.stat span { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: #ffb3bf; }

.dropzone {
    margin-top: 20px; padding: 30px; text-align: center; cursor: pointer;
    border: 2px dashed #4a1b27; border-radius: 20px;
    background: linear-gradient(180deg, rgba(28, 18, 24, .55), rgba(17, 17, 22, .85));
    transition: .18s;
}

.dropzone:hover, .dropzone.dragover {
    border-color: var(--brand);
    background: linear-gradient(180deg, rgba(225, 29, 72, .10), rgba(17, 17, 22, .9));
    transform: translateY(-1px);
    box-shadow: 0 20px 44px rgba(225, 29, 72, .16);
}

.dropzone:focus-visible { outline: 3px solid rgba(225, 29, 72, .4); outline-offset: 2px; }

.dz-icon {
    width: 54px; height: 54px; margin: 0 auto 12px;
    border-radius: 17px; background: var(--brand-soft);
    border: 1px solid rgba(225, 29, 72, .32);
    display: grid; place-items: center;
}

.dz-icon svg { width: 26px; height: 26px; fill: none; stroke: #ff9aa8; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.dropzone h2 { margin: 0 0 6px; font-size: 18px; }
.dz-hint { margin: 0; color: var(--muted); font-size: 13px; }

.link { border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: #ff9aa8; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

.progress { max-width: 420px; height: 8px; margin: 16px auto 0; border-radius: 999px; background: #2a222a; overflow: hidden; }
.progress-bar { width: 0; height: 100%; background: linear-gradient(90deg, #e11d48, #ff8a9d); transition: width .2s; }
.progress-bar.error { background: var(--danger); }
.progress-label { margin: 8px 0 0; font-size: 12px; color: var(--muted); }

.files { margin-top: 30px; }
.files-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.files-head h2 { margin: 0; font-size: 18px; }

.chip {
    display: inline-block; padding: 2px 9px; border-radius: 999px;
    background: var(--brand-soft); color: #ffc9d1;
    font-size: 11px; font-weight: 700; vertical-align: middle;
}

.filelist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.file {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(26, 20, 25, .55), rgba(17, 17, 22, .92));
    transition: .15s;
}

.file:hover { border-color: #4a2430; transform: translateY(-1px); box-shadow: 0 16px 34px rgba(0, 0, 0, .42); }

.file-ico {
    flex: 0 0 auto; width: 46px; height: 46px; border-radius: 13px;
    display: grid; place-items: center; color: #fff;
    font-size: 11px; font-weight: 800; letter-spacing: .02em;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .09);
}

.kind-image { background: linear-gradient(135deg, #fb7185, #be123c); }
.kind-video { background: linear-gradient(135deg, #f472b6, #9f1239); }
.kind-audio { background: linear-gradient(135deg, #fb923c, #b45309); }
.kind-archive { background: linear-gradient(135deg, #fbbf24, #a16207); }
.kind-doc { background: linear-gradient(135deg, #f87171, #991b1b); }
.kind-code { background: linear-gradient(135deg, #34d399, #047857); }
.kind-other { background: linear-gradient(135deg, #8b8b96, #3f3f46); }

.file-main { flex: 1; min-width: 0; }

.file-name { display: block; font-size: 14px; font-weight: 600; color: var(--ink); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-name:hover { color: #ff9aa8; text-decoration: underline; text-underline-offset: 2px; }

.file-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.dot { width: 3px; height: 3px; border-radius: 50%; background: #51434c; }

.file-actions { display: flex; align-items: center; gap: 6px; }
.delete-form { margin: 0; }

.icon-btn {
    display: grid; place-items: center; width: 38px; height: 38px;
    border: 1px solid var(--line); border-radius: 10px; background: rgba(23, 23, 31, .85);
    color: #c2b7bd; cursor: pointer; text-decoration: none; transition: .15s;
}

.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:hover { background: var(--panel-2); color: #ff9aa8; border-color: #4a2430; }
.icon-btn.danger:hover { background: rgba(248, 113, 113, .12); color: #fca5a5; border-color: rgba(248, 113, 113, .4); }

.empty {
    padding: 50px 20px; text-align: center; color: var(--muted);
    border: 1px dashed var(--line); border-radius: 18px;
    background: linear-gradient(180deg, rgba(26, 20, 25, .45), rgba(17, 17, 22, .85));
}
.empty-icon { width: 58px; height: 58px; margin: 0 auto 12px; border-radius: 17px; background: var(--panel-2); display: grid; place-items: center; }
.empty-icon svg { width: 26px; height: 26px; fill: none; stroke: #7d7480; stroke-width: 2; }
.empty h3 { margin: 0 0 4px; color: var(--ink); font-size: 16px; }
.empty p { margin: 0; font-size: 13px; }

.toast {
    position: fixed; right: 20px; bottom: 20px; z-index: 50; max-width: 380px;
    padding: 13px 16px; border-radius: 12px; color: #f6f2f4; font-size: 14px;
    background: #16121a; border: 1px solid var(--line); border-left: 4px solid var(--brand);
    box-shadow: 0 20px 44px rgba(0, 0, 0, .6); animation: slideIn .25s ease;
}

.toast.ok { border-left-color: var(--ok); }
.toast.error { border-left-color: var(--danger); }
.toast.info { border-left-color: var(--brand-2); }
.toast.hide { opacity: 0; transform: translateY(8px); transition: .4s; }

@keyframes slideIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.footer { border-top: 1px solid var(--line); background: rgba(8, 8, 11, .75); }
.footer-inner { display: flex; justify-content: space-between; gap: 12px; padding: 18px 20px; color: var(--muted); font-size: 12px; }

body.auth {
    display: grid; place-items: center;
    background:
        radial-gradient(880px 560px at 12% -10%, rgba(225, 29, 72, .30), transparent 60%),
        radial-gradient(680px 460px at 108% 108%, rgba(120, 12, 38, .35), transparent 60%),
        radial-gradient(620px 420px at 82% 6%, rgba(255, 92, 114, .12), transparent 60%),
        #060608;
    background-attachment: fixed;
}

.auth-wrap { width: min(440px, 100%); padding: 24px; }

.auth-card {
    position: relative;
    background: linear-gradient(180deg, rgba(26, 18, 23, .92), rgba(13, 12, 16, .97));
    border: 1px solid #38212b; border-radius: 22px; padding: 34px;
    box-shadow: 0 40px 90px rgba(0, 0, 0, .65), 0 0 0 1px rgba(225, 29, 72, .07);
    backdrop-filter: blur(8px);
}

.auth-card::before {
    content: ""; position: absolute; inset: -1px; border-radius: 22px; padding: 1px;
    background: linear-gradient(140deg, rgba(255, 92, 114, .45), transparent 40%, rgba(159, 18, 57, .3));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    pointer-events: none;
}

.auth-brand { display: flex; align-items: center; gap: 15px; margin-bottom: 26px; }

.auth-brand h1 {
    margin: 0; font-size: 27px; letter-spacing: -.03em; font-weight: 800; line-height: 1.1;
    background: linear-gradient(180deg, #ffffff 4%, #ffdfe3 42%, #ff5c72 78%, #e11d48 100%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
    filter: drop-shadow(0 4px 18px rgba(225, 29, 72, .32));
}

.auth-brand p { margin: 4px 0 0; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: #b88f9a; font-weight: 600; }

.field { display: block; margin-bottom: 16px; }
.field > span { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: #cfc6cb; }

.field input, .field select {
    width: 100%; padding: 12px 14px;
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: rgba(23, 23, 31, .85); color: var(--ink); font: inherit; outline: none; transition: .16s;
}

.field input:focus, .field select:focus { border-color: var(--brand); box-shadow: var(--ring); background: var(--panel-2); }

.field input.otp { letter-spacing: .35em; font-size: 20px; text-align: center; font-variant-numeric: tabular-nums; }

.password { position: relative; }
.password input { padding-right: 76px; }

.toggle-pass {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    border: 0; border-radius: 8px; padding: 8px 10px;
    background: transparent; color: var(--muted);
    font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
}

.toggle-pass:hover { background: var(--panel-2); color: var(--ink); }

.alert {
    margin-bottom: 16px; padding: 12px 14px;
    border: 1px solid rgba(248, 113, 113, .4); border-radius: var(--radius-sm);
    background: rgba(248, 113, 113, .1); color: #fca5a5; font-size: 14px;
}

.alert.ok { border-color: rgba(52, 211, 153, .4); background: rgba(52, 211, 153, .1); color: #6ee7b7; }

.auth-foot { margin: 20px 0 0; text-align: center; font-size: 13px; color: var(--muted); }
.auth-foot a { color: #ff9aa8; font-weight: 600; }

.panel {
    margin-top: 18px; padding: 22px;
    background: linear-gradient(180deg, rgba(26, 20, 25, .6), rgba(17, 17, 22, .95));
    border: 1px solid var(--line); border-radius: var(--radius);
}

.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-head h2 { margin: 0; font-size: 17px; }
.panel-note { margin: 0; color: var(--muted); font-size: 13px; }

.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: end; }
.form-grid.two { grid-template-columns: repeat(2, 1fr); }
.form-grid .field { margin-bottom: 0; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }

table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 720px; }
table.data th {
    text-align: left; padding: 11px 14px; font-size: 10.5px; font-weight: 700;
    letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
    background: rgba(9, 7, 10, .65); border-bottom: 1px solid var(--line);
}
table.data td { padding: 11px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
table.data tr:first-child td { border-top: 0; }
table.data tbody tr:hover { background: rgba(225, 29, 72, .05); }

.role {
    display: inline-block; padding: 2px 9px; border-radius: 999px;
    font-size: 10.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
}
.role-owner { background: rgba(251, 191, 36, .15); color: #fcd34d; border: 1px solid rgba(251, 191, 36, .35); }
.role-admin { background: rgba(255, 92, 114, .15); color: #ffb3bf; border: 1px solid rgba(255, 92, 114, .34); }
.role-user { background: rgba(160, 160, 173, .14); color: #d4d4dc; border: 1px solid rgba(160, 160, 173, .28); }

.actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.mini-form { display: flex; gap: 6px; align-items: center; margin: 0; }

.mini-form input, .mini-form select {
    padding: 7px 9px; font-size: 12px; border-radius: 9px;
    border: 1px solid var(--line); background: rgba(9, 7, 10, .6); color: var(--ink);
    font-family: inherit; outline: none; max-width: 130px;
}

.mini-form input:focus, .mini-form select:focus { border-color: var(--brand); box-shadow: var(--ring); }

.section-title { margin: 30px 0 12px; font-size: 17px; }

.status {
    display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px;
    border-radius: 999px; font-size: 12px; font-weight: 700;
    border: 1px solid var(--line); background: rgba(9, 7, 10, .5); color: #d4d4dc;
}
.status .status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status.on { border-color: rgba(52, 211, 153, .35); color: #6ee7b7; background: rgba(52, 211, 153, .08); }
.status.on .status-dot { background: var(--ok); box-shadow: 0 0 10px rgba(52, 211, 153, .8); }
.status.off { border-color: rgba(248, 113, 113, .3); color: #fca5a5; background: rgba(248, 113, 113, .08); }
.status.off .status-dot { background: var(--danger); }

.secret {
    display: block; padding: 14px 16px; margin: 10px 0;
    border: 1px dashed #4a2430; border-radius: 12px;
    background: rgba(9, 7, 10, .6);
    font-family: "Cascadia Mono", Consolas, "Courier New", monospace;
    font-size: 17px; letter-spacing: .16em; color: #ffb3bf;
    word-break: break-all; text-align: center; user-select: all;
}

.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.codes li {
    padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
    background: rgba(9, 7, 10, .55); text-align: center;
    font-family: "Cascadia Mono", Consolas, monospace; font-size: 14px; letter-spacing: .1em; color: #ffd7dc;
}

.event { font-family: "Cascadia Mono", Consolas, monospace; font-size: 12px; }
.event.bad { color: #fca5a5; }
.event.good { color: #6ee7b7; }

.note-list { margin: 10px 0 0; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.7; }

.mt-10 { margin-top: 10px; }
.mt-14 { margin-top: 14px; }
.mt-16 { margin-top: 16px; }
.mb-18 { margin-bottom: 18px; }
.break-all { word-break: break-all; }
.panel-warn { border-color: rgba(251, 191, 36, .4); }

@media (max-width: 860px) {
    .form-grid, .form-grid.two { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .topbar-inner { height: auto; padding: 10px 0; flex-wrap: wrap; }
    .search { order: 3; flex-basis: 100%; max-width: none; }
    .user-name { display: none; }
    .nav-link { padding: 6px 8px; font-size: 12px; }
    .hero { flex-direction: column; align-items: flex-start; }
    .stats { width: 100%; }
    .stat { flex: 1; }
    .file-ico { width: 40px; height: 40px; font-size: 10px; }
    .footer-inner { flex-direction: column; }
    .auth-card { padding: 26px; }
    .panel { padding: 18px; }
    .codes { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}
