:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f0f4f8;
    --bg-card: #ffffff;
    --bg-input: #f5f7fa;
    --accent: #163263;
    --accent-light: #1e4a8f;
    --accent-gradient: linear-gradient(135deg, #163263, #1e4a8f);
    --text-primary: #163263;
    --text-secondary: #5a6f8a;
    --border: #d1dbe6;
    --border-light: #e8edf3;
    --success: #059669;
    --error: #dc2626;
    --warning: #d97706;
    --gold: #b8860b;
}

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

body {
    font-family: 'DM Sans', -apple-system, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    min-height: 100vh;
}

.bg-pattern, .grid-overlay { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.bg-pattern { background: radial-gradient(ellipse at 20% 0%, rgba(22,50,99,0.08), transparent 50%); }

.app { position: relative; z-index: 1; min-height: 100vh; }

/* ===== NAVBAR ===== */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; 
    height: 80px;
    background: var(--accent);
    border-bottom: 3px solid var(--gold);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px; z-index: 100;
    box-shadow: 0 2px 10px rgba(22,50,99,0.2);
}

.logo { 
    display: flex; 
    align-items: center; 
    gap: 14px;
    font-size: 1.4rem;
    font-weight: 700; 
    color: #ffffff; 
    text-decoration: none; 
}

.logo-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #ffffff;
    border: 2px solid var(--gold);
}

.logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.user-badge { 
    display: none; 
    align-items: center; 
    gap: 8px; 
    padding: 6px 14px; 
    background: rgba(255,255,255,0.15); 
    border-radius: 50px; 
    border: 1px solid rgba(255,255,255,0.3);
    color: #ffffff;
}
.user-badge.visible { display: flex; }
.user-name { color: #ffffff; }
.user-avatar { 
    width: 32px; 
    height: 32px; 
    background: var(--gold); 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-weight: 600; 
    font-size: 0.8rem; 
    color: #ffffff;
    overflow: hidden;
}
.user-avatar.user-photo {
    background: transparent;
    border: 2px solid var(--gold);
}
.user-avatar.user-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.btn-admin {
    color: rgba(255,255,255,0.8);
    padding: 4px;
    margin-left: 4px;
}
.btn-admin:hover { color: var(--gold); }
.btn-logout { color: rgba(255,255,255,0.8); padding: 4px; }
.btn-logout:hover { color: #ffffff; }

/* ===== MAIN CONTENT ===== */
.main-content { padding-top: 80px; min-height: 100vh; }

/* ===== AUTH ===== */
.auth-container { min-height: calc(100vh - 80px); display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-card { 
    width: 100%; 
    max-width: 400px; 
    background: var(--bg-card); 
    border-radius: 16px; 
    border: 1px solid var(--border);
    padding: 40px; 
    box-shadow: 0 4px 20px rgba(22,50,99,0.1);
}
.auth-title { font-size: 1.8rem; margin-bottom: 8px; text-align: center; color: var(--accent); }
.auth-subtitle { color: var(--text-secondary); text-align: center; margin-bottom: 24px; }
.auth-switch { text-align: center; margin-top: 20px; color: var(--text-secondary); }
.auth-switch a { color: var(--accent); text-decoration: none; font-weight: 600; }
.auth-switch a:hover { text-decoration: underline; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 16px; }
.form-label { display: block; color: var(--text-secondary); margin-bottom: 6px; font-size: 0.9rem; font-weight: 500; }
.form-label.required::after { content: ' *'; color: var(--error); }
.form-input { 
    width: 100%; 
    padding: 12px 14px; 
    background: var(--bg-input); 
    border: 1px solid var(--border); 
    border-radius: 8px; 
    color: var(--text-primary); 
    font-size: 1rem; 
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus { 
    outline: none; 
    border-color: var(--accent); 
    box-shadow: 0 0 0 3px rgba(22,50,99,0.1);
}
.form-input::placeholder { color: var(--text-secondary); }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 140px; }

/* ===== BUTTONS ===== */
.btn { 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    padding: 12px 24px; 
    border-radius: 8px; 
    font-size: 1rem; 
    font-weight: 600; 
    cursor: pointer; 
    border: none; 
    text-decoration: none; 
    transition: all 0.2s;
}
.btn-primary { 
    width: 100%; 
    background: var(--accent-gradient); 
    color: white; 
}
.btn-primary:hover {
    box-shadow: 0 4px 15px rgba(22,50,99,0.3);
    transform: translateY(-1px);
}
.btn-secondary { 
    background: var(--bg-input); 
    color: var(--text-primary); 
    border: 1px solid var(--border); 
}
.btn-secondary:hover {
    background: var(--border-light);
    border-color: var(--accent);
}
.btn-add { 
    width: 100%; 
    padding: 12px; 
    background: transparent; 
    border: 2px dashed var(--border); 
    border-radius: 8px; 
    color: var(--text-secondary); 
    cursor: pointer; 
    margin-top: 12px; 
    transition: all 0.2s;
}
.btn-add:hover { 
    border-color: var(--accent); 
    color: var(--accent); 
    background: rgba(22,50,99,0.03);
}
.btn-delete { 
    background: var(--error); 
    color: white; 
    border: none; 
    width: 24px; 
    height: 24px; 
    border-radius: 50%; 
    cursor: pointer; 
    font-size: 1rem; 
    line-height: 1; 
    transition: background 0.2s;
}
.btn-delete:hover {
    background: #b91c1c;
}

/* ===== DASHBOARD ===== */
.dashboard { display: none; }
.dashboard.active { display: block; }

.sidebar { 
    position: fixed; 
    left: 0; 
    top: 80px; 
    bottom: 0; 
    width: 220px; 
    background: var(--bg-card); 
    border-right: 1px solid var(--border); 
    padding: 20px 12px; 
}
.sidebar-section { margin-bottom: 24px; }
.sidebar-title { 
    font-size: 0.75rem; 
    text-transform: uppercase; 
    color: var(--text-secondary); 
    margin-bottom: 8px; 
    padding: 0 12px; 
    font-weight: 600;
    letter-spacing: 0.5px;
}
.nav-item { 
    display: block; 
    padding: 10px 14px; 
    border-radius: 8px; 
    color: var(--text-secondary); 
    text-decoration: none; 
    margin-bottom: 4px; 
    transition: all 0.2s;
}
.nav-item:hover { 
    background: var(--bg-secondary); 
    color: var(--text-primary); 
}
.nav-item.active { 
    background: var(--accent); 
    color: #ffffff; 
}

.dashboard-content { 
    margin-left: 220px; 
    padding: 24px 32px; 
    min-height: calc(100vh - 80px); 
}

.page-header {
    margin-bottom: 24px;
}
.page-title { 
    font-size: 1.8rem; 
    color: var(--accent);
}
.section-title { 
    font-size: 1.1rem; 
    margin-bottom: 16px; 
    color: var(--accent); 
    font-weight: 600;
}

/* ===== CV SECTIONS ===== */
.cv-section { 
    background: var(--bg-card); 
    border-radius: 12px; 
    border: 1px solid var(--border); 
    padding: 24px; 
    margin-bottom: 20px; 
    box-shadow: 0 2px 8px rgba(22,50,99,0.05);
}

.list-item { 
    background: var(--bg-secondary); 
    border-radius: 8px; 
    padding: 16px; 
    margin-bottom: 12px; 
    border: 1px solid var(--border-light); 
    transition: border-color 0.2s;
}
.list-item:hover {
    border-color: var(--border);
}
.item-header { display: flex; justify-content: flex-end; margin-bottom: 8px; }

/* ===== SKILLS ===== */
.skills-container { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.skill-tag { 
    display: inline-flex; 
    align-items: center; 
    gap: 6px; 
    padding: 6px 12px; 
    background: var(--accent); 
    border: none; 
    border-radius: 50px; 
    font-size: 0.9rem; 
    color: #ffffff;
}
.skill-tag button { 
    background: none; 
    border: none; 
    color: rgba(255,255,255,0.7); 
    cursor: pointer; 
    font-size: 1rem; 
}
.skill-tag button:hover { color: #ffffff; }
.skill-input-container { display: flex; gap: 8px; }
.skill-input-container .form-input { flex: 1; }

/* ===== CV PREVIEW ===== */
.cv-preview { 
    background: white; 
    color: var(--text-primary); 
    border-radius: 12px; 
    padding: 40px; 
    max-width: 800px; 
    margin: 0 auto; 
    box-shadow: 0 4px 20px rgba(22,50,99,0.1);
    border: 1px solid var(--border);
}
.cv-preview h1 { 
    font-size: 1.8rem; 
    margin-bottom: 8px; 
    color: var(--accent);
}
.cv-preview h2 { 
    font-size: 1.1rem; 
    color: var(--accent); 
    margin: 24px 0 12px; 
    border-bottom: 2px solid var(--gold); 
    padding-bottom: 4px; 
}
.cv-preview p { margin-bottom: 8px; line-height: 1.6; }

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 1000; }
.toast { 
    padding: 12px 20px; 
    background: var(--bg-card); 
    border: 1px solid var(--border); 
    border-radius: 8px; 
    margin-top: 8px; 
    animation: slideIn 0.3s ease; 
    box-shadow: 0 4px 15px rgba(22,50,99,0.15);
    color: var(--text-primary);
}
.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--error); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ===== SELECT DROPDOWN ===== */
select.form-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235a6f8a' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .dashboard-content { margin-left: 0; padding: 16px; }
    .form-row { flex-direction: column; }
    .navbar { padding: 0 16px; }
    .logo { font-size: 1.2rem; gap: 10px; }
    .logo-icon { width: 44px; height: 44px; }
}
