* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary: #4F46E5;
    --primary-light: #818CF8;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --text: #1E293B;
    --text-light: #64748B;
    --bg: #F8FAFC;
    --card: #FFFFFF;
    --border: #E2E8F0;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

#app {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

.screen {
    display: none;
    width: 100%;
    height: 100%;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

/* Login Screen */
.login-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(135deg, var(--primary) 0%, #7C3AED 100%);
}

.login-logo {
    text-align: center;
    margin-bottom: 48px;
}

.logo-icon {
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 28px;
    font-weight: bold;
    color: var(--primary);
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.login-logo h1 {
    color: white;
    font-size: 24px;
    margin-bottom: 8px;
}

.login-logo p {
    color: rgba(255,255,255,0.8);
    font-size: 14px;
}

.login-form {
    background: white;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-full {
    width: 100%;
}

/* App Header */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    padding-top: calc(16px + var(--safe-top));
    background: white;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-title {
    font-size: 20px;
    font-weight: 700;
}

.sync-status {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #ECFDF5;
    border-radius: 20px;
    font-size: 12px;
    color: var(--success);
}

.sync-status.offline {
    background: #FEF3C7;
    color: var(--warning);
}

.sync-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
}

.sync-dot.offline {
    background: var(--warning);
}

.sync-time {
    font-size: 10px;
    color: var(--text-light);
    margin-left: 4px;
}

/* App Content */
.app-content {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 90px;
}

.app-content,
.day-events,
.modal-content {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.app-content::-webkit-scrollbar,
.day-events::-webkit-scrollbar,
.modal-content::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.view {
    display: none;
    padding: 12px;
    min-height: calc(100vh - 140px);
}

.view.active {
    display: flex;
    flex-direction: column;
}

#calendar-view.active {
    padding-bottom: 90px;
    min-height: auto;
}

/* Dashboard Header */
.dashboard-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 4px 0;
}

.header-avatar {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary) 0%, #7C3AED 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
}

.header-greeting {
    flex: 1;
    min-width: 0;
}

.dashboard-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 2px;
}

.dashboard-subtitle {
    font-size: 14px;
    color: var(--text-light);
}

.header-action {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    border: none;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    flex-shrink: 0;
}

.header-action:active {
    transform: scale(0.95);
    background: var(--border);
}

.header-action svg {
    width: 24px;
    height: 24px;
    color: var(--text);
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    padding: 18px 16px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.stat-card:active {
    transform: scale(0.96);
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.stat-card.primary { position: relative; }
.stat-card.primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--primary) 0%, #7C3AED 100%);
    border-radius: 4px 0 0 4px;
}

.stat-card.success { position: relative; }
.stat-card.success::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--success) 0%, #059669 100%);
    border-radius: 4px 0 0 4px;
}

.stat-card.warning { position: relative; }
.stat-card.warning::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--warning) 0%, #D97706 100%);
    border-radius: 4px 0 0 4px;
}

.stat-card.purple { position: relative; }
.stat-card.purple::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #A855F7 0%, #7C3AED 100%);
    border-radius: 4px 0 0 4px;
}

.stat-icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-card.primary .stat-icon-wrapper { background: #EEF2FF; color: var(--primary); }
.stat-card.success .stat-icon-wrapper { background: #ECFDF5; color: var(--success); }
.stat-card.warning .stat-icon-wrapper { background: #FEF3C7; color: var(--warning); }
.stat-card.purple .stat-icon-wrapper { background: #FDF4FF; color: #A855F7; }

.stat-icon-wrapper svg {
    width: 24px;
    height: 24px;
}

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-light);
    font-weight: 500;
}

.stat-value {
    font-size: 24px;
    font-weight: 800;
    line-height: 1.2;
}

.stat-value.revenue { color: var(--primary); }
.stat-value.days { color: var(--success); }
.stat-value.pending { color: var(--warning); }
.stat-value.score { color: #A855F7; }

.stat-trend {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 2px;
}

.stat-trend.up { color: var(--success); font-weight: 600; }
.stat-trend.warning { color: var(--warning); font-weight: 600; }

/* Section */
.section {
    margin-bottom: 24px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
}

.section-link {
    display: flex;
    align-items: center;
    gap: 4px;
    border: none;
    background: transparent;
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

.section-link:active {
    background: rgba(79, 70, 229, 0.1);
}

.section-link svg {
    width: 16px;
    height: 16px;
}

/* Schedule List */
.schedule-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.schedule-item {
    background: white;
    padding: 16px;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    display: flex;
    gap: 14px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.schedule-item:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.schedule-date {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary) 0%, #7C3AED 100%);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.schedule-date .day {
    font-size: 20px;
    font-weight: 800;
    line-height: 1;
}

.schedule-date .month {
    font-size: 11px;
    opacity: 0.9;
    margin-top: 2px;
}

.schedule-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.schedule-title {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.schedule-course {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.schedule-meta {
    font-size: 13px;
    color: var(--text-light);
    display: flex;
    gap: 16px;
    align-items: center;
}

.schedule-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.schedule-meta span::before {
    content: '';
    width: 4px;
    height: 4px;
    background: var(--text-light);
    border-radius: 50%;
}

.schedule-meta span:first-child::before {
    display: none;
}

.schedule-status {
    margin-top: 6px;
}

/* Calendar */
.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding: 8px 0;
}

.calendar-title {
    font-size: 18px;
    font-weight: 700;
}

.nav-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: white;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.nav-btn:active {
    transform: scale(0.95);
    box-shadow: 0 1px 6px rgba(0,0,0,0.04);
}

.nav-btn svg {
    width: 20px;
    height: 20px;
    color: var(--text);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 8px;
    padding: 8px 4px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--border);
    padding: 1px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    min-height: 300px;
}

.calendar-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 8px 4px;
    font-size: 14px;
    cursor: pointer;
    position: relative;
    min-height: 56px;
    background: white;
    transition: background 0.2s;
}

.calendar-day:active {
    background: var(--bg);
}

.calendar-day.blank {
    background: var(--bg);
    cursor: default;
}

.calendar-day.today {
    background: linear-gradient(135deg, var(--primary) 0%, #7C3AED 100%);
    color: white;
    font-weight: 700;
}

.calendar-day.today .city-tag {
    background: rgba(255,255,255,0.25);
    color: white;
}

.calendar-day.selected {
    background: #EEF2FF;
    font-weight: 600;
}

.calendar-day.selected.today {
    background: linear-gradient(135deg, var(--primary) 0%, #7C3AED 100%);
}

.day-number {
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
}

.calendar-day.today .day-number {
    font-weight: 700;
}

.meeting-icon {
    width: 12px;
    height: 12px;
    color: #F43F5E;
    margin-top: 4px;
}

.meeting-icon svg {
    width: 100%;
    height: 100%;
}

.calendar-day.today .meeting-icon {
    color: rgba(255,255,255,0.9);
}

.day-cities {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    justify-content: center;
    margin-top: 4px;
}

.city-tag {
    font-size: 8px;
    padding: 2px 6px;
    background: linear-gradient(135deg, var(--primary) 0%, #7C3AED 100%);
    color: white;
    border-radius: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 45px;
    font-weight: 500;
}

/* Day Events */
.day-events {
    background: white;
    margin-top: 16px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    flex-shrink: 0;
    max-height: 35vh;
    overflow-y: auto;
}

.events-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}

.events-date {
    font-weight: 700;
    font-size: 16px;
}

.events-list {
    padding: 16px;
}

.event-item {
    padding: 16px;
    border-left: 4px solid var(--primary);
    background: var(--bg);
    border-radius: 12px;
    margin-bottom: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.event-item:active {
    transform: scale(0.98);
}

.event-item:last-child {
    margin-bottom: 0;
}

.event-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.event-title {
    font-weight: 700;
    font-size: 15px;
}

.event-status {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 600;
}

.event-status.confirmed { background: #D1FAE5; color: #059669; }
.event-status.planning { background: #DBEAFE; color: #2563EB; }
.event-status.coordinating { background: #FEF3C7; color: #D97706; }
.event-status.pending { background: #E0E7FF; color: #4F46E5; }
.event-status.completed { background: #CCFBF1; color: #14B8A6; }

.event-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.event-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    border: 1px solid transparent;
}

.event-chip.payment-unpaid {
    color: #475569;
    background: #F1F5F9;
    border-color: #CBD5E1;
}

.event-chip.payment-invoiced {
    color: #1D4ED8;
    background: #DBEAFE;
    border-color: #BFDBFE;
}

.event-chip.payment-paid {
    color: #047857;
    background: #D1FAE5;
    border-color: #A7F3D0;
}

.event-note {
    margin-top: 12px;
    padding: 12px 14px;
    background: rgba(148, 163, 184, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 12px;
    color: var(--text);
    font-size: 13px;
    line-height: 1.5;
}

.event-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.event-action-btn {
    flex: 1;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: white;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s, border-color 0.2s;
}

.event-action-btn:active {
    transform: scale(0.98);
}

.event-action-btn.edit {
    border-color: rgba(79, 70, 229, 0.18);
    color: var(--primary);
    background: rgba(79, 70, 229, 0.06);
}

.event-action-btn.delete {
    border-color: rgba(239, 68, 68, 0.18);
    color: var(--danger);
    background: rgba(239, 68, 68, 0.06);
}

.event-detail {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-light);
}

.event-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.event-time {
    font-size: 13px;
    color: var(--text-light);
}

.event-form textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    min-height: 88px;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.event-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
    background: white;
}

/* Profile */
.profile-header {
    text-align: center;
    padding: 32px 20px;
    background: white;
    border-radius: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.avatar {
    width: 88px;
    height: 88px;
    background: linear-gradient(135deg, var(--primary) 0%, #7C3AED 100%);
    border-radius: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 32px;
    font-weight: 800;
    color: white;
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.3);
}

.profile-header h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.profile-header p {
    font-size: 14px;
    color: var(--text-light);
}

.profile-menu {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.menu-item {
    width: 100%;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    border: none;
    background: transparent;
    font-size: 16px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item svg {
    width: 22px;
    height: 22px;
    color: var(--text-light);
}

.menu-item:active {
    background: var(--bg);
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    display: flex;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(200, 210, 220, 0.3);
    padding-bottom: var(--safe-bottom);
    z-index: 9999;
    border-radius: 0;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 0;
    border: none;
    background: transparent;
    color: var(--text-light);
    font-size: 12px;
    cursor: pointer;
    gap: 4px;
}

.nav-item svg {
    width: 24px;
    height: 24px;
}

.nav-item.active {
    color: var(--primary);
    background: transparent;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
    z-index: 10000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }

/* Loading Skeleton */
.loading-skeleton {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.skeleton-item {
    height: 80px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 12px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-light);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 400px;
    border-radius: 12px;
    overflow: hidden;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    max-height: 80vh;
    overflow-y: auto;
}

.modal.show .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border);
    background: #f9fafb;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.close-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-light);
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
}

.close-btn:active {
    background: #f3f4f6;
}

/* Event Form */
.event-form {
    padding: 20px;
}

.form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.form-group input[type="number"],
.form-group select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 44px;
    cursor: pointer;
    background-color: #fff;
    background-image:
        linear-gradient(135deg, transparent 50%, #94a3b8 50%),
        linear-gradient(45deg, #94a3b8 50%, transparent 50%);
    background-position:
        calc(100% - 20px) calc(50% - 3px),
        calc(100% - 14px) calc(50% - 3px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.form-group input[type="number"]:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn-secondary {
    flex: 1;
    padding: 14px 24px;
    background: #f3f4f6;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:active {
    transform: scale(0.98);
    background: #e5e7eb;
}

/* Quick Add Button */
.header-action {
    width: 44px;
    height: 44px;
    border: none;
    background: linear-gradient(135deg, var(--primary) 0%, #7C3AED 100%);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.header-action svg {
    width: 20px;
    height: 20px;
    color: white;
}

.header-action:active {
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.2);
}

/* iOS Refinement Layer */
:root {
    --primary: #4257FF;
    --primary-light: #7C8DFF;
    --primary-soft: #EEF2FF;
    --success: #18B57B;
    --warning: #F59E0B;
    --danger: #F05252;
    --text: #0F172A;
    --text-light: #64748B;
    --bg: #F4F7FF;
    --card: rgba(255, 255, 255, 0.9);
    --border: rgba(148, 163, 184, 0.18);
    --surface-shadow: 0 18px 48px rgba(15, 23, 42, 0.12);
    --surface-shadow-soft: 0 10px 28px rgba(15, 23, 42, 0.08);
}

body {
    background:
        radial-gradient(circle at top left, rgba(124, 141, 255, 0.28), transparent 28%),
        radial-gradient(circle at bottom right, rgba(24, 181, 123, 0.16), transparent 24%),
        linear-gradient(180deg, #EEF3FF 0%, #F8FAFF 100%);
}

body::before,
body::after {
    content: '';
    position: fixed;
    inset: auto;
    pointer-events: none;
    z-index: 0;
}

body::before {
    top: -120px;
    right: -80px;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(66, 87, 255, 0.24) 0%, rgba(66, 87, 255, 0) 70%);
}

body::after {
    bottom: 40px;
    left: -120px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(24, 181, 123, 0.16) 0%, rgba(24, 181, 123, 0) 72%);
}

#app {
    position: relative;
    z-index: 1;
    max-width: 430px;
    margin: 0 auto;
    background: linear-gradient(180deg, rgba(247, 249, 255, 0.98) 0%, rgba(240, 245, 255, 0.98) 100%);
}

@media (min-width: 500px) {
    body {
        padding: 12px 0;
    }

    #app {
        height: calc(100vh - 24px);
        border-radius: 34px;
        overflow: hidden;
        border: 1px solid rgba(255, 255, 255, 0.7);
        box-shadow: 0 24px 70px rgba(15, 23, 42, 0.18);
    }
}

.screen {
    position: relative;
    background: linear-gradient(180deg, rgba(247, 249, 255, 0.98) 0%, rgba(240, 245, 255, 0.98) 100%);
}

#login-screen {
    overflow: hidden;
    background:
        linear-gradient(180deg, #263DDB 0%, #5569FF 36%, #EDF2FF 100%);
}

#login-screen::before,
#login-screen::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(6px);
    opacity: 0.9;
}

#login-screen::before {
    top: -90px;
    right: -40px;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.24) 0%, rgba(255, 255, 255, 0) 72%);
}

#login-screen::after {
    left: -90px;
    bottom: 120px;
    width: 240px;
    height: 240px;
    background: radial-gradient(circle, rgba(129, 140, 248, 0.38) 0%, rgba(129, 140, 248, 0) 72%);
}

.login-container {
    position: relative;
    z-index: 1;
    padding: calc(32px + var(--safe-top)) 24px 28px;
    background: transparent;
    gap: 28px;
}

.login-logo {
    text-align: left;
    margin-bottom: 0;
}

.login-badge {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 12px;
    margin-bottom: 20px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.24);
    backdrop-filter: blur(18px);
    color: rgba(255, 255, 255, 0.94);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.logo-icon {
    width: 88px;
    height: 88px;
    margin: 0 0 18px;
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(241, 245, 255, 0.98) 100%);
    color: var(--primary);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        0 16px 44px rgba(15, 23, 42, 0.22);
}

.login-logo h1 {
    font-size: 32px;
    line-height: 1.05;
    margin-bottom: 10px;
    letter-spacing: -0.04em;
}

.login-logo p {
    max-width: 220px;
    font-size: 15px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.82);
}

.login-form {
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid rgba(255, 255, 255, 0.38);
    border-radius: 30px;
    padding: 24px 22px 22px;
    backdrop-filter: blur(28px);
    box-shadow: 0 28px 54px rgba(15, 23, 42, 0.16);
}

.form-group label {
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    margin-bottom: 9px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.form-group input,
.form-group input[type="number"],
.form-group select,
.event-form textarea {
    min-height: 52px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background-color: rgba(248, 250, 252, 0.92);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.form-group input:focus,
.form-group input[type="number"]:focus,
.form-group select:focus,
.event-form textarea:focus {
    box-shadow:
        0 0 0 4px rgba(66, 87, 255, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.btn-primary,
.btn-secondary {
    min-height: 54px;
    border-radius: 18px;
}

.btn-primary {
    background: linear-gradient(135deg, #4257FF 0%, #6675FF 100%);
    box-shadow: 0 14px 28px rgba(66, 87, 255, 0.26);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

#main-app {
    background:
        radial-gradient(circle at top center, rgba(124, 141, 255, 0.18), transparent 22%),
        linear-gradient(180deg, rgba(247, 249, 255, 0.98) 0%, rgba(239, 244, 255, 0.98) 100%);
}

.app-header {
    top: 0;
    margin: calc(10px + var(--safe-top)) 14px 0;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.64);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.74);
    box-shadow: var(--surface-shadow-soft);
    backdrop-filter: blur(28px);
}

.header-title {
    font-size: 22px;
    letter-spacing: -0.03em;
}

.sync-status {
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid rgba(16, 185, 129, 0.14);
    background: rgba(16, 185, 129, 0.1);
    color: #047857;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.72),
        0 10px 20px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(18px);
    transition:
        transform 0.24s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.24s ease,
        background 0.24s ease,
        border-color 0.24s ease,
        color 0.24s ease;
}

.sync-status.offline {
    border-color: rgba(245, 158, 11, 0.2);
    background: rgba(245, 158, 11, 0.12);
    color: #B45309;
}

.sync-status.is-updating {
    animation: ios-sync-pill-refresh 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.sync-status .sync-dot {
    position: relative;
    width: 8px;
    height: 8px;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.14);
}

.sync-status .sync-dot.online {
    background: #10B981;
}

.sync-status .sync-dot.offline {
    background: #F59E0B;
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.16);
}

.sync-status .sync-dot::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 999px;
    border: 1px solid currentColor;
    opacity: 0.18;
}

.sync-time {
    font-size: 11px;
    color: inherit;
    opacity: 0.72;
}

.app-content {
    padding: 10px 14px calc(90px + var(--safe-bottom));
}

.view {
    padding: 8px 0 24px;
    min-height: calc(100vh - 176px);
    gap: 22px;
    animation: ios-view-enter 0.26s ease;
}

#calendar-view.active {
    padding-bottom: 90px;
}

.dashboard-header {
    margin-bottom: 0;
    padding: 18px 18px;
    border-radius: 28px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.82) 0%, rgba(255, 255, 255, 0.64) 100%);
    border: 1px solid rgba(255, 255, 255, 0.58);
    box-shadow: var(--surface-shadow);
    backdrop-filter: blur(26px);
    overflow: hidden;
}

.dashboard-header::after {
    content: '';
    position: absolute;
    inset: auto auto -30px -20px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(66, 87, 255, 0.16) 0%, rgba(66, 87, 255, 0) 72%);
    pointer-events: none;
}

.header-avatar {
    width: 56px;
    height: 56px;
    border-radius: 20px;
    box-shadow: 0 14px 26px rgba(66, 87, 255, 0.26);
}

.dashboard-title {
    font-size: 28px;
    letter-spacing: -0.04em;
    margin-bottom: 4px;
}

.dashboard-subtitle {
    font-size: 14px;
    color: #64748B;
}

.header-action {
    width: 48px;
    height: 48px;
    border-radius: 18px;
    box-shadow: 0 14px 24px rgba(66, 87, 255, 0.24);
}

.dashboard-grid {
    gap: 14px;
    margin-bottom: 0;
}

.stat-card {
    min-height: 156px;
    padding: 18px 16px;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.76);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0.82) 100%);
    box-shadow: var(--surface-shadow-soft);
}

.stat-card::before {
    top: 10px;
    left: 14px;
    right: 14px;
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0));
    opacity: 1;
}

.stat-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 18px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.stat-value {
    font-size: 28px;
    letter-spacing: -0.04em;
}

.stat-trend {
    margin-top: auto;
    font-size: 12px;
}

.section {
    margin-bottom: 0;
}

.section-header {
    padding: 0 4px;
    margin-bottom: 12px;
}

.section-title {
    font-size: 20px;
    letter-spacing: -0.03em;
}

.section-link {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(66, 87, 255, 0.08);
}

.schedule-list {
    gap: 14px;
}

.schedule-item {
    padding: 18px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0.84) 100%);
    box-shadow: var(--surface-shadow-soft);
    transition:
        transform 0.24s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.24s cubic-bezier(0.22, 1, 0.36, 1),
        border-color 0.24s ease;
}

.schedule-item:active {
    transform: translateY(1px) scale(0.985);
    box-shadow: 0 12px 22px rgba(15, 23, 42, 0.08);
    border-color: rgba(99, 102, 241, 0.22);
}

.schedule-date {
    width: 60px;
    height: 60px;
    border-radius: 20px;
    box-shadow: 0 14px 28px rgba(66, 87, 255, 0.24);
}

.schedule-title {
    font-size: 16px;
}

.schedule-meta {
    flex-wrap: wrap;
    gap: 8px 14px;
}

.calendar-header {
    padding: 0 4px;
    margin-bottom: 10px;
}

.calendar-title {
    font-size: 20px;
    letter-spacing: -0.03em;
    transform-origin: center;
}

.calendar-title.is-animating-prev {
    animation: ios-calendar-title-prev 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

.calendar-title.is-animating-next {
    animation: ios-calendar-title-next 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-btn {
    width: 48px;
    height: 48px;
    border: 1px solid rgba(255, 255, 255, 0.74);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: var(--surface-shadow-soft);
    backdrop-filter: blur(18px);
    transition:
        transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.22s ease,
        background 0.22s ease;
}

.nav-btn:active {
    transform: translateY(1px) scale(0.96);
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.08);
}

.calendar-weekdays {
    margin-bottom: 10px;
    padding: 12px 8px;
    border: 1px solid rgba(255, 255, 255, 0.64);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.48);
}

.calendar-grid {
    gap: 8px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.68);
    box-shadow: var(--surface-shadow);
    transform-origin: center;
}

.calendar-grid.is-animating-prev {
    animation: ios-calendar-slide-prev 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.calendar-grid.is-animating-next {
    animation: ios-calendar-slide-next 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.calendar-day {
    min-height: 62px;
    padding: 10px 5px 8px;
    border: 1px solid rgba(226, 232, 240, 0.82);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.92);
    transition:
        transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.2s ease,
        border-color 0.2s ease,
        background 0.2s ease;
}

.calendar-day.blank {
    border: none;
    background: transparent;
}

.calendar-day.today {
    box-shadow: 0 14px 24px rgba(66, 87, 255, 0.24);
}

.calendar-day.selected {
    border-color: rgba(66, 87, 255, 0.18);
    background: linear-gradient(180deg, rgba(66, 87, 255, 0.12) 0%, rgba(99, 102, 241, 0.18) 100%);
    box-shadow: 0 10px 22px rgba(66, 87, 255, 0.14);
}

.calendar-day:active:not(.blank) {
    transform: translateY(1px) scale(0.97);
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.08);
}

.day-cities {
    gap: 4px;
}

.city-tag {
    max-width: 56px;
    padding: 3px 7px;
    font-size: 9px;
}

.day-events {
    margin-top: 18px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: var(--surface-shadow);
    backdrop-filter: blur(24px);
    max-height: 40vh;
    transform-origin: center;
}

.day-events.is-animating-prev {
    animation: ios-day-panel-prev 0.36s cubic-bezier(0.22, 1, 0.36, 1);
}

.day-events.is-animating-next {
    animation: ios-day-panel-next 0.36s cubic-bezier(0.22, 1, 0.36, 1);
}

.events-header {
    padding: 18px 20px 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, rgba(255, 255, 255, 0.48) 100%);
}

.events-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    transform-origin: center;
}

.events-date.is-animating-prev {
    animation: ios-calendar-title-prev 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.events-date.is-animating-next {
    animation: ios-calendar-title-next 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.events-list.is-animating-prev {
    animation: ios-day-events-prev 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

.events-list.is-animating-next {
    animation: ios-day-events-next 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

.events-list.is-animating-prev .event-item,
.events-list.is-animating-next .event-item {
    animation: ios-event-stagger-in 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: var(--event-stagger-delay, 0ms);
}

.events-list.is-animating-prev .empty-state,
.events-list.is-animating-next .empty-state {
    animation: ios-event-stagger-in 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: var(--event-stagger-delay, 0ms);
}

.event-item {
    margin-bottom: 0;
    padding: 16px;
    border-left: none;
    border: 1px solid rgba(226, 232, 240, 0.72);
    border-radius: 22px;
    background: rgba(247, 250, 255, 0.94);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.72),
        0 10px 20px rgba(15, 23, 42, 0.05);
    transition:
        transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.22s ease,
        border-color 0.22s ease;
}

.event-item:active {
    transform: translateY(1px) scale(0.985);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.72),
        0 12px 22px rgba(15, 23, 42, 0.08);
    border-color: rgba(99, 102, 241, 0.18);
}

.event-header {
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.event-title {
    font-size: 16px;
    letter-spacing: -0.02em;
}

.event-status {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
}

.event-detail {
    font-size: 13.5px;
}

.event-meta {
    margin-top: 14px;
    gap: 10px;
}

.event-note {
    background: rgba(255, 255, 255, 0.78);
}

.event-action-btn {
    min-height: 42px;
    border-radius: 16px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
    transition:
        transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.event-action-btn:active {
    transform: translateY(1px) scale(0.97);
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 28px 20px;
    border: 1px solid rgba(226, 232, 240, 0.72);
    border-radius: 22px;
    background: rgba(247, 250, 255, 0.88);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.72),
        0 10px 20px rgba(15, 23, 42, 0.04);
    text-align: center;
    color: #64748B;
}

.empty-state-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(66, 87, 255, 0.12) 0%, rgba(66, 87, 255, 0.05) 100%);
    color: var(--primary);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.empty-state-icon svg {
    width: 24px;
    height: 24px;
}

.empty-state p {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #334155;
}

.empty-state span {
    font-size: 12px;
    color: #94A3B8;
}

.profile-header {
    margin-bottom: 18px;
    padding: 34px 22px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 30px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.84) 0%, rgba(255, 255, 255, 0.72) 100%);
    box-shadow: var(--surface-shadow);
    backdrop-filter: blur(22px);
}

.profile-menu {
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: var(--surface-shadow-soft);
    backdrop-filter: blur(22px);
}

.menu-item {
    position: relative;
    padding: 18px 18px;
    font-size: 15px;
}

.menu-item::after {
    content: '›';
    margin-left: auto;
    color: #94A3B8;
    font-size: 20px;
    line-height: 1;
}

.bottom-nav {
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    gap: 8px;
    padding: 8px;
    padding-bottom: calc(8px + var(--safe-bottom));
    border: none;
    border-top: 1px solid rgba(200, 210, 220, 0.3);
    border-radius: 0;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.08);
    z-index: 9999;
}

.nav-item {
    min-height: 56px;
    padding: 10px 0 8px;
    border-radius: 0;
    transition:
        background 0.22s ease,
        color 0.22s ease,
        transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.22s ease;
}

.nav-item span {
    font-weight: 600;
}

.nav-item.active {
    color: var(--primary);
    background: transparent;
    box-shadow: none;
}

.nav-item:active {
    transform: translateY(1px) scale(0.96);
}

.toast {
    bottom: calc(90px + var(--safe-bottom));
    max-width: calc(100vw - 48px);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.82);
    box-shadow: 0 22px 34px rgba(15, 23, 42, 0.2);
    backdrop-filter: blur(20px);
    transform: translateX(-50%) translateY(22px) scale(0.97);
    opacity: 0;
    transition:
        transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.22s ease;
    z-index: 10000;
}

.toast.show {
    transform: translateX(-50%) translateY(0) scale(1);
    opacity: 1;
}

.toast.closing {
    transform: translateX(-50%) translateY(14px) scale(0.985);
    opacity: 0;
}

.toast-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
    flex-shrink: 0;
}

.toast-icon svg {
    width: 16px;
    height: 16px;
}

.toast-message {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    color: #F8FAFC;
}

.toast.success {
    background: linear-gradient(180deg, rgba(5, 150, 105, 0.92) 0%, rgba(4, 120, 87, 0.9) 100%);
}

.toast.warning {
    background: linear-gradient(180deg, rgba(217, 119, 6, 0.92) 0%, rgba(180, 83, 9, 0.9) 100%);
}

.toast.error {
    background: linear-gradient(180deg, rgba(220, 38, 38, 0.92) 0%, rgba(185, 28, 28, 0.9) 100%);
}

.toast.info {
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.9) 100%);
}

.modal {
    align-items: flex-end;
    justify-content: center;
    padding: 24px 12px calc(12px + var(--safe-bottom));
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(12px);
}

.modal-content {
    position: relative;
    width: min(100%, 430px);
    max-width: 430px;
    max-height: calc(88vh - var(--safe-bottom));
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 30px 30px 24px 24px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 250, 255, 0.94) 100%);
    box-shadow: 0 28px 64px rgba(15, 23, 42, 0.2);
    transform: translateY(36px);
    opacity: 0;
    transition:
        transform 0.34s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.26s ease;
}

.modal.show .modal-content {
    transform: translateY(0);
    opacity: 1;
    animation: ios-sheet-enter 0.36s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal.closing .modal-content {
    transform: translateY(24px) scale(0.985);
    opacity: 0;
    animation: ios-sheet-exit 0.22s ease forwards;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 50%;
    width: 48px;
    height: 5px;
    transform: translateX(-50%);
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.34);
}

.modal-header {
    padding: 28px 22px 14px;
    background: transparent;
    border-bottom: 1px solid rgba(226, 232, 240, 0.7);
}

.close-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 12px;
    background: rgba(148, 163, 184, 0.12);
    transition:
        transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
        background 0.2s ease;
}

.close-btn:active {
    transform: translateY(1px) scale(0.94);
    background: rgba(148, 163, 184, 0.2);
}

.event-form {
    padding: 18px 20px 22px;
}

.form-row {
    gap: 10px;
}

.form-group {
    margin-bottom: 14px;
}

.form-group select {
    background-position:
        calc(100% - 20px) calc(50% - 3px),
        calc(100% - 14px) calc(50% - 3px);
}

.form-actions {
    margin-top: 28px;
    gap: 10px;
}

@keyframes ios-view-enter {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes ios-calendar-slide-prev {
    from {
        opacity: 0.52;
        transform: translateX(-18px) scale(0.988);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes ios-calendar-slide-next {
    from {
        opacity: 0.52;
        transform: translateX(18px) scale(0.988);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes ios-calendar-title-prev {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes ios-calendar-title-next {
    from {
        opacity: 0;
        transform: translateX(10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes ios-sheet-enter {
    from {
        opacity: 0;
        transform: translateY(48px) scale(0.975);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes ios-sheet-exit {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(24px) scale(0.985);
    }
}

@keyframes ios-day-panel-prev {
    from {
        opacity: 0.68;
        transform: translateX(-16px) scale(0.992);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes ios-day-panel-next {
    from {
        opacity: 0.68;
        transform: translateX(16px) scale(0.992);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes ios-day-events-prev {
    from {
        opacity: 0;
        transform: translateX(-18px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes ios-day-events-next {
    from {
        opacity: 0;
        transform: translateX(18px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes ios-event-stagger-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes ios-sync-pill-refresh {
    from {
        opacity: 0.72;
        transform: translateY(-2px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

/* Unified Visual Refresh */
:root {
    --primary: #2563eb;
    --primary-light: #3b82f6;
    --primary-deep: #1d4ed8;
    --primary-soft: rgba(37, 99, 235, 0.10);
    --accent: #60a5fa;
    --accent-soft: rgba(96, 165, 250, 0.10);
    --bg: #f5f8fc;
    --bg-alt: #edf3fb;
    --surface: #ffffff;
    --surface-strong: #ffffff;
    --surface-muted: #f8fbff;
    --border: #d7e1ef;
    --border-strong: #c2d2e6;
    --text: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #64748b;
    --shadow-soft: 0 2px 10px rgba(15, 23, 42, 0.03);
    --shadow-card: 0 6px 18px rgba(15, 23, 42, 0.04);
    --shadow-float: 0 10px 28px rgba(15, 23, 42, 0.06);
}

body {
    background: linear-gradient(180deg, #f5f8fc 0%, #edf3fb 100%);
    color: var(--text);
}

#app,
.screen,
#main-app {
    background: transparent;
}

.app-content {
    background: transparent;
}

.login-container {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border);
    background: #ffffff;
    box-shadow: var(--shadow-card);
}

.login-container::before {
    display: none;
}

.login-logo,
.login-form {
    position: relative;
    z-index: 1;
}

.login-badge {
    border: 1px solid rgba(37, 99, 235, 0.10);
    background: #eff6ff;
    color: var(--primary);
    box-shadow: none;
}

.logo-icon {
    background: var(--primary);
    box-shadow: none;
}

.login-logo h1 {
    color: var(--text);
}

.login-logo p {
    color: var(--text-secondary);
}

.form-group label {
    color: var(--text-secondary);
}

.form-group input,
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--text);
    box-shadow: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(100, 116, 139, 0.72);
}

.form-group input:focus,
.form-group input[type="number"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: rgba(37, 99, 235, 0.45);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.10);
}

.btn-primary,
.btn-primary.btn-full {
    background: var(--primary);
    box-shadow: none;
}

.app-header {
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    box-shadow: none;
    padding: 14px 16px 10px;
}

.header-title {
    color: var(--text);
    letter-spacing: -0.03em;
    font-size: 1.85rem;
    font-weight: 700;
}

.sync-status {
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--primary-deep);
    box-shadow: none;
    min-height: 2.4rem;
    padding: 0.45rem 0.75rem;
}

.sync-status.offline {
    border-color: rgba(249, 115, 22, 0.18);
    color: #9a3412;
}

.dashboard-header,
.section,
.calendar-header,
.day-events,
.profile-header,
.profile-menu,
.modal-content {
    border: 1px solid var(--border);
    background: #ffffff;
    box-shadow: var(--shadow-soft);
    backdrop-filter: none;
    border-radius: 22px;
}

.dashboard-header::after {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.16), rgba(37, 99, 235, 0));
}

.header-avatar,
.header-action,
.nav-btn {
    background: #ffffff;
    border: 1px solid var(--border);
    box-shadow: none;
}

.header-avatar {
    color: var(--primary);
}

.header-action,
.nav-btn,
.section-link {
    color: var(--primary);
}

.dashboard-title,
.section-title,
.calendar-title,
.events-date,
.profile-header h2 {
    color: var(--text);
}

.dashboard-subtitle,
.section-link span,
.profile-header p,
.event-meta,
.sync-time {
    color: var(--text-secondary);
}

.dashboard-grid {
    gap: 12px;
}

.dashboard-header {
    padding: 18px;
}

.stat-card,
.schedule-item,
.event-item,
.menu-item {
    border: 1px solid var(--border);
    background: #ffffff;
    box-shadow: var(--shadow-card);
    backdrop-filter: none;
}

.stat-card {
    overflow: hidden;
    padding: 16px;
    min-height: 152px;
}

.stat-card::before {
    opacity: 0.18;
}

.stat-card.primary::after {
    background: rgba(37, 99, 235, 0.08);
}

.stat-card.success::after {
    background: rgba(59, 130, 246, 0.08);
}

.stat-card.warning::after {
    background: rgba(147, 197, 253, 0.12);
}

.stat-card.purple::after {
    background: rgba(226, 232, 240, 0.6);
}

.stat-card.primary .stat-icon-wrapper,
.stat-card.success .stat-icon-wrapper,
.stat-card.warning .stat-icon-wrapper,
.stat-card.purple .stat-icon-wrapper {
    border: 1px solid var(--border);
    box-shadow: none;
}

.stat-icon-wrapper {
    width: 52px;
    height: 52px;
}

.stat-card.primary .stat-icon-wrapper {
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary);
}

.stat-card.success .stat-icon-wrapper {
    background: rgba(59, 130, 246, 0.08);
    color: var(--primary);
}

.stat-card.warning .stat-icon-wrapper {
    background: rgba(191, 219, 254, 0.6);
    color: var(--primary-deep);
}

.stat-card.purple .stat-icon-wrapper {
    background: #eff6ff;
    color: var(--primary-deep);
}

.stat-label,
.event-meta,
.menu-item span:last-child {
    color: var(--text-secondary);
}

.stat-label {
    font-size: 0.92rem;
}

.stat-value,
.event-title,
.menu-item span,
.calendar-day .day-number {
    color: var(--text);
}

.stat-value {
    font-size: clamp(2rem, 7vw, 2.35rem);
    line-height: 1.02;
    letter-spacing: -0.05em;
}

.schedule-item {
    gap: 14px;
}

.schedule-time,
.event-time {
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary);
    border: 1px solid rgba(37, 99, 235, 0.10);
}

.schedule-city,
.city-tag {
    background: #dbeafe;
    color: #1d4ed8;
    border: 1px solid rgba(37, 99, 235, 0.18);
    font-weight: 700;
}

.calendar-weekdays {
    background: #ffffff;
    border: 1px solid var(--border);
}

.calendar-weekdays span {
    color: #475569;
    font-weight: 700;
}

.calendar-grid {
    gap: 8px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(203, 213, 225, 0.9);
}

.calendar-day {
    border: 1px solid #cfd9e6;
    background: #ffffff;
    box-shadow: none;
    min-height: 68px;
}

.calendar-day .day-number {
    color: #1e293b;
    font-weight: 800;
}

.calendar-day .meeting-icon {
    color: #2563eb;
}

.calendar-day.today,
.calendar-day.selected.today {
    background: #eff6ff;
    border-color: #93c5fd;
}

.calendar-day.selected {
    background: #2563eb;
    border-color: #1d4ed8;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.calendar-day.blank {
    background: rgba(255, 255, 255, 0.42);
}

.calendar-day.today .day-number {
    color: #1d4ed8;
}

.calendar-day.selected .day-number,
.calendar-day.selected .meeting-icon,
.calendar-day.selected.today .day-number,
.calendar-day.selected.today .meeting-icon {
    color: #ffffff;
}

.calendar-day.today .city-tag {
    background: #bfdbfe;
    color: #1e40af;
    border-color: rgba(37, 99, 235, 0.12);
}

.calendar-day.selected .city-tag,
.calendar-day.selected.today .city-tag {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.24);
}

.day-events {
    background: #ffffff;
    padding: 16px;
}

.events-header {
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.events-date {
    font-size: 1rem;
}

.event-item {
    padding: 12px 14px;
}

.empty-state {
    border: 1px dashed rgba(37, 99, 235, 0.18);
    background: #f8fbff;
    color: var(--text-secondary);
}

.profile-header {
    text-align: left;
}

.profile-header .avatar {
    background: var(--primary);
    box-shadow: none;
}

.menu-item {
    color: var(--text);
}

.menu-item::after {
    color: rgba(15, 118, 110, 0.42);
}

.menu-item svg {
    color: var(--primary);
}

.bottom-nav {
    border: none;
    border-top: 1px solid rgba(200, 210, 220, 0.3);
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.06);
    padding-top: 10px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    border-radius: 0;
    z-index: 9999;
}

.nav-item {
    color: var(--text-tertiary);
    font-size: 0.82rem;
}

.nav-item.active {
    color: var(--primary);
    background: transparent;
    box-shadow: none;
}

.toast {
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
    backdrop-filter: none;
    width: calc(100% - 48px);
    max-width: 320px;
    padding: 12px 14px;
    border-radius: 18px;
}

.toast-message {
    font-weight: 600;
    letter-spacing: -0.01em;
    font-size: 0.95rem;
}

.toast.success,
.toast.info {
    background: #1e40af;
    border-color: #1e40af;
}

.modal {
    background: rgba(15, 23, 42, 0.18);
    backdrop-filter: none;
}

.modal-content {
    border: 1px solid var(--border);
    background: #ffffff;
    box-shadow: var(--shadow-card);
}

.modal-header {
    background: rgba(255, 255, 255, 0.64);
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

/* Mobile style alignment with desktop shell */
#login-screen {
    justify-content: center;
    padding: 0 0 calc(10px + var(--safe-bottom));
    background: linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 100%);
}

#login-screen::before,
#login-screen::after {
    display: none;
}

.login-container {
    flex: 0 1 auto;
    width: min(380px, calc(100% - 32px));
    margin: calc(var(--safe-top) + 20px) auto 16px;
    padding: 24px 20px 20px;
    border-radius: 24px;
    gap: 16px;
}

.login-logo {
    text-align: center;
    margin: 0;
}

.login-badge,
.login-logo p {
    display: none;
}

.logo-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 12px;
    border-radius: 16px;
    border: 1px solid rgba(37, 99, 235, 0.18);
    background: var(--primary);
    color: #ffffff;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.login-logo h1 {
    margin: 0;
    color: var(--text);
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.login-form {
    border: 0;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    margin-bottom: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}

.form-group input,
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    min-height: 46px;
    border-radius: 12px;
    border-color: var(--border);
    background: #ffffff;
}

.btn-primary,
.btn-primary.btn-full {
    min-height: 46px;
    border-radius: 12px;
    background: var(--primary);
}

.header-avatar,
.schedule-date {
    background: var(--primary);
    color: #ffffff;
}

.schedule-date {
    border: 1px solid rgba(37, 99, 235, 0.2);
    box-shadow: none;
}

.schedule-date .month {
    opacity: 0.88;
}

.calendar-day.today,
.calendar-day.selected.today {
    background: #e8f1ff;
    border-color: #93c5fd;
}

.calendar-day.today .day-number,
.calendar-day.today .meeting-icon {
    color: #1d4ed8;
}

.calendar-day.selected {
    background: var(--primary);
    border-color: var(--primary-deep);
}

.calendar-day.selected .day-number,
.calendar-day.selected .meeting-icon,
.calendar-day.selected .city-tag {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.24);
}

.event-action-btn.edit {
    border-color: rgba(37, 99, 235, 0.18);
    color: var(--primary);
    background: rgba(37, 99, 235, 0.06);
}

.event-action-btn.delete {
    border-color: rgba(220, 38, 38, 0.18);
    color: #dc2626;
    background: rgba(220, 38, 38, 0.06);
}

.dashboard-header {
    align-items: center;
    gap: 10px;
}

.header-action {
    background: var(--primary);
    border: 1px solid var(--primary-deep);
    color: #ffffff;
    box-shadow: none;
}

.header-action svg {
    color: #ffffff;
}

.header-action:active {
    background: var(--primary-deep);
    border-color: var(--primary-deep);
}

/* Radius refinement: tighten all mobile corners */
@media (min-width: 500px) {
    #app {
        border-radius: 24px;
    }
}

#app .login-container {
    border-radius: 16px;
}

#app .logo-icon,
#app .schedule-date,
#app .modal-content,
#app .dashboard-header,
#app .section,
#app .calendar-header,
#app .day-events,
#app .profile-header,
#app .profile-menu,
#app .stat-card,
#app .schedule-item,
#app .event-item,
#app .menu-item,
#app .calendar-grid,
#app .calendar-day,
#app .app-header,
#app .bottom-nav,
#app .header-action,
#app .nav-btn,
#app .toast {
    border-radius: 12px;
}

#app .nav-item {
    border-radius: 0;
}

#app .modal-header {
    border-radius: 12px 12px 0 0;
}

#app .close-btn,
#app .event-action-btn,
#app .form-group input,
#app .form-group input[type="number"],
#app .form-group select,
#app .form-group textarea,
#app .event-form textarea,
#app .btn-primary,
#app .btn-secondary {
    border-radius: 10px;
}

#app .sync-status,
#app .event-status,
#app .event-chip,
#app .city-tag,
#app .schedule-time,
#app .event-time,
#app .section-link {
    border-radius: 8px;
}

#app .modal-content::before {
    border-radius: 6px;
}

/* Calendar table mode */
#app .calendar-weekdays {
    margin-bottom: 0;
    padding: 0;
    border: 1px solid var(--border);
    border-bottom: 0;
    border-radius: 8px 8px 0 0;
    background: #f8fbff;
    overflow: hidden;
}

#app .calendar-weekdays span {
    padding: 8px 0;
    border-right: 1px solid var(--border);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
}

#app .calendar-weekdays span:last-child {
    border-right: 0;
}

#app .calendar-grid {
    gap: 0;
    border: 1px solid var(--border);
    border-top: 0;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: none;
}

#app .calendar-day {
    min-height: 72px;
    padding: 6px 4px;
    justify-content: flex-start;
    align-items: center;
    gap: 4px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    background: #ffffff;
}

#app .calendar-day:nth-child(7n) {
    border-right: 0;
}

#app .calendar-day.blank {
    background: #f8fafc;
}

#app .calendar-day.selected {
    background: var(--primary);
    border-color: #1e40af;
}

#app .calendar-day.today,
#app .calendar-day.selected.today {
    background: #e8f1ff;
}

#app .calendar-day.selected.today {
    background: var(--primary);
}

#app .calendar-day .day-number {
    font-size: 13px;
    font-weight: 700;
}

#app .day-meta {
    display: inline-block;
    min-height: 16px;
    font-size: 10px;
    line-height: 1.2;
    color: var(--text-secondary);
}

#app .day-meta.is-empty {
    opacity: 0;
}

#app .calendar-day.selected .day-number,
#app .calendar-day.selected .day-meta,
#app .calendar-day.selected .meeting-icon {
    color: #ffffff;
}
