﻿/* ==========================================================================
   Tools panel — shared form controls
   Used by: ToolTextField, ToolSelect, ToolTextArea, ToolNumberField, ...
   ========================================================================== */

.tool-group {
    margin-top: 1.25rem;
}

.tool-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 0.4rem;
}

/* ---------- Text inputs, selects, textareas ---------- */
.tool-input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.6rem 0.75rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #f0f0f0;
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 120ms ease, background 120ms ease;
}

    .tool-input::placeholder {
        color: rgba(255, 255, 255, 0.25);
    }

    .tool-input:focus {
        outline: none;
        border-color: rgba(109, 92, 246, 0.6);
        background: rgba(109, 92, 246, 0.06);
    }

/* ---------- Select ---------- */
.select-wrapper {
    position: relative;
    display: block;
}

.tool-select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 2.25rem;
    cursor: pointer;
}

    .tool-select option {
        background: #1a1a22;
        color: #f0f0f0;
    }

.select-chevron {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.7rem;
    pointer-events: none;
    line-height: 1;
}

/* ---------- File input (logo upload) ---------- */
.logo-input {
    display: block;
    width: 100%;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
}

    .logo-input::file-selector-button {
        background: rgba(255, 255, 255, 0.06);
        border: 1px solid rgba(255, 255, 255, 0.1);
        color: #f0f0f0;
        padding: 0.45rem 0.8rem;
        border-radius: 6px;
        font-size: 0.8rem;
        font-family: inherit;
        font-weight: 500;
        margin-right: 0.6rem;
        cursor: pointer;
        transition: background 120ms ease;
    }

        .logo-input::file-selector-button:hover {
            background: rgba(109, 92, 246, 0.15);
            border-color: rgba(109, 92, 246, 0.4);
        }

/* ---------- Small text-only clear button ---------- */
.tool-clear {
    margin-top: 0.5rem;
    background: none;
    border: none;
    color: rgba(229, 72, 77, 0.8);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
}

    .tool-clear:hover {
        color: #e5484d;
    }

/* ---------- Textarea ---------- */
.tool-textarea {
    resize: none;
    line-height: 1.55;
    overflow-y: auto;
    padding: 0.65rem 0.75rem;
}

.tool-textarea--sm {
    height: 4rem;
}

.tool-textarea--md {
    height: 12rem;
}

.tool-textarea--lg {
    height: 8rem;
}

/* ---------- Tool section ---------- */
.tool-section {
    position: relative;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 1.15rem 1.15rem 1.35rem;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: border-color 150ms ease, background 150ms ease;
}

.tool-section-header h3 {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    margin: 0 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.tool-section-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

    /* Inside a section, individual tool-groups don't need their own margin */
    .tool-section-body .tool-group {
        margin-top: 0;
    }


/* ---------- Label row (label + optional inline action) ---------- */
.tool-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.4rem;
}

    .tool-label-row .tool-label {
        margin-bottom: 0;
    }

.tool-inline-action {
    background: none;
    border: none;
    color: rgba(229, 72, 77, 0.75);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
    transition: color 120ms ease;
    white-space: nowrap;
}

    .tool-inline-action:hover {
        color: #e5484d;
    }

/* ---------- Custom scrollbar for tools panel ---------- */
.tools-panel {
    /* Firefox */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

    /* WebKit (Chrome, Edge, Safari) */
    .tools-panel::-webkit-scrollbar {
        width: 10px;
    }

    .tools-panel::-webkit-scrollbar-track {
        background: transparent;
        margin: 4px 0;
    }

    .tools-panel::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.12);
        border-radius: 999px;
        border: 2px solid transparent;
        background-clip: padding-box;
    }

        .tools-panel::-webkit-scrollbar-thumb:hover {
            background: rgba(255, 255, 255, 0.22);
            background-clip: padding-box;
            border: 2px solid transparent;
        }

    .tools-panel::-webkit-scrollbar-corner {
        background: transparent;
    }

/* ---------- Line items editor ---------- */
.line-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.line-head {
    display: grid;
    grid-template-columns: 1fr 70px 120px 110px 36px;
    gap: 0.5rem;
    padding: 0 0 0.5rem;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

    .line-head span:nth-child(2),
    .line-head span:nth-child(3),
    .line-head span:nth-child(4) {
        text-align: right;
    }

.line-row {
    display: grid;
    grid-template-columns: 1fr 70px 120px 110px 36px;
    gap: 0.5rem;
    align-items: start;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

    .line-row:last-of-type {
        border-bottom: none;
    }

.line-desc-cell {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.line-detail-input {
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
    opacity: 0.8;
}

.line-row input[type="number"] {
    text-align: right;
}

.line-total {
    align-self: start;
    padding-top: 0.65rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #f0f0f0;
    text-align: right;
    white-space: nowrap;
}

.line-remove {
    align-self: start;
    margin-top: 0.35rem;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(229, 72, 77, 0.08);
    border: 1px solid rgba(229, 72, 77, 0.25);
    border-radius: 6px;
    color: #e5484d;
    font-size: 1.15rem;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    transition: background 120ms ease, border-color 120ms ease;
    padding: 0;
    font-family: inherit;
}

    .line-remove:hover:not(:disabled) {
        background: rgba(229, 72, 77, 0.18);
        border-color: rgba(229, 72, 77, 0.5);
    }

    .line-remove:disabled {
        opacity: 0.25;
        cursor: not-allowed;
    }

.line-add {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(47, 189, 125, 0.08);
    border: 1px solid rgba(47, 189, 125, 0.25);
    border-radius: 6px;
    color: #2fbd7d;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    padding: 0.5rem 0.9rem;
    cursor: pointer;
    font-family: inherit;
    transition: background 120ms ease, border-color 120ms ease;
    margin-top: 0.25rem;
}

    .line-add:hover {
        background: rgba(47, 189, 125, 0.16);
        border-color: rgba(47, 189, 125, 0.5);
    }

    .line-add span {
        font-size: 1rem;
        font-weight: 700;
        line-height: 1;
    }