@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ═══════════════════════════════════════════════
   CSS DESIGN TOKENS
   ═══════════════════════════════════════════════ */
:root {
    /* Dark palette */
    --bg-darkest: #0a0a14;
    --bg-dark: #0f0f1a;
    --bg-card: #1a1a2e;
    --bg-card-hover: #1f1f38;
    --bg-input: #16213e;
    --bg-surface: #12122a;
    
    /* Accent colors */
    --accent-primary: #00d4aa;
    --accent-primary-dim: rgba(0, 212, 170, 0.15);
    --accent-primary-glow: rgba(0, 212, 170, 0.3);
    --accent-gold: #ffd700;
    --accent-gold-dim: rgba(255, 215, 0, 0.15);
    --accent-danger: #ff4757;
    --accent-danger-dim: rgba(255, 71, 87, 0.15);
    --accent-warning: #ffa502;
    --accent-info: #3742fa;
    
    /* Category colors */
    --cat-devices: #6c5ce7;
    --cat-online: #0984e3;
    --cat-subscriptions: #e17055;
    --cat-finance: #00b894;
    --cat-insurance: #fdcb6e;
    --cat-security: #d63031;
    --cat-documents: #a29bfe;
    --cat-contacts: #74b9ff;
    --cat-software: #55efc4;
    
    /* Text */
    --text-primary: #e8e8f0;
    --text-secondary: #8888a8;
    --text-muted: #555577;
    --text-inverse: #0a0a14;
    
    /* Borders & Shadows */
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-active: rgba(0, 212, 170, 0.4);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 30px rgba(0, 212, 170, 0.15);
    --shadow-hover: 0 8px 40px rgba(0, 0, 0, 0.5);
    
    /* Glass */
    --glass-bg: rgba(26, 26, 46, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-blur: 20px;
    
    /* Sizing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ═══════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-darkest);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 15% 15%, rgba(0, 212, 170, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 85% 85%, rgba(108, 92, 231, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(255, 215, 0, 0.02) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-gold);
}

/* ═══════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════ */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.sidebar {
    width: 280px;
    background: var(--bg-dark);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: transform var(--transition-normal);
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-subtle);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo .logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-gold));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(0, 212, 170, 0.3);
}

.sidebar-logo .logo-text {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-section-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    padding: 12px 12px 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition-fast);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.nav-item:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-primary-dim);
    color: var(--accent-primary);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 3px;
    background: var(--accent-primary);
    border-radius: 0 2px 2px 0;
}

.nav-item .nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-item .nav-badge {
    margin-left: auto;
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 24px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid var(--border-subtle);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
}

.sidebar-user .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), #6c5ce7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: white;
}

.sidebar-user .user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user .user-name {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user .user-role {
    font-size: 11px;
    color: var(--text-muted);
}

.main-content {
    flex: 1;
    margin-left: 280px;
    min-height: 100vh;
    padding: 0;
    overflow-x: hidden;
    max-width: 100vw;
}

.page-header {
    padding: 28px 40px 20px;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(15, 15, 26, 0.8);
    backdrop-filter: blur(var(--glass-blur));
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-title .title-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-body {
    padding: 32px 40px;
}

/* ═══════════════════════════════════════════════
   CARDS & GLASS
   ═══════════════════════════════════════════════ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
    transition: all var(--transition-normal);
}

.card:hover {
    border-color: var(--border-active);
    box-shadow: var(--shadow-hover);
}

.card-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.card-title {
    font-size: 16px;
    font-weight: 600;
}

/* ═══════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(255,255,255,0.1), transparent);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.btn:hover::after {
    opacity: 1;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), #00b894);
    color: var(--text-inverse);
    box-shadow: 0 4px 16px rgba(0, 212, 170, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 212, 170, 0.4);
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-active);
}

.btn-danger {
    background: linear-gradient(135deg, var(--accent-danger), #c0392b);
    color: white;
    box-shadow: 0 4px 16px rgba(255, 71, 87, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
}

.btn-gold {
    background: linear-gradient(135deg, var(--accent-gold), #f39c12);
    color: var(--text-inverse);
    box-shadow: 0 4px 16px rgba(255, 215, 0, 0.3);
}

.btn-gold:hover {
    transform: translateY(-2px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 8px 12px;
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-sm);
}

.btn-icon.sm {
    width: 32px;
    height: 32px;
}

/* ═══════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════ */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}

.form-label .required {
    color: var(--accent-danger);
    margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    transition: all var(--transition-fast);
    outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-primary-dim);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-muted);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238888a8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
    cursor: pointer;
}

.form-select option {
    background: var(--bg-dark);
    color: var(--text-primary);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.password-wrapper {
    position: relative;
    display: flex;
    gap: 4px;
}

.password-wrapper .form-input {
    padding-right: 80px;
}

.password-toggle,
.password-copy {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    font-size: 14px;
    transition: color var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover,
.password-copy:hover {
    color: var(--accent-primary);
}

.password-toggle {
    right: 40px;
}

.password-copy {
    right: 10px;
}

/* ═══════════════════════════════════════════════
   DASHBOARD STATS
   ═══════════════════════════════════════════════ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--stat-color, var(--accent-primary));
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.stat-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-icon {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    opacity: 0.6;
}

/* ═══════════════════════════════════════════════
   CATEGORY GRID
   ═══════════════════════════════════════════════ */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.category-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--cat-color, var(--accent-primary));
    transition: height var(--transition-normal);
}

.category-card:hover {
    transform: translateY(-4px);
    border-color: var(--cat-color, var(--accent-primary));
    box-shadow: var(--shadow-hover);
}

.category-card:hover::before {
    height: 4px;
}

.category-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 16px;
    position: relative;
}

.category-name {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.category-count {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ═══════════════════════════════════════════════
   ENTRY LIST
   ═══════════════════════════════════════════════ */
.entry-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.entry-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.entry-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-active);
    transform: translateX(4px);
}

.entry-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
}

.entry-info {
    flex: 1;
    min-width: 0;
}

.entry-name {
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.entry-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.entry-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.entry-item:hover .entry-actions {
    opacity: 1;
}

/* ═══════════════════════════════════════════════
   SEARCH
   ═══════════════════════════════════════════════ */
.search-wrapper {
    position: relative;
    max-width: 400px;
}

.search-wrapper .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 10px 16px 10px 42px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    transition: all var(--transition-fast);
    outline: none;
}

.search-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-primary-dim);
}

/* ═══════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-dark);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 32px;
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    transform: scale(0.95) translateY(20px);
    transition: transform var(--transition-normal);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

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

.modal-title {
    font-size: 20px;
    font-weight: 700;
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-card);
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--accent-danger-dim);
    color: var(--accent-danger);
}

.modal-body {
    margin-bottom: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border-subtle);
}

/* ═══════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════ */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    min-width: 300px;
    max-width: 420px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    animation: toastSlideIn 0.3s ease-out;
}

.toast.success {
    border-left: 4px solid var(--accent-primary);
}

.toast.error {
    border-left: 4px solid var(--accent-danger);
}

.toast.warning {
    border-left: 4px solid var(--accent-warning);
}

.toast-message {
    flex: 1;
    font-size: 14px;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    line-height: 1;
}

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

/* ═══════════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════════ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

.login-bg-orbs {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.login-bg-orbs .orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    animation: orbFloat 15s ease-in-out infinite;
}

.login-bg-orbs .orb:nth-child(1) {
    width: 400px;
    height: 400px;
    background: rgba(0, 212, 170, 0.08);
    top: -10%;
    left: -5%;
    animation-delay: 0s;
}

.login-bg-orbs .orb:nth-child(2) {
    width: 300px;
    height: 300px;
    background: rgba(108, 92, 231, 0.08);
    bottom: -10%;
    right: -5%;
    animation-delay: -5s;
}

.login-bg-orbs .orb:nth-child(3) {
    width: 200px;
    height: 200px;
    background: rgba(255, 215, 0, 0.06);
    top: 50%;
    left: 50%;
    animation-delay: -10s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -30px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(15px, 15px) scale(1.02); }
}

.login-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    max-width: 440px;
    width: 100%;
    position: relative;
    z-index: 1;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.login-card .logo-section {
    text-align: center;
    margin-bottom: 36px;
}

.login-card .logo-icon-large {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-gold));
    border-radius: var(--radius-lg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin-bottom: 16px;
    box-shadow: 0 8px 24px rgba(0, 212, 170, 0.3);
    animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% { box-shadow: 0 8px 24px rgba(0, 212, 170, 0.3); }
    50% { box-shadow: 0 8px 40px rgba(0, 212, 170, 0.5); }
}

.login-card h1 {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}

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

.login-error {
    background: var(--accent-danger-dim);
    border: 1px solid rgba(255, 71, 87, 0.3);
    color: var(--accent-danger);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ═══════════════════════════════════════════════
   SETUP PAGE
   ═══════════════════════════════════════════════ */
.setup-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.setup-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    max-width: 520px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.recovery-key-display {
    background: var(--bg-darkest);
    border: 2px dashed var(--accent-gold);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    margin: 24px 0;
}

.recovery-key-display .key {
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-gold);
    letter-spacing: 2px;
    word-break: break-all;
    line-height: 1.8;
}

.recovery-key-display .warning {
    font-size: 13px;
    color: var(--accent-danger);
    margin-top: 16px;
    font-weight: 600;
}

/* ═══════════════════════════════════════════════
   GUIDE PAGE
   ═══════════════════════════════════════════════ */
.guide-section {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 16px;
}

.guide-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding-bottom: 12px;
}

.guide-section-title {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.guide-section-body {
    padding-top: 16px;
    border-top: 1px solid var(--border-subtle);
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-secondary);
}

/* ═══════════════════════════════════════════════
   EMPTY STATES
   ═══════════════════════════════════════════════ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
}

/* ═══════════════════════════════════════════════
   ACTIVITY LOG
   ═══════════════════════════════════════════════ */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.activity-item:hover {
    background: var(--bg-card);
}

.activity-time {
    color: var(--text-muted);
    font-size: 12px;
    white-space: nowrap;
    min-width: 140px;
}

.activity-action {
    color: var(--text-secondary);
    flex: 1;
}

/* ═══════════════════════════════════════════════
   TABS
   ═══════════════════════════════════════════════ */
.tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
}

.tab {
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    background: none;
    font-family: inherit;
}

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

.tab.active {
    background: var(--bg-card);
    color: var(--accent-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* ═══════════════════════════════════════════════
   UTILITY CLASSES
   ═══════════════════════════════════════════════ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-secondary); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.text-success { color: var(--accent-primary); }
.text-danger { color: var(--accent-danger); }
.text-gold { color: var(--accent-gold); }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

.hidden { display: none !important; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ═══════════════════════════════════════════════
   SCROLLBAR
   ═══════════════════════════════════════════════ */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 3px;
}

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

/* ═══════════════════════════════════════════════
   SKELETON LOADING
   ═══════════════════════════════════════════════ */
.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: skeletonWave 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeletonWave {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ═══════════════════════════════════════════════
   BADGE
   ═══════════════════════════════════════════════ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-admin {
    background: var(--accent-primary-dim);
    color: var(--accent-primary);
}

.badge-readonly {
    background: var(--accent-gold-dim);
    color: var(--accent-gold);
}

/* ═══════════════════════════════════════════════
   MOBILE MENU TOGGLE
   ═══════════════════════════════════════════════ */
.mobile-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 200;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

/* ═══════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .mobile-toggle {
        display: flex;
    }
    
    .sidebar {
        transform: translateX(-100%);
        z-index: 150;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .page-header {
        padding: 20px 20px 16px;
        padding-top: 68px;
    }
    
    .page-body {
        padding: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .login-card {
        padding: 32px 24px;
    }
    
    .setup-card {
        padding: 32px 24px;
    }
    
    .modal {
        padding: 24px;
        margin: 16px;
        max-height: 90vh;
    }
    
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }
    
    .page-header-inner {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* F06: Global mobile overflow prevention */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
        max-width: 100vw;
    }
    
    .main-content {
        max-width: 100vw;
        width: 100%;
    }
    
    .page-header {
        max-width: 100vw;
        box-sizing: border-box;
    }
    
    .page-body {
        max-width: 100vw;
        box-sizing: border-box;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    html {
        font-size: 15px;
    }
    
    /* F06: Prevent horizontal overflow */
    .page-header-inner {
        gap: 12px;
    }
    
    .page-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
    }
    
    .page-actions .btn {
        flex: 1 1 auto;
        min-width: 0;
        font-size: 13px;
        padding: 8px 12px;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* Cards should never exceed viewport */
    .card, .entry-card, .stat-card {
        max-width: 100%;
        overflow: hidden;
    }
    
    /* Entry card grid fix */
    .entry-card-header {
        flex-wrap: wrap;
    }
    
    .entry-card-actions {
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .entry-card-actions .btn {
        font-size: 12px;
        padding: 4px 8px;
    }
    
    /* Export cards */
    .export-card, .print-card {
        max-width: 100%;
        overflow-x: hidden;
    }
    
    /* Table overflow */
    table {
        display: block;
        overflow-x: auto;
        max-width: 100%;
    }
    
    /* Modal fixes */
    .modal {
        width: calc(100vw - 32px);
        max-width: 100%;
        margin: 16px;
        padding: 20px 16px;
    }
    
    /* Page body padding */
    .page-body {
        padding: 16px 12px;
    }
    
    .page-header {
        padding: 16px 12px;
        padding-top: 64px;
    }
}

/* Ultra-narrow: iPhone SE / 390px */
@media (max-width: 400px) {
    .page-title {
        font-size: 1.2rem;
    }
    
    .page-subtitle {
        font-size: 12px;
    }
    
    .btn {
        font-size: 13px;
        padding: 8px 12px;
    }
    
    .nav-item {
        font-size: 13px;
        padding: 8px 12px;
    }
    
    .stat-card {
        padding: 12px;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
}

/* ═══════════════════════════════════════════════
   PRINT STYLES (for recovery key)
   ═══════════════════════════════════════════════ */
@media print {
    body {
        background: white !important;
        color: black !important;
    }
    
    .no-print {
        display: none !important;
    }
    
    .print-only {
        display: block !important;
    }
    
    .recovery-key-display {
        border: 2px solid #333;
        background: #f9f9f9 !important;
    }
    
    .recovery-key-display .key {
        color: #333 !important;
    }
}

.print-only {
    display: none;
}

/* ═══════════════════════════════════════════════
   COPIED ANIMATION
   ═══════════════════════════════════════════════ */
.copied-tooltip {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-primary);
    color: var(--text-inverse);
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    animation: copiedFade 1.5s ease-out forwards;
    pointer-events: none;
    white-space: nowrap;
}

@keyframes copiedFade {
    0% { opacity: 0; transform: translateX(-50%) translateY(5px); }
    20% { opacity: 1; transform: translateX(-50%) translateY(0); }
    80% { opacity: 1; }
    100% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}

/* ═══════════════════════════════════════════════
   LIGHT THEME
   ═══════════════════════════════════════════════ */
html[data-theme="light"] {
    --bg-darkest: #f0f2f5;
    --bg-dark: #f5f7fa;
    --bg-card: #ffffff;
    --bg-card-hover: #f8f9fb;
    --bg-input: #f0f2f5;
    --bg-surface: #fafbfc;
    
    --accent-primary: #00a884;
    --accent-primary-dim: rgba(0, 168, 132, 0.1);
    --accent-primary-glow: rgba(0, 168, 132, 0.2);
    --accent-danger: #e74c3c;
    --accent-danger-dim: rgba(231, 76, 60, 0.1);
    --accent-warning: #f39c12;
    
    --text-primary: #1a1a2e;
    --text-secondary: #6c6c8a;
    --text-muted: #9999b0;
    --text-inverse: #ffffff;
    
    --border-subtle: rgba(0, 0, 0, 0.08);
    --border-active: rgba(0, 168, 132, 0.4);
    --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.08);
    --shadow-glow: 0 0 20px rgba(0, 168, 132, 0.1);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.12);
    
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .sidebar {
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
}

[data-theme="light"] .sidebar .nav-item,
[data-theme="light"] .sidebar .nav-section-label,
[data-theme="light"] .sidebar .sidebar-logo .logo-text,
[data-theme="light"] .sidebar .user-name,
[data-theme="light"] .sidebar .user-role {
    color: #e8e8f0;
}

[data-theme="light"] .sidebar .search-input {
    background: rgba(255,255,255,0.1);
    color: #e8e8f0;
    border-color: rgba(255,255,255,0.15);
}

[data-theme="light"] .sidebar .search-input::placeholder {
    color: rgba(255,255,255,0.4);
}

/* ═══════════════════════════════════════════════
   THEME TOGGLE BUTTON
   ═══════════════════════════════════════════════ */
.theme-toggle-btn {
    background: none;
    border: none;
    font-size: 1.2em;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    margin-left: auto;
    line-height: 1;
}

.theme-toggle-btn:hover {
    background: rgba(255,255,255,0.1);
    transform: rotate(20deg);
}

/* ═══════════════════════════════════════════════
   GLOBAL SEARCH
   ═══════════════════════════════════════════════ */
.sidebar-search {
    padding: 0 16px 12px;
}

.search-input-wrapper {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    pointer-events: none;
}

.search-input {
    width: 100%;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    padding: 8px 12px 8px 34px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    transition: var(--transition-fast);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: rgba(255,255,255,0.1);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-hover);
    z-index: 1000;
    display: none;
    max-height: 300px;
    overflow-y: auto;
    margin-top: 4px;
}

.search-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    text-decoration: none;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-subtle);
    transition: var(--transition-fast);
}

.search-result-item:last-child { border-bottom: none; }

.search-result-item:hover {
    background: var(--accent-primary-dim);
}

.search-result-title {
    font-weight: 500;
    font-size: 14px;
}

.search-result-cat {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-no-results {
    padding: 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* ═══════════════════════════════════════════════
   PASSWORD STRENGTH INDICATOR
   ═══════════════════════════════════════════════ */
.password-strength-bar {
    height: 4px;
    background: var(--bg-input);
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}

.password-strength-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease, background 0.3s ease;
    width: 0;
}

.password-strength-fill.strength-weak { background: var(--accent-danger); }
.password-strength-fill.strength-fair { background: var(--accent-warning); }
.password-strength-fill.strength-good { background: #2ed573; }
.password-strength-fill.strength-strong { background: var(--accent-primary); }

.password-strength-label {
    font-size: 11px;
    margin-top: 3px;
    min-height: 16px;
}

.password-strength-label.strength-weak { color: var(--accent-danger); }
.password-strength-label.strength-fair { color: var(--accent-warning); }
.password-strength-label.strength-good { color: #2ed573; }
.password-strength-label.strength-strong { color: var(--accent-primary); }

/* ═══════════════════════════════════════════════
   PASSWORD GENERATOR BUTTON
   ═══════════════════════════════════════════════ */
.password-generate {
    background: none;
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    font-size: 16px;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
}

.password-generate:hover {
    background: var(--accent-primary-dim);
    border-color: var(--accent-primary);
}

/* ═══════════════════════════════════════════════
   FORM RANGE SLIDER
   ═══════════════════════════════════════════════ */
.form-range {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-input);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.form-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    border: none;
}

.form-row {
    display: flex;
    align-items: center;
}

/* ═══════════════════════════════════════════════
   KEYCHAIN STYLES
   ═══════════════════════════════════════════════ */
.keychain-group {
    margin-bottom: 28px;
}

.keychain-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.keychain-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: var(--transition-normal);
    overflow: hidden;
}

.keychain-card:hover {
    border-color: rgba(224, 86, 253, 0.3);
    box-shadow: 0 4px 20px rgba(224, 86, 253, 0.1);
    transform: translateY(-2px);
}

.keychain-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 0;
}

.keychain-icon {
    font-size: 24px;
}

.keychain-type-badge {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #e056fd;
    background: rgba(224, 86, 253, 0.12);
    padding: 3px 8px;
    border-radius: 20px;
}

.keychain-card-body {
    padding: 10px 16px 12px;
}

.keychain-label {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.keychain-value-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.keychain-value-masked {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    letter-spacing: 2px;
    color: var(--text-muted);
}

.keychain-card-footer {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
    border-top: 1px solid var(--border-subtle);
    background: rgba(0,0,0,0.1);
}

.keychain-card-footer .btn {
    flex: 1;
    justify-content: center;
    font-size: 14px;
    padding: 6px;
}

.keychain-card-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
}

.keychain-card-mini:hover {
    border-color: rgba(224, 86, 253, 0.3);
    background: var(--bg-card-hover);
}

.keychain-icon-mini {
    font-size: 20px;
}

/* ═══════════════════════════════════════════════
   DEVICE OVERVIEW STYLES
   ═══════════════════════════════════════════════ */
.device-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.device-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.device-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--device-color, #6c5ce7);
}

.device-card:hover {
    border-color: var(--device-color, #6c5ce7);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    transform: translateY(-2px);
}

.device-card-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    background: color-mix(in srgb, var(--device-color, #6c5ce7) 15%, transparent);
    flex-shrink: 0;
}

.device-card-info {
    flex: 1;
    min-width: 0;
}

.device-card-name {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.device-card-type {
    font-size: 12px;
    color: var(--text-secondary);
}

.device-card-updated {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.device-card-arrow {
    font-size: 18px;
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.device-card:hover .device-card-arrow {
    color: var(--device-color, #6c5ce7);
    transform: translateX(4px);
}

/* ═══════════════════════════════════════════════
   TRUSTED CONTACTS STYLES
   ═══════════════════════════════════════════════ */
.trusted-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 16px;
}

.trusted-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition-normal);
}

.trusted-card:hover {
    border-color: rgba(116, 185, 255, 0.3);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.trusted-card.trusted-granted {
    border-color: rgba(0, 212, 170, 0.3);
    background: linear-gradient(135deg, var(--bg-card), rgba(0, 212, 170, 0.03));
}

.trusted-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
}

.trusted-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #74b9ff, #0984e3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    color: white;
    flex-shrink: 0;
}

.trusted-info {
    flex: 1;
    min-width: 0;
}

.trusted-name {
    font-weight: 600;
    font-size: 15px;
}

.trusted-relation {
    font-size: 12px;
    color: var(--text-secondary);
}

.trusted-status {
    flex-shrink: 0;
}

.trusted-card-body {
    padding: 0 16px 16px;
}

.trusted-details {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.trusted-detail {
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-input);
    padding: 4px 10px;
    border-radius: 20px;
}

.trusted-card-footer {
    display: flex;
    gap: 6px;
    padding: 12px 16px;
    border-top: 1px solid var(--border-subtle);
    background: rgba(0,0,0,0.08);
}

/* Inactivity Progress Bar */
.inactivity-progress-container {
    margin-top: 8px;
}

.inactivity-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.inactivity-progress-bar {
    height: 6px;
    background: var(--bg-input);
    border-radius: 3px;
    overflow: hidden;
}

.inactivity-progress-fill {
    height: 100%;
    background: var(--accent-primary);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.inactivity-progress-fill.warning {
    background: var(--accent-warning);
}

.inactivity-progress-fill.danger {
    background: var(--accent-danger);
}

/* Badges */
.badge-granted {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--accent-primary-dim);
    color: var(--accent-primary);
    font-weight: 600;
}

.badge-triggered {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--accent-danger-dim);
    color: var(--accent-danger);
    font-weight: 600;
}

.badge-pending {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(255, 165, 2, 0.12);
    color: var(--accent-warning);
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .keychain-grid {
        grid-template-columns: 1fr;
    }
    .device-grid {
        grid-template-columns: 1fr;
    }
    .trusted-grid {
        grid-template-columns: 1fr;
    }
    .grid-3 {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════════
   BRANDING PAGE STYLES
   ═══════════════════════════════════════════════ */

/* Tabs */
.tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 4px;
    border: 1px solid var(--border-subtle);
}

.tab {
    flex: 1;
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.tab:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-primary);
}

.tab.active {
    background: var(--accent-primary-dim);
    color: var(--accent-primary);
    font-weight: 600;
}

/* Preset Grid */
.preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.preset-card {
    padding: 12px;
    background: var(--bg-input);
    border: 2px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    text-align: center;
}

.preset-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.preset-card.preset-active {
    border-color: var(--accent-primary);
    box-shadow: 0 0 12px var(--accent-primary-glow);
}

.preset-colors {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-bottom: 8px;
}

.preset-colors span {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.1);
}

.preset-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
}

/* Color Picker */
.color-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.color-item {
    text-align: center;
}

.color-input-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.color-input-row input[type="color"] {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 0;
    background: transparent;
}

.color-hex {
    width: 80px !important;
    font-family: monospace;
    font-size: 12px;
    text-align: center;
}

/* Logo Upload */
.logo-upload-area {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: 2px dashed var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
}

.logo-upload-area:hover {
    border-color: var(--accent-primary);
    background: var(--accent-primary-dim);
}

.logo-preview {
    max-width: 120px;
    max-height: 60px;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

.logo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
    text-align: center;
}

/* Feature Toggles */
.feature-grid {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.feature-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--bg-card);
}

.feature-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.feature-icon {
    font-size: 22px;
}

.feature-name {
    font-weight: 600;
    font-size: 14px;
}

.feature-desc {
    margin-top: 1px;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--bg-input);
    border-radius: 26px;
    cursor: pointer;
    transition: var(--transition-fast);
    border: 1px solid var(--border-subtle);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    top: 2px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: var(--transition-fast);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--accent-primary-dim);
    border-color: var(--accent-primary);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(21px);
    background: var(--accent-primary);
}

/* Grid helpers */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.card-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.card-title {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
}

@media (max-width: 768px) {
    .tabs {
        flex-wrap: wrap;
    }
    .preset-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .grid-2 {
        grid-template-columns: 1fr;
    }
    .color-picker-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
