:root {
    --primary-color: #223b71;
    --secondary-color: #2ecc71;
    --font-family: 'Helvetica Neue', sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: sans-serif;
    display: flex;
    height: 100vh;
}

#sidebar {
    width: 280px;
    background: #223b71;
    color: white;
    padding: 15px;
}

#sidebar h3 {
    margin-bottom: 10px;
}

.element-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* Two columns */
    gap: 10px;
}

.element {
    background-color: #12264f;
    padding: 8px;
    text-align: center;
    cursor: grab;
    border-radius: 4px;
    user-select: none;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    transition: background-color 0.3s ease;
}

.element:hover {
    background-color: #1951ab;
}

.element:active {
    background-color: #0f3a7b;
}

.element i {
    font-size: 24px;
    margin-bottom: 5px;
}

.element:active {
    cursor: grabbing;
}

#canvas {
    flex: 1;
    background: #ecf0f1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    overflow: auto;
}

#canvas-inner {
    resize: both;
    width: 794px;
    min-height: 1123px;
    background: white;
    /* border: 2px dashed #3498db; */
    position: relative;
}

.canvas-element {
    position: absolute;
    background: white;
    border: 1px solid #ccc;
    padding: 10px;
    resize: both;
    overflow: auto;
    cursor: move;
}

.canvas-element .remove-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    background: red;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 14px;
    line-height: 20px;
}

.toolbar {
    position: absolute;
    display: none;
    background: #fff;
    border: 1px solid #ccc;
    padding: 5px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.toolbar button {
    margin: 0 2px;
}

.canvas-element img {
    max-width: 100%;
    height: auto;
}

.invoice-wrapper table input {
    padding: 4px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.invoice-wrapper .remove-row {
    background: red;
    color: white;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    cursor: pointer;
}

.drop-zone>.canvas-element {
    position: relative !important;
    margin-bottom: 10px;
}

.drop-zone {
    min-height: 100px;
    border: 1px dashed #bbb;
    padding: 10px;
    margin: 5px;
}

.columns-wrapper {
    display: flex;
    width: 100%;
}

.columns-wrapper>div {
    flex: 1;
}

.mainEditorBox {
    background-color: #fff;
    width: 100%;
    display: flex;
}

.right-sidebar {
    width: 25%;
}

#element-sidebar {
    width: 100%;
    background: #fff;
    border-top: 1px solid #ccc;
    margin-top: 10px;
    padding: 10px 10px;
}

#element-sidebar .element-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#element-sidebar .element-editor-header h3 {
    margin: 0;
}

#element-sidebar .element-editor-header button {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 20px;
}

.element-style-controls {
    width: 100%;
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.element-style-controls .style-control {
    display: flex;
    justify-content: space-between;
    align-items: center;
}


.right-toolbar-top {
    width: 100%;
    height: 5vh;
    display: flex;
    align-items: center;
    justify-content: end;
    padding: 10px;
}

.right-toolbar-top button {
    margin-inline: 5px;
    border: none;
    background: var(--primary-color);
    color: white;
    padding: 7px 10px;
    border-radius: 4px;
    cursor: pointer;
}

@media print {
  .page-break {
    page-break-before: always;
  }
}