* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    background: #0a0a0a;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: #f4f4ff;
    overflow-x: hidden;
}

/* Hidden utility */
.hidden {
    display: none !important;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-container {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.loading-title {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, #a855f7 50%, #6366f1 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.loading-text {
    color: #c1c1d8;
    font-size: 1.1rem;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 2px solid #2a2a2a;
    border-top: 2px solid #a855f7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Shield Icon */
.shield-icon {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.shield-icon.small {
    width: 32px;
    height: 32px;
}

.shield-icon:not(.small):not(.large) {
    width: 80px;
    height: 80px;
}

.shield-icon.large {
    width: 120px;
    height: 120px;
}

.shield-body {
    width: 100%;
    height: 80%;
    background: linear-gradient(135deg, #a855f7, #6366f1);
    clip-path: polygon(50% 0%, 0% 25%, 0% 75%, 50% 100%, 100% 75%, 100% 25%);
    position: relative;
    box-shadow: 0 8px 32px rgba(168, 85, 247, 0.3);
    animation: glow 2s ease-in-out infinite alternate;
}

.shield-icon.small .shield-body {
    clip-path: polygon(50% 0%, 0% 25%, 0% 75%, 50% 100%, 100% 75%, 100% 25%);
}

.shield-lock {
    position: absolute;
    top: 25%;
    left: 50%;
    transform: translateX(-50%);
    width: 35%;
    height: 35%;
    border: 3px solid #ffd700;
    border-radius: 50% 50% 0 0;
    background: transparent;
    z-index: 2;
}

.shield-icon.small .shield-lock {
    border-width: 2px;
    width: 40%;
    height: 40%;
}

@keyframes glow {
    0% { box-shadow: 0 8px 32px rgba(168, 85, 247, 0.3); }
    100% { box-shadow: 0 8px 32px rgba(168, 85, 247, 0.6); }
}

/* Auth Gate */
.auth-gate {
    min-height: 100vh;
    background: radial-gradient(circle at top, #121520 0%, #0a0a0a 60%);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.auth-container {
    max-width: 480px;
    width: 100%;
    text-align: center;
}

.auth-hero {
    margin-bottom: 48px;
}

.auth-title {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, #a855f7 50%, #6366f1 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
    margin: 24px 0 12px;
}

.auth-tagline {
    font-size: 1.3rem;
    color: #c1c1d8;
    margin-bottom: 8px;
}

.auth-description {
    color: #8b8ba0;
    font-size: 1rem;
}

.google-signin-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 16px 32px;
    background: #fff;
    color: #1f2937;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.google-signin-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.google-icon {
    width: 20px;
    height: 20px;
}

/* Main App */
.main-app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    background: rgba(26, 26, 26, 0.8);
    border-bottom: 1px solid #2a2a2a;
    backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.app-title {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, #a855f7 50%, #6366f1 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-email {
    color: #c1c1d8;
    font-size: 0.9rem;
}

.sign-out-btn {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    color: #c1c1d8;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sign-out-btn:hover {
    border-color: #a855f7;
    color: #a855f7;
}

/* Dashboard */
.dashboard {
    flex: 1;
    background: linear-gradient(180deg, #0a0a0a 0%, #1a1a1a 100%);
    padding: 40px 24px;
}

.dashboard-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 48px;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 24px;
    background: linear-gradient(135deg, #fff 0%, #a855f7 50%, #6366f1 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Profile Section */
.profile-card {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 16px;
    padding: 32px;
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

.profile-avatar {
    position: relative;
    width: 120px;
    height: 120px;
    flex-shrink: 0;
}

.avatar-image {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #a855f7, #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-initials {
    font-size: 3rem;
    font-weight: 700;
    color: #fff;
}

.profile-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.profile-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.field-label {
    font-size: 0.9rem;
    color: #8b8ba0;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

.field-value {
    font-size: 1.1rem;
    color: #f8f8ff;
    font-weight: 500;
}

.field-value.mono {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
}

/* Sites Grid */
.sites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.site-card {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.2s ease;
    position: relative;
}

.site-card:hover {
    border-color: #3a3a3a;
    transform: translateY(-2px);
}

.site-icon {
    font-size: 2rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.site-info {
    flex: 1;
}

.site-info h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #f8f8ff;
    margin-bottom: 4px;
}

.site-info p {
    color: #8b8ba0;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.site-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
}

.status-dot.connected {
    background: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.status-text {
    font-size: 0.85rem;
    color: #10b981;
    font-weight: 500;
}

.site-link {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #a855f7, #6366f1);
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.site-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.4);
}

.site-link.current {
    background: #2a2a2a;
    color: #8b8ba0;
    cursor: default;
}

.site-link.current:hover {
    transform: none;
    box-shadow: none;
}

/* Login History */
.history-card {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 16px;
    padding: 24px;
    overflow: hidden;
}

.history-table-container {
    overflow-x: auto;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
}

.history-table th {
    text-align: left;
    padding: 12px 16px;
    color: #8b8ba0;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #2a2a2a;
}

.history-table td {
    padding: 12px 16px;
    color: #f8f8ff;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(42, 42, 42, 0.5);
}

.history-table tr:last-child td {
    border-bottom: none;
}

.loading-row td {
    text-align: center;
    color: #8b8ba0;
    font-style: italic;
    padding: 24px;
}

/* Session Management */
.session-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
}

.session-card {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 16px;
    padding: 24px;
    display: flex;
    gap: 16px;
}

.session-icon {
    font-size: 2rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.session-info {
    flex: 1;
}

.session-info h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #f8f8ff;
    margin-bottom: 16px;
}

.session-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.session-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.session-field label {
    font-size: 0.9rem;
    color: #8b8ba0;
    font-weight: 500;
}

.session-field span {
    font-size: 0.9rem;
    color: #f8f8ff;
    font-weight: 500;
}

.session-status.active {
    color: #10b981;
    font-weight: 600;
}

.session-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    color: #c1c1d8;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    position: relative;
}

.action-btn:hover:not(:disabled) {
    border-color: #a855f7;
    color: #a855f7;
}

.action-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-icon {
    font-size: 1rem;
}

.btn-subtitle {
    position: absolute;
    right: 12px;
    font-size: 0.75rem;
    color: #6b7280;
    font-style: italic;
}

/* Connected Apps */
.apps-card {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 16px;
    padding: 48px 24px;
}

.apps-placeholder {
    text-align: center;
    color: #8b8ba0;
}

.placeholder-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.apps-placeholder h3 {
    font-size: 1.4rem;
    margin-bottom: 8px;
    color: #c1c1d8;
}

.apps-placeholder p {
    margin-bottom: 4px;
    font-size: 0.95rem;
}

.placeholder-note {
    font-size: 0.85rem;
    color: #6b7280;
    font-style: italic;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    min-width: 300px;
    padding: 16px 20px;
    border-radius: 12px;
    color: #fff;
    font-weight: 500;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transform: translateX(100%);
    animation: slideIn 0.3s ease forwards;
    backdrop-filter: blur(16px);
}

.toast.success {
    background: linear-gradient(135deg, #10b981, #059669);
}

.toast.error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.toast.info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

@keyframes slideIn {
    to {
        transform: translateX(0);
    }
}

@keyframes slideOut {
    to {
        transform: translateX(100%);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard {
        padding: 24px 16px;
    }
    
    .dashboard-content {
        gap: 32px;
    }
    
    .profile-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 24px;
    }
    
    .sites-grid {
        grid-template-columns: 1fr;
    }
    
    .session-grid {
        grid-template-columns: 1fr;
    }
    
    .header-content {
        padding: 12px 16px;
    }
    
    .user-info {
        gap: 12px;
    }
    
    .user-email {
        display: none;
    }
    
    .auth-title {
        font-size: 2.5rem;
    }
    
    .toast-container {
        right: 16px;
        left: 16px;
    }
    
    .toast {
        min-width: auto;
    }
    
    .history-table {
        font-size: 0.8rem;
    }
    
    .history-table th,
    .history-table td {
        padding: 8px 12px;
    }
}

@media (max-width: 480px) {
    .sites-grid {
        grid-template-columns: 1fr;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .auth-title {
        font-size: 2rem;
    }
    
    .profile-avatar {
        width: 80px;
        height: 80px;
    }
    
    .avatar-initials {
        font-size: 2rem;
    }
    
    .site-card {
        padding: 20px;
    }
    
    .session-card {
        padding: 20px;
    }
}

/* Additional utility classes */
.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 1rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.opacity-50 {
    opacity: 0.5;
}