:root {
    --bg-color: #0a0f0d;
    --sidebar-color: #0f1612;
    --primary-color: #16a671;
    --text-main: #e2e8f0;
    --text-dim: #94a3b8;
    --card-bg: #141d1a;
    --border-color: #1e2925;
    --coral: #ff7e67;
    --amber: #ffb84d;
    --green: #16a671;
    --transition: all 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Epilogue', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
}

h1, h2, h3, h4 {
    font-family: 'Syne', sans-serif;
}

/* Sidebar */
aside {
    width: 228px;
    background-color: var(--sidebar-color);
    border-right: 1px solid var(--border-color);
    height: 100vh;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    z-index: 100;
}

.logo {
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: 20px;
    color: var(--primary-color);
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-grow: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    color: var(--text-dim);
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
    background-color: #1a2420;
    color: var(--primary-color);
}

.logout-btn {
    margin-top: auto;
    border: none;
    background: none;
    cursor: pointer;
    justify-content: flex-start;
}

/* Main Content */
main {
    flex-grow: 1;
    padding: 24px 40px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Topbar */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

header h1 {
    font-size: 28px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.site-selector {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    cursor: pointer;
}

button {
    cursor: pointer;
    transition: var(--transition);
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 10px 20px;
}

.btn-outline:hover {
    background: var(--border-color);
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar {
    width: 36px;
    height: 36px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    text-transform: uppercase;
}

/* Plan Banner */
.plan-banner {
    background: linear-gradient(90deg, #141d1a 0%, #0f1612 100%);
    border: 1px solid var(--border-color);
    padding: 20px 24px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.plan-info {
    display: flex;
    gap: 32px;
}

.plan-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.plan-stat label {
    font-size: 12px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.plan-stat span {
    font-weight: 700;
    font-size: 16px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 24px;
    border-radius: 12px;
}

.stat-card label {
    font-size: 14px;
    color: var(--text-dim);
    display: block;
    margin-bottom: 8px;
}

.stat-card .value {
    font-size: 32px;
    font-family: 'Syne', sans-serif;
    font-weight: 700;
}

/* Layout Columns */
.layout-grid {
    display: grid;
    grid-template-columns: 6fr 4fr;
    gap: 32px;
    margin-bottom: 32px;
}

.panel {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
}

.panel-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h2 {
    font-size: 18px;
}

.panel-content {
    padding: 24px;
    flex-grow: 1;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.tab {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 14px;
    padding-bottom: 4px;
    border-bottom: 2px solid transparent;
}

.tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* Task Cards */
.task-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.task-card {
    background: #1a2420;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    gap: 20px;
}

.score-badge {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
}

.score-high { background-color: rgba(22, 166, 113, 0.2); color: #16a671; border: 1px solid #16a671; }
.score-med { background-color: rgba(255, 184, 77, 0.2); color: #ffb84d; border: 1px solid #ffb84d; }
.score-low { background-color: rgba(255, 126, 103, 0.2); color: #ff7e67; border: 1px solid #ff7e67; }

.task-info {
    flex-grow: 1;
}

.task-info h3 {
    font-size: 16px;
    margin-bottom: 8px;
}

.task-info p {
    font-size: 14px;
    color: var(--text-dim);
    margin-bottom: 16px;
    line-height: 1.5;
}

.pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pill {
    font-size: 11px;
    padding: 4px 10px;
    background: #0a0f0d;
    border: 1px solid var(--border-color);
    border-radius: 100px;
    color: var(--text-dim);
    text-transform: uppercase;
    font-weight: 600;
}

.task-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Alert Cards */
.alert-card {
    border-left: 4px solid var(--coral);
    background: #1a2420;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.alert-card h4 {
    font-size: 14px;
    margin-bottom: 4px;
}

.alert-card p {
    font-size: 12px;
    color: var(--text-dim);
}

/* Opportunity Row */
.opp-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.opp-row:last-child { border-bottom: none; }

.opp-info h4 { font-size: 14px; }
.opp-info span { font-size: 12px; color: var(--text-dim); }

.pos-badge {
    background: rgba(255, 184, 77, 0.1);
    color: var(--amber);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
}

/* Bottom Row */
.bottom-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin-bottom: 32px;
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

th {
    text-align: left;
    padding: 12px 8px;
    color: var(--text-dim);
    font-weight: 500;
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 12px 8px;
    border-bottom: 1px solid var(--border-color);
}

/* Skeleton */
.skeleton {
    background: linear-gradient(90deg, #1a2420 25%, #1f2d28 50%, #1a2420 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text { height: 16px; margin-bottom: 8px; width: 100%; }
.skeleton-val { height: 32px; width: 60%; }
.skeleton-task { height: 120px; width: 100%; margin-bottom: 16px; }

/* Error/Empty States */
#error-banner {
    display: none;
    background: var(--coral);
    color: white;
    padding: 12px;
    text-align: center;
    font-weight: 600;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
    color: var(--text-dim);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--card-bg);
    padding: 32px;
    border-radius: 16px;
    width: 400px;
    border: 1px solid var(--border-color);
}

.modal-content h3 { margin-bottom: 20px; }
.modal-content input {
    width: 100%;
    padding: 12px;
    background: #0a0f0d;
    border: 1px solid var(--border-color);
    color: white;
    border-radius: 8px;
    margin-bottom: 20px;
}

@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
