﻿/**
 * Billing WiFi V2 - CSS Foundation
 * Mobile-first design system for Billing WiFi V2
 */

:root {
    /* Brand Colors */
    --v2-primary: #F04444;
    --v2-coral: #FF5A5F;
    --v2-orange: #FF7A1A;
    --v2-warm-orange: #FF9D2E;
    --v2-soft-yellow: #FFC857;

    /* Primary Gradient */
    --v2-gradient: linear-gradient(135deg, #F04444 0%, #FF7A1A 55%, #FF9D2E 100%);
    --v2-gradient-hover: linear-gradient(135deg, #E03A3A 0%, #E87018 55%, #E89225 100%);

    /* Background Colors */
    --v2-bg: #F7F8FC;
    --v2-bg-dark: #EEF1F8;
    --v2-card: #FFFFFF;
    --v2-overlay: rgba(17, 24, 39, 0.45);

    /* Text Colors */
    --v2-text: #17181C;
    --v2-text-secondary: #6F7480;
    --v2-text-muted: #9CA3AF;
    --v2-text-inverse: #FFFFFF;

    /* Border Colors */
    --v2-border: rgba(17, 24, 39, 0.08);
    --v2-border-strong: rgba(17, 24, 39, 0.15);

    /* Status Colors */
    --v2-success: #10B981;
    --v2-success-bg: #ECFDF5;
    --v2-warning: #F59E0B;
    --v2-warning-bg: #FFFBEB;
    --v2-error: #EF4444;
    --v2-error-bg: #FEF2F2;
    --v2-info: #3B82F6;
    --v2-info-bg: #EFF6FF;

    /* Menu Icon Gradients */
    --v2-gradient-customers: linear-gradient(135deg, #3B82F6 0%, #60A5FA 100%);
    --v2-gradient-bills: linear-gradient(135deg, #F97316 0%, #FBBF24 100%);
    --v2-gradient-whatsapp: linear-gradient(135deg, #22C55E 0%, #4ADE80 100%);
    --v2-gradient-reports: linear-gradient(135deg, #8B5CF6 0%, #A78BFA 100%);
    --v2-gradient-settings: linear-gradient(135deg, #1F2937 0%, #4B5563 100%);
    --v2-gradient-activity: linear-gradient(135deg, #EF4444 0%, #F87171 100%);
    --v2-gradient-mikrotik: linear-gradient(135deg, #06B6D4 0%, #3B82F6 100%);
    --v2-gradient-olt: linear-gradient(135deg, #EC4899 0%, #8B5CF6 100%);
    --v2-gradient-acs: linear-gradient(135deg, #14B8A6 0%, #3B82F6 100%);

    /* Shadows */
    --v2-shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04);
    --v2-shadow-md: 0 10px 30px rgba(15, 23, 42, 0.06), 0 2px 8px rgba(15, 23, 42, 0.04);
    --v2-shadow-lg: 0 20px 40px rgba(15, 23, 42, 0.08), 0 4px 12px rgba(15, 23, 42, 0.05);
    --v2-shadow-glow: 0 10px 40px rgba(240, 68, 68, 0.25);

    /* Border Radius */
    --v2-radius-sm: 8px;
    --v2-radius-md: 12px;
    --v2-radius-lg: 16px;
    --v2-radius-xl: 20px;
    --v2-radius-2xl: 24px;
    --v2-radius-full: 9999px;

    /* Transitions */
    --v2-transition: 140ms ease;
    --v2-transition-slow: 280ms ease;
}
/* ============================================
   2. MOBILE SHELL & LAYOUT
   ============================================ */

/* Mobile Shell Container */
.v2-shell {
    width: 100%;
    max-width: 430px;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0 auto;
    background: var(--v2-bg);
    position: relative;
    overflow-x: hidden;
}

/* Desktop: Centered with outer background */
@media (min-width: 431px) {
    .v2-shell {
        box-shadow: 0 0 60px rgba(0, 0, 0, 0.1);
        border-left: 1px solid var(--v2-border);
        border-right: 1px solid var(--v2-border);
    }
}

/* Global Outer Background for Desktop */
.v2-outer-bg {
    background: #1a1a2e;
    min-height: 100vh;
    min-height: 100dvh;
}

@media (min-width: 431px) {
    .v2-outer-bg {
        padding: 20px 0;
    }
}

/* Safe Area Support */
.v2-safe-top {
    padding-top: env(safe-area-inset-top, 0px);
}

.v2-safe-bottom {
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* ============================================
   3. TYPOGRAPHY
   ============================================ */

.v2-text-xs { font-size: 11px; line-height: 1.4; }
.v2-text-sm { font-size: 13px; line-height: 1.5; }
.v2-text-base { font-size: 15px; line-height: 1.5; }
.v2-text-lg { font-size: 17px; line-height: 1.5; }
.v2-text-xl { font-size: 20px; line-height: 1.3; }
.v2-text-2xl { font-size: 24px; line-height: 1.2; }
.v2-text-3xl { font-size: 28px; line-height: 1.15; }

.v2-font-medium { font-weight: 500; }
.v2-font-semibold { font-weight: 600; }
.v2-font-bold { font-weight: 700; }

.v2-text-primary { color: var(--v2-primary); }
.v2-text-secondary { color: var(--v2-text-secondary); }
.v2-text-muted { color: var(--v2-text-muted); }
.v2-text-success { color: var(--v2-success); }
.v2-text-warning { color: var(--v2-warning); }
.v2-text-error { color: var(--v2-error); }

/* ============================================
   4. SPACING
   ============================================ */

.v2-space-y-1 { margin-top: 4px; }
.v2-space-y-2 { margin-top: 8px; }
.v2-space-y-3 { margin-top: 12px; }
.v2-space-y-4 { margin-top: 16px; }
.v2-space-y-5 { margin-top: 20px; }
.v2-space-y-6 { margin-top: 24px; }

.v2-p-3 { padding: 12px; }
.v2-p-4 { padding: 16px; }
.v2-p-5 { padding: 20px; }
.v2-p-6 { padding: 24px; }

.v2-px-3 { padding-left: 12px; padding-right: 12px; }
.v2-px-4 { padding-left: 16px; padding-right: 16px; }
.v2-px-5 { padding-left: 20px; padding-right: 20px; }

.v2-py-2 { padding-top: 8px; padding-bottom: 8px; }
.v2-py-3 { padding-top: 12px; padding-bottom: 12px; }
.v2-py-4 { padding-top: 16px; padding-bottom: 16px; }

.v2-gap-2 { gap: 8px; }
.v2-gap-3 { gap: 12px; }
.v2-gap-4 { gap: 16px; }

/* ============================================
   5. CARD SYSTEM
   ============================================ */

.v2-card {
    background: var(--v2-card);
    border-radius: var(--v2-radius-xl);
    border: 1px solid var(--v2-border);
    box-shadow: var(--v2-shadow-md);
    padding: 16px;
    transition: transform var(--v2-transition), box-shadow var(--v2-transition);
}

.v2-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--v2-shadow-lg);
}

.v2-card-flat {
    background: var(--v2-card);
    border-radius: var(--v2-radius-lg);
    border: 1px solid var(--v2-border);
    padding: 14px 16px;
}

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

.v2-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--v2-text);
}

/* ============================================
   6. BUTTON SYSTEM
   ============================================ */

/* Primary Button */
.v2-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    padding: 0 20px;
    background: var(--v2-gradient);
    color: var(--v2-text-inverse);
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--v2-radius-lg);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(240, 68, 68, 0.25);
    transition: transform var(--v2-transition), box-shadow var(--v2-transition);
}

.v2-btn-primary:hover {
    background: var(--v2-gradient-hover);
    box-shadow: 0 6px 20px rgba(240, 68, 68, 0.35);
}

.v2-btn-primary:active {
    transform: scale(0.97);
    box-shadow: 0 2px 8px rgba(240, 68, 68, 0.2);
}

.v2-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Secondary Button */
.v2-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    padding: 0 20px;
    background: var(--v2-bg);
    color: var(--v2-text);
    font-size: 15px;
    font-weight: 500;
    border-radius: var(--v2-radius-lg);
    border: 1px solid var(--v2-border-strong);
    cursor: pointer;
    transition: transform var(--v2-transition), background var(--v2-transition);
}

.v2-btn-secondary:hover {
    background: var(--v2-bg-dark);
}

.v2-btn-secondary:active {
    transform: scale(0.97);
}

/* Ghost Button */
.v2-btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 40px;
    padding: 0 14px;
    background: transparent;
    color: var(--v2-text-secondary);
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--v2-radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--v2-transition);
}

.v2-btn-ghost:hover {
    background: var(--v2-bg);
    color: var(--v2-text);
}

/* Icon Button */
.v2-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--v2-bg);
    color: var(--v2-text-secondary);
    border-radius: var(--v2-radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--v2-transition);
}

.v2-btn-icon:hover {
    background: var(--v2-bg-dark);
    color: var(--v2-text);
}

.v2-btn-icon:active {
    transform: scale(0.94);
}

/* Danger Button */
.v2-btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    padding: 0 20px;
    background: var(--v2-error);
    color: white;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--v2-radius-lg);
    border: none;
    cursor: pointer;
    transition: all var(--v2-transition);
}

.v2-btn-danger:hover {
    background: #dc2626;
}

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

/* Full Width Button */
.v2-btn-full {
    width: 100%;
}

/* Small Button */
.v2-btn-sm {
    height: 36px;
    padding: 0 14px;
    font-size: 13px;
}

/* ============================================
   7. PRESS EFFECT (Global)
   ============================================ */

.v2-press {
    transition: transform var(--v2-transition), box-shadow var(--v2-transition);
    cursor: pointer;
}

.v2-press:hover {
    transform: translateY(-1px);
}

.v2-press:active {
    transform: scale(0.96);
    box-shadow: var(--v2-shadow-sm);
}
/* ============================================
   8. TOAST SYSTEM
   ============================================ */

.v2-toast-container {
    position: fixed;
    top: env(safe-area-inset-top, 16px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    width: calc(100% - 32px);
    max-width: 398px;
    pointer-events: none;
}

.v2-toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: var(--v2-card);
    border-radius: var(--v2-radius-lg);
    box-shadow: var(--v2-shadow-lg);
    border: 1px solid var(--v2-border);
    pointer-events: auto;
    margin-bottom: 8px;
}

.v2-toast-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.v2-toast-success .v2-toast-icon { color: var(--v2-success); }
.v2-toast-error .v2-toast-icon { color: var(--v2-error); }
.v2-toast-warning .v2-toast-icon { color: var(--v2-warning); }
.v2-toast-info .v2-toast-icon { color: var(--v2-info); }

.v2-toast-content {
    flex: 1;
    min-width: 0;
}

.v2-toast-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--v2-text);
    margin-bottom: 2px;
}

.v2-toast-message {
    font-size: 13px;
    color: var(--v2-text-secondary);
    line-height: 1.4;
}

.v2-toast-close {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--v2-text-muted);
    cursor: pointer;
    border-radius: var(--v2-radius-sm);
    transition: all var(--v2-transition);
}

.v2-toast-close:hover {
    background: var(--v2-bg);
    color: var(--v2-text);
}

/* ============================================
   9. SKELETON LOADING
   ============================================ */

@keyframes v2-skeleton-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.v2-skeleton {
    background: linear-gradient(90deg, var(--v2-bg) 25%, var(--v2-bg-dark) 50%, var(--v2-bg) 75%);
    background-size: 200% 100%;
    animation: v2-skeleton-shimmer 1.5s infinite;
    border-radius: var(--v2-radius-md);
}

@keyframes v2-skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.v2-skeleton-text {
    height: 14px;
    margin-bottom: 8px;
}

.v2-skeleton-text-sm {
    height: 12px;
    width: 60%;
}

.v2-skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--v2-radius-full);
}

.v2-skeleton-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--v2-radius-lg);
}

.v2-skeleton-card {
    height: 120px;
    border-radius: var(--v2-radius-xl);
}

/* ============================================
   10. EMPTY STATE
   ============================================ */

.v2-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    text-align: center;
}

.v2-empty-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--v2-bg);
    border-radius: var(--v2-radius-full);
    margin-bottom: 20px;
    color: var(--v2-text-muted);
}

.v2-empty-icon svg {
    width: 40px;
    height: 40px;
}

.v2-empty-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--v2-text);
    margin-bottom: 8px;
}

.v2-empty-description {
    font-size: 14px;
    color: var(--v2-text-secondary);
    max-width: 280px;
    margin-bottom: 20px;
}

/* ============================================
   11. MODAL
   ============================================ */

.v2-modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--v2-overlay);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.v2-modal {
    background: var(--v2-card);
    border-radius: var(--v2-radius-2xl);
    box-shadow: var(--v2-shadow-lg);
    width: 100%;
    max-width: 360px;
    max-height: calc(100vh - 32px);
    overflow: hidden;
}

.v2-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 0;
}

.v2-modal-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--v2-text);
}

.v2-modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--v2-text-muted);
    cursor: pointer;
    border-radius: var(--v2-radius-md);
    transition: all var(--v2-transition);
}

.v2-modal-close:hover {
    background: var(--v2-bg);
    color: var(--v2-text);
}

.v2-modal-body {
    padding: 16px 20px 20px;
}

.v2-modal-footer {
    display: flex;
    gap: 12px;
    padding: 0 20px 20px;
}

.v2-modal-footer .v2-btn-primary,
.v2-modal-footer .v2-btn-secondary {
    flex: 1;
}

/* ============================================
   12. BOTTOM SHEET
   ============================================ */

.v2-bottom-sheet-overlay {
    position: fixed;
    inset: 0;
    background: var(--v2-overlay);
    z-index: 9998;
}

.v2-bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 430px;
    background: var(--v2-card);
    border-radius: var(--v2-radius-2xl) var(--v2-radius-2xl) 0 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    max-height: 85vh;
    overflow-y: auto;
}

.v2-bottom-sheet-handle {
    width: 36px;
    height: 4px;
    background: var(--v2-border-strong);
    border-radius: var(--v2-radius-full);
    margin: 12px auto;
}

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

.v2-bottom-sheet-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--v2-text);
}

.v2-bottom-sheet-body {
    padding: 16px 20px 20px;
}

.v2-bottom-sheet-footer {
    padding: 12px 20px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--v2-border);
    display: flex;
    gap: 12px;
}

/* ============================================
   13. FORM INPUTS
   ============================================ */

.v2-input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    font-size: 16px; /* Prevents iOS auto-zoom */
    color: var(--v2-text);
    background: var(--v2-card);
    border: 1.5px solid var(--v2-border-strong);
    border-radius: var(--v2-radius-lg);
    transition: all var(--v2-transition);
}

.v2-input:focus {
    outline: none;
    border-color: var(--v2-primary);
    box-shadow: 0 0 0 3px rgba(240, 68, 68, 0.12);
}

.v2-input::placeholder {
    color: var(--v2-text-muted);
}

.v2-input-error {
    border-color: var(--v2-error);
}

.v2-input-error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

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

.v2-input-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--v2-text);
    margin-bottom: 8px;
}

.v2-input-hint {
    font-size: 12px;
    color: var(--v2-text-muted);
    margin-top: 6px;
}

.v2-input-error-message {
    font-size: 12px;
    color: var(--v2-error);
    margin-top: 6px;
}

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

/* ============================================
   14. BADGE / STATUS
   ============================================ */

.v2-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: var(--v2-radius-full);
}

.v2-badge-success {
    background: var(--v2-success-bg);
    color: var(--v2-success);
}

.v2-badge-warning {
    background: var(--v2-warning-bg);
    color: var(--v2-warning);
}

.v2-badge-error {
    background: var(--v2-error-bg);
    color: var(--v2-error);
}

.v2-badge-info {
    background: var(--v2-info-bg);
    color: var(--v2-info);
}

.v2-badge-neutral {
    background: var(--v2-bg);
    color: var(--v2-text-secondary);
}
/* ============================================
   15. ICON CONTAINER SYSTEM (Semi-3D)
   ============================================ */

/* Base Icon Container */
.v2-icon-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--v2-radius-lg);
    position: relative;
    flex-shrink: 0;
    transition: transform var(--v2-transition), box-shadow var(--v2-transition);
}

.v2-icon-container::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1.5px;
    background: linear-gradient(135deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 50%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.v2-icon-container::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 -2px 4px rgba(0,0,0,0.1);
    pointer-events: none;
}

/* Icon inner content */
.v2-icon-container svg {
    width: 24px;
    height: 24px;
    position: relative;
    z-index: 1;
}

/* Small icon container */
.v2-icon-sm {
    width: 36px;
    height: 36px;
    border-radius: var(--v2-radius-md);
}

.v2-icon-sm svg {
    width: 18px;
    height: 18px;
}

/* Large icon container */
.v2-icon-lg {
    width: 56px;
    height: 56px;
    border-radius: var(--v2-radius-xl);
}

.v2-icon-lg svg {
    width: 28px;
    height: 28px;
}

/* Extra large icon container */
.v2-icon-xl {
    width: 64px;
    height: 64px;
    border-radius: var(--v2-radius-xl);
}

.v2-icon-xl svg {
    width: 32px;
    height: 32px;
}

/* Gradient backgrounds for icon containers */
.v2-icon-customers {
    background: var(--v2-gradient-customers);
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
}

.v2-icon-bills {
    background: var(--v2-gradient-bills);
    box-shadow: 0 4px 14px rgba(249, 115, 22, 0.3);
}

.v2-icon-whatsapp {
    background: var(--v2-gradient-whatsapp);
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.3);
}

.v2-icon-reports {
    background: var(--v2-gradient-reports);
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.3);
}

.v2-icon-settings {
    background: var(--v2-gradient-settings);
    box-shadow: 0 4px 14px rgba(31, 41, 55, 0.3);
}

.v2-icon-activity {
    background: var(--v2-gradient-activity);
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

.v2-icon-mikrotik {
    background: var(--v2-gradient-mikrotik);
    box-shadow: 0 4px 14px rgba(6, 182, 212, 0.3);
}

.v2-icon-olt {
    background: var(--v2-gradient-olt);
    box-shadow: 0 4px 14px rgba(236, 72, 153, 0.3);
}

.v2-icon-acs {
    background: var(--v2-gradient-acs);
    box-shadow: 0 4px 14px rgba(20, 184, 166, 0.3);
}

.v2-icon-primary {
    background: var(--v2-gradient);
    box-shadow: 0 4px 14px rgba(240, 68, 68, 0.3);
}

.v2-icon-success {
    background: linear-gradient(135deg, #10B981 0%, #34D399 100%);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.v2-icon-warning {
    background: linear-gradient(135deg, #F59E0B 0%, #FBBF24 100%);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
}

.v2-icon-error {
    background: linear-gradient(135deg, #EF4444 0%, #F87171 100%);
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

/* Icon container press effect */
.v2-icon-press {
    cursor: pointer;
}

.v2-icon-press:hover {
    transform: translateY(-2px);
}

.v2-icon-press:active {
    transform: scale(0.94);
}

/* ============================================
   16. PAGE LAYOUT UTILITIES
   ============================================ */

.v2-page {
    padding: 16px;
    padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px));
}

.v2-page-header {
    margin-bottom: 20px;
}

.v2-page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--v2-text);
    line-height: 1.2;
}

.v2-page-subtitle {
    font-size: 14px;
    color: var(--v2-text-secondary);
    margin-top: 4px;
}

.v2-section {
    margin-bottom: 24px;
}

.v2-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--v2-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

/* ============================================
   17. LIST ITEMS
   ============================================ */

.v2-list-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--v2-card);
    border-radius: var(--v2-radius-lg);
    margin-bottom: 10px;
    border: 1px solid var(--v2-border);
    transition: all var(--v2-transition);
}

.v2-list-item:hover {
    background: var(--v2-bg);
}

.v2-list-item:active {
    transform: scale(0.99);
}

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

.v2-list-item-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--v2-text);
    margin-bottom: 2px;
}

.v2-list-item-subtitle {
    font-size: 13px;
    color: var(--v2-text-secondary);
}

.v2-list-item-action {
    flex-shrink: 0;
}

/* ============================================
   18. DIVIDERS
   ============================================ */

.v2-divider {
    height: 1px;
    background: var(--v2-border);
    margin: 16px 0;
}

.v2-divider-vertical {
    width: 1px;
    height: 24px;
    background: var(--v2-border);
}

/* ============================================
   19. UTILITY CLASSES
   ============================================ */

.v2-hidden { display: none; }
.v2-flex { display: flex; }
.v2-flex-col { flex-direction: column; }
.v2-items-center { align-items: center; }
.v2-justify-center { justify-content: center; }
.v2-justify-between { justify-content: space-between; }
.v2-flex-1 { flex: 1; }
.v2-flex-shrink-0 { flex-shrink: 0; }

.v2-w-full { width: 100%; }
.v2-min-w-0 { min-width: 0; }

.v2-overflow-hidden { overflow: hidden; }
.v2-overflow-x-auto { overflow-x: auto; }
.v2-overflow-y-auto { overflow-y: auto; }

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

.v2-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================
   20. ANIMATIONS
   ============================================ */

@keyframes v2-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes v2-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes v2-slide-down {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes v2-scale-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes v2-bounce-in {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.v2-animate-fade-in { animation: v2-fade-in 0.3s ease forwards; }
.v2-animate-slide-up { animation: v2-slide-up 0.4s ease forwards; }
.v2-animate-slide-down { animation: v2-slide-down 0.4s ease forwards; }
.v2-animate-scale-in { animation: v2-scale-in 0.3s ease forwards; }
.v2-animate-bounce-in { animation: v2-bounce-in 0.4s ease forwards; }

/* Staggered animations */
.v2-stagger > *:nth-child(1) { animation-delay: 0ms; }
.v2-stagger > *:nth-child(2) { animation-delay: 50ms; }
.v2-stagger > *:nth-child(3) { animation-delay: 100ms; }
.v2-stagger > *:nth-child(4) { animation-delay: 150ms; }
.v2-stagger > *:nth-child(5) { animation-delay: 200ms; }
.v2-stagger > *:nth-child(6) { animation-delay: 250ms; }

/* ============================================
   21. PWA STANDALONE MODE FIXES
   ============================================ */

/* Safe area - only apply in browser mode */
.v2-safe-top {
    padding-top: env(safe-area-inset-top, 0px);
}

/* Header safe top - browser mode only, no padding in standalone */
.header-safe-top {
    padding-top: env(safe-area-inset-top, 0px);
}

/* Remove extra top padding in iOS standalone mode */
@supports (padding-top: env(safe-area-inset-top)) {
    @media display-mode: standalone {
        .v2-safe-top {
            padding-top: 0 !important;
        }

        .header-safe-top {
            padding-top: 0 !important;
        }

        /* Bottom nav sticks to bottom in standalone */
        .bottom-nav-fixed {
            bottom: env(safe-area-inset-bottom, 0px) !important;
        }

        /* Adjust content padding for standalone */
        .mobile-content-pb {
            padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
        }

        body.dashboard-page .mobile-content-pb {
            padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px));
        }
    }
}

/* Desktop PWA window adjustments */
@media (display-mode: standalone) and (min-width: 431px) {
    .v2-outer-bg {
        padding: 0 !important;
    }

    .v2-shell {
        box-shadow: none !important;
        border: none !important;
    }
}
