/* --- Global Variables & Refined Palette --- */
:root {
    --side-bg: #0f172a;           /* Deep Slate Navy */
    --side-item-hover: rgba(255, 255, 255, 0.05);
    --accent-blue: #3b82f6;       /* Vibrant Action Blue */
    --accent-blue-soft: rgba(59, 130, 246, 0.1);
    --text-dark: #1e293b;         /* Rich Charcoal */
    --text-light: #64748b;        /* Muted Slate Gray */
    --border-color: #e2e8f0;      /* Clean, Soft Border */
    --input-focus: #3b82f6;
    --success-green: #10b981;
    --warning-orange: #f59e0b;
}

body {
    margin: 0;
    background-color: #f9fafb; /* Kept as requested */
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text-dark);
    -webkit-font-smoothing: antialiased;
}

.account-dashboard {
    display: flex;
    min-height: 100vh;
}

/* --- SIDEBAR MENU --- */
.dashboard-sidebar {
    width: 280px;
    background: #880b17;
    color: white;
    padding: 40px 0; /* Vertical padding only */
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.05);
    max-width: 19%;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 40px;
    padding: 0 30px;
    letter-spacing: -0.5px;
}

.sidebar-logo i {
    color: var(--accent-blue);
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 15px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    /* padding: 12px 16px; */
    color: #94a3b8;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 15px;
    transition: all 0.2s ease;
}

.sidebar-menu-item{
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: #f7f7f8;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 15px;
    transition: all 0.2s ease;
}

.menu-item i {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.menu-item:hover {
    background: rgb(242 243 246 / 40%);
    color: #f8fafc;
}

.menu-item.active {
    background: rgb(242 243 246 / 40%);
    color: #f7f7f7;
    font-weight: 600;
}

.menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 20px 15px;
}

.menu-item.logout {
    color: #f5f5f5; /* Soft Red for logout */
}

.menu-item.logout:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* --- MAIN CONTENT --- */
.dashboard-content {
    flex-grow: 1;
    padding: 60px 10%; /* Responsive horizontal padding */
}

/* TOP HEADER CONTENT */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 30px;
    margin-bottom: 50px;
}

.header-text h1 {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-dark);
    margin: 0 0 8px 0;
    letter-spacing: -1px;
    text-align: left;
}

.header-text p {
    color: var(--text-light);
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
}

.last-updated {
    font-size: 13px;
    color: var(--text-light);
    font-weight: 500;
    background: #f1f5f9;
    padding: 6px 12px;
    border-radius: 20px;
}

/* --- THE FORM --- */
.form-wrapper {
    max-width: 800px;
}

.field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.field-group.full {
    grid-column: span 2;
}

.field-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.field-group input {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    font-size: 15px;
    box-sizing: border-box;
    background: #fff;
    transition: all 0.2s ease;
    color: var(--text-dark);
}

.field-group input::placeholder {
    color: #cbd5e1;
}

.field-group input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

/* Strength Bar */
.strength-indicator {
    height: 6px;
    background: #e2e8f0;
    margin-top: 12px;
    border-radius: 10px;
    overflow: hidden;
}

.strength-indicator .bar {
    width: 45%;
    height: 100%;
    /* background: linear-gradient(90deg, var(--warning-orange), var(--success-green)); */
    border-radius: 10px;
}

/* Action Buttons */
.form-actions-wide {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1.5px solid #f1f5f9;
    display: flex;
    gap: 15px;
}

.btn-save {
    background: var(--side-bg);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-save:hover {
    background: #000;
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.btn-cancel {
    background: white;
    color: var(--text-light);
    border: 1.5px solid var(--border-color);
    padding: 14px 32px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cancel:hover {
    background: #f8fafc;
    color: var(--text-dark);
    border-color: #cbd5e1;
}


/* Update profile */
.form-message {
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 4px;
    font-size: 14px;
}

.form-message.success {
    background: #d4edda;
    color: #155724;
}

.form-message.error {
    background: #f8d7da;
    color: #721c24;
}


.form-loader {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 6px;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #ddd;
    border-top: 4px solid #333;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Make parent relative */
#profile_form {
    position: relative;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .dashboard-sidebar { width: 80px; }
    .sidebar-logo span, .menu-item span { display: none; }
    .sidebar-logo { padding: 0; justify-content: center; }
    .sidebar-menu { padding: 0 10px; }
    .menu-item { justify-content: center; padding: 15px; }
    .dashboard-content { padding: 40px 20px; }
}

@media (max-width: 640px) {
    .field-grid { grid-template-columns: 1fr; }
    .field-group.full { grid-column: span 1; }
    .content-header { flex-direction: column; align-items: flex-start; gap: 15px; }
}