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

:root {
    --primary: #ce492a;
    --primary-light: #e05a38;
    --bg: #f7f5f3;
    --sidebar-bg: #1a1a1a;
    --sidebar-width: 260px;
    --text: #1a1a1a;
    --text-muted: #888;
    --border: #e8e4e0;
    --shadow: 0 2px 12px rgba(0, 0, 0, .07);
    --shadow-md: 0 4px 24px rgba(0, 0, 0, .1);
    --radius: 14px;
    --radius-sm: 8px
}

html,
body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text)
}

a {
    text-decoration: none;
    color: inherit
}

svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform .3s ease
}

.sidebar-logo {
    padding: 28px 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, .08)
}

.logo-text {
    font-size: 26px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 3px
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, .55);
    font-size: 14px;
    font-weight: 500;
    transition: all .2s
}

.nav-item:hover {
    background: rgba(255, 255, 255, .07);
    color: rgba(255, 255, 255, .9)
}

.nav-item.active {
    background: var(--primary);
    color: #fff
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    display: flex;
    align-items: center;
    gap: 10px
}

.user-mini {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px
}

.user-avatar-sm {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center
}

.user-info span {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    display: block
}

.user-info small {
    font-size: 11px;
    color: rgba(255, 255, 255, .4)
}

.logout-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, .4);
    transition: all .2s
}

.logout-btn:hover {
    background: rgba(255, 255, 255, .07);
    color: #fff
}

.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 32px
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text);
    padding: 4px
}

.page-body {
    padding: 32px;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(14px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

h1 {
    font-size: 22px;
    font-weight: 800
}

.page-sub {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 2px;
    margin-bottom: 28px
}

/* Profile header */
.profile-header {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 24px;
    animation: fadeUp .4s ease
}

.avatar-big {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #e87a5a);
    color: #fff;
    font-size: 28px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative
}

.avatar-edit {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #1a1a1a;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid #fff
}

.avatar-edit svg {
    width: 12px;
    height: 12px
}

.profile-meta h2 {
    font-size: 20px;
    font-weight: 800
}

.profile-meta p {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 3px
}

.role-badge {
    display: inline-flex;
    background: rgba(206, 73, 42, .1);
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 50px;
    margin-top: 8px
}

/* Sections */
.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px
}

.profile-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    animation: fadeUp .4s ease both
}

.profile-card h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px
}

.profile-card h3 svg {
    color: var(--primary)
}

.form-group {
    margin-bottom: 16px
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--text-muted);
    margin-bottom: 6px
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 13px;
    border: 1px solid var(--border);
    border-radius: 9px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    transition: border-color .2s, box-shadow .2s;
    outline: none
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(206, 73, 42, .1);
    background: #fff
}

.form-group input:read-only {
    background: #f0eeec;
    cursor: not-allowed;
    color: var(--text-muted)
}

.btn-save {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 11px 22px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: background .2s
}

.btn-save:hover {
    background: var(--primary-light)
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 9px 20px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all .2s
}

.btn-outline:hover {
    background: rgba(206, 73, 42, .05)
}

/* Password strength */
.pwd-strength {
    height: 4px;
    border-radius: 2px;
    margin-top: 6px;
    transition: all .3s;
    background: var(--border)
}

.pwd-strength.weak {
    background: linear-gradient(90deg, #e74c3c 33%, var(--border) 33%)
}

.pwd-strength.medium {
    background: linear-gradient(90deg, #f39c12 66%, var(--border) 66%)
}

.pwd-strength.strong {
    background: #27ae60
}

.pwd-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px
}

/* Stats mini */
.mini-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 0
}

.mini-stat {
    background: var(--bg);
    border-radius: 10px;
    padding: 14px;
    text-align: center
}

.mini-stat-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary)
}

.mini-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 3px
}

/* Danger zone */
.danger-card {
    background: #fff;
    border: 1px solid rgba(231, 76, 60, .3);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-top: 20px;
    animation: fadeUp .4s ease both;
    animation-delay: .3s
}

.danger-card h3 {
    font-size: 15px;
    font-weight: 700;
    color: #c0392b;
    margin-bottom: 8px
}

.danger-card p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px
}

.btn-danger {
    background: #e74c3c;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: background .2s
}

.btn-danger:hover {
    background: #c0392b
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #1a1a1a;
    color: #fff;
    padding: 13px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
    transform: translateY(80px);
    opacity: 0;
    transition: all .3s;
    z-index: 300
}

.toast.show {
    transform: translateY(0);
    opacity: 1
}

.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .4);
    z-index: 90
}

@media(max-width:900px) {
    .profile-grid {
        grid-template-columns: 1fr
    }
}

@media(max-width:768px) {
    .sidebar {
        transform: translateX(-100%)
    }

    .sidebar.open {
        transform: translateX(0)
    }

    .overlay.active {
        display: block
    }

    .main-content {
        margin-left: 0
    }

    .menu-toggle {
        display: flex
    }

    .topbar,
    .page-body {
        padding-left: 20px;
        padding-right: 20px
    }

    .profile-header {
        flex-direction: column;
        text-align: center
    }

    .mini-stats {
        grid-template-columns: 1fr 1fr
    }
}