:root {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --border: #334155;
    --input-bg: #020617;
    --shadow: rgba(0, 0, 0, 0.3);
    --nav-height: 70px;
}

[data-theme="light"] {
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #475569;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --border: #e2e8f0;
    --input-bg: #f1f5f9;
    --shadow: rgba(0, 0, 0, 0.05);
}

* { box-sizing: border-box; margin: 0; padding: 0; transition: background 0.3s, color 0.3s; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

/* Navbar */
.navbar {
    width: 100%; height: var(--nav-height); background: var(--card-bg);
    border-bottom: 1px solid var(--border); display: flex; justify-content: space-between;
    align-items: center; padding: 0 2rem; position: fixed; top: 0; z-index: 100;
    box-shadow: 0 4px 6px var(--shadow);
}
.nav-brand { display: flex; align-items: center; gap: 10px; font-size: 1.5rem; font-weight: 700; color: var(--accent); }
.nav-brand img { height: 40px; }
.nav-actions { display: flex; align-items: center; gap: 15px; }

.nav-btn {
    background: var(--accent); color: white; border: none; padding: 8px 16px;
    border-radius: 6px; cursor: pointer; font-weight: 600; font-size: 0.9rem;
}
.nav-btn.outline { background: transparent; border: 1px solid var(--border); color: var(--text-muted); }
.nav-btn.outline:hover { border-color: var(--accent); color: var(--accent); }
.nav-btn:hover { opacity: 0.9; }

.nav-link { color: var(--text-muted); text-decoration: none; font-weight: 500; margin-right: 10px; }
.nav-link:hover { color: var(--accent); }
.theme-btn {
    background: transparent; border: 1px solid var(--border); color: var(--text-main);
    padding: 8px 12px; border-radius: 8px; cursor: pointer; font-size: 1rem;
}

#userProfile { display: flex; align-items: center; gap: 10px; }
#usernameDisplay { font-weight: bold; color: var(--accent); margin-right: 5px; }

/* RESPONSIVE HAMBURGER MENU */
.mobile-only { display: none; }
.desktop-only { display: flex; align-items: center; gap: 15px; }

#mobile-menu-btn {
    background: transparent; border: none; color: var(--text-main); font-size: 1.5rem; cursor: pointer;
}

/* Mobile Nav Drawer */
.mobile-nav {
    position: fixed; top: var(--nav-height); left: 0; width: 100%; 
    background: var(--card-bg); border-bottom: 1px solid var(--border);
    z-index: 99; padding: 1rem; box-shadow: 0 15px 30px -10px rgba(0,0,0,0.3);
    animation: slideDown 0.3s ease-out;
    border-radius: 0 0 16px 16px;
}
@keyframes slideDown { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.mobile-nav-content { display: flex; flex-direction: column; gap: 8px; }
.mobile-link {
    display: flex; align-items: center; gap: 15px; width: 100%;
    padding: 12px 16px; border: none; background: transparent;
    color: var(--text-muted); font-size: 1rem; font-weight: 500;
    border-radius: 8px; transition: all 0.2s ease; cursor: pointer;
}
.mobile-link:hover { background: var(--input-bg); color: var(--accent); transform: translateX(5px); }
.mobile-link i { width: 24px; text-align: center; font-size: 1.1rem; }

.mobile-user-greeting { 
    padding: 12px 16px; color: var(--text-main); font-weight: 700; 
    font-size: 1.1rem; border-bottom: 1px solid var(--border); 
    margin-bottom: 8px; display: flex; align-items: center; gap: 10px;
}
.mobile-user-greeting::before { content: '\f2bd'; font-family: 'Font Awesome 6 Free'; font-weight: 900; color: var(--accent); }

/* MEDIA QUERY FOR PHONES */
@media (max-width: 768px) {
    .desktop-only { display: none; }
    .mobile-only { display: block; }
    .navbar { padding: 0 1.5rem; }
    .card { padding: 1.5rem; }
}

/* Layout */
.main-wrapper { max-width: 900px; width: 100%; padding: 20px; margin-top: var(--nav-height); flex: 1; }
.tool-section { margin: 40px 0 60px; }
.card {
    background: var(--card-bg); padding: 2.5rem; border-radius: 16px;
    box-shadow: 0 10px 25px var(--shadow); text-align: center; border: 1px solid var(--border);
}
.header h2 { font-size: 1.8rem; margin-bottom: 0.5rem; }
.subtitle { color: var(--text-muted); margin-bottom: 2rem; }

/* Input */
.input-group { position: relative; width: 100%; max-width: 500px; margin: 0 auto; display: flex; align-items: center; }
input {
    width: 100%; padding: 16px 20px; border-radius: 10px;
    border: 2px solid var(--border); background: var(--input-bg);
    color: var(--text-main); font-size: 1.1rem; font-family: monospace; margin-bottom: 10px;
}
input:focus { border-color: var(--accent); outline: none; }
input::-ms-reveal, input::-ms-clear { display: none; }

textarea {
    width: 100%; padding: 16px 20px; border-radius: 10px;
    border: 2px solid var(--border); background: var(--input-bg);
    color: var(--text-main); font-size: 1.1rem; font-family: monospace; margin-bottom: 10px;
    resize: vertical; font-family: 'Inter', sans-serif;
}
textarea:focus { border-color: var(--accent); outline: none; }

/* Specific padding for the main password input to accommodate icons */
#passwordInput { padding-right: 130px; }

.input-icons { position: absolute; right: 15px; top: 26px; display: flex; gap: 15px; align-items: center; }
.input-icons i { cursor: pointer; color: var(--text-muted); font-size: 1.1rem; transition: color 0.2s; }
.input-icons i:hover { color: var(--accent); }
#generateBtn:active { transform: rotate(180deg); }

/* Tooltips for Big Screens */
@media (min-width: 769px) {
    [data-tooltip] { position: relative; }
    [data-tooltip]:hover::after {
        content: attr(data-tooltip);
        position: absolute;
        bottom: 100%;
        left: 50%;
        transform: translateX(-50%);
        background: var(--card-bg);
        border: 1px solid var(--border);
        color: var(--text-main);
        padding: 6px 10px;
        border-radius: 6px;
        font-size: 0.8rem;
        white-space: nowrap;
        pointer-events: none;
        box-shadow: 0 4px 10px rgba(0,0,0,0.2);
        margin-bottom: 10px;
        z-index: 100;
        font-family: 'Inter', sans-serif;
        opacity: 0;
        animation: fadeInTooltip 0.2s forwards;
    }
    @keyframes fadeInTooltip { to { opacity: 1; } }

    /* Specific fix for Theme Toggle (Top Right Edge) */
    #theme-toggle[data-tooltip]:hover::after {
        bottom: auto;
        top: 100%;
        margin-bottom: 0;
        margin-top: 10px;
        left: auto;
        right: 0;
        transform: none;
    }
}

/* Caps Lock Warning */
.caps-warning {
    color: #ef4444;
    font-size: 0.85rem;
    margin-top: -5px;
    margin-bottom: 15px;
    font-weight: 600;
    text-align: left;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: fadeIn 0.3s ease;
    padding-left: 5px;
}

/* Password Requirement Checklist */
.password-checklist {
    list-style: none; padding: 0; margin: 5px auto 15px;
    display: flex; flex-wrap: wrap; gap: 15px; justify-content: center;
    max-width: 500px;
}
.password-checklist li {
    font-size: 0.85rem; color: var(--text-muted); display: flex; align-items: center; gap: 6px;
    transition: color 0.3s ease;
}
.password-checklist li i { font-size: 0.8rem; transition: all 0.3s; }
.password-checklist li.valid { color: #22c55e; font-weight: 600; }
.password-checklist li.valid i { color: #22c55e; }
.password-checklist li.valid i::before { content: "\f058"; } /* FontAwesome Check Circle */

/* Results */
.hidden { display: none !important; }
.meter-wrapper { position: relative; max-width: 500px; margin: 15px auto 10px; }
.meter-container { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; width: 100%; }
.custom-tooltip {
    position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
    background: var(--card-bg); border: 1px solid var(--border); padding: 8px 12px;
    border-radius: 6px; font-size: 0.8rem; color: var(--text-main);
    box-shadow: 0 4px 10px rgba(0,0,0,0.5); pointer-events: none;
    opacity: 0; transition: opacity 0.2s; width: max-content; max-width: 280px;
    z-index: 10; text-align: center; margin-bottom: 10px; font-weight: 500;
}
.meter-wrapper:hover .custom-tooltip { opacity: 1; }
.custom-tooltip::after {
    content: ''; position: absolute; top: 100%; left: 50%; margin-left: -6px;
    border-width: 6px; border-style: solid;
    border-color: var(--card-bg) transparent transparent transparent;
}
#strength-meter { height: 100%; width: 0%; transition: width 0.4s ease, background 0.4s; }
.score-row { display: flex; justify-content: space-between; max-width: 500px; margin: 0 auto; font-weight: 600; font-size: 0.9rem; }
.feedback {
    margin-top: 20px; text-align: left; max-width: 500px; margin-left: auto; margin-right: auto;
    background: rgba(255, 77, 77, 0.08); padding: 15px; border-radius: 8px;
}
.feedback:empty { display: none; }
.warning { color: #ef4444; font-weight: bold; margin-bottom: 5px; }
ul { padding-left: 20px; color: var(--text-muted); font-size: 0.95rem; }

/* Chart */
#chart-container { margin-top: 30px; border-top: 1px solid var(--border); padding-top: 20px; animation: fadeIn 0.5s ease-in-out; }
.chart-header h3 { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 15px; }
.chart-wrapper { position: relative; height: 250px; width: 100%; display: flex; justify-content: center; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Workflow Section */
.workflow-section { margin: 40px 0 60px; }
.center-text { text-align: center; }
.workflow-section .section-header {
    display: block;
    border-bottom: none;
    padding-bottom: 0;
}
.workflow-section .section-header h2 {
    margin-bottom: 10px;
}
.workflow-steps { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 30px; }
.step-card { background: var(--card-bg); padding: 20px; border-radius: 12px; border: 1px solid var(--border); text-align: center; flex: 1; transition: transform 0.3s; }
.step-card:hover { transform: translateY(-5px); border-color: var(--accent); }
.step-icon { width: 50px; height: 50px; background: rgba(59, 130, 246, 0.1); color: var(--accent); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 15px; font-size: 1.2rem; }
.step-card h4 { margin-bottom: 10px; color: var(--text-main); }
.step-card p { font-size: 0.9rem; color: var(--text-muted); }
.step-arrow { color: var(--border); font-size: 1.5rem; }

@media (max-width: 768px) {
    .workflow-steps { flex-direction: column; }
    .step-arrow { transform: rotate(90deg); margin: 10px 0; }
}

/* Security Badges */
.security-badges { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }

/* Field Errors (Inline Validation) */
.field-error { font-size: 0.85rem; margin-bottom: 10px; }
/* Pull error up in auth modal because inputs have large bottom margin */
.modal-body .field-error { margin-top: -10px; }
/* Set small top margin in dashboard because inputs have 0 bottom margin */
.input-group-dash .field-error { margin-top: 5px; }

/* Details Section */
.details-section { display: flex; flex-direction: column; gap: 2rem; margin-bottom: 4rem; }
.grid-row { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }

.detail-card { 
    background: var(--card-bg); padding: 2.5rem; border-radius: 20px; 
    border: 1px solid var(--border); transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative; overflow: hidden; box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.detail-card:hover { 
    transform: translateY(-8px); 
    box-shadow: 0 20px 40px -5px rgba(0,0,0,0.2);
    border-color: rgba(59, 130, 246, 0.3);
}

.detail-card::after {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 3px;
    background: linear-gradient(90deg, var(--accent), #8b5cf6);
    transform: scaleX(0); transform-origin: left; transition: transform 0.4s ease;
}
.detail-card:hover::after { transform: scaleX(1); }

.detail-card h3 { 
    margin-bottom: 1.5rem; color: var(--text-main); font-size: 1.3rem;
    display: flex; align-items: center; gap: 15px; letter-spacing: -0.5px;
}

.detail-card h3 i { 
    width: 45px; height: 45px; background: rgba(59, 130, 246, 0.1); 
    color: var(--accent); border-radius: 12px; display: flex; 
    align-items: center; justify-content: center; font-size: 1.1rem;
    transition: all 0.3s ease;
}

.detail-card:hover h3 i { 
    background: var(--accent); color: white; transform: rotate(10deg) scale(1.1); 
}

.detail-card p { color: var(--text-muted); line-height: 1.7; margin-bottom: 1.2rem; }

.detail-card ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 15px; }
.detail-card li { 
    position: relative; padding-left: 30px; color: var(--text-muted); line-height: 1.6;
}
.detail-card li::before {
    content: '\f00c'; font-family: 'Font Awesome 6 Free'; font-weight: 900;
    position: absolute; left: 0; top: 3px; color: var(--accent); 
    font-size: 0.9rem; opacity: 0.8;
}
.detail-card strong { color: var(--text-main); font-weight: 600; }

.tags { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.tag { 
    background: rgba(255,255,255,0.03); color: var(--text-muted); 
    padding: 8px 16px; border-radius: 50px; font-size: 0.85rem; 
    border: 1px solid var(--border); transition: all 0.3s; cursor: default;
    font-weight: 500;
}
.tag:hover { 
    background: rgba(59, 130, 246, 0.15); border-color: var(--accent); 
    color: var(--accent); transform: translateY(-2px);
}

/* Make the last card span full width if it's the odd one out (3rd item) */
.grid-row > .detail-card:last-child:nth-child(odd) { grid-column: 1 / -1; }

@media (max-width: 768px) {
    .grid-row { grid-template-columns: 1fr; }
    .detail-card { padding: 1.5rem; }
}

/* --- MODAL STYLES --- */
.modal {
    position: fixed; z-index: 200; left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.7); display: flex; justify-content: center; align-items: center;
    backdrop-filter: blur(5px);
}
.modal-content {
    background-color: var(--card-bg); padding: 2.5rem; border-radius: 16px;
    width: 400px; border: 1px solid var(--border); position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5); text-align: center;
}
.close-modal { position: absolute; top: 20px; right: 20px; font-size: 1.2rem; cursor: pointer; color: var(--text-muted); z-index: 10; }
.close-modal:hover { color: var(--accent); }

/* Shake Animation for Persistent Modals */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}
.shake-anim { animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both; }

/* Highlight Close Icon Animation */
.highlight-close {
    color: #ef4444 !important;
    transform: scale(1.4) rotate(90deg);
    transition: all 0.3s ease;
}

/* Session Timeout Modal */
.timeout-header { color: #f97316; }
.timeout-countdown { font-weight: bold; color: var(--accent); }
.timeout-btn { margin-top: 15px; }

/* Legal Modal (New) */
.legal-content { width: 800px; max-width: 95%; padding: 0; overflow: visible; display: flex; flex-direction: column; text-align: left; }
.legal-container { display: flex; height: 500px; }
.legal-sidebar { width: 250px; background: var(--bg-color); border-right: 1px solid var(--border); padding: 20px; display: flex; flex-direction: column; border-radius: 16px 0 0 16px; }
.legal-header h2 { font-size: 1.4rem; color: var(--accent); margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
.legal-nav { display: flex; flex-direction: column; gap: 10px; }
.legal-tab { background: transparent; border: none; color: var(--text-muted); padding: 12px; text-align: left; border-radius: 8px; cursor: pointer; transition: all 0.2s; font-weight: 500; }
.legal-tab:hover, .legal-tab.active { background: var(--accent); color: white; }
.legal-main { flex: 1; padding: 30px; overflow-y: auto; }
.legal-pane h3 { margin-bottom: 10px; color: var(--text-main); font-size: 1.5rem; border-bottom: 1px solid var(--border); padding-bottom: 15px; }
.legal-date { margin-bottom: 20px; }
.legal-block { margin-top: 20px; }
.legal-block h4 { color: var(--text-main); margin-bottom: 8px; font-size: 1.1rem; }
.legal-block p { color: var(--text-muted); line-height: 1.6; font-size: 0.95rem; }
.close-legal { top: 15px; right: 15px; z-index: 200; }

@media (max-width: 768px) {
    .legal-container { flex-direction: column; height: auto; max-height: 80vh; }
    .legal-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); padding: 15px; border-radius: 16px 16px 0 0; }
    .legal-main { padding: 20px; }
}

.dashboard-container {
    display: flex; width: 900px; max-width: 95vw; height: 80vh;
    background: var(--card-bg); border-radius: 16px; overflow: hidden;
    border: 1px solid var(--border); position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.dash-sidebar {
    width: 250px; background: var(--bg-color); border-right: 1px solid var(--border);
    display: flex; flex-direction: column; padding: 30px 20px;
}

.dash-profile-summary { text-align: center; margin-bottom: 40px; }
.dash-avatar {
    width: 80px; height: 80px; margin: 0 auto 15px; border-radius: 50%;
    background: var(--accent); padding: 2px;
}
.dash-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 3px solid var(--bg-color); }
.dash-profile-summary h3 { font-size: 1.2rem; margin-bottom: 5px; }
.dash-role { font-size: 0.85rem; color: var(--text-muted); background: rgba(255,255,255,0.05); padding: 4px 10px; border-radius: 12px; }

.dash-nav { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.dash-tab {
    background: transparent; border: none; color: var(--text-muted);
    padding: 12px 15px; text-align: left; border-radius: 10px;
    cursor: pointer; font-size: 0.95rem; display: flex; align-items: center; gap: 12px;
    transition: all 0.2s;
}
.dash-tab:hover, .dash-tab.active { background: var(--accent); color: white; }
.dash-tab i { width: 20px; text-align: center; }

.dash-footer { margin-top: auto; border-top: 1px solid var(--border); padding-top: 20px; }
.dash-logout {
    width: 100%; background: transparent; border: 1px solid var(--border);
    color: #ef4444; padding: 10px; border-radius: 8px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 10px;
}
.dash-logout:hover { background: rgba(239, 68, 68, 0.1); }

.dash-content { flex: 1; padding: 40px; position: relative; overflow-y: auto; }
.dash-view { animation: fadeIn 0.3s ease; }
.dash-view h2 { margin-bottom: 30px; font-size: 1.8rem; border-bottom: 1px solid var(--border); padding-bottom: 15px; }
.close-dashboard {
    position: absolute; top: 20px; right: 20px; background: transparent;
    border: none; color: var(--text-muted); font-size: 1.2rem; cursor: pointer; z-index: 20;
}
.close-dashboard:hover { color: var(--accent); }

/* Dashboard Forms */
.form-grid { display: grid; gap: 20px; max-width: 500px; }
.input-group-dash label { display: block; margin-bottom: 8px; color: var(--text-muted); font-size: 0.9rem; }
.input-group-dash input { width: 100%; margin-bottom: 0; }
.char-count { float: right; font-size: 0.8rem; font-weight: normal; }
.dash-actions { margin-top: 30px; display: flex; align-items: center; gap: 20px; }
.danger-btn-text { 
    background: transparent; border: 1px solid #ef4444; color: #ef4444; 
    padding: 10px 20px; border-radius: 8px; cursor: pointer; font-weight: 600; 
    text-decoration: none; transition: all 0.2s;
}
.danger-btn-text:hover { background: #ef4444; color: white; }

.mobile-action-btn { display: none; }

/* Mobile Dashboard adjustments */
@media (max-width: 768px) {
    .dashboard-container { flex-direction: column; height: 100%; border-radius: 0; }
    .dash-sidebar { width: 100%; flex-direction: row; align-items: center; padding: 15px; height: auto; border-right: none; border-bottom: 1px solid var(--border); gap: 15px; }
    .dash-profile-summary { display: block; margin: 0; text-align: left; }
    .dash-avatar { width: 45px; height: 45px; margin: 0; border-width: 2px; }
    .dash-profile-summary h3, .dash-role { display: none; }
    .dash-nav { flex-direction: row; overflow-x: auto; flex: 1; }
    .dash-footer { display: none; } /* Use main nav logout */
    .dash-content { padding: 20px; }
    .dash-actions { flex-direction: column; align-items: stretch; }
    .mobile-action-btn { display: block; text-align: center; }
    #deleteAccountBtn { margin-top: 10px; }
}

/* Auth Form */
.modal-body input { width: 100%; margin-bottom: 15px; }
.primary-btn { width: 100%; padding: 12px; background: var(--accent); color: white; border: none; border-radius: 8px; font-size: 1rem; cursor: pointer; font-weight: bold; }
.primary-btn:hover { background: var(--accent-hover); }

/* Forgot Password Link Style */
.auth-extras { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; margin-top: -10px; }
.forgot-link { font-size: 0.85rem; color: var(--text-muted); text-decoration: none; margin-left: auto; }
.forgot-link:hover { color: var(--accent); text-decoration: underline; }
.remember-me { font-size: 0.85rem; color: var(--text-muted); display: flex; align-items: center; gap: 6px; cursor: pointer; }
.remember-me input { width: auto; margin: 0; cursor: pointer; }

.divider { display: flex; align-items: center; margin: 15px 0; color: var(--text-muted); font-size: 0.8rem; }
.divider::before, .divider::after { content: ""; flex: 1; border-bottom: 1px solid var(--border); }
.divider span { padding: 0 10px; }

.social-btn { width: 100%; padding: 10px; border: 1px solid var(--border); background: var(--input-bg); color: var(--text-main); border-radius: 8px; cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 10px; margin-bottom: 10px; font-weight: 500; text-decoration: none; }
@media (hover: hover) {
    .social-btn:hover { background-color: var(--bg-color); opacity: 0.9; }
}

.auth-switch { margin-top: 15px; font-size: 0.9rem; color: var(--text-muted); }
.auth-switch a { color: var(--accent); text-decoration: none; font-weight: bold; }
.error-msg { color: #ef4444; margin-top: 10px; font-size: 0.9rem; }

.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin-top: 10px; color: var(--text-main); font-size: 0.95rem; }
th, td { padding: 12px; border-bottom: 1px solid var(--border); text-align: left; }
th { color: var(--accent); font-weight: 600; }
tr:hover { background-color: rgba(255,255,255,0.02); }

.danger-btn { width: 100%; padding: 12px; background: #ef4444; color: white; border: none; border-radius: 8px; cursor: pointer; font-weight: bold; }
.danger-btn:hover { background: #dc2626; }
.btn-sm { padding: 5px; width: auto; font-size: 0.8rem; }

/* Mega Footer */
.mega-footer { width: 100%; background: var(--card-bg); border-top: 1px solid var(--border); padding: 60px 20px 20px; margin-top: auto; font-size: 0.9rem; }
.footer-content { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); gap: 50px; margin-bottom: 40px; }
.footer-col h4 { color: var(--text-main); margin-bottom: 20px; font-size: 1rem; font-weight: 600; }

.footer-brand { font-size: 1.4rem; font-weight: 700; color: var(--accent); margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
.footer-brand img { height: 40px; }
.footer-links { list-style: none; padding: 0; }
.footer-links li { margin-bottom: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 8px; }
.footer-links a { color: var(--text-muted); text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { color: var(--accent); }

/* Feature list specific styling */
.feature-list li { color: var(--text-main); font-weight: 500; }
.feature-list li i { color: var(--accent); width: 20px; text-align: center; }

.footer-socials { display: flex; gap: 15px; margin-bottom: 15px; }
.footer-socials a {
    width: 36px; height: 36px; background: var(--input-bg); border: 1px solid var(--border);
    border-radius: 8px; display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); text-decoration: none; transition: all 0.3s;
}
.footer-socials a:hover { background: var(--accent); color: white; border-color: var(--accent); transform: translateY(-3px); }

.footer-disclaimer { font-size: 0.8rem; color: var(--text-muted); opacity: 0.7; }

.footer-bottom {
    max-width: 1200px; margin: 0 auto; padding-top: 20px; border-top: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center; color: var(--text-muted); font-size: 0.85rem;
}
.region-selector { display: flex; align-items: center; gap: 8px; cursor: pointer; transition: color 0.2s; }
.region-selector:hover { color: var(--text-main); }

/* Responsive Footer */
@media (max-width: 1024px) {
    .footer-content { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .footer-content { grid-template-columns: 1fr; text-align: center; }
    .footer-brand, .footer-links li, .footer-socials, .footer-bottom { justify-content: center; }
    .footer-bottom { flex-direction: column; gap: 15px; }
    .footer-col { margin-bottom: 20px; }
}

/* Back to Top Button */
.back-to-top {
    position: fixed; bottom: 30px; right: 30px;
    width: 45px; height: 45px; border-radius: 50%;
    background: var(--accent); color: white; border: none;
    cursor: pointer; z-index: 95;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
    opacity: 0; visibility: hidden; transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--accent-hover); transform: translateY(-5px); box-shadow: 0 8px 20px rgba(0,0,0,0.4); }

/* Loading Spinner */
.btn-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn-loading::after {
    content: ""; position: absolute;
    width: 1em; height: 1em;
    top: 50%; left: 50%;
    margin-top: -0.5em; margin-left: -0.5em;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- 2FA SPECIFIC STYLES --- */
.security-card { background: var(--input-bg); border: 1px solid var(--accent); padding: 15px 20px; border-radius: 10px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; }
.security-card h3 { color: var(--text-main); font-size: 1rem; margin-bottom: 4px; display: flex; gap: 8px; }
.security-card p { color: var(--text-muted); font-size: 0.85rem; margin: 0; }
.sm-btn { width: auto; padding: 8px 16px; font-size: 0.9rem; }
.qr-container { background: white; padding: 10px; border-radius: 8px; width: 180px; height: 180px; margin: 15px auto; display: flex; align-items: center; justify-content: center; }
.qr-container img { width: 100%; height: 100%; }
.code-input { text-align: center; font-family: monospace; font-size: 1.4rem; letter-spacing: 4px; color: var(--accent); }
@media (max-width: 768px) { .security-card { flex-direction: column; text-align: center; gap: 15px; } }

/* --- AUTH SPECIFIC (NEW) --- */
.input-group-auth { position: relative; width: 100%; }
.input-group-auth input[type="password"] { margin-bottom: 15px; padding-right: 45px; }
.password-toggle-icon { position: absolute; right: 15px; top: 15px; cursor: pointer; color: var(--text-muted); font-size: 1.1rem; z-index: 10; }
.password-toggle-icon:hover { color: var(--accent); }

.github-btn { background-color: #24292e !important; color: white !important; border: none !important; }
.linkedin-btn { background-color: #0077b5 !important; color: white !important; border: none !important; }
@media (hover: hover) {
    .github-btn:hover, .linkedin-btn:hover { opacity: 0.9; transform: translateY(-1px); }
}

/* --- VAULT STYLES --- */
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; border-bottom: 1px solid var(--border); padding-bottom: 15px; }
.section-header h2 { margin-bottom: 0; border-bottom: none; padding-bottom: 0; }
.vault-header-actions { display: flex; gap: 10px; }

@media (max-width: 768px) {
    .section-header { flex-direction: column; align-items: flex-start; gap: 15px; }
    .vault-header-actions { width: 100%; display: flex; gap: 10px; }
    .vault-header-actions button { flex: 1; justify-content: center; }
}

.vault-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }

.vault-card {
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
}
.vault-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    border-color: var(--accent);
}
.vault-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
}
.site-favicon, .site-favicon-default {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    flex-shrink: 0;
    object-fit: contain;
}
.site-favicon-default {
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1.2rem;
}
.vault-card-title h4 {
    color: var(--text-main);
    margin: 0;
    font-size: 1.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.vault-card .site-url {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: none;
    display: block;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.vault-card .site-url:hover { color: var(--accent); }
.vault-field {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    font-size: 0.95rem;
    color: var(--text-muted);
}
.vault-field > i:first-child {
    width: 20px;
    text-align: center;
    color: var(--accent);
}
.vault-field-value { flex: 1; word-break: break-all; font-family: monospace; }
.masked-pass { font-family: 'Inter', sans-serif; letter-spacing: 3px; }
.vault-field .action-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 5px;
    border-radius: 4px;
}
.vault-field .action-btn:hover { color: var(--accent); background: var(--bg-color); }
.vault-actions { display: flex; margin-top: auto; border-top: 1px solid var(--border); }
.vault-btn {
    flex: 1; background: transparent; border: none;
    border-right: 1px solid var(--border); color: var(--text-muted);
    padding: 12px; border-radius: 0; cursor: pointer;
    font-size: 0.85rem; font-weight: 600; transition: all 0.2s;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.vault-btn:last-child { border-right: none; border-radius: 0 0 10px 10px; }
.vault-btn:first-child { border-radius: 0 0 0 10px; }
.vault-btn:hover { background: var(--bg-color); color: var(--text-main); }
.vault-btn.delete:hover { color: #ef4444; background: rgba(239, 68, 68, 0.1); }

/* --- TOAST NOTIFICATIONS (NEW) --- */
#toast-box {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    width: 320px;
    padding: 15px;
    border-radius: 8px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-main);
    transform: translateX(100%);
    animation: slideIn 0.3s forwards;
    position: relative;
    overflow: hidden;
}

.toast.success { border-left: 4px solid #22c55e; }
.toast.error { border-left: 4px solid #ef4444; }
.toast.info { border-left: 4px solid #3b82f6; }

.toast i { font-size: 1.2rem; }
.toast.success i { color: #22c55e; }
.toast.error i { color: #ef4444; }
.toast.info i { color: #3b82f6; }

.toast::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    background: currentColor;
    opacity: 0.3;
    animation: timeOut 3s linear forwards;
}

@keyframes slideIn { to { transform: translateX(0); } }
@keyframes slideOut { to { transform: translateX(120%); opacity: 0; } }
@keyframes timeOut { from { width: 100%; } to { width: 0%; } }