:root {
    --primary: #6C5CE7;
    --primary-dark: #4B3F99;
    --primary-light: #A29BFE;
    --primary-bg: #F3F1FF;
    --green: #2ECC71;
    --green-dark: #1E7E4E;
    --green-light: #A3F7B5;
    --green-bg: #F0FFF4;
    --orange: #F39C12;
    --orange-dark: #D68910;
    --red: #E74C3C;
    --blue: #3498DB;
    --teal: #1ABC9C;
    --pink: #E91E8C;
    --bg: #F8F7FF;
    --bg-card: #FFFFFF;
    --bg-section: #F0EEFF;
    --text: #2D3436;
    --text-light: #636E72;
    --text-muted: #B2BEC3;
    --border: #E8E8F0;
    --font-size-base: 16px;
    --radius: 14px;
    --radius-sm: 10px;
    --radius-lg: 20px;
    --shadow: 0 2px 12px rgba(108, 92, 231, 0.06);
    --shadow-lg: 0 4px 20px rgba(108, 92, 231, 0.12);
    --header-height: 56px;
    --nav-height: 68px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: var(--font-size-base);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.quote-card.fade-in {
    background: #f9e0e0;
    padding: 10px !important;
    border-radius: 10px;
    font-size: 15px;
    color: #000;
    border-left: 5px solid #ef5a5a;
    margin-bottom: 15px;
}

#app {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
    background: var(--bg);
}

#app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-card);
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 16px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

#page-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    flex: 1;
}

#header-actions {
    display: flex;
    gap: 4px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text);
    font-size: 20px;
    transition: background 0.2s;
}

.btn-icon:active {
    background: var(--border);
}

#main-content {
    padding: 16px;
    padding-bottom: calc(var(--nav-height) + 32px);
    min-height: calc(100vh - var(--header-height) - var(--nav-height));
}

#bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: var(--bg-card);
    display: flex;
    justify-content: space-around;
    height: var(--nav-height);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.04);
    z-index: 100;
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

#bottom-nav::-webkit-scrollbar { display: none; }

.nav-item {
    flex: 1;
    min-width: 56px;
    max-width: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px 4px;
    transition: color 0.2s;
    min-height: 56px;
    position: relative;
}

.nav-item svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.nav-item span {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

#bottom-nav.nav-icon-only .nav-item {
    min-width: 48px;
    max-width: 60px;
}

#bottom-nav.nav-icon-only .nav-item span {
    display: none;
}

#bottom-nav.nav-label-only .nav-item {
    min-width: 52px;
    max-width: 72px;
}

#bottom-nav.nav-label-only .nav-item svg {
    display: none;
}

#bottom-nav.nav-label-only .nav-item span {
    font-size: 11px;
}

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

.nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: var(--primary);
    border-radius: 0 0 4px 4px;
}

.nav-item:active {
    transform: scale(0.95);
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
    transition: transform 0.15s;
}

.card:active {
    transform: scale(0.98);
}

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

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}

.card-subtitle {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 8px;
}

.card-body {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.6;
}

.card-footer {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.btn {
    padding: 12px 18px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    transition: opacity 0.2s, transform 0.1s;
}

.btn:active {
    transform: scale(0.97);
    opacity: 0.9;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-green {
    background: var(--green);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text);
}

.btn-danger {
    background: var(--red);
    color: white;
}

.btn-sm {
    padding: 8px 14px;
    min-height: 36px;
    font-size: 12px;
}

.btn-full {
    width: 100%;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.badge-primary {
    background: var(--primary-bg);
    color: var(--primary-dark);
}

.badge-green {
    background: var(--green-bg);
    color: var(--green-dark);
}

.badge-warning {
    background: #FFF3CD;
    color: #856404;
}

.badge-danger {
    background: #F8D7DA;
    color: #721C24;
}

.progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin: 8px 0;
}

.progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}

.progress-fill.green {
    background: linear-gradient(90deg, var(--green), var(--green-light));
}

.progress-fill.purple {
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
}

.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="number"],
input[type="search"],
textarea,
select {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    background: var(--bg);
    color: var(--text);
    outline: none;
    transition: border-color 0.2s;
    min-height: 44px;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--primary);
}

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

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 200;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    backdrop-filter: blur(4px);
}

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

.overlay.hidden {
    display: none;
}

.search-container {
    width: 100%;
    max-width: 480px;
    background: var(--bg-card);
    min-height: 100vh;
    padding: 16px;
    border-radius: 0;
}

.search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.search-bar input {
    flex: 1;
    border-radius: var(--radius);
    background: var(--bg);
}

.search-filters {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 12px;
    margin-bottom: 16px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.search-filters::-webkit-scrollbar {
    display: none;
}

.filter-btn {
    padding: 6px 14px;
    border: 1.5px solid var(--border);
    border-radius: 20px;
    background: var(--bg);
    color: var(--text-light);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 36px;
}

.filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.search-result {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}

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

.search-result h4 {
    font-size: 14px;
    margin-bottom: 4px;
}

.search-result p {
    font-size: 12px;
    color: var(--text-light);
}

.panel-container {
    width: 100%;
    max-width: 480px;
    background: var(--bg-card);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

.panel-header h2 {
    font-size: 18px;
    color: var(--primary);
}

#notification-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.notif-item {
    padding: 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    background: var(--bg);
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.notif-item.unread {
    background: var(--primary-bg);
}

.notif-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
}

.notif-content h4 {
    font-size: 14px;
    margin-bottom: 4px;
}

.notif-content p {
    font-size: 12px;
    color: var(--text-light);
}

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

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 300;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

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

.modal.hidden {
    display: none;
}

.modal-content {
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    background: var(--bg-card);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 16px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 1;
}

.modal-header h2 {
    font-size: 18px;
    color: var(--primary);
}

#modal-body {
    padding: 16px;
}

#toast-container {
    position: fixed;
    bottom: calc(var(--nav-height) + 20px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 400;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 400px;
    width: 90%;
}

.toast {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    background: var(--text);
    color: white;
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

.toast.success {
    background: var(--green);
}

.toast.error {
    background: var(--red);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

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

.fade-in {
    animation: fadeIn 0.3s ease;
}

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

.section-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
}

.section-see-all {
    font-size: 13px;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
}

.home-hero {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius-lg);
    padding: 20px;
    color: white;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.home-hero::after {
    content: '';
    position: absolute;
    top: -40%;
    right: -20%;
    width: 180px;
    height: 180px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 50%;
}

.home-hero::before {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -15%;
    width: 140px;
    height: 140px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 50%;
}

.hero-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    flex-shrink: 0;
}

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

.home-hero h2 {
    font-size: 19px;
    margin-bottom: 4px;
    position: relative;
    z-index: 1;
}

.home-hero p {
    opacity: 0.9;
    font-size: 13px;
    position: relative;
    z-index: 1;
}

.offline-banner {
    background: #FFF3CD;
    color: #856404;
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.quote-card {
    background: linear-gradient(135deg, var(--primary-bg), #FFF8E7);
    border-radius: var(--radius);
    padding: 16px 18px;
    margin-bottom: 20px;
    border-left: 4px solid var(--primary);
    position: relative;
}

.quote-card::before {
    content: '"';
    position: absolute;
    top: -8px;
    left: 12px;
    font-size: 48px;
    color: var(--primary-light);
    font-family: Georgia, serif;
    line-height: 1;
}

.quote-text {
    font-size: 14px;
    font-style: italic;
    color: var(--text);
    line-height: 1.6;
    position: relative;
    z-index: 1;
    display: block;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.15s;
}

.stat-card:active {
    transform: scale(0.97);
}

.stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

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

.stat-progress {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.stat-progress .progress-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s;
}

.quick-actions {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 24px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.quick-actions::-webkit-scrollbar {
    display: none;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    border: none;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 14px 16px;
    min-width: 76px;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: transform 0.15s;
}

.quick-action-btn:active {
    transform: scale(0.95);
}

.quick-action-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.quick-action-btn span:last-child {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-light);
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.module-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px 12px;
    text-align: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: transform 0.15s;
}

.module-card:active {
    transform: scale(0.96);
}

.module-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    font-size: 20px;
}

.module-card h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.habit-group {
    margin-bottom: 16px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.habit-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--green-dark);
    color: white;
}

.habit-group-header h3 {
    font-size: 15px;
    font-weight: 600;
}

.habit-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

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

.habit-item.completed-today {
    background: var(--green-bg);
}

.habit-check {
    width: 28px;
    height: 28px;
    border: 2px solid var(--green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    font-size: 14px;
    color: transparent;
}

.habit-check.completed {
    background: var(--green);
    border-color: var(--green);
    color: white;
}

.habit-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.habit-streak {
    font-size: 12px;
    color: var(--green);
    font-weight: 700;
}

.empty-state {
    text-align: center;
    padding: 48px 20px;
}

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

.empty-state h3 {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--text-light);
}

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

.loading {
    display: flex;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.login-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: calc(100vh - var(--header-height) - var(--nav-height));
    padding: 20px;
}

.login-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    box-shadow: var(--shadow-lg);
}

.login-card h2 {
    text-align: center;
    margin-bottom: 8px;
    color: var(--primary);
    font-size: 24px;
}

.login-card p {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 24px;
    font-size: 14px;
}

.login-error {
    background: #F8D7DA;
    color: #721C24;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 13px;
    display: none;
}

.profile-header {
    text-align: center;
    padding: 24px 0;
    margin-bottom: 8px;
}

.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 28px;
    font-weight: 700;
    color: white;
}

.profile-name {
    font-size: 18px;
    font-weight: 700;
}

.profile-email {
    font-size: 13px;
    color: var(--text-light);
}

.profile-role {
    display: inline-block;
    margin-top: 6px;
}

.profile-phone {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 4px;
}

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

.settings-group {
    margin-bottom: 24px;
}

.settings-group-title {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
    padding-left: 4px;
}

.settings-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s;
}

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

.setting-item:active {
    background: var(--bg);
}

.setting-label {
    display: flex;
    align-items: center;
    gap: 12px;
}

.setting-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.setting-text h4 {
    font-size: 14px;
    font-weight: 600;
}

.setting-text p {
    font-size: 12px;
    color: var(--text-muted);
}

.setting-arrow {
    font-size: 18px;
    color: var(--text-muted);
}

.font-size-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.font-size-control .btn {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
}

.font-size-display {
    font-size: 13px;
    font-weight: 600;
    min-width: 36px;
    text-align: center;
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--border);
    border-radius: 24px;
    transition: 0.2s;
}

.slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.2s;
}

input:checked+.slider {
    background: var(--green);
}

input:checked+.slider::before {
    transform: translateX(20px);
}

.product-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    background: var(--border);
}

.content-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.15s;
}

.content-card:active {
    transform: scale(0.98);
}

.content-card-body {
    padding: 14px 16px;
}

.content-card-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: var(--border);
}

.content-card h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.content-card p {
    font-size: 13px;
    color: var(--text-light);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.course-module {
    padding: 14px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.module-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.module-number.completed {
    background: var(--green);
}

.module-info h4 {
    font-size: 14px;
    margin-bottom: 2px;
}

.module-info p {
    font-size: 12px;
    color: var(--text-light);
}

.qa-item {
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--radius);
    margin-bottom: 12px;
    box-shadow: var(--shadow);
}

.qa-question {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--primary-dark);
}

.qa-answer {
    font-size: 14px;
    color: var(--text-light);
    padding: 12px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--green);
    line-height: 1.6;
}

.qa-status {
    font-size: 12px;
    margin-top: 10px;
}

.note-item {
    padding: 14px 16px;
    background: var(--bg-card);
    border-radius: var(--radius);
    margin-bottom: 10px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--orange);
}

.note-item h4 {
    font-size: 14px;
    margin-bottom: 4px;
}

.note-item p {
    font-size: 13px;
    color: var(--text-light);
}

.note-item .notif-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
}

.challenge-card {
    background: linear-gradient(135deg, var(--primary-bg), white);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
    border: 1.5px solid var(--primary-light);
}

.challenge-card h3 {
    font-size: 15px;
    margin-bottom: 4px;
}

.challenge-card p {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 10px;
}

.finance-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.finance-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    text-align: center;
}

.finance-card h4 {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.finance-card .amount {
    font-size: 22px;
    font-weight: 700;
}

.finance-card .amount.income {
    color: var(--green);
}

.finance-card .amount.expense {
    color: var(--red);
}

.online-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.online-status.connected {
    background: var(--green-bg);
    color: var(--green-dark);
}

.online-status.disconnected {
    background: #F8D7DA;
    color: #721C24;
}

.hidden {
    display: none !important;
}

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

.mt-8 {
    margin-top: 8px;
}

.mt-16 {
    margin-top: 16px;
}

.mt-24 {
    margin-top: 24px;
}

.mb-8 {
    margin-bottom: 8px;
}

.mb-16 {
    margin-bottom: 16px;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.posts-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    margin-bottom: 12px;
}

.posts-count {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.view-toggle {
    display: flex;
    gap: 4px;
    background: var(--bg);
    border-radius: 8px;
    padding: 4px;
}

.view-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
}

.view-toggle-btn.active {
    background: var(--bg-card);
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.post-grid-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.15s;
}

.post-grid-card:active {
    transform: scale(0.98);
}

.post-grid-image {
    width: 100%;
    height: 100px;
    background: var(--bg-section);
    overflow: hidden;
}

.post-grid-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-grid-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.post-grid-body {
    padding: 10px;
}

.post-grid-body h3 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-grid-body p {
    font-size: 11px;
    color: var(--text-light);
    margin: 0 0 8px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-grid-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.post-grid-date {
    font-size: 10px;
    color: var(--text-muted);
}

.bookmark-btn.bookmarked {
    color: var(--primary);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.category-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px 16px;
    text-align: center;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.15s;
    border: 2px solid transparent;
}

.category-card:active {
    transform: scale(0.97);
}

.category-card:hover {
    border-color: var(--primary-light);
}

.category-card-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.category-card h3 {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.category-card-count {
    font-size: 12px;
    color: var(--text-muted);
}

.single-post {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.single-post-image {
    width: 100%;
    max-height: 220px;
    overflow: hidden;
}

.single-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.single-post-header {
    padding: 20px;
}

.single-post-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.single-post-meta .badge {
    cursor: pointer;
}

.single-post-header h1 {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 8px 0;
}

.single-post-date {
    font-size: 13px;
    color: var(--text-muted);
}

.single-post-actions {
    display: flex;
    gap: 8px;
    padding: 0 20px 16px 20px;
    border-bottom: 1px solid var(--border);
}

.single-post-content {
    padding: 20px;
    font-size: var(--font-size-base);
    line-height: 1.8;
}

.single-post-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    margin: 16px 0;
}

.single-post-content h1, .single-post-content h2, .single-post-content h3, .single-post-content h4 {
    margin-top: 24px;
    margin-bottom: 12px;
    line-height: 1.3;
}

.single-post-content p {
    margin-bottom: 16px;
}

.single-post-content ul, .single-post-content ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

.single-post-content blockquote {
    border-left: 4px solid var(--primary);
    padding: 12px 16px;
    margin: 16px 0;
    background: var(--primary-bg);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.post-nav {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 0;
    margin-top: 16px;
}

.post-nav .btn {
    flex: 1;
    max-width: 48%;
}

.badge-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.badge-warning {
    background: #FFF3CD;
    color: #856404;
}

.settings-group {
    margin-bottom: 24px;
}

.settings-group-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    padding-left: 4px;
}

.settings-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s;
}

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

.setting-item:active {
    background: var(--bg-section);
}

.setting-label {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.setting-label span {
    font-size: 15px;
    font-weight: 500;
}

.setting-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.setting-text h4 {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 2px 0;
}

.setting-text p {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
}

.setting-arrow {
    font-size: 18px;
    color: var(--text-muted);
}

.btn-icon-sm {
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

@media (min-width: 481px) {
    #app {
        max-width: 720px;
        border-left: 1px solid var(--border);
        border-right: 1px solid var(--border);
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.05);
    }

    #bottom-nav {
        max-width: 720px;
    }

    .search-container {
        max-width: 720px;
    }

    .modal-content {
        max-width: 720px;
        border-radius: 16px 16px 0 0;
        max-height: 90vh;
    }

    .panel-container {
        max-width: 720px;
        max-height: 90vh;
    }

    #main-content {
        -ms-overflow-style: auto;
        scrollbar-width: thin;
    }

    #main-content::-webkit-scrollbar {
        width: 8px;
    }

    #main-content::-webkit-scrollbar-track {
        background: var(--bg);
    }

    #main-content::-webkit-scrollbar-thumb {
        background: var(--border);
        border-radius: 4px;
    }

    #main-content::-webkit-scrollbar-thumb:hover {
        background: var(--text-light);
    }

    .card, .habit-card, .challenge-card, .stat-card, .quote-card, .settings-card, .product-card, .post-card, .course-card {
        max-width: 100%;
    }
}

@media (min-width: 900px) {
    #app {
        max-width: 860px;
    }

    #bottom-nav {
        max-width: 860px;
    }

    .search-container {
        max-width: 860px;
    }

    .modal-content {
        max-width: 860px;
    }

    .panel-container {
        max-width: 860px;
    }
}