html {
  font-size: 14px;
}

/* Print styles for Projects/Details report output */
@media print {

  /* Page setup */
  @page { margin: 12mm; }

  /* Hide non-report UI */
  nav.breadcrumb,
  .btn, .btn-group, .dropdown, .dropdown-menu,
  .nav-tabs,
  .alert, .modal,
  a[href^="javascript:"],
  .no-print {
    display: none !important;
  }

  /* Make cards look like report sections */
  .card {
    border: 1px solid #bbb !important;
    box-shadow: none !important;
    break-inside: avoid;
  }
  .card-header {
    background: #fff !important;
    border-bottom: 1px solid #bbb !important;
    font-weight: 600;
  }
  .card-body {
    padding: 8px 10px !important;
  }

  /* Ensure ALL tab panes are printed (not only active) */
  /* Do NOT force tab panes to print. The Projects/Details page provides a dedicated
     print-only block and the legacy tab UI is wrapped in .screen-only which is hidden.
     Removing the global rule avoids duplicate content in Print Preview. */
  .tab-content > .tab-pane {
    display: none !important;
  }

  /* Explicit, required print rules (acceptance checklist) */
  .no-print { display: none !important; }
  .tab-pane { display: block !important; }
  thead { display: table-header-group !important; }
  img { max-width: 100% !important; height: auto !important; }

  /* Remove tab-pane spacing artifacts */
  .tab-content {
    border: 0 !important;
  }

  /* Tables print cleanly */
  table { page-break-inside: auto; }
  thead { display: table-header-group; }
  tr { page-break-inside: avoid; page-break-after: auto; }

  /* Links should print like text */
  a { color: #000 !important; text-decoration: none !important; }

  /* Reduce icon noise in print */
  .bi { display: none !important; }

  /* Hide interactive map tiles in print (show summary instead)
     Map container remains hidden so no blank tiles print */
  #projectMap, #map { display: none !important; }

  /* Printed snapshot image styling */
  #projectMapPrintImage img {
    max-width: 100% !important;
    height: auto !important;
    border: 1px solid #bbb !important;
    display: block;
  }

  /* Make static map print sharp and large */
  .static-map-print img, #projectMapPrintImage img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    border: 1px solid #bbb !important;
    display: block;
  }

  /* Tighten section spacing for compact report (no more than ~12px vertical gaps) */
  .report-print > * { margin-bottom: 8px !important; }
  .report-print .mb-2 { margin-bottom: 8px !important; }
  hr { margin: 6px 0 !important; border: 0; border-top: 1px solid #ddd; }

  /* Denser table cells for print */
  table.table-sm td, table.table-sm th { padding: 4px 6px !important; }
  tbody tr { page-break-inside: avoid; }

  /* Avoid large fixed map container causing blank pages */
  .tab-pane #projectMap, .tab-pane #projectMapPrintImage { height: auto !important; min-height: 0 !important; }

  /* Print section title */
  .print-section-title {
    margin: 8px 0 6px 0 !important;
    padding-bottom: 4px !important;
    border-bottom: 1px solid #bbb !important;
    font-size: 14pt !important;
    font-weight: 700 !important;
  }

}

@media (min-width: 768px) {
  html {
    font-size: 12px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}
.js-autogrow {
    overflow: hidden;
    resize: vertical;
    min-height: 2.25rem; /* ~ form-control height */
    max-height: 240px;
}


/* Keep every cell in the lines grid top-aligned */
#gr-lines > tr > td, #gr-lines > tr > th {
    vertical-align: top;
}

/* Reserve a small, consistent space for the friendly text under lookups
     so inputs don't "jump" when the label appears */
.lookup-ctl .form-text {
    min-height: 1.1rem; /* adjust 1.0–1.25rem to taste */
    margin-top: .25rem; /* small gap below the input */
}

    /* (Optional) avoid layout wobble if the link shows/hides */
    .lookup-ctl .form-text .js-details {
        display: inline-block;
    }

/* === SAP B1-style compact inputs (Activities pages) === */
.input-compact { max-width: 360px; }
.input-date { max-width: 240px; }
.input-num { max-width: 180px; }
.textarea-compact { max-width: 860px; }

/* Readonly display should still look like inputs */
.input-readonly {
    background-color: #f8f9fa;
    cursor: default;
}

@media (max-width: 768px) {
    .input-compact, .input-date, .input-num, .textarea-compact { 
        max-width: 100%; 
    }
}

/* Shared KPI tiles (Insights + Home At-a-glance) */
.kpi {
    transition: transform .12s ease, box-shadow .12s ease, background-color .2s ease;
    border: 1px solid rgba(0,0,0,.06);
    background: #fff;
}

    .kpi:hover {
        transform: translateY(-2px);
        box-shadow: 0 .2rem .8rem rgba(0,0,0,.08);
    }

    .kpi .icon {
        width: 28px;
        height: 28px;
        border-radius: 6px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 16px;
        background: #eef4ff;
        color: #3356d4;
        margin-right: .5rem;
    }

    .kpi .muted {
        color: #6b7280;
    }

/* Hover effect for clickable cards (headline indicators, etc.) */
.hover-card {
    transition: transform .12s ease, box-shadow .12s ease;
    cursor: pointer;
}

    .hover-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 .3rem 1rem rgba(0,0,0,.12) !important;
    }

/* ===== Mobile Optimizations for Index Page ===== */

/* Admin context: stack vertically on mobile, horizontal on desktop */
.admin-context-mobile {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.9rem;
}

@media (min-width: 768px) {
    .admin-context-mobile {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0;
        font-size: 1.25rem; /* fs-5 equivalent */
    }

    .admin-context-mobile .admin-item:not(:last-child) {
        margin-right: 1rem;
    }
}
