/* Modern Dashboard Styles with Sidebar */
:root {
    --primary-color: #667eea;
    --primary-dark: #5a67d8;
    --secondary-color: #764ba2;
    --success-color: #48bb78;
    --danger-color: #f56565;
    --warning-color: #ecc94b;
    --sidebar-bg: #1a202c;
    --sidebar-hover: #2d3748;
    --topbar-bg: #ffffff;
    --card-bg: #ffffff;
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --text-light: #a0aec0;
    --border-color: #e2e8f0;
    --border-radius: 8px;
    --box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    --hover-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    --transition: all 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f7fafc;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
}

.container {
    min-height: 100vh;
}

/* Login Styles */
.login-container {
    background: white;
    border-radius: 12px;
    padding: 40px 32px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    max-width: 360px;
    margin: 80px auto;
    text-align: center;
}

.vault-logo {
    margin-bottom: 24px;
}

.vault-logo svg {
    color: var(--primary-color);
}

.login-container h1 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
}

.login-form input {
    width: 100%;
    padding: 12px;
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 20px;
    text-align: center;
    letter-spacing: 4px;
    transition: var(--transition);
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(102, 126, 234, 0.2);
}

.btn-secondary {
    background: white;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
}

.btn-secondary:hover {
    background: #f7fafc;
    border-color: var(--text-light);
}

.hint {
    margin-top: 16px;
    color: var(--text-light);
    font-size: 12px;
}

/* Dashboard Layout */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: var(--transition);
    z-index: 1000;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
}

.logo span {
    background: linear-gradient(135deg, #fff, #e2e8f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-nav {
    padding: 16px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: #a0aec0;
    text-decoration: none;
    transition: var(--transition);
    font-size: 13px;
    position: relative;
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: white;
}

.nav-item.active {
    background: var(--sidebar-hover);
    color: white;
    border-left: 3px solid var(--primary-color);
}

.nav-item .badge {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
}

.nav-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 16px 20px;
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--sidebar-hover);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.user-details {
    flex: 1;
}

.user-name {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: white;
}

.user-role {
    font-size: 11px;
    color: #a0aec0;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    width: calc(100% - 260px);
    transition: var(--transition);
}

/* Top Bar */
.top-bar {
    background: var(--topbar-bg);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-secondary);
    display: none;
}

.page-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f7fafc;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.search-box input {
    border: none;
    background: none;
    outline: none;
    font-size: 13px;
    width: 200px;
}

.search-box input::placeholder {
    color: var(--text-light);
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 6px;
    border-radius: 6px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: #f7fafc;
    color: var(--primary-color);
}

.user-profile {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    overflow: hidden;
}

.user-profile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Content Area */
.content-area {
    padding: 24px;
}

/* Messages */
.message {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 13px;
    animation: slideIn 0.3s ease;
}

.message.success {
    background: #f0fff4;
    color: #22543d;
    border: 1px solid #c6f6d5;
}

.message.error {
    background: #fff5f5;
    color: #742a2a;
    border: 1px solid #fed7d7;
}

@keyframes slideIn {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.action-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 13px;
    font-weight: 500;
}

.action-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--hover-shadow);
}

.action-card.active {
    background: #ebf4ff;
    border-color: var(--primary-color);
}

.cancel-edit {
    margin-left: 8px;
    color: var(--danger-color);
    text-decoration: none;
    font-size: 16px;
}

/* Add Item Section */
.add-item-section {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--box-shadow);
}

.add-item-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.item-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group select,
.form-group input,
.form-group textarea {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    transition: var(--transition);
}

.form-group select:focus,
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

/* Items Grid */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

/* Vault Cards */
.vault-card {
    background: white;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    overflow: hidden;
}

.vault-card:hover {
    box-shadow: var(--hover-shadow);
    border-color: #cbd5e0;
}

.card-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fafbfc;
}

.card-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.item-type {
    background: #e2e8f0;
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.item-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.card-actions {
    display: flex;
    gap: 4px;
}

.action-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-light);
}

.view-btn:hover {
    background: var(--primary-color);
    color: white;
}

.copy-btn:hover {
    background: var(--success-color);
    color: white;
}

.edit-btn:hover {
    background: var(--warning-color);
    color: white;
}

.delete-btn:hover {
    background: var(--danger-color);
    color: white;
}

.card-content {
    padding: 12px 16px;
}

.content-hidden {
    background: #f7fafc;
    padding: 8px 12px;
    border-radius: 4px;
    font-family: monospace;
    letter-spacing: 2px;
    color: var(--text-light);
    font-size: 13px;
}

.content-visible {
    background: #f7fafc;
    padding: 8px 12px;
    border-radius: 4px;
    color: var(--text-primary);
    word-break: break-all;
    font-family: monospace;
    font-size: 13px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.card-footer {
    padding: 8px 16px 12px;
    border-top: 1px solid var(--border-color);
    font-size: 11px;
    color: var(--text-light);
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 24px;
    color: var(--text-light);
    background: white;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.empty-state svg {
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 14px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: white;
    margin: 15% auto;
    padding: 24px;
    border-radius: 8px;
    max-width: 320px;
    position: relative;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    position: absolute;
    right: 16px;
    top: 12px;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-light);
}

.close:hover {
    color: var(--danger-color);
}

.modal h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.pin-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pin-form input {
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 16px;
    text-align: center;
    letter-spacing: 4px;
}

/* Notification */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--text-primary);
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 13px;
    z-index: 3000;
    opacity: 0;
    transform: translateY(10px);
    transition: var(--transition);
}

.notification.show {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .items-grid {
        grid-template-columns: 1fr;
    }
    
    .top-bar-right {
        gap: 8px;
    }
    
    .search-box {
        width: 140px;
    }
    
    .search-box input {
        width: 100px;
    }
    
    .modal-content {
        margin: 30% 16px;
    }
}

@media (max-width: 480px) {
    .top-bar {
        padding: 12px 16px;
    }
    
    .content-area {
        padding: 16px;
    }
    
    .page-title {
        font-size: 16px;
    }
    
    .search-box {
        display: none;
    }
    
    .quick-actions {
        flex-direction: column;
    }
    
    .action-card {
        width: 100%;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}
/* Additional Styles for New Features */

/* Dropdown Menu */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    min-width: 200px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    z-index: 1000;
    margin-top: 8px;
    border: 1px solid var(--border-color);
}

.dropdown-menu a {
    color: var(--text-primary);
    padding: 10px 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    transition: var(--transition);
}

.dropdown-menu a:hover {
    background: #f7fafc;
    color: var(--primary-color);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

/* Modal Large */
.modal-lg {
    max-width: 800px !important;
    width: 90%;
}

/* Backups Table */
.backups-table,
.activity-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.backups-table th,
.activity-table th {
    text-align: left;
    padding: 12px 8px;
    background: #f7fafc;
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
}

.backups-table td,
.activity-table td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--border-color);
}

.backups-table tr:hover,
.activity-table tr:hover {
    background: #f7fafc;
}

.btn-small {
    padding: 4px 12px !important;
    font-size: 12px !important;
}

.empty-message {
    text-align: center;
    padding: 30px;
    color: var(--text-light);
    background: #f7fafc;
    border-radius: 6px;
}

/* Activity Badges */
.activity-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.action-login {
    background: #c6f6d5;
    color: #22543d;
}

.action-login-failed {
    background: #fed7d7;
    color: #742a2a;
}

.action-login-locked {
    background: #feebc8;
    color: #744210;
}

.action-logout {
    background: #e9d8fd;
    color: #44337a;
}

.action-pin-change {
    background: #bee3f8;
    color: #1e4a6b;
}

.action-pin-change-failed {
    background: #fed7d7;
    color: #742a2a;
}

.action-item-added {
    background: #c6f6d5;
    color: #22543d;
}

.action-item-updated {
    background: #bee3f8;
    color: #1e4a6b;
}

.action-item-deleted {
    background: #fed7d7;
    color: #742a2a;
}

.action-item-viewed {
    background: #e2e8f0;
    color: #2d3748;
}

.action-backup-created {
    background: #fefcbf;
    color: #744210;
}

.action-backup-restored {
    background: #c6f6d5;
    color: #22543d;
}

/* Password Generator */
.password-generator {
    padding: 10px 0;
}

.generated-password {
    background: #f7fafc;
    padding: 12px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 16px;
    text-align: center;
    border: 1px solid var(--border-color);
    word-break: break-all;
}

/* Form Improvements */
.form-group label {
    display: block;
    margin-bottom: 4px;
}

/* Notification Enhancement */
.notification {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Activity Log Modal Scroll */
.activity-table {
    max-height: 400px;
    overflow-y: auto;
    display: block;
}

/* Backup Table Responsive */
@media (max-width: 768px) {
    .backups-table,
    .activity-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .modal-lg {
        width: 95%;
        margin: 10% auto;
    }
}

/* Loading States */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Tooltips */
[title] {
    position: relative;
    cursor: help;
}

[title]:hover:after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-primary);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 4px;
}

/* Success Animation */
@keyframes checkmark {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.success-checkmark {
    color: var(--success-color);
    animation: checkmark 0.3s ease;
}
