/**
 * Form Components Styles
 * Estilos padronizados para componentes de formulário reutilizáveis
 */

/* =========================================
   CARD CONTAINER
   ========================================= */
.compact-card {
    border: 1px solid #e3e6f0;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    border-radius: 0.35rem;
    margin-bottom: 1rem;
    background: #fff;
}

.compact-header {
    background-color: #f8f9fc;
    border-bottom: 1px solid #e3e6f0;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.compact-header-title {
    font-weight: 700;
    color: #4e73df;
    font-size: 1rem;
    margin: 0;
}

.compact-header-extra {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    min-height: 1rem;
    flex-shrink: 0;
}

.compact-header-title-group {
    flex: 1;
    min-width: 0;
}

.compact-body {
    padding: 1.25rem;
}

/* =========================================
   FORM LABELS
   ========================================= */
.form-label-custom {
    display: block;
    font-weight: 600;
    font-size: 0.8rem;
    color: #5a5c69;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.form-label-custom .required {
    color: #e74a3b;
    margin-left: 2px;
}

/* =========================================
   FORM CONTROLS (Input, Select, Textarea)
   ========================================= */
.form-control-custom {
    border: 1px solid #d1d3e2;
    border-radius: 0.35rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control-custom:focus {
    border-color: #4e73df;
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.15);
    outline: none;
}

.form-control-custom:disabled,
.form-control-custom[readonly] {
    background-color: #f8f9fc;
    cursor: not-allowed;
}

.form-control-custom.is-invalid {
    border-color: #e74a3b;
}

.form-control-custom.is-invalid:focus {
    box-shadow: 0 0 0 0.2rem rgba(231, 74, 59, 0.15);
}

/* =========================================
   HELPER TEXT
   ========================================= */
.form-helper {
    font-size: 0.75rem;
    color: #858796;
    margin-top: 0.25rem;
}

.form-helper i {
    opacity: 0.7;
}

/* =========================================
   QUANTITY INPUT (com unidade)
   ========================================= */
.quantity-wrapper {
    position: relative;
}

.quantity-wrapper .unit-label {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #858796;
    font-size: 0.85rem;
    font-weight: 600;
    pointer-events: none;
}

.quantity-wrapper input {
    padding-right: 50px;
}

/* =========================================
   FILTER STYLES (para filtros em listagens)
   ========================================= */
.filter-label {
    font-weight: 600;
    font-size: 0.75rem;
    color: #858796;
    margin-bottom: 0.2rem;
    text-transform: uppercase;
}

/* =========================================
   ACTION BUTTONS
   ========================================= */
.btn-submit {
    padding: 0.6rem 2rem;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.03em;
}

/* =========================================
   TABLE COMPACT STYLES
   ========================================= */
.table-compact th,
.table-compact td {
    padding: 0.4rem;
    font-size: 0.85rem;
    vertical-align: middle;
}

.table-compact th {
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    background-color: #f8f9fc;
    border-top: none;
    font-weight: 700;
    color: #5a5c69;
    position: sticky;
    top: 0;
    z-index: 2;
}

.compact-table-scroll {
    max-height: var(--compact-table-max-height, 70vh);
    overflow-y: auto;
}

.compact-table-scroll table {
    margin-bottom: 0;
}

.compact-table-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    background-color: #f8f9fc;
}
