/* CSS Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #4F46E5;
    --primary-dark: #4338CA;
    --primary-light: #818CF8;
    --secondary: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    --nav-height: 56px;
    --bottom-nav-height: 64px;
    --safe-area-inset-top: env(safe-area-inset-top, 0px);
    --safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
}

html {
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
    background-color: #4F46E5;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Top Navigation */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: calc(var(--nav-height) + var(--safe-area-inset-top));
    padding-top: var(--safe-area-inset-top);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 8px;
    padding-right: 8px;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(79, 70, 229, 0.3);
}

.top-nav::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
}

.top-nav .nav-btn,
.top-nav .nav-logo,
.top-nav .nav-spacer {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    text-decoration: none;
    color: white;
    font-size: 1.125rem;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.top-nav .nav-btn:hover,
.top-nav .nav-logo:hover {
    background: rgba(255, 255, 255, 0.15);
}

.top-nav .nav-btn:active,
.top-nav .nav-logo:active {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(0.9);
}

.top-nav .nav-btn i,
.top-nav .nav-logo i {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.top-nav .nav-btn:active i,
.top-nav .nav-logo:active i {
    transform: scale(0.85);
}

.top-nav .nav-title {
    font-size: 1.1rem;
    font-weight: 700;
    flex: 1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
}

/* Main Content */
.main-content {
    padding-top: calc(var(--nav-height) + var(--safe-area-inset-top));
    padding-bottom: calc(var(--bottom-nav-height) + var(--safe-area-inset-bottom) + 16px);
    min-height: 100vh;
}

.main-content.no-bottom-nav {
    padding-bottom: 16px;
}

.main-content.has-fab {
    padding-bottom: calc(var(--bottom-nav-height) + var(--safe-area-inset-bottom) + 80px);
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--bottom-nav-height) + var(--safe-area-inset-bottom));
    padding-bottom: var(--safe-area-inset-bottom);
    background: white;
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    border-top: 1px solid var(--gray-100);
}

.bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 16px;
    color: var(--gray-400);
    text-decoration: none;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 64px;
    position: relative;
    border-radius: 12px;
}

.bottom-nav .nav-item i {
    font-size: 1.35rem;
    margin-bottom: 4px;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.bottom-nav .nav-item span {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.bottom-nav .nav-item.active i {
    transform: scale(1.1);
}

.bottom-nav .nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 3px;
    background: var(--primary);
    border-radius: 0 0 3px 3px;
    animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) scaleX(0);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) scaleX(1);
    }
}

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

.bottom-nav .nav-item:active i {
    transform: scale(0.85);
}

/* Floating Action Button */
.fab {
    position: fixed !important;
    bottom: calc(var(--bottom-nav-height) + var(--safe-area-inset-bottom) + 16px);
    right: 16px;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.4), 0 2px 4px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    z-index: 900;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s;
    -webkit-tap-highlight-color: transparent;
    animation: fabPulse 2s ease-in-out infinite;
}

@keyframes fabPulse {
    0%, 100% { box-shadow: 0 4px 16px rgba(79, 70, 229, 0.4), 0 2px 4px rgba(0, 0, 0, 0.1); }
    50% { box-shadow: 0 6px 24px rgba(79, 70, 229, 0.5), 0 2px 4px rgba(0, 0, 0, 0.1); }
}

.fab:hover {
    transform: scale(1.05);
}

.fab:active {
    transform: scale(0.9);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.4);
    animation: none;
}

.fab i {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.fab:active i {
    transform: rotate(90deg);
}

/* Cards */
.card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    margin: 12px 16px;
    overflow: hidden;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s;
}

.card:active:not(:has(button:active, a:active, input:focus, select:focus)) {
    transform: scale(0.98);
}

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

.card-header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
}

.card-body {
    padding: 16px;
}

.card-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

/* List Items */
.list {
    background: white;
    margin: 12px 16px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.list-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--gray-100);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

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

.list-item:active {
    background: var(--gray-50);
    transform: scale(0.985);
}

.list-item-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 14px;
    font-size: 1.1rem;
    flex-shrink: 0;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.list-item:active .list-item-icon {
    transform: scale(0.9);
}

.list-item-icon.green { background: linear-gradient(135deg, #34D399 0%, var(--secondary) 100%); }
.list-item-icon.red { background: linear-gradient(135deg, #F87171 0%, var(--danger) 100%); }
.list-item-icon.yellow { background: linear-gradient(135deg, #FBBF24 0%, var(--warning) 100%); }
.list-item-icon.gray { background: linear-gradient(135deg, var(--gray-300) 0%, var(--gray-400) 100%); }
.list-item-icon.blue { background: linear-gradient(135deg, #60A5FA 0%, #2563EB 100%); }

.list-item-content {
    flex: 1;
    min-width: 0;
}

.list-item-title {
    font-weight: 500;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-item-subtitle {
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin-top: 2px;
}

.list-item-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.list-item-arrow {
    color: var(--gray-400);
    margin-left: 8px;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-primary { background: var(--primary-light); color: var(--primary-dark); }
.badge-success { background: #D1FAE5; color: #065F46; }
.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-danger { background: #FEE2E2; color: #991B1B; }
.badge-gray { background: var(--gray-200); color: var(--gray-700); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, transparent 50%);
    pointer-events: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.btn-primary:active {
    transform: scale(0.95);
    box-shadow: 0 1px 4px rgba(79, 70, 229, 0.3);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-secondary:active {
    background: var(--gray-200);
    transform: scale(0.95);
}

.btn-success {
    background: linear-gradient(135deg, #34D399 0%, var(--secondary) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

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

.btn-danger {
    background: linear-gradient(135deg, #F87171 0%, var(--danger) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

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

.btn-warning {
    background: linear-gradient(135deg, #FBBF24 0%, var(--warning) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

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

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

.btn-outline::before {
    display: none;
}

.btn-outline:active {
    background: var(--primary);
    color: white;
    transform: scale(0.95);
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-sm {
    padding: 10px 16px;
    font-size: 0.875rem;
    border-radius: 10px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.125rem;
    border-radius: 14px;
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    background: white;
    color: var(--gray-800);
    transition: border-color 0.2s;
    -webkit-appearance: none;
}

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

.form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 48px;
}

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

/* Checkbox */
.checkbox-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: white;
    border-bottom: 1px solid var(--gray-100);
    cursor: pointer;
}

.checkbox-item:active {
    background: var(--gray-50);
}

.checkbox-input {
    display: none;
}

.checkbox-box {
    width: 24px;
    height: 24px;
    border: 2px solid var(--gray-300);
    border-radius: 6px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.checkbox-input:checked + .checkbox-box {
    background: var(--secondary);
    border-color: var(--secondary);
}

.checkbox-input:checked + .checkbox-box::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: white;
    font-size: 0.75rem;
}

.checkbox-content {
    flex: 1;
}

.checkbox-label {
    font-weight: 500;
    color: var(--gray-800);
}

.checkbox-subtitle {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.checkbox-input:checked ~ .checkbox-content .checkbox-label {
    text-decoration: line-through;
    color: var(--gray-400);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 12px 16px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stat-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    font-size: 1.125rem;
}

.stat-card-icon.primary { background: #EEF2FF; color: var(--primary); }
.stat-card-icon.success { background: #D1FAE5; color: var(--secondary); }
.stat-card-icon.warning { background: #FEF3C7; color: var(--warning); }
.stat-card-icon.danger { background: #FEE2E2; color: var(--danger); }

.stat-card-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-800);
    line-height: 1;
}

.stat-card-label {
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin-top: 4px;
}

/* Section Headers */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px 8px;
}

.section-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.section-action {
    font-size: 0.875rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: calc(var(--nav-height) + 12px);
    left: 16px;
    right: 16px;
    padding: 12px 16px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1100;
    animation: slideDown 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast-success {
    background: var(--secondary);
    color: white;
}

.toast-error {
    background: var(--danger);
    color: white;
}

@keyframes slideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes fadeOut {
    to { opacity: 0; transform: translateY(-20px); }
}

/* Progress Bar */
.progress-bar {
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--secondary);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 48px 32px;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--gray-100);
    color: var(--gray-400);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 2rem;
}

.empty-state-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 8px;
}

.empty-state-text {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-bottom: 24px;
}

/* Login Page */
.login-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 48px 24px;
    padding-top: calc(48px + var(--safe-area-inset-top));
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.login-logo {
    text-align: center;
    margin-bottom: 48px;
}

.login-logo i {
    font-size: 4rem;
    color: white;
    margin-bottom: 16px;
}

.login-logo h1 {
    font-size: 1.5rem;
    color: white;
    font-weight: 700;
}

.login-logo p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
}

.login-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.login-error {
    background: #FEE2E2;
    color: #991B1B;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--gray-500); }
.text-small { font-size: 0.875rem; }
.text-danger { color: var(--danger); }
.text-success { color: var(--secondary); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.p-2 { padding: 16px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.w-100 { width: 100%; }

/* Alert boxes */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin: 12px 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.alert-warning {
    background: #FEF3C7;
    color: #92400E;
}

.alert-danger {
    background: #FEE2E2;
    color: #991B1B;
}

.alert-info {
    background: #DBEAFE;
    color: #1E40AF;
}

.alert i {
    font-size: 1.125rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.alert-text {
    font-size: 0.875rem;
}

/* Swipe Actions */
.swipe-container {
    overflow: hidden;
}

.swipe-item {
    position: relative;
}

.swipe-actions {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    display: flex;
}

.swipe-action {
    width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
}

.swipe-action-edit { background: var(--primary); }
.swipe-action-delete { background: var(--danger); }

/* Pull to refresh indicator */
.pull-indicator {
    text-align: center;
    padding: 16px;
    color: var(--gray-500);
    font-size: 0.875rem;
}

/* Search Bar */
/* Page-level Search Bar (units, supplies, etc.) */
.search-bar {
    padding: 12px 16px;
    background: white;
    margin: 12px 16px 0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrapper > i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    pointer-events: none;
    z-index: 1;
    font-size: 0.9rem;
}

.search-bar .search-input {
    width: 100%;
    padding: 12px 16px 12px 42px;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    font-size: 1rem;
    background: var(--gray-50);
    -webkit-appearance: none;
    appearance: none;
}

.search-bar .search-input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Quantity Controls */
.qty-control {
    display: flex;
    align-items: center;
    gap: 12px;
}

.qty-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--gray-300);
    background: white;
    color: var(--gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
}

.qty-btn:active {
    background: var(--gray-100);
}

.qty-value {
    font-size: 1.125rem;
    font-weight: 600;
    min-width: 40px;
    text-align: center;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal {
    background: white;
    border-radius: 16px 16px 0 0;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

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

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--gray-100);
    color: var(--gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.modal-body {
    padding: 16px;
}

.modal-footer {
    padding: 16px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: 12px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* Tab Navigation */
.tabs {
    display: flex;
    background: white;
    padding: 8px;
    margin: 12px 16px;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-600);
    text-decoration: none;
    transition: all 0.2s;
}

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

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

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

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

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

/* Enhanced Click/Tap Feedback */
.clickable,
a:not(.no-feedback):not(.fab),
button:not(.no-feedback),
.btn,
.list-item,
.nav-item,
.nav-btn,
.nav-logo,
.card[onclick],
[data-link] {
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

.clickable::after,
a:not(.no-feedback):not(.fab)::after,
button:not(.no-feedback)::after,
.btn::after,
.list-item::after,
.nav-item::after,
.nav-btn::after,
.nav-logo::after,
.card[onclick]::after,
[data-link]::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(0,0,0,0.1) 0%, transparent 70%);
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
    pointer-events: none;
    border-radius: inherit;
}

.clickable:active::after,
a:not(.no-feedback):not(.fab):active::after,
button:not(.no-feedback):active::after,
.btn:active::after,
.list-item:active::after,
.nav-item:active::after,
.nav-btn:active::after,
.nav-logo:active::after,
.card[onclick]:active::after,
[data-link]:active::after {
    transform: translate(-50%, -50%) scale(2.5);
    opacity: 1;
    transition: transform 0s, opacity 0s;
}

/* Button loading state */
.btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn.loading::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

/* Active state enhancements */
.btn:active:not(:disabled) {
    transform: scale(0.97);
}

.list-item:active {
    background: var(--gray-100) !important;
}

/* nav-btn active states are defined in .top-nav section */

/* Bottom nav enhancements - ensure it sticks */
html, body {
    height: 100%;
    overflow-x: hidden;
}

body {
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.bottom-nav {
    flex-shrink: 0;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
}

/* Pressed state for form elements */
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    outline: none;
}

/* Checkbox/radio enhanced feedback */
.checkbox-item:active,
.radio-item:active {
    background: var(--gray-100);
}

/* Toast animation */
.toast {
    animation: toastSlideIn 0.3s ease-out;
}

@keyframes toastSlideIn {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Calendar Badges (Unit View) */
.calendar-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 0 16px;
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
    clear: both;
}

.calendar-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.calendar-badge i,
.calendar-badge i.fab,
.calendar-badge i.fas {
    font-size: inherit !important;
    width: auto !important;
    height: auto !important;
    position: static !important;
    display: inline !important;
    transform: none !important;
    left: auto !important;
    top: auto !important;
    color: inherit !important;
}

.calendar-badge.airbnb {
    background: #FFE5E5;
    color: #FF5A5F;
}

.calendar-badge.vrbo {
    background: #E5F0FF;
    color: #0061E0;
}

.calendar-badge.booking {
    background: #E5ECFF;
    color: #003580;
}

.calendar-badge.other {
    background: #F3F4F6;
    color: #6B7280;
}

/* Pull to Refresh Indicator */
.pull-indicator {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 20px;
    background: white;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: opacity 0.2s;
    opacity: 0;
    pointer-events: none;
}

.pull-indicator.visible {
    opacity: 1;
}

.pull-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    border-radius: 50%;
    color: var(--gray-500);
    font-size: 1rem;
    transition: transform 0.1s ease-out, background 0.2s, color 0.2s;
}

.pull-indicator.ready .pull-icon {
    background: var(--primary);
    color: white;
}

.pull-text {
    margin-top: 6px;
    font-size: 0.75rem;
    color: var(--gray-500);
    font-weight: 500;
    white-space: nowrap;
}

.pull-indicator.ready .pull-text {
    color: var(--primary);
}

/* Trial Banner */
.trial-banner {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    color: white;
    padding: 10px 16px;
    font-size: 0.85rem;
    text-align: center;
    z-index: 99;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.trial-banner i {
    font-size: 1rem;
}

.trial-banner strong {
    font-size: 1.1rem;
}

.trial-banner a {
    color: white;
    font-weight: 600;
    text-decoration: underline;
    margin-left: 8px;
}

.trial-banner a:hover {
    text-decoration: none;
}

/* Adjust main content when trial banner is visible */
body:has(.trial-banner) .main-content {
    padding-top: calc(var(--nav-height) + var(--safe-area-inset-top) + 44px + 16px);
}
