.detail-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--color-border-light);
    min-height: var(--toolbar-height);
}

.detail-panel__title {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
}

.detail-panel__close {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-secondary);
    transition: background var(--transition-fast);
}

.detail-panel__close:hover {
    background: var(--color-bg-hover);
    color: var(--color-text-primary);
}

.detail-panel__content {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-lg);
}

/* Form groups */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-group__label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-xs);
}

.form-group__input {
    width: 100%;
    height: 32px;
    padding: 0 var(--space-sm);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg-input);
    font-size: var(--font-size-base);
    transition: border-color var(--transition-fast);
}

.form-group__input:focus {
    border-color: var(--color-border-focus);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}

.form-group__input--error {
    border-color: var(--color-danger);
}

.form-group__error {
    font-size: var(--font-size-xs);
    color: var(--color-danger);
    margin-top: var(--space-xxs);
}

.form-group__select {
    width: 100%;
    height: 32px;
    padding: 0 var(--space-sm);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg-input);
    font-size: var(--font-size-base);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%236E6E73' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 28px;
}

.form-group__select:focus {
    border-color: var(--color-border-focus);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}

.form-group__textarea {
    width: 100%;
    min-height: 80px;
    padding: var(--space-sm);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg-input);
    font-size: var(--font-size-base);
    resize: vertical;
    line-height: 1.4;
}

.form-group__textarea:focus {
    border-color: var(--color-border-focus);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}

/* Row layout */
.form-row {
    display: flex;
    gap: var(--space-md);
}

.form-row .form-group {
    flex: 1;
}

/* Amount input */
.form-group__amount {
    display: flex;
    align-items: center;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    height: 32px;
}

.form-group__amount-prefix {
    padding: 0 var(--space-sm);
    background: var(--color-bg-stripe);
    border-right: 1px solid var(--color-border);
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    height: 100%;
}

.form-group__amount input {
    border: none;
    padding: 0 var(--space-sm);
    flex: 1;
    height: 100%;
    text-align: right;
    font-family: var(--font-mono);
    font-size: var(--font-size-md);
}

.form-group__amount input:focus {
    outline: none;
}

.form-group__amount:focus-within {
    border-color: var(--color-border-focus);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}

/* Buttons in detail */
.detail-actions {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--color-border-light);
}

.detail-actions .btn {
    flex: 1;
}

/* Split transactions sub-form */
.splits-container {
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-top: var(--space-sm);
}

.splits-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    background: var(--color-bg-stripe);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
}

.split-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--color-border-light);
}

.split-row:last-child {
    border-bottom: none;
}

.split-row select, .split-row input {
    height: 28px;
    padding: 0 var(--space-sm);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
}

.split-row__category {
    flex: 1;
}

.split-row__amount {
    width: 100px;
    text-align: right;
    font-family: var(--font-mono);
}

.split-row__delete {
    width: 24px;
    height: 24px;
    color: var(--color-danger);
    opacity: 0.6;
}

.split-row__delete:hover {
    opacity: 1;
}

.splits-total {
    display: flex;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-md);
    background: var(--color-bg-stripe);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
}

.splits-total--warning {
    color: var(--color-warning);
}

/* Status selector */
.status-selector {
    display: flex;
    gap: var(--space-xs);
}

.status-selector__btn {
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    border: 1px solid var(--color-border);
    transition: all var(--transition-fast);
}

.status-selector__btn.active {
    color: white;
    border-color: transparent;
}

.status-selector__btn.active.status--planned  { background: var(--color-status-planned); }
.status-selector__btn.active.status--created  { background: var(--color-status-created); }
.status-selector__btn.active.status--cleared  { background: var(--color-status-cleared); }
.status-selector__btn.active.status--locked   { background: var(--color-status-locked); }
.status-selector__btn.active.status--canceled { background: var(--color-status-canceled); }

/* Autocomplete dropdown */
.autocomplete {
    position: relative;
}

.autocomplete__list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 200px;
    overflow-y: auto;
    background: var(--color-bg-content);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-popover);
    z-index: 100;
    display: none;
}

.autocomplete__list.open {
    display: block;
}

.autocomplete__item {
    padding: var(--space-sm) var(--space-md);
    cursor: pointer;
    font-size: var(--font-size-base);
}

.autocomplete__item:hover,
.autocomplete__item.highlighted {
    background: var(--color-bg-selected);
}
