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

:root {
    --primary-dark: #151922;
    --primary-light: #ffffff;
    --secondary-dark: #252b36;
    --secondary-light: #f5f7f1;
    --border-color: #dce3d8;
    --text-primary: #17211c;
    --text-secondary: #66736a;
    --accent: #0f766e;
    --accent-strong: #0a5f59;
    --accent-soft: #e3f3ef;
    --surface: #ffffff;
    --surface-muted: #fbfcf8;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #d97706;
    --shadow-sm: 0 8px 24px rgba(23, 33, 28, 0.08);
    --shadow-md: 0 18px 50px rgba(23, 33, 28, 0.12);
    --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f4f6f0;
    color: var(--text-primary);
    overflow-x: hidden;
}

button,
input,
textarea {
    font: inherit;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(15, 118, 110, 0.2);
    outline-offset: 2px;
}

/* ========== ANIMATIONS ========== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

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

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

@keyframes shimmer {
    0%   { background-position: -1000px 0; }
    100% { background-position:  1000px 0; }
}

.auth-container,
.auth-card,
.auth-header,
.logo-container,
.auth-tabs,
.auth-form.active,
.form-group,
.app-container,
.modal-content,
.error-message,
.success-message,
.empty-state,
.password-detail,
.password-form {
    animation: none;
}

/* ========== AUTH CONTAINER ========== */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 0;
    overflow-y: auto;
    background:
        radial-gradient(circle at 18% 20%, rgba(15, 118, 110, 0.28), transparent 34%),
        radial-gradient(circle at 84% 12%, rgba(217, 119, 6, 0.18), transparent 30%),
        linear-gradient(135deg, #10141d 0%, #202938 100%);
    animation: fadeIn 0.8s ease-out;
}

.auth-wrapper {
    width: 100%;
    max-width: 460px;
    padding: 20px;
}

.auth-card {
    background: rgba(255, 255, 255, 0.96);
    border-radius: 18px;
    padding: 40px;
    box-shadow: 0 26px 70px rgba(0, 0, 0, 0.32);
    animation: slideInUp 0.6s ease-out;
    border: 1px solid rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(18px);
}

@keyframes slideInUp {
    from { opacity: 0; transform: translateY(40px); }
    to   { opacity: 1; transform: translateY(0); }
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
    animation: fadeIn 0.8s ease-out 0.2s both;
}

.logo-container {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--accent) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: scaleIn 0.6s ease-out 0.3s both;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.logo-icon {
    width: 50px;
    height: 50px;
    fill: white;
}

.auth-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.tagline {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

/* ========== AUTH TABS ========== */
.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 30px;
    background: #eef3ec;
    padding: 4px;
    border-radius: 12px;
    animation: slideInDown 0.6s ease-out 0.3s both;
}

@keyframes slideInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.tab-btn {
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 10px;
    transition: var(--transition);
    position: relative;
}

.tab-btn.active {
    background: var(--primary-light);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.tab-btn:hover:not(.active) {
    color: var(--text-primary);
}

/* ========== FORM STYLES ========== */
.auth-form {
    display: none;
    opacity: 0;
}

.auth-form.active {
    display: block;
    opacity: 1;
    animation: fadeIn 0.4s ease-out;
}

.form-group {
    margin-bottom: 20px;
    animation: slideInLeft 0.5s ease-out;
    animation-fill-mode: both;
}

.form-group:nth-child(2) { animation-delay: 0.1s; }
.form-group:nth-child(3) { animation-delay: 0.2s; }

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 12px;
    width: 20px;
    height: 20px;
    fill: var(--text-secondary);
    pointer-events: none;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 12px 12px 40px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
    background: var(--primary-light);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.eye-icon {
    width: 20px;
    height: 20px;
    fill: var(--text-secondary);
    transition: var(--transition);
}

.toggle-password:hover .eye-icon {
    fill: var(--text-primary);
}

.error-message {
    margin-top: 8px;
    color: var(--danger);
    font-size: 13px;
    animation: slideInLeft 0.3s ease-out;
}

.success-message {
    margin-top: 8px;
    color: var(--success);
    font-size: 13px;
    animation: slideInLeft 0.3s ease-out;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 2000;
}

.modal-content {
    width: 100%;
    max-width: 480px;
    background: white;
    border-radius: 18px;
    padding: 28px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.2);
    position: relative;
    animation: scaleIn 0.35s ease-out;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.modal-header h2 {
    margin: 0;
    font-size: 22px;
    color: var(--text-primary);
}

.close-modal {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    transition: var(--transition);
}

.close-modal:hover { color: var(--text-primary); }

.modal-description {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
}

.user-menu { position: relative; }

.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 260px;
    background: var(--surface);
    border-radius: 14px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    padding: 10px 0;
    z-index: 100;
}

.dropdown-user {
    padding: 8px 16px 10px;
}

.dropdown-label {
    display: block;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.dropdown-email {
    display: block;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.dropdown-item:hover { background: var(--secondary-light); }
.dropdown-item.logout { color: var(--danger); }

.dropdown-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 8px 0;
}

/* ========== BUTTONS ========== */
.btn-submit {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--accent) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 20px;
    position: relative;
    overflow: hidden;
}

.btn-submit::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: left 0.5s ease;
}

.btn-submit:hover::before { left: 100%; }
.btn-submit:hover { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(15, 118, 110, 0.24); }
.btn-submit:active { transform: translateY(0); }

.login-footer {
    margin-top: 14px;
    display: flex;
    justify-content: flex-end;
}

.forgot-password-link {
    padding: 0;
    border: none;
    background: transparent;
    font: inherit;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.forgot-password-link:hover { color: var(--text-primary); }

/* ========== APP CONTAINER ========== */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background:
        linear-gradient(180deg, rgba(227, 243, 239, 0.65) 0%, rgba(245, 247, 241, 0.9) 42%, #f8faf5 100%);
    animation: fadeIn 0.6s ease-out;
}

/* ========== NAVBAR ========== */
.navbar {
    background: rgba(21, 25, 34, 0.96);
    color: white;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 10px 30px rgba(21, 25, 34, 0.18);
    position: sticky;
    top: 0;
    z-index: 900;
    backdrop-filter: blur(14px);
}

.nav-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    cursor: pointer;
    margin-right: 10px;
    transition: var(--transition);
}

.mobile-menu-btn svg { width: 24px; height: 24px; fill: white; }
.mobile-menu-btn:active { opacity: 0.7; }

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
}

.brand-icon { width: 32px; height: 32px; fill: white; }

.nav-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.user-button,
.logout-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.user-button:hover,
.logout-btn:hover { background: rgba(255, 255, 255, 0.2); }

.user-button svg,
.logout-btn svg { width: 20px; height: 20px; fill: white; }

/* ========== MAIN CONTENT ========== */
.main-content {
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 24px;
}

.container {
    display: grid;
    grid-template-columns: minmax(300px, 340px) minmax(0, 1fr);
    gap: 24px;
    align-items: stretch;
    min-height: calc(100vh - 96px);
}

/* ========== SIDEBAR ========== */
.sidebar {
    background: rgba(255, 255, 255, 0.86);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    align-self: start;
    position: sticky;
    top: 86px;
}

.sidebar-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.sidebar-kicker,
.detail-kicker {
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.sidebar-header h2 {
    font-size: 22px;
    line-height: 1.15;
}

.count-badge {
    min-width: 34px;
    min-height: 28px;
    padding: 5px 10px;
    background: var(--accent-soft);
    border: 1px solid rgba(15, 118, 110, 0.18);
    border-radius: 999px;
    color: var(--accent-strong);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
}

.search-wrapper {
    position: relative;
    margin-bottom: 14px;
}

.search-wrapper input {
    width: 100%;
    height: 44px;
    padding: 0 14px 0 42px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--surface-muted);
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition);
}

.search-wrapper input:focus {
    border-color: var(--accent);
    background: var(--surface);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    width: 18px;
    height: 18px;
    fill: var(--text-secondary);
    transform: translateY(-50%);
    pointer-events: none;
}

.btn-primary-sidebar {
    width: 100%;
    min-height: 46px;
    padding: 13px 16px;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--accent) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 12px;
    transition: var(--transition);
}

.btn-primary-sidebar svg { width: 20px; height: 20px; fill: white; }
.btn-primary-sidebar:hover { box-shadow: 0 12px 24px rgba(15, 118, 110, 0.18); }

.vault-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 22px;
}

.btn-secondary-sidebar {
    min-height: 42px;
    padding: 10px 12px;
    background: var(--surface);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-secondary-sidebar svg { width: 18px; height: 18px; fill: var(--text-primary); flex: 0 0 auto; }

.btn-secondary-sidebar:hover {
    background: var(--accent-soft);
    border-color: rgba(15, 118, 110, 0.25);
    color: var(--accent-strong);
}

.btn-secondary-sidebar:hover svg { fill: var(--accent-strong); }

.password-list {
    border-top: 1px solid var(--border-color);
    padding-top: 18px;
}

.password-list h3 {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 12px;
    letter-spacing: 0.08em;
}

.list-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: calc(100vh - 430px);
    min-height: 0;
    overflow-y: auto;
    padding-right: 2px;
}

.list-empty {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.45;
    padding: 14px;
    background: var(--surface-muted);
    border: 1px dashed var(--border-color);
    border-radius: 12px;
}

.list-item {
    width: 100%;
    padding: 10px;
    background: var(--surface);
    border: 1px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    animation: none;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    text-align: left;
}

.list-item-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
}

.list-item-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.list-item-title,
.list-item-meta {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.list-item-title { font-size: 14px; font-weight: 700; }
.list-item-meta  { color: var(--text-secondary); font-size: 12px; }

.list-item:hover {
    border-color: rgba(15, 118, 110, 0.24);
    box-shadow: 0 8px 18px rgba(23, 33, 28, 0.07);
}

.list-item.active {
    background: var(--primary-dark);
    color: white;
    box-shadow: 0 12px 24px rgba(21, 25, 34, 0.18);
    border-color: var(--primary-dark);
}

.list-item.active .list-item-icon {
    background: rgba(255, 255, 255, 0.14);
    fill: white;
    color: white;
}

.list-item.active .list-item-meta {
    color: white;
    opacity: 0.72;
}

/* ========== MAIN PANEL ========== */
.main-panel {
    background: rgba(255, 255, 255, 0.88);
    border-radius: 16px;
    padding: 34px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

/* =====================================================
   EMPTY STATE — desktop / laptop (split layout)
   ===================================================== */
.empty-state {
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 48px;
    animation: fadeIn 0.35s ease-out;
}

/* ---- LEFT column ---- */
.empty-left {
    flex: 0 0 auto;
    max-width: 340px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
}

.empty-icon {
    width: 64px;
    height: 64px;
    padding: 14px;
    background: var(--primary-dark);
    border-radius: 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(21, 25, 34, 0.18);
}

.empty-icon svg {
    width: 36px;
    height: 36px;
    fill: white;
    flex-shrink: 0;
}

.empty-kicker {
    color: var(--accent);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.empty-left h2 {
    font-size: 30px;
    font-weight: 800;
    line-height: 1.15;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.empty-left p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.65;
    margin-bottom: 28px;
}

.empty-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Pill-style primary button in empty state */
.empty-actions .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
}

.empty-actions .btn-primary svg,
.empty-actions .btn-secondary svg {
    width: 17px;
    height: 17px;
    fill: currentColor;
    flex-shrink: 0;
}

.empty-actions .btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
}

/* ---- RIGHT column — feature cards ---- */
.empty-right {
    flex: 1 1 0;
    min-width: 0;
}

.empty-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.empty-feature {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 18px 20px;
    background: var(--surface-muted);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    transition: var(--transition);
}

.empty-feature:hover {
    background: var(--accent-soft);
    border-color: rgba(15, 118, 110, 0.22);
    box-shadow: 0 6px 18px rgba(15, 118, 110, 0.08);
}

/* Coloured icon bubbles */
.ef-icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ef-icon svg {
    width: 22px;
    height: 22px;
    fill: white;
}

.ef-icon--secure {
    background: linear-gradient(135deg, var(--primary-dark), #1e3a35);
}

.ef-icon--import {
    background: linear-gradient(135deg, #0f766e, #0d9488);
}

.ef-icon--export {
    background: linear-gradient(135deg, #0a5f59, #0f766e);
}

.ef-body {
    min-width: 0;
}

.ef-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.ef-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* vertical divider between left and right */
.empty-state::before {
    content: '';
    display: block;
    width: 1px;
    align-self: stretch;
    background: var(--border-color);
    flex-shrink: 0;
    order: 1;           /* sits between left (order 0 default) and right */
}

.empty-right { order: 2; }

/* ========== PASSWORD DETAIL VIEW ========== */
.password-detail {
    width: 100%;
    animation: fadeIn 0.3s ease-out;
}

.detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.detail-header h2 {
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.1;
    color: var(--text-primary);
    overflow-wrap: anywhere;
}

.detail-subtitle {
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    overflow-wrap: anywhere;
}

.detail-actions {
    display: flex;
    gap: 10px;
}

.btn-icon {
    width: 42px;
    height: 42px;
    border: 1px solid var(--border-color);
    background: var(--surface);
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-icon svg { width: 20px; height: 20px; fill: var(--text-primary); }

.btn-icon:hover {
    background: var(--accent-soft);
    border-color: rgba(15, 118, 110, 0.28);
}

.btn-icon:hover svg { fill: var(--accent-strong); }

.btn-icon.danger:hover {
    background: var(--danger);
    border-color: var(--danger);
}

.btn-icon.danger:hover svg { fill: white; }

.detail-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 18px;
}

.detail-field label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 8px;
    letter-spacing: 0.08em;
}

.field-value {
    min-height: 48px;
    padding: 13px 14px;
    background: var(--surface-muted);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 14px;
    color: var(--text-primary);
    word-break: break-all;
    font-weight: 500;
}

.password-display {
    display: flex;
    gap: 10px;
    align-items: center;
}

.password-display .field-value { flex: 1; }

.password-display .field-value.masked {
    letter-spacing: 2px;
    font-size: 18px;
}

.btn-reveal {
    min-height: 48px;
    padding: 10px 16px;
    background: var(--primary-dark);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-reveal:hover {
    background: var(--accent-strong);
    box-shadow: 0 8px 18px rgba(15, 118, 110, 0.2);
}

/* ========== PASSWORD FORM ========== */
.password-form {
    width: 100%;
    max-width: 600px;
    animation: fadeIn 0.3s ease-out;
}

.password-form h2 {
    font-size: 28px;
    line-height: 1.15;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.form-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 26px;
}

#passwordForm .form-group { margin-bottom: 24px; }

#passwordForm label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

#passwordForm input,
#passwordForm textarea {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
    background: white;
}

#passwordForm .input-wrapper input { padding-right: 48px; }

#passwordForm input:focus,
#passwordForm textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.form-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 30px;
}

.btn-primary {
    min-height: 46px;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--accent) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary:hover { box-shadow: 0 12px 24px rgba(15, 118, 110, 0.2); }

.btn-secondary {
    min-height: 46px;
    padding: 12px 20px;
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: var(--accent-soft);
    border-color: rgba(15, 118, 110, 0.24);
    color: var(--accent-strong);
}

/* ========== TOAST NOTIFICATION ========== */
.toast {
    position: fixed;
    bottom: -100px;
    right: 20px;
    padding: 14px 20px;
    background: var(--text-primary);
    color: white;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    max-width: 300px;
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    pointer-events: none;
    transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.show { bottom: 20px; }

/* ========== LOADING SPINNER ========== */
.loading-spinner {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    animation: fadeIn 0.3s ease-out;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar { width: 8px; }

::-webkit-scrollbar-track {
    background: var(--secondary-light);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

.auth-container,
.auth-card,
.auth-header,
.logo-container,
.auth-tabs,
.auth-form.active,
.form-group,
.app-container,
.modal-content,
.empty-state,
.password-detail,
.password-form,
.detail-header,
.form-actions {
    animation: none;
}

/* ========== RESPONSIVE: medium laptop squeeze ========== */
@media (max-width: 1100px) {
    .empty-state {
        gap: 32px;
    }

    .empty-left {
        max-width: 280px;
    }

    .empty-left h2 {
        font-size: 26px;
    }
}

/* ========== RESPONSIVE: tablet and below ========== */
@media (max-width: 900px) {
    /* Collapse empty state to single column */
    .empty-state {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 32px;
    }

    .empty-state::before {
        display: none; /* hide vertical divider */
    }

    .empty-left {
        max-width: 440px;
        align-items: center;
    }

    .empty-actions {
        justify-content: center;
    }

    .empty-right {
        width: 100%;
        max-width: 440px;
        order: 2;
    }
}

@media (max-width: 1024px) {
    .main-content { padding: 15px; }

    .container {
        grid-template-columns: 280px 1fr;
        gap: 15px;
    }

    .sidebar  { padding: 15px; }
    .main-panel { padding: 25px; }
}

@media (max-width: 768px) {
    .main-content { padding: 14px; }

    .container {
        grid-template-columns: 1fr;
        position: relative;
        min-height: calc(100vh - 82px);
    }

    .sidebar {
        display: none;
        position: fixed;
        left: 0;
        top: 58px;
        width: min(86vw, 330px);
        height: calc(100vh - 58px);
        background: rgba(255, 255, 255, 0.98);
        border-radius: 0;
        z-index: 997;
        box-shadow: 14px 0 34px rgba(21, 25, 34, 0.16);
        padding: 15px;
        overflow-y: auto;
        border-right: 1px solid var(--border-color);
    }

    .sidebar.mobile-open { display: block; }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 58px; left: 0;
        width: 100%; height: calc(100vh - 58px);
        background: rgba(0, 0, 0, 0.3);
        z-index: 996;
        animation: fadeIn 0.3s ease-out;
    }

    .sidebar-overlay.mobile-open { display: block; }

    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .main-panel {
        padding: 22px;
        min-height: calc(100vh - 110px);
    }

    .auth-card  { padding: 30px 20px; }
    .auth-header h1 { font-size: 24px; }

    .detail-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .detail-actions {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .detail-actions .btn-icon { flex: 1; min-width: 48px; }

    .form-actions { grid-template-columns: 1fr; gap: 10px; }

    .detail-content { grid-template-columns: 1fr; gap: 20px; }

    .form-group input,
    .form-group textarea { padding: 14px 12px 14px 40px; font-size: 16px; }

    #passwordForm input,
    #passwordForm textarea { padding: 14px; font-size: 16px; }

    #passwordForm .input-wrapper input { padding-right: 48px; }

    .btn-submit,
    .btn-primary { padding: 14px 20px; font-size: 15px; min-height: 48px; }

    .btn-secondary { min-height: 48px; }

    .detail-header h2 { font-size: 22px; }

    .password-display { flex-direction: column; }
    .btn-reveal { width: 100%; }

    .list-container { max-height: none; }

    .navbar { padding: 10px 0; }
    .nav-content { padding: 0 15px; }
    .brand { font-size: 18px; }
    .brand-icon { width: 28px; height: 28px; }
    .nav-actions { gap: 8px; }

    .user-button,
    .logout-btn { width: 36px; height: 36px; }

    .user-button svg,
    .logout-btn svg { width: 18px; height: 18px; }
}

@media (max-width: 480px) {
    .auth-wrapper  { padding: 10px; }
    .auth-card     { padding: 20px; border-radius: 12px; }
    .auth-header h1 { font-size: 20px; }
    .tagline       { font-size: 12px; }

    .logo-container { width: 60px; height: 60px; }
    .logo-icon      { width: 38px; height: 38px; }

    .auth-tabs     { margin-bottom: 20px; }
    .tab-btn       { padding: 8px 12px; font-size: 12px; }

    .main-content  { padding: 10px; }
    .container     { grid-template-columns: 1fr; }

    .main-panel    { padding: 18px; border-radius: 14px; }

    .empty-icon    { width: 56px; height: 56px; padding: 12px; border-radius: 14px; }
    .empty-icon svg { width: 30px; height: 30px; }
    .empty-left h2 { font-size: 22px; }
    .empty-left p  { font-size: 13px; }

    .ef-icon { width: 38px; height: 38px; }
    .ef-icon svg { width: 19px; height: 19px; }

    .detail-header h2     { font-size: 18px; }
    .detail-header        { margin-bottom: 20px; padding-bottom: 15px; }

    .detail-actions .btn-icon { min-width: 44px; height: 44px; }
    .detail-actions .btn-icon svg { width: 18px; height: 18px; }

    .field-value { padding: 10px 12px; font-size: 13px; }

    .password-form h2 { font-size: 20px; margin-bottom: 8px; }

    .form-group label,
    #passwordForm label { font-size: 12px; }

    .form-group input,
    .form-group textarea { padding: 12px 12px 12px 38px; font-size: 16px; border-radius: 10px; }

    #passwordForm input,
    #passwordForm textarea { padding: 12px; font-size: 16px; border-radius: 10px; }

    #passwordForm .input-wrapper input { padding-right: 46px; }

    .input-icon { width: 18px; height: 18px; left: 10px; }

    .btn-submit,
    .btn-primary,
    .btn-secondary { padding: 12px 16px; font-size: 13px; min-height: 44px; border-radius: 10px; }

    .empty-actions { flex-direction: column; }
    .form-actions  { margin-top: 20px; gap: 8px; }

    .toast {
        right: 8px; left: 8px; bottom: -100px;
        max-width: none; font-size: 13px; padding: 12px 16px;
    }

    .toast.show { bottom: 15px; }

    .navbar { padding: 8px 0; }
    .nav-content { padding: 0 10px; }
    .brand { font-size: 16px; gap: 8px; }
    .brand-icon { width: 24px; height: 24px; }

    .user-button,
    .logout-btn { width: 32px; height: 32px; }

    .user-button svg,
    .logout-btn svg { width: 16px; height: 16px; }
}

@media (max-width: 360px) {
    .auth-card      { padding: 16px; }
    .auth-header h1 { font-size: 18px; }

    .form-group input,
    #passwordForm input { font-size: 16px; }

    .detail-header h2 { font-size: 16px; }
}

@media (max-height: 720px) {
    .auth-container { align-items: flex-start; padding: 18px 0; }
    .auth-card      { padding: 28px 32px; }
    .auth-header    { margin-bottom: 22px; }
    .logo-container { width: 66px; height: 66px; margin-bottom: 14px; }
    .logo-icon      { width: 42px; height: 42px; }
    .auth-tabs      { margin-bottom: 22px; }
    .form-group     { margin-bottom: 16px; }
    .btn-submit     { margin-top: 12px; }
}

/* ========== LANDSCAPE MODE ========== */
@media (max-height: 500px) and (orientation: landscape) {
    .auth-container { align-items: flex-start; }
    .sidebar        { max-height: calc(100vh - 70px); }
    .main-panel     { max-height: calc(100vh - 100px); overflow-y: auto; }
    .detail-content { gap: 15px; }
}

/* ========== TOUCH DEVICES ========== */
@media (hover: none) and (pointer: coarse) {
    .btn-icon,
    .btn-primary,
    .btn-secondary,
    .btn-submit,
    .list-item { min-height: 48px; }

    .list-item { padding: 14px; }

    button { -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1); }
}
