/* ============================================================
   master-form.css
   Shared styles for master (add/edit) form pages — e.g.
   product.php, godown.php, customer.php, etc.
   ============================================================ */

body { background:#f0f2f5; margin:0; padding:10px 14px; }

.sim-card {
    background:#fff;
    border-radius:10px;
    box-shadow:0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
    overflow:hidden;
}

.sim-card-header {
    background:#fff;
    border-bottom:2px solid #f1f5f9;
    padding:12px 20px;
    display:flex;
    align-items:center;
    justify-content:space-between;
}
.sim-card-header h2 {
    font-size:15px;
    font-weight:700;
    color:#1e293b;
    margin:0;
    letter-spacing:.01em;
}
.sim-badge {
    font-size:11px;
    background:#f1f5f9;
    color:#64748b;
    border-radius:20px;
    padding:3px 10px;
    font-weight:600;
}

.sim-body { padding:20px; }

/* Form rows */
.fr { display:flex; align-items:center; margin-bottom:9px; gap:0; }
.fr-2 { display:grid; grid-template-columns:1fr 1fr; gap:0 16px; margin-bottom:9px; }

.fl { /* field wrapper */
    display:flex;
    align-items:center;
    flex:1;
}

.lbl {
    font-size:12px;
    font-weight:500;
    color:#64748b;
    white-space:nowrap;
    text-align:right;
    padding-right:10px;
    min-width:130px;
    flex-shrink:0;
}
.lbl-sm { min-width:90px; }

.finp {
    flex:1;
    padding:7px 11px;
    background:#f8fafc;
    border:1px solid #e2e8f0;
    border-radius:6px;
    font-size:12.5px;
    color:#1e293b;
    outline:none;
    transition:border-color .15s, background .15s, box-shadow .15s;
    width:100%;
    box-sizing:border-box;
    font-family:inherit;
}
.finp:focus {
    background:#fff;
    border-color:#3b82f6;
    box-shadow:0 0 0 3px rgba(59,130,246,.12);
}
.finp:disabled {
    background:#f1f5f9;
    color:#94a3b8;
    cursor:not-allowed;
    border-color:#e2e8f0;
}
.finp.required-star { border-left:3px solid #3b82f6; }

/* Button bar */
.btn-bar {
    display:flex;
    justify-content:center;
    align-items:center;
    gap:8px;
    padding:16px 20px;
    border-top:1px solid #f1f5f9;
    background:#fafafa;
}
.abtn {
    width:46px;
    height:46px;
    border-radius:10px;
    border:none;
    cursor:pointer;
    font-size:15px;
    color:#fff;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    text-decoration:none;
    transition:transform .12s, box-shadow .12s, filter .12s;
    position:relative;
}
.abtn:hover { transform:translateY(-2px); box-shadow:0 5px 14px rgba(0,0,0,.22); filter:brightness(1.06); }
.abtn:active { transform:translateY(0); box-shadow:none; filter:brightness(.95); }
.abtn[disabled] { opacity:.4; pointer-events:none; }

.abtn-prev   { background:#2563eb; }
.abtn-next   { background:#38bdf8; }
.abtn-search { background:#db2777; }
.abtn-print  { background:#7c3aed; }
.abtn-add    { background:#16a34a; }
.abtn-edit   { background:#ea580c; }
.abtn-del    { background:#dc2626; }
.abtn-exit   { background:#e2e8f0; color:#64748b; }

/* tooltip on hover */
.abtn::after {
    content: attr(data-tip);
    position:absolute;
    bottom:calc(100% + 6px);
    left:50%;
    transform:translateX(-50%);
    background:#1e293b;
    color:#fff;
    font-size:10px;
    font-weight:600;
    padding:3px 8px;
    border-radius:4px;
    white-space:nowrap;
    opacity:0;
    pointer-events:none;
    transition:opacity .15s;
}
.abtn:hover::after { opacity:1; }

/* Save/Cancel extended buttons */
.abtn-save   { width:auto; padding:0 18px; background:#16a34a; gap:6px; font-size:12.5px; font-weight:600; }
.abtn-cancel { width:auto; padding:0 16px; background:#64748b; gap:6px; font-size:12.5px; font-weight:600; }

/* Audit info footer */
.audit-info {
    margin-top:14px;
    padding-top:10px;
    border-top:1px dashed #e2e8f0;
    display:flex;
    flex-wrap:wrap;
    gap:16px;
    font-size:11px;
    color:#94a3b8;
}
.audit-info i { margin-right:4px; }
.audit-info b { color:#64748b; }

/* ============================================================
   Search modal
   ============================================================ */
.srch-overlay {
    display:none;
    position:fixed;
    inset:0;
    background:rgba(15,23,42,.5);
    z-index:9999;
    align-items:flex-start;
    justify-content:center;
    padding-top:60px;
}
.srch-dialog {
    background:#fff;
    border-radius:12px;
    width:94%;
    max-width:980px;
    overflow:hidden;
    box-shadow:0 24px 64px rgba(0,0,0,.3);
    max-height:85vh;
    display:flex;
    flex-direction:column;
}
.srch-header {
    padding:14px 18px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    border-bottom:1px solid #f1f5f9;
}
.srch-title { font-size:14px; font-weight:700; color:#1e293b; }
.srch-close {
    background:#f1f5f9;
    border:none;
    color:#64748b;
    width:30px;
    height:30px;
    border-radius:6px;
    cursor:pointer;
    font-size:16px;
    display:flex;
    align-items:center;
    justify-content:center;
}

.srch-filterbar {
    padding:12px 18px;
    border-bottom:1px solid #f1f5f9;
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    align-items:end;
    background:#fafbfc;
}
.srch-label {
    display:block;
    font-size:10.5px;
    font-weight:700;
    text-transform:uppercase;
    letter-spacing:.06em;
    color:#94a3b8;
    margin-bottom:4px;
}
.srch-ctl {
    padding:7px 10px;
    border:1px solid #e2e8f0;
    border-radius:6px;
    font-size:12.5px;
    outline:none;
    background:#fff;
}
.srch-grow { flex:1; min-width:160px; }
.srch-input {
    width:100%;
    padding:7px 11px;
    border:1px solid #e2e8f0;
    border-radius:6px;
    font-size:12.5px;
    outline:none;
    background:#fff;
    box-sizing:border-box;
}
.srch-go-btn {
    padding:8px 18px;
    border-radius:6px;
    border:none;
    background:#2563eb;
    color:#fff;
    font-size:12.5px;
    font-weight:600;
    cursor:pointer;
}

.srch-tablewrap { overflow:auto; flex:1; }
.srch-table { width:100%; border-collapse:collapse; font-size:12px; }
.srch-table thead tr { position:sticky; top:0; background:#f8fafc; }
.srch-table th {
    padding:9px 14px;
    text-align:left;
    border-bottom:2px solid #e2e8f0;
    font-weight:600;
    color:#374151;
    font-size:11.5px;
}
.srch-table td { padding:8px 14px; border-bottom:1px solid #f1f5f9; color:#1e293b; }
.srch-table td.srch-id   { color:#64748b; font-weight:600; }
.srch-table td.srch-name { font-weight:500; color:#1e293b; }
.srch-table td.srch-val  { color:#64748b; }
.srch-table td.srch-empty { text-align:center; padding:24px; color:#94a3b8; }

.srch-table tbody tr.srch-row { cursor:pointer; transition:background .1s; background:#fff; }
.srch-table tbody tr.srch-row:nth-child(even) { background:#f8fafc; }
.srch-table tbody tr.srch-row:hover { background:#eff6ff; }

.srch-pagination { display:flex; border-top:1px solid #f1f5f9; }
.srch-page-btn {
    flex:1;
    padding:10px;
    border:none;
    background:#f8fafc;
    color:#374151;
    font-size:12.5px;
    font-weight:600;
    cursor:pointer;
}
.srch-page-btn--prev { border-right:1px solid #f1f5f9; }
.srch-page-btn--next { border-left:1px solid #f1f5f9; }
.srch-page-info { padding:10px 16px; font-size:12px; color:#64748b; white-space:nowrap; align-self:center; }
