/* ========================================
   NOTER - CSS STYLES
   3D, Dynamic, Attractive, Responsive
   ======================================== */

:root {
    --primary: #6c5ce7;
    --secondary: #00cec9;
    --accent: #fd79a8;
    --bg: #0a0a1a;
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    --text: #ffffff;
    --text-dim: rgba(255, 255, 255, 0.6);
    --text-muted: rgba(255, 255, 255, 0.3);
    --success: #00b894;
    --danger: #e17055;
    --warning: #fdcb6e;
    --shadow-3d: 0 20px 60px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(108, 92, 231, 0.3);
    --glass-bg: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(255, 255, 255, 0.1);
    --radius: 16px;
    --radius-sm: 10px;
    --sidebar-width: 260px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============ LIGHT THEME ============ */
body.light-mode {
    --bg: #f0f2f5;
    --bg-card: rgba(0, 0, 0, 0.03);
    --bg-card-hover: rgba(0, 0, 0, 0.06);
    --text: #1a1a2e;
    --text-dim: rgba(26, 26, 46, 0.65);
    --text-muted: rgba(26, 26, 46, 0.35);
    --shadow-3d: 0 20px 60px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 30px rgba(108, 92, 231, 0.15);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.08);
}

body.light-mode #sidebar {
    background: rgba(255, 255, 255, 0.95);
    border-right-color: rgba(0, 0, 0, 0.08);
}
body.light-mode .top-bar {
    background: rgba(255, 255, 255, 0.85);
    border-bottom-color: rgba(0, 0, 0, 0.06);
}
body.light-mode #bottom-nav {
    background: rgba(255, 255, 255, 0.95);
    border-top-color: rgba(0, 0, 0, 0.06);
}
body.light-mode .input-wrapper {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
}
body.light-mode .input-wrapper:focus-within {
    background: rgba(0, 0, 0, 0.02);
}
body.light-mode .task-item {
    background: rgba(0, 0, 0, 0.02);
}
body.light-mode .task-item:hover {
    background: rgba(0, 0, 0, 0.04);
}
body.light-mode .expense-item {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.06);
}
body.light-mode .expense-item:hover {
    background: rgba(0, 0, 0, 0.04);
}
body.light-mode .nav-item:hover {
    background: rgba(0, 0, 0, 0.04);
}
body.light-mode .nav-item.active {
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.12), rgba(0, 206, 201, 0.08));
}
body.light-mode .btn-icon {
    background: rgba(0, 0, 0, 0.05);
}
body.light-mode .btn-icon:hover {
    background: rgba(0, 0, 0, 0.1);
}
body.light-mode .toast {
    background: rgba(255, 255, 255, 0.97);
    border-color: rgba(0, 0, 0, 0.08);
}
body.light-mode .modal-overlay {
    background: rgba(0, 0, 0, 0.3);
}
body.light-mode .history-item {
    background: rgba(0, 0, 0, 0.02);
}
body.light-mode .history-item:hover {
    background: rgba(0, 0, 0, 0.05);
}
body.light-mode .setting-input {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--text);
}
body.light-mode .btn-secondary {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.1);
}
body.light-mode .clock-card {
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.08), rgba(0, 206, 201, 0.06));
}
body.light-mode .danger-zone {
    background: rgba(225, 112, 85, 0.06);
}
body.light-mode .sidebar-user {
    border-bottom-color: rgba(0, 0, 0, 0.06);
}
body.light-mode .sidebar-header {
    border-bottom-color: rgba(0, 0, 0, 0.06);
}
body.light-mode .sidebar-footer {
    border-top-color: rgba(0, 0, 0, 0.06);
}
body.light-mode .event-card {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.06);
}
body.light-mode .countdown-unit {
    background: rgba(0, 0, 0, 0.04);
}
body.light-mode .wallet-budget-input {
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.08), rgba(0, 206, 201, 0.05));
}
body.light-mode .wallet-stat {
    background: rgba(0, 0, 0, 0.03);
}
body.light-mode .budget-row {
    border-bottom-color: rgba(0, 0, 0, 0.05);
}
body.light-mode .progress-bar-3d {
    background: rgba(0, 0, 0, 0.06);
}
body.light-mode .history-bar {
    background: rgba(0, 0, 0, 0.08);
}
body.light-mode ::-webkit-scrollbar-thumb {
    background: rgba(108, 92, 231, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

/* ============ PARTICLES BG ============ */
#particles-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ============ SCREENS ============ */
.screen {
    display: none;
    width: 100%;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}
.screen.active {
    display: flex;
}

/* ============ GLASS CARD ============ */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    max-width: 100%;
    word-wrap: break-word;
    box-sizing: border-box;
}

/* ============ 3D CARD ============ */
.card-3d {
    transition: transform var(--transition), box-shadow var(--transition);
    transform: perspective(1000px) rotateX(0) rotateY(0);
    box-shadow: var(--shadow-3d);
}
.card-3d:hover {
    transform: perspective(1000px) rotateX(2deg) rotateY(-2deg) translateY(-4px);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), var(--shadow-glow);
}

/* ============ AUTH SCREEN ============ */
.auth-container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    position: relative;
    overflow: hidden;
    max-width: 100vw;
}

.auth-3d-shape {
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    opacity: 0.15;
    animation: morphShape 15s infinite ease-in-out;
    top: -100px;
    right: -100px;
    filter: blur(40px);
}
.auth-3d-shape.shape-2 {
    background: linear-gradient(135deg, var(--accent), var(--primary));
    bottom: -100px;
    left: -100px;
    top: auto;
    right: auto;
    animation-delay: -7s;
    animation-direction: reverse;
}

@keyframes morphShape {
    0%, 100% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; transform: rotate(0deg) scale(1); }
    25% { border-radius: 58% 42% 75% 25% / 76% 46% 54% 24%; transform: rotate(90deg) scale(1.1); }
    50% { border-radius: 50% 50% 33% 67% / 55% 27% 73% 45%; transform: rotate(180deg) scale(1); }
    75% { border-radius: 33% 67% 58% 42% / 63% 68% 32% 37%; transform: rotate(270deg) scale(1.1); }
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 40px 35px;
    position: relative;
    z-index: 2;
    animation: slideUp 0.8s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-logo {
    text-align: center;
    margin-bottom: 35px;
}
.logo-icon {
    width: 70px;
    height: 70px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 28px;
    box-shadow: 0 10px 30px rgba(108, 92, 231, 0.4);
    transform: perspective(200px) rotateY(-5deg);
    transition: transform 0.5s;
}
.logo-icon:hover {
    transform: perspective(200px) rotateY(5deg) scale(1.05);
}
.logo-text {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.logo-subtitle {
    color: var(--text-dim);
    font-size: 0.85rem;
    margin-top: 5px;
}

.auth-form {
    display: none;
}
.auth-form.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

.input-group-3d {
    margin-bottom: 16px;
}
.input-wrapper {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    padding: 0 16px;
    transition: all var(--transition);
}
.input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(108, 92, 231, 0.2);
    background: rgba(255, 255, 255, 0.08);
}
.input-wrapper i {
    color: var(--text-dim);
    font-size: 0.9rem;
    width: 20px;
    transition: color var(--transition);
}
.input-wrapper:focus-within i {
    color: var(--primary);
}
.input-wrapper input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text);
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    padding: 14px 12px;
}
.input-wrapper input::placeholder {
    color: var(--text-muted);
}

/* ============ BUTTONS ============ */
.btn-3d {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}
.btn-3d::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.5s;
}
.btn-3d:hover::before {
    left: 100%;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 8px 25px rgba(108, 92, 231, 0.4);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(108, 92, 231, 0.5);
}
.btn-primary:active {
    transform: translateY(0);
}
.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
    border: 1px solid var(--glass-border);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}
.btn-danger {
    background: linear-gradient(135deg, #e17055, #d63031);
    color: white;
    box-shadow: 0 8px 25px rgba(225, 112, 85, 0.3);
}
.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(225, 112, 85, 0.4);
}
.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    flex-shrink: 0;
}
.btn-icon:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.1);
}
.btn-sm {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    color: var(--text-dim);
    font-size: 0.85rem;
}
.auth-switch a {
    color: var(--primary);
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    transition: color var(--transition);
}
.auth-switch a:hover {
    color: var(--secondary);
}

.error-msg {
    color: var(--danger);
    text-align: center;
    font-size: 0.85rem;
    margin-top: 15px;
    min-height: 20px;
}

/* ============ APP LAYOUT ============ */
#app-screen {
    display: none;
    flex-direction: row;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}
#app-screen.active {
    display: flex;
}

/* ============ SIDEBAR ============ */
#sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 26, 0.95);
    backdrop-filter: blur(30px);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    transition: transform var(--transition);
    overflow-y: auto;
}

.sidebar-header {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--glass-border);
}
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.3rem;
    font-weight: 700;
}
.sidebar-logo i {
    color: var(--primary);
    font-size: 1.5rem;
}
.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1.2rem;
    cursor: pointer;
}

.sidebar-user {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--glass-border);
}
.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.nav-menu {
    list-style: none;
    padding: 16px 12px;
    flex: 1;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    margin-bottom: 4px;
    color: var(--text-dim);
    font-weight: 500;
}
.nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
}
.nav-item.active {
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.2), rgba(0, 206, 201, 0.1));
    color: var(--primary);
}
.nav-item.active i {
    color: var(--primary);
}
.nav-indicator {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
    transition: height var(--transition);
}
.nav-item.active .nav-indicator {
    height: 60%;
}
.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 1.05rem;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid var(--glass-border);
}
.btn-logout {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: var(--radius-sm);
    background: rgba(225, 112, 85, 0.1);
    color: var(--danger);
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}
.btn-logout:hover {
    background: rgba(225, 112, 85, 0.2);
}

/* ============ MAIN CONTENT ============ */
#main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left var(--transition);
    overflow-x: hidden;
    min-width: 0;
}

.top-bar {
    padding: 16px 30px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(10, 10, 26, 0.6);
    backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 50;
}
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.3rem;
    cursor: pointer;
}
.top-bar-title {
    font-size: 1.2rem;
    font-weight: 700;
    flex: 1;
}
.top-bar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}
.top-bar-clock {
    font-size: 0.9rem;
    color: var(--text-dim);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

/* Theme Toggle */
.theme-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    outline: none;
}
.theme-toggle-track {
    width: 56px;
    height: 30px;
    border-radius: 15px;
    background: linear-gradient(135deg, #1a1a2e, #2d2d5e);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 7px;
    transition: background 0.4s ease;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3);
}
body.light-mode .theme-toggle-track {
    background: linear-gradient(135deg, #87ceeb, #ffd700);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.1);
}
.theme-icon-dark,
.theme-icon-light {
    font-size: 0.7rem;
    z-index: 1;
    transition: opacity 0.3s, color 0.3s;
}
.theme-icon-dark {
    color: #a0a0ff;
    opacity: 1;
}
.theme-icon-light {
    color: #ffd700;
    opacity: 0.4;
}
body.light-mode .theme-icon-dark {
    opacity: 0.4;
    color: #7a7aaa;
}
body.light-mode .theme-icon-light {
    opacity: 1;
    color: #ff8c00;
}
.theme-toggle-thumb {
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    top: 3px;
    left: 3px;
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55), background 0.4s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
body.light-mode .theme-toggle-thumb {
    transform: translateX(26px);
    background: linear-gradient(135deg, #ff8c00, #ffd700);
    box-shadow: 0 2px 8px rgba(255, 140, 0, 0.4);
}

/* ============ PAGES ============ */
.page {
    display: none;
    padding: 30px;
    animation: pageIn 0.4s ease;
    flex: 1;
    overflow-x: hidden;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}
.page.active {
    display: block;
}

@keyframes pageIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ============ HOME PAGE ============ */
.home-clock-section {
    margin-bottom: 30px;
}
.clock-card {
    padding: 30px;
    text-align: center;
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.15), rgba(0, 206, 201, 0.1));
}
.clock-date {
    font-size: 1.1rem;
    color: var(--text-dim);
    margin-bottom: 16px;
    font-weight: 500;
    letter-spacing: 1px;
}
.clock-time-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.clock-digit-group {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.clock-digit {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    transition: transform 0.3s;
}
.clock-digit.tick {
    animation: digitTick 0.3s ease;
}
@keyframes digitTick {
    0% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-4px) scale(1.05); }
    100% { transform: translateY(0) scale(1); }
}
.clock-sep {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary);
    animation: blink 1s infinite;
    line-height: 1;
    margin-top: -20px;
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
.clock-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 6px;
}

.home-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.home-planner-card {
    grid-column: 1 / -1;
    padding: 24px;
}
.home-stats-card {
    padding: 24px;
}
.home-stats-card canvas {
    width: 100% !important;
    max-width: 100%;
    height: auto;
}
.home-wallet-card {
    padding: 24px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}
.card-header h3 i {
    color: var(--primary);
}

.badge {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.home-tasks-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 16px;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    margin-bottom: 8px;
    transition: all var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.task-item:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(4px);
}
.task-item.completed {
    opacity: 0.6;
}
.task-item.completed .task-text {
    text-decoration: line-through;
    color: var(--text-dim);
}
.task-item.completing {
    animation: completeTask 0.6s ease forwards;
}
@keyframes completeTask {
    0% { background: rgba(255, 255, 255, 0.03); }
    50% { background: rgba(0, 184, 148, 0.2); transform: scale(1.02); }
    100% { background: rgba(255, 255, 255, 0.03); opacity: 0.6; }
}

.task-checkbox {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
}
.task-checkbox.checked {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-color: transparent;
    animation: checkPop 0.4s ease;
}
@keyframes checkPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}
.task-checkbox.checked i {
    color: white;
    font-size: 0.7rem;
}
.task-text {
    flex: 1;
    font-size: 0.9rem;
    min-width: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.task-delete {
    opacity: 0;
    transition: opacity var(--transition);
    color: var(--danger);
    cursor: pointer;
    font-size: 0.85rem;
}
.task-item:hover .task-delete {
    opacity: 1;
}

.card-footer {
    margin-top: 10px;
}
.progress-bar-3d {
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 4px;
    transition: width 0.5s ease;
    position: relative;
    width: 0%;
}
.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}
@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.wallet-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}
.wallet-stat {
    text-align: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-sm);
}
.wallet-stat-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}
.wallet-stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
}
.wallet-stat-value.spent {
    color: var(--danger);
}
.wallet-stat-value.remaining {
    color: var(--success);
}

/* ============ PLANNER PAGE ============ */
.planner-header {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.planner-date-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    flex: 1;
}
.planner-current-date {
    flex: 1;
    text-align: center;
    font-weight: 600;
    font-size: 1rem;
    min-width: 0;
}
.planner-stats {
    display: flex;
    gap: 20px;
    padding: 12px 24px;
}
.stat-item {
    text-align: center;
}
.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.planner-add {
    display: flex;
    gap: 12px;
    padding: 16px;
    margin-bottom: 20px;
}
.planner-add .input-wrapper {
    flex: 1;
}

.planner-tasks-list {
    margin-bottom: 24px;
}

.planner-history .card-header {
    margin-bottom: 0;
    padding: 20px 24px;
}
.history-list {
    padding: 0 24px 20px;
    max-height: 400px;
    overflow-y: auto;
    transition: all var(--transition);
}
.history-list.collapsed {
    max-height: 0;
    padding-bottom: 0;
    overflow: hidden;
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    margin-bottom: 8px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: all var(--transition);
}
.history-item:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(4px);
}
.history-date {
    font-weight: 600;
    font-size: 0.9rem;
}
.history-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-dim);
}
.history-bar {
    width: 60px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}
.history-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 2px;
}

/* ============ WALLET PAGE ============ */
.wallet-header {
    margin-bottom: 24px;
}
.wallet-month-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
}
.wallet-current-month {
    flex: 1;
    text-align: center;
    font-weight: 600;
    font-size: 1.1rem;
    min-width: 0;
}

/* Budget Input Section */
.wallet-budget-input {
    padding: 24px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.12), rgba(0, 206, 201, 0.08));
}
.budget-input-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.budget-input-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 0.95rem;
}
.budget-input-label i {
    color: var(--primary);
    font-size: 1.1rem;
}
.budget-input-row {
    display: flex;
    gap: 12px;
    align-items: center;
}
.budget-input-row .input-wrapper {
    flex: 1;
}
.budget-input-row .input-wrapper input {
    font-size: 1.1rem;
    font-weight: 600;
}
.budget-highlight span:last-child {
    color: var(--primary);
    font-size: 1.05rem;
}

.wallet-overview {
    margin-bottom: 24px;
}
.wallet-budget-card {
    display: flex;
    align-items: center;
    gap: 30px;
    padding: 30px;
    flex-wrap: wrap;
}
.budget-circle {
    width: 140px;
    height: 140px;
    position: relative;
    flex-shrink: 0;
}
.budget-circle svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}
.budget-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.06);
    stroke-width: 8;
}
.budget-fill {
    fill: none;
    stroke: url(#budgetGradient);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 339.292;
    stroke-dashoffset: 339.292;
    transition: stroke-dashoffset 1s ease;
    filter: drop-shadow(0 0 6px rgba(108, 92, 231, 0.4));
}
.budget-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}
.budget-center span {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.budget-info {
    flex: 1;
    min-width: 200px;
}
.budget-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
    gap: 8px;
    flex-wrap: wrap;
}
.budget-row span:first-child {
    color: var(--text-dim);
}
.budget-row span:last-child {
    font-weight: 600;
}
.budget-row.spent span:last-child {
    color: var(--danger);
}
.budget-row.remaining span:last-child {
    color: var(--success);
}
.editable-budget {
    cursor: pointer;
    color: var(--primary) !important;
    transition: all var(--transition);
}
.editable-budget:hover {
    text-decoration: underline;
}

.wallet-add {
    padding: 16px;
    margin-bottom: 20px;
}
.wallet-add-row {
    display: flex;
    gap: 12px;
    align-items: center;
}
.wallet-add-row .input-wrapper {
    flex: 2;
}
.input-small {
    flex: 1 !important;
    min-width: 100px;
}

.wallet-expenses-list {
    margin-bottom: 24px;
}

.expense-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    margin-bottom: 8px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    transition: all var(--transition);
}
.expense-item:hover {
    background: var(--bg-card-hover);
    transform: translateX(4px);
}
.expense-item.paid {
    opacity: 0.5;
}
.expense-item.paid .expense-desc {
    text-decoration: line-through;
}
.expense-desc {
    flex: 1;
    font-size: 0.9rem;
    min-width: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.expense-amount {
    font-weight: 700;
    color: var(--danger);
    font-size: 0.95rem;
}
.expense-item.paid .expense-amount {
    color: var(--success);
}

/* ============ EVENTS PAGE ============ */
.events-header {
    margin-bottom: 24px;
}
.events-title {
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}
.events-title i {
    color: var(--primary);
}

.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.event-card {
    padding: 24px;
    border-radius: var(--radius);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}
.event-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}
.event-card:hover {
    transform: perspective(1000px) rotateX(3deg) translateY(-6px);
    box-shadow: var(--shadow-3d), var(--shadow-glow);
}
.event-card.nearest {
    border-color: var(--primary);
    box-shadow: 0 0 30px rgba(108, 92, 231, 0.2);
}
.event-card.nearest::before {
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.event-icon {
    font-size: 2rem;
    margin-bottom: 12px;
}
.event-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
}
.event-date-display {
    color: var(--text-dim);
    font-size: 0.85rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.event-countdown {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.countdown-unit {
    background: rgba(255, 255, 255, 0.06);
    padding: 6px 12px;
    border-radius: 8px;
    text-align: center;
    min-width: 55px;
}
.countdown-num {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}
.countdown-label {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ============ SETTINGS PAGE ============ */
.settings-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
.settings-section {
    padding: 28px;
}
.settings-section h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.settings-section h3 i {
    color: var(--primary);
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.setting-row label {
    font-size: 0.9rem;
    color: var(--text-dim);
}
.setting-input {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text);
    font-family: 'Poppins', sans-serif;
    padding: 8px 14px;
    font-size: 0.85rem;
    outline: none;
    width: 180px;
    transition: border-color var(--transition);
}
.setting-input:focus {
    border-color: var(--primary);
}

.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}
.color-picker-wrapper input[type="color"] {
    -webkit-appearance: none;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    background: none;
    padding: 0;
}
.color-picker-wrapper input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 2px;
}
.color-picker-wrapper input[type="color"]::-webkit-color-swatch {
    border: 2px solid var(--glass-border);
    border-radius: 50%;
}

.account-info {
    margin-bottom: 24px;
}
.account-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.account-label {
    color: var(--text-dim);
    font-size: 0.85rem;
}
.account-value {
    font-weight: 600;
    font-size: 0.9rem;
}

.danger-zone {
    margin-top: 20px;
    padding: 20px;
    border: 1px solid rgba(225, 112, 85, 0.3);
    border-radius: var(--radius-sm);
    background: rgba(225, 112, 85, 0.05);
}
.danger-zone h4 {
    color: var(--danger);
    margin-bottom: 8px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.danger-zone p {
    color: var(--text-dim);
    font-size: 0.8rem;
    margin-bottom: 16px;
}
.danger-zone .input-wrapper {
    margin-bottom: 12px;
}

/* ============ BOTTOM NAV ============ */
#bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(10, 10, 26, 0.95);
    backdrop-filter: blur(30px);
    border-top: 1px solid var(--glass-border);
    padding: 8px 0;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
}
.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.65rem;
    transition: all var(--transition);
    padding: 8px 12px;
    position: relative;
    min-width: 56px;
    -webkit-tap-highlight-color: transparent;
}
.bottom-nav-item i {
    font-size: 1.2rem;
    transition: all var(--transition);
}
.bottom-nav-item.active {
    color: var(--primary);
}
.bottom-nav-item.active i {
    transform: translateY(-2px) scale(1.1);
}
.bottom-nav-item.active::before {
    content: '';
    position: absolute;
    top: -8px;
    width: 30px;
    height: 3px;
    background: var(--primary);
    border-radius: 0 0 3px 3px;
}

/* ============ MODAL ============ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeInBg 0.3s ease;
}
.modal-overlay.active {
    display: flex;
}
@keyframes fadeInBg {
    from { opacity: 0; }
    to { opacity: 1; }
}
.modal-card {
    width: 100%;
    max-width: 440px;
    padding: 24px;
    animation: modalIn 0.4s ease;
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}
.modal-body {
    max-height: 60vh;
    overflow-y: auto;
}
.modal-body .input-wrapper {
    margin-bottom: 12px;
}
.modal-body .btn-3d {
    width: 100%;
    margin-top: 12px;
}

/* ============ TOAST ============ */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast {
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    background: rgba(10, 10, 26, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastIn 0.4s ease;
    box-shadow: var(--shadow-3d);
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--primary); }
.toast.removing {
    animation: toastOut 0.3s ease forwards;
}
@keyframes toastIn {
    from { opacity: 0; transform: translateX(100px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(100px); }
}

/* ============ CONFETTI ============ */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
}

/* ============ EMPTY STATE ============ */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}
.empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.3;
}
.empty-state p {
    font-size: 0.9rem;
}

/* ============ LOADING ============ */
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
}
.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--glass-border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
    .settings-sections {
        grid-template-columns: 1fr;
    }
    .home-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    /* Sidebar */
    #sidebar {
        transform: translateX(-100%);
        width: 280px;
    }
    #sidebar.open {
        transform: translateX(0);
    }
    .sidebar-close {
        display: block;
    }

    /* Main Content */
    #app-screen {
        width: 100vw !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }
    #main-content {
        margin-left: 0;
        width: 100vw !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }
    .menu-toggle {
        display: block;
    }

    /* Bottom Nav */
    #bottom-nav {
        display: flex;
        justify-content: space-around;
    }

    /* Pages - force fit mobile screen */
    .page {
        padding: 14px 10px !important;
        padding-bottom: 90px !important;
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }
    .page > * {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    .page .glass-card,
    .page .card-3d {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Top Bar */
    .top-bar {
        padding: 10px 10px;
        gap: 8px;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .top-bar-title {
        font-size: 0.9rem;
    }
    .top-bar-right {
        gap: 8px;
        flex-shrink: 0;
    }
    .top-bar-clock {
        font-size: 0.7rem;
    }
    .theme-toggle-track {
        width: 40px;
        height: 22px;
        border-radius: 11px;
        padding: 0 5px;
    }
    .theme-toggle-thumb {
        width: 16px;
        height: 16px;
        top: 3px;
        left: 3px;
    }
    body.light-mode .theme-toggle-thumb {
        transform: translateX(18px);
    }
    .theme-icon-dark,
    .theme-icon-light {
        font-size: 0.5rem;
    }

    /* Clock */
    .clock-card {
        padding: 20px 14px;
    }
    .clock-date {
        font-size: 0.85rem;
        margin-bottom: 12px;
    }
    .clock-time-wrapper {
        gap: 4px;
    }
    .clock-digit {
        font-size: 2.2rem;
    }
    .clock-sep {
        font-size: 1.8rem;
        margin-top: -14px;
    }
    .clock-label {
        font-size: 0.55rem;
        letter-spacing: 1px;
    }

    /* Home Grid */
    .home-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .home-planner-card,
    .home-stats-card,
    .home-wallet-card {
        padding: 18px 14px;
    }
    .card-header h3 {
        font-size: 0.9rem;
    }
    .wallet-summary-grid {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 8px;
    }
    .wallet-stat {
        padding: 10px 6px;
    }
    .wallet-stat-label {
        font-size: 0.6rem;
    }
    .wallet-stat-value {
        font-size: 0.95rem;
    }

    /* Planner */
    .planner-header {
        flex-direction: column;
        gap: 10px;
    }
    .planner-date-nav {
        padding: 10px 14px;
    }
    .planner-current-date {
        font-size: 0.78rem;
        word-wrap: break-word;
        line-height: 1.3;
    }
    .planner-stats {
        gap: 16px;
        padding: 10px 16px;
        justify-content: center;
    }
    .stat-number {
        font-size: 1.3rem;
    }
    .planner-add {
        padding: 12px;
        gap: 8px;
    }
    .planner-add .input-wrapper input {
        font-size: 0.85rem;
        padding: 12px 10px;
    }
    .planner-add .btn-3d {
        padding: 12px 16px;
    }
    .task-item {
        padding: 10px 12px;
        gap: 10px;
    }
    .task-text {
        font-size: 0.85rem;
    }
    .task-checkbox {
        width: 22px;
        height: 22px;
    }
    .task-delete {
        opacity: 0.6;
        font-size: 0.8rem;
    }
    .planner-history {
        margin-top: 16px;
    }
    .planner-history .card-header {
        padding: 16px;
    }
    .history-list {
        padding: 0 16px 16px;
    }
    .history-item {
        padding: 10px 12px;
    }
    .history-date {
        font-size: 0.8rem;
    }

    /* Wallet */
    .wallet-budget-input {
        padding: 16px 14px;
    }
    .budget-input-label {
        font-size: 0.85rem;
    }
    .budget-input-row {
        flex-wrap: wrap;
        gap: 10px;
    }
    .budget-input-row .input-wrapper {
        flex-basis: 100%;
    }
    .budget-input-row .btn-3d {
        width: 100%;
        justify-content: center;
    }
    .wallet-month-nav {
        max-width: 100%;
        padding: 10px 14px;
    }
    .wallet-current-month {
        font-size: 0.85rem;
        word-wrap: break-word;
    }
    .wallet-budget-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 20px 14px;
        gap: 20px;
    }
    .budget-circle {
        width: 120px;
        height: 120px;
    }
    .budget-center span {
        font-size: 1.3rem;
    }
    .budget-info {
        width: 100%;
    }
    .budget-row {
        font-size: 0.8rem;
        padding: 8px 0;
    }
    .wallet-add {
        padding: 12px;
    }
    .wallet-add-row {
        flex-wrap: wrap;
        gap: 10px;
    }
    .wallet-add-row .input-wrapper:first-child {
        flex-basis: 100%;
    }
    .wallet-add-row .input-small {
        flex: 1;
        min-width: 0;
    }
    .wallet-add-row .btn-3d {
        padding: 12px 18px;
    }
    .expense-item {
        padding: 12px;
        gap: 10px;
    }
    .expense-desc {
        font-size: 0.82rem;
    }
    .expense-amount {
        font-size: 0.82rem;
    }

    /* Events */
    .events-header {
        margin-bottom: 16px;
    }
    .events-title {
        font-size: 1.05rem;
    }
    .events-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .event-card {
        padding: 18px 14px;
    }
    .event-icon {
        font-size: 1.6rem;
        margin-bottom: 8px;
    }
    .event-name {
        font-size: 0.95rem;
    }
    .event-date-display {
        font-size: 0.78rem;
        margin-bottom: 10px;
    }
    .event-countdown {
        gap: 6px;
    }
    .countdown-unit {
        padding: 5px 8px;
        min-width: 48px;
    }
    .countdown-num {
        font-size: 0.95rem;
    }
    .countdown-label {
        font-size: 0.5rem;
    }

    /* Settings */
    .settings-sections {
        gap: 16px;
    }
    .settings-section {
        padding: 20px 14px;
    }
    .settings-section h3 {
        font-size: 1rem;
        margin-bottom: 18px;
    }
    .setting-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 12px 0;
    }
    .setting-input {
        width: 100%;
    }
    .color-picker-wrapper {
        width: 100%;
    }
    .account-row {
        flex-direction: column;
        gap: 4px;
        padding: 10px 0;
    }
    .danger-zone {
        padding: 16px;
    }
    .danger-zone .btn-3d {
        width: 100%;
        justify-content: center;
    }

    /* Auth */
    .auth-card {
        padding: 30px 20px;
        margin: 0 10px;
    }
    .logo-icon {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }
    .logo-text {
        font-size: 1.7rem;
    }
    .btn-3d {
        padding: 12px 20px;
        font-size: 0.9rem;
    }

    /* Modal */
    .modal-card {
        margin: 16px;
        padding: 20px;
    }

    /* Toast */
    #toast-container {
        top: auto;
        bottom: 80px;
        right: 10px;
        left: 10px;
    }
    .toast {
        font-size: 0.8rem;
        padding: 12px 16px;
    }

    /* Cards 3D - disable on mobile completely */
    .card-3d {
        transform: none !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    }
    .card-3d:hover {
        transform: none !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    }
}

@media (max-width: 400px) {

    /* ---- Global ---- */
    .page {
        padding: 8px 6px !important;
        padding-bottom: 80px !important;
    }
    .page > * {
        max-width: 100% !important;
    }

    /* ---- Top Bar ---- */
    .top-bar {
        padding: 8px 6px !important;
        gap: 6px !important;
    }
    .menu-toggle {
        font-size: 1.1rem;
    }
    .top-bar-title {
        font-size: 0.8rem !important;
    }
    .top-bar-clock {
        display: none;
    }
    .top-bar-right {
        gap: 4px;
    }
    .theme-toggle-track {
        width: 36px !important;
        height: 20px !important;
        border-radius: 10px !important;
        padding: 0 4px !important;
    }
    .theme-toggle-thumb {
        width: 14px !important;
        height: 14px !important;
        top: 3px !important;
        left: 3px !important;
    }
    body.light-mode .theme-toggle-thumb {
        transform: translateX(16px) !important;
    }
    .theme-icon-dark,
    .theme-icon-light {
        font-size: 0.45rem !important;
    }

    /* ---- Home Clock ---- */
    .clock-card {
        padding: 14px 8px;
    }
    .clock-date {
        font-size: 0.72rem;
        margin-bottom: 8px;
    }
    .clock-time-wrapper {
        gap: 2px;
    }
    .clock-digit {
        font-size: 1.5rem;
    }
    .clock-sep {
        font-size: 1.1rem;
        margin-top: -10px;
    }
    .clock-label {
        font-size: 0.45rem;
        letter-spacing: 0.5px;
    }

    /* ---- Home Cards ---- */
    .home-grid {
        gap: 10px;
    }
    .home-planner-card,
    .home-stats-card,
    .home-wallet-card {
        padding: 12px 8px;
    }
    .card-header h3 {
        font-size: 0.75rem;
    }
    .badge {
        font-size: 0.6rem;
        padding: 2px 6px;
    }
    .wallet-summary-grid {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    .wallet-stat {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 6px 10px;
    }
    .wallet-stat-label {
        margin-bottom: 0;
        font-size: 0.55rem;
    }
    .wallet-stat-value {
        font-size: 0.85rem !important;
    }

    /* ---- Planner ---- */
    .planner-header {
        gap: 8px;
    }
    .planner-date-nav {
        padding: 8px 6px !important;
        gap: 4px !important;
    }
    .planner-date-nav .btn-icon {
        width: 28px !important;
        height: 28px !important;
        font-size: 0.7rem;
    }
    .planner-current-date {
        font-size: 0.68rem !important;
        line-height: 1.2;
    }
    .planner-stats {
        padding: 8px 10px !important;
        gap: 12px !important;
    }
    .stat-number {
        font-size: 1rem;
    }
    .stat-label {
        font-size: 0.5rem;
    }
    .planner-add {
        padding: 8px 6px !important;
        gap: 6px !important;
    }
    .planner-add .input-wrapper {
        padding: 0 8px;
    }
    .planner-add .input-wrapper input {
        font-size: 0.75rem !important;
        padding: 10px 6px !important;
    }
    .planner-add .btn-3d {
        padding: 10px 10px !important;
        font-size: 0.8rem !important;
    }
    .task-item {
        padding: 8px 6px;
        gap: 6px;
    }
    .task-checkbox {
        width: 20px;
        height: 20px;
    }
    .task-checkbox.checked i {
        font-size: 0.6rem;
    }
    .task-text {
        font-size: 0.75rem !important;
    }
    .task-delete {
        font-size: 0.7rem;
    }
    .planner-history .card-header {
        padding: 12px 8px;
    }
    .planner-history .card-header h3 {
        font-size: 0.75rem;
    }
    .history-list {
        padding: 0 8px 10px;
    }
    .history-item {
        padding: 8px 6px;
        gap: 6px;
    }
    .history-date {
        font-size: 0.7rem;
    }
    .history-stats {
        font-size: 0.65rem;
    }
    .history-bar {
        width: 40px;
    }
    .empty-state {
        padding: 24px 10px;
    }
    .empty-state i {
        font-size: 2rem;
    }
    .empty-state p {
        font-size: 0.75rem;
    }

    /* ---- Wallet ---- */
    .wallet-header {
        margin-bottom: 12px;
    }
    .wallet-month-nav {
        padding: 8px 6px !important;
        gap: 4px !important;
    }
    .wallet-month-nav .btn-icon {
        width: 28px !important;
        height: 28px !important;
        font-size: 0.7rem;
    }
    .wallet-current-month {
        font-size: 0.78rem !important;
    }
    .wallet-budget-input {
        padding: 12px 8px !important;
    }
    .budget-input-label {
        font-size: 0.72rem !important;
        gap: 6px;
    }
    .budget-input-label i {
        font-size: 0.9rem;
    }
    .budget-input-row {
        gap: 8px !important;
    }
    .budget-input-row .input-wrapper {
        padding: 0 8px;
    }
    .budget-input-row .input-wrapper input {
        font-size: 0.82rem !important;
        padding: 10px 6px;
    }
    .budget-input-row .btn-3d {
        padding: 10px 12px !important;
        font-size: 0.8rem !important;
    }
    .wallet-budget-card {
        padding: 14px 8px !important;
        gap: 12px !important;
    }
    .budget-circle {
        width: 90px !important;
        height: 90px !important;
    }
    .budget-center span {
        font-size: 1rem !important;
    }
    .budget-row {
        font-size: 0.72rem !important;
        padding: 6px 0;
    }
    .wallet-add {
        padding: 8px 6px !important;
    }
    .wallet-add-row {
        gap: 8px !important;
    }
    .wallet-add-row .input-wrapper {
        padding: 0 8px;
    }
    .wallet-add-row .input-wrapper input {
        font-size: 0.75rem;
        padding: 10px 6px;
    }
    .wallet-add-row .btn-3d {
        padding: 10px 12px !important;
        font-size: 0.8rem !important;
    }
    .expense-item {
        padding: 8px 6px !important;
        gap: 6px !important;
    }
    .expense-desc {
        font-size: 0.72rem !important;
    }
    .expense-amount {
        font-size: 0.72rem !important;
    }
    .wallet-history .card-header {
        padding: 12px 8px;
    }

    /* ---- Events ---- */
    .events-title {
        font-size: 0.9rem;
    }
    .event-card {
        padding: 12px 8px;
    }
    .event-icon {
        font-size: 1.3rem;
        margin-bottom: 6px;
    }
    .event-name {
        font-size: 0.8rem;
    }
    .event-date-display {
        font-size: 0.68rem;
        margin-bottom: 8px;
    }
    .event-countdown {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr 1fr;
        gap: 4px;
    }
    .countdown-unit {
        min-width: auto;
        padding: 4px 2px;
    }
    .countdown-num {
        font-size: 0.82rem;
    }
    .countdown-label {
        font-size: 0.4rem;
    }

    /* ---- Settings ---- */
    .settings-section {
        padding: 14px 8px;
    }
    .settings-section h3 {
        font-size: 0.88rem;
    }
    .setting-row label {
        font-size: 0.78rem;
    }

    /* ---- Auth ---- */
    .auth-card {
        padding: 24px 14px;
    }
    .logo-icon {
        width: 54px;
        height: 54px;
        font-size: 22px;
    }
    .logo-text {
        font-size: 1.5rem;
    }
    .btn-3d {
        padding: 11px 16px;
        font-size: 0.82rem;
    }
    .input-wrapper {
        padding: 0 10px;
    }
    .input-wrapper input {
        padding: 10px 8px;
        font-size: 0.8rem;
    }

    /* ---- Bottom Nav ---- */
    #bottom-nav {
        padding: 6px 0;
    }
    .bottom-nav-item {
        font-size: 0.55rem;
        padding: 6px 4px;
        min-width: auto;
    }
    .bottom-nav-item i {
        font-size: 1rem;
    }

    /* ---- Modal ---- */
    .modal-card {
        margin: 10px;
        padding: 16px;
    }
}

/* ============ ADMIN SECRET BUTTON ============ */
.admin-secret-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.12);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    transition: all 0.3s;
}
.admin-secret-btn:hover {
    background: rgba(108, 92, 231, 0.15);
    color: var(--primary);
}

/* ============ ADMIN PANEL ============ */
.admin-container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 30px 20px;
    min-height: 100vh;
}
.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.admin-title {
    display: flex;
    align-items: center;
    gap: 12px;
}
.admin-title i {
    color: var(--primary);
    font-size: 1.4rem;
}
.admin-title h2 {
    font-size: 1.3rem;
    font-weight: 700;
}
.admin-stats-row {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.admin-stat-card {
    flex: 1;
    min-width: 120px;
    padding: 16px;
    border-radius: var(--radius-sm);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    text-align: center;
}
.admin-stat-card .stat-number {
    font-size: 1.5rem;
    display: block;
}
.admin-stat-card .stat-label {
    font-size: 0.7rem;
    color: var(--text-dim);
}
.admin-table-wrapper {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.admin-table thead {
    background: rgba(108, 92, 231, 0.1);
}
.admin-table th {
    padding: 14px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dim);
    white-space: nowrap;
}
.admin-table td {
    padding: 12px;
    border-top: 1px solid var(--glass-border);
    vertical-align: middle;
}
.admin-table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}
.admin-table .user-email {
    font-size: 0.78rem;
    color: var(--text-dim);
    word-break: break-all;
}
.admin-table .user-password {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.admin-table .pass-hidden {
    font-family: monospace;
    font-size: 0.8rem;
    letter-spacing: 2px;
    color: var(--text-dim);
}
.btn-pass-reveal {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 0.72rem;
    transition: color 0.2s;
}
.btn-pass-reveal:hover {
    color: var(--primary);
}
.admin-table .status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-block;
}
.status-badge.active {
    background: rgba(0, 184, 148, 0.15);
    color: var(--success);
}
.status-badge.disabled {
    background: rgba(225, 112, 85, 0.15);
    color: var(--danger);
}
.admin-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.admin-actions button {
    padding: 6px 10px;
    border: none;
    border-radius: 6px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}
.btn-admin-edit {
    background: rgba(108, 92, 231, 0.15);
    color: var(--primary);
}
.btn-admin-edit:hover {
    background: rgba(108, 92, 231, 0.3);
}
.btn-admin-toggle {
    background: rgba(253, 203, 110, 0.15);
    color: var(--warning);
}
.btn-admin-toggle:hover {
    background: rgba(253, 203, 110, 0.3);
}
.btn-admin-delete {
    background: rgba(225, 112, 85, 0.15);
    color: var(--danger);
}
.btn-admin-delete:hover {
    background: rgba(225, 112, 85, 0.3);
}

@media (max-width: 768px) {
    .admin-container {
        padding: 16px 10px;
    }
    .admin-title h2 {
        font-size: 1rem;
    }
    .admin-table {
        font-size: 0.75rem;
    }
    .admin-table th, .admin-table td {
        padding: 10px 8px;
    }
    .admin-actions {
        flex-direction: column;
    }
    .admin-actions button {
        font-size: 0.65rem;
        padding: 5px 8px;
    }
}

/* ============ SIDEBAR OVERLAY (Mobile) ============ */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
}
.sidebar-overlay.active {
    display: block;
}

/* ============ MISC ANIMATIONS ============ */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}
