/* Dark Mysterious Hackery Vault Theme */

:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-tertiary: #1a1a1a;
    --terminal-green: #00ff41;
    --terminal-cyan: #00ffff;
    --terminal-yellow: #ffff00;
    --terminal-red: #ff0040;
    --terminal-purple: #ff00ff;
    --text-primary: #00ff41;
    --text-secondary: #00ffff;
    --text-muted: #666666;
    --border-color: #333333;
    --glow-color: rgba(0, 255, 65, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.vault-body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Courier New', 'Consolas', 'Monaco', monospace;
    overflow-x: hidden;
    position: relative;
    color-scheme: dark;
}

body.vault-body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        repeating-linear-gradient(
            0deg,
            rgba(0, 255, 65, 0.03) 0px,
            transparent 1px,
            transparent 2px,
            rgba(0, 255, 65, 0.03) 3px
        );
    pointer-events: none;
    z-index: 1;
}

/* Terminal Container */
.vault-container {
    background: var(--bg-secondary);
    border: 2px solid var(--terminal-green);
    box-shadow: 0 0 20px var(--glow-color), inset 0 0 20px rgba(0, 255, 65, 0.1);
    max-width: 600px;
    width: 100%;
    position: relative;
    z-index: 2;
}

/* Landing page footer (index.php); main area uses Bootstrap vh-100 + flex center */
.landing-footer {
    flex-shrink: 0;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.35em 0.5em;
    padding: 16px 20px 22px;
    font-size: 12px;
    letter-spacing: 0.1em;
    color: rgba(170, 210, 188, 0.8);
    border-top: 1px solid rgba(0, 255, 65, 0.18);
    z-index: 2;
    position: relative;
    text-align: center;
}

.landing-footer-copy {
    color: #8eb89e;
}

.landing-footer-brand {
    color: #cff5e0;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.terminal-header {
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--terminal-green);
    padding: 10px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.terminal-buttons {
    display: flex;
    gap: 8px;
}

.terminal-buttons span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.btn-close {
    background: var(--terminal-red);
}

.btn-minimize {
    background: var(--terminal-yellow);
}

.btn-maximize {
    background: var(--terminal-green);
}

.terminal-title {
    color: var(--terminal-green);
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.terminal-body {
    padding: 30px;
    position: relative;
    min-height: 400px;
}

.scanline {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--terminal-green);
    opacity: 0.3;
    animation: scanline 8s linear infinite;
    pointer-events: none;
}

@keyframes scanline {
    0% { top: 0; opacity: 0.3; }
    50% { opacity: 0.6; }
    100% { top: 100%; opacity: 0.3; }
}

/* Glitch Effect */
.glitch {
    font-size: 2.5rem;
    font-weight: bold;
    text-transform: uppercase;
    position: relative;
    color: var(--terminal-green);
    letter-spacing: 5px;
    animation: glitch 2s infinite;
    text-shadow: 
        0 0 10px var(--terminal-green),
        0 0 20px var(--terminal-green),
        0 0 30px var(--terminal-green);
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 var(--terminal-cyan);
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 var(--terminal-purple), 2px 2px var(--terminal-red);
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 1s infinite linear alternate-reverse;
}

@keyframes glitch {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
}

@keyframes glitch-anim {
    0% { clip: rect(31px, 9999px, 94px, 0); }
    5% { clip: rect(54px, 9999px, 66px, 0); }
    10% { clip: rect(28px, 9999px, 100px, 0); }
    15% { clip: rect(87px, 9999px, 5px, 0); }
    20% { clip: rect(42px, 9999px, 78px, 0); }
    25% { clip: rect(23px, 9999px, 35px, 0); }
    30% { clip: rect(76px, 9999px, 99px, 0); }
    35% { clip: rect(12px, 9999px, 54px, 0); }
    40% { clip: rect(65px, 9999px, 22px, 0); }
    45% { clip: rect(44px, 9999px, 88px, 0); }
    50% { clip: rect(33px, 9999px, 11px, 0); }
    55% { clip: rect(90px, 9999px, 45px, 0); }
    60% { clip: rect(19px, 9999px, 67px, 0); }
    65% { clip: rect(58px, 9999px, 3px, 0); }
    70% { clip: rect(7px, 9999px, 92px, 0); }
    75% { clip: rect(81px, 9999px, 26px, 0); }
    80% { clip: rect(36px, 9999px, 71px, 0); }
    85% { clip: rect(15px, 9999px, 48px, 0); }
    90% { clip: rect(69px, 9999px, 8px, 0); }
    95% { clip: rect(52px, 9999px, 84px, 0); }
    100% { clip: rect(25px, 9999px, 60px, 0); }
}

/* Tabs */
.vault-tabs {
    display: flex;
    gap: 10px;
    margin: 30px 0;
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 10px 20px;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: var(--terminal-cyan);
}

.tab-btn.active {
    color: var(--terminal-green);
    border-bottom-color: var(--terminal-green);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Forms */
.vault-form {
    margin-top: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.terminal-label {
    display: block;
    color: var(--terminal-cyan);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.terminal-input {
    width: 100%;
    background-color: var(--bg-primary);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--terminal-green);
    padding: 12px;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
    resize: vertical;
    -webkit-appearance: none;
    appearance: none;
}

/* Bootstrap reboot can set light input backgrounds; keep vault fields on-theme */
body.vault-body .vault-form .terminal-input:not(.readonly) {
    background-color: var(--bg-primary) !important;
    color: var(--terminal-green) !important;
}

.terminal-input[type="textarea"],
textarea.terminal-input {
    min-height: 80px;
    resize: vertical;
}

.terminal-input:focus {
    border-color: var(--terminal-green);
    box-shadow: 0 0 10px var(--glow-color);
}

/* Match dark vault theme when browsers autofill username/password (otherwise white/yellow) */
.terminal-input:-webkit-autofill,
.terminal-input:-webkit-autofill:hover,
.terminal-input:-webkit-autofill:focus,
.terminal-input:-webkit-autofill:active {
    -webkit-text-fill-color: var(--terminal-green) !important;
    caret-color: var(--terminal-green);
    border: 1px solid var(--border-color) !important;
    -webkit-box-shadow: 0 0 0 1000px var(--bg-primary) inset !important;
    box-shadow: 0 0 0 1000px var(--bg-primary) inset !important;
    transition: background-color 99999s ease-out 0s;
}

.terminal-input:-webkit-autofill:focus {
    border-color: var(--terminal-green) !important;
    -webkit-box-shadow: 0 0 0 1000px var(--bg-primary) inset, 0 0 10px var(--glow-color) !important;
    box-shadow: 0 0 0 1000px var(--bg-primary) inset, 0 0 10px var(--glow-color) !important;
}

.terminal-input.readonly {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    cursor: default;
}

.terminal-text {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.6;
}

.terminal-text.warning {
    color: var(--terminal-yellow);
}

.vault-login-hint {
    color: #b8dcc8;
    font-size: 0.9rem;
    line-height: 1.55;
    margin-bottom: 1.1rem;
    text-align: left;
}

.vault-login-cancel-wrap {
    margin-top: 1.25rem;
    text-align: center;
    font-size: 12px;
}

body.vault-body a.vault-login-cancel-link,
body.vault-body a.vault-login-cancel-link:visited {
    color: #8ef5a8;
    text-decoration: none;
    letter-spacing: 0.08em;
    font-weight: 600;
    text-shadow: 0 0 12px rgba(0, 255, 65, 0.25);
}

body.vault-body a.vault-login-cancel-link:hover {
    color: var(--terminal-green);
    text-decoration: underline;
    text-shadow: 0 0 14px var(--glow-color);
}

body.vault-body a.vault-login-cancel-link:focus-visible {
    outline: 2px solid rgba(0, 255, 65, 0.6);
    outline-offset: 3px;
}

/* Empty section messages (notes, files, contacts, …) — higher contrast than default .terminal-text */
.terminal-text.notes-empty,
.terminal-text.contacts-empty,
.terminal-text.passwords-empty,
.terminal-text.creditcards-empty,
.terminal-text.files-browser-empty {
    color: #d2f4e2;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.65;
    letter-spacing: 0.02em;
    text-transform: none;
    text-shadow: 0 0 18px rgba(0, 255, 65, 0.12);
    margin: 0;
    padding: 22px 24px;
    max-width: 38rem;
    background: rgba(6, 22, 12, 0.88);
    border: 1px solid rgba(0, 255, 65, 0.35);
    border-radius: 6px;
    box-shadow:
        inset 0 1px 0 rgba(0, 255, 65, 0.1),
        0 8px 24px rgba(0, 0, 0, 0.4);
}

.terminal-text.files-browser-empty {
    text-align: center;
    max-width: none;
}

/* Buttons */
.btn-vault {
    background: transparent;
    border: 2px solid var(--terminal-green);
    color: var(--terminal-green);
    padding: 12px 30px;
    font-family: inherit;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.btn-vault::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--terminal-green);
    opacity: 0.1;
    transition: left 0.3s;
}

.btn-vault:hover::before {
    left: 0;
}

.btn-vault:hover {
    box-shadow: 0 0 20px var(--glow-color);
    text-shadow: 0 0 10px var(--terminal-green);
}

.btn-vault-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 10px 20px;
    font-family: inherit;
    font-size: 11px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-vault-secondary:hover {
    border-color: var(--terminal-red);
    color: var(--terminal-red);
}

/* Alerts */
.terminal-alert {
    background: var(--bg-primary);
    border: 1px solid;
    padding: 15px;
    margin-bottom: 20px;
    font-size: 12px;
}

.alert-danger {
    border-color: var(--terminal-red);
    color: var(--terminal-red);
}

.alert-warning {
    border-color: var(--terminal-yellow);
    color: var(--terminal-yellow);
}

.error-prefix,
.warning-prefix {
    font-weight: bold;
    margin-right: 10px;
}

/* Key Display */
.key-display {
    display: flex;
    gap: 10px;
}

.key-display .terminal-input {
    flex: 1;
}

.btn-copy {
    background: var(--bg-tertiary);
    border: 1px solid var(--terminal-green);
    color: var(--terminal-green);
    padding: 12px 20px;
    font-family: inherit;
    font-size: 11px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-copy:hover {
    background: var(--terminal-green);
    color: var(--bg-primary);
}

/* Main Vault Interface */
.vault-main {
    display: flex;
    height: 100vh;
    position: relative;
    z-index: 2;
}

.vault-sidebar {
    width: 250px;
    background: var(--bg-secondary);
    border-right: 2px solid var(--terminal-green);
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 20px var(--glow-color);
}

/* Sidebar title — same EntroCrypt glitch look as landing page, sized for narrow column */
.vault-sidebar > .terminal-header.vault-sidebar-header {
    justify-content: center;
    align-items: center;
    padding: 14px 10px 15px;
    min-height: 2.5rem;
}

.vault-sidebar > .terminal-header.vault-sidebar-header .vault-sidebar-brand.glitch {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0;
    text-align: center;
    font-size: clamp(0.69rem, 0.26rem + 1.35vw, 0.96rem);
    letter-spacing: 0.1em;
    line-height: 1.2;
    white-space: normal;
    word-break: break-word;
}

.sidebar-content {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.vault-status {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 14px;
    background: rgba(0, 20, 8, 0.65);
    border: 1px solid rgba(0, 255, 65, 0.55);
    margin-bottom: 20px;
    box-shadow:
        inset 0 0 20px rgba(0, 255, 65, 0.07),
        0 0 12px rgba(0, 255, 65, 0.12);
}

.status-indicator {
    width: 11px;
    height: 11px;
    background: var(--terminal-green);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(0, 255, 65, 0.75);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

.status-text {
    color: #b8ffc8;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    text-shadow: 0 0 10px rgba(0, 255, 65, 0.35);
}

.sidebar-nav {
    flex: 1;
}

.nav-btn {
    width: 100%;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(0, 255, 65, 0.35);
    color: #c5ead4;
    padding: 15px;
    margin-bottom: 10px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-btn:hover {
    border-color: rgba(0, 255, 255, 0.65);
    color: #e8ffff;
    background: rgba(0, 255, 255, 0.08);
    box-shadow: 0 0 12px rgba(0, 255, 255, 0.12);
}

.nav-btn.active {
    border-color: var(--terminal-green);
    color: var(--terminal-green);
    background: rgba(0, 255, 65, 0.14);
    box-shadow: 0 0 14px rgba(0, 255, 65, 0.2);
    font-weight: 700;
}

.nav-icon {
    font-size: 16px;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 0, 64, 0.22);
}

.btn-logout {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(165deg, rgba(48, 12, 22, 0.95) 0%, rgba(14, 6, 8, 0.98) 100%);
    border: 1px solid rgba(255, 0, 64, 0.55);
    border-radius: 6px;
    color: #ff7a94;
    padding: 14px 16px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, box-shadow 0.2s, transform 0.2s, background 0.2s;
    box-shadow:
        0 4px 14px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 120, 140, 0.14);
}

.btn-logout:hover {
    color: #fff5f7;
    background: linear-gradient(165deg, rgba(255, 0, 64, 0.38) 0%, rgba(160, 0, 40, 0.55) 100%);
    border-color: rgba(255, 120, 130, 0.9);
    box-shadow:
        0 0 22px rgba(255, 0, 64, 0.4),
        0 6px 18px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 200, 210, 0.2);
    transform: translateY(-1px);
}

.btn-logout:active {
    transform: translateY(0);
    box-shadow: 0 0 12px rgba(255, 0, 64, 0.25), inset 0 2px 8px rgba(0, 0, 0, 0.35);
}

.btn-logout:focus-visible {
    outline: 2px solid rgba(255, 100, 120, 0.95);
    outline-offset: 2px;
}

.btn-logout-icon {
    font-size: 18px;
    line-height: 1;
    filter: drop-shadow(0 0 8px rgba(255, 0, 64, 0.45));
}

.btn-logout-text {
    text-shadow: 0 0 12px rgba(255, 0, 64, 0.25);
}

/* Content Area */
.vault-content-area {
    flex: 1;
    background: var(--bg-primary);
    overflow-y: auto;
    padding: 30px;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--terminal-green);
}

.section-title {
    color: var(--terminal-green);
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 0 0 10px var(--glow-color);
}

/* Section header primary actions (+ New note, upload, etc.) */
.btn-add {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: linear-gradient(165deg, rgba(14, 28, 18, 0.95) 0%, rgba(8, 14, 10, 0.98) 100%);
    border: 1px solid rgba(0, 255, 65, 0.55);
    border-radius: 6px;
    color: #8ef5a8;
    padding: 12px 18px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.11em;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, box-shadow 0.2s, transform 0.2s, background 0.2s;
    box-shadow:
        0 4px 14px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(0, 255, 65, 0.12);
    text-shadow: 0 0 12px rgba(0, 255, 65, 0.22);
}

.btn-add:hover {
    color: #f0fff4;
    background: linear-gradient(165deg, rgba(0, 255, 65, 0.24) 0%, rgba(0, 110, 44, 0.48) 100%);
    border-color: rgba(0, 255, 130, 0.88);
    box-shadow:
        0 0 22px rgba(0, 255, 65, 0.38),
        0 6px 18px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(160, 255, 190, 0.22);
    transform: translateY(-1px);
}

.btn-add:active {
    transform: translateY(0);
    box-shadow: 0 0 12px rgba(0, 255, 65, 0.22), inset 0 2px 8px rgba(0, 0, 0, 0.35);
}

.btn-add:focus-visible {
    outline: 2px solid rgba(0, 255, 130, 0.85);
    outline-offset: 2px;
}

/* Notes */
.notes-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px 20px;
    align-items: stretch;
}

.notes-container > .notes-empty {
    grid-column: 1 / -1;
}

.note-card {
    display: flex;
    flex-direction: column;
    min-height: 188px;
    background: linear-gradient(165deg, rgba(26, 32, 28, 0.95) 0%, var(--bg-secondary) 100%);
    border: 1px solid rgba(0, 255, 65, 0.25);
    border-radius: 6px;
    padding: 16px 16px 14px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
    position: relative;
    user-select: none;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(0, 255, 65, 0.06);
}

.note-card:hover {
    border-color: rgba(0, 255, 65, 0.55);
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.45), 0 0 18px var(--glow-color);
    transform: translateY(-2px);
}

.note-card.sortable-ghost {
    opacity: 0.45;
}

.note-card-title {
    color: var(--terminal-green);
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.note-meta {
    flex: 1 1 auto;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 255, 65, 0.12);
    font-size: 11px;
    line-height: 1.45;
    color: #9ec4b0;
    letter-spacing: 0.02em;
}

.note-meta-line {
    display: block;
}

.note-meta-line + .note-meta-line {
    margin-top: 5px;
}

.note-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: flex-end;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid rgba(0, 255, 65, 0.15);
}

.note-meta-label {
    color: var(--terminal-cyan);
    font-weight: 600;
    font-size: 10px;
    letter-spacing: 0.08em;
}

.note-meta-sep {
    margin: 0 0.4em;
    color: rgba(0, 255, 65, 0.35);
}

.note-date-meta {
    font-size: 11px;
    line-height: 1.5;
    color: #9ec4b0;
    margin: 12px 0 0 0;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(0, 255, 65, 0.2);
    border-radius: 2px;
}

.btn-note-action {
    background: rgba(8, 20, 12, 0.9);
    border: 1px solid rgba(0, 255, 65, 0.55);
    color: #b8f5c8;
    padding: 5px 10px;
    font-family: inherit;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.btn-note-action:hover {
    border-color: var(--terminal-cyan);
    color: #e8ffff;
    background: rgba(0, 255, 255, 0.12);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.22);
}

.btn-note-action.delete {
    border-color: rgba(255, 0, 64, 0.6);
    color: #ffb3c4;
}

.btn-note-action.delete:hover {
    border-color: var(--terminal-red);
    color: #ffffff;
    background: rgba(255, 0, 64, 0.14);
    box-shadow: 0 0 10px rgba(255, 0, 64, 0.35);
}


/* Files */
.files-section-header {
    flex-wrap: wrap;
    gap: 12px 16px;
}

.files-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.files-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 4px;
    margin: 0 0 16px 0;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(0, 255, 65, 0.2);
    border-radius: 4px;
    font-size: 12px;
}

.files-bc-part {
    background: none;
    border: none;
    color: #c5ead4;
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    padding: 2px 4px;
    text-decoration: none;
    border-radius: 2px;
}

.files-bc-part:hover {
    color: var(--terminal-cyan);
    background: rgba(0, 255, 255, 0.08);
}

.files-bc-sep {
    color: rgba(0, 255, 65, 0.35);
    user-select: none;
    margin: 0 2px;
}

.files-browser-empty {
    grid-column: 1 / -1;
}

.files-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: 16px 14px;
    align-items: start;
}

.file-browser-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-height: 158px;
    padding: 14px 10px 12px;
    background: linear-gradient(165deg, rgba(26, 32, 28, 0.92) 0%, var(--bg-secondary) 100%);
    border: 1px solid rgba(0, 255, 65, 0.22);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
    user-select: none;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(0, 255, 65, 0.05);
}

.file-browser-tile--file {
    cursor: default;
}

.file-browser-tile-drag {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    min-height: 0;
    padding-bottom: 4px;
    cursor: pointer;
}

/* ZIP etc.: no in-browser viewer — tile body opens nothing; drag still uses grab */
.file-browser-tile--no-view .file-browser-tile-drag {
    cursor: grab;
}

.file-browser-tile--folder.file-browser-drop-target {
    border-color: rgba(0, 255, 255, 0.75);
    box-shadow: 0 0 22px rgba(0, 255, 255, 0.35);
    transform: translateY(-2px) scale(1.02);
}

.files-bc-part.files-bc-drop-target {
    color: #e8ffff !important;
    background: rgba(0, 255, 255, 0.15);
    border-radius: 3px;
}

.file-browser-tile:hover {
    border-color: rgba(0, 255, 65, 0.5);
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.4), 0 0 14px var(--glow-color);
    transform: translateY(-2px);
}

.file-browser-tile--folder .file-browser-icon {
    filter: hue-rotate(-12deg) saturate(1.1);
}

.file-browser-icon {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 8px;
    text-shadow: 0 0 12px rgba(0, 255, 65, 0.25);
}

.file-browser-label {
    color: var(--terminal-green);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.3;
    word-break: break-word;
    width: 100%;
    flex: 1 1 auto;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.file-browser-meta {
    font-size: 10px;
    color: #8eb8a0;
    margin-top: 6px;
    width: 100%;
    line-height: 1.3;
}

.file-browser-tile-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 2px;
    justify-content: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 255, 65, 0.12);
    width: 100%;
}

.file-browser-tile-actions .btn-note-action:not(.btn-action-icon) {
    padding: 4px 8px;
    font-size: 9px;
}

.btn-note-action.btn-action-icon {
    padding: 4px 3px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    line-height: 1;
    letter-spacing: 0;
    text-transform: none;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 8px;
}

.btn-note-action.btn-action-icon:hover {
    border: none !important;
    background: rgba(0, 255, 255, 0.14) !important;
    box-shadow: none !important;
    color: #e8ffff;
}

.btn-note-action.btn-action-icon.delete {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

.btn-note-action.btn-action-icon.delete:hover {
    border: none !important;
    background: rgba(255, 0, 64, 0.18) !important;
    box-shadow: none !important;
    color: #ffffff;
}

.btn-note-action.btn-action-icon:focus-visible {
    outline: 2px solid rgba(0, 255, 255, 0.45);
    outline-offset: 2px;
}

.btn-note-action.btn-action-icon.delete:focus-visible {
    outline-color: rgba(255, 0, 64, 0.55);
}

.file-browser-tile-actions .btn-note-action.btn-action-icon {
    font-size: 1.08rem !important;
    padding: 4px 2px !important;
    flex: 0 0 auto;
}

.btn-action-icon-char {
    pointer-events: none;
    line-height: 1;
}

#section-files.drag-over {
    border: 2px dashed var(--terminal-green);
    background: rgba(0, 255, 65, 0.05);
    position: relative;
}

#section-files.drag-over::before {
    content: 'DROP FILES HERE';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--terminal-green);
    font-size: 1.5rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 3px;
    z-index: 10;
    pointer-events: none;
    text-shadow: 0 0 20px var(--glow-color);
}

.file-viewer-content {
    padding: 20px;
}

.file-viewer-content img {
    border: 1px solid var(--border-color);
    box-shadow: 0 0 10px var(--glow-color);
}

.file-viewer-content iframe {
    border: 1px solid var(--border-color);
    box-shadow: 0 0 10px var(--glow-color);
    background: #fff;
}

.file-viewer-content video,
.file-viewer-content audio {
    border: 1px solid var(--border-color);
    box-shadow: 0 0 10px var(--glow-color);
    background: var(--bg-primary);
}

.file-text-content {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    padding: 15px;
    color: var(--terminal-green);
    font-family: 'Courier New', 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    line-height: 1.6;
    text-align: left;
    overflow-x: auto;
    max-height: 60vh;
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.file-viewer-info {
    text-align: center;
    padding: 20px;
}

.file-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    min-height: 200px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--terminal-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Contacts, passwords, credit cards — shared card grid */
.contacts-container,
.passwords-container,
.creditcards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px 20px;
    align-items: stretch;
}

.contacts-container > .contacts-empty,
.passwords-container > .passwords-empty,
.creditcards-container > .creditcards-empty {
    grid-column: 1 / -1;
}

.contact-card,
.password-card,
.creditcard-card {
    display: flex;
    flex-direction: column;
    min-height: 168px;
    background: linear-gradient(165deg, rgba(26, 32, 28, 0.95) 0%, var(--bg-secondary) 100%);
    border: 1px solid rgba(0, 255, 65, 0.25);
    border-radius: 6px;
    padding: 16px 16px 14px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
    position: relative;
    user-select: none;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(0, 255, 65, 0.06);
}

.contact-card:hover,
.password-card:hover,
.creditcard-card:hover {
    border-color: rgba(0, 255, 65, 0.55);
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.45), 0 0 18px var(--glow-color);
    transform: translateY(-2px);
}

.contact-card-title,
.password-card-title,
.creditcard-card-title {
    color: var(--terminal-green);
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.contact-card-details,
.password-card-details,
.creditcard-card-details {
    flex: 1 1 auto;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 255, 65, 0.12);
    font-size: 11px;
    line-height: 1.5;
    color: #9ec4b0;
}

.contact-card-details--empty,
.password-card-details--empty,
.creditcard-card-details--empty {
    flex: 1 1 auto;
    min-height: 40px;
    padding-top: 0;
    margin-top: 8px;
    border-top: none;
}

.contact-detail-line,
.password-detail-line,
.creditcard-detail-line {
    margin-bottom: 6px;
    word-break: break-word;
}

.contact-detail-line:last-child,
.password-detail-line:last-child,
.creditcard-detail-line:last-child {
    margin-bottom: 0;
}

.contact-card-actions,
.password-card-actions,
.creditcard-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: flex-end;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid rgba(0, 255, 65, 0.15);
}

/* Settings */
.settings-container {
    max-width: none;
    width: 100%;
}

.settings-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
    gap: 28px 32px;
    align-items: start;
}

.settings-column--main {
    min-width: 0;
}

.settings-column--side {
    position: sticky;
    top: 16px;
}

.settings-side-title {
    margin-bottom: 12px;
    font-size: 0.75rem;
    letter-spacing: 0.14em;
}

.settings-column--side .setting-item {
    padding: 14px 16px;
    margin-bottom: 12px;
}

.settings-column--side .setting-item:last-child {
    margin-bottom: 0;
}

.settings-column--side .terminal-label {
    display: block;
    margin-bottom: 8px;
}

.settings-side-value {
    display: block;
    color: #dff8ea;
    font-size: 0.9rem;
    line-height: 1.4;
    letter-spacing: 0.02em;
    text-transform: none;
}

@media (max-width: 991px) {
    .settings-layout {
        grid-template-columns: 1fr;
    }

    .settings-column--side {
        position: static;
    }
}

.vault-security-blurb {
    background: var(--bg-tertiary);
    border: 1px solid rgba(0, 255, 65, 0.4);
    padding: 24px 28px;
    margin-bottom: 0;
    box-shadow: inset 0 0 28px rgba(0, 255, 65, 0.07);
}

.vault-security-heading {
    color: var(--terminal-green);
    font-size: 1rem;
    font-weight: bold;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 16px;
    line-height: 1.35;
    text-shadow: 0 0 12px var(--glow-color);
}

.vault-security-lead {
    margin-bottom: 14px;
}

.vault-security-blurb .terminal-text {
    color: #dff5e8;
    font-size: 0.95rem;
    line-height: 1.68;
    margin-bottom: 14px;
    letter-spacing: 0.02em;
    text-transform: none;
    font-weight: normal;
}

.vault-security-blurb .terminal-text strong {
    color: #ffffff;
    font-weight: 650;
}

.vault-security-subhead {
    margin-top: 8px;
    margin-bottom: 12px;
    font-size: 0.78rem;
    letter-spacing: 0.12em;
}

.vault-security-list {
    margin: 0 0 14px 1.15rem;
    padding: 0;
    list-style: square;
    color: #cff3dc;
    font-size: 0.92rem;
    line-height: 1.62;
    letter-spacing: 0.02em;
    text-transform: none;
}

.vault-security-list li {
    margin-bottom: 10px;
    padding-left: 6px;
}

.vault-security-list li strong {
    color: #ffffff;
    font-weight: 650;
}

.vault-security-list li::marker {
    color: var(--terminal-cyan);
}

.vault-inline-code {
    font-family: 'Courier New', 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
    color: #7cfffc;
    background: rgba(0, 0, 0, 0.45);
    padding: 2px 6px;
    border-radius: 3px;
    word-break: break-word;
}

.vault-security-footnote {
    margin-bottom: 0 !important;
    font-size: 0.88rem !important;
    color: #b8d4c4 !important;
    line-height: 1.62 !important;
    border-top: 1px solid rgba(0, 255, 65, 0.25);
    padding-top: 16px;
    margin-top: 6px;
}

.setting-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 20px;
    margin-bottom: 15px;
}

.vault-id {
    color: #9dfff8;
    font-size: 13px;
    line-height: 1.5;
    word-break: break-all;
    display: block;
    margin-top: 2px;
}

/* Modal */
.vault-modal {
    background: var(--bg-secondary);
    border: 2px solid var(--terminal-green);
    box-shadow: 0 0 30px var(--glow-color);
}

.vault-modal .modal-body {
    padding: 30px;
}

.btn-close-modal {
    background: transparent;
    border: none;
    color: var(--terminal-red);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    line-height: 1;
}

.btn-close-modal:hover {
    color: var(--terminal-red);
    text-shadow: 0 0 10px var(--terminal-red);
}

.terminal-footer {
    border-top: 1px solid var(--border-color);
    padding: 15px 30px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Quill Editor Dark Theme */
.ql-container {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--terminal-green);
    font-family: inherit;
}

.ql-editor {
    color: var(--terminal-green);
    min-height: 300px;
}

.ql-toolbar {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-bottom: none;
}

.ql-toolbar .ql-stroke {
    stroke: var(--terminal-green);
}

.ql-toolbar .ql-fill {
    fill: var(--terminal-green);
}

.ql-toolbar button:hover,
.ql-toolbar button.ql-active {
    color: var(--terminal-cyan);
}

.ql-toolbar button:hover .ql-stroke,
.ql-toolbar button.ql-active .ql-stroke {
    stroke: var(--terminal-cyan);
}

.ql-toolbar button:hover .ql-fill,
.ql-toolbar button.ql-active .ql-fill {
    fill: var(--terminal-cyan);
}

/* Note modal — read-only view (toolbar hidden, clearer title) */
#noteModal.note-modal-view .ql-toolbar {
    display: none;
}

#noteModal.note-modal-view .ql-container.ql-snow {
    border-top: 1px solid var(--border-color);
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

#noteModal.note-modal-view .ql-editor {
    cursor: default;
    background: rgba(0, 0, 0, 0.2);
}

#noteModal.note-modal-view .ql-editor.ql-blank::before {
    color: rgba(0, 255, 65, 0.35);
}

#noteModal.note-modal-view .terminal-input.readonly {
    color: #c5ead4;
    border-color: rgba(0, 255, 65, 0.35);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--terminal-green);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--terminal-cyan);
}

/* Responsive */
@media (max-width: 768px) {
    .vault-main {
        flex-direction: column;
    }
    
    .vault-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 2px solid var(--terminal-green);
    }
    
    .sidebar-nav {
        display: flex;
        gap: 10px;
        overflow-x: auto;
    }
    
    .nav-btn {
        white-space: nowrap;
        margin-bottom: 0;
    }

    /* Log out: pin to viewport bottom (not directly under the horizontal nav) */
    .sidebar-footer {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 40;
        margin-top: 0;
        padding-top: 12px;
        padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
        padding-left: max(16px, env(safe-area-inset-left, 0px));
        padding-right: max(16px, env(safe-area-inset-right, 0px));
        background: var(--bg-secondary);
        border-top: 1px solid rgba(255, 0, 64, 0.35);
        border-bottom: none;
        box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.55);
    }

    .vault-content-area {
        padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
    }
}

