:root[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #0f172a;
    --text-muted: #64748b;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --card-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

:root[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-card: #1e293b;
    --border-color: #334155;
    --text-primary: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --card-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.5);
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
body { background: var(--bg-primary); color: var(--text-primary); min-height: 100vh; display: flex; flex-direction: column; }

/* Top Navigation */
header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 2rem; background: var(--bg-card); border-bottom: 1px solid var(--border-color); }
.header-actions { display: flex; gap: 1rem; align-items: center; }
.btn { padding: 0.5rem 1rem; border-radius: 6px; border: 1px solid var(--border-color); background: var(--bg-card); color: var(--text-primary); cursor: pointer; text-decoration: none; font-size: 0.875rem; }
.btn-primary { background: var(--accent); color: #fff; border: none; }

/* Dashboard Layout */
.container { width: 100%; max-width: 1280px; margin: 2rem auto; padding: 0 1.5rem; flex: 1; }
.widget-bar { display: flex; justify-content: space-between; align-items: center; background: var(--bg-card); padding: 1.25rem 1.5rem; border-radius: 12px; margin-bottom: 2rem; border: 1px solid var(--border-color); }
.section-title { font-size: 1.25rem; font-weight: 600; margin: 2rem 0 1rem; display: flex; justify-content: space-between; align-items: center; }

/* Grids */
.grid-tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.grid-3x2 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.grid-4col { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }

@media (max-width: 900px) {
    .grid-3x2 { grid-template-columns: repeat(2, 1fr); }
    .grid-4col { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .grid-3x2, .grid-4col { grid-template-columns: 1fr; }
}

/* Cards */
.card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 10px; padding: 1.25rem; text-decoration: none; color: inherit; display: flex; flex-direction: column; transition: transform 0.2s, box-shadow 0.2s; position: relative; }
.card:hover { transform: translateY(-2px); box-shadow: var(--card-shadow); }
.card.draggable { cursor: grab; }
.card.dragging { opacity: 0.4; }
.card h3 { font-size: 1rem; margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.5rem; }
.card p { font-size: 0.8125rem; color: var(--text-muted); line-height: 1.4; }
