:root {
    --bg-canvas: #09090b;
    --surface: #18181b;
    --surface-hover: #27272a;
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --text-main: #f4f4f5;
    --text-muted: #71717a;
    --radius-lg: 12px;
    --radius-md: 8px;
    --shadow-float: 0 10px 30px -10px rgba(0,0,0,0.5);
}

* { box-sizing: border-box; user-select: none; }

body {
    margin: 0;
    background-color: var(--bg-canvas);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

header {
    height: 56px;
    min-height: 56px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(24, 24, 27, 0.9);
    backdrop-filter: blur(12px);
    z-index: 100;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.brand { display: flex; align-items: center; gap: 10px; }
.logo { font-weight: 900; font-size: 16px; color: #fff; font-family: 'Montserrat', sans-serif; letter-spacing: -0.5px; }
.logo span { color: var(--accent); }
.doc-name { font-size: 12px; color: var(--text-muted); font-weight: 500; background: rgba(255,255,255,0.03); padding: 3px 10px; border-radius: 20px; }

.nav-actions { display: flex; gap: 8px; }

.btn {
    background: var(--accent); color: #fff; border: none; padding: 7px 14px;
    font-weight: 600; font-size: 12px; border-radius: var(--radius-md); cursor: pointer; transition: 0.2s; font-family: inherit;
}
.btn:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-subtle { background: rgba(255,255,255,0.06); color: #fff; }
.btn-subtle:hover { background: rgba(255,255,255,0.12); }

.app-layout {
    flex: 1;
    display: grid;
    grid-template-columns: 280px 1fr 280px;
    height: calc(100vh - 56px);
    overflow: hidden;
    background: radial-gradient(circle at center, #18181b 0%, #09090b 100%);
}

.sidebar-left {
    background: rgba(20, 20, 23, 0.85);
    backdrop-filter: blur(16px);
    border-right: 1px solid rgba(255,255,255,0.06);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 10;
    overflow-y: auto;
}

.sidebar-title { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); font-weight: 700; margin: 0; }

.panel-action {
    background: rgba(255,255,255,0.04); color: #fff; border: 1px solid rgba(255,255,255,0.04);
    padding: 10px 14px; text-align: left; border-radius: var(--radius-md); font-weight: 500; font-size: 13px;
    cursor: pointer; transition: 0.2s; display: flex; align-items: center; gap: 10px; font-family: inherit;
}
.panel-action:hover { background: var(--surface-hover); border-color: rgba(255,255,255,0.1); color: var(--accent); }

.workspace {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: auto;
    padding: 40px;
}

#artboard {
    width: 960px;
    height: 540px;
    min-width: 960px;
    min-height: 540px;
    background: #ffffff;
    position: relative;
    box-shadow: 0 30px 60px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.05);
    overflow: hidden;
    border-radius: 4px;
}

.sidebar-right {
    background: rgba(20, 20, 23, 0.85);
    backdrop-filter: blur(16px);
    border-left: 1px solid rgba(255,255,255,0.06);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    z-index: 10;
    overflow-y: auto;
}

.prop-group { display: flex; flex-direction: column; gap: 6px; }
.prop-group label { font-size: 11px; font-weight: 500; color: var(--text-muted); }

.prop-input {
    background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.08); color: #fff;
    padding: 8px 10px; border-radius: var(--radius-md); font-size: 13px; outline: none; transition: 0.2s; width: 100%; font-family: inherit;
}
.prop-input:focus { border-color: var(--accent); background: rgba(0,0,0,0.5); }

.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }

.align-btn {
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06); color: #fff;
    padding: 6px; border-radius: 6px; cursor: pointer; font-size: 11px; text-align: center;
    font-family: inherit; transition: 0.2s;
}
.align-btn:hover, .align-btn.active { background: var(--accent); border-color: var(--accent); }

.btn-danger {
    background: rgba(239, 68, 68, 0.15); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 9px; border-radius: var(--radius-md); font-weight: 600; font-size: 12px; cursor: pointer; transition: 0.2s;
    margin-top: auto; width: 100%; font-family: inherit;
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.25); }

.voox-element {
    position: absolute;
    cursor: grab;
    user-select: none;
    box-sizing: border-box;
}

.voox-element:active { cursor: grabbing; }

.voox-element.sel {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.voox-element.sel .ph,
.voox-element.sel .rh { display: block; }

.ph {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--accent);
    border: 2px solid #fff;
    border-radius: 2px;
    z-index: 10;
    display: none;
    pointer-events: auto;
}
.ph.tl { top: -6px; left: -6px; cursor: nw-resize; }
.ph.tr { top: -6px; right: -6px; cursor: ne-resize; }
.ph.bl { bottom: -6px; left: -6px; cursor: sw-resize; }
.ph.br { bottom: -6px; right: -6px; cursor: se-resize; }

.rh {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 16px;
    background: var(--accent);
    border: 2px solid #fff;
    border-radius: 50%;
    z-index: 10;
    display: none;
    cursor: grab;
    pointer-events: auto;
}

.voox-text { white-space: pre-wrap; word-break: break-word; }
.voox-image img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }