/*
 * =============================================
 * CLINIC COMPACT DENSITY — LEVEL 2 (SYSTEM-WIDE)
 * Loaded after clinic-theme.css
 *
 * Covers every page in the system:
 *   Add Patient · Patients List · Patient Profile
 *   Visit Workspace · Visit History · Archive
 *   System Settings · Edit Patient · All Modals
 *
 * NO zoom · NO transform · NO font below 11px
 * =============================================
 */

/* ─── Shared height token ───────────────────── */
:root {
    --compact-h: 36px;
}

/* ============================================================
   1. PAGE SECTION PADDING (ALL PAGES)
   Filament: <section class="… py-8 gap-y-8">
   py-8 = 32px. Reduce to 16px top / 20px bottom.
   ============================================================ */

.fi-page > section {
    padding-top:    16px !important;
    padding-bottom: 20px !important;
    gap:            10px !important;
}

.fi-page > section > div.grid {
    gap: 8px !important;
}

/* ============================================================
   2. TOPBAR  64px → 54px (ALL PAGES)
   ============================================================ */

.fi-topbar nav {
    height:     54px !important;
    min-height: 54px !important;
}

.ctxbar-title  { font-size: 14px !important; }
.ctxbar-crumbs { font-size: 11px !important; }

.ctxbar-action-btn {
    padding:     0.38rem 0.65rem !important;
    font-size:   0.7rem !important;
    min-height:  30px !important;
    line-height: 1.3 !important;
}

/* ============================================================
   3. SIDEBAR HEADER + NAV ITEMS (ALL PAGES)
   ============================================================ */

.fi-sidebar-header {
    height: 54px !important;
}

.fi-sidebar-nav {
    padding-top:    0.5rem !important;
    padding-bottom: 0.5rem !important;
}

.fi-sidebar-nav-groups {
    gap: 0.2rem !important;
}

.fi-sidebar-item-button {
    padding-top:    0.45rem !important;
    padding-bottom: 0.45rem !important;
    font-size:      0.78rem !important;
    gap:            0.5rem !important;
}

/* ============================================================
   4. FILAMENT NATIVE MODALS (ALL PAGES)
   fi-modal-header has px-6 pt-6 (Tailwind)
   fi-modal-content has gap-y-4 py-6 px-6
   fi-modal-footer  has py-5 px-6
   ============================================================ */

.fi-modal-header {
    padding-left:  1rem !important;
    padding-right: 1rem !important;
    padding-top:   0.875rem !important;
}

.fi-modal-content {
    padding-left:   1rem !important;
    padding-right:  1rem !important;
    padding-top:    0.75rem !important;
    padding-bottom: 0.75rem !important;
    gap:            0.625rem !important;
}

.fi-modal-footer {
    padding-left:   1rem !important;
    padding-right:  1rem !important;
    padding-top:    0.625rem !important;
    padding-bottom: 0.625rem !important;
}

/* ============================================================
   5. FILAMENT NATIVE INPUTS & SELECTS
   ============================================================ */

.fi-input-wrp {
    min-height: var(--compact-h) !important;
}

.fi-select-input {
    min-height: var(--compact-h) !important;
    font-size:  13px !important;
}

.fi-fo-placeholder {
    height:     var(--compact-h) !important;
    min-height: var(--compact-h) !important;
    max-height: var(--compact-h) !important;
    font-size:  13px !important;
    padding:    0 10px !important;
}

.fi-section-content-ctn {
    padding: 12px 14px !important;
}

.fi-section-header-ctn {
    padding: 8px 14px !important;
}

/* ============================================================
   6. CUSTOM CLINIC INPUTS  44px → 36px (ALL PAGES)
   ============================================================ */

.clinic-input {
    height:     var(--compact-h) !important;
    min-height: var(--compact-h) !important;
    max-height: var(--compact-h) !important;
    padding:    0 10px !important;
    font-size:  13px !important;
}

.clinic-input.clinic-input-sm {
    height:     30px !important;
    min-height: 30px !important;
    max-height: 30px !important;
    padding:    0 8px !important;
    font-size:  12px !important;
}

.clinic-select {
    height:     var(--compact-h) !important;
    min-height: var(--compact-h) !important;
    max-height: var(--compact-h) !important;
    padding:    0 2rem 0 10px !important;
    font-size:  13px !important;
}

.clinic-search-input {
    height:     var(--compact-h) !important;
    min-height: var(--compact-h) !important;
    padding:    0 10px !important;
    font-size:  13px !important;
}

.clinic-readonly-value {
    height:     var(--compact-h) !important;
    min-height: var(--compact-h) !important;
    max-height: var(--compact-h) !important;
    padding:    0 10px !important;
    font-size:  13px !important;
}

/* ============================================================
   7. FIELD LABELS (ALL PAGES)
   ============================================================ */

.clinic-field-label {
    font-size:   11px !important;
    min-height:  15px !important;
    line-height: 15px !important;
}

.clinic-label {
    font-size: 11px !important;
}

.clinic-field {
    gap: 6px !important;
}

/* ============================================================
   8. DATE / TIME PICKERS  44px → 36px (ALL PAGES)
   ============================================================ */

.clinic-picker-field {
    height:     var(--compact-h) !important;
    min-height: var(--compact-h) !important;
    max-height: var(--compact-h) !important;
}

.clinic-picker-input-row {
    height: var(--compact-h) !important;
}

.clinic-picker-type-input {
    font-size:  13px !important;
    min-height: var(--compact-h) !important;
}

.clinic-picker-value,
.clinic-picker-placeholder {
    font-size: 13px !important;
}

.clinic-field > .clinic-date-picker-wrap,
.clinic-field > .clinic-time-picker-wrap,
.clinic-input-compatible {
    height:     var(--compact-h) !important;
    min-height: var(--compact-h) !important;
    max-height: var(--compact-h) !important;
}

.clinic-field > .clinic-date-picker-wrap > .clinic-picker-field,
.clinic-field > .clinic-date-picker-wrap > .clinic-picker-input-row,
.clinic-field > .clinic-time-picker-wrap > .clinic-picker-field {
    height:     var(--compact-h) !important;
    min-height: var(--compact-h) !important;
    max-height: var(--compact-h) !important;
}

/* ============================================================
   9. VISIT TYPE SEGMENTED CONTROL  44px → 36px
   ============================================================ */

.clinic-segmented-option {
    height:    var(--compact-h) !important;
    padding:   0 0.625rem !important;
    font-size: 13px !important;
}

/* ============================================================
   10. SYSTEM-WIDE TABS (.clinic-tabs / .clinic-tab-btn)
   Used in: System Settings · Edit Patient
   ============================================================ */

.clinic-tabs {
    margin-bottom: 0.625rem !important;
    padding:       2px !important;
}

.clinic-tab-btn {
    padding:   0.35rem 0.75rem !important;
    font-size: 0.78rem !important;
}

/* ============================================================
   11. PATIENT PROFILE TABS (.pp-tab-nav / .pp-tab-btn)
   Defined in clinic-theme.css
   ============================================================ */

.pp-tab-nav {
    min-height:    var(--compact-h) !important;
    margin-bottom: 0.625rem !important;
}

.pp-tab-btn {
    padding:   0.375rem 0.75rem !important;
    font-size: 0.75rem !important;
}

/* ============================================================
   12. PATIENT PROFILE CARDS (.pp-card)
   Defined in clinic-theme.css
   ============================================================ */

.pp-card-header {
    padding:   0.45rem 0.875rem !important;
    font-size: 0.68rem !important;
}

.pp-lv-body {
    padding: 0.625rem 0.875rem !important;
}

/* ============================================================
   13. ARCHIVE TABS
   Defined as inline <style> in archive-visits.blade.php
   ============================================================ */

.archive-tab-btn {
    padding:   0.45rem 0.875rem !important;
    font-size: 0.78rem !important;
}

/* Archive filter date fields */
.archive-date-field .clinic-picker-input-row {
    height:     var(--compact-h) !important;
    min-height: var(--compact-h) !important;
}

/* ============================================================
   14. ADD PATIENT CARD
   Inline <style> in add-patient.blade.php — !important wins.
   ============================================================ */

.ap-card {
    margin-bottom: 0.75rem !important;
}

.ap-card-header {
    padding: 10px 14px 8px !important;
}

.ap-card-body {
    padding: 12px 14px !important;
    gap:     10px !important;
}

.ap-sep {
    padding-top: 0.45rem !important;
}

.ap-age-value {
    height:    var(--compact-h) !important;
    font-size: 13px !important;
    padding:   0 10px !important;
}

/* ============================================================
   15. CHRONIC DISEASE CARDS (ALL PAGES)
   ============================================================ */

.clinic-chronic-grid {
    gap:           10px !important;
    margin-bottom: 10px !important;
}

.clinic-chronic-trigger {
    padding:    8px 10px !important;
    min-height: 44px !important;
    gap:        8px !important;
}

.clinic-check-icon-box {
    width:         18px !important;
    height:        18px !important;
    min-width:     18px !important;
    border-radius: 4px !important;
}

.clinic-chronic-name {
    font-size: 13px !important;
}

.clinic-chronic-abbr {
    font-size:     10px !important;
    padding:       2px 5px !important;
    border-radius: 3px !important;
}

.clinic-chronic-details {
    padding: 8px 10px !important;
}

.clinic-chronic-details-grid {
    gap: 8px !important;
}

/* ============================================================
   16. TEXTAREA (ALL PAGES)
   ============================================================ */

.clinic-textarea {
    min-height:  72px !important;
    padding:     8px 10px !important;
    font-size:   13px !important;
    line-height: 1.45 !important;
}

/* ============================================================
   17. VISIT WORKSPACE LAYOUT GAPS
   Inline <style> in patient-visit-workspace.blade.php
   ============================================================ */

.pwk-step1-layout {
    gap: 10px !important;
}

.pwk-grid-2col {
    gap: 10px !important;
}

.pwk-exam-measurements-grid {
    gap: 10px !important;
}

.pwk-measurements-side {
    gap: 10px !important;
}

.pwk-measurements-history-body {
    padding-top: 0.5rem !important;
}

.pwk-measurements-history-scroll {
    gap:            0.625rem !important;
    padding-bottom: 0.5rem !important;
}

.pwk-measurement-history-card {
    padding: 0.75rem !important;
    gap:     0.5rem !important;
}

.pwk-notes-grid {
    gap: 10px !important;
}

/* ============================================================
   18. VISIT WORKSPACE PLANNED PROCEDURES
   ============================================================ */

.planned-procedures-grid {
    gap: 10px !important;
}

.planned-procedure-card {
    padding:       0.625rem 0.75rem !important;
    border-radius: 10px !important;
}

.planned-procedure-fields {
    gap: 8px !important;
}

/* Picker height inside planned procedures */
.pwk-planned-procedures-body .clinic-picker-input-row {
    height:     var(--compact-h) !important;
    min-height: var(--compact-h) !important;
}

.pwk-planned-procedures-body .clinic-picker-type-input {
    min-height: var(--compact-h) !important;
    padding:    0 8px !important;
    font-size:  13px !important;
}

.pwk-planned-procedures-body .clinic-picker-cal-btn {
    width:      var(--compact-h) !important;
    min-width:  var(--compact-h) !important;
    height:     var(--compact-h) !important;
}

.planned-procedure-notes-field {
    min-height: 56px !important;
    height:     56px !important;
    padding:    6px 8px !important;
    font-size:  12px !important;
}

.pwk-planned-procedures-body {
    padding-top: 0.5rem !important;
}

/* ============================================================
   19. VISIT WORKSPACE NEW-RECORD MODAL (.nrm-*)
   ============================================================ */

.nrm-card {
    padding:       1rem !important;
    border-radius: 12px !important;
}

.nrm-header {
    gap:           0.625rem !important;
    margin-bottom: 0.875rem !important;
}

.nrm-icon {
    width:  36px !important;
    height: 36px !important;
}

.nrm-title {
    font-size: 0.9rem !important;
}

.nrm-desc {
    margin-top: 0.25rem !important;
    font-size:  0.8rem !important;
}

.nrm-actions {
    gap: 0.5rem !important;
}

/* ============================================================
   20. PATIENTS LIST PAGE MODALS
   ============================================================ */

.pl-btn-remove-solid {
    padding:   6px 12px !important;
    font-size: 0.8rem !important;
}

.pl-modal-icon-warn,
.pl-modal-icon-danger {
    width:  36px !important;
    height: 36px !important;
}

/* ============================================================
   21. FORM GRID GAPS (ALL PAGES)
   ============================================================ */

.clinic-form-grid {
    gap: 10px 12px !important;
}

.clinic-form-grid.two-cols {
    gap: 12px !important;
}

.clinic-form-grid-3 {
    gap: 12px !important;
}

/* ============================================================
   22. GENERAL CLINIC CARDS (Edit Patient, System Settings)
   ============================================================ */

.clinic-card-body {
    padding: 12px 14px !important;
}

/* ============================================================
   23. BUTTONS (ALL PAGES)
   ============================================================ */

.clinic-btn-primary {
    padding:   6px 12px !important;
    font-size: 13px !important;
}

.clinic-btn-secondary {
    padding:   6px 12px !important;
    font-size: 13px !important;
}

.clinic-btn-success {
    padding:   6px 12px !important;
    font-size: 13px !important;
}

/* ============================================================
   24. DATA TABLES (ALL PAGES)
   ============================================================ */

.clinic-table {
    font-size: 13px !important;
}

.clinic-table th {
    padding:   5px 8px !important;
    font-size: 12px !important;
}

.clinic-table td {
    padding:   6px 8px !important;
    font-size: 13px !important;
}

.measurements-table th {
    padding:   5px 8px !important;
    font-size: 12px !important;
}

.measurements-table td {
    font-size: 13px !important;
}

/* ============================================================
   25. PATIENT PROFILE HERO STATS
   ============================================================ */

.pp-profile-hero .ph-stat {
    padding: 0.5rem 0.625rem !important;
}

.pp-profile-hero .ph-stats {
    gap: 0 !important;
}
