/* HatchCo ERP Theme - High Productivity & Premium UI */

/* --- Palette Definitions --- */
:root {
    /* Primary (Green) */
    --h-primary: #76bc21;
    --h-primary-grad-1: #9FD064;
    --h-primary-grad-2: #C8E4A6;
    --h-primary-grad-3: #F1F8E8;

    /* Black */
    --h-black: #1d1e1d;
    --h-black-grad-1: #3F403F;
    --h-black-grad-2: #616261;
    --h-black-grad-3: #838383;

    /* Gray */
    --h-gray: #6F7271;
    --h-gray-grad-1: #9A9D9C;
    --h-gray-grad-2: #c5c7c6;
    --h-gray-grad-3: #F7F8FA;

    /* Danger (Red - Soft) */
    --h-danger: #ea5455;
    --h-danger-grad-1: #f07f80;
    --h-danger-grad-2: #f6a9aa;
    --h-danger-grad-3: #fdeded;

    /* Warning (Yellow - Soft) */
    --h-warning: #ffb020;
    --h-warning-grad-1: #ffc457;
    --h-warning-grad-2: #ffd78d;
    --h-warning-grad-3: #fffaeb;

    /* --- Framework Overrides --- */
    --bs-primary: var(--h-primary);
    --bs-primary-rgb: 118, 188, 33;
    --bs-success: var(--h-primary);
    --bs-success-rgb: 118, 188, 33;
    --bs-secondary: var(--h-gray);
    --bs-light: var(--h-gray-grad-3);
    --bs-dark: var(--h-black);
    --bs-warning: var(--h-warning);
    --bs-danger: var(--h-danger);
    --bs-form-invalid-color: var(--h-danger);
    --bs-form-invalid-border-color: var(--h-danger);
    
    --bs-body-font-family: 'Roboto', sans-serif;
    --bs-body-color: var(--h-gray);
    --bs-heading-color: var(--h-black);
    --bs-link-color: var(--h-primary);
    --bs-link-hover-color: var(--h-primary-grad-1);
}

/* --- Global Typography --- */
body {
    font-family: 'Roboto', sans-serif !important;
    font-size: 13px !important; /* Standardize base size */
    color: var(--h-gray) !important;
    /* background-color: #f7f9fc; */
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    color: var(--h-black) !important;
    font-weight: 500;
    font-family: 'Roboto', sans-serif !important;
}

/* --- Components Overrides --- */

/* Buttons */
.btn {
    font-size: 13px !important;
    font-weight: 500 !important;
    height: 32px !important; /* Unified Height Standard 2025 */
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center;
    border-radius: 6px !important;
}
.btn-primary {
    background-color: var(--h-primary);
    border-color: var(--h-primary);
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background-color: var(--h-primary-grad-1) !important;
    border-color: var(--h-primary-grad-1) !important;
}

/* Override Success to match Brand Green */
.btn-success {
    background-color: var(--h-primary);
    border-color: var(--h-primary);
    color: #fff;
}
.btn-success:hover, .btn-success:focus, .btn-success:active {
    background-color: var(--h-primary-grad-1) !important;
    border-color: var(--h-primary-grad-1) !important;
    color: #fff;
}

.btn-outline-success {
    color: var(--h-primary);
    border-color: var(--h-primary);
}
.btn-outline-success:hover, .btn-outline-success:focus, .btn-outline-success:active {
    background-color: var(--h-primary) !important;
    border-color: var(--h-primary) !important;
    color: #fff;
}

.btn-check:checked + .btn-outline-success, 
.btn-check:active + .btn-outline-success, 
.btn-outline-success.active, 
.btn-outline-success.dropdown-toggle.show, 
.btn-outline-success:active {
    background-color: var(--h-primary) !important;
    border-color: var(--h-primary) !important;
    color: #fff;
}

/* Secondary (Gray) */
.btn-secondary {
    background-color: var(--h-gray);
    border-color: var(--h-gray);
    color: #fff;
}
.btn-secondary:hover, .btn-secondary:focus, .btn-secondary:active, .btn-secondary.active {
    background-color: var(--h-gray-grad-1) !important;
    border-color: var(--h-gray-grad-1) !important;
    color: #fff;
}

/* Dark (Black) */
.btn-dark {
    background-color: var(--h-black);
    border-color: var(--h-black);
}
.btn-dark:hover, .btn-dark:focus, .btn-dark:active, .btn-dark.active {
    background-color: var(--h-black-grad-1) !important;
    border-color: var(--h-black-grad-1) !important;
}

/* Danger (Red) */
.btn-danger {
    background-color: var(--h-danger);
    border-color: var(--h-danger);
}
.btn-danger:hover, .btn-danger:focus, .btn-danger:active, .btn-danger.active {
    background-color: var(--h-danger-grad-1) !important;
    border-color: var(--h-danger-grad-1) !important;
}

/* Warning (Yellow) */
.btn-warning {
    background-color: var(--h-warning);
    border-color: var(--h-warning);
    color: #fff;
}
.btn-warning:hover, .btn-warning:focus, .btn-warning:active, .btn-warning.active {
    background-color: var(--h-warning-grad-1) !important;
    border-color: var(--h-warning-grad-1) !important;
    color: #fff;
}

/* --- TYPOGRAPHY & PAGE HEADER --- */
.h-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 0 !important; /* No padding */
    border-bottom: none !important; /* No border */
}
/* Ensure no child elements have borders */
.h-page-header > div,
.h-page-header > * {
    border-bottom: none !important;
}
.h-page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--h-black);
    margin: 0;
    line-height: 1.2;
}
.h-page-subtitle {
    font-size: 13px;
    color: var(--h-gray);
    margin-top: 4px;
}

/* Custom Breadcrumb */
.h-breadcrumb {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: var(--h-gray-grad-1);
    list-style: none;
    margin: 0;
    padding: 0;
}
.h-breadcrumb-item + .h-breadcrumb-item::before {
    content: "/";
    padding: 0 8px;
    color: var(--h-gray-grad-2);
}
.h-breadcrumb-item a {
    color: var(--h-gray);
    text-decoration: none;
    transition: color 0.2s;
}
.h-breadcrumb-item a:hover {
    color: var(--h-primary);
}
.h-breadcrumb-item.active {
    color: var(--h-gray-grad-1); /* Inactive end state */
    pointer-events: none;
}

/* Headings Utilities */
.text-h1 { font-size: 24px; font-weight: 700; color: var(--h-black) !important; }
.text-h2 { font-size: 20px; font-weight: 600; color: var(--h-black) !important; }
.text-h3 { font-size: 16px; font-weight: 600; color: var(--h-black) !important; }
.text-body { font-size: 13px; color: var(--h-gray); }
.text-small { font-size: 11px; color: var(--h-gray-grad-1); }

/* Card Section Titles (Uppercase Gray - Primary Section) */
.card-title-uppercase {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--h-gray); /* Darker gray for more presence */
    padding-bottom: 12px; /* Internal air before the line */
    margin-bottom: 24px; /* External space after the line */
    border-bottom: 1px solid var(--h-gray-grad-3);
    display: flex;
    align-items: center;
    width: 100%;
}
.card-title-uppercase i, .card-title-uppercase svg, .card-title-uppercase .feather {
    margin: 0 8px 0 0 !important; /* Reducido para mayor densidad visual */
    width: 18px;
    height: 18px;
}

/* Green Page Section Subtitle */
.section-subtitle-green {
    display: flex;
    align-items: center;
    color: var(--h-primary);
    font-size: 13px;
    font-weight: 600;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--h-gray-grad-3);
    margin-bottom: 4px;
    margin-top: 12px;
}
.section-subtitle-green i, .section-subtitle-green svg {
    margin-right: 8px;
    width: 18px; height: 18px;
}

/* Standardize Button Icons */
.btn .feather, .btn i, .btn svg {
    width: 16px;
    height: 16px;
    vertical-align: text-bottom;
}

/* --- CARDS (Standardized) --- */
.card {
    border: 1px solid rgba(0,0,0,0.06) !important; /* Extremely subtle border */
    border-radius: 10px !important; /* Modern rounding */
    box-shadow: 0 4px 24px 0 rgba(34, 41, 47, 0.05) !important; /* Loki Soft Shadow */
    background-color: #fff;
    margin-bottom: 24px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
/* Hover effect removed for cleaner UI, can be restored if interactive cards are needed */

.card-body {
    padding: 24px !important; /* Spacious padding */
}

/* Card Header (Optional, for when standard bootstrap header is used) */
.card-header {
    background-color: #fff !important;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-header .card-title {
    margin-bottom: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--h-black);
}

/* Utility to remove card shadow/border if needed */
.card-flat {
    box-shadow: none !important;
    border: 1px solid rgba(0,0,0,0.08) !important;
}

/* Standardize Icons inside Buttons - Pure Gap Strategy */
.btn .feather, .btn i, .btn svg {
    margin: 0 !important; /* Force margin reset */
}
.btn .feather + span, .btn i + span, .btn svg + span,
.btn .feather + .text, .btn i + .text { 
    margin-left: 0 !important; /* Disable legacy margins */
}

/* Only-icon buttons */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    width: 32px;
    height: 32px;
}
.btn-icon.btn-sm {
    width: 28px;
    height: 28px;
}

/* Forms */
.form-label {
    color: var(--h-black);
    font-weight: 500;
    font-size: 13px;
}
.form-control {
    border-color: var(--h-gray-grad-2) !important;
    color: var(--h-black-grad-1) !important;
    font-size: 13px;
    box-shadow: none;
    background-image: none !important; /* No chevron for standard inputs */
}
.h-paging-limit-select {
    width: 90px !important;
}
.form-select {
    border-color: var(--h-gray-grad-2) !important;
    color: var(--h-black-grad-1) !important;
    font-size: 13px;
    box-shadow: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%236c757d' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.75rem center !important;
    background-size: 16px 12px !important;
}

/* Sizes Standard */
.form-control-sm, .form-select-sm {
    height: 32px;
    font-size: 13px; /* Standardize to 13px as per latest requirement */
}

/* Placeholder Standard */
.form-control::placeholder {
    color: var(--h-gray-grad-2) !important;
    opacity: 1;
}

.form-control:focus, .form-select:focus {
    border-color: var(--h-primary) !important;
    color: var(--h-black);
    box-shadow: 0 0 0 0.2rem rgba(118, 188, 33, 0.25) !important;
}

/* Standard Input Group Text (Icon wrapper) */
.input-group-text {
    border-color: var(--h-gray-grad-2) !important;
    color: var(--h-gray-grad-1);
    background-color: var(--h-gray-grad-3) !important; /* Encased Look */
}

/* Standard Seamless Input Group (Integrated Icon) */
.input-group-seamless {
    display: flex !important;
    border: 1px solid var(--h-gray-grad-2);
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    height: 38px;
    align-items: center;
    width: 100%;
}

.input-group-seamless .input-group-text {
    background: transparent !important;
    border: none !important;
    padding: 0 8px 0 12px !important;
    color: var(--h-gray-grad-1);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.input-group-seamless .form-control {
    border: none !important;
    padding-left: 0 !important; /* Icon already has padding */
    box-shadow: none !important;
    height: 100% !important;
    background: transparent !important;
    flex-grow: 1;
}

.input-group-seamless:focus-within {
    border-color: var(--h-primary);
    box-shadow: 0 0 0 0.2rem rgba(118, 188, 33, 0.25);
}

/* Force Invalid Feedback display for Input Groups */
.was-validated .input-group:has(.form-control:invalid) + .invalid-feedback,
.input-group.is-invalid + .invalid-feedback {
    display: block !important;
}

/* Sidebar Overrides to remove NobleUI defaults */
.sidebar .sidebar-header .sidebar-brand {
    color: var(--h-primary) !important;
}
.sidebar .nav-link {
    font-family: 'Roboto', sans-serif;
}
.sidebar .nav-link.active {
    color: var(--h-primary) !important;
}
.sidebar .nav-link :hover {
    color: var(--h-primary) !important;
}

/* --- Utilities --- */
.text-primary { color: var(--h-primary) !important; }
.bg-primary { background-color: var(--h-primary) !important; }
.text-success { color: var(--h-primary) !important; } /* Unify success to visual brand green */
.text-muted { color: var(--h-gray-grad-1) !important; }
.icon-sm { width: 15px; height: 15px; }
.icon-input { width: 15px; height: 15px; }
.icon-xs { width: 12px; height: 12px; }

/* Global rule for icons inside input groups as per Design System */
.input-group-text i, 
.input-group-text svg,
.input-group-text .feather {
    width: 15px;
    height: 15px;
}

/* --- Custom Components (Centralized) --- */

/* Avatars */
.avatar-initials {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    color: #fff;
    margin-right: 10px;
}

/* Tabs: nav-tabs-custom (Legacy support) */
.nav-tabs-custom {
    border-bottom: 2px solid #e0e0e0 !important;
    margin-bottom: 1.5rem;
    position: relative;
    display: flex;
}
.nav-tabs-custom .nav-link {
    border: none !important;
    color: var(--h-gray);
    padding: 0.75rem 1.25rem;
    font-weight: 500;
    transition: all 0.2s;
    background-color: transparent !important;
    margin-bottom: -2px;
    z-index: 5;
}
.nav-tabs-custom .nav-link:hover {
    color: var(--h-primary);
    background-color: var(--h-primary-grad-3) !important; 
}
.nav-tabs-custom .nav-link.active {
    color: var(--h-primary) !important;
    border-bottom: 2px solid var(--h-primary) !important;
    background-color: transparent !important;
    font-weight: 700 !important; 
}

/* --- Premium Tabs (Card Style) --- */
.h-nav-tabs-premium {
    border-bottom: 1px solid #e2e8f0 !important;
    display: flex !important;
    flex-direction: row !important;
    gap: 0px; /* Overlap exactly */
    padding: 0 1.5rem !important;
    background: transparent;
    margin-bottom: 0 !important;
    list-style: none;
}

.h-nav-tabs-premium .nav-item {
    margin-bottom: -1px !important;
}

.h-nav-tabs-premium .nav-link {
    border: 1px solid #e2e8f0 !important;
    border-bottom: 1px solid #e2e8f0 !important;
    border-top-left-radius: 8px !important;
    border-top-right-radius: 8px !important;
    background-color: #f1f5f9 !important; /* Slightly more gray for contrast */
    color: #64748b !important;
    padding: 10px 20px !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    height: 42px;
    margin-right: 2px;
}

.h-nav-tabs-premium .nav-link.active {
    background-color: #fff !important;
    color: var(--h-primary) !important;
    border-color: #e2e8f0 !important;
    border-bottom: 2px solid #fff !important;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.04);
    z-index: 10;
}

.h-nav-tabs-premium .nav-link .badge {
    font-size: 9px !important;
    padding: 1px 5px !important;
    border-radius: 10px !important;
    font-weight: 700 !important;
    background-color: var(--h-primary) !important;
    color: #fff !important;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.h-nav-tabs-premium .nav-link:not(.active) .badge {
    background-color: #94a3b8 !important; /* Gray badge if inactive */
}

/* --- Selectable List Items --- */
.h-list-selectable-item {
    cursor: pointer;
    transition: all 0.2s;
    border-left: 4px solid transparent;
    padding: 22px 28px !important; /* More breathing room */
    border-bottom: 1px solid #edf2f7 !important;
    display: block;
    min-width: 0;
    width: 100%;
    overflow-x: hidden !important;
    text-decoration: none !important;
}

.h-list-selectable-item:hover {
    background-color: #f8fafc;
}

.h-list-selectable-item.active {
    background-color: var(--h-primary-grad-3) !important;
    border-left-color: var(--h-primary);
}

.h-list-no-horizontal {
    overflow-x: hidden !important;
    width: 100%;
}

.h-nav-tabs-premium .nav-link i, 
.h-nav-tabs-premium .nav-link svg {
    width: 16px !important;
    height: 16px !important;
    color: var(--h-gray-grad-1);
}

.h-nav-tabs-premium .nav-link.active {
    background-color: #fff !important;
    color: var(--h-primary) !important;
    border-color: var(--h-gray-grad-2) !important;
    border-bottom: 2px solid #fff !important;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.02);
}

.h-nav-tabs-premium .nav-link.active i, 
.h-nav-tabs-premium .nav-link.active svg {
    color: var(--h-primary);
}

.h-nav-tabs-premium .nav-link:not(.active):hover {
    background-color: #f1f3f5 !important;
    color: var(--h-black) !important;
}

/* --- Selectable List Items --- */
.h-list-selectable-item {
    cursor: pointer;
    transition: all 0.2s;
    border-left: 4px solid transparent;
    padding: 1rem;
    border-bottom: 1px solid var(--h-gray-grad-3);
}

.h-list-selectable-item:hover {
    background-color: var(--h-primary-grad-3);
}

.h-list-selectable-item.active {
    background-color: var(--h-primary-grad-3) !important;
    border-left-color: var(--h-primary);
}

/* Table Custom Premium */
.table-custom {
    width: 100%;
    margin-bottom: 0; /* Remove bottom margin for clean card fit */
    color: var(--h-gray);
    vertical-align: middle;
    border-color: #dee2e6;
}
/* Increased specificity to override theme defaults & DataTables */
body .card-custom .table-custom thead th,
body .card-custom table.dataTable thead th,
body .card-custom .table thead th {
    /* Estructural */
    position: sticky; 
    top: 0; 
    /* Force Background with EXTREME Specificity overrides */
    background-color: var(--h-gray-grad-3) !important;
    background-image: none !important;
    --bs-table-bg: var(--h-gray-grad-3) !important;
    --bs-table-accent-bg: var(--h-gray-grad-3) !important;
    z-index: 10;
    height: 40px; /* Altura Fija Obligatoria */
    vertical-align: middle;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
    box-shadow: 0 1px 0 #dee2e6; /* Separator for sticky */

    /* Tipografía */
    font-weight: 500; /* Updated Standard */
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #1d1e1d; /* Negro Suave */
}
.table-custom tbody td {
    padding: 10px 15px;
    vertical-align: middle;
    border-bottom: 1px solid #dee2e6;
}

/* Hover Verde Premium */
.table-custom tbody tr:hover {
    background-color: rgba(118, 188, 33, 0.05) !important;
}

/* Typography Standards for Tables */
.h-td-main {
    font-size: 13px !important;
    color: var(--h-black) !important;
    font-weight: 500;
    line-height: 1.2;
}

.h-td-sub {
    font-size: 11px !important;
    color: var(--h-gray-grad-2) !important;
    font-weight: 400;
    margin-top: 2px;
}

/* Clickable Row */
.clickable-row {
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
}

/* Card Custom */
.card-custom {
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.03);
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    background-color: #fff;
}

/* Badges Premium HashCo (Unified) */
.badge-pill-custom, .h-badge {
    border-radius: 6px !important;
    font-size: 11px !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    height: 24px !important;
    padding: 0 12px;
    font-weight: 700;
    line-height: 1; 
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.badge-pill-custom i, .h-badge i,
.badge-pill-custom svg, .h-badge svg,
.badge-pill-custom .feather, .h-badge .feather {
    width: 12px !important;
    height: 12px !important;
    stroke-width: 2.5px;
}

.badge-hatchco-success, .h-badge-success, .h-badge-approved { background-color: rgba(118, 188, 33, 0.1); color: var(--h-primary); border: 1px solid rgba(118, 188, 33, 0.2); }
.badge-hatchco-secondary, .h-badge-secondary { background-color: rgba(111, 114, 113, 0.1); color: var(--h-gray); border: 1px solid rgba(111, 114, 113, 0.2); }
.badge-hatchco-dark, .h-badge-dark { background-color: rgba(29, 30, 29, 0.1); color: var(--h-black); border: 1px solid rgba(29, 30, 29, 0.2); }
.badge-hatchco-light, .h-badge-light { background-color: #f0f1f1; color: var(--h-gray); border: 1px solid #dee2e6; }
.badge-hatchco-warning, .h-badge-warning { background-color: rgba(255, 176, 32, 0.1); color: var(--h-warning); border: 1px solid rgba(255, 176, 32, 0.2); }
.badge-hatchco-danger, .h-badge-danger { background-color: rgba(234, 84, 85, 0.1); color: var(--h-danger); border: 1px solid rgba(234, 84, 85, 0.2); }

/* Outline Badges (.h-badge-o-*) */
.h-badge-o-primary, .h-badge-vobo { background-color: transparent !important; color: var(--h-primary); border: 1px solid var(--h-primary); }
.h-badge-o-secondary { background-color: transparent !important; color: var(--h-gray); border: 1px solid var(--h-gray); }
.h-badge-o-warning { background-color: transparent !important; color: var(--h-warning); border: 1px solid var(--h-warning); }
.h-badge-o-danger { background-color: transparent !important; color: var(--h-danger); border: 1px solid var(--h-danger); }
.h-badge-o-dark { background-color: transparent !important; color: var(--h-black); border: 1px solid var(--h-black); }

/* Thumbnail Squircle */
.list-thumbnail-container {
    width: 40px; height: 40px;
    border-radius: 10px;
    overflow: hidden;
    background-color: #f8f9fa;
    border: 1px solid #edf2f9;
}
.list-thumbnail-img { width: 100%; height: 100%; object-fit: cover; }

/* Contact Icons */
.contact-icon {
    color: var(--h-gray);
    transition: color 0.2s;
    margin-right: 8px;
    display: inline-flex;
    align-items: center;
}
.contact-icon:hover {
    color: var(--h-primary);
}



/* Alerts Override */
.alert-success {
    background-color: var(--h-primary-grad-3);
    border-color: var(--h-primary-grad-2);
    color: #4e8509; /* Darker shade of brand green for text readability */
}

/* Standardize Alert Icons */
.alert .feather, 
.alert i, 
.alert svg {
    width: 20px !important;
    height: 20px !important;
    margin-right: 12px;
    flex-shrink: 0;
    stroke-width: 2px;
    vertical-align: text-bottom;
}

/* Alert Success Color Spec */
.alert-success .feather, 
.alert-success i, 
.alert-success svg {
    color: var(--h-primary);
}

/* Custom Form Feedback Color - Robust Selectors */
.invalid-feedback {
    color: #ea5455 !important;
    font-weight: 500;
}
.was-validated .form-control:invalid ~ .invalid-feedback,
.was-validated .form-select:invalid ~ .invalid-feedback {
    color: #ea5455 !important;
}
.input-group.is-invalid .invalid-feedback {
    color: #ea5455 !important;
}

/* --- Custom Validation Icons (Smaller & Thinner) --- */
/* Override Bootstrap defaults to prevent overlap with numeric controls */
.form-control.is-valid, .was-validated .form-control:valid,
.form-select.is-valid, .was-validated .form-select:valid {
    /* Feather 'check' icon, thinner (stroke 1.5), green (#76bc21) */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2376bc21' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='20 6 9 17 4 12'%3e%3c/polyline%3e%3c/svg%3e") !important;
    background-size: 14px 14px !important; /* Smaller than default (approx 20px) */
    background-position: right 0.75rem center !important;
}

.form-control.is-invalid, .was-validated .form-control:invalid,
.form-select.is-invalid, .was-validated .form-select:invalid {
    /* Feather 'alert-circle' icon, thinner (stroke 1.5), red (#ea5455) */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23ea5455' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3e%3ccircle cx='12' cy='12' r='10'%3e%3c/circle%3e%3cline x1='12' y1='8' x2='12' y2='12'%3e%3c/line%3e%3cline x1='12' y1='16' x2='12.01' y2='16'%3e%3c/line%3e%3c/svg%3e") !important;
    background-size: 14px 14px !important;
    background-position: right 0.75rem center !important;
}

/* =========================================
   HATCHCO DESIGN SYSTEM (Namespaced .h-*)
   ========================================= */

/* --- BOTONES (.h-btn-*) --- */
.h-btn {
    /* Base styles inheriting from Bootstrap btn but enforced */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 12px;
    line-height: 1; /* Better for vertical alignment with flex */
    height: 30px !important;
    padding: 0 10px !important;
    border-radius: 6px;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
    border: 1px solid transparent;
    cursor: pointer;
    gap: 4px; /* Tighter gap for compact button design */
    text-decoration: none;
}
.h-btn i, .h-btn svg, .h-btn .feather {
    width: 14px; /* Slightly smaller for better proportion */
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: -1px; /* Optical vertical centering adjustment */
}

/* Semantic Action Buttons (Helper classes) */
.h-btn-add, .h-btn-save {
    background-color: var(--h-primary);
    border-color: var(--h-primary);
    color: #fff;
}
.h-btn-add:hover, .h-btn-save:hover {
    background-color: var(--h-primary-grad-1);
    border-color: var(--h-primary-grad-1);
}

.h-btn-delete {
    background-color: var(--h-danger);
    border-color: var(--h-danger);
    color: #fff;
}
.h-btn-delete:hover {
    background-color: var(--h-danger-grad-1);
    border-color: var(--h-danger-grad-1);
}

/* Primary (Green) */
.h-btn-primary {
    background-color: var(--h-primary);
    border-color: var(--h-primary);
    color: #fff;
}
.h-btn-primary:hover, .h-btn-primary:focus {
    background-color: var(--h-primary-grad-1);
    border-color: var(--h-primary-grad-1);
    color: #fff;
}

/* Secondary (Gray) */
.h-btn-secondary {
    background-color: var(--h-gray);
    border-color: var(--h-gray);
    color: #fff;
}
.h-btn-secondary:hover, .h-btn-secondary:focus {
    background-color: var(--h-gray-grad-1);
    border-color: var(--h-gray-grad-1);
    color: #fff;
}

/* Dark (Black) */
.h-btn-dark {
    background-color: var(--h-black);
    border-color: var(--h-black);
    color: #fff;
}
.h-btn-dark:hover, .h-btn-dark:focus {
    background-color: var(--h-black-grad-1);
    border-color: var(--h-black-grad-1);
    color: #fff;
}

/* Danger (Red) */
.h-btn-danger {
    background-color: var(--h-danger);
    border-color: var(--h-danger);
    color: #fff;
}
.h-btn-danger:hover, .h-btn-danger:focus {
    background-color: var(--h-danger-grad-1);
    border-color: var(--h-danger-grad-1);
    color: #fff;
}

/* Warning (Yellow) */
.h-btn-warning {
    background-color: var(--h-warning);
    border-color: var(--h-warning);
    color: #fff;
}
.h-btn-warning:hover, .h-btn-warning:focus {
    background-color: var(--h-warning-grad-1);
    border-color: var(--h-warning-grad-1);
    color: #fff;
}

/* VoBo (Custom Green Outline/Light) */
.h-btn-vobo {
    background-color: rgba(118, 188, 33, 0.15);
    color: #3F403F;
    border: 1px solid var(--h-primary);
}
.h-btn-vobo:hover {
    background-color: var(--h-primary);
    color: #fff;
}

/* Outline Primary (Green) */
.h-btn-o-primary {
    background-color: transparent;
    border-color: var(--h-primary);
    color: var(--h-primary);
}
.h-btn-o-primary:hover, .h-btn-o-primary:focus {
    background-color: var(--h-primary);
    color: #fff;
}

/* Outline Secondary (Gray) */
.h-btn-o-secondary {
    background-color: transparent;
    border-color: var(--h-gray-grad-2);
    color: var(--h-gray);
}
.h-btn-o-secondary:hover, .h-btn-o-secondary:focus {
    background-color: var(--h-gray-grad-3);
    color: var(--h-black);
    border-color: var(--h-gray-grad-2);
}

/* Outline Dark (Black) */
.h-btn-o-dark {
    background-color: transparent;
    border-color: var(--h-black);
    color: var(--h-black);
}
.h-btn-o-dark:hover, .h-btn-o-dark:focus {
    background-color: var(--h-black);
    color: #fff;
}

/* Outline Danger (Red) */
.h-btn-o-danger {
    background-color: transparent;
    border-color: var(--h-danger);
    color: var(--h-danger);
}
.h-btn-o-danger:hover, .h-btn-o-danger:focus {
    background-color: var(--h-danger);
    color: #fff;
}

/* Outline Warning (Yellow) */
.h-btn-o-warning {
    background-color: transparent;
    border-color: var(--h-warning);
    color: var(--h-warning);
}
.h-btn-o-warning:hover, .h-btn-o-warning:focus {
    background-color: var(--h-warning);
    color: #fff;
}

/* Button Icon Only (Seamless) */
.h-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: var(--h-gray);
    transition: all 0.2s;
    padding: 0;
    cursor: pointer;
}
.h-btn-icon:hover {
    background-color: var(--h-gray-grad-3);
    color: var(--h-black);
}
.h-btn-icon i, .h-btn-icon svg, .h-btn-icon .feather {
    width: 16px;
    height: 16px;
}

/* Size Variants */
.h-btn-sm {
    height: 28px !important;
    padding: 0 8px !important;
    font-size: 11px !important;
}
.h-btn-lg {
    height: 40px !important;
    padding: 0 20px !important;
    font-size: 14px !important;
}
/* Legacy Outline Gray (Keep for compatibility) */
.h-btn-outline-gray {
    background-color: var(--h-gray);
    border-color: var(--h-gray);
    color: #fff;
}
.h-btn-outline-gray:hover {
    background-color: transparent;
    color: var(--h-gray);
    border-color: var(--h-gray);
}

/* Cancel / White */
.h-btn-cancel {
    background-color: #fff;
    color: var(--h-gray);
    border: 1px solid transparent;
}
.h-btn-cancel:hover {
    color: var(--h-black);
    background-color: #f8f9fa;
}




/* --- TABLE STYLES (.h-table) --- */
.h-table {
    width: 100%;
    margin-bottom: 1rem;
    color: var(--h-gray);
    vertical-align: middle;
    border-color: #dee2e6;
}
.h-table thead th {
    background-color: var(--h-gray-grad-3) !important; /* Neutral Gray Header (Lighter) */
    color: var(--h-black) !important; /* Force Black Text */
    font-weight: 700;
    text-transform: uppercase;
    font-size: 12px; /* Standardize table headers to 12px */
    padding: 12px 16px;
    border-bottom: none;
    white-space: nowrap;
    position: sticky; top: 0; z-index: 10;
    vertical-align: middle; /* Ensure base alignment */
}

/* Flex alignment for sortable headers if needed, or align-middle handling */
.h-table thead th.sortable {
    cursor: pointer;
}
.h-table tbody td {
    padding: 10px 15px;
    vertical-align: middle;
    border-bottom: 1px solid #dee2e6;
}
.h-table tbody tr:hover {
    background-color: rgba(118, 188, 33, 0.05);
}

/* Table Sorting Icons (Reduced size -50%) */
.h-table th .sort-icon {
    width: 9px;
    height: 9px;
    stroke-width: 2.5px;
    color: var(--h-black) !important; /* Icon matches text color by default */
    opacity: 0.3; /* Default faint */
    margin-left: 6px;
    vertical-align: middle;
    transition: all 0.2s;
    margin-bottom: 2px; /* Optical correction for text baseline */
}
.h-table th .sort-icon.active,
.h-table th:hover .sort-icon {
    opacity: 1;
    color: var(--h-primary) !important; /* Green only when active/hover */
}

/* Table Checkbox (Reduced) */
.h-table .form-check-input {
    width: 13px !important;
    height: 13px !important;
    margin-top: 0.2rem;
}

/* Table Style: Clean (No borders, no rounding) */
.table-clean-container {
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}
/* Ensure table itself has no side borders */
.h-table {
    border-collapse: separate; 
    border-spacing: 0;
}
.h-table th:first-child, .h-table td:first-child {
    padding-left: 0.5rem !important; /* Adjust padding if removing borders completely */
}

/* Table Action Buttons: NEW RULE */
/* 1. Active (Default): GREEN */
.h-table .btn-icon,
.table-custom .btn-icon {
    color: var(--h-primary) !important;
    transition: all 0.2s;
}
/* 2. Hover: Darker Green or Background effect */
.h-table .btn-icon:hover,
.table-custom .btn-icon:hover {
    background-color: rgba(118, 188, 33, 0.1);
    color: var(--h-primary-grad-1) !important; 
}
/* 3. Inactive / Disabled / Opacity class: GRAY GRAD 2 */
.h-table .btn-icon.opacity-25,
.h-table .btn-icon.disabled,
.h-table .btn-icon:disabled,
.table-custom .btn-icon.opacity-25,
.table-custom .btn-icon.disabled,
.table-custom .btn-icon:disabled {
    color: var(--h-gray-grad-2) !important;
    opacity: 1 !important; 
}
/* Exception: If opacity-25 is used for transparency, we might want to keep opacity but enforce color */

.h-table .btn-icon.text-danger {
     /* If the user specifically puts text-danger, do we override? 
        The prompt says: "Los iconos de acciones deben de ser de color verde". 
        So yes, override unless specifically asked otherwise. 
        Wait, standard pattern for delete is red. I will leave delete as red if class is present, 
        BUT the previous instruction said "Todos los iconos de acciones tienen que ser de color verde". 
        I will make them Green by default. */
    color: var(--h-primary) !important; 
}
/* Force icon color inheritance & Alignment */
.h-table .btn-icon,
.table-custom .btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px; height: 28px; /* Fixed touch target */
}
.h-table .btn-icon i,
.h-table .btn-icon svg,
.h-table .btn-icon .feather,
.table-custom .btn-icon i,
.table-custom .btn-icon svg,
.table-custom .btn-icon .feather {
    color: inherit;
    margin-top: -2px; /* Compensación óptica para centrado perfecto */
}
/* Feather Icons (SVG Stroke) */
.h-table .btn-icon .feather {
    stroke: currentColor;
    stroke-width: 2px; /* Standard thickness */
    fill: none; /* Crucial: Do not fill stroke icons */
}
/* MDI or Font Icons */
.h-table .btn-icon .mdi, 
.h-table .btn-icon i:not(.feather) {
    line-height: 1;
    font-size: 18px; /* Ensure consistent size */
    fill: currentColor; /* If using SVG MDI, otherwise font handles it */
}

/* Allow red ONLY on hover for delete if needed, but for now stick to Green as requested. */
.h-table .btn-icon.text-danger:hover {
     color: var(--h-danger) !important; /* Optional feedback */
}
/* --- Icon Only Button (.h-btn-icon) --- */
.h-btn-icon {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    color: var(--h-primary) !important; /* Green when Active */
    transition: all 0.2s ease;
    cursor: pointer;
}

.h-btn-icon i, 
.h-btn-icon svg,
.h-btn-icon .feather {
    width: 15px !important;
    height: 15px !important;
}

.h-btn-icon:hover {
    color: var(--h-primary-grad-1) !important;
    background-color: rgba(118, 188, 33, 0.05) !important;
    border-radius: 4px;
}

/* Gray when basic/inactive or disabled */
.h-btn-icon.text-muted,
.h-btn-icon.inactive,
.h-btn-icon:disabled,
.h-btn-icon.disabled {
    color: var(--h-gray-grad-2) !important;
}

.h-btn-icon.text-muted:hover {
    color: var(--h-primary) !important;
}


/* --- Light Button --- */
.h-btn-light {
    background-color: var(--h-gray-grad-3);
    color: var(--h-gray);
    border-color: var(--h-gray-grad-3);
}
.h-btn-light:hover {
    background-color: var(--h-gray-grad-2);
    color: var(--h-black);
    border-color: var(--h-gray-grad-2);
}

/* --- Inverse Buttons (Soft Bg) --- */
.h-btn-inverse-primary {
    background-color: var(--h-primary-grad-3);
    color: var(--h-primary);
    border-color: transparent;
}
.h-btn-inverse-primary:hover {
    background-color: var(--h-primary);
    color: #fff;
}

.h-btn-inverse-secondary {
    background-color: var(--h-gray-grad-3);
    color: var(--h-gray);
    border-color: transparent;
}
.h-btn-inverse-secondary:hover {
    background-color: var(--h-gray);
    color: #fff;
}

.h-btn-inverse-danger {
    background-color: var(--h-danger-grad-3);
    color: var(--h-danger);
    border-color: transparent;
}
.h-btn-inverse-danger:hover {
    background-color: var(--h-danger);
    color: #fff;
}

/* --- Form Controls & Buttons Standard Height --- */
.btn, .h-btn, .form-control, .form-select, .input-group-text {
    height: 32px !important; /* Unified Standard 2025 */
}
.form-control {
    border-radius: 6px;
    border: 1px solid var(--h-gray-grad-2);
    font-size: 13px;
    color: var(--h-dark);
    padding: 6px 12px; /* Adjusted vertically */
}
.form-control:focus {
    border-color: var(--h-primary);
    box-shadow: 0 0 0 0.2rem rgba(118, 188, 33, 0.15);
}

/* Disabled Input Style */
.form-control:disabled, .form-control[readonly] {
    background-color: #f0f1f1 !important;
    opacity: 1;
}

.form-select {
    border-radius: 6px;
    border: 1px solid var(--h-gray-grad-2);
    font-size: 13px;
    color: var(--h-dark);
    padding-top: 4px;
    padding-bottom: 4px;
}
.input-group-text {
    border-radius: 6px;
    border: 1px solid var(--h-gray-grad-2);
    font-size: 13px;
    color: var(--h-dark);
    background-color: var(--h-gray-grad-3);
    padding: 6px 12px;
}
/* --- Dropzone / File Upload (.h-dropzone) --- */
.h-dropzone {
    border: 2px dashed var(--h-gray-grad-2);
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
    background-color: #fff;
    transition: all 0.2s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 120px;
}

.h-dropzone:hover, .h-dropzone.dragover {
    border-color: var(--h-primary);
    background-color: rgba(118, 188, 33, 0.02);
}

.h-dropzone i, .h-dropzone svg {
    width: 32px;
    height: 32px;
    color: var(--h-gray-grad-1);
    margin-bottom: 10px;
}

.h-dropzone .dz-message {
    font-size: 14px;
    color: var(--h-gray-grad-1);
    font-weight: 600;
    margin: 0;
}

.h-dropzone .dz-note {
    font-size: 12px;
    color: var(--h-gray-grad-2);
    margin-top: 4px;
}

/* --- Outline Buttons --- */
.h-btn-outline-primary, .h-btn-o-primary {
    background-color: transparent;
    border: 1px solid var(--h-primary);
    color: var(--h-primary);
}
.h-btn-outline-primary:hover, .h-btn-o-primary:hover {
    background-color: var(--h-primary);
    color: #fff;
}

.h-btn-outline-secondary {
    background-color: transparent;
    border: 1px solid var(--h-gray);
    color: var(--h-gray);
}
.h-btn-outline-secondary:hover {
    background-color: var(--h-gray);
    color: #fff;
}

.h-btn-outline-danger {
    background-color: transparent;
    border: 1px solid var(--h-danger);
    color: var(--h-danger);
}
.h-btn-outline-danger:hover {
    background-color: var(--h-danger);
    color: #fff;
}


/* --- Missing Inverse Buttons --- */
.h-btn-inverse-dark {
    background-color: rgba(29, 30, 29, 0.1); 
    color: var(--h-black);
    border-color: transparent;
}
.h-btn-inverse-dark:hover {
    background-color: var(--h-black);
    color: #fff;
}

.h-btn-inverse-warning {
    background-color: var(--h-warning-grad-3);
    color: #b3760d; /* Darker yellow for text compliance */
    border-color: transparent;
}
.h-btn-inverse-warning:hover {
    background-color: var(--h-warning);
    color: #fff;
}

/* --- Missing Outline Buttons --- */
.h-btn-outline-dark {
    background-color: transparent;
    border: 1px solid var(--h-black);
    color: var(--h-black);
}
.h-btn-outline-dark:hover {
    background-color: var(--h-black);
    color: #fff;
}

/* =========================================
   ESTRUCTURA DE TABLAS MAESTRAS (LISTAS)
   ========================================= */

/* Contenedor principal del listado dentro de card-body */
.card-custom .card-body {
    padding: 1.5rem !important;
}

/* 1. Pestañas de Estatus (Top) */
.h-filter-tabs {
    border-bottom: 2px solid var(--h-gray-grad-3);
    margin-bottom: 1.25rem;
}

/* 2. Barra de Herramientas y Filtros (Middle) */
.h-filter-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0;
}

/* Ajustes de columnas para filtros estandarizados */
.h-filter-toolbar .col-search { 
    flex: 1; 
    min-width: 250px; 
}
.h-filter-toolbar .col-select { 
    width: 180px; 
    flex-shrink: 0;
}
.h-filter-toolbar .col-action { 
    width: auto; 
    flex-shrink: 0;
}

/* 3. Contenedor de Tabla (Bottom) */
#tableContainer {
    margin-top: 0;
    min-height: 200px;
    position: relative;
}

/* Estilo para los filtros */
.h-search-group {
    position: relative;
    width: 100%;
}

.h-search-group .input-group-text {
    background-color: transparent !important;
    border-right: none !important;
    padding-right: 0 !important;
}

.h-search-group .form-control {
    border-left: none !important;
    padding-left: 8px !important;
    padding-right: 35px !important; /* Espacio para el botón de limpiar */
}



/* Botón de Limpiar Filtros Estándar */
.h-btn-reset-filters {
    height: 30px !important;
    padding: 0 12px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: var(--h-gray-grad-2) !important;
    background-color: var(--h-gray-grad-3) !important;
    border: 1px solid var(--h-gray-grad-3) !important;
    border-radius: 6px !important;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none !important;
    cursor: default;
    pointer-events: none;
    opacity: 0.6;
}

/* Estado Activo (Cuando hay filtros) */
.h-btn-reset-filters.active {
    color: var(--h-primary) !important;
    background-color: rgba(118, 188, 33, 0.05) !important;
    border-color: var(--h-primary) !important;
    cursor: pointer;
    pointer-events: auto;
    opacity: 1;
}

.h-btn-reset-filters.active:hover {
    background-color: var(--h-primary) !important;
    color: #fff !important;
}

.h-btn-reset-filters i, 
.h-btn-reset-filters svg {
    width: 14px !important;
    height: 14px !important;
}

.h-btn-outline-warning {
    background-color: transparent;
    border: 1px solid var(--h-warning);
    color: var(--h-warning);
}
/* --- MODAL LOKI (Premium Style) --- */
.modal-content {
    border: none !important;
    border-radius: 14px !important; /* Softer, modern corners */
    box-shadow: 0 15px 40px rgba(0,0,0,0.15) !important; /* Deep "Floating" Shadow */
    overflow: hidden; /* Clip inner content */
    background-color: #fff;
}

/* Standard Header (Gray for Forms) */
.modal-header {
    background-color: var(--h-gray-grad-3) !important; /* Explicit Gray Header */
    border-bottom: 1px solid rgba(0,0,0,0.03) !important; /* Subtle separator */
    padding: 12px 24px !important; /* Reduced vertical padding (Slimmer) */
    display: flex; align-items: center;
}
.modal-title {
    font-weight: 700 !important;
    color: var(--h-black) !important;
    font-size: 16px !important; /* Slightly more compact than 18 */
}
.modal-header .btn-close {
    opacity: 0.5;
}

.modal-body {
    padding: 24px !important; /* Standard spacing */
    color: var(--h-gray);
    font-size: 14px;
    line-height: 1.6;
    background-color: #fff !important;
}

.modal-footer {
    border-top: none !important;
    background-color: #fff !important; /* White footer as requested */
    padding: 0 24px 24px 24px !important;
    justify-content: flex-end;
    gap: 12px;
}

/* --- COMPACT ALERT MODAL (White & Tight) --- */
.modal-confirmation .modal-content {
    box-shadow: 0 10px 30px rgba(0,0,0,0.12) !important;
}
.modal-confirmation .modal-body {
    padding: 30px 24px 10px 24px !important; /* Top heavy, less bottom */
    text-align: center;
}
.modal-confirmation .modal-footer {
    padding: 10px 24px 24px 24px !important;
    justify-content: center; /* Center buttons */
}
.modal-confirmation h5 {
    font-size: 18px;
    color: var(--h-black);
    margin-bottom: 8px;
}
.modal-confirmation p {
    font-size: 13px;
    color: var(--h-gray);
}

/* --- NESTED MODALS (Stacking) --- */
/* Ensure confirmation modals appear above other modals */
.modal-confirmation {
    z-index: 2000 !important;
}
/* Adjust second backdrop if exists */
.modal-backdrop + .modal-backdrop {
    z-index: 1990 !important;
}

/* --- MODAL CLOSE BUTTON --- */
.modal-header .close {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    opacity: 0.5;
}
.modal-header .close:hover {
    opacity: 0.8;
}

/* --- TABLE DEFAULTS --- */
.h-table {
    font-size: 13px; /* Body Text Standard */
}
.h-table .feather, 
.h-table i, 
.h-table svg {
    /* Default icon size in tables (Actions, etc) */
    width: 16px; 
    height: 16px;
    vertical-align: text-bottom;
}
/* Exception: Icons inside badges within tables override this to 12px via badge rules */

/* --- PAGINATION --- */
.pagination {
    --bs-pagination-active-bg: var(--h-primary);
    --bs-pagination-active-border-color: var(--h-primary);
    --bs-pagination-color: var(--h-gray);
    --bs-pagination-hover-color: var(--h-primary);
    --bs-pagination-focus-color: var(--h-primary);
    --bs-pagination-focus-box-shadow: 0 0 0 0.25rem rgba(118, 188, 33, 0.25);
}

.page-link {
    color: var(--h-gray) !important;
    border-color: var(--h-gray-grad-2) !important; /* Matches Form Inputs */
    font-size: 13px;
    padding: 0.5rem 0.75rem; 
}

.page-link:hover {
    color: var(--h-primary) !important;
    background-color: var(--h-primary-grad-3) !important;
    border-color: var(--h-gray-grad-2) !important;
}

.page-item.active .page-link {
    background-color: var(--h-primary) !important;
    border-color: var(--h-primary) !important;
    color: #fff !important;
    font-weight: 600;
}

.page-item.disabled .page-link {
    color: var(--h-gray-grad-1) !important;
    background-color: #f8f9fa !important;
    border-color: var(--h-gray-grad-2) !important;
}

/* =========================================
   TABLA DE CONCEPTOS (Facturas/Presupuestos)
   ========================================= */

/* Estilos de Tabla */
#tablaConceptos th,
#tablaConceptos td {
    padding: 12px 15px !important;
    vertical-align: middle;
}

#tablaConceptos thead th {
    font-weight: 600;
    color: #6c757d;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    font-size: 0.75rem;
    padding-top: 15px !important;
    padding-bottom: 15px !important;
    background-color: #fcfcfc !important;
    border-bottom: 1px solid #f0f0f0 !important;
}

/* Anchos de Columna */
.col-w-drag {
    width: 25px;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.col-w-concepto {
    width: 100%;
    min-width: 250px;
}

.col-w-total {
    width: 14%;
    min-width: 130px;
}

.col-w-acciones {
    width: 40px;
}

/* Styles inputs */
#tablaConceptos input[type=number]::-webkit-inner-spin-button,
#tablaConceptos input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

#tablaConceptos input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Input Concepto Rich (contenteditable) */
.input-concepto-rich {
    min-height: 30px;
    max-height: 400px;
    overflow-y: auto;
    resize: vertical;
    white-space: pre-wrap;
    background-color: #fff;
    border: 1px solid var(--h-gray-grad-2);
    border-radius: 6px;
    padding: 6px 10px !important;
    font-size: 13px; /* Standardized to 13px */
    line-height: 1.4;
    color: #212529;
}

.input-concepto-rich:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, .25);
}

/* Placeholder para contenteditable */
.input-concepto-rich:empty:before {
    content: attr(data-placeholder);
    color: #6c757d;
    opacity: 0.6;
}

.input-concepto-rich:focus:empty:before {
    content: attr(data-placeholder);
    color: #adb5bd;
}

/* =========================================
   FILE DROP ZONE (Carga de Archivos)
   ========================================= */

/* --- Gestión de Archivos Premium (Design System HatchCo) --- */
.file-mgmt-wrapper {
    margin-top: 8px;
}

.h-file-card {
    background: #ffffff;
    border: 1px solid var(--h-gray-grad-3);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.h-file-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border-color: var(--h-primary-grad-2);
}

.h-file-icon-box {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 14px;
    flex-shrink: 0;
}

/* Colores alineados al Design System (Iconos Verdes HatchCo) */
.bg-soft-success, .bg-soft-pdf { background-color: var(--h-primary-grad-3); color: var(--h-primary); }
.bg-soft-xml { background-color: #fef4e8; color: #ffb020; } /* Soft Warning/Orange color for XML */
.bg-soft-upload { background-color: var(--h-primary-grad-3); color: var(--h-primary); }

.h-file-info {
    flex-grow: 1;
    min-width: 0;
    margin-right: 12px;
}

.h-file-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--h-gray-grad-1);
    margin-bottom: 1px;
}

.h-file-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--h-black);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.h-file-actions {
    display: flex;
    gap: 6px;
}

/* Botones de acción minimalistas */
.h-btn-action {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    background: #f2f2f2; /* Restaurado fondo gris suave del Design System */
    color: var(--h-gray);
}

.h-btn-action i,
.h-btn-action svg {
    width: 14px !important;
    height: 14px !important;
}

.h-btn-action-view:hover { 
    color: var(--h-primary); 
    background: var(--h-primary-grad-3); 
}
.h-btn-action-delete:hover { 
    color: var(--h-danger); 
    background: var(--h-danger-grad-3); 
}

/* --- FILE MANAGEMENT & DROPZONES (MODERN) --- */
/* --- FILE MANAGEMENT & BOARD LAYOUT --- */
.h-file-board {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}

.h-board-drop-column {
    flex: 0 0 280px; /* Ancho fijo para la zona de carga en el board */
}

.h-board-list-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Drop Zone Modern (Large & Vertical) */
.h-drop-zone {
    position: relative;
    width: 100%;
    min-height: 120px;
    padding: 1.5rem;
    background: var(--h-primary-grad-3);
    border: 2px dashed var(--h-primary-grad-2);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.h-drop-zone:hover, .h-drop-zone.drag-over {
    background: #fff;
    border-color: var(--h-primary);
    box-shadow: 0 10px 25px rgba(0,0,0,0.06);
    transform: translateY(-2px);
}

.h-drop-icon {
    width: 42px;
    height: 42px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    color: var(--h-primary);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.h-drop-zone:hover .h-drop-icon {
    background: var(--h-primary);
    color: #fff;
    transform: scale(1.1);
}

.h-drop-text-main {
    font-size: 14px;
    font-weight: 700;
    color: var(--h-black);
    margin: 0;
}

.h-drop-text-sub {
    font-size: 11px;
    color: var(--h-gray-grad-2);
    margin: 4px 0 0 0;
}

/* File Card Modernized */
.h-file-card {
    display: flex;
    align-items: center;
    padding: 0.45rem 0.75rem;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 10px;
    gap: 0.85rem;
    transition: all 0.2s ease;
}

.h-file-card:hover {
    border-color: var(--h-primary);
    box-shadow: 0 8px 15px rgba(118, 188, 33, 0.1);
    transform: translateY(-2px);
}

.h-file-icon-box {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.h-file-info {
    flex: 1;
    min-width: 0;
}

.h-file-label {
    font-size: 9px;
    text-transform: uppercase;
    font-weight: 600;
    color: #b0b0b0;
    letter-spacing: 0.5px;
    margin-bottom: 0px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.h-file-name {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--h-black);
}

/* =========================================
   6. SKELETON LOADING
   ========================================= */
@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
    display: inline-block;
    height: 12px;
    width: 100%;
}
.skeleton-circle {
    width: 32px; height: 32px; border-radius: 50%;
}

/* =========================================
   7. MODAL TYPE SELECTOR (Option Cards)
   ========================================= */
.type-option {
    padding: 1.25rem;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    background-color: #fff;
}
.type-option:hover {
    transform: translateY(-2px);
    border-color: transparent;
    box-shadow: 0 10px 20px -5px rgba(0,0,0,0.1);
}
.type-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.type-icon i {
    width: 24px;
    height: 24px;
    stroke-width: 2.5;
}

/* Prospecto Variant */
.type-option.prospecto:hover {
    border: 1px solid #ffca2c;
    background: linear-gradient(to right, #fff, rgba(255, 193, 7, 0.05));
}
.type-icon.prospecto {
    background: #fff3cd;
    color: #856404;
}

/* Cliente Variant */
.type-option.cliente:hover {
    border: 1px solid var(--h-primary);
    background: linear-gradient(to right, #fff, rgba(118, 188, 33, 0.05));
}
.type-icon.cliente {
    background: rgba(118, 188, 33, 0.15);
    color: var(--h-primary);
}

/* =========================================
   8. SPECIFIC FORM OVERRIDES (Select2 & Validation)
   ========================================= */
/* --- SELECT2 HATCHCO PREMIUM STANDARD (Global - Small 32px) --- */
.select2-container--default .select2-selection--single {
    height: 32px !important;
    border: 1px solid var(--h-gray-grad-2) !important;
    border-radius: 6px !important;
    display: flex !important;
    align-items: center !important;
    background-image: none !important; /* Elimina flecha de Bootstrap */
}

.select2-container--default .select2-selection--single .select2-selection__rendered,
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    line-height: 32px !important;
    padding-left: 12px !important;
    padding-right: 30px !important;
    color: #1d1e1d !important;
    font-size: 13px !important;
    font-weight: 500 !important;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #9A9D9C !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow,
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__arrow {
    height: 30px !important;
    top: 1px !important;
    right: 8px !important;
    width: 14px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    display: none !important; /* Esconde flecha original */
}

/* Flecha Premium HatchCo */
.select2-container--default .select2-selection--single .select2-selection__arrow::after {
    content: '' !important;
    display: block !important;
    width: 12px !important;
    height: 12px !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-size: 12px 12px !important;
    background-position: center !important;
    transition: transform 0.2s ease;
}

.select2-container--open .select2-selection__arrow::after {
    transform: rotate(180deg) !important;
}

.select2-container--default.select2-container--open .select2-selection--single {
    border-color: #76bc21 !important;
    box-shadow: 0 0 0 0.2rem rgba(118, 188, 33, 0.25) !important;
}

.select2-dropdown {
    border-color: #c5c7c6 !important;
    border-radius: 0.375rem !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
}

.select2-search--dropdown .select2-search__field {
    border-color: #c5c7c6 !important;
    border-radius: 0.375rem !important;
    padding: 4px 12px !important;
}

.select2-results__option--highlighted[aria-selected] {
    background-color: var(--h-primary) !important;
}

.select2-container--default .select2-selection--single .select2-selection__clear {
    position: absolute !important;
    right: 28px !important;
    top: 0 !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    color: var(--h-gray-grad-1) !important;
    font-weight: bold;
    font-size: 16px;
}

/* Ensure the text inside select2 doesn't have extra padding that pushes the clear button */
.select2-container--default .select2-selection--single .select2-selection__rendered {
    padding-right: 35px !important; /* Space for clear button and arrow */
}

/* Estilos para badges en Select2 results */
.select2-results__option .badge {
    font-size: 0.7em !important;
    padding: 0.25em 0.5em;
    font-weight: 600;
}

.select2-selection__rendered .badge {
    font-size: 0.65em !important;
    padding: 0.2em 0.4em;
    font-weight: 600;
    vertical-align: middle;
}


/* =========================================
   9. HEADER STATUS & PIPELINE
   ========================================= */
/* HEADER BADGES (Folio / Fecha) */
.header-badge {
    background-color: #fff;
    border: 1px solid #dce0e4;
    color: #1d1e1d;
    border-radius: 6px;
    padding: 0 15px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
    height: 30px;
    white-space: nowrap;
}

.header-badge i,
.header-badge svg {
    width: 14px !important;
    height: 14px !important;
    stroke-width: 2px;
    color: #6F7271; /* --h-gray */
    margin-right: 8px;
}

/* PIPELINE VISUALIZER */
.pipeline-container {
    background-color: #F1F8E8;
    border-radius: 6px;
    padding: 3px;
    display: inline-flex;
    width: 100%;
    border: 1px solid #dce0e4;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
    align-items: center;
    height: 30px;
}

.pipeline-item {
    flex: 1;
    text-align: center;
    padding: 0 8px;
    height: 100%;
    font-size: 0.7rem;
    font-weight: 700;
    color: #6F7271; /* --h-gray */
    cursor: default;
    border-radius: 4px;
    transition: all 0.2s ease;
    position: relative;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pipeline-item.active {
    background-color: #76bc21; /* --h-primary */
    color: #ffffff;
    box-shadow: 0 1px 2px rgba(118, 188, 33, 0.25);
}

/* Pipeline Status States */
.pipeline-item.status-aprobado.active { background-color: #76bc21; }
.pipeline-item.status-rechazado.active { background-color: #ef4444; }
.pipeline-item.status-facturado.active { background-color: #0ea5e9; }

.pipeline-item i,
.pipeline-item svg {
    width: 14px !important;
    height: 14px !important;
    stroke-width: 2px;
}

/* Dropdown inside pipeline adjustments */
.pipeline-item.dropdown .dropdown-menu {
    font-size: 0.8rem;
    border-radius: 6px;
    margin-top: 4px !important;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Botón Invertido al Hover (Gris) - Presupuestos */
.btn-hover-outline-gray {
    background-color: #6c757d;
    border-color: #6c757d;
    color: #fff;
    transition: all 0.2s ease-in-out;
}
.btn-hover-outline-gray:hover {
    background-color: transparent !important;
    color: #6c757d !important;
    border-color: #6c757d !important;
}

/* Integrated Tabs for Cards (Premium Dashboard Style) */
.h-card-tabs-integrated {
    display: flex;
    width: 100%;
    gap: 4px;
    border-bottom: 1px solid #ced4da !important; /* Darker gray line */
}
.h-card-tabs-integrated::after {
    content: "";
    flex: 1;
}
.h-card-tabs-integrated .nav-item {
    margin-bottom: -1px; /* Overlap the bottom border */
}
.h-card-tabs-integrated .nav-link {
    border: 1px solid #ced4da !important;
    border-bottom: none !important;
    background-color: #f8f9fa !important;
    color: var(--h-gray) !important;
    border-radius: 6px 6px 0 0 !important;
    padding: 8px 16px !important;
    font-size: 11px !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    transition: all 0.2s;
    height: auto !important;
    display: flex;
    align-items: center;
}
.h-card-tabs-integrated .nav-link:hover {
    color: var(--h-primary) !important;
    background-color: #f8f9fa !important;
    border-color: #ced4da !important;
}
.h-card-tabs-integrated .nav-link.active {
    background-color: #fff !important;
    border-color: #ced4da !important;
    border-bottom: 1px solid #fff !important; /* Merges with the card body */
    color: var(--h-primary) !important;
    z-index: 1;
    font-weight: 700 !important;
}

/* Profile & UI Utilities */
.avatar-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    border-radius: 12px;
}

.extra-small {
    font-size: 10px !important;
}

.badge-hatchco-light {
    background-color: #f0f1f1;
    color: var(--h-gray);
    font-weight: 600;
    font-size: 11px;
}

.badge-hatchco-success { background-color: rgba(118, 188, 33, 0.1); color: var(--h-primary); border: 1px solid rgba(118, 188, 33, 0.2); }
.badge-hatchco-warning { background-color: rgba(255, 176, 32, 0.1); color: var(--h-warning); border: 1px solid rgba(255, 176, 32, 0.2); }
.badge-hatchco-danger { background-color: rgba(234, 84, 85, 0.1); color: var(--h-danger); border: 1px solid rgba(234, 84, 85, 0.2); }

/* Vertical Navigation Inside Cards */
.h-vertical-nav .nav-link {
    border-radius: 12px !important;
    border: 1px solid transparent !important;
    background-color: #f8f9fa !important;
    color: var(--h-gray) !important;
    transition: all 0.2s ease;
    text-align: left;
    padding-top: 12px !important;
    padding-bottom: 12px !important;
}

.h-vertical-nav .nav-link:hover {
    background-color: #f1f2f3 !important;
}

.h-vertical-nav .nav-link.active {
    background-color: #fff !important;
    border-color: #ced4da !important;
    color: var(--h-primary) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05) !important;
    position: relative;
    padding-left: 1.5rem !important;
}

.h-vertical-nav .nav-link.active::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 20%;
    bottom: 20%;
    width: 4px;
    background-color: var(--h-primary);
    border-radius: 4px;
}

.h-vertical-nav .nav-link i {
    width: 20px;
    height: 20px;
    transition: transform 0.2s;
}

.h-vertical-nav .nav-link.active i {
    transform: scale(1.1);
    color: var(--h-primary);
}



/* =========================================
   PORTFOLIO & GALLERIES (Loki UI)
   ========================================= */

/* --- Portfolio Grid Layout --- */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* --- Portfolio Card Design --- */
.portfolio-card {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.portfolio-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.portfolio-card-image {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
}

.portfolio-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.portfolio-card:hover .portfolio-card-image img {
    transform: scale(1.08);
}

.portfolio-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.3) 50%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.25rem;
    color: white;
}

.portfolio-card:hover .portfolio-card-overlay {
    opacity: 1;
}

.portfolio-card-year {
    font-size: 0.75rem;
    opacity: 0.9;
    margin-bottom: 0.25rem;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.portfolio-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5rem;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.portfolio-card-client {
    font-size: 0.875rem;
    font-weight: 500;
    opacity: 0.95;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.portfolio-card-category {
    font-size: 0.7rem;
    opacity: 0.8;
    margin-top: 0.5rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

/* --- Card Actions --- */
.portfolio-card-actions {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.portfolio-card:hover .portfolio-card-actions {
    opacity: 1;
}

.portfolio-card-actions .btn {
    width: 34px;
    height: 34px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}

/* --- Special Badges (Portfolio) --- */
.badge-demo {
    background: linear-gradient(135deg, #76BC21 0%, #5a9518 100%);
    color: white;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* --- Media Preview Area --- */
.file-preview {
    display: block;
    column-count: 3;
    column-gap: 15px;
}

@media (max-width: 768px) { .file-preview { column-count: 2; } }
@media (max-width: 576px) { .file-preview { column-count: 1; } }

.file-item {
    display: inline-block;
    margin-bottom: 20px;
    width: 100%;
}

.file-item img, .file-item video {
    width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: contain;
}

.file-item.pdf-item {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.file-item.pdf-item iframe {
    width: 85%;
    height: 600px;
    border: none;
}

/* --- List View Thumbnails --- */
.list-thumbnail-container {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background-color: #f8f9fa;
    flex-shrink: 0;
}

.list-thumbnail-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- General Skeletons (Unified) --- */
.skeleton-loading-unified {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ==========================================================================
   PUBLIC BUDGET VIEW (public_view.php)
   ========================================================================== */

/* Container & Animations */
.public-container {
    max-width: 950px;
    margin: 40px auto;
    background: #ffffff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    min-height: 100vh;
    padding: 50px 70px;
    animation: hFadeIn 0.8s ease-out;
    position: relative;
}

@keyframes hFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header Section */
.pdf-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 60px;
}

.logo-box img {
    width: 230px;
    height: auto;
}

.title-box {
    text-align: right;
}

.document-label {
    font-size: 32px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0px;
    letter-spacing: -1px;
}

.folio-label {
    font-size: 18px;
    font-weight: 700;
    color: var(--h-primary);
    margin-bottom: 0px;
    margin-top: -2px;
}

/* Info Boxes */
.info-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    margin-bottom: 40px;
    align-items: start;
}

.info-group {
    padding-top: 0;
}

.info-group-title {
    font-size: 12px;
    font-weight: 800;
    color: var(--h-black);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--h-primary);
    padding-bottom: 8px;
}

.info-content {
    font-size: 13px;
    line-height: 1.5;
}

.info-row {
    display: flex;
    margin-bottom: 3px;
}

.info-label {
    color: var(--h-gray-grad-1);
    width: 110px;
    flex-shrink: 0;
}

.info-value {
    font-weight: 700;
    color: var(--h-black);
}

/* Items Table */
.items-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 40px;
    margin-bottom: 10px;
}

.items-table thead th {
    background: var(--h-black);
    color: white;
    text-align: left;
    padding: 10px 15px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.items-table tbody td {
    padding: 15px;
    border-bottom: 1px solid #eee;
    font-size: 13px;
    vertical-align: top;
    color: var(--h-black);
}

.items-table td ul,
.items-table td ol {
    padding-left: 22px;
    margin-top: 10px;
    margin-bottom: 15px;
}

.items-table td li {
    list-style-type: disc !important;
    margin-bottom: 6px;
    display: list-item !important;
}

.item-row:hover {
    background-color: #fafafa;
}

.row-header {
    background-color: var(--h-gray-grad-3) !important;
    border-bottom: 2px solid #eee !important;
}

.row-header td {
    font-weight: 700 !important;
    color: var(--h-black) !important;
    text-transform: uppercase;
    font-size: 13px !important;
    letter-spacing: 0.5px;
    padding: 12px 15px !important;
}

/* Totals Section */
.totals-section {
    display: flex;
    justify-content: flex-end;
    margin-top: -5px;
    padding-right: 0px; /* Aligned with table edge */
}

.totals-table {
    width: 100%; /* Will be contained by its parent flex box */
    max-width: 450px;
    border-collapse: collapse;
}

.totals-table td {
    padding: 8px 10px;
    font-size: 13px;
    vertical-align: middle;
}

/* Col 1: Spacer to push everything right */
.totals-table td:first-child {
    width: auto;
}

/* Col 2 & 3: Content columns */
.totals-table td:nth-child(2),
.totals-table td:nth-child(3) {
    width: 1px;
    white-space: nowrap;
}

.total-label {
    color: var(--h-gray);
    text-align: right;
    font-weight: 500;
    padding-left: 30px !important; /* This defines how much the BG extends to the left */
}

.total-value-sub {
    text-align: right;
    font-weight: 700;
    color: var(--h-gray); /* Standardized to gray for intermediate values */
    font-size: 15px;
    font-variant-numeric: tabular-nums;
    padding-right: 15px !important;
}

.row-total-final td:nth-child(2),
.row-total-final td:nth-child(3) {
    background-color: var(--h-gray-grad-3);
    border-top: 2px solid var(--h-primary);
}

.row-total-final td {
    padding-top: 15px !important;
    padding-bottom: 15px !important;
}

.total-highlight-label {
    font-size: 14px;
    font-weight: 800;
    color: var(--h-primary); /* Now in green as per request */
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.total-highlight-value {
    font-size: 24px;
    font-weight: 900;
    color: var(--h-primary);
    line-height: 1;
    text-align: right;
    font-variant-numeric: tabular-nums;
    padding-right: 15px !important;
}

/* Terms & Conditions */
.terms-content {
    font-size: 11px;
    line-height: 1.4;
    color: #606060;
    background: var(--h-gray-grad-3);
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #f0f0f0;
}

.terms-content ul,
.terms-content ol {
    margin-left: 18px;
    margin-top: 2px;
    margin-bottom: 2px;
}

.terms-content li {
    margin-bottom: 1px;
    display: list-item !important;
    list-style-type: disc !important;
}

.terms-content strong,
.terms-content b {
    color: #333;
    display: inline-block;
    margin-top: 3px;
}

/* Floating Action Bar */
.action-bar {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(29, 30, 29, 0.98);
    padding: 8px 20px;
    border-radius: 8px;
    display: flex;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-public {
    padding: 7px 15px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
    border: none;
    text-transform: uppercase;
    text-decoration: none;
}

.btn-public-primary {
    background: var(--h-primary);
    color: white;
}

.btn-public-primary:hover {
    background: var(--h-primary-grad-1);
    transform: translateY(-2px);
    color: white;
}

.btn-public-danger {
    background: var(--h-danger);
    color: white;
}

.btn-public-danger:hover {
    background: var(--h-danger-grad-1);
    transform: translateY(-2px);
    color: white;
}

.btn-public-outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
}

.btn-public-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Footer Section */
.pdf-footer {
    margin-top: 80px;
    padding-top: 20px;
    border-top: 1px dashed #ccc;
    text-align: center;
    font-size: 11px;
    color: var(--h-gray-grad-1);
}

/* Print Overrides */
@media print {
    .action-bar {
        display: none !important;
    }

    body {
        background: white !important;
        padding: 0 !important;
    }

    .public-container {
        box-shadow: none !important;
        margin: 0 !important;
        width: 100% !important;
        padding: 0 !important;
        animation: none !important;
    }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .public-container {
        padding: 30px 20px;
        margin: 0;
    }

    .info-section {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .pdf-header {
        flex-direction: column;
        gap: 20px;
    }

    .title-box {
        text-align: left;
    }

    .items-table th:nth-child(3),
    .items-table td:nth-child(3) {
        display: none;
    }

    .action-bar {
        width: 95%;
        padding: 10px;
        gap: 8px;
    }

    .btn-public {
        padding: 8px 12px;
        font-size: 11px;
    }
}

.project-box {
    background: var(--h-gray-grad-3);
    padding: 2px 15px 4px 15px;
    border-radius: 4px;
    margin-bottom: 12px;
    border-left: 4px solid var(--h-primary);
}

.project-box-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--h-gray-grad-1);
    text-transform: uppercase;
    margin-bottom: 0px;
}

.project-box-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--h-black);
    line-height: 1.1;
}
