:root {
    --bg: #0f172a;
    --panel: #111827;
    --panel-soft: #1f2937;
    --text: #e5e7eb;
    --muted: #94a3b8;
    --line: #334155;
    --primary: #38bdf8;
    --primary-dark: #0284c7;
    --danger: #f87171;
    --success: #34d399;
    --warning: #fbbf24;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: radial-gradient(circle at top, #1e3a8a 0, var(--bg) 32rem);
    color: var(--text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    min-height: 100vh;
}

a {
    color: #7dd3fc;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.topbar {
    align-items: center;
    background: rgba(15, 23, 42, 0.9);
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    padding: 1rem clamp(1rem, 5vw, 3rem);
    position: sticky;
    top: 0;
    backdrop-filter: blur(10px);
    z-index: 10;
}

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

.nav {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.container {
    margin: 0 auto;
    max-width: 1100px;
    padding: 2rem 1rem 4rem;
}

.hero,
.page-heading {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

h1,
h2 {
    line-height: 1.1;
    margin: 0 0 0.45rem;
}

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

.small-text {
    font-size: 0.9rem;
}

.card,
.table-card,
.auth-card,
.empty-state {
    background: rgba(17, 24, 39, 0.92);
    border: 1px solid var(--line);
    border-radius: 1rem;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.25);
    padding: 1.25rem;
}

.auth-card {
    margin: 3rem auto 0;
    max-width: 460px;
}

.empty-state {
    text-align: center;
}

.stack {
    display: grid;
    gap: 1rem;
}

.grid {
    display: grid;
    gap: 1rem;
}

.grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

label {
    color: #f8fafc;
    display: grid;
    font-weight: 650;
    gap: 0.45rem;
}

input,
textarea,
button {
    font: inherit;
}

input,
textarea {
    background: #020617;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    color: var(--text);
    padding: 0.78rem 0.9rem;
    width: 100%;
}

textarea {
    resize: vertical;
}

input:focus,
textarea:focus {
    border-color: var(--primary);
    outline: 2px solid rgba(56, 189, 248, 0.25);
}

.button,
button.button {
    align-items: center;
    background: var(--panel-soft);
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    color: #f8fafc;
    cursor: pointer;
    display: inline-flex;
    font-weight: 750;
    justify-content: center;
    min-height: 2.65rem;
    padding: 0.7rem 1rem;
    text-decoration: none;
}

.button:hover {
    filter: brightness(1.08);
    text-decoration: none;
}

.button.primary {
    background: var(--primary-dark);
    border-color: var(--primary);
}

.button.danger {
    background: #7f1d1d;
    border-color: var(--danger);
}

.button.small {
    min-height: 2.15rem;
    padding: 0.45rem 0.7rem;
}

.link-button {
    background: transparent;
    border: 0;
    color: #7dd3fc;
    cursor: pointer;
    padding: 0;
}

.inline-form {
    display: inline-flex;
    margin: 0;
}

.search-form {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.table-card {
    overflow-x: auto;
    padding: 0;
}

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

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 1rem;
    text-align: left;
    vertical-align: middle;
}

th {
    color: #bfdbfe;
    font-size: 0.86rem;
    text-transform: uppercase;
}

tr:last-child td {
    border-bottom: 0;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.alert {
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
}

.alert-error {
    background: rgba(127, 29, 29, 0.75);
    border: 1px solid var(--danger);
}

.alert-success {
    background: rgba(6, 78, 59, 0.75);
    border: 1px solid var(--success);
}

.password-row {
    display: flex;
    gap: 0.6rem;
}

.password-row input {
    flex: 1;
}

.generator-box {
    border: 1px solid var(--line);
    border-radius: 0.85rem;
    padding: 1rem;
}

.generator-box legend {
    color: #bfdbfe;
    font-weight: 800;
    padding: 0 0.5rem;
}

.checkbox {
    align-items: center;
    display: flex;
    gap: 0.5rem;
    margin-top: 1.85rem;
}

.checkbox input {
    width: auto;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.detail-row {
    align-items: center;
    border-bottom: 1px solid var(--line);
    display: grid;
    gap: 1rem;
    grid-template-columns: 11rem 1fr;
    padding-bottom: 1rem;
}

.detail-row.block {
    align-items: start;
}

.detail-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.label {
    color: #bfdbfe;
    font-weight: 800;
}

code {
    background: #020617;
    border: 1px solid var(--line);
    border-radius: 0.4rem;
    padding: 0.12rem 0.35rem;
}

@media (max-width: 760px) {
    .topbar,
    .hero,
    .page-heading,
    .search-form,
    .password-row,
    .detail-row {
        align-items: stretch;
        flex-direction: column;
        grid-template-columns: 1fr;
    }

    .grid.two,
    .grid.four {
        grid-template-columns: 1fr;
    }

    .checkbox {
        margin-top: 0;
    }
}


.secret-box {
    background: rgba(2, 6, 23, 0.55);
    border: 1px solid var(--line);
    border-radius: 0.85rem;
    display: grid;
    gap: 1rem;
    padding: 1rem;
}

.breakable {
    display: inline-block;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.block-text {
    display: block;
    margin-top: 0.3rem;
}
