
:root {
    --ink: #1b2434;
    --muted: #7c8798;
    --line: #e8ecf2;
    --surface: #ffffff;
    --canvas: #f7f8fb;
    --navy: #17243b;
    --violet: #6d5ce8;
    --violet-dark: #5c4cd1;
    --mint: #27a985;
    --danger: #c54352;
}

html, body {
    margin: 0;
    min-height: 100%;
    background: var(--canvas);
    color: var(--ink);
    font-family: 'DM Sans', 'Segoe UI', Arial, sans-serif;
}

button, input, textarea, select { font: inherit; }
h1, h2, h3 { color: var(--ink); font-family: 'Manrope', 'DM Sans', sans-serif; letter-spacing: -0.035em; }
h1 { font-size: clamp(1.9rem, 3vw, 2.5rem); font-weight: 750; margin: 0.2rem 0 0.25rem; }
h2 { font-size: 1.2rem; font-weight: 700; margin: 0; }
a { color: var(--violet-dark); }
.app-frame { min-height: 100vh; display: flex; }
.sidebar { width: 250px; flex: 0 0 250px; background: var(--navy); color: #fff; display: flex; flex-direction: column; padding: 25px 16px 20px; }
.app-brand { padding: 0 12px 43px; }
.brand-link { display: flex; align-items: center; gap: 12px; color: white; text-decoration: none; }
.brand-link > span:last-child { display: grid; gap: 2px; }
.brand-link strong { font: 800 1.14rem 'Manrope', sans-serif; letter-spacing: -.04em; }
.brand-link small { color: #9eabc0; font-size: .76rem; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; background: #7566e9; color: white; border-radius: 12px; font-size: 1.45rem; font-weight: 700; }
.brand-mark.large { width: 52px; height: 52px; margin: 0 auto 20px; font-size: 1.8rem; border-radius: 16px; }
.nav-section-label { color: #7f8ca3; font-size: .67rem; font-weight: 700; letter-spacing: .12em; margin: 0 12px 11px; }
.app-nav { display: grid; gap: 6px; }
.app-nav-link { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 12px; color: #bdc7d7; text-decoration: none; border-radius: 10px; font-size: .9rem; font-weight: 500; }
.app-nav-link:hover { color: #fff; background: rgba(255,255,255,.07); }
.app-nav-link.active { color: #fff; background: rgba(117,102,233,.24); }
.nav-icon { width: 20px; text-align: center; color: #aaa0ff; font-size: 1.05rem; }
.sidebar-bottom { margin-top: auto; display: flex; align-items: center; gap: 9px; color: #a3afc2; border-top: 1px solid rgba(255,255,255,.1); padding: 19px 12px 0; font-size: .76rem; }
.status-dot, .vault-footnote span, .security-note span { color: #49d3a6; font-size: .6rem; }
.main-area { min-width: 0; flex: 1; }
.top-row { height: 66px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: flex-end; padding: 0 clamp(22px, 4vw, 56px); }
.top-label { color: #9aa3b2; font-size: .67rem; font-weight: 700; letter-spacing: .12em; }
.top-lock { display: none; }
.content-area { max-width: 1240px; margin: auto; padding: clamp(26px, 4vw, 50px) clamp(22px, 4vw, 56px) 42px; }
.eyebrow { color: var(--violet); font-size: .66rem; line-height: 1.2; font-weight: 800; letter-spacing: .13em; margin: 0 0 7px; }
.muted { color: var(--muted); font-size: .9rem; margin: 0; line-height: 1.55; }
.auth-screen { min-height: calc(100vh - 155px); display: grid; place-items: center; }
.auth-card { width: min(100%, 430px); background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 39px 42px 30px; box-shadow: 0 16px 45px rgba(25, 37, 59, .07); }
.auth-card > .eyebrow, .auth-card > h1, .auth-card > .muted { text-align: center; }
.auth-card > h1 { font-size: 1.8rem; margin-bottom: 8px; }
.auth-card > .muted { margin: 0 auto 26px; }
.field-label { display: block; color: #394457; font-size: .8rem; font-weight: 700; margin: 16px 0 7px; }
.vault-input { border-color: #e0e5ed !important; border-radius: 9px !important; min-height: 43px; color: var(--ink) !important; font-size: .88rem !important; box-shadow: none !important; }
.vault-input:focus { border-color: #9a8ff1 !important; box-shadow: 0 0 0 3px rgba(109,92,232,.1) !important; }
.full-button { width: 100%; margin-top: 22px; min-height: 45px; border-radius: 9px; background: var(--violet); border-color: var(--violet); font-size: .88rem; font-weight: 700; }
.full-button:hover, .btn-primary:hover { background: var(--violet-dark); border-color: var(--violet-dark); }
.security-note { margin: 24px 0 0; text-align: center; color: #8a95a4; font-size: .73rem; }
.validation-message, .form-error { color: var(--danger); font-size: .78rem; margin: 5px 0 0; }
.form-error { margin-top: 15px; text-align: center; }
.vault-page { max-width: 1100px; margin: 0 auto; }
.vault-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 29px; }
.vault-header .muted { margin-top: 6px; }
.lock-button { border-radius: 9px; font-size: .8rem; font-weight: 600; min-height: 40px; }
.vault-toolbar { display: flex; align-items: center; gap: 11px; margin-bottom: 20px; }
.search-box { min-width: 150px; flex: 1; position: relative; }
.search-box > span { position: absolute; top: 6px; left: 12px; color: #8f99a8; font-size: 1.35rem; z-index: 1; line-height: 1.2; }
.search-box input { padding-left: 39px; }
.category-filter { width: 180px; }
.add-button { min-height: 43px; white-space: nowrap; border-radius: 9px; background: var(--violet); border-color: var(--violet); font-weight: 700; font-size: .82rem; }
.notice { background: #e9f8f2; color: #26765d; border: 1px solid #c9eddf; padding: 11px 14px; border-radius: 9px; font-size: .82rem; margin: -10px 0 18px; }
.vault-content { display: grid; grid-template-columns: minmax(310px, .85fr) minmax(360px, 1.15fr); gap: 17px; align-items: start; }
.item-list, .detail-card, .detail-placeholder, .empty-state, .editor-card, .generator-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 5px 20px rgba(27,36,52,.025); }
.item-list { overflow: hidden; }
.vault-item { width: 100%; min-height: 75px; padding: 13px 15px; display: flex; align-items: center; gap: 12px; text-align: left; border: 0; border-bottom: 1px solid #f0f2f5; background: white; color: var(--ink); }
.vault-item:last-child { border-bottom: 0; }
.vault-item:hover, .vault-item.selected { background: #f8f7ff; }
.vault-item.selected { box-shadow: inset 3px 0 var(--violet); }
.item-avatar { width: 39px; height: 39px; border-radius: 12px; display: grid; place-items: center; flex: 0 0 39px; color: #6357c9; background: #efedff; font-size: 1.1rem; font-weight: 700; }
.item-summary { min-width: 0; flex: 1; display: grid; gap: 5px; }
.item-summary strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .84rem; }
.item-summary > span { color: #929cac; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .74rem; }
.category-tag { display: inline-flex; align-items: center; white-space: nowrap; border-radius: 20px; background: #f1f3f7; color: #687386; padding: 4px 9px; font-size: .67rem; font-weight: 600; }
.detail-card { min-height: 260px; padding: 22px 24px; }
.detail-title-row { display: flex; align-items: center; gap: 13px; padding-bottom: 20px; border-bottom: 1px solid #edf0f4; margin-bottom: 4px; }
.large-avatar { width: 47px; height: 47px; flex-basis: 47px; font-size: 1.25rem; }
.detail-title { min-width: 0; flex: 1; display: grid; justify-items: start; gap: 7px; }
.detail-title h2 { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-actions { display: flex; gap: 4px; }
.icon-button { border: 0; background: transparent; color: #7a8596; width: 34px; height: 34px; border-radius: 8px; font-size: 1.1rem; }
.icon-button:hover { background: #f0efff; color: var(--violet-dark); }
.delete-action:hover { background: #fff0f1; color: var(--danger); }
.detail-field { display: grid; grid-template-columns: 94px minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 14px 0; border-bottom: 1px solid #f0f2f5; font-size: .81rem; }
.detail-field > span { color: #8c96a5; font-size: .76rem; }
.detail-field > strong, .detail-field > a { min-width: 0; overflow-wrap: anywhere; }
.secret-value { font-family: 'Cascadia Code', Consolas, monospace; letter-spacing: .02em; }
.text-button { border: 0; background: transparent; color: var(--violet-dark); font-size: .75rem; font-weight: 700; }
.notes-detail { grid-template-columns: 1fr; gap: 8px; align-items: start; }
.notes-detail p { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; color: #455164; }
.detail-footer { color: #9aa3b2; font-size: .69rem; padding-top: 15px; }
.delete-confirm { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 11px; margin-top: 16px; background: #fff6f6; border-radius: 9px; color: #74434a; font-size: .78rem; }
.delete-confirm span { flex: 1 1 100%; }
.detail-placeholder { min-height: 260px; display: grid; place-content: center; justify-items: center; text-align: center; }
.empty-state { min-height: 320px; display: grid; justify-items: center; align-content: center; text-align: center; padding: 34px; }
.empty-state h2 { margin: 12px 0 8px; }
.empty-state .btn { margin-top: 22px; }
.empty-icon { width: 48px; height: 48px; border-radius: 15px; background: #f0efff; color: var(--violet); display: grid; place-items: center; font-size: 1.45rem; }
.empty-filter { padding: 25px 20px; }
.empty-filter h2 { font-size: 1rem; margin-bottom: 7px; }
.vault-footnote { color: #969fae; font-size: .71rem; margin: 20px 2px; }
.editor-card { margin-bottom: 22px; padding: 22px 24px; }
.editor-heading { display: flex; align-items: start; justify-content: space-between; margin-bottom: 17px; }
.editor-heading h2 { font-size: 1.35rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.field-label:first-child { margin-top: 0; }
.wide-field { grid-column: 1 / -1; }
.password-entry { display: flex; gap: 9px; }
.password-entry .btn { white-space: nowrap; }
.notes-input { min-height: 100px; }
.editor-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }
.editor-actions .btn { border-radius: 8px; min-height: 40px; font-size: .82rem; }
.generator-page { max-width: 700px; margin: 5vh auto 0; }
.generator-page > .muted { margin-bottom: 23px; }
.generator-card { padding: 25px 28px; }
.generated-row { display: flex; gap: 10px; }
.generated-password { font-family: 'Cascadia Code', Consolas, monospace !important; font-size: .92rem !important; }
.generated-row .btn { white-space: nowrap; border-radius: 8px; background: var(--violet); border-color: var(--violet); }
.length-row { margin-top: 22px; }
.length-row .field-label { display: flex; justify-content: space-between; margin: 0 0 8px; }
.length-row strong { color: var(--violet-dark); }
.generator-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; color: #536073; font-size: .82rem; }
.generator-options input { accent-color: var(--violet); margin-right: 7px; }
.generator-hint { margin: 23px 0 0; border-top: 1px solid var(--line); padding-top: 16px; color: #8b95a4; font-size: .76rem; line-height: 1.55; }
.loading-card { max-width: 430px; margin: 18vh auto; text-align: center; color: var(--muted); }
#blazor-error-ui { display: none; }
#blazor-error-ui .dismiss { cursor: pointer; margin-left: 10px; }

@media (max-width: 900px) {
    .sidebar { width: 212px; flex-basis: 212px; }
    .vault-content { grid-template-columns: minmax(250px, .9fr) minmax(290px, 1.1fr); }
    .category-tag { display: none; }
}
@media (max-width: 700px) {
    .app-frame { display: block; }
    .sidebar { width: auto; padding: 12px 14px; }
    .app-brand { padding: 0 4px 12px; }
    .brand-mark { width: 34px; height: 34px; }
    .app-nav { display: flex; gap: 7px; }
    .nav-section-label, .sidebar-bottom { display: none; }
    .app-nav-link { height: 38px; font-size: .78rem; padding: 0 10px; }
    .top-row { height: 43px; padding: 0 20px; }
    .content-area { padding: 25px 16px 32px; }
    .vault-header { margin-bottom: 21px; }
    .vault-content { grid-template-columns: 1fr; }
    .detail-card { min-height: 0; }
    .vault-toolbar { flex-wrap: wrap; }
    .search-box { flex-basis: 100%; }
    .category-filter { flex: 1; width: auto; }
    .add-button { flex: 1; }
    .category-tag { display: inline-flex; }
}
@media (max-width: 480px) {
    .auth-card { padding: 31px 23px 24px; }
    .vault-header { align-items: start; }
    .lock-button { padding: 6px 9px; font-size: .72rem; }
    .form-grid { grid-template-columns: 1fr; }
    .wide-field { grid-column: auto; }
    .editor-card { padding: 18px 16px; }
    .detail-card { padding: 18px 15px; }
    .detail-field { grid-template-columns: 75px minmax(0,1fr) auto; }
    .generator-card { padding: 20px 17px; }
    .generator-options { grid-template-columns: 1fr; }
}


