:root {
    --sidebar-width: 260px;
    --header-height: 64px
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0
}

html {
    overflow-x: hidden;
    scroll-behavior: smooth
}

body {
    font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
    background: #F1F5F9;
    color: #1e293b;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh
}

html.dark body {
    background: #0F172A;
    color: #E2E8F0
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px
}

::-webkit-scrollbar-track {
    background: transparent
}

::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 99px
}

html.dark ::-webkit-scrollbar-thumb {
    background: #334155
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: #fff;
    border-right: 1px solid #E2E8F0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform .3s cubic-bezier(.4, 0, .2, 1)
}

html.dark .sidebar {
    background: #0F172A;
    border-right-color: #1E293B
}

@media(max-width:1023px) {
    .sidebar {
        transform: translateX(-100%)
    }

    .sidebar.open {
        transform: translateX(0)
    }
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .4);
    z-index: 999
}

.sidebar-overlay.active {
    display: block
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 10px;
    color: #64748B;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    margin: 0 12px 2px;
    transition: all .15s
}

.nav-item:hover {
    background: #F1F5F9;
    color: #334155
}

html.dark .nav-item:hover {
    background: #1E293B;
    color: #E2E8F0
}

.nav-item.active {
    background: #EFF6FF;
    color: #2563EB;
    font-weight: 600
}

html.dark .nav-item.active {
    background: rgba(37, 99, 235, .15);
    color: #60A5FA
}

.nav-item .nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0
}

.nav-group-title {
    font-size: 11px;
    font-weight: 700;
    color: #94A3B8;
    text-transform: uppercase;
    letter-spacing: .08em;
    padding: 16px 28px 6px
}

.header {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--header-height);
    background: rgba(255, 255, 255, .88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid #E2E8F0;
    z-index: 900;
    display: flex;
    align-items: center;
    padding: 0 24px;
    transition: left .3s
}

html.dark .header {
    background: rgba(15, 23, 42, .88);
    border-bottom-color: #1E293B
}

@media(max-width:1023px) {
    .header {
        left: 0
    }
}

.main-content {
    margin-left: var(--sidebar-width);
    padding-top: var(--header-height);
    min-height: 100vh;
    transition: margin-left .3s
}

@media(max-width:1023px) {
    .main-content {
        margin-left: 0
    }
}

.card {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 16px
}

html.dark .card {
    background: #1E293B;
    border-color: #334155
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: background .15s
}

.btn-primary {
    background: #2563EB;
    color: #fff
}

.btn-primary:hover {
    background: #1D4ED8
}

.btn-outline {
    background: #fff;
    color: #334155;
    border: 1px solid #E2E8F0
}

html.dark .btn-outline {
    background: #1E293B;
    color: #E2E8F0;
    border-color: #334155
}

.btn-outline:hover {
    background: #F8FAFC
}

html.dark .btn-outline:hover {
    background: #334155
}

.btn-sm {
    padding: 7px 14px;
    font-size: 13px;
    border-radius: 8px
}

.btn-danger {
    background: #EF4444;
    color: #fff
}

.btn-danger:hover {
    background: #DC2626
}

.btn-success {
    background: #10B981;
    color: #fff
}

.btn-success:hover {
    background: #059669
}

.avatar {
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: #1E293B;
    outline: none;
    transition: border-color .15s
}

html.dark .form-input {
    background: #0F172A;
    border-color: #334155;
    color: #E2E8F0
}

.form-input:focus {
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .08)
}

.form-input-icon {
    padding-left: 38px
}

.form-input::placeholder {
    color: #94A3B8
}

select.form-input {
    appearance: none;
    cursor: pointer;
    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='%2394a3b8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px
}

textarea.form-input {
    resize: none
}

.dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 180px;
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .1);
    z-index: 500;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: all .2s ease;
    overflow: hidden
}

html.dark .dropdown-menu {
    background: #1E293B;
    border-color: #334155
}

.dropdown-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0)
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    font-size: 14px;
    color: #475569;
    cursor: pointer
}

html.dark .dropdown-item {
    color: #CBD5E1
}

.dropdown-item:hover {
    background: #F8FAFC
}

html.dark .dropdown-item:hover {
    background: #334155
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s, visibility .2s
}

.modal-backdrop.open {
    opacity: 1;
    visibility: visible
}

.modal-box {
    width: 100%;
    max-width: 480px;
    max-height: 92vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, .15);
    transform: scale(.95) translateY(10px);
    transition: transform .25s cubic-bezier(.34, 1.56, .64, 1)
}

html.dark .modal-box {
    background: #1E293B;
    border: 1px solid #334155
}

.modal-backdrop.open .modal-box {
    transform: scale(1) translateY(0)
}

.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px
}

@media(max-width:480px) {
    .toast-container {
        right: 12px;
        left: 12px
    }
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .1);
    font-size: 14px;
    font-weight: 500;
    max-width: 360px;
    animation: toastIn .3s ease
}

html.dark .toast {
    background: #1E293B;
    border-color: #334155
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(40px)
    }

    to {
        opacity: 1;
        transform: translateX(0)
    }
}

/* Toggle */
.toggle-track {
    width: 44px;
    height: 24px;
    border-radius: 99px;
    background: #CBD5E1;
    cursor: pointer;
    position: relative;
    transition: background .2s;
    flex-shrink: 0
}

html.dark .toggle-track {
    background: #475569
}

.toggle-track.on {
    background: #2563EB
}

.toggle-knob {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform .2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .15)
}

.toggle-track.on .toggle-knob {
    transform: translateX(20px)
}

/* Settings Tab */
.settings-tab {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #64748B;
    transition: all .15s;
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    font-family: inherit
}

.settings-tab:hover {
    background: #F1F5F9;
    color: #334155
}

html.dark .settings-tab:hover {
    background: #334155;
    color: #E2E8F0
}

.settings-tab.active {
    background: #EFF6FF;
    color: #2563EB;
    font-weight: 600
}

html.dark .settings-tab.active {
    background: rgba(37, 99, 235, .15);
    color: #60A5FA
}

/* Section */
.settings-section {
    display: none
}

.settings-section.active {
    display: block
}

/* Setting Row */
.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid #F1F5F9;
    gap: 16px
}

html.dark .setting-row {
    border-bottom-color: #1E293B
}

.setting-row:last-child {
    border-bottom: none
}

/* Color swatch */
.color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all .15s
}

.color-swatch:hover {
    transform: scale(1.1)
}

.color-swatch.selected {
    border-color: #1E293B;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #2563EB
}

html.dark .color-swatch.selected {
    border-color: #fff
}

/* Password strength */
.strength-bar {
    height: 4px;
    border-radius: 99px;
    background: #E2E8F0;
    overflow: hidden;
    flex: 1
}

html.dark .strength-bar {
    background: #334155
}

.strength-fill {
    height: 100%;
    border-radius: 99px;
    transition: width .3s
}

/* Plan card */
.plan-card {
    border: 2px solid #E2E8F0;
    border-radius: 14px;
    padding: 20px;
    cursor: pointer;
    transition: all .2s;
    text-align: center
}

html.dark .plan-card {
    border-color: #334155
}

.plan-card:hover {
    border-color: #93C5FD
}

.plan-card.current {
    border-color: #2563EB;
    background: #EFF6FF
}

html.dark .plan-card.current {
    background: rgba(37, 99, 235, .1);
    border-color: #3B82F6
}

/* Session item */
.session-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border-radius: 12px;
    background: #F8FAFC;
    transition: background .15s
}

html.dark .session-item {
    background: #0F172A
}

/* Danger zone */
.danger-zone {
    border: 1px solid #FECACA;
    border-radius: 14px;
    padding: 20px;
    background: #FEF2F2
}

html.dark .danger-zone {
    border-color: rgba(239, 68, 68, .2);
    background: rgba(239, 68, 68, .05)
}

@media(max-width:639px) {
    .hide-mobile {
        display: none !important
    }
}

@media(max-width:767px) {
    .hide-tablet {
        display: none !important
    }
}