/* ============================================
   Forms
   ============================================ */

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition-fast);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(200, 149, 108, 0.15);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

select {
    cursor: pointer;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

/* AI Suggestion */
.ai-suggestion {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.ai-hint {
    color: var(--text-muted);
    font-size: 12px;
}

/* Angebot specific */
.angebot-header-info {
    background: var(--bg-dark);
    padding: 16px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 20px;
    font-size: 14px;
}

.positionen-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
}

.position-row {
    display: grid;
    grid-template-columns: 2fr 80px 100px 100px 40px;
    gap: 12px;
    align-items: center;
    padding: 12px;
    background: var(--bg-dark);
    border-radius: var(--border-radius-sm);
}

.position-row input {
    padding: 8px 12px;
}

.position-remove {
    background: none;
    border: none;
    color: var(--accent-danger);
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
    opacity: 0.7;
    transition: var(--transition-fast);
}

.position-remove:hover {
    opacity: 1;
}

.angebot-summary {
    background: var(--bg-dark);
    padding: 20px;
    border-radius: var(--border-radius-sm);
    margin-top: 20px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    color: var(--text-secondary);
}

.summary-row.total {
    border-top: 1px solid var(--border-color);
    margin-top: 8px;
    padding-top: 16px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Rechnung Preview */
.rechnung-preview {
    padding: 32px;
    background: white;
    color: #1a1a1a;
    margin: 24px;
    border-radius: var(--border-radius-sm);
}

.rechnung-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e5e5e5;
}

.rechnung-firma {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
}

.rechnung-nummer {
    text-align: right;
}

.rechnung-nummer h3 {
    color: var(--accent-primary);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.rechnung-nummer p {
    font-size: 20px;
    font-weight: 600;
}

.rechnung-adressen {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.rechnung-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.rechnung-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
}

.rechnung-table th {
    background: #f5f5f5;
    padding: 12px;
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    color: #666;
}

.rechnung-table td {
    padding: 12px;
    border-bottom: 1px solid #e5e5e5;
}

.rechnung-table .text-right {
    text-align: right;
}

.rechnung-totals {
    display: flex;
    justify-content: flex-end;
}

.rechnung-totals table {
    width: 280px;
}

.rechnung-totals td {
    padding: 8px 0;
}

.rechnung-totals .total-row {
    font-size: 18px;
    font-weight: 700;
    border-top: 2px solid #1a1a1a;
}

/* ============================================
   Auto-suggest Dropdown
   ============================================ */

.suggest-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: var(--shadow-lg);
}

.suggest-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s ease;
}

.suggest-item:last-child {
    border-bottom: none;
}

.suggest-item:hover {
    background: rgba(200, 149, 108, 0.08);
}

.suggest-item-name {
    font-weight: 500;
}

.suggest-item-detail {
    font-size: 11px;
    color: var(--text-muted);
}

/* ============================================
   Customer Presets & Autocomplete
   ============================================ */

.preset-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.preset-select {
    flex: 1;
    min-width: 200px;
}

.hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
    font-style: italic;
}

.position-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

/* Position with autocomplete wrapper */
.position-row {
    position: relative;
}

.pos-beschreibung-wrapper {
    position: relative;
    flex: 1;
}

.material-suggest {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--accent-primary);
    border-radius: var(--border-radius-sm);
    max-height: 180px;
    overflow-y: auto;
    z-index: 200;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.material-suggest-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.15s ease;
}

.material-suggest-item:last-child {
    border-bottom: none;
}

.material-suggest-item:hover {
    background: rgba(200, 149, 108, 0.1);
}

.material-suggest-name {
    font-weight: 500;
    font-size: 13px;
}

.material-suggest-meta {
    display: flex;
    gap: 8px;
    font-size: 11px;
    color: var(--text-muted);
}

.material-suggest-meta .price {
    color: var(--accent-success);
    font-weight: 600;
}

.material-suggest-meta .stock {
    color: var(--text-secondary);
}

/* Material picker modal */
.material-picker-list {
    max-height: 400px;
    overflow-y: auto;
}

.material-picker-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    margin-bottom: 8px;
    cursor: pointer;
    transition: opacity 0.15s ease, transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.material-picker-item:hover {
    border-color: var(--accent-primary);
    background: rgba(200, 149, 108, 0.08);
}

.material-picker-item.selected {
    border-color: var(--accent-success);
    background: rgba(90, 158, 111, 0.1);
}

.material-picker-check {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.material-picker-item.selected .material-picker-check {
    background: var(--accent-success);
    border-color: var(--accent-success);
    color: white;
}

