:root {
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.75);
    --border-card: rgba(255, 255, 255, 0.1);
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-yellow: #f59e0b;
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --bottom-nav-height: 64px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.15) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    padding: 1rem;
    padding-bottom: calc(var(--bottom-nav-height) + 1.5rem + env(safe-area-inset-bottom));
}

/* Header Section */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-card);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
}

.brand-title h1 {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(1.2rem, 4vw, 1.6rem);
    font-weight: 700;
}

.brand-title p {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.header-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* User Profile Badge */
.user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-card);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

/* Buttons Touch Optimized */
.btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-card);
    color: var(--text-main);
    min-height: 44px;
    padding: 8px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border: none;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.btn-google {
    background: #ffffff;
    color: #1e293b;
    font-weight: 600;
    width: 100%;
    min-height: 52px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.15);
}

.btn-google:hover {
    background: #f1f5f9;
}

/* Stats Row */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-card);
    border-radius: 16px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.stat-icon.green { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.stat-icon.red { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.stat-icon.yellow { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.stat-icon.purple { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }

.stat-info h3 {
    font-size: 1.3rem;
    font-weight: 700;
}

.stat-info p {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Search Bar */
.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 1.5rem;
}

.input-search {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text-main);
    font-size: 0.95rem;
    outline: none;
    min-height: 48px;
}

.input-search:focus {
    border-color: var(--accent-blue);
}

/* Teacher Cards Grid (Mobile Native Single Column) */
.teachers-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.2rem;
}

@media (min-width: 640px) {
    .teachers-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }
}

.teacher-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-card);
    border-radius: 16px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.teacher-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.teacher-name {
    font-size: 1.05rem;
    font-weight: 600;
}

.teacher-email {
    color: #38bdf8;
    font-size: 0.8rem;
    word-break: break-all;
}

.status-pill {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.status-pill.success {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-pill.error-net {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-pill.error-timeout {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-pill.offline {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid #ef4444;
    animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
}

.dot.green { background: #10b981; }
.dot.red { background: #ef4444; }
.dot.yellow { background: #f59e0b; }

.detail-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    padding: 4px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
}

.detail-label {
    color: var(--text-muted);
}

.detail-value {
    font-weight: 500;
}

/* Mobile Bottom Touch Bar */
.bottom-touch-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-card);
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 90;
    justify-content: space-around;
    align-items: center;
}

.touch-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.75rem;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    flex: 1;
    height: 100%;
}

.touch-nav-item.active {
    color: var(--accent-blue);
    font-weight: 600;
}

.touch-nav-icon {
    font-size: 1.2rem;
}

/* Auth Overlay Screen */
.auth-screen {
    position: fixed;
    inset: 0;
    background: var(--bg-dark);
    background-image: 
        radial-gradient(at 50% 0%, rgba(59, 130, 246, 0.25) 0px, transparent 60%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    z-index: 200;
}

.auth-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-card);
    border-radius: 24px;
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 420px;
    text-align: center;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.auth-logo {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    margin: 0 auto;
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.4);
}

.auth-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
}

.auth-sub {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.4;
}

.auth-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--accent-red);
    color: #f87171;
    padding: 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    display: none;
}
