body { background-color: var(--bg-primary); margin: 0; -webkit-tap-highlight-color: transparent; }
        .app-container {
            max-width: 480px;
            margin: 0 auto;
            min-height: 100vh;
            min-height: 100dvh;
            background: var(--bg-secondary);
            position: relative;
            box-shadow: 0 0 50px rgba(0,0,0,0.5);
            display: flex;
            flex-direction: column;
            border-left: 1px solid var(--glass-border);
            border-right: 1px solid var(--glass-border);
        }

        /* Top Bar */
        .app-header {
            padding: 1rem 1.5rem;
            border-bottom: 1px solid var(--glass-border);
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: var(--glass-bg);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            position: sticky;
            top: 0;
            z-index: 100;
            padding-top: max(1rem, env(safe-area-inset-top));
        }
        .app-title {
            display: flex;
            align-items: baseline;
            text-decoration: none;
        }
        .app-title .brand-cruz {
            font-family: var(--font-display);
            font-size: 1.8rem;
            font-weight: 400;
            margin-right: 4px;
            letter-spacing: 0.8px;
            text-transform: uppercase;
            color: var(--text-primary);
        }
        .app-title .brand-coaching {
            font-family: 'Archivo', sans-serif;
            font-size: 0.62rem;
            font-weight: 700;
            letter-spacing: 2px;
            text-transform: uppercase;
            color: var(--accent);
        }
        .header-action {
            background: none;
            border: none;
            color: var(--text-secondary);
            font-size: 0.8rem;
            cursor: pointer;
            padding: 6px 12px;
            border-radius: 6px;
            transition: 0.2s;
        }
        .header-action:hover { color: var(--accent); }

        /* Login Screen */
        .login-screen {
            padding: 3rem 2rem;
            display: flex;
            flex-direction: column;
            justify-content: center;
            flex: 1;
        }
        .login-logo {
            text-align: center;
            margin-bottom: 2rem;
        }
        .login-logo .brand-cruz {
            font-family: var(--font-display);
            font-size: 3.3rem;
            font-weight: 400;
            letter-spacing: 1px;
            text-transform: uppercase;
            color: var(--text-primary);
        }
        .login-logo .brand-coaching {
            display: block;
            font-family: 'Archivo', sans-serif;
            font-size: 0.78rem;
            font-weight: 700;
            letter-spacing: 3px;
            text-transform: uppercase;
            color: var(--accent);
            margin-top: -2px;
        }
        .input-group { margin-bottom: 1.5rem; }
        .input-group label { display: block; margin-bottom: 0.5rem; color: var(--text-secondary); font-size: 0.85rem; font-weight: 400; }
        .input-group input {
            width: 100%;
            padding: 0.9rem 1rem;
            background: var(--bg-primary);
            border: 1px solid var(--glass-border);
            color: var(--text-primary);
            border-radius: 10px;
            font-size: 1rem;
            font-family: var(--font-body);
            transition: border-color 0.2s;
        }
        .input-group input:focus { border-color: var(--accent); outline: none; }
        .login-btn {
            width: 100%;
            padding: 1rem;
            background: var(--accent);
            color: #fff;
            border: none;
            border-radius: 10px;
            font-size: 1rem;
            font-weight: 500;
            font-family: var(--font-display);
            cursor: pointer;
            margin-top: 0.5rem;
            transition: all 0.3s;
            box-shadow: 0 4px 20px var(--accent-glow);
        }
        .login-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 30px rgba(176, 38, 255, 0.5); }
        .login-btn:active { transform: scale(0.97); box-shadow: 0 2px 10px var(--accent-glow); }

        /* Dashboard Screen */
        .dashboard-screen {
            display: none;
            flex: 1;
            padding: 1.5rem;
            overflow-y: auto;
        }

        /* Welcome Banner */
        .welcome-banner {
            margin-bottom: 1.5rem;
        }
        .welcome-banner h2 {
            font-family: var(--font-display);
            font-size: 1.4rem;
            font-weight: 500;
            margin-bottom: 4px;
        }
        .welcome-banner p {
            color: var(--text-secondary);
            font-size: 0.85rem;
        }
        
        /* Interactive Calendar Widget */
        .calendar-widget {
            background: var(--glass-bg);
            border: 1px solid var(--glass-border);
            border-radius: 14px;
            padding: 1rem;
            margin-bottom: 1.5rem;
        }
        .calendar-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1rem;
        }
        .calendar-month {
            font-weight: 500;
            font-size: 1rem;
        }
        .calendar-toggle-group {
            display: flex;
            background: var(--bg-secondary);
            border-radius: 20px;
            border: 1px solid var(--glass-border);
            overflow: hidden;
        }
        .cal-toggle-btn {
            background: transparent;
            border: none;
            color: var(--text-secondary);
            padding: 4px 14px;
            font-size: 0.75rem;
            cursor: pointer;
            transition: 0.3s;
            font-family: var(--font-body);
        }
        .cal-toggle-btn.active {
            background: rgba(176, 38, 255, 0.2);
            color: var(--text-primary);
        }
        .calendar-days {
            display: flex;
            justify-content: space-between;
            margin-bottom: 0.5rem;
        }
        .cal-day-label {
            font-size: 0.7rem;
            color: var(--text-secondary);
            width: 36px;
            text-align: center;
            font-weight: 500;
        }
        .calendar-dates {
            display: flex;
            justify-content: space-between;
        }
        .cal-date {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.85rem;
            color: var(--text-secondary);
            cursor: pointer;
            transition: 0.2s;
            -webkit-tap-highlight-color: transparent;
        }
        .cal-date:hover { background: var(--glass-border); }
        .cal-date.active {
            background: var(--accent);
            color: #fff;
            font-weight: 600;
        }
        .cal-date.today:not(.active) {
            border: 1px solid var(--accent);
        }
        .cal-date.has-session::after {
            content: '';
            position: absolute;
            bottom: 0;
            width: 4px;
            height: 4px;
            border-radius: 50%;
            background: #4CAF50;
        }
        .cal-date-container {
            position: relative;
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        /* Monthly View Additions */
        #monthly-view .calendar-dates {
            display: grid;
            grid-template-columns: repeat(7, 1fr);
            gap: 6px 0;
            justify-items: center;
        }
        #monthly-view .cal-date-container { width: 100%; }

        /* Group Dropdown */
        .group-select-container { margin-bottom: 1.5rem; }
        .group-select {
            width: 100%;
            padding: 0.85rem 1rem;
            background: var(--bg-primary);
            border: 1px solid var(--glass-border);
            color: var(--text-primary);
            border-radius: 10px;
            font-size: 0.95rem;
            font-family: var(--font-body);
            appearance: none;
            -webkit-appearance: none;
            cursor: pointer;
            background-image: url('data:image/svg+xml;utf8,<svg fill="%23a3a3a3" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
            background-repeat: no-repeat;
            background-position: right 1rem center;
            transition: border-color 0.2s;
        }
        .group-select:focus { outline: none; border-color: var(--accent); }

        /* Session Details */
        .session-header { margin-bottom: 1rem; }
        .session-date {
            font-weight: 500;
            font-size: 1.05rem;
            margin-bottom: 2px;
        }
        .session-time { color: var(--text-secondary); font-size: 0.85rem; }
        
        .attendance-toggle-box {
            background: var(--bg-primary);
            border-radius: 14px;
            padding: 1.2rem 1.5rem;
            margin-bottom: 1.5rem;
            border: 1px solid var(--glass-border);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .toggle-info h4 { font-size: 1rem; margin-bottom: 3px; font-weight: 500; }
        .toggle-info p { color: var(--text-secondary); font-size: 0.8rem; }

        /* Custom Switch */
        .switch { position: relative; display: inline-block; width: 50px; height: 28px; flex-shrink: 0; }
        .switch input { opacity: 0; width: 0; height: 0; }
        .slider {
            position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
            background-color: var(--bg-secondary);
            border: 1px solid var(--glass-border);
            transition: .3s;
            border-radius: 34px;
        }
        .slider:before {
            position: absolute; content: ""; height: 20px; width: 20px; left: 3px; bottom: 3px;
            background-color: var(--text-secondary);
            transition: .3s;
            border-radius: 50%;
        }
        input:checked + .slider { background-color: var(--accent); border-color: var(--accent); }
        input:checked + .slider:before { transform: translateX(22px); background-color: #fff; }

        /* Roster */
        .roster-section h4 {
            font-weight: 500;
            color: var(--text-secondary);
            font-size: 0.8rem;
            margin-bottom: 0.75rem;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        .roster-list { list-style: none; }
        .roster-item {
            display: flex;
            align-items: center;
            padding: 0.7rem 0;
            border-bottom: 1px solid var(--glass-border);
        }
        .roster-item:last-child { border-bottom: none; }
        .roster-item .avatar {
            width: 34px; height: 34px; border-radius: 50%;
            background: rgba(176, 38, 255, 0.1);
            border: 1px solid rgba(176, 38, 255, 0.2);
            display: flex; align-items: center; justify-content: center;
            font-weight: 500; color: var(--accent); margin-right: 0.8rem; font-size: 0.75rem;
        }
        .roster-name { font-size: 0.9rem; flex: 1; }
        .status-indicator { width: 8px; height: 8px; border-radius: 50%; background: #4CAF50; margin-left: auto; flex-shrink: 0; }
        .status-out { background: #f44336; }

        .roster-item { transition: background 0.15s ease; }
        .roster-item:hover { background: rgba(255,255,255,0.02); }


        .empty-state {
            padding: 3rem 1rem;
            text-align: center;
            color: var(--text-secondary);
        }
        .empty-state-icon {
            font-size: 2.5rem;
            margin-bottom: 0.75rem;
            opacity: 0.4;
        }

        /* Loading spinner */
        .loading-overlay {
            display: none;
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(5,5,5,0.8);
            z-index: 200;
            align-items: center;
            justify-content: center;
        }
        .loading-overlay.show { display: flex; }
        .spinner {
            width: 36px; height: 36px;
            border: 3px solid var(--glass-border);
            border-top-color: var(--accent);
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
        }
        @keyframes spin { to { transform: rotate(360deg); } }

        /* Recording pulse */
        @keyframes pulse-record {
            0%, 100% { box-shadow: 0 0 0 0 rgba(244,67,54,0.4); }
            50% { box-shadow: 0 0 0 8px rgba(244,67,54,0); }
        }
        .recording-active {
            animation: pulse-record 1.5s ease infinite;
        }
