/* ============================================================
   Acompanhamento de Produção — Visual Ficha de Caderno
   ============================================================ */

/* ---------- Reset básico ---------- */
*, *::before, *::after { box-sizing: border-box; }

/* ---------- Cabeçalho da página ---------- */
.px-3.py-3 h4 {
    font-size: 1rem;
}
.px-3.py-3 small {
    font-size: .72rem;
}
.px-3.py-3 img {
    height: 32px !important;
}

/* ---------- Grid de fichas ---------- */
.ficha-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-start;
}

.ficha {
    background: #fff;
    border: 1px solid #DDE1E6;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    transition: box-shadow .15s ease;
    width: 220px;        /* largura fixa */
    max-width: 100%;  
    flex-shrink: 0;
}

@media (max-width: 900px) {
    .ficha { width: calc(50% - 7px); }
}
@media (max-width: 580px) {
    .ficha { width: 100%; }
}

.ficha:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,.08);
}

/* ---------- Cabeçalho da ficha ---------- */
.ficha-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 8px 5px 10px;
    background: #F5F6F8;
    border-bottom: 1.5px solid #DDE1E6;
}

.linha-badge {
    font-size: 11px;
    font-weight: 600;
    color: #1a2232;
    letter-spacing: .01em;
    text-transform: uppercase;
}

.ficha-header-meta {
    font-size: 10px;
    color: #8A8F98;
    margin-left: 6px;
    flex: 1;
}

.header-actions {
    display: flex;
    gap: 1px;
}
.header-actions button {
    border: none;
    background: transparent;
    color: #9AA0A8;
    width: 24px;
    height: 24px;
    border-radius: 5px;
    font-size: .78rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .1s;
}
.header-actions button:hover {
    background: #E8EAED;
    color: #1F2329;
}
.header-actions button.btn-danger-soft:hover {
    background: #FDECEA;
    color: #c0392b;
}

/* ---------- Corpo da ficha ---------- */
.ficha-body {
    padding: 0;
}

.field-row {
    display: grid;
    grid-template-columns: 76px 1fr;
    border-bottom: 0.5px solid #F0F1F3;
    height: auto;
}
.field-row:last-child {
    border-bottom: none;
}

.field-label {
    font-size: 7.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #9AA0A8;
    padding: 3px 5px 3px 9px;
    border-right: 0.5px solid #F0F1F3;
    background: #FAFBFC;
    display: flex;
    align-items: center;
    line-height: 1.3;
}

.field-value {
    font-size: 10.5px;
    color: #1a2232;
    padding: 3px 7px;
    display: flex;
    align-items: center;
    word-break: break-word;
    line-height: 1.4;
}
.field-value.empty {
    color: #C7CBD1;
    font-style: italic;
    font-size: 10px;
}

/* ---------- Nota (rodapé da ficha) ---------- */
.ficha-nota {
    padding: 5px 10px 6px 12px;
    font-size: 10.5px;
    color: #6B7280;
    border-top: 0.5px dashed #DDE1E6;
    background: #FDFDF8;
    font-style: italic;
    display: flex;
    align-items: flex-start;
    gap: 4px;
    line-height: 1.4;
}
.ficha-nota i {
    margin-top: 1px;
    flex-shrink: 0;
    opacity: .6;
}

/* ---------- Toolbar ---------- */
.ficha-toolbar {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.ficha-toolbar .form-select {
    font-size: .76rem;
    padding: 5px 10px;
}

.ficha-toolbar .btn {
    font-size: .76rem;
    padding: 5px 11px;
}

.search-wrap {
    flex: 1 1 200px;
    position: relative;
    min-width: 180px;
}
.search-wrap i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #8A8F98;
    font-size: .78rem;
    pointer-events: none;
}
.search-wrap input {
    width: 100%;
    border: 1px solid #DDE1E6;
    background: #fff;
    border-radius: 8px;
    padding: 5px 12px 5px 28px;
    font-size: .76rem;
    outline: none;
    color: #1a2232;
    transition: border-color .15s;
}
.search-wrap input:focus {
    border-color: #6B7CFF;
    box-shadow: 0 0 0 3px rgba(107,124,255,.1);
}

/* ---------- Empty state ---------- */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: #8A8F98;
}
.empty-state i {
    font-size: 2rem;
    opacity: .4;
    display: block;
    margin-bottom: 8px;
}
.empty-state p {
    font-size: .84rem;
    margin-bottom: 14px;
}

/* ---------- Contador ---------- */
.ficha-count {
    font-size: 11px;
    color: #8A8F98;
    margin-bottom: 10px;
}

/* ---------- Modal campos ---------- */
#entryModal .modal-header {
    background: #F5F6F8;
    border-bottom: 1.5px solid #DDE1E6;
}
#entryModal .form-label {
    font-size: .76rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #6B7280;
    margin-bottom: 3px;
}
#entryModal .form-control,
#entryModal .form-select {
    font-size: .85rem;
    border-color: #DDE1E6;
    border-radius: 7px;
}
#entryModal .form-control:focus,
#entryModal .form-select:focus {
    border-color: #6B7CFF;
    box-shadow: 0 0 0 3px rgba(107,124,255,.1);
}

.ficha-id {
    font-size: 9px;
    color: #9AA0A8;
    margin-left: 6px;
    flex: 1;
}