:root {
    /* Color Palette - Premium Light Mode based on Logo */
    --bg-base: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #f1f5f9;
    --bg-glossy: rgba(255, 255, 255, 0.85);
    
    --primary: #0f76ff;
    --primary-hover: #0056d6;
    --primary-glow: rgba(15, 118, 255, 0.3);
    
    --accent: #3b82f6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --border-subtle: rgba(15, 23, 42, 0.08); /* Dark lines, low opacity */
    --border-strong: rgba(15, 23, 42, 0.15);
    
    /* Metrics */
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    --sidebar-width: 280px;
    
    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

html, body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
    height: 100vh;
    overflow: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.2;
}

/* Base Layout */
.app-container {
    display: flex;
    height: 100vh;
    width: 100%;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.sidebar-header {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-subtle);
}

.sidebar-header h2 {
    color: var(--primary);
    font-weight: 800;
    font-size: 28px;
    letter-spacing: -1px;
}

.logo-text {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    font-weight: 500;
}

.nav-item:hover {
    background-color: var(--bg-surface-elevated);
    color: var(--text-primary);
}

.nav-item.active {
    background-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.nav-icon {
    font-size: 18px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-subtle);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
    width: 100%;
}

.btn-secondary {
    background-color: var(--bg-surface-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
    background-color: var(--border-strong);
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 4px 12px var(--primary-glow);
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
    position: relative;
    background: radial-gradient(circle at top right, rgba(15, 118, 255, 0.05), transparent 400px);
}

/* Views */
.view {
    display: none;
    animation: fadeIn 0.3s ease;
    max-width: 1500px;
    width: 100%;
    margin: 0 auto;
}

.view.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* View Header */
.view-header {
    margin-bottom: 32px;
}

.view-header h1 {
    font-size: 32px;
    margin-bottom: 8px;
}

.view-header p {
    color: var(--text-secondary);
    font-size: 16px;
}

/* Section Cards */
.card {
    background: var(--bg-glossy);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    overflow: hidden;
}

.card-header {
    background: var(--bg-surface-elevated);
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-subtle);
}

.card-header h3 {
    font-size: 18px;
    color: var(--primary);
}

.card-header-warning h3 {
    color: var(--warning);
}

.card-body {
    padding: 24px;
}

.info-box {
    background: #edfcf5;
    border-left: 3px solid var(--success);
    padding: 14px 18px;
    border-radius: 4px;
    margin-bottom: 20px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.skool-alert-box {
    background-color: #f0f7ff;
    border-left: 3px solid var(--primary);
    border-radius: 0 6px 6px 0;
    padding: 16px 20px;
    margin-bottom: 24px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.skool-alert-icon {
    color: var(--primary);
    font-weight: 800;
    font-style: normal;
    font-size: 13px;
    margin-top: 2px;
}

.skool-alert-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
}

.skool-alert-title {
    color: var(--text-primary);
    font-weight: 600;
}

.skool-alert-title span {
    color: var(--primary);
}

.skool-alert-text {
    color: var(--text-secondary);
}

.skool-alert-link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.2s;
}

.skool-alert-link:hover {
    opacity: 0.8;
}

.theory-block {
    background-color: #f1f5f9;
    padding: 12px 24px;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 14px;
    color: var(--primary);
    font-style: italic;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.theory-line {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.theory-icon {
    font-style: normal;
    font-weight: 700;
    font-size: 14px;
    opacity: 0.8;
}

.info-box strong {
    color: var(--text-primary);
}

/* Tables */
.table-container {
    overflow-x: auto;
    margin-bottom: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th, .data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    border-right: 1px solid var(--border-subtle);
}

.data-table th:last-child, .data-table td:last-child {
    border-right: none;
}

.data-table th {
    background-color: var(--bg-surface-elevated);
    font-family: var(--font-heading);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.data-table td {
    background-color: var(--bg-surface);
    vertical-align: top;
}

/* Inputs */
input[type="text"], select, textarea {
    width: 100%;
    background-color: var(--bg-base);
    border: 1px solid var(--border-strong);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 14px;
    transition: all 0.2s ease;
}

input[type="text"]:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
    background-color: var(--bg-surface);
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

/* Image Upload Area */
.image-upload-area {
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 160px;
    background-color: rgba(0,0,0,0.02);
}

.image-upload-area:hover, .image-upload-area.dragover {
    border-color: var(--primary);
    color: var(--text-primary);
    background-color: rgba(59, 130, 246, 0.05);
}

.image-upload-area img {
    max-width: 100%;
    max-height: 240px;
    border-radius: 4px;
    margin-top: 8px;
    object-fit: contain;
}

/* Add Row Button */
.add-row-btn {
    background: transparent;
    border: 1px dashed var(--border-strong);
    color: var(--text-secondary);
    width: 100%;
    padding: 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    margin-top: 12px;
    transition: all 0.2s ease;
    font-family: var(--font-heading);
}

.add-row-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background-color: rgba(59, 130, 246, 0.05);
}

/* Checkpoint / Highlights */
.checkpoint {
    background-color: rgba(220, 38, 38, 0.15); /* dark red tint */
    border: 1px solid var(--danger);
    border-left: 4px solid var(--danger);
    padding: 16px 24px;
    border-radius: var(--radius-md);
    margin: 32px 0;
    display: flex;
    align-items: center;
    gap: 16px;
}

.checkpoint h3 {
    color: var(--danger);
    font-size: 16px;
    margin-bottom: 4px;
}

.checkpoint p {
    color: var(--text-secondary);
    font-size: 14px;
}

.checkpoint-icon {
    font-size: 24px;
}

/* Authentication Overlay */
.auth-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(248, 250, 252, 0.95);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease;
}

.auth-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.auth-card {
    background: #ffffff;
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    width: 100%;
    max-width: 400px;
    border: 1px solid var(--border-light);
    text-align: center;
}

.auth-title {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.auth-desc {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.auth-form input {
    padding: 12px 16px;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 14px;
}

.auth-btn {
    width: 100%;
    padding: 12px;
    justify-content: center;
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 12px;
    margin-bottom: 24px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-medium);
}

.auth-divider span {
    padding: 0 10px;
}

.auth-google-btn {
    background: white;
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
}

.auth-google-btn:hover {
    background: #f8fafc;
}

.auth-error {
    color: var(--danger);
    font-size: 13px;
    margin-top: 12px;
    min-height: 20px;
}

.hidden {
    display: none !important;
}

