:root {
    --bg: #f8f9fa;
    --surface: #ffffff;
    --panel: #ffffff;
    --panel2: #f1f3f5;
    --accent: #4285f4;
    --accent-light: rgba(66, 133, 244, 0.1);
    --text: #212529;
    --text-secondary: #6c757d;
    --border: #dee2e6;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --topbar-h: 56px;
    --sidebar-w: 64px;
    --right-panel-w: 260px;
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    user-select: none;
}

/* ─── LAYOUT ─── */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
}

.topbar {
    height: var(--topbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 15px;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.main-content {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
}

.sidebar {
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 0;
    gap: 8px;
    z-index: 90;
}

.canvas-area {
    flex: 1;
    position: relative;
    background: #eef1f4; /* Subtle blueprint-style grid background later */
    overflow: hidden;
}

.property-panel {
    width: var(--right-panel-w);
    background: var(--surface);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 90;
    box-shadow: -2px 0 10px rgba(0,0,0,0.02);
}

/* ─── COMPONENTS ─── */
.logo {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.5px;
    margin-right: 10px;
}
.logo span { color: var(--accent); }

.vtabs {
    display: flex;
    background: var(--panel2);
    padding: 4px;
    border-radius: 8px;
    gap: 2px;
}
.vtab {
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
}
.vtab:hover { color: var(--text); }
.vtab.active {
    background: var(--surface);
    color: var(--accent);
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.tool-btn {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: all 0.2s;
    background: transparent;
    color: var(--text-secondary);
    gap: 2px;
}
.tool-btn:hover { background: var(--panel2); color: var(--text); }
.tool-btn.active {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent);
}
.tool-icon svg { width: 22px; height: 22px; }
.tool-label { font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }

/* ─── PROPERTY PANEL INTERNALS ─── */
.prop-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
}
.prop-title { font-size: 14px; font-weight: 700; color: var(--text); }
.prop-subtitle { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }

.prop-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.section-header {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.8px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.prop-card {
    background: var(--panel2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 15px;
}

.prop-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.prop-label { font-size: 12px; color: var(--text-secondary); }
.prop-input {
    width: 80px;
    padding: 5px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 12px;
    text-align: right;
    outline: none;
}
.prop-input:focus { border-color: var(--accent); }

/* ─── OVERLAYS ─── */
.canvas-overlay {
    position: absolute;
    pointer-events: none;
    z-index: 80;
}
.overlay-top-left { top: 15px; left: 15px; display: flex; flex-direction: column; gap: 8px; }
.overlay-bottom-center { bottom: 15px; left: 50%; transform: translateX(-50%); }
.overlay-top-right { top: 15px; right: 15px; }

.action-chip {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 11px;
    pointer-events: all;
    box-shadow: var(--shadow);
    color: var(--text-secondary);
}

.control-btn {
    width: 32px;
    height: 32px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: all;
    box-shadow: var(--shadow);
}
.control-btn:hover { background: var(--panel2); }

/* ─── UTILS ─── */
.flex-ml { margin-left: auto; }
.flex-gap { display: flex; gap: 8px; }

.btn-action {
    padding: 6px 12px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.btn-action:hover { opacity: 0.9; }

.btn-outline {
    padding: 6px 12px;
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
}
.btn-outline:hover { background: var(--panel2); }