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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#av-saas-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    margin: 0;
    padding: 0;
    display: flex;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    color: rgba(255, 255, 255, 0.9);
    overflow: hidden;
}

body.admin-bar #av-saas-wrapper {
    top: 32px;
    height: calc(100vh - 32px);
}

.av-sidebar {
    width: 280px;
    min-width: 280px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
}

.av-brand {
    padding: 32px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}

.av-logo {
    font-size: 32px;
}

.av-brand-name {
    font-size: 18px;
    font-weight: 700;
    color: white;
    letter-spacing: -0.5px;
}

.av-brand-tagline {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 1px;
}

.av-nav {
    flex: 1;
    padding: 24px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.av-nav-item {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    padding: 14px 16px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 15px;
    font-weight: 500;
    text-align: left;
}

.av-nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.95);
}

.av-nav-item.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3) 0%, rgba(168, 85, 247, 0.3) 100%);
    color: white;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.5);
}

.av-nav-icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.av-sidebar-footer {
    padding: 20px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.av-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
}

.av-status-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse 2s ease infinite;
}

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

.av-main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
}

.av-content-header {
    padding: 32px 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(10px);
}

.av-welcome {
    font-size: 28px;
    font-weight: 700;
    color: white;
    margin-bottom: 4px;
}

.av-date {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
}

.av-content-body {
    flex: 1;
    padding: 32px 40px;
    overflow-y: auto;
}

.av-section {
    display: none;
}

.av-section.active {
    display: block;
}

.av-section-header {
    margin-bottom: 32px;
}

.av-section-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: white;
    margin-bottom: 8px;
}

.av-section-header p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}

.av-glass-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.av-glass-card h2,
.av-glass-card h3 {
    color: white;
    margin-bottom: 20px;
}

.av-tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.av-tool-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.av-tool-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(99, 102, 241, 0.3);
    border-color: rgba(99, 102, 241, 0.5);
}

.av-tool-card .tool-icon {
    font-size: 48px;
}

.av-tool-card .tool-name {
    font-size: 16px;
    font-weight: 600;
    color: white;
    text-align: center;
}

.av-tool-card .tool-desc {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
}

#av-tool-viewport {
    margin-top: 40px;
}

input,
select,
textarea {
    background: #1e293b !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 15px;
    width: 100%;
    transition: all 0.3s ease;
    font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
    background: #1e293b !important;
    border-color: rgba(99, 102, 241, 0.8) !important;
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

input::placeholder,
textarea::placeholder {
    color: rgba(255, 255, 255, 0.4) !important;
}

input[type="date"],
input[type="time"] {
    color-scheme: dark;
}

input[type="radio"],
input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #6366f1;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-text-fill-color: white !important;
    -webkit-box-shadow: 0 0 0 1000px #1e293b inset !important;
}

.av-form-group {
    margin-bottom: 20px;
}

.av-form-label,
.av-form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.av-glass-button,
button[type="submit"] {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    margin-top: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.av-glass-button:hover,
button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.av-glass-button:disabled,
button[type="submit"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.hidden {
    display: none !important;
}

.av-result-container {
    margin-top: 32px;
}

.av-result-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
    text-align: center;
    color: #c4b5fd;
}

.av-text-center {
    text-align: center;
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

#av-crm-container {
    overflow-x: auto;
}

#av-crm-container table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 12px;
    overflow: hidden;
}

#av-crm-container th {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3) 0%, rgba(168, 85, 247, 0.2) 100%);
    padding: 16px 20px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255, 255, 255, 0.95);
    border-bottom: 2px solid rgba(99, 102, 241, 0.3);
}

#av-crm-container td {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(15, 23, 42, 0.4);
}

#av-crm-container tr:hover td {
    background: rgba(99, 102, 241, 0.1);
}

#av-crm-container tr:last-child td {
    border-bottom: none;
}

.wrap {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    min-height: 100vh;
    padding: 40px;
}

.wrap h1 {
    color: white;
    font-size: 32px;
    margin-bottom: 32px;
    font-weight: 700;
}

@media (max-width: 1024px) {
    .av-sidebar {
        width: 80px;
        min-width: 80px;
    }
    
    .av-brand-text,
    .av-nav-label,
    .av-status-text {
        display: none;
    }
    
    .av-nav-item {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    #av-saas-wrapper {
        flex-direction: column;
    }
    
    .av-sidebar {
        width: 100%;
        min-width: 100%;
        height: auto;
        max-height: 80px;
        flex-direction: row;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        overflow-x: auto;
    }
    
    .av-brand {
        padding: 16px;
        border-right: 1px solid rgba(255, 255, 255, 0.1);
        border-bottom: none;
    }
    
    .av-nav {
        flex-direction: row;
        padding: 12px;
        overflow-x: auto;
    }
    
    .av-sidebar-footer {
        display: none;
    }
    
    .av-content-header {
        padding: 24px 20px;
    }
    
    .av-content-body {
        padding: 24px 20px;
    }
    
    .av-tool-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 16px;
    }
    
    input,
    select,
    textarea {
        font-size: 16px;
    }
}
