/* ============================================================
   Shan HazComm — UI Polish
   Spacing, visual rhythm, and padding refinements.
   Does NOT change brand colors, fonts, or design language.
   ============================================================ */

:root {
    --hse-green:     #7AAB42;
    --hse-red:       #E2322B;
    --hse-radius:    8px;
    --hse-radius-sm: 5px;
    --hse-shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.07), 0 1px 2px rgba(0, 0, 0, 0.04);
    --hse-shadow:    0 2px 10px rgba(0, 0, 0, 0.09), 0 1px 4px rgba(0, 0, 0, 0.05);
}


/* ── Page / Container ─────────────────────────────────────── */

/* Let MudBlazor manage main content top padding (AppBar offset) */
/* Add breathing room between AppBar and page content globally */
.mud-main-content > * {
    margin-top: 1rem;
}

/* Ensure every page has breathing room at the bottom */
.mud-main-content {
    padding-bottom: 3rem !important;
}

/* Consistent padding for all content containers */
.mud-container-root {
    padding-left:  1.5rem !important;
    padding-right: 1.5rem !important;
    padding-top:   1.25rem !important;
}


/* ── Page Titles ─────────────────────────────────────────── */

.mud-typography-h4 {
    margin-top:    1rem    !important;
    margin-bottom: 1.75rem !important;
    font-weight:   600     !important;
    letter-spacing: -0.015em;
    line-height:   1.25;
}

.mud-typography-h5 {
    margin-bottom: 1rem !important;
    font-weight:   600  !important;
    line-height:   1.3;
}

.mud-typography-h6 {
    margin-bottom: 0.75rem !important;
    font-weight:   600     !important;
}


/* ── Form Grid ───────────────────────────────────────────── */

/* More breathing room between form groups */
.mb-3 {
    margin-bottom: 1.25rem !important;
}

.mb-2 {
    margin-bottom: 0.875rem !important;
}


/* ── MudPaper / Cards ────────────────────────────────────── */

.mud-paper-root {
    border-radius: var(--hse-radius) !important;
    box-shadow:    var(--hse-shadow-sm) !important;
}

.mud-paper-outlined {
    border-radius: var(--hse-radius) !important;
}


/* ── AppBar ──────────────────────────────────────────────── */

.mud-appbar {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14) !important;
}


/* ── Buttons ─────────────────────────────────────────────── */

.mud-button-root:not(.mud-icon-button) {
    border-radius:   6px             !important;
    padding:         0.45rem 1.5rem  !important;
    font-weight:     500             !important;
    letter-spacing:  0.025em;
    transition:      box-shadow 0.15s ease, transform 0.1s ease !important;
}

.mud-button-root:not(.mud-icon-button):hover {
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.16) !important;
    transform:  translateY(-1px);
}

.mud-button-root:not(.mud-icon-button):active {
    transform: translateY(0);
}

/* Full-width buttons (FullWidth=true) get consistent vertical padding */
.mud-button-full-width {
    padding-top:    0.6rem !important;
    padding-bottom: 0.6rem !important;
}


/* ── Input Fields ────────────────────────────────────────── */

/* Slightly more padding inside text inputs for readability */
.mud-input-root .mud-input {
    padding-top:    0.5rem  !important;
    padding-bottom: 0.375rem !important;
}

/* Better visual weight on input labels */
.mud-input-label {
    font-weight: 500 !important;
    font-size:   0.875rem !important;
}

/* Textarea inputs — a little more padding */
.mud-input-root textarea {
    padding: 0.5rem 0 !important;
    line-height: 1.6 !important;
}


/* ── Select / Dropdown (Bootstrap Blazor) ────────────────── */

.bootstrap-select .dropdown-toggle,
.bb-select {
    border-radius: var(--hse-radius-sm) !important;
    padding: 0.45rem 0.875rem !important;
}


/* ── Tables ──────────────────────────────────────────────── */

.mud-table-container {
    border-radius: var(--hse-radius) !important;
    overflow: hidden;
    box-shadow: var(--hse-shadow-sm) !important;
}

.mud-table-head .mud-table-cell {
    font-weight:      600   !important;
    font-size:        0.8rem !important;
    letter-spacing:   0.04em;
    text-transform:   uppercase;
    padding:          0.75rem 1rem !important;
    background-color: #f5f7f5;
}

.mud-table-body .mud-table-cell {
    padding: 0.7rem 1rem !important;
}

.mud-table-body .mud-table-row:hover {
    background-color: rgba(122, 171, 66, 0.05) !important;
}


/* ── Dialogs / Modals ────────────────────────────────────── */

.mud-dialog {
    border-radius: var(--hse-radius) !important;
}

.mud-dialog-title {
    padding: 1.25rem 1.5rem 0.75rem !important;
    font-weight: 600 !important;
}

.mud-dialog-content {
    padding: 0.75rem 1.5rem 1rem !important;
}

.mud-dialog-actions {
    padding: 0.75rem 1.5rem 1.25rem !important;
    gap: 0.5rem;
}


/* ── MudCard (IncidentCardItem, ActionCardItem) ──────────── */

.mud-card {
    border-radius: var(--hse-radius) !important;
    box-shadow:    var(--hse-shadow-sm) !important;
    transition:    box-shadow 0.2s ease !important;
    margin-bottom: 0.875rem;
    overflow:      visible;
}

.mud-card:hover {
    box-shadow: var(--hse-shadow) !important;
}

.mud-card-header {
    padding: 1rem 1.25rem 0.5rem !important;
    align-items: flex-start !important;
    flex-wrap: wrap !important;
}

.mud-card-header-content {
    overflow: visible !important;
    min-width: 0;
    flex: 1 1 auto;
}

/* Ensure chip rows inside cards always wrap */
.mud-card .mud-stack {
    flex-wrap: wrap !important;
}

/* Fix the default top margin on card header actions */
.mud-card-header-actions {
    margin-top: 0 !important;
    text-align: right;
}

.mud-card-content {
    padding: 0.5rem 1.25rem !important;
}

/* Last MudCardContent gets bottom padding */
.mud-card-content:last-of-type {
    padding-bottom: 0.875rem !important;
}

.mud-card-actions {
    padding: 0.5rem 1rem 0.875rem !important;
    gap: 0.5rem;
}

/* Card title (h6 inside card header) */
.mud-card-header .mud-typography-h6 {
    font-size:     0.95rem !important;
    font-weight:   600     !important;
    line-height:   1.4;
    margin-bottom: 0.2rem !important;
}

/* Caption lines in card header */
.mud-card-header .mud-typography-caption {
    font-size:     0.78rem  !important;
    line-height:   1.5;
    color:         #6c757d;
    display:       block;
    margin-bottom: 0.1rem;
}


/* ── MudGrid ─────────────────────────────────────────────── */

.mud-grid {
    gap: 0;
}

/* Give MudItem consistent bottom spacing in form grids */
.mud-grid .mud-grid-item {
    padding: 0.5rem !important;
}


/* ── MudField (ObservationDetail detail view) ────────────── */

.mud-field-root {
    border-radius: var(--hse-radius-sm) !important;
    margin-bottom: 0.25rem;
}

.mud-field-root .mud-field-label {
    font-size:   0.72rem  !important;
    font-weight: 600      !important;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color:       #6c757d  !important;
}

.mud-field-root .mud-field-input {
    font-size:   0.9rem  !important;
    padding-top: 0.25rem !important;
}


/* ── MudExpansionPanel (Additional Details section) ──────── */

.mud-expand-panel {
    border-radius: var(--hse-radius) !important;
    margin-bottom: 0.5rem;
}

.mud-expand-panel-header {
    font-weight: 600 !important;
    padding: 0.75rem 1rem !important;
}

.mud-expand-panel-content {
    padding: 0.5rem 1rem 1rem !important;
}


/* ── MudSimpleTable (ActionDetail key-value table) ───────── */

.mud-simple-table {
    border-radius: var(--hse-radius-sm);
    overflow: hidden;
}

.mud-simple-table th {
    font-weight:     600    !important;
    font-size:       0.78rem !important;
    letter-spacing:  0.04em;
    text-transform:  uppercase;
    color:           #6c757d !important;
    padding:         0.65rem 1rem !important;
    background-color: #f5f7f5;
    border-bottom:   2px solid #e9ecef !important;
}

.mud-simple-table td {
    padding:      0.6rem 1rem !important;
    font-size:    0.875rem    !important;
    border-bottom: 1px solid #f0f0f0 !important;
    vertical-align: middle;
}

.mud-simple-table tr:last-child td {
    border-bottom: none !important;
}

/* Label column (first td) bold */
.mud-simple-table td:first-child {
    font-weight: 500;
    color:       #495057;
    width:       40%;
}


/* ── MudAlert ────────────────────────────────────────────── */

.mud-alert {
    border-radius: var(--hse-radius-sm) !important;
    padding: 0.75rem 1rem !important;
    font-size: 0.875rem !important;
    margin-bottom: 0.75rem;
}


/* ── MudCheckBox (reminder checkbox in ActionCardItem) ───── */

.mud-checkbox {
    margin-top: 0.25rem !important;
}

.mud-checkbox .mud-button-label {
    font-size: 0.82rem !important;
}


/* ── .item_holder (TextInputParam / custom inputs) ───────── */

.item_holder {
    min-height:    auto;
    padding:       0.4rem 0.75rem !important;
    border-radius: var(--hse-radius-sm);
    transition:    background-color 0.15s ease;
}

.item_holder:focus-within {
    background-color: rgba(122, 171, 66, 0.04);
}


/* ── S3 Images (media in cards) ──────────────────────────── */

/* Wrap images in a flex container for consistent spacing */
.ignore_style_img {
    border-radius: var(--hse-radius-sm) !important;
    margin:        6px    !important;
    height:        150px;
    object-fit:    cover;
    max-width:     100%;
    transition:    transform 0.2s ease;
}

.ignore_style_img:hover {
    transform: scale(1.02);
}


/* ── Chips / Badges ──────────────────────────────────────── */

/* Only override border-radius — do NOT touch padding or height
   as it breaks vertical alignment in flex rows */
.mud-chip {
    border-radius: 20px !important;
}

/* Severity chips inside MudField */
.mud-field-root .mud-chip {
    margin:      0   !important;
    font-weight: 600 !important;
}


/* ── Responsive: tighter padding on mobile ───────────────── */

@media (max-width: 768px) {
    .mud-container-root {
        padding-left:  0.75rem !important;
        padding-right: 0.75rem !important;
    }

    .mud-typography-h4 {
        font-size:     1.5rem  !important;
        margin-bottom: 1.25rem !important;
    }

    .mud-button-root {
        padding: 0.5rem 1rem !important;
    }
}

/* Empty state */
.empty-state-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
    opacity: 0.75;
}
