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

:root {
    --bg: #0a0a0a;
    --surface: #141414;
    --surface2: #1e1e1e;
    --border: #2a2a2a;
    --text: #e8e8e8;
    --text2: #888;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --danger: #ef4444;
    --success: #22c55e;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

#app { max-width: 600px; margin: 0 auto; padding: 16px; }

.auth-container {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; min-height: 100vh; padding: 24px;
}
.auth-logo { font-size: 64px; margin-bottom: 16px; }
.auth-container h1 { margin-bottom: 24px; font-size: 28px; }
.auth-container input {
    width: 100%; max-width: 320px; padding: 12px 16px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 8px; color: var(--text); font-size: 16px;
    margin-bottom: 12px;
}
.auth-container input:focus { outline: none; border-color: var(--primary); }
.btn-primary {
    width: 100%; max-width: 320px; padding: 12px;
    background: var(--primary); color: white; border: none;
    border-radius: 8px; font-size: 16px; font-weight: 600;
    cursor: pointer; margin-top: 8px;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.link-text { margin-top: 16px; color: var(--text2); font-size: 14px; }
.link-text a { color: var(--primary); text-decoration: none; }
.link-text a:hover { text-decoration: underline; }
.error { color: var(--danger); font-size: 14px; margin-bottom: 12px; text-align: center; }

.vault-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 16px; padding-top: 8px;
}
.vault-header h1 { font-size: 24px; }
.header-actions { display: flex; gap: 8px; }

.search-bar {
    width: 100%; padding: 10px 16px; background: var(--surface);
    border: 1px solid var(--border); border-radius: 8px;
    color: var(--text); font-size: 16px; margin-bottom: 16px;
}
.search-bar:focus { outline: none; border-color: var(--primary); }

.category { margin-bottom: 16px; }
.category-header {
    font-size: 13px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.5px; color: var(--text2); padding: 4px 0 8px;
}

.entry-row {
    display: flex; align-items: center; padding: 12px 16px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 8px; margin-bottom: 6px; cursor: pointer;
    transition: background 0.15s;
}
.entry-row:hover { background: var(--surface2); }
.entry-row:active { background: var(--border); }
.entry-info { flex: 1; min-width: 0; }
.entry-name { font-weight: 500; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entry-user { font-size: 13px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-copy {
    background: none; border: none; font-size: 18px; cursor: pointer;
    padding: 8px; border-radius: 6px;
}
.btn-copy:hover { background: var(--surface2); }

.btn-icon {
    background: var(--surface); border: 1px solid var(--border);
    color: var(--text); padding: 8px 12px; border-radius: 8px;
    cursor: pointer; font-size: 16px;
}
.btn-icon:hover { background: var(--surface2); }
.btn-danger-icon:hover { background: rgba(239,68,68,0.2); }
.btn-sm { padding: 8px 16px; }

.fab {
    position: fixed; bottom: 24px; right: 24px; width: 56px; height: 56px;
    border-radius: 28px; background: var(--primary); color: white;
    border: none; font-size: 28px; cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4); z-index: 10;
    display: flex; align-items: center; justify-content: center;
}
.fab:hover { background: var(--primary-hover); transform: scale(1.05); }

.detail-header {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 16px; padding-top: 8px;
}
.detail-header h2 { flex: 1; font-size: 20px; }
.detail-actions { display: flex; gap: 4px; }
.detail-category { font-size: 14px; color: var(--text2); margin-bottom: 16px; }
.detail-fields { display: flex; flex-direction: column; gap: 12px; }
.field-row {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 12px; background: var(--surface);
    border-radius: 8px; border: 1px solid var(--border);
}
.field-label { font-size: 12px; color: var(--text2); min-width: 80px; }
.field-value { flex: 1; font-size: 14px; word-break: break-all; }
.btn-reveal {
    background: none; border: none; font-size: 16px; cursor: pointer; padding: 4px;
}
.favorite-badge { margin-top: 12px; color: #f59e0b; font-size: 14px; }

.form-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px; padding-top: 8px;
}
.form-header h2 { flex: 1; text-align: center; font-size: 18px; }
.entry-form {
    display: flex; flex-direction: column; gap: 12px;
}
.entry-form input, .entry-form select, .entry-form textarea {
    width: 100%; padding: 10px 14px; background: var(--surface);
    border: 1px solid var(--border); border-radius: 8px;
    color: var(--text); font-size: 16px;
}
.entry-form input:focus, .entry-form select:focus, .entry-form textarea:focus {
    outline: none; border-color: var(--primary);
}
.password-row { display: flex; gap: 4px; align-items: center; }
.password-row input { flex: 1; }
.checkbox-row {
    display: flex; align-items: center; gap: 8px; font-size: 14px;
}
.checkbox-row input { width: auto; }

@media (min-width: 600px) {
    #app { padding: 24px; }
}