.edit-header {
    margin-bottom: 20px;
    position: relative;
    text-align: center;
}

.back-link {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    text-decoration: none;
    color: #555;
    font-size: 0.9rem;
}

.edit-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    display: inline-block;
}

.actions-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    align-items: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 8px;
    border: none;
    background-color: white;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.2s ease-in-out;
}

.btn:hover {
    background-color: #f8f8f8;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background-color: var(--theme-dark);
    color: white;
}

.btn-primary:hover {
    background-color: rgb(220, 130, 0);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: white;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.2s ease-in-out;
}

.btn-icon:hover {
    background-color: #f0f0f0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.item-list-edit {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.item-card-edit {
    display: flex;
    align-items: center;
    background-color: white;
    border-radius: 12px;
    padding: 15px 12px 15px 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.drag-handle {
    display: none;
    cursor: grab;
    color: #ccc;
    margin-right: 15px;
}

.is-sorting .drag-handle {
    display: block;
}

.is-sorting .item-actions {
    display: none;
}

.item-card-edit.sortable-ghost {
    opacity: 0.4;
    background: rgba(248, 182, 43, 0.3);
}

.item-card-edit .item-info {
    flex-grow: 1;
}

.item-card-edit .item-details {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-right: 10px;
}

.item-price {
    font-size: 1.1rem;
    font-weight: 700;
}

.item-price .unit {
    font-size: 0.9rem;
    font-weight: 400;
    color: #777;
    margin-left: 4px;
}

.item-actions {
    display: flex;
    gap: 15px;
}

.item-actions svg {
    width: 20px;
    height: 20px;
    color: #888;
    cursor: pointer;
    transition: color 0.2s;
}

.item-actions svg:hover {
    color: #333;
}

/* Styles for the add/edit form */
.item-price-edit {
    display: flex;
    align-items: center;
    gap: 5px;
}

.item-form input[type="text"],
.item-form input[type="number"] {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.item-form input[type="text"]:focus,
.item-form input[type="number"]:focus {
    outline: none;
    border-color: var(--theme-dark);
}

.form-input-name {
    width: 100%;
}
.form-input-price {
    width: 70px;
}
.form-input-unit {
    width: 60px;
}

.form-unit-prefix {
    color: #777;
}

.btn-save, .btn-cancel {
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
}

.btn-save {
    background-color: var(--theme-dark);
    color: white;
}
.btn-save:hover {
    background-color: rgb(220, 130, 0);
}

.btn-cancel {
    background-color: #eee;
    color: #333;
}
.btn-cancel:hover {
    background-color: #ddd;
}

/* SortableJS helper class */
.sortable-ghost {
    opacity: 0.4;
    background: #c8ebfb;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.modal-content h2 {
    margin-top: 0;
    margin-bottom: 20px;
    text-align: center;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
}

.modal-content .form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 25px;
}

.top-buttons {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
}

.button {
    padding: 8px 12px;
    border: none;
    border-radius: 5px;
    background-color: #f0f0f0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #333;
    transition: background-color 0.2s ease-in-out;
}

.button:hover {
    background-color: #e0e0e0;
}

.button svg {
    vertical-align: middle;
}

#add-item-btn {
    background-color: #ff9900;
    color: white;
}

#add-item-btn:hover {
    background-color: #e68a00;
}

#restore-default-btn {
    margin-left: auto;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    padding: 0;
    justify-content: center;
}

.sort-handle {
    cursor: grab;
    color: #aaa;
}