/* =====================================================================
   VMS — Compact design mode for Add / Edit pages.
   Opt-in: applies only when <body> has the class "vms-compact".
   CSS-only, reversible, no markup/logic change. Tightens spacing while
   preserving readability, touch targets and keyboard accessibility.
   Loaded AFTER each page's inline <style> so these overrides win.
   ===================================================================== */

/* ── Headings: professional dark-slate text instead of saturated blue,
      with a slim accent bar kept as a subtle brand cue. ── */
body.vms-compact h4.mb-3 {
    color: #1e293b !important;
    border-bottom-color: #edf1f7 !important;
}
body.vms-compact h4.mb-3::before { background: #2563eb !important; width: 3px; }

/* ── Normal case (no forced UPPERCASE) + comfortable letter-spacing ── */
body.vms-compact,
body.vms-compact * { text-transform: none !important; letter-spacing: normal !important; }

/* ── Slightly larger base font for readability ── */
body.vms-compact { font-size: 14px; }
body.vms-compact .vms-subtitle { font-size: .82rem; }

/* ── Smoother, softer components ── */
body.vms-compact .form-control,
body.vms-compact .custom-select {
    border-radius: 8px;
    border-color: #e2e8f0;
    transition: border-color .15s ease, box-shadow .15s ease;
}
body.vms-compact .form-control:focus,
body.vms-compact .custom-select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
body.vms-compact .btn { border-radius: 8px; transition: background-color .15s ease, box-shadow .15s ease, transform .12s ease; }
body.vms-compact .vms-section-card {
    border: 1px solid #eef1f6;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .05);
    transition: box-shadow .15s ease;
}
body.vms-compact .vms-section-card:hover { box-shadow: 0 3px 12px rgba(15, 23, 42, .07); }

/* ── "Add More" buttons: friendly soft-accent pills with a label ── */
body.vms-compact .btn-add-more {
    background: #eff6ff !important;
    border: 1px solid #bfdbfe !important;
    color: #1d4ed8 !important;
    border-radius: 999px !important;
    padding: .3rem .9rem !important;
    font-size: .8rem !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    line-height: 1.4;
    box-shadow: none !important;
    transition: background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .12s ease;
}
body.vms-compact .btn-add-more .fa { font-size: .78rem; }
/* Append a clear label after the + icon (buttons are icon-only in markup). */
body.vms-compact .btn-add-more::after { content: "Add More"; }
body.vms-compact .btn-add-more:not(:disabled):hover {
    background: #2563eb !important;
    border-color: #2563eb !important;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, .28) !important;
}
body.vms-compact .btn-add-more:not(:disabled):active { transform: translateY(0); box-shadow: none !important; }
body.vms-compact .btn-add-more:disabled,
body.vms-compact .btn-add-more[disabled] { opacity: .5; }

/* ── Page shell ── */
body.vms-compact .vms-container.py-4 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
body.vms-compact .vms-form-panel { padding: 1rem 1.15rem; }
body.vms-compact .vms-header-banner { margin-bottom: .75rem; }

/* ── Stepper / progress ── */
/* Step indicator (Company Info → Submit) hidden on Add/Edit pages per request. */
body.vms-compact #vms-stepper { display: none !important; }
body.vms-compact .vms-stepper { padding-bottom: .6rem !important; margin-bottom: .75rem !important; }

/* ── Section cards ── */
body.vms-compact .vms-section-card {
    padding: .85rem 1rem !important;
    margin-bottom: .85rem !important;
    border-radius: 10px;
}
body.vms-compact .vms-section-card h4,
body.vms-compact h4.mb-3 { font-size: 1.05rem !important; margin-bottom: .7rem !important; }

/* ── Form rows / fields ── */
body.vms-compact .form-group,
body.vms-compact .mb-3 { margin-bottom: .6rem !important; }
body.vms-compact label { margin-bottom: .25rem; font-size: .85rem; font-weight: 600; }
body.vms-compact .form-control,
body.vms-compact .custom-select {
    min-height: calc(1.5em + .55rem + 2px);
    height: auto;
    padding: .35rem .7rem;
    font-size: .9rem;
}
body.vms-compact textarea.form-control { min-height: 60px; }
/* Tighter gutters so columns sit closer */
body.vms-compact .row { margin-left: -8px; margin-right: -8px; }
body.vms-compact .row > [class^="col-"],
body.vms-compact .row > [class*=" col-"] { padding-left: 8px; padding-right: 8px; }

/* Field hints / errors stay compact but readable */
body.vms-compact .vms-field-error { font-size: .74rem; margin-top: 2px; }
body.vms-compact small,
body.vms-compact .text-muted.small { font-size: .74rem; }

/* ── Buttons (consistent, slightly tighter) ── */
body.vms-compact .btn { font-size: .85rem; }
body.vms-compact .btn-sm { padding: .25rem .6rem; }

/* ── File upload controls: clean, modern, consistent (Add + Edit) ── */
body.vms-compact input[type="file"].form-control { padding: .28rem .4rem; height: auto; cursor: pointer; font-size: .82rem; }
body.vms-compact input[type="file"].form-control::file-selector-button {
    background: #2563eb; color: #fff; border: 0; border-radius: 7px;
    padding: .35rem .9rem; margin-right: .7rem; font-weight: 600; font-size: .8rem;
    cursor: pointer; transition: background .15s ease;
}
body.vms-compact input[type="file"].form-control:hover::file-selector-button { background: #1d4ed8; }
body.vms-compact input[type="file"].form-control::-webkit-file-upload-button {
    background: #2563eb; color: #fff; border: 0; border-radius: 7px;
    padding: .35rem .9rem; margin-right: .7rem; font-weight: 600; font-size: .8rem; cursor: pointer;
}
/* Selected-file chip */
body.vms-compact .vms-file-badge {
    background: #eff6ff !important; border: 1px solid #dbeafe !important; border-radius: 8px !important;
    padding: 5px 10px !important; margin-top: 6px; color: #1e293b !important;
    display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px;
}
body.vms-compact .vms-file-badge .vms-file-icon { color: #2563eb; }
body.vms-compact .vms-file-badge .vms-file-size { color: #64748b; font-size: .76rem; }
/* Preview button on the selected file */
body.vms-compact .vms-preview-btn {
    background: #2563eb !important; color: #fff !important; border: 0; border-radius: 6px;
    padding: 2px 10px !important; font-size: .76rem; font-weight: 600; margin-left: 6px;
    display: inline-flex; align-items: center; gap: 4px; cursor: pointer; transition: background .15s ease;
}
body.vms-compact .vms-preview-btn:hover { background: #1d4ed8 !important; opacity: 1; }

/* ── Upload areas ── */
body.vms-compact .vms-upload-meta { margin-top: 2px !important; font-size: .72rem; }
body.vms-compact .vms-attach-field .input-group { gap: 6px; }
body.vms-compact .vms-file-saved { padding: 3px 9px; font-size: .74rem; }
body.vms-compact .vms-file-badge { margin-top: 4px; padding: 4px 8px; }

/* ── Tables ── */
body.vms-compact table td,
body.vms-compact table th { padding: .4rem .55rem; font-size: .85rem; vertical-align: middle; }

/* ── Tips / guidelines callout ── */
body.vms-compact .vms-tips-box { padding: .6rem .85rem !important; margin-bottom: .85rem !important; }

/* ── Responsiveness: keep columns stacking cleanly on small screens ── */
@media (max-width: 576px) {
    body.vms-compact .vms-section-card { padding: .75rem .8rem !important; }
    body.vms-compact .vms-form-panel { padding: .8rem .85rem; }
    /* Touch targets remain usable */
    body.vms-compact .btn,
    body.vms-compact .form-control,
    body.vms-compact .custom-select { font-size: .9rem; }
}
