:root {
    --blue: #2d6cff;
    --blue-dark: #0e2f8a;
    --sky: #dbeafe;
    --paper: #f8fbff;
    --ink: #08111f;
    --line: #08111f;
    --red: #ff4d4d;
    --yellow: #ffd966;
    --green: #50d890;
    --shadow: 8px 8px 0 #08111f;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at 10% 10%, rgba(45,108,255,.18), transparent 28%),
        linear-gradient(135deg, #f8fbff 0%, #dbeafe 100%);
}

a { color: inherit; }

.wrapper {
    width: min(1120px, calc(100% - 28px));
    margin: 0 auto;
    padding: 28px 0 50px;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 950;
    font-size: 22px;
    letter-spacing: -.04em;
    text-decoration: none;
}

.logo-box {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    background: var(--blue);
    color: white;
    border: 3px solid var(--line);
    box-shadow: 4px 4px 0 var(--line);
    transform: rotate(-3deg);
}

.card {
    background: rgba(255,255,255,.92);
    border: 3px solid var(--line);
    box-shadow: var(--shadow);
    border-radius: 20px;
    padding: 22px;
}

.hero {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 22px;
    align-items: stretch;
}

.hero h1, .page-title {
    margin: 0 0 12px;
    font-size: clamp(34px, 6vw, 70px);
    line-height: .93;
    letter-spacing: -.07em;
}

.hero p, .muted { color: #334155; line-height: 1.65; }

.btn, button, input[type="submit"] {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--blue);
    color: white;
    border: 3px solid var(--line);
    border-radius: 14px;
    padding: 12px 16px;
    font-weight: 900;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 4px 4px 0 var(--line);
    transition: transform .12s ease, box-shadow .12s ease;
}

.btn:hover, button:hover, input[type="submit"]:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 var(--line);
}

.btn.secondary { background: white; color: var(--ink); }
.btn.danger { background: var(--red); }
.btn.small { padding: 8px 10px; border-radius: 10px; font-size: 13px; }

.grid { display: grid; gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.form-row { display: grid; gap: 8px; margin-bottom: 16px; }
label { font-weight: 900; }
input, textarea, select {
    width: 100%;
    border: 3px solid var(--line);
    border-radius: 14px;
    padding: 13px 14px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    outline: none;
}
textarea { min-height: 220px; resize: vertical; }
input:focus, textarea:focus, select:focus { box-shadow: 0 0 0 4px rgba(45,108,255,.22); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0 12px; }
th { text-align: left; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: #475569; }
td { background: white; border-top: 3px solid var(--line); border-bottom: 3px solid var(--line); padding: 14px; vertical-align: top; }
td:first-child { border-left: 3px solid var(--line); border-radius: 14px 0 0 14px; }
td:last-child { border-right: 3px solid var(--line); border-radius: 0 14px 14px 0; }

.badge {
    display: inline-flex;
    align-items: center;
    border: 2px solid var(--line);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 950;
}
.badge.active { background: var(--green); }
.badge.warning { background: var(--yellow); }
.badge.expired { background: var(--red); color: white; }
.badge.lock { background: #111827; color: white; }

.note-paper {
    position: relative;
    background: white;
    border: 3px solid var(--line);
    box-shadow: var(--shadow);
    border-radius: 22px;
    padding: clamp(20px, 4vw, 38px);
    overflow: hidden;
}
.note-paper::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 14px;
    background: repeating-linear-gradient(to bottom, var(--blue), var(--blue) 18px, #174ee8 18px, #174ee8 28px);
}
.note-content {
    white-space: normal;
    font-size: 18px;
    line-height: 1.78;
}

.note-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 14px 0 24px;
}

.flash {
    border: 3px solid var(--line);
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 14px;
    font-weight: 800;
    background: #fff;
}
.flash.success { background: #dcfce7; }
.flash.error { background: #fee2e2; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.login-box { max-width: 460px; margin: 7vh auto 0; }
.copy-input { font-size: 13px; }

.footer-note {
    margin-top: 24px;
    font-size: 13px;
    color: #475569;
}

@media (max-width: 820px) {
    .hero, .grid-2 { grid-template-columns: 1fr; }
    .nav { align-items: flex-start; flex-direction: column; }
    .card { padding: 18px; }
}
