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

:root {
    --bg: #0f1117;
    --surface: #1a1d27;
    --border: #2a2d37;
    --text: #e4e4e7;
    --text-muted: #71717a;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --danger: #ef4444;
    --success: #22c55e;
    --radius: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

/* Nav */
.nav { display: flex; align-items: center; justify-content: space-between; padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--border); }
.nav-brand { font-weight: 700; font-size: 18px; color: var(--text); text-decoration: none; }
.nav-user { display: flex; align-items: center; gap: 12px; }
.nav-user img { width: 32px; height: 32px; border-radius: 50%; }
.nav-user span { color: var(--text-muted); font-size: 14px; }

.container { max-width: 900px; margin: 0 auto; padding: 24px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); font-size: 14px; cursor: pointer; text-decoration: none; transition: background 0.15s; }
.btn:hover { background: var(--border); }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: rgba(239, 68, 68, 0.1); }
.btn-sm { padding: 4px 10px; font-size: 13px; }
.btn-icon { padding: 4px 8px; border: none; background: none; color: var(--text-muted); cursor: pointer; display: inline-flex; align-items: center; border-radius: 4px; transition: color 0.15s, background 0.15s; }
.btn-icon:hover { color: var(--text); background: var(--border); }

/* Toolbar */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.toolbar-actions { display: flex; gap: 8px; }

/* Search */
.search-input { padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); font-size: 14px; width: 280px; }
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus { outline: none; border-color: var(--primary); }

/* Credential list */
.cred-list { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.cred-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); transition: background 0.1s; }
.cred-row:last-child { border-bottom: none; }
.cred-row:hover { background: var(--surface); }
.cred-info { display: flex; flex-direction: column; gap: 2px; }
.cred-name { font-weight: 600; font-size: 15px; }
.cred-username { color: var(--text-muted); font-size: 13px; }
.cred-actions { display: flex; align-items: center; gap: 4px; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 4px; font-size: 11px; background: var(--border); color: var(--text-muted); margin-left: 8px; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.form-input { width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); font-size: 14px; }
.form-input:focus { outline: none; border-color: var(--primary); }
textarea.form-input { min-height: 80px; resize: vertical; font-family: inherit; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }

/* Panel */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.panel-title { font-size: 16px; font-weight: 600; margin-bottom: 12px; }

/* Detail view */
.detail-field { margin-bottom: 12px; }
.detail-label { font-size: 12px; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.05em; margin-bottom: 2px; }
.detail-value { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.detail-value .password-dots { font-family: monospace; letter-spacing: 2px; }

/* Share panel */
.share-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); }
.share-row:last-child { border-bottom: none; }

/* Login */
.login-container { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-box { text-align: center; padding: 40px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.login-box h1 { margin-bottom: 8px; }
.login-box p { color: var(--text-muted); margin-bottom: 24px; }
.btn-google { display: inline-flex; align-items: center; gap: 10px; padding: 10px 24px; background: white; color: #333; border: 1px solid #ddd; border-radius: var(--radius); font-size: 15px; font-weight: 500; cursor: pointer; text-decoration: none; }
.btn-google:hover { background: #f5f5f5; }

/* Secret page */
.secret-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin: 16px 0; word-break: break-all; font-family: monospace; font-size: 16px; }
.secret-warning { color: var(--danger); font-size: 14px; margin-top: 12px; }
.secret-gone { text-align: center; padding: 60px 20px; color: var(--text-muted); }

/* Empty state */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }

/* Toast */
.toast { position: fixed; bottom: 24px; right: 24px; padding: 10px 20px; background: var(--success); color: white; border-radius: var(--radius); font-size: 14px; opacity: 0; transition: opacity 0.3s; pointer-events: none; }
.toast.show { opacity: 1; }

.htmx-indicator { opacity: 0; transition: opacity 200ms; }
.htmx-request .htmx-indicator { opacity: 1; }
