/* =============================================================================
   Mahendra Feeds ERP — Premium Theme
   Primary : #1E3A5F (Deep Navy)  |  Accent: #E8B923 (Gold)
   Version : 3.0  |  Clean Enterprise ERP Design
============================================================================= */

/* -- Design Tokens --------------------------------------------------------- */
:root {
    --navy:          #1E3A5F;
    --navy-dark:     #152B47;
    --navy-medium:   #2A4A72;
    --navy-light:    #EBF0F8;
    --gold:          #E8B923;
    --gold-dark:     #C9A01E;
    --gold-light:    #FBF0C2;
    --danger:        #DC3545;
    --danger-light:  #FDECEA;
    --success:       #198754;
    --success-light: #D1FAE5;
    --warning:       #F59E0B;
    --warning-light: #FEF3C7;
    --info:          #0EA5E9;
    --info-light:    #E0F2FE;
    --bg:            #F0F2F5;
    --surface:       #FFFFFF;
    --border:        #E2E8F0;
    --border-dark:   #CBD5E0;
    --text:          #1A202C;
    --text-muted:    #718096;
    --text-light:    #A0AEC0;
    --card-shadow:   0 2px 16px rgba(30, 58, 95, 0.08);
    --card-shadow-hover: 0 8px 32px rgba(30, 58, 95, 0.15);
    --radius:        10px;
    --radius-sm:     7px;
    --radius-lg:     14px;
}

/* -- Base ------------------------------------------------------------------ */
* { box-sizing: border-box; }
body {
    background-color: var(--bg);
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--text);
    font-size: 0.9rem;
    -webkit-font-smoothing: antialiased;
}

/* -- Page Loader ----------------------------------------------------------- */
#page-loader {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.85);
    z-index: 99999;
    align-items: center;
    justify-content: center;
}
#page-loader.active { display: flex; }
.spinner-brand {
    width: 44px; height: 44px;
    border: 4px solid var(--navy-light);
    border-top-color: var(--navy);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* -- Sidebar --------------------------------------------------------------- */
.main-sidebar {
    background: linear-gradient(180deg, var(--navy-dark) 0%, var(--navy) 60%, var(--navy-medium) 100%);
    box-shadow: 4px 0 20px rgba(21, 43, 71, 0.25);
}
.main-sidebar .brand-link {
    background: rgba(0, 0, 0, 0.18);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding: 13px 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}
.brand-logo-box {
    width: 36px; height: 36px;
    background: var(--gold);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(232,185,35,0.4);
}
.brand-logo-box i { color: var(--navy-dark); font-size: 0.95rem; }
.brand-text {
    color: #fff;
    font-weight: 700;
    font-size: 0.93rem;
    letter-spacing: 0.2px;
    line-height: 1.2;
}
.brand-text small {
    color: rgba(255,255,255,0.5);
    font-size: 0.69rem;
    font-weight: 400;
    display: block;
}

/* Sidebar scrollbar */
.sidebar { overflow-y: auto; overflow-x: hidden; }
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }

/* User panel in sidebar */
.sidebar-user-panel {
    padding: 11px 15px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    display: flex;
    align-items: center;
    gap: 10px;
}
.sidebar-user-panel img {
    width: 32px; height: 32px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.22);
    flex-shrink: 0;
}
.sidebar-user-name { color: #fff; font-size: 0.83rem; font-weight: 600; line-height: 1.2; }
.sidebar-user-role { color: rgba(255,255,255,0.48); font-size: 0.69rem; }

/* Nav items */
.sidebar .nav-sidebar { padding: 6px 0 16px; }
.sidebar .nav-item { margin: 0 7px 1px; }
.sidebar .nav-link {
    color: rgba(255,255,255,0.80);
    border-radius: 7px;
    padding: 8px 11px;
    transition: all 0.16s ease;
    display: flex;
    align-items: center;
    font-size: 0.845rem;
    font-weight: 500;
    gap: 0;
}
.sidebar .nav-link:hover {
    background: rgba(255,255,255,0.09);
    color: #fff;
    transform: translateX(2px);
}
.sidebar .nav-link.active,
.sidebar .nav-link.active:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #fff !important;
    font-weight: 600;
    box-shadow: none;
}
.sidebar .nav-link .nav-icon {
    color: rgba(255,255,255,0.55);
    width: 22px;
    text-align: center;
    font-size: 0.88rem;
    flex-shrink: 0;
    margin-right: 8px;
}
.sidebar .nav-link.active .nav-icon { color: var(--gold) !important; }
.sidebar .nav-link > p {
    flex: 1;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: inherit;
    white-space: nowrap;
}
.sidebar .nav-link > p > .right {
    font-size: 0.73rem;
    transition: transform 0.2s;
    color: rgba(255,255,255,0.38);
}
.menu-open > .nav-link {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}
.menu-open > .nav-link:not(.active) {
    box-shadow: none;
}
.menu-open > .nav-link > p > .right { transform: rotate(-90deg); }

/* Treeview sub-items */
.nav-treeview {
    padding: 2px 0;
    background: rgba(0,0,0,0.14);
    border-radius: 0 0 7px 7px;
    margin: 0 -7px;
}
.nav-treeview .nav-item { margin: 0; }
.nav-treeview .nav-link {
    padding: 7px 12px 7px 36px;
    border-radius: 0;
    font-size: 0.815rem;
    color: rgba(255,255,255,0.68);
    transform: none !important;
}
.nav-treeview .nav-link:hover {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.92);
}
.nav-treeview .nav-link.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff !important;
    font-weight: 600;
    box-shadow: none;
}
.nav-treeview .nav-link.active .nav-icon { color: var(--gold) !important; }
.nav-treeview .nav-icon { font-size: 0.48rem !important; color: rgba(255,255,255,0.35) !important; }

/* Sidebar group label */
.nav-sidebar-label {
    color: rgba(255,255,255,0.32);
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    padding: 13px 18px 3px;
    display: block;
    pointer-events: none;
}

/* -- Navbar ---------------------------------------------------------------- */
.main-header.navbar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 8px rgba(30,58,95,0.05);
    height: 56px;
    min-height: 56px;
}
.navbar-nav .nav-link { color: var(--text-muted) !important; padding: 0 10px; }
.navbar-nav .nav-link:hover { color: var(--navy) !important; }

/* Alert badge */
.navbar-badge {
    background: var(--gold) !important;
    color: var(--navy-dark) !important;
    font-size: 0.58rem !important;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    padding: 2px 4px;
    border-radius: 8px;
}

/* Navbar alert dropdown */
.alert-dropdown-header {
    background: var(--navy);
    color: #fff;
    padding: 11px 15px;
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.84rem;
    font-weight: 600;
}
.alert-item {
    padding: 9px 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    transition: background 0.13s;
}
.alert-item:hover { background: #F9FAFB; }
.alert-icon { font-size: 0.82rem; margin-top: 2px; }
.alert-severity-critical .alert-icon { color: var(--danger); }
.alert-severity-warning  .alert-icon { color: var(--warning); }
.alert-severity-info     .alert-icon { color: var(--info); }

/* Navbar user dropdown header */
.user-dd-header {
    background: var(--navy-light);
    padding: 14px;
    text-align: center;
    border-radius: 8px 8px 0 0;
    border-bottom: 1px solid var(--border);
}
.user-dd-header strong { color: var(--navy); font-size: 0.88rem; display: block; margin-top: 6px; }
.user-dd-role { color: var(--navy-medium); font-size: 0.73rem; }

/* -- Content Layout -------------------------------------------------------- */
.content-wrapper { background: var(--bg) !important; }

/* Content header (breadcrumb + title bar) */
.content-header { padding: 13px 22px; background: #fff; border-bottom: 1px solid var(--border); margin-bottom: 0; }
.content-header h1 {
    font-size: 1.18rem; font-weight: 700; color: var(--navy);
    display: flex; align-items: center; gap: 8px; margin: 0;
}
.content-header h1 i { color: var(--gold); font-size: 0.92rem; }
.breadcrumb { margin: 0; font-size: 0.79rem; background: none; padding: 0; }
.breadcrumb-item a { color: var(--navy-medium); text-decoration: none; }
.breadcrumb-item a:hover { color: var(--navy); text-decoration: underline; }
.breadcrumb-item.active { color: var(--text-muted); }
.breadcrumb-item + .breadcrumb-item::before { color: var(--text-light); }

.content { padding: 20px 22px; }

/* -- Cards ----------------------------------------------------------------- */
.card {
    background: var(--surface);
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    margin-bottom: 0;
    transition: box-shadow 0.2s;
}
.card-header {
    border-radius: var(--radius) var(--radius) 0 0 !important;
    border-bottom: 1px solid var(--border);
    padding: 13px 17px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--navy);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-title i { color: var(--gold); font-size: 0.9rem; }

/* Coloured card headers */
.card-header-navy {
    background: var(--navy) !important;
    border-bottom: none !important;
}
.card-header-navy .card-title,
.card-header-navy .card-title i,
.card-header-navy * { color: #fff !important; }

/* Card outline top-border variants */
.card-outline.card-primary  { border-top: 3px solid var(--navy); }
.card-outline.card-success  { border-top: 3px solid var(--success); }
.card-outline.card-warning  { border-top: 3px solid var(--gold); }
.card-outline.card-danger   { border-top: 3px solid var(--danger); }
.card-outline.card-info     { border-top: 3px solid var(--info); }

/* AdminLTE solid card header color overrides */
.card.card-primary:not(.card-outline) > .card-header { background: var(--navy); }
.card.card-success:not(.card-outline) > .card-header { background: var(--success); }
.card.card-warning:not(.card-outline) > .card-header { background: var(--gold); color: var(--navy-dark); }
.card.card-danger:not(.card-outline) > .card-header  { background: var(--danger); }

.card-footer .btn {
    pointer-events: auto;
    position: relative;
    z-index: 2;
}

/* Modals above page loader (z-index 99999); dialog must be above backdrop */
body.modal-open .modal {
    z-index: 100001 !important;
}
body.modal-open .modal-backdrop {
    z-index: 100000 !important;
}

/* Production — Record Output modal (scrollable body, footer always visible) */
#recordOutputModal .modal-dialog {
    max-width: 800px;
    width: calc(100% - 1.5rem);
    margin: 1.75rem auto;
}
#recordOutputModal .modal-content {
    overflow: visible;
}
#recordOutputModal .modal-body {
    overflow-x: hidden;
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;
    /* max-height set in JS from viewport; fallback: */
    max-height: calc(100vh - 220px);
}
#recordOutputModal .modal-footer {
    background: #fafbfc;
    border-top: 1px solid var(--border);
    position: relative;
    z-index: 2;
}

.card-footer {
    background: #FAFBFC;
    border-top: 1px solid var(--border);
    border-radius: 0 0 var(--radius) var(--radius) !important;
    padding: 12px 17px;
}

/* -- Dashboard date filter (compact, in welcome bar) ----------------------- */
.dashboard-date-filter-input {
    width: 7.5rem;
    max-width: 38vw;
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(255, 255, 255, 0.35);
    font-size: 0.8rem;
    height: calc(1.5em + 0.5rem + 2px);
}
.dashboard-date-filter .btn-outline-light {
    border-color: rgba(255, 255, 255, 0.35);
    color: rgba(255, 255, 255, 0.9);
}
.dashboard-date-filter .btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

/* -- Dashboard KPI Widgets ------------------------------------------------- */
.widget-card {
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    text-decoration: none !important;
    border: none;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    color: #fff;
}
a.widget-card,
a.widget-card:link,
a.widget-card:visited {
    color: #fff !important;
}
.widget-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(0,0,0,0.18);
    color: #fff !important;
    text-decoration: none !important;
}
.widget-card:hover .widget-value,
.widget-card:hover .widget-label,
.widget-card:hover .widget-breakdown,
.widget-card:hover .widget-breakdown-row,
.widget-card:hover .widget-breakdown-row span,
.widget-card:hover .widget-breakdown-row strong,
.widget-card:hover .card-body,
.widget-card:hover .card-body div {
    color: #fff !important;
}
.widget-card:focus,
.widget-card:active {
    color: #fff !important;
    text-decoration: none !important;
}
.widget-card .card-body { padding: 20px 22px; min-height: 110px; position: relative; }
.widget-icon {
    position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
    font-size: 2.8rem; opacity: 0.17;
}
.widget-value { font-size: 1.9rem; font-weight: 800; line-height: 1.1; margin-bottom: 4px; }
.widget-label { font-size: 0.77rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; opacity: 0.88; }
.widget-card .widget-breakdown {
    font-size: 0.72rem;
    line-height: 1.35;
    opacity: 0.95;
}
.widget-card .widget-breakdown-row {
    margin-bottom: 0.2rem;
}
.widget-card .widget-breakdown-row:last-child {
    margin-bottom: 0;
}
.widget-card.has-breakdown .card-body {
    min-height: 200px;
}

/* Widget colour variants */
.widget-navy   { background: linear-gradient(135deg, #152B47 0%, #1E3A5F 100%); color:#fff; }
.widget-gold   { background: linear-gradient(135deg, #B8891A 0%, #E8B923 100%); color:#fff; }
.widget-blue   { background: linear-gradient(135deg, #1565C0 0%, #2196F3 100%); color:#fff; }
.widget-green  { background: linear-gradient(135deg, #1B5E20 0%, #2E7D32 100%); color:#fff; }
.widget-teal   { background: linear-gradient(135deg, #00695C 0%, #00897B 100%); color:#fff; }
.widget-purple { background: linear-gradient(135deg, #4527A0 0%, #7B1FA2 100%); color:#fff; }
.widget-amber  { background: linear-gradient(135deg, #E65100 0%, #F57F17 100%); color:#fff; }
.widget-red    { background: linear-gradient(135deg, #B71C1C 0%, #E53935 100%); color:#fff; }
.widget-indigo { background: linear-gradient(135deg, #1A237E 0%, #3949AB 100%); color:#fff; }
.widget-grey   { background: linear-gradient(135deg, #37474F 0%, #546E7A 100%); color:#fff; }
/* Legacy aliases */
.widget-primary   { background: linear-gradient(135deg, #152B47 0%, #1E3A5F 100%); color:#fff; }
.widget-secondary { background: linear-gradient(135deg, #B8891A 0%, #E8B923 100%); color:#fff; }

/* -- Buttons --------------------------------------------------------------- */
.btn { border-radius: var(--radius-sm); font-weight: 600; font-size: 0.84rem; transition: all 0.16s; }
.btn-sm { font-size: 0.80rem; padding: 6px 14px; border-radius: 6px; }
.btn-xs { font-size: 0.74rem; padding: 3px 9px; border-radius: 5px; }

.btn-primary   { background: var(--navy); border-color: var(--navy); color:#fff; }
.btn-primary:hover { background: var(--navy-dark); border-color: var(--navy-dark); color:#fff; box-shadow: 0 4px 12px rgba(30,58,95,0.28); }

.btn-secondary { background: #6B7280; border-color: #6B7280; color:#fff; }
.btn-secondary:hover { background: #4B5563; border-color: #4B5563; color:#fff; }

.btn-success   { background: var(--success); border-color: var(--success); color:#fff; }
.btn-success:hover { background: #157347; border-color: #157347; color:#fff; box-shadow: 0 4px 12px rgba(25,135,84,0.28); }

.btn-warning   { background: var(--gold); border-color: var(--gold-dark); color: var(--navy-dark) !important; }
.btn-warning:hover { background: var(--gold-dark); border-color: var(--gold-dark); color: var(--navy-dark) !important; box-shadow: 0 4px 12px rgba(232,185,35,0.32); }

.btn-danger    { background: var(--danger); border-color: var(--danger); color:#fff; }
.btn-danger:hover { background: #BB2D3B; border-color: #BB2D3B; color:#fff; box-shadow: 0 4px 12px rgba(220,53,69,0.28); }

.btn-info      { background: var(--info); border-color: var(--info); color:#fff; }
.btn-info:hover { background: #0C87C5; border-color: #0C87C5; color:#fff; }

.btn-outline-primary { border-color: var(--navy); color: var(--navy); background: transparent; }
.btn-outline-primary:hover { background: var(--navy); color:#fff; }

.btn-outline-warning { border-color: var(--gold-dark); color: var(--gold-dark); background: transparent; }
.btn-outline-warning:hover { background: var(--gold); color: var(--navy-dark); border-color: var(--gold); }

/* -- Forms ----------------------------------------------------------------- */
.form-label { font-size: 0.84rem; font-weight: 600; color: #374151; margin-bottom: 5px; }

.form-control, .form-select {
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 0.875rem;
    color: var(--text);
    background-color: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus, .form-select:focus {
    border-color: var(--navy-medium);
    box-shadow: 0 0 0 3px rgba(30,58,95,0.11);
    outline: none;
}
.form-control.is-invalid { border-color: var(--danger); }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px rgba(220,53,69,0.11); }
.invalid-feedback { font-size: 0.79rem; color: var(--danger); }

.input-group-text {
    background: #F8FAFC;
    border-color: var(--border-dark);
    color: var(--navy);
    font-size: 0.84rem;
}
.input-group > .form-control,
.input-group > .form-select { border-radius: 0 !important; }
.input-group > :first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm) !important; }
.input-group > :last-child  { border-radius: 0 var(--radius-sm) var(--radius-sm) 0 !important; }
.input-group .form-control:not(:first-child):not(:last-child) { border-radius: 0 !important; }

textarea.form-control { resize: vertical; min-height: 90px; }

/* Flatpickr altInput */
.flatpickr-input[readonly] { background-color: #fff !important; cursor: pointer; }
.flatpickr-alt-input { background-color: #fff !important; cursor: pointer; }
.flatpickr-calendar {
    border-radius: var(--radius);
    box-shadow: 0 8px 30px rgba(30,58,95,0.14);
    border: 1px solid var(--border);
    font-family: inherit;
}
.flatpickr-day.selected,
.flatpickr-day.selected:hover { background: var(--navy); border-color: var(--navy); }
.flatpickr-day.today { border-color: var(--gold); color: var(--navy); font-weight: 700; }
.flatpickr-months .flatpickr-month { background: var(--navy); color: #fff; border-radius: var(--radius) var(--radius) 0 0; }
.flatpickr-current-month,
.flatpickr-current-month .numInputWrapper input,
.flatpickr-current-month .flatpickr-monthDropdown-months { color: #fff !important; }
.flatpickr-weekday { color: var(--navy); font-weight: 600; }

/* Select2 */
.select2-container--default .select2-selection--single {
    border: 1px solid var(--border-dark) !important;
    border-radius: var(--radius-sm) !important;
    height: 38px !important;
    padding: 4px 8px;
    background-color: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--navy-medium) !important;
    box-shadow: 0 0 0 3px rgba(30,58,95,0.11);
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--text);
    font-size: 0.875rem;
    line-height: 28px;
    padding-left: 2px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 36px; }
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: var(--navy);
}
.select2-dropdown {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-dark);
    box-shadow: 0 4px 16px rgba(30,58,95,0.12);
}
.select2-search__field {
    border-radius: 5px !important;
    border-color: var(--border-dark) !important;
    font-size: 0.875rem !important;
}

/* Tray issue — compact farm multi-select (Select2) */
.ec-form .ti-farm-select-wrap {
    position: relative;
}
.ec-form .ti-farm-select-wrap.is-invalid-wrap .select2-container--default .select2-selection--multiple {
    border-color: var(--bs-danger, #dc3545) !important;
}
.ec-form .ti-farm-select-wrap .select2-container {
    width: 100% !important;
}
.ec-form .ti-farm-select-wrap .select2-container--default .select2-selection--multiple {
    min-height: calc(1.5em + 0.75rem + 2px);
    max-height: calc(1.5em + 0.75rem + 2px);
    border: 1px solid var(--border-dark) !important;
    border-radius: var(--radius-sm) !important;
    background-color: #fff;
    padding: 0 0.5rem;
    display: flex;
    align-items: center;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.ec-form .ti-farm-select-wrap .select2-container--default.select2-container--focus .select2-selection--multiple,
.ec-form .ti-farm-select-wrap .select2-container--default.select2-container--open .select2-selection--multiple {
    border-color: var(--navy-medium) !important;
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.11);
}
.ec-form .ti-farm-select-wrap .select2-container--default .select2-selection--multiple .select2-selection__rendered {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
    width: 100%;
    overflow: hidden;
    min-height: calc(1.5em + 0.75rem);
}
.ec-form .ti-farm-select-wrap.ti-farm-select-empty .select2-container--default .select2-selection--multiple .select2-selection__rendered {
    justify-content: center;
    position: relative;
}
.ec-form .ti-farm-select-wrap .select2-container--default .select2-selection--multiple .select2-selection__choice {
    font-size: 0.75rem;
    line-height: 1.2;
    margin: 0;
    padding: 0.1rem 0.35rem;
    max-width: 5.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: #eef4fb;
    border: 1px solid #c5d5e8;
    color: var(--navy);
}
.ec-form .ti-farm-select-wrap .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    margin-right: 0.2rem;
    color: var(--navy-medium);
}
.ec-form .ti-farm-select-wrap .select2-container--default .select2-selection--multiple .select2-search--inline {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 4rem;
}
.ec-form .ti-farm-select-wrap.ti-farm-select-empty .select2-container--default .select2-selection--multiple .select2-search--inline,
.ec-form .ti-farm-select-wrap .select2-container--default .select2-selection--multiple .select2-selection__rendered:not(:has(.select2-selection__choice)) .select2-search--inline {
    flex: 1 1 100%;
    max-width: 100%;
    width: 100%;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ec-form .ti-farm-select-wrap .select2-container--default .select2-selection--multiple .select2-search__field {
    margin: 0;
    height: 1.5rem;
    font-size: 0.875rem;
    color: var(--text);
}
.ec-form .ti-farm-select-wrap.ti-farm-select-empty .select2-container--default .select2-selection--multiple .select2-search__field,
.ec-form .ti-farm-select-wrap .select2-container--default .select2-selection--multiple .select2-selection__rendered:not(:has(.select2-selection__choice)) .select2-search__field {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100%;
    text-align: center;
}
.ec-form .ti-farm-select-wrap .select2-container--default .select2-selection--multiple .select2-search__field::placeholder {
    color: #6c757d;
    opacity: 1;
    text-align: center;
}
.ec-form .ti-farm-select-wrap .select2-container--default .select2-selection--multiple .select2-selection__placeholder {
    color: #6c757d !important;
    font-size: 0.875rem;
    line-height: calc(1.5em + 0.75rem);
    margin: 0;
    padding: 0 0.5rem;
    display: block;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    float: none;
    text-align: center;
}
.ec-form .ti-farm-select-wrap.ti-farm-select-empty .select2-container--default .select2-selection--multiple .select2-selection__placeholder {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    line-height: 1.25;
    pointer-events: none;
}
.ec-form .ti-farm-select-wrap.ti-farm-select-empty .select2-container--default .select2-selection--multiple .select2-search__field {
    opacity: 0;
    width: 1px !important;
    min-width: 1px !important;
    padding: 0;
}
.ec-form .ti-farm-ms-bar {
    display: flex;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem 0.35rem;
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
}
.ec-form .ti-farm-ms-bar .btn {
    flex: 1;
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
}

/* -- Tables / DataTables --------------------------------------------------- */
.table { font-size: 0.8rem; color: var(--text); margin-bottom: 0; }
.table thead th {
    background: var(--navy);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 6px 10px;
    border: none !important;
    white-space: nowrap;
    line-height: 1.2;
}
.table td {
    padding: 5px 10px;
    vertical-align: middle;
    border-color: var(--border);
    line-height: 1.25;
}
/* Compact index / DataTables lists */
.dataTables_wrapper table.table.table-sm td,
.dataTables_wrapper table.table.table-sm th {
    padding-top: 4px;
    padding-bottom: 4px;
}
.dataTables_wrapper table.table tbody td .badge {
    padding: 2px 7px;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.2;
}
.dataTables_wrapper table.table tbody td .action-btn {
    width: 26px;
    height: 26px;
    font-size: 0.68rem;
}
.dataTables_wrapper table.table tbody td .action-btn-group {
    gap: 2px;
}
.table-hover tbody tr:hover td { background-color: var(--navy-light) !important; }
.table-striped > tbody > tr:nth-of-type(odd) > td { background-color: #FAFBFC; }
.table-bordered { border-color: var(--border); }
.table-bordered thead th { border-color: var(--navy) !important; }

/* DataTables */
.dataTables_wrapper .datatable-controls {
    align-items: center;
    margin-bottom: 0.75rem !important;
}
.dataTables_wrapper .datatable-controls > [class*="col-"]:first-child {
    display: flex;
    justify-content: flex-start;
}
.dataTables_wrapper .datatable-controls > [class*="col-"]:last-child {
    display: flex;
    justify-content: flex-end;
}
.dataTables_wrapper .dataTables_filter {
    float: none;
    text-align: left;
    margin: 0;
}
.dataTables_wrapper .dataTables_filter label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    width: 100%;
    justify-content: flex-start;
}
.dataTables_wrapper .dataTables_length {
    float: none;
    text-align: right;
    margin: 0;
}
.dataTables_wrapper .dataTables_length label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    justify-content: flex-end;
}
.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label,
.dataTables_wrapper .dataTables_info { font-size: 0.82rem; color: var(--text-muted); }
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sm);
    padding: 5px 10px;
    font-size: 0.82rem;
    color: var(--text);
    background: #fff;
}
.dataTables_wrapper .dataTables_filter input {
    margin-left: 0 !important;
    min-width: 220px;
}
.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--navy-medium);
    box-shadow: 0 0 0 3px rgba(30,58,95,0.1);
    outline: none;
}
@media (max-width: 767.98px) {
    .dataTables_wrapper .datatable-controls > [class*="col-"]:last-child {
        justify-content: flex-start;
        margin-top: 0.75rem;
    }
    .dataTables_wrapper .dataTables_length label {
        justify-content: flex-start;
    }
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 6px !important;
    font-size: 0.80rem;
    padding: 4px 10px !important;
    color: var(--navy) !important;
    border: 1px solid var(--border) !important;
    margin: 0 2px;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--navy) !important;
    border-color: var(--navy) !important;
    color: #fff !important;
    box-shadow: none;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:not(.disabled):hover {
    background: var(--navy-light) !important;
    color: var(--navy) !important;
    border-color: var(--border) !important;
}
.dataTables_wrapper .dataTables_processing {
    background: rgba(255,255,255,0.92);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--card-shadow);
    color: var(--navy);
    font-size: 0.84rem;
}
div.dt-buttons > .dt-button,
.dt-button {
    background: #fff !important;
    border: 1px solid var(--border-dark) !important;
    border-radius: var(--radius-sm) !important;
    font-size: 0.79rem !important;
    color: var(--navy) !important;
    padding: 5px 12px !important;
    margin-right: 4px !important;
    box-shadow: none !important;
}
div.dt-buttons > .dt-button:hover { background: var(--navy-light) !important; }

/* -- Status Badges --------------------------------------------------------- */
.badge {
    font-size: 0.73rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.2px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
/* Green — success states */
.badge-active,
.badge-confirmed,
.badge-delivered,
.badge-closed,
.badge-fully_returned { background: var(--success-light); color: var(--success); }
.badge-completed { background: #16a34a; color: #ffffff; }
/* Grey — inactive */
.badge-inactive, .badge-cancelled { background: #F3F4F6; color: #6B7280; }
/* Blue — in-progress states */
.badge-pending,
.badge-collected,
.badge-issued,
.badge-draft { background: var(--info-light); color: #0369A1; }
/* Amber — transit / partial */
.badge-in_transit,
.badge-partially_returned,
.badge-in_progress,
.badge-moved { background: var(--warning-light); color: #92400E; }
/* Navy — received / dispatched */
.badge-received,
.badge-dispatched { background: var(--navy-light); color: var(--navy); }
/* Danger */
.badge-critical { background: var(--danger-light); color: var(--danger); }
/* Bootstrap overrides */
.badge-secondary { background: #F3F4F6; color: #6B7280; }
.badge-success   { background: var(--success-light); color: var(--success); }
.badge-danger    { background: var(--danger-light); color: var(--danger); }
.badge-warning   { background: var(--warning-light); color: #92400E; }
.badge-info      { background: var(--info-light); color: #0369A1; }
.badge-primary   { background: var(--navy-light); color: var(--navy); }

/* -- Action Button Group --------------------------------------------------- */
.action-btn-group { display: flex; align-items: center; justify-content: center; gap: 4px; }

.dataTables_wrapper table.table tbody td .production-actions-dropdown .dropdown-toggle {
    padding: 0.2rem 0.5rem;
    font-size: 0.8rem;
}
.dataTables_wrapper table.table tbody td .production-actions-dropdown .dropdown-menu {
    font-size: 0.85rem;
    min-width: 11rem;
    z-index: 1050;
}
/* table-responsive clips Bootstrap 4 dropdowns — allow menu to show */
#productionTable_wrapper .table-responsive,
.dataTables_wrapper:has(#productionTable) .table-responsive {
    overflow: visible;
}
#productionTable_wrapper .dataTables_scrollBody {
    overflow: visible !important;
}
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px; height: 30px;
    border-radius: 6px;
    font-size: 0.77rem;
    border: none;
    cursor: pointer;
    transition: all 0.14s;
    text-decoration: none !important;
}
.action-btn:hover { transform: scale(1.12); opacity: 0.9; }
.action-btn-view    { background: var(--navy-light); color: var(--navy); }
.action-btn-edit    { background: var(--warning-light); color: #92400E; }
.action-btn-delete  { background: var(--danger-light); color: var(--danger); }
.action-btn-confirm { background: var(--success-light); color: var(--success); }
.action-btn-info    { background: var(--info-light); color: #0369A1; }

/* -- Flash Alerts ---------------------------------------------------------- */
.alert { border: none; border-left: 4px solid; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 0.87rem; }
.alert-success { background: var(--success-light); border-color: var(--success); color: #166534; }
.alert-danger,
.alert-error   { background: var(--danger-light); border-color: var(--danger); color: #991B1B; }
.alert-warning { background: var(--warning-light); border-color: var(--warning); color: #92400E; }
.alert-info    { background: var(--info-light); border-color: var(--info); color: #0369A1; }

/* -- Detail View Tables ---------------------------------------------------- */
.detail-table td:first-child {
    width: 165px;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.815rem;
    vertical-align: top;
    padding: 10px 16px 10px 0;
    white-space: nowrap;
}
.detail-table td:last-child { font-size: 0.875rem; color: var(--text); padding: 10px 0; }
.detail-table tr:not(:last-child) td { border-bottom: 1px solid var(--border); }

/* -- SweetAlert2 ----------------------------------------------------------- */
.swal2-popup { font-family: inherit; border-radius: var(--radius-lg); }
.swal2-confirm { background: var(--navy) !important; border-radius: var(--radius-sm) !important; }
.swal2-cancel  { background: #6B7280 !important; border-radius: var(--radius-sm) !important; }

/* -- Opening stock rows ---------------------------------------------------- */
.opening-stock-simple-grid .form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--navy);
}
.opening-stock-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.opening-stock-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem 1rem;
    padding: 0.75rem 0.85rem;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.opening-stock-row__head {
    flex: 0 0 100%;
    font-size: 0.9rem;
    color: var(--navy);
    margin-bottom: 0.15rem;
}
.opening-stock-row__fields {
    flex: 1 1 280px;
    min-width: 0;
}
.opening-stock-row__fields .form-label {
    font-size: 0.72rem;
    color: var(--text-muted);
}
.opening-stock-row__fields .form-control {
    font-weight: 600;
    color: var(--navy);
}
.opening-stock-row__actions {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-end;
    padding-bottom: 2px;
}
.opening-stock-add-btn {
    width: 38px;
    height: 38px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
@media (max-width: 575.98px) {
    .opening-stock-row__fields .col-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* -- Dashboard charts ------------------------------------------------------ */
.dashboard-chart-wrap {
    position: relative;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
}
.dashboard-chart-wrap--egg { height: 280px; }
.dashboard-chart-wrap--tray { height: 260px; max-width: 280px; }
.dashboard-chart-wrap--tray-sm { height: 220px; max-width: 240px; }

/* -- Egg Collection form layout -------------------------------------------- */
.ec-form .ec-section {
    margin-bottom: 1.75rem;
    padding-bottom: 1.75rem;
    border-bottom: 1px solid var(--border);
}
.ec-form .ec-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* Compact forms (dispatch, etc.) — balanced spacing, no section blocks */
.ec-form.ec-form-compact .dispatch-field {
    margin-bottom: 1rem;
}
.ec-form.ec-form-compact .dispatch-field .form-label {
    margin-bottom: 0.35rem;
    font-size: 0.875rem;
    font-weight: 600;
    display: block;
}
.ec-form.ec-form-compact .dispatch-field .form-control,
.ec-form.ec-form-compact .dispatch-field select.form-control {
    width: 100%;
}
.ec-form.ec-form-compact .dispatch-field .form-text,
.ec-form.ec-form-compact .dispatch-field small.text-muted {
    display: block;
    margin-top: 0.35rem;
    margin-bottom: 0;
    line-height: 1.35;
    font-size: 0.75rem;
}
.ec-form.ec-form-compact > .row:last-child .dispatch-field {
    margin-bottom: 0;
}
.ec-form .ec-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1rem;
}
.ec-form .ec-field {
    margin-bottom: 0;
}
.ec-form .ec-field .form-label {
    display: block;
    margin-bottom: 0.35rem;
    min-height: 1.25rem;
}
.ec-form .ec-field .form-control,
.ec-form .ec-field .form-select {
    width: 100%;
}
.ec-form .ec-field-hint {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    min-height: 1rem;
}
.ec-form .ec-field-readonly .form-control:disabled {
    background-color: #f3f4f6;
    color: #374151;
    opacity: 1;
    cursor: not-allowed;
}
.ec-form .ec-field-input .form-control,
.ec-form .ec-field-input .form-select {
    background-color: #fff;
}
.ec-form .ec-banner {
    background: linear-gradient(135deg, #1E3A5F 0%, #2a5080 100%);
    color: #fff;
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
}
.ec-form .ec-banner.ec-banner--compact {
    padding: 0.65rem 0.85rem;
}
.ec-form .ec-banner--compact .ec-banner-hint {
    font-size: 0.78rem;
    line-height: 1.35;
    margin-bottom: 0.5rem;
}
.ec-form .ec-banner-kicker {
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.75;
    margin-bottom: 0.15rem;
    line-height: 1.2;
}
.ec-form .ec-banner-value {
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.3;
    word-break: break-word;
}
.ec-form .ec-banner-sub {
    display: block;
    font-size: 0.7rem;
    opacity: 0.7;
    margin-top: 0.1rem;
}
.ec-form .ec-banner-cell {
    min-width: 0;
}
.ec-form .ec-banner-grid > [class*="col-"] {
    margin-bottom: 0;
}
.ec-form .ec-banner-issue {
    color: #E8B923;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.3;
    word-break: break-word;
}
.ec-form .ec-banner--compact .ec-banner-issue {
    font-size: 1.05rem;
    line-height: 1.25;
}
.ec-form .ec-banner-meta {
    font-size: 0.8125rem;
    opacity: 0.9;
}
.ec-form .ec-banner-meta dt {
    font-weight: 600;
    opacity: 0.75;
    margin-bottom: 0.15rem;
}
.ec-form .ec-banner-meta dd {
    margin: 0 0 0.65rem 0;
    font-weight: 500;
}
.ec-form .ec-banner-meta dd:last-child {
    margin-bottom: 0;
}
.ec-form .ec-banner-hint {
    font-size: 0.8125rem;
    opacity: 0.85;
    margin: 0;
}
.ec-form .ec-banner-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.85;
    margin-bottom: 0.35rem;
    color: #fff;
}
.ec-form .ec-banner--compact .ec-banner-label {
    font-size: 0.65rem;
    margin-bottom: 0.2rem;
}
.ec-form .ec-banner-input.form-control {
    background-color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #1f2937;
    font-size: 0.875rem;
}
.ec-form .ec-banner-input.form-control:focus {
    border-color: #E8B923;
    box-shadow: 0 0 0 0.2rem rgba(232, 185, 35, 0.35);
}
.ec-form .ec-banner-trip {
    margin-top: 0.25rem;
}

/* Egg collection create — tighter sections & farm cards */
.ec-form.ec-form-collection .ec-section {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
}
.ec-form.ec-form-collection .ec-section-title {
    margin-bottom: 0.5rem;
}
.ec-form.ec-form-collection .ec-field .form-label {
    margin-bottom: 0.2rem;
    min-height: 0;
    font-size: 0.78rem;
}
.ec-form.ec-form-collection .ec-field-hint {
    margin-top: 0.15rem;
    min-height: 0;
    font-size: 0.72rem;
}
.ec-form.ec-form-collection .ec-farm-card .card-body {
    padding: 0.5rem 0.75rem 0.35rem;
}
.ec-form.ec-form-collection .ec-farm-card.is-details-open .egg-type-breakdown {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
}
.ec-form.ec-form-collection .ec-farm-details-row {
    margin-left: -0.35rem;
    margin-right: -0.35rem;
    margin-bottom: 0.35rem;
}
.ec-form.ec-form-collection .ec-farm-details-row > [class*="col-"] {
    padding-left: 0.35rem;
    padding-right: 0.35rem;
    margin-bottom: 0.35rem;
}
.ec-form.ec-form-collection .ec-farm-split-title {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.ec-form.ec-form-collection .ec-totals-row {
    margin-left: -0.35rem;
    margin-right: -0.35rem;
    margin-bottom: 0.35rem;
}
.ec-form.ec-form-collection .ec-totals-row > [class*="col-"] {
    padding-left: 0.35rem;
    padding-right: 0.35rem;
}
.ec-form.ec-form-collection .egg-type-row {
    gap: 0.4rem;
    margin-bottom: 0.35rem;
}
.ec-form.ec-form-collection .egg-type-row .ec-field .form-label {
    margin-bottom: 0.15rem;
    min-height: 0;
}
.ec-form.ec-form-collection .egg-type-row .form-control,
.ec-form.ec-form-collection .egg-type-row .form-control-sm {
    min-height: calc(1.4em + 0.5rem + 2px);
    padding: 0.2rem 0.45rem;
    font-size: 0.8125rem;
}
.ec-form.ec-form-collection .egg-type-row .egg-type-actions .btn {
    min-width: 1.85rem;
    height: calc(1.4em + 0.5rem + 2px);
    padding: 0.15rem 0.35rem;
}
.ec-form.ec-form-collection .egg-collection-totals .form-control-sm {
    min-height: calc(1.4em + 0.5rem + 2px);
}
.ec-form.ec-form-collection .egg-type-meta {
    line-height: 1.3;
}
.ec-form .ec-farm-pick {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    height: 100%;
    background: #fff;
}
.ec-form .ec-farm-pick .form-check-input {
    margin-top: 0.2rem;
}
.ec-form .ec-farm-pick .form-check-label {
    width: 100%;
    padding-left: 0.35rem;
}
.ec-form .ec-farm-card .card-header {
    background: #F4F8FD;
    border-bottom: 1px solid var(--border);
    padding: 0.65rem 1rem;
}
.ec-form .ec-farm-card .ec-farm-toggle {
    flex-shrink: 0;
    padding: 0.2rem 0.45rem;
    line-height: 1;
    font-size: 0.75rem;
    min-width: 1.65rem;
}
.ec-form .ec-farm-card .ec-farm-toggle i {
    font-size: 0.7rem;
}
.ec-form .ec-farm-card .card-body {
    padding: 1rem 1rem 0.25rem;
}
.ec-form .ec-farm-card .egg-type-breakdown {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}
.ec-form .ec-farm-card.is-details-open .egg-type-breakdown {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}
.ec-form .ec-farm-card .ec-farm-details {
    padding-bottom: 0.25rem;
}
.ec-form .ec-input-highlight .form-control {
    border-color: var(--navy-medium);
    background-color: #fffef8;
    font-weight: 600;
}

.ec-form .ec-trip-schedule {
    padding-top: 0.25rem;
}
.ec-form .egg-type-breakdown .egg-type-row .btn {
    min-width: 2.25rem;
    height: calc(1.5em + 0.75rem + 2px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.ec-form .egg-type-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: end;
}
.ec-form .egg-collection-totals .ec-field .form-control {
    min-height: calc(1.5em + 0.75rem + 2px);
}
.ec-form .egg-type-row .ec-field {
    margin-bottom: 0;
}
.ec-form .egg-type-row .ec-field .form-label {
    min-height: 1.25rem;
    margin-bottom: 0.35rem;
    white-space: nowrap;
}
.ec-form .egg-type-row .ec-field .form-control,
.ec-form .egg-type-row .ec-field .form-select {
    width: 100%;
    min-height: calc(1.5em + 0.75rem + 2px);
}
.ec-form .egg-type-row .egg-type-actions {
    display: flex;
    align-items: flex-end;
    padding-bottom: 0;
}
@media (max-width: 767.98px) {
    .ec-form .egg-type-row {
        grid-template-columns: 1fr 1fr;
    }
    .ec-form .egg-type-row .egg-type-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
}

/* -- Toastr ---------------------------------------------------------------- */
#toast-container > .toast { border-radius: var(--radius-sm); box-shadow: 0 4px 20px rgba(0,0,0,0.15); font-family: inherit; }
#toast-container > .toast-success { background-color: #065F46; }
#toast-container > .toast-error   { background-color: #991B1B; }
#toast-container > .toast-warning { background-color: #92400E; color: #fff; }
#toast-container > .toast-info    { background-color: var(--navy); }

/* -- Login Page ------------------------------------------------------------ */
.login-page { background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 50%, var(--navy-medium) 100%); }
.login-box { width: 420px; }
.login-box .card { border-radius: var(--radius-lg); box-shadow: 0 20px 60px rgba(0,0,0,0.25); }
.login-logo a { color: #fff; font-weight: 800; font-size: 1.3rem; }

/* -- Dashboard Welcome Card ------------------------------------------------ */
.page-header-card {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-medium) 100%);
    border-radius: var(--radius);
    padding: 22px 26px;
    color: #fff;
    box-shadow: 0 4px 20px rgba(30,58,95,0.22);
    position: relative;
    overflow: hidden;
}
.page-header-card::before {
    content: '';
    position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px;
    background: rgba(255,255,255,0.04);
    border-radius: 50%;
}
.page-header-card h4 { font-size: 1.15rem; font-weight: 700; color:#fff; margin: 0 0 4px; }
.page-header-card small { color: rgba(255,255,255,0.62); font-size: 0.81rem; }

/* -- Stock Row (inventory cards) ------------------------------------------ */
.stock-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 15px;
    background: #FAFBFC;
    border-radius: 8px;
    border-left: 4px solid var(--navy);
    margin-bottom: 10px;
}

/* -- Utility helpers ------------------------------------------------------- */
.text-navy { color: var(--navy) !important; }
.text-gold  { color: var(--gold) !important; }
.bg-navy    { background: var(--navy) !important; color:#fff !important; }
.bg-gold    { background: var(--gold) !important; }
.fw-700     { font-weight: 700 !important; }
.fs-sm      { font-size: 0.82rem !important; }
.fs-xs      { font-size: 0.75rem !important; }

/* Sidebar collapse fix */
.sidebar-mini.sidebar-collapse .main-sidebar:not(:hover) .brand-text { display: none; }
.sidebar-mini.sidebar-collapse .main-sidebar:not(:hover) .brand-logo-box { margin-right: 0; }
.sidebar-mini.sidebar-collapse .main-sidebar:not(:hover) .sidebar-user-name,
.sidebar-mini.sidebar-collapse .main-sidebar:not(:hover) .sidebar-user-role { display: none; }

/* Spacing helpers */
.g-3 { --bs-gutter-x: 1rem; --bs-gutter-y: 1rem; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 0.75rem !important; }
.mb-4 { margin-bottom: 1.25rem !important; }

/* Print */
@media print {
    .main-sidebar, .main-header, .content-header .breadcrumb,
    .card-footer .btn, #page-loader { display: none !important; }
    .card { box-shadow: none; }
}
