body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #f0f2f5;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* WRAPPER */
.wrapper {
    display: flex;
    flex: 1;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* SIDEBAR */
.sidebar {
    width: 230px;
    background: #1e3c72;
    color: white;
    padding: 20px;
    position: relative; /* changed from sticky to relative */
    z-index: 10;       /* ensure it’s above main pages */
}

.sidebar li {
    padding: 12px 15px;
    margin-bottom: 5px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 13.5px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    border-left: 3px solid transparent;
    display: flex;
    align-items: center;
}

.sidebar li:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateX(5px);
    border-left-color: #cbd5e0;
}

.sidebar li.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-weight: 700;
    border-left-color: #38bdf8;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* MAIN */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

/* TOPBAR */
.topbar {
    background: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    box-shadow: 0 2px 5px gray;
    position: relative;
    z-index: 5; /* above main pages */
}

/* PAGES */
.page {
    display: none;
    padding: 20px;
    position: relative;
    z-index: 1;
    pointer-events: auto; /* allow interaction */
}

.page.active {
    display: block;
    z-index: 2;
}

/* CARDS */
.cards {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.card {
    flex: 1;
    padding: 20px;
    border-radius: 10px;
    color: white;
}

.blue { background: #3498db; }
.green { background: #2ecc71; }
.orange { background: #f39c12; }
.red { background: #e74c3c; }

/* BUTTONS */
button {
    margin-top: 10px;
    padding: 8px;
    border: none;
    cursor: pointer;
    border-radius: 5px;
}

.btn {
    background: #1e3c72;
    color: white;
}

.small {
    padding: 5px 10px;
}

.approve {
    background: orange;
}

/* TABLE */
table {
    width: 100%;
    background: white;
    border-collapse: collapse;
}

th {
    background: #1e3c72;
    color: white;
    text-align: left;
}

th, td {
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

/* BADGES */
.badge {
    padding: 5px 10px;
    border-radius: 5px;
    color: white;
}

.pending { background: orange; }
.approved { background: green; }

/* FOOTER */
.footer {
    background: #2c2c2c;
    color: #ccc;
    padding: 25px 40px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    font-size: 13px;
    position: relative;
    z-index: 1;
}

.footer p {
    margin: 3px 10px;
}

.footer-section {
    width: 220px;
    margin-bottom: 15px;
}

.footer-section h4 {
    color: #fff;
    margin-bottom: 8px;
    font-size: 14px;
}

.footer-section p {
    margin: 4px 0;
}

.footer-bottom {
    width: 100%;
    text-align: center;
    border-top: 1px solid #555;
    margin-top: 15px;
    padding-top: 10px;
    font-size: 12px;
    color: #aaa;
}

/* AUTH PAGES */
.auth-body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
}

.auth-container {
    background: white;
    padding: 30px;
    border-radius: 12px;
    width: 300px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.auth-container h2 {
    margin-bottom: 20px;
}

.auth-container input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border-radius: 5px;
    border: 1px solid #ccc;
}

.auth-container button {
    width: 100%;
    padding: 10px;
    background: #1e3c72;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.auth-container a {
    color: #1e3c72;
    text-decoration: none;
}

/* PROFILE & DROPDOWN */
.profile {
    position: relative;
    cursor: pointer;
    font-weight: bold;
    z-index: 20;
}

.dropdown {
    position: absolute;
    right: 0;
    top: 30px;
    background: white;
    color: black;
    width: 150px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    display: none;
    overflow: hidden;
    z-index: 100;
    pointer-events: auto;
}

.dropdown-item {
    padding: 10px;
    cursor: pointer;
}

.dropdown-item:hover {
    background: #f0f0f0;
}

.logout {
    color: red;
}

.avatar {
    width: 25px;
    border-radius: 50%;
    margin-right: 5px;
    vertical-align: middle;
}

#login_history table {
    width: 100%;
    border-collapse: collapse;
    max-height: 400px;
    overflow-y: auto;
    display: block;
}

#login_history th, #login_history td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

#login_history tr:nth-child(even) {background-color: #f2f2f2;}
#login_history th {
    background-color: #4CAF50;
    color: white;
    position: sticky;
    top: 0;
}

.section-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.card-box {
    background: #fff;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* MODAL SYSTEM */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 30px;
    border-radius: 15px;
    width: 400px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.3);
    position: relative;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover { color: black; }

.modal-header {
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.modal-body p {
    margin: 10px 0;
    font-size: 16px;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px dashed #eee;
    padding-bottom: 5px;
}

.modal-body strong {
    color: #2c3e50;
}

/* CATCH CARD SYSTEM */
.catch-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.catch-card {
    background: white;
    border-radius: 10px;
    padding: 15px 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-left: 5px solid #1e3c72;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.catch-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.catch-info h4 {
    margin: 0;
    font-size: 18px;
    color: #2c3e50;
}

.catch-info span {
    font-size: 13px;
    color: #7f8c8d;
}

.catch-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-unravel {
    background: #ecf0f1;
    color: #2c3e50;
    padding: 6px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 12px;
    transition: background 0.2s;
}

.btn-unravel:hover {
    background: #dfe6e9;
}

/* UNRAVEL CONTENT - Fixed Visibility */
.unravel-content {
    display: none;
    overflow: hidden;
    background: #fafafa;
    border-radius: 0 0 10px 10px;
}

.unravel-content.active {
    display: block;
    padding: 20px;
    border-top: 1px solid #edf2f7;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.detail-item label {
    display: block;
    font-size: 10px;
    color: #718096;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.detail-item label i {
    margin-right: 5px;
    color: #4a5568;
}

.detail-item span {
    font-size: 14px;
    color: #2d3748;
    font-weight: 600;
}

.badge-catch {
    background: #e1f5fe;
    color: #039be5;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
}

/* LIST BOX ENCLOSURE - Professional */
.list-box {
    background: #fff;
    border-radius: 12px;
    border: none;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-top: 20px;
}

.list-box-header {
    background: #fff;
    padding: 20px 25px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.list-box-header h3 {
    margin: 0;
    font-size: 17px;
    color: #1a365d;
    font-weight: 700;
    letter-spacing: -0.2px;
}

.list-box-content {
    padding: 25px;
    max-height: 600px;
    overflow-y: auto;
    background-color: #ffffff;
}

.list-search-container {
    position: relative;
    width: 250px;
}

.list-search {
    width: 100%;
    background: #f7fafc;
    padding: 8px 16px 8px 35px;
    border-radius: 20px;
    font-size: 13px;
    color: #4a5568;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
    outline: none;
}

.list-search:focus {
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
    background: #fff;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    font-size: 12px;
}

.no-results {
    display: none;
    text-align: center;
    padding: 40px 20px;
    background: #fff;
    border-radius: 12px;
    border: 1px dashed #cbd5e0;
    color: #718096;
}

.no-results i {
    font-size: 40px;
    color: #e2e8f0;
    margin-bottom: 15px;
    display: block;
}

.no-results h4 {
    margin: 0;
    font-size: 16px;
    color: #4a5568;
}

.catch-card {
    background: #fff;
    border-radius: 10px;
    padding: 0; /* Remove padding for better header/content flow */
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    border: 1px solid #edf2f7;
    transition: all 0.2s ease;
}

.catch-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border-color: #cbd5e0;
}

.catch-card-header {
    padding: 18px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.catch-info h4 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 700;
    color: #2d3748;
}

.catch-info h4 i {
    margin-right: 8px;
    color: #3182ce;
}

.catch-info span {
    font-size: 12px;
    color: #718096;
    display: block;
}

.catch-info i.fa-clock {
    margin-right: 5px;
}

.btn-unravel {
    background: #ebf8ff;
    color: #3182ce;
    border: 1px solid #bee3f8;
    padding: 8px 18px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-unravel:hover {
    background: #3182ce;
    color: #fff;
}

.btn-unravel i {
    margin-right: 6px;
}

/* COOLER HISTORY MODAL ADDITIONAL STYLES */
#historyList tr {
    transition: background-color 0.2s ease;
}
#historyList tr:hover {
    background-color: #f8fafc;
}
#historyModal code {
    font-family: 'Consolas', 'Courier New', Courier, monospace;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    color: #475569;
    border: 1px solid #e2e8f0;
}

@keyframes pulseStatus {
    0% {
        transform: scale(1);
        box-shadow: 0 0 4px rgba(72, 187, 120, 0.4);
    }
    50% {
        transform: scale(1.2);
        box-shadow: 0 0 10px rgba(72, 187, 120, 0.8);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 4px rgba(72, 187, 120, 0.4);
    }
}

/* --- TRANSACTION MANAGEMENT & OPERATIONAL DATA MODULE STYLES --- */
.tx-header-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 22px 28px;
    border-radius: 14px;
    margin-bottom: 20px;
    box-shadow: 0 8px 20px rgba(30, 60, 114, 0.15);
}
.tx-header-banner h2 {
    margin: 0 0 6px 0;
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}
.tx-header-banner p {
    margin: 0;
    font-size: 13.5px;
    opacity: 0.9;
}
.tx-header-actions {
    display: flex;
    gap: 10px;
}
.btn-tx-primary {
    background: #38bdf8;
    color: #0f172a;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}
.btn-tx-primary:hover {
    background: #7dd3fc;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
}
.btn-tx-secondary {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}
.btn-tx-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
}

.tx-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}
.tx-kpi-card {
    background: white;
    border-radius: 12px;
    padding: 18px 20px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
}
.tx-kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.06);
}
.tx-kpi-info span.label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    font-weight: 600;
    margin-bottom: 4px;
}
.tx-kpi-info h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
}
.tx-kpi-info small {
    display: block;
    font-size: 11.5px;
    color: #64748b;
    margin-top: 4px;
}
.tx-kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}
.tx-kpi-icon.blue { background: #e0f2fe; color: #0284c7; }
.tx-kpi-icon.green { background: #dcfce7; color: #16a34a; }
.tx-kpi-icon.amber { background: #fef3c7; color: #d97706; }
.tx-kpi-icon.purple { background: #f3e8ff; color: #9333ea; }

.tx-seasonal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 22px;
}
@media (max-width: 900px) {
    .tx-seasonal-grid { grid-template-columns: 1fr; }
}

.tx-season-card {
    background: white;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
}
.tx-season-header {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f1f5f9;
}
.tx-season-header.dry {
    background: linear-gradient(90deg, #fff7ed 0%, #ffedd5 100%);
    border-left: 5px solid #f97316;
}
.tx-season-header.wet {
    background: linear-gradient(90deg, #eff6ff 0%, #dbeafe 100%);
    border-left: 5px solid #2563eb;
}
.tx-season-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}
.tx-season-body {
    padding: 18px 20px;
}
.species-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    margin-bottom: 14px;
}
.species-pill {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.species-pill.dry {
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #ffedd5;
}
.species-pill.wet {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #dbeafe;
}

.tx-filter-bar {
    background: white;
    padding: 16px 20px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin-bottom: 18px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.tx-filter-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    flex: 1;
}
.tx-input {
    padding: 9px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
}
.tx-input:focus {
    border-color: #1e3c72;
    box-shadow: 0 0 0 3px rgba(30, 60, 114, 0.1);
}
.tx-select {
    padding: 9px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    background: white;
    cursor: pointer;
}

.season-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11.5px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.season-badge.dry {
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #ffedd5;
}
.season-badge.wet {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #dbeafe;
}

.tx-admin-review-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 20px;
    margin-top: 24px;
}
.tx-admin-review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}
.tx-admin-review-header h4 {
    margin: 0;
    font-size: 16px;
    color: #0f172a;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Modal styling */
.tx-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}
.tx-modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 540px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalPop {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
.tx-modal-header {
    background: #1e3c72;
    color: white;
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.tx-modal-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
}
.tx-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.8;
}
.tx-modal-close:hover { opacity: 1; }
.tx-modal-body {
    padding: 24px;
}
.tx-form-group {
    margin-bottom: 16px;
}
.tx-form-group label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}
.tx-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.tx-modal-footer {
    padding: 16px 24px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* --- ROI, WEATHER & TOOLS STYLES --- */
.roi-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11.5px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.roi-badge.excellent {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}
.roi-badge.good {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}
.roi-badge.fair {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}
.roi-badge.loss {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
}

.weather-badge {
    padding: 3px 8px;
    border-radius: 8px;
    font-size: 11.5px;
    font-weight: 600;
    background: #f8fafc;
    color: #334155;
    border: 1px solid #e2e8f0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.tool-tag {
    display: inline-block;
    padding: 2px 7px;
    background: #f1f5f9;
    color: #475569;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    margin-right: 4px;
    margin-bottom: 2px;
    border: 1px solid #e2e8f0;
}

.cost-text {
    color: #dc2626;
    font-weight: 600;
}
.profit-text {
    color: #16a34a;
    font-weight: 700;
}

/* MOBILE RESPONSIVE ENHANCEMENTS */
@media (max-width: 768px) {
    .catch-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .catch-actions {
        width: 100%;
        justify-content: space-between;
    }
    .details-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .list-box-header {
        flex-direction: column;
        align-items: stretch !important;
    }
    .list-search-container {
        width: 100%;
    }
    .btn-tx-primary, .btn {
        width: 100%;
        justify-content: center;
    }
}
/* Screen mode: hide print-only headers */
.print-only-header {
    display: none;
}

/* UNIFIED TAB-ISOLATED PRINT STYLES */
@media print {
    /* Hide non-printable elements: sidebars, topbar, navigation, buttons, search filters, modals & web header banners */
    .sidebar, 
    .topbar, 
    .list-search-container, 
    button, 
    .btn, 
    .btn-tx-primary, 
    .btn-tx-secondary, 
    .tx-header-actions, 
    .tx-filter-bar,
    .tx-header-banner,
    .tx-seasonal-grid,
    .reports-web-header,
    .modal,
    .tx-modal,
    #txModal,
    #txViewModal,
    footer,
    .footer,
    .footer-section,
    .footer-bottom,
    .tx-modal-footer {
        display: none !important;
    }

    /* Display clean print header */
    .print-only-header {
        display: block !important;
    }

    /* Reset page containers for clean document printing */
    html, body {
        background: #ffffff !important;
        color: #000000 !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
    }

    .main-content {
        margin: 0 !important;
        padding: 10px !important;
        width: 100% !important;
    }

    /* HIDE ALL TAB PAGES BY DEFAULT IN PRINT MODE */
    .page {
        display: none !important;
    }

    /* ONLY DISPLAY THE CURRENTLY ACTIVE TAB PAGE */
    .page.active {
        display: block !important;
        visibility: visible !important;
        position: relative !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .page.active * {
        visibility: visible !important;
    }

    /* Force background colors, badges, and chart colors to print */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Reports tab print layout */
    #reports {
        padding: 0 !important;
    }

    #reports .cards {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 10px !important;
        margin-bottom: 16px !important;
    }

    /* Transactions tab print layout */
    #transactions {
        padding: 0 !important;
    }

    #transactions .tx-kpi-grid {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 10px !important;
        margin-bottom: 16px !important;
    }

    /* Hide the Action column in transaction table when printing */
    #transactions table th:last-child,
    #transactions table td:last-child {
        display: none !important;
    }

    /* Ensure chart canvases render cleanly at full height without cutoffs */
    canvas {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        display: block !important;
        visibility: visible !important;
    }

    /* Prevent breaking cards, list-boxes, or table rows awkwardly across page breaks */
    .card, 
    .list-box, 
    .tx-kpi-card, 
    tr {
        break-inside: avoid !important;
        page-break-inside: avoid !important;
    }

    .list-box {
        box-shadow: none !important;
        border: 1px solid #cbd5e1 !important;
        margin-bottom: 16px !important;
    }

    .list-box-header {
        padding: 8px 12px !important;
        background: #f8fafc !important;
        border-bottom: 1px solid #e2e8f0 !important;
    }

    .list-box-header h3 {
        font-size: 13px !important;
        margin: 0 !important;
    }

    table {
        width: 100% !important;
        border-collapse: collapse !important;
    }

    th, td {
        border: 1px solid #e2e8f0 !important;
        padding: 5px 8px !important;
        font-size: 10.5px !important;
    }
}

/* MESSENGER CHAT STYLES */
.chat-user-item:hover {
    background: #f1f5f9 !important;
}
.chat-user-item.active {
    background: #e0f2fe !important;
    border-left: 4px solid #0284c7 !important;
}
.chat-bubble {
    max-width: 72%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.45;
    word-wrap: break-word;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.chat-bubble.fisherman {
    background: #ffffff;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
.chat-bubble.admin {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #ffffff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

/* WEATHER & GEAR ANALYTICS SCROLLBARS */
#weatherListContainer::-webkit-scrollbar,
#toolsListContainer::-webkit-scrollbar {
    width: 6px;
}
#weatherListContainer::-webkit-scrollbar-track,
#toolsListContainer::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}
#weatherListContainer::-webkit-scrollbar-thumb,
#toolsListContainer::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
#weatherListContainer::-webkit-scrollbar-thumb:hover,
#toolsListContainer::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}


/* --- SHARED UI REFINEMENTS --- */
:root {
    --hm-navy: #12355b;
    --hm-blue: #087e8b;
    --hm-cyan: #2ec4b6;
    --hm-ink: #172b4d;
    --hm-muted: #64748b;
    --hm-surface: #ffffff;
    --hm-bg: #f4f7fb;
    --hm-border: #e2e8f0;
    --hm-radius: 14px;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background:
        radial-gradient(circle at 100% 0, rgba(46, 196, 182, 0.08), transparent 32rem),
        var(--hm-bg);
    color: var(--hm-ink);
}

.wrapper {
    min-height: 100vh;
}

.sidebar {
    width: 258px;
    flex: 0 0 258px;
    padding: 26px 16px;
    background: linear-gradient(180deg, #12355b 0%, #0b2948 100%);
    box-shadow: 8px 0 24px rgba(15, 42, 70, 0.08);
}

.sidebar h2 {
    margin: 0 10px 30px;
    font-size: 22px;
    letter-spacing: -0.4px;
}

.sidebar ul {
    padding: 0;
    margin: 0;
    list-style: none;
}

.sidebar li {
    min-height: 44px;
    margin-bottom: 6px;
    padding: 11px 14px;
    border-left: 3px solid transparent;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 13px;
}

.sidebar li:hover,
.sidebar li.active {
    transform: none;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-left-color: var(--hm-cyan);
}

.sidebar li i {
    color: #7dd3fc !important;
}

.main {
    min-width: 0;
}

.topbar {
    min-height: 76px;
    padding: 16px clamp(18px, 3vw, 36px);
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid var(--hm-border);
    box-shadow: 0 4px 18px rgba(30, 60, 114, 0.06);
}

.topbar h2 {
    min-width: 0;
    margin: 0;
    color: var(--hm-ink);
    font-size: clamp(16px, 2vw, 21px);
    letter-spacing: -0.3px;
}

.page {
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
    padding: clamp(18px, 3vw, 32px);
}

button,
.btn,
input,
select,
textarea {
    font: inherit;
}

button,
.btn {
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

button:hover,
.btn:hover {
    transform: translateY(-1px);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(46, 196, 182, 0.35);
    outline-offset: 2px;
}

table {
    border: 1px solid var(--hm-border);
    border-radius: 10px;
    overflow: hidden;
}

th {
    background: var(--hm-navy);
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

td {
    color: #334155;
    font-size: 13px;
}

tbody tr:hover {
    background: #f8fbfd;
}

.mobile-nav-toggle {
    display: none;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    border: 1px solid var(--hm-border);
    border-radius: 10px;
    background: var(--hm-surface);
    color: var(--hm-navy);
}

/* Auth screens share the dashboard's visual language and remain usable on narrow devices. */
.auth-body {
    min-height: 100vh;
    height: auto;
    padding: 24px 16px;
    background:
        linear-gradient(135deg, rgba(18, 53, 91, 0.96), rgba(8, 126, 139, 0.9)),
        radial-gradient(circle at 15% 15%, rgba(46, 196, 182, 0.45), transparent 25rem);
}

.auth-container {
    width: min(100%, 440px);
    padding: clamp(24px, 5vw, 38px);
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(3, 24, 44, 0.25);
}

.auth-container h2 {
    margin-top: 0;
    color: var(--hm-navy);
    font-size: 24px;
}

.auth-container form {
    text-align: left;
}

.auth-container form > label:first-child {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 9px;
    min-height: 22px;
    margin: 0 0 12px;
    color: var(--hm-text);
}

.auth-container input[type="checkbox"] {
    appearance: auto;
    -webkit-appearance: checkbox;
    display: inline-block;
    flex: 0 0 auto;
    width: 15px !important;
    min-width: 15px;
    height: 15px;
    min-height: 15px;
    margin: 0 !important;
    padding: 0 !important;
    accent-color: var(--hm-ocean);
}

.auth-container input:not([type="checkbox"]):not([type="file"]) {
    display: block;
    width: 100%;
    min-height: 44px;
    margin: 10px 0 14px;
    padding: 11px 13px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    color: var(--hm-ink);
    background: #fbfdff;
}

.auth-container input[type="file"] {
    display: block;
    width: 100%;
    margin: 8px 0 16px;
    padding: 9px;
    border: 1px dashed #94a3b8;
    border-radius: 9px;
    background: #f8fafc;
}

.auth-container label {
    display: block;
    color: #475569;
    font-size: 12px;
    font-weight: 600;
}

.auth-container button {
    min-height: 44px;
    width: 100%;
    margin-top: 8px;
    border-radius: 9px;
    background: var(--hm-navy);
    font-weight: 700;
}

.auth-container form > input,
.auth-container form > div > input {
    max-width: 100%;
}

.auth-container form > div {
    width: 100%;
}

.auth-container button:hover {
    background: var(--hm-blue);
}

.auth-container a {
    color: var(--hm-blue);
    font-weight: 600;
}

@media (max-width: 900px) {
    .mobile-nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 1100;
        width: min(84vw, 290px);
        transform: translateX(-105%);
        transition: transform 0.25s ease;
        overflow-y: auto;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main {
        width: 100%;
    }
}

@media (max-width: 600px) {
    .topbar {
        padding: 12px 16px;
    }

    .topbar h2 {
        font-size: 15px;
        line-height: 1.25;
    }

    .profile span {
        max-width: 90px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .page {
        padding: 16px 12px 24px;
    }

    .section-grid,
    .tx-form-row {
        grid-template-columns: 1fr;
    }

    .list-box-content {
        padding: 14px;
        overflow-x: auto;
    }

    table {
        min-width: 620px;
    }

    .modal-content {
        width: calc(100% - 24px);
        margin: 8% auto;
        padding: 22px;
    }
}

/* 2026-09-14 accessibility, alignment, night-mode, and chat-image fixes */
.dashboard-stat-card,
.dashboard-panel,
.dashboard-action-card {
    box-sizing: border-box;
}

.dashboard-action-card {
    min-height: 98px;
    background: var(--hm-panel);
}

.dashboard-action-card:hover {
    background: #f3faf9 !important;
}

.chat-shell,
.chat-user-panel,
.chat-conversation-panel {
    min-width: 0;
}

.chat-composer {
    padding: 10px 14px 14px;
    border-top: 1px solid var(--hm-line);
    background: var(--hm-panel);
}

.chat-composer-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-attach-button,
.chat-attachment-preview button {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    margin: 0;
    border: 1px solid var(--hm-line);
    background: #edf8f6;
    color: var(--hm-ocean);
}

.chat-attach-button {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 17px;
}

.chat-send-button {
    min-height: 42px;
    margin: 0;
    padding: 10px 20px;
    border-radius: 22px;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.chat-send-button:disabled {
    opacity: 0.55;
    cursor: wait;
}

.chat-attachment-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    max-width: 100%;
    margin: 0 0 9px 52px;
    padding: 7px 9px;
    border: 1px solid var(--hm-line);
    border-radius: 11px;
    background: #f8fcfb;
    color: var(--hm-text);
    font-size: 12px;
}

.chat-attachment-preview[hidden] {
    display: none !important;
}

.chat-attachment-preview img {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
}

.chat-attachment-preview span {
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-attachment-preview button {
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

.chat-message-image {
    display: block;
    width: min(330px, 55vw);
    max-height: 360px;
    margin-bottom: 7px;
    border-radius: 10px;
    object-fit: contain;
    background: rgba(0, 0, 0, 0.12);
}

.chat-message-text {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

html[data-theme="dark"] .dashboard-stat-card,
html[data-theme="dark"] .dashboard-panel,
html[data-theme="dark"] .dashboard-action-card,
html[data-theme="dark"] .chat-shell,
html[data-theme="dark"] .chat-user-panel,
html[data-theme="dark"] .chat-search-panel,
html[data-theme="dark"] .chat-conversation-panel,
html[data-theme="dark"] .chat-active-header,
html[data-theme="dark"] #chatMessagesThread,
html[data-theme="dark"] .chat-composer,
html[data-theme="dark"] .chat-attachment-preview {
    background: #0c2735 !important;
    border-color: #315164 !important;
    color: #e6f4f4 !important;
}

html[data-theme="dark"] .dashboard-action-card:hover,
html[data-theme="dark"] .chat-user-item:hover,
html[data-theme="dark"] .chat-user-item.active {
    background: #133747 !important;
}

html[data-theme="dark"] .page [style*="color: #2d3748"],
html[data-theme="dark"] .page [style*="color:#2d3748"],
html[data-theme="dark"] .page [style*="color: #1e293b"],
html[data-theme="dark"] .page [style*="color:#1e293b"],
html[data-theme="dark"] .page [style*="color: #1e3c72"],
html[data-theme="dark"] .page [style*="color:#1e3c72"],
html[data-theme="dark"] .page [style*="color: #334155"],
html[data-theme="dark"] .page [style*="color:#334155"],
html[data-theme="dark"] .page [style*="color: #4a5568"],
html[data-theme="dark"] .page [style*="color:#4a5568"] {
    color: #e6f4f4 !important;
}

html[data-theme="dark"] .page [style*="color: #718096"],
html[data-theme="dark"] .page [style*="color:#718096"],
html[data-theme="dark"] .page [style*="color: #64748b"],
html[data-theme="dark"] .page [style*="color:#64748b"],
html[data-theme="dark"] .page [style*="color: #94a3b8"],
html[data-theme="dark"] .page [style*="color:#94a3b8"] {
    color: #a8bdc5 !important;
}

html[data-theme="dark"] .page [style*="background: white"],
html[data-theme="dark"] .page [style*="background:#ffffff"],
html[data-theme="dark"] .page [style*="background: #ffffff"],
html[data-theme="dark"] .page [style*="background:#f8fafc"],
html[data-theme="dark"] .page [style*="background: #f8fafc"] {
    background: #0c2735 !important;
    border-color: #315164 !important;
}

html[data-theme="dark"] .chat-bubble.fisherman {
    background: #17394a !important;
    color: #e6f4f4 !important;
}

html[data-theme="dark"] .profile > span,
html[data-theme="dark"] .dropdown strong,
html[data-theme="dark"] .dropdown span,
html[data-theme="dark"] .dropdown i {
    color: #e6f4f4 !important;
}

@media (max-width: 820px) {
    .chat-shell {
        height: auto !important;
        min-height: 720px;
        flex-direction: column;
    }

    .chat-user-panel {
        width: 100% !important;
        max-height: 240px;
        border-right: 0 !important;
        border-bottom: 1px solid var(--hm-line);
    }

    .chat-conversation-panel {
        min-height: 480px;
    }

    .chat-send-button span {
        display: none;
    }

    .chat-send-button {
        width: 42px;
        padding: 10px;
    }

    .chat-attachment-preview {
        margin-left: 0;
    }
}

.manual-page {
    margin: 0;
    background: var(--hm-bg, #f4f8f8);
    color: var(--hm-text, #123044);
}

.manual-shell {
    width: min(1120px, calc(100% - 32px));
    margin: 32px auto;
}

.manual-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.manual-header span { color: var(--hm-ocean); font-size: 11px; font-weight: 800; letter-spacing: 1.4px; }
.manual-header h1 { margin: 5px 0 0; }
.manual-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.manual-grid article { position: relative; padding: 22px 22px 22px 66px; border: 1px solid var(--hm-line); border-radius: 16px; background: var(--hm-panel); box-shadow: 0 10px 25px rgba(18, 63, 78, .07); }
.manual-grid article b { position: absolute; top: 22px; left: 20px; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--hm-ocean); color: #fff; }
.manual-grid h2 { margin: 0 0 7px; font-size: 17px; }
.manual-grid p { margin: 0; color: var(--hm-muted); line-height: 1.62; }
html[data-theme="dark"] .manual-grid article { background: #0b2438; border-color: #254555; }
html[data-theme="dark"] .manual-grid h2 { color: #e6f4f4; }
html[data-theme="dark"] .manual-grid p { color: #a8bdc5; }

@media (max-width: 700px) {
    .manual-header { align-items: flex-start; flex-direction: column; }
    .manual-grid { grid-template-columns: 1fr; }
}

/* =========================================================
   ACCESSIBILITY, SETTINGS, AND DARK MODE
   ========================================================= */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
textarea,
select {
    color: #111827 !important;
    background-color: #ffffff;
    caret-color: #111827;
}

input::placeholder,
textarea::placeholder {
    color: #64748b;
    opacity: 1;
}

.remember-option {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 2px 0 14px;
    color: #334155;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.remember-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--hm-ocean);
}

.auth-settings {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 20;
    display: flex;
    gap: 8px;
}

.auth-settings button {
    min-width: 44px;
    height: 42px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 10px;
    background: rgba(6, 28, 44, 0.72);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}

.auth-settings svg {
    width: 18px;
    vertical-align: middle;
}

.topbar-settings {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    margin-right: 12px;
}

.topbar-setting-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    margin: 0;
    padding: 8px 11px;
    border: 1px solid var(--hm-line);
    border-radius: 10px;
    background: #ffffff;
    color: var(--hm-text);
    box-shadow: 0 4px 12px rgba(18, 63, 78, 0.07);
}

.topbar-setting-button svg {
    width: 16px;
    height: 16px;
}

.guide-header {
    margin-bottom: 18px;
    padding: 24px;
    border-radius: 18px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--hm-navy), var(--hm-ocean));
    box-shadow: var(--hm-shadow);
}

.guide-header h3 {
    margin: 5px 0 8px;
    font-size: 24px;
}

.guide-header p {
    max-width: 760px;
    margin: 0;
    color: #d7f8f1;
    line-height: 1.6;
}

.guide-kicker {
    color: var(--hm-mint);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.7px;
}

.guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 14px;
}

.guide-card {
    display: flex;
    gap: 14px;
    padding: 19px;
    border: 1px solid var(--hm-line);
    border-radius: 15px;
    background: var(--hm-panel);
    box-shadow: 0 8px 22px rgba(18, 63, 78, 0.06);
}

.guide-card > span {
    display: grid;
    place-items: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: #ffffff;
    background: var(--hm-ocean);
    font-weight: 800;
}

.guide-card h4 {
    margin: 1px 0 7px;
    color: var(--hm-text);
}

.guide-card p {
    margin: 0;
    color: var(--hm-soft-text);
    font-size: 13px;
    line-height: 1.55;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --hm-cream: #051722;
    --hm-panel: #0c2735;
    --hm-line: #254555;
    --hm-text: #e6f4f4;
    --hm-soft-text: #a8bdc5;
    --hm-shadow: 0 18px 45px rgba(0, 0, 0, 0.24);
}

html[data-theme="dark"] body,
html[data-theme="dark"] .main {
    background: #051722;
    color: var(--hm-text);
}

html[data-theme="dark"] .topbar,
html[data-theme="dark"] .list-box,
html[data-theme="dark"] .list-box-header,
html[data-theme="dark"] .list-box-content,
html[data-theme="dark"] .catch-card,
html[data-theme="dark"] .card-box,
html[data-theme="dark"] .tx-kpi-card,
html[data-theme="dark"] .tx-season-card,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .tx-modal-content,
html[data-theme="dark"] table,
html[data-theme="dark"] .dropdown,
html[data-theme="dark"] .guide-card {
    background: #0c2735 !important;
    border-color: var(--hm-line) !important;
    color: var(--hm-text) !important;
}

html[data-theme="dark"] .page h1,
html[data-theme="dark"] .page h2,
html[data-theme="dark"] .page h3,
html[data-theme="dark"] .page h4,
html[data-theme="dark"] .page label,
html[data-theme="dark"] .page td,
html[data-theme="dark"] .page p,
html[data-theme="dark"] .topbar h2,
html[data-theme="dark"] .dropdown-item,
html[data-theme="dark"] .guide-card h4 {
    color: var(--hm-text) !important;
}

html[data-theme="dark"] tbody tr:hover,
html[data-theme="dark"] .dropdown-item:hover {
    background: #133747 !important;
}

html[data-theme="dark"] .topbar-setting-button {
    border-color: var(--hm-line);
    background: #133747;
    color: #e6f4f4;
}

html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
    color: #111827 !important;
    background: #f8fafc !important;
}

html[data-theme="dark"] .auth-container {
    background: #0c2735;
    border-color: #315164;
    color: #e6f4f4;
}

html[data-theme="dark"] .auth-container h2,
html[data-theme="dark"] .auth-subtitle,
html[data-theme="dark"] .remember-option,
html[data-theme="dark"] .auth-footer {
    color: #e6f4f4;
}

@media (max-width: 700px) {
    .topbar-settings span {
        display: none;
    }

    .topbar-setting-button {
        min-width: 38px;
        justify-content: center;
        padding: 8px;
    }
}

/* Public preview page */
.preview-body {
    min-height: 100vh;
    background: #f7fbfa;
    color: var(--hm-text);
}

.preview-nav {
    width: min(1180px, calc(100% - 40px));
    min-height: 78px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.preview-brand,
.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--hm-text);
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.5px;
    text-decoration: none;
}

.brand-mark,
.auth-brand svg {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: var(--hm-navy);
    color: var(--hm-mint);
}

.brand-mark svg {
    width: 19px;
}

.preview-links {
    display: flex;
    align-items: center;
    gap: 30px;
}

.preview-links a {
    color: var(--hm-soft-text);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.preview-links a:hover {
    color: var(--hm-ocean);
}

.preview-login {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 15px;
    border: 1px solid var(--hm-line);
    border-radius: 9px;
    background: #fff;
    color: var(--hm-text) !important;
    box-shadow: 0 5px 14px rgba(18, 63, 78, 0.06);
}

.preview-login svg {
    width: 14px;
}

.preview-hero {
    width: min(1180px, calc(100% - 40px));
    min-height: 650px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(420px, 1.1fr);
    align-items: center;
    gap: clamp(36px, 7vw, 90px);
    padding: 78px 0 92px;
}

.eyebrow {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 18px;
    color: var(--hm-ocean);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.8px;
    text-transform: uppercase;
}

.eyebrow svg {
    width: 14px;
}

.preview-hero h1 {
    max-width: 620px;
    margin: 0;
    color: var(--hm-deep);
    font-size: clamp(42px, 5.2vw, 72px);
    line-height: 1.02;
    letter-spacing: -3.8px;
}

.preview-lead {
    max-width: 520px;
    margin: 28px 0 0;
    color: var(--hm-soft-text);
    font-size: 16px;
    line-height: 1.7;
}

.preview-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 34px;
}

.preview-primary,
.preview-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 47px;
    padding: 0 18px;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
}

.preview-primary {
    background: var(--hm-navy);
    color: #fff;
    box-shadow: 0 10px 22px rgba(11, 48, 72, 0.18);
}

.preview-primary:hover {
    background: var(--hm-ocean);
    color: #fff;
    transform: translateY(-1px);
}

.preview-secondary {
    color: var(--hm-ocean);
}

.preview-secondary:hover {
    background: #e9f7f4;
}

.preview-primary svg,
.preview-secondary svg {
    width: 16px;
}

.preview-proof {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 30px;
    color: var(--hm-soft-text);
    font-size: 10px;
    font-weight: 700;
}

.preview-proof span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.preview-proof svg {
    width: 15px;
    color: var(--hm-teal);
}

.preview-hero-art {
    position: relative;
    min-height: 450px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-art-glow {
    position: absolute;
    width: 460px;
    height: 460px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(22, 184, 166, 0.28), rgba(22, 184, 166, 0));
}

.preview-window {
    position: relative;
    width: 100%;
    max-width: 610px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 17px;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 30px 70px rgba(11, 48, 72, 0.17);
    backdrop-filter: blur(12px);
    transform: rotate(1.5deg);
}

.preview-window-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 14px;
    border-bottom: 1px solid var(--hm-line);
    background: #fff;
}

.preview-window-bar > span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #c7d9d8;
}

.preview-window-bar small {
    margin-left: 10px;
    color: #92a9ae;
    font-size: 8px;
}

.preview-window-body {
    display: flex;
    min-height: 350px;
}

.preview-mini-sidebar {
    width: 56px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
    padding: 18px 0;
    background: var(--hm-deep);
    color: #7195a0;
}

.preview-mini-sidebar b {
    color: var(--hm-mint);
}

.preview-mini-sidebar svg {
    width: 16px;
}

.preview-mini-content {
    flex: 1;
    padding: 22px;
    background: #f8fcfb;
}

.preview-mini-heading,
.preview-mini-banner,
.preview-mini-grid,
.preview-mini-table span {
    display: flex;
    align-items: center;
}

.preview-mini-heading {
    justify-content: space-between;
}

.preview-mini-heading small,
.preview-mini-table > small {
    display: block;
    color: #91a9ae;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 1px;
}

.preview-mini-heading strong {
    display: block;
    margin-top: 5px;
    color: var(--hm-text);
    font-size: 15px;
}

.preview-mini-heading > svg {
    width: 17px;
    color: var(--hm-ocean);
}

.preview-mini-banner {
    justify-content: space-between;
    margin-top: 22px;
    padding: 18px;
    border-radius: 11px;
    background: var(--hm-navy);
    color: #fff;
}

.preview-mini-banner small {
    display: block;
    color: #a7c9c8;
    font-size: 9px;
}

.preview-mini-banner strong {
    display: block;
    margin-top: 6px;
    font-size: 25px;
}

.preview-mini-banner svg {
    color: var(--hm-mint);
}

.preview-mini-grid {
    gap: 9px;
    margin-top: 10px;
}

.preview-mini-grid > div {
    flex: 1;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--hm-line);
    border-radius: 9px;
    background: #fff;
}

.preview-mini-grid svg {
    width: 14px;
    color: var(--hm-teal);
}

.preview-mini-grid small,
.preview-mini-grid b {
    display: block;
}

.preview-mini-grid small {
    margin-top: 9px;
    color: #90a5aa;
    font-size: 8px;
}

.preview-mini-grid b {
    margin-top: 3px;
    color: var(--hm-text);
    font-size: 17px;
}

.preview-mini-table {
    margin-top: 16px;
    padding: 14px;
    border: 1px solid var(--hm-line);
    border-radius: 9px;
    background: #fff;
}

.preview-mini-table span {
    justify-content: space-between;
    padding-top: 11px;
    color: var(--hm-text);
    font-size: 10px;
}

.preview-mini-table em {
    color: var(--hm-ocean);
    font-size: 9px;
    font-style: normal;
    font-weight: 700;
}

.preview-capabilities {
    padding: 102px max(20px, calc((100% - 1180px) / 2)) 110px;
    background: #fff;
}

.preview-workflow {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 108px 0;
}

.preview-workflow .preview-section-heading {
    max-width: 680px;
}

.preview-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
    margin-top: 52px;
}

.preview-step {
    display: flex;
    gap: 18px;
    padding: 24px 22px;
    border-top: 1px solid var(--hm-line);
}

.preview-step > span {
    color: var(--hm-teal);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 1px;
}

.preview-step svg {
    width: 20px;
    color: var(--hm-ocean);
}

.preview-step h3 {
    margin: 20px 0 9px;
    color: var(--hm-text);
    font-size: 16px;
}

.preview-step p {
    margin: 0;
    color: var(--hm-soft-text);
    font-size: 12px;
    line-height: 1.7;
}

.preview-trust {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(35px, 8vw, 120px);
    padding: 100px max(20px, calc((100% - 1180px) / 2));
    background: var(--hm-deep);
    color: #fff;
}

.preview-trust-copy h2 {
    max-width: 520px;
    margin: 0;
    color: #fff;
    font-size: clamp(31px, 4vw, 52px);
    line-height: 1.08;
    letter-spacing: -2px;
}

.preview-trust-copy > p:last-child {
    max-width: 510px;
    margin: 22px 0 0;
    color: #a9c3c4;
    font-size: 14px;
    line-height: 1.75;
}

.preview-trust .eyebrow {
    color: var(--hm-mint);
}

.preview-trust-list {
    align-self: center;
    display: grid;
    gap: 13px;
}

.preview-trust-list > div {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 17px;
    border: 1px solid rgba(185, 243, 232, 0.16);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.045);
}

.preview-trust-list svg {
    flex: 0 0 auto;
    width: 19px;
    color: var(--hm-mint);
}

.preview-trust-list b,
.preview-trust-list small {
    display: block;
}

.preview-trust-list b {
    color: #fff;
    font-size: 12px;
}

.preview-trust-list small {
    margin-top: 4px;
    color: #8eafb1;
    font-size: 10px;
}

.preview-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: min(980px, calc(100% - 40px));
    margin: 0 auto;
    padding: 80px 0 35px;
}

.preview-metrics > div {
    padding: 8px 30px;
    border-right: 1px solid var(--hm-line);
}

.preview-metrics > div:last-child {
    border-right: 0;
}

.preview-metrics strong,
.preview-metrics span,
.preview-metrics small {
    display: block;
}

.preview-metrics strong {
    color: var(--hm-ocean);
    font-size: 34px;
    letter-spacing: -1.5px;
}

.preview-metrics span {
    margin-top: 7px;
    color: var(--hm-text);
    font-size: 12px;
    font-weight: 800;
}

.preview-metrics small {
    margin-top: 5px;
    color: var(--hm-soft-text);
    font-size: 10px;
}

.preview-section-heading {
    max-width: 570px;
}

.preview-section-heading h2,
.preview-cta h2 {
    margin: 0;
    color: var(--hm-deep);
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.1;
    letter-spacing: -2px;
}

.preview-section-heading > p:last-child {
    margin-top: 17px;
    color: var(--hm-soft-text);
    font-size: 14px;
    line-height: 1.6;
}

.preview-feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-top: 55px;
}

.preview-feature {
    padding: 26px;
    border: 1px solid var(--hm-line);
    border-radius: 14px;
    background: #fcfefe;
}

.preview-feature > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: #e7f8f4;
    color: var(--hm-ocean);
}

.preview-feature h3 {
    margin: 24px 0 10px;
    color: var(--hm-text);
    font-size: 15px;
}

.preview-feature p {
    margin: 0;
    color: var(--hm-soft-text);
    font-size: 12px;
    line-height: 1.65;
}

.preview-cta {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 90px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}

.preview-cta .eyebrow {
    margin-bottom: 12px;
}

.preview-cta h2 {
    font-size: clamp(28px, 3.5vw, 44px);
}

.preview-footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 25px max(20px, calc((100% - 1180px) / 2));
    border-top: 1px solid var(--hm-line);
    color: var(--hm-soft-text);
    font-size: 10px;
}

.preview-footer span:first-child {
    color: var(--hm-text);
    font-weight: 800;
}

.auth-brand {
    margin: 0 auto 24px;
}

.auth-brand svg {
    padding: 9px;
}

.auth-subtitle {
    margin: -8px 0 24px;
    color: var(--hm-soft-text);
    font-size: 12px;
    line-height: 1.5;
}

.auth-footer {
    color: var(--hm-soft-text);
    font-size: 12px;
}

.secondary-auth-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #edf8f6 !important;
    color: var(--hm-ocean) !important;
    box-shadow: none !important;
}

.secondary-auth-button svg {
    width: 15px;
}

@media (max-width: 900px) {
    .preview-hero {
        grid-template-columns: 1fr;
        padding-top: 55px;
    }

    .preview-hero-art {
        min-height: 390px;
    }

    .preview-feature-grid {
        grid-template-columns: 1fr;
    }

    .preview-steps,
    .preview-trust {
        grid-template-columns: 1fr;
    }

    .preview-trust-list {
        max-width: 600px;
    }
}

@media (max-width: 600px) {
    .preview-nav,
    .preview-hero,
    .preview-cta {
        width: min(100% - 28px, 1180px);
    }

    .preview-nav {
        min-height: 68px;
    }

    .preview-links {
        gap: 12px;
    }

    .preview-links > a:not(.preview-login) {
        display: none;
    }

    .preview-hero {
        padding: 48px 0 65px;
    }

    .preview-hero h1 {
        font-size: 44px;
        letter-spacing: -2.4px;
    }

    .preview-lead {
        font-size: 14px;
    }

    .preview-actions,
    .preview-primary,
    .preview-secondary {
        width: 100%;
    }

    .preview-hero-art {
        min-height: 280px;
    }

    .preview-window {
        transform: none;
    }

    .preview-window-body {
        min-height: 270px;
    }

    .preview-mini-content {
        padding: 12px;
    }

    .preview-mini-grid > div {
        padding: 8px;
    }

    .preview-mini-grid small {
        font-size: 7px;
    }

    .preview-mini-table {
        display: none;
    }

    .preview-capabilities {
        padding: 70px 14px;
    }

    .preview-workflow {
        width: min(100% - 28px, 1180px);
        padding: 70px 0;
    }

    .preview-step {
        padding: 20px 0;
    }

    .preview-trust {
        padding: 70px 20px;
    }

    .preview-metrics {
        grid-template-columns: 1fr;
        gap: 22px;
        width: min(100% - 28px, 980px);
        padding: 60px 0 10px;
    }

    .preview-metrics > div {
        padding: 0 0 22px;
        border-right: 0;
        border-bottom: 1px solid var(--hm-line);
    }

    .preview-cta {
        flex-direction: column;
        align-items: stretch;
        padding: 65px 0;
    }

    .preview-footer {
        flex-direction: column;
    }
}

/* Preview alignment overrides for the complete product story. */
.preview-workflow,
.preview-roles,
.preview-results,
.preview-faq {
    width: min(1180px, calc(100% - 40px));
    margin-right: auto;
    margin-left: auto;
}

.preview-workflow {
    padding: 104px 0;
}

.preview-steps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
}

.preview-step {
    min-width: 0;
    display: grid;
    grid-template-columns: auto auto;
    grid-template-rows: auto auto 1fr;
    column-gap: 12px;
    align-content: start;
    padding: 22px 20px;
    border: 1px solid var(--hm-line);
    border-radius: 14px;
    background: #fff;
}

.preview-step > b {
    grid-column: 1;
    grid-row: 1;
    color: var(--hm-teal);
    font-size: 11px;
    letter-spacing: 1px;
}

.preview-step > span {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    color: var(--hm-ocean);
}

.preview-step > span svg {
    width: 19px;
    height: 19px;
}

.preview-step > h3 {
    grid-column: 1 / -1;
    grid-row: 2;
    margin: 24px 0 9px;
    color: var(--hm-text);
    font-size: 15px;
}

.preview-step > p {
    grid-column: 1 / -1;
    grid-row: 3;
    margin: 0;
    color: var(--hm-soft-text);
    font-size: 12px;
    line-height: 1.65;
}

.preview-roles {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    align-items: center;
    gap: clamp(40px, 8vw, 115px);
    padding: 105px 0;
}

.preview-role-visual {
    position: relative;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    background: linear-gradient(145deg, #e8f7f4, #f8fcfb);
}

.preview-role-card {
    border: 1px solid rgba(8, 126, 139, 0.12);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 45px rgba(18, 63, 78, 0.11);
}

.preview-role-card-main {
    width: min(74%, 300px);
    padding: 22px;
}

.preview-role-card-main > span {
    display: inline-flex;
    width: 35px;
    height: 35px;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: #e7f8f4;
    color: var(--hm-ocean);
}

.preview-role-card-main > span svg {
    width: 17px;
}

.preview-role-card small,
.preview-role-card strong,
.preview-role-card em {
    display: block;
}

.preview-role-card small {
    margin-top: 19px;
    color: #86a1a7;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 1px;
}

.preview-role-card strong {
    margin-top: 7px;
    color: var(--hm-text);
    font-size: 17px;
}

.preview-bars {
    height: 76px;
    display: flex;
    align-items: end;
    gap: 8px;
    margin: 20px 0 17px;
    border-bottom: 1px solid var(--hm-line);
}

.preview-bars i {
    flex: 1;
    border-radius: 4px 4px 0 0;
    background: linear-gradient(180deg, var(--hm-teal), #9be7dc);
}

.preview-role-card em {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--hm-ocean);
    font-size: 10px;
    font-style: normal;
    font-weight: 700;
}

.preview-role-card em svg {
    width: 13px;
}

.preview-role-card-float {
    position: absolute;
    right: 7%;
    bottom: 27px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 7px 10px;
    align-items: center;
    padding: 13px 16px;
}

.preview-role-card-float > svg {
    grid-row: span 2;
    width: 18px;
    color: var(--hm-ocean);
}

.preview-role-card-float span {
    color: var(--hm-soft-text);
    font-size: 9px;
}

.preview-role-card-float b {
    color: var(--hm-text);
    font-size: 16px;
}

.preview-role-copy h2 {
    max-width: 600px;
    margin: 0;
    color: var(--hm-deep);
    font-size: clamp(30px, 4vw, 50px);
    line-height: 1.08;
    letter-spacing: -2px;
}

.preview-role-list {
    display: grid;
    gap: 10px;
    margin-top: 30px;
}

.preview-role-list > div {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 13px 0;
    border-top: 1px solid var(--hm-line);
}

.preview-role-list > div > span {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: #e7f8f4;
    color: var(--hm-ocean);
}

.preview-role-list svg {
    width: 15px;
}

.preview-role-list p {
    margin: 0;
}

.preview-role-list b,
.preview-role-list small {
    display: block;
}

.preview-role-list b {
    color: var(--hm-text);
    font-size: 12px;
}

.preview-role-list small {
    margin-top: 4px;
    color: var(--hm-soft-text);
    font-size: 11px;
    line-height: 1.45;
}

.preview-trust {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.preview-trust-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
    align-self: center;
}

.preview-trust-grid > div {
    min-height: 125px;
    padding: 18px;
    border: 1px solid rgba(185, 243, 232, 0.15);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.045);
}

.preview-trust-grid svg {
    width: 18px;
    color: var(--hm-mint);
}

.preview-trust-grid b,
.preview-trust-grid span {
    display: block;
}

.preview-trust-grid b {
    margin-top: 19px;
    color: #fff;
    font-size: 12px;
}

.preview-trust-grid span {
    margin-top: 5px;
    color: #8eafb1;
    font-size: 10px;
    line-height: 1.45;
}

.preview-results {
    padding: 105px 0;
}

.preview-result-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-top: 45px;
}

.preview-result-grid > div {
    padding: 23px;
    border: 1px solid var(--hm-line);
    border-radius: 13px;
    background: #fff;
}

.preview-result-grid strong {
    color: var(--hm-teal);
    font-size: 12px;
}

.preview-result-grid h3 {
    margin: 25px 0 8px;
    color: var(--hm-text);
    font-size: 15px;
}

.preview-result-grid p {
    margin: 0;
    color: var(--hm-soft-text);
    font-size: 12px;
    line-height: 1.6;
}

.preview-faq {
    padding: 0 0 105px;
}

.preview-faq-list {
    max-width: 780px;
    margin-top: 42px;
    border-top: 1px solid var(--hm-line);
}

.preview-faq details {
    padding: 20px 0;
    border-bottom: 1px solid var(--hm-line);
}

.preview-faq summary {
    cursor: pointer;
    color: var(--hm-text);
    font-size: 14px;
    font-weight: 800;
}

.preview-faq details p {
    max-width: 680px;
    margin: 12px 0 0;
    color: var(--hm-soft-text);
    font-size: 12px;
    line-height: 1.7;
}

@media (max-width: 900px) {
    .preview-steps,
    .preview-result-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .preview-roles {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .preview-workflow,
    .preview-roles,
    .preview-results,
    .preview-faq {
        width: min(100% - 28px, 1180px);
    }

    .preview-steps,
    .preview-result-grid,
    .preview-trust-grid {
        grid-template-columns: 1fr;
    }

    .preview-roles,
    .preview-results {
        padding: 70px 0;
    }

    .preview-role-card-main {
        width: 72%;
    }

    .preview-trust {
        grid-template-columns: 1fr;
    }

    .preview-faq {
        padding-bottom: 70px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

/* Final dashboard polish */
.sidebar-backdrop {
    display: none;
    border: 0;
    margin: 0;
    padding: 0;
}

.page.active {
    animation: pageEnter 0.24s ease-out;
}

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

.profile {
    min-height: 42px;
    padding: 3px 6px 3px 3px;
    border-radius: 24px;
    transition: background 0.2s ease;
}

.profile:hover {
    background: #f1f5f9;
}

.dropdown {
    top: calc(100% + 10px);
    right: 0;
    border-color: var(--hm-border);
}

.dropdown-item {
    min-height: 40px;
    display: flex;
    align-items: center;
    transition: background 0.15s ease, padding-left 0.15s ease;
}

.dropdown-item:hover {
    padding-left: 19px !important;
    background: #f0fdfa;
}

.footer {
    background: #0b2948;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-section h4 {
    color: #a7f3d0;
}

.footer-bottom {
    border-top-color: rgba(255, 255, 255, 0.14);
}

/* Consistent scrollbars for long lists and chat panels. */
* {
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 transparent;
}

@media (max-width: 900px) {
    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1050;
        display: block;
        visibility: hidden;
        opacity: 0;
        background: rgba(15, 23, 42, 0.42);
        transition: opacity 0.25s ease, visibility 0.25s ease;
        pointer-events: none;
    }

    body.sidebar-open .sidebar-backdrop {
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
    }

    body.sidebar-open {
        overflow: hidden;
    }
}

/* =========================================================
   HULIMO VISUAL REDESIGN
   ========================================================= */
:root {
    --hm-deep: #061c2c;
    --hm-navy: #0b3048;
    --hm-ocean: #087e8b;
    --hm-teal: #16b8a6;
    --hm-mint: #b9f3e8;
    --hm-cream: #f7fbfa;
    --hm-panel: rgba(255, 255, 255, 0.88);
    --hm-line: #dceae9;
    --hm-text: #173042;
    --hm-soft-text: #6b8490;
    --hm-shadow: 0 18px 45px rgba(18, 63, 78, 0.09);
}

body {
    background:
        radial-gradient(circle at 80% -10%, rgba(22, 184, 166, 0.15), transparent 33rem),
        radial-gradient(circle at -5% 40%, rgba(8, 126, 139, 0.08), transparent 30rem),
        var(--hm-cream);
    color: var(--hm-text);
}

.wrapper {
    background: transparent;
}

.sidebar {
    width: 272px;
    flex-basis: 272px;
    padding: 28px 17px;
    background:
        linear-gradient(180deg, rgba(6, 28, 44, 0.99), rgba(11, 48, 72, 0.99)),
        radial-gradient(circle at 20% 0, rgba(22, 184, 166, 0.28), transparent 18rem);
    box-shadow: 12px 0 35px rgba(6, 28, 44, 0.12);
}

.sidebar h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 12px 36px;
    color: #fff;
    font-size: 24px;
    letter-spacing: -0.8px;
}

.sidebar h2::after {
    content: "ADMIN";
    margin-left: auto;
    padding: 4px 7px;
    border: 1px solid rgba(185, 243, 232, 0.25);
    border-radius: 6px;
    color: var(--hm-mint);
    font-size: 8px;
    letter-spacing: 1.2px;
}

.sidebar ul {
    position: relative;
}

.sidebar ul::before {
    content: "WORKSPACE";
    display: block;
    margin: 0 14px 11px;
    color: rgba(185, 243, 232, 0.55);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.5px;
}

.sidebar li {
    min-height: 46px;
    margin: 5px 0;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-left: 3px solid transparent;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.68);
    font-size: 12.5px;
    letter-spacing: 0.05px;
}

.sidebar li:hover {
    border-color: rgba(185, 243, 232, 0.12);
    border-left-color: var(--hm-teal);
    background: rgba(255, 255, 255, 0.075);
    color: #fff;
}

.sidebar li.active {
    border-color: rgba(185, 243, 232, 0.18);
    border-left-color: var(--hm-teal);
    background: linear-gradient(90deg, rgba(22, 184, 166, 0.24), rgba(22, 184, 166, 0.04));
    color: #fff;
    box-shadow: inset 0 0 20px rgba(22, 184, 166, 0.06);
}

.sidebar li i {
    color: var(--hm-mint) !important;
}

.main {
    background: transparent;
}

.topbar {
    position: sticky;
    top: 0;
    min-height: 82px;
    padding: 16px clamp(18px, 3vw, 42px);
    border-bottom: 1px solid rgba(220, 234, 233, 0.8);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 7px 28px rgba(18, 63, 78, 0.06);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.topbar h2 {
    color: var(--hm-text);
    font-size: clamp(15px, 1.7vw, 20px);
    font-weight: 800;
}

.mobile-nav-toggle {
    border-color: var(--hm-line);
    color: var(--hm-ocean);
    box-shadow: 0 5px 14px rgba(18, 63, 78, 0.08);
}

.page {
    max-width: 1660px;
    padding: clamp(20px, 3vw, 42px);
}

.page > h2,
.page > h3 {
    color: var(--hm-text);
    letter-spacing: -0.45px;
}

.page > h2 {
    margin-top: 0;
    font-size: 25px;
}

.card-box,
.list-box,
.tx-kpi-card,
.tx-season-card,
.catch-card {
    border: 1px solid var(--hm-line);
    border-radius: 17px;
    box-shadow: var(--hm-shadow);
}

.list-box {
    overflow: hidden;
    background: var(--hm-panel);
}

.list-box-header {
    min-height: 70px;
    padding: 18px 23px;
    background: linear-gradient(90deg, #fff, #f5fbfa);
    border-bottom: 1px solid var(--hm-line);
}

.list-box-header h3 {
    color: var(--hm-text);
    font-size: 16px;
}

.list-box-content {
    padding: 23px;
}

.card,
.blue,
.green,
.orange,
.red {
    border-radius: 17px;
    box-shadow: 0 14px 28px rgba(18, 63, 78, 0.1);
}

button,
.btn {
    border-radius: 9px;
    font-weight: 700;
}

.btn,
.auth-container button {
    background: linear-gradient(135deg, var(--hm-ocean), var(--hm-navy));
    box-shadow: 0 8px 16px rgba(8, 126, 139, 0.18);
}

.btn:hover,
.auth-container button:hover {
    background: linear-gradient(135deg, var(--hm-teal), var(--hm-ocean));
    box-shadow: 0 10px 20px rgba(8, 126, 139, 0.25);
}

table {
    border: 1px solid var(--hm-line);
    border-radius: 13px;
    box-shadow: 0 8px 22px rgba(18, 63, 78, 0.05);
}

th {
    background: var(--hm-navy);
    color: #d9fff7;
    font-size: 10px;
    letter-spacing: 0.8px;
}

th, td {
    padding: 13px 14px;
}

tbody tr {
    transition: background 0.16s ease, transform 0.16s ease;
}

tbody tr:hover {
    background: #effbf9;
}

.catch-card:hover,
.tx-kpi-card:hover,
.card-box:hover {
    border-color: rgba(22, 184, 166, 0.42);
    box-shadow: 0 20px 38px rgba(18, 63, 78, 0.13);
}

.modal-content,
.tx-modal-content {
    border: 1px solid var(--hm-line);
    box-shadow: 0 25px 80px rgba(6, 28, 44, 0.24);
}

.footer {
    background: linear-gradient(135deg, #061c2c, #0b3048);
    padding: 34px clamp(24px, 4vw, 54px);
}

.footer-section h4 {
    color: var(--hm-mint);
    font-size: 13px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

/* Auth redesign */
.auth-body {
    position: relative;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 12% 14%, rgba(185, 243, 232, 0.25), transparent 22rem),
        radial-gradient(circle at 90% 88%, rgba(22, 184, 166, 0.3), transparent 25rem),
        linear-gradient(135deg, #061c2c, #087e8b);
}

.auth-body::before,
.auth-body::after {
    position: fixed;
    content: "";
    width: 320px;
    height: 320px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    pointer-events: none;
}

.auth-body::before {
    top: -160px;
    right: -70px;
}

.auth-body::after {
    bottom: -190px;
    left: -90px;
}

.auth-container {
    position: relative;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 28px 80px rgba(3, 22, 35, 0.34);
}

.auth-container::before {
    content: "HULIMO | FISHPORT OPERATIONS";
    display: block;
    margin-bottom: 18px;
    color: var(--hm-ocean);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.8px;
}

.auth-container h2 {
    color: var(--hm-text);
    letter-spacing: -0.5px;
}

.auth-container input:not([type="checkbox"]):not([type="file"]):focus {
    border-color: var(--hm-teal);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(22, 184, 166, 0.12);
}

@media (max-width: 900px) {
    .sidebar {
        width: min(88vw, 310px);
        flex-basis: auto;
    }
}

@media (max-width: 600px) {
    .topbar {
        min-height: 68px;
    }

    .page > h2 {
        font-size: 21px;
    }

    .list-box-header,
    .list-box-content {
        padding: 16px;
    }
}

/* Final theme and layout guardrails. Keep this block last so legacy inline styles
   cannot make dark-mode text disappear or break translated labels. */
.dashboard-stats-grid {
    align-items: stretch;
}

.dashboard-stat-card {
    min-height: 136px;
}

.dashboard-stat-card > div:first-child,
.dashboard-action-card,
.dashboard-panel,
.chat-conversation-panel,
.chat-active-header > div:first-child,
.chat-active-header > div:first-child > div {
    min-width: 0;
}

.dashboard-action-card > div,
.dashboard-stat-card span,
.dashboard-panel h3,
.chat-active-header h4,
.chat-active-header span {
    overflow-wrap: anywhere;
}

.chat-composer-row input {
    min-width: 80px;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
textarea,
select {
    color-scheme: light;
    color: #111827 !important;
    -webkit-text-fill-color: #111827;
    background: #ffffff !important;
}

html[data-theme="dark"] .dashboard-stat-card,
html[data-theme="dark"] .dashboard-panel,
html[data-theme="dark"] .dashboard-action-card,
html[data-theme="dark"] .chat-shell,
html[data-theme="dark"] .chat-user-panel,
html[data-theme="dark"] .chat-search-panel,
html[data-theme="dark"] .chat-conversation-panel,
html[data-theme="dark"] .chat-active-header,
html[data-theme="dark"] #chatMessagesThread,
html[data-theme="dark"] .chat-composer,
html[data-theme="dark"] .chat-attachment-preview {
    background: #0c2735 !important;
    border-color: #315164 !important;
    color: #e6f4f4 !important;
}

html[data-theme="dark"] .dashboard-stat-card h1,
html[data-theme="dark"] .dashboard-stat-card h2,
html[data-theme="dark"] .dashboard-stat-card h3,
html[data-theme="dark"] .dashboard-stat-card div,
html[data-theme="dark"] .dashboard-panel h1,
html[data-theme="dark"] .dashboard-panel h2,
html[data-theme="dark"] .dashboard-panel h3,
html[data-theme="dark"] .dashboard-action-card div,
html[data-theme="dark"] .chat-active-header h4,
html[data-theme="dark"] .chat-active-header div,
html[data-theme="dark"] .chat-user-item strong {
    color: #e6f4f4 !important;
}

html[data-theme="dark"] .dashboard-stat-card span:not([style*="color: #3182ce"]):not([style*="color: #38a169"]):not([style*="color: #805ad5"]):not([style*="color: #e53e3e"]),
html[data-theme="dark"] .dashboard-action-card div:last-child,
html[data-theme="dark"] .chat-user-item div,
html[data-theme="dark"] .chat-active-header span {
    color: #a8bdc5 !important;
}

html[data-theme="dark"] .page [style*="background: white"],
html[data-theme="dark"] .page [style*="background:white"],
html[data-theme="dark"] .page [style*="background: #fff"],
html[data-theme="dark"] .page [style*="background:#fff"],
html[data-theme="dark"] .page [style*="background: #ffffff"],
html[data-theme="dark"] .page [style*="background:#ffffff"],
html[data-theme="dark"] .page [style*="background: #f8fafc"],
html[data-theme="dark"] .page [style*="background:#f8fafc"] {
    background: #0c2735 !important;
    border-color: #315164 !important;
}

html[data-theme="dark"] .page [style*="color: #2d3748"],
html[data-theme="dark"] .page [style*="color:#2d3748"],
html[data-theme="dark"] .page [style*="color: #1e293b"],
html[data-theme="dark"] .page [style*="color:#1e293b"],
html[data-theme="dark"] .page [style*="color: #1e3c72"],
html[data-theme="dark"] .page [style*="color:#1e3c72"],
html[data-theme="dark"] .page [style*="color: #334155"],
html[data-theme="dark"] .page [style*="color:#334155"],
html[data-theme="dark"] .page [style*="color: #4a5568"],
html[data-theme="dark"] .page [style*="color:#4a5568"] {
    color: #e6f4f4 !important;
}

html[data-theme="dark"] .page [style*="color: #718096"],
html[data-theme="dark"] .page [style*="color:#718096"],
html[data-theme="dark"] .page [style*="color: #64748b"],
html[data-theme="dark"] .page [style*="color:#64748b"],
html[data-theme="dark"] .page [style*="color: #94a3b8"],
html[data-theme="dark"] .page [style*="color:#94a3b8"],
html[data-theme="dark"] .page [style*="color: #a0aec0"],
html[data-theme="dark"] .page [style*="color:#a0aec0"] {
    color: #a8bdc5 !important;
}

html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
    color-scheme: light;
    color: #111827 !important;
    -webkit-text-fill-color: #111827;
    background: #ffffff !important;
    border-color: #78909c !important;
}

@media (max-width: 720px) {
    .dashboard-stats-grid {
        grid-template-columns: 1fr !important;
    }

    .dashboard-overview-grid {
        display: grid !important;
        grid-template-columns: 1fr;
    }

    .dashboard-panel {
        min-width: 0 !important;
        width: 100%;
    }

    .dashboard-panel > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    .chat-composer-row {
        align-items: flex-end;
        flex-wrap: wrap;
    }

    .chat-composer-row #chatMessageInput {
        flex: 1 1 calc(100% - 54px) !important;
    }

    .chat-send-button {
        width: 100%;
    }

    .chat-attachment-preview {
        margin-left: 0;
    }
}

/* Public and manual display controls share the same saved language/theme. */
.preview-settings,
.manual-settings {
    position: static;
    flex: 0 0 auto;
}

.preview-settings button,
.manual-settings button {
    margin: 0;
}

.manual-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

html[data-theme="dark"] .preview-body {
    background: #051722;
    color: #e6f4f4;
}

html[data-theme="dark"] .preview-login,
html[data-theme="dark"] .preview-window,
html[data-theme="dark"] .preview-result-grid > div,
html[data-theme="dark"] .preview-faq details {
    background: #0c2735;
    border-color: #315164;
}

html[data-theme="dark"] .preview-brand,
html[data-theme="dark"] .preview-links a:not(.preview-primary),
html[data-theme="dark"] .preview-result-grid h3,
html[data-theme="dark"] .preview-faq summary {
    color: #e6f4f4 !important;
}

html[data-theme="dark"] .preview-result-grid p,
html[data-theme="dark"] .preview-faq details p,
html[data-theme="dark"] .preview-section-heading > p:not(.eyebrow) {
    color: #a8bdc5;
}

@media (max-width: 760px) {
    .preview-nav,
    .preview-links,
    .manual-header-actions {
        flex-wrap: wrap;
    }

    .preview-links {
        gap: 10px;
        justify-content: flex-end;
    }
}

/* Keep every modal inside one viewport-sized overlay with no duplicate-looking
   panel leaking below the active dialog. */
.modal {
    overflow-y: auto;
    overscroll-behavior: contain;
    box-sizing: border-box;
    padding: 16px;
}

.modal > .modal-content {
    max-width: min(95%, 960px);
    box-sizing: border-box;
}

#historyModal .modal-content {
    display: flex;
    flex-direction: column;
    width: min(960px, 100%) !important;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    margin: 0 auto !important;
}

#historyModal .modal-body {
    min-height: 0;
    overflow: auto;
}

#historyModal .modal-content > :last-child {
    flex: 0 0 auto;
}

/* Shared, reversible theme contract for every page and dynamically opened dialog. */
html:root {
    --hm-deep: #061c2c; --hm-navy: #0b3048; --hm-ocean: #087e8b;
    --hm-teal: #16b8a6; --hm-mint: #b9f3e8;
    --hm-cream: #f4f8fa; --hm-panel: #ffffff; --hm-line: #d7e3e9;
    --hm-text: #173042; --hm-soft-text: #526b79;
    --hm-shadow: 0 8px 28px rgb(18 63 78 / 8%);
    color-scheme: light;
}
html[data-theme="dark"] {
    --hm-cream: #081b28; --hm-panel: #102c3c; --hm-line: #355363;
    --hm-text: #edf6fa; --hm-soft-text: #b6cbd5;
    --hm-shadow: 0 8px 28px rgb(0 0 0 / 22%);
    color-scheme: dark;
}
html body, html .main { color: var(--hm-text); }
html :is(.topbar,.list-box,.list-box-header,.list-box-content,.catch-card,
.card-box,.tx-kpi-card,.tx-season-card,.modal-content,.tx-modal-content,
.dropdown,.guide-card,.dashboard-stat-card,.dashboard-panel,.dashboard-action-card,
.auth-container,.preview-window,.preview-faq details,.manual-grid article) {
    color: var(--hm-text); background-color: var(--hm-panel);
    border-color: var(--hm-line); border-radius: 16px;
}
html :is(.page,.modal-content,.tx-modal-content,.auth-container,.manual-grid article) :is(h1,h2,h3,h4,label) {
    color: var(--hm-text);
}
html :is(.auth-subtitle,.auth-footer,.remember-option,.manual-grid p) { color: var(--hm-soft-text); }
html input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
html textarea, html select,
html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
html[data-theme="dark"] textarea, html[data-theme="dark"] select {
    color-scheme: inherit; color: var(--hm-text) !important;
    -webkit-text-fill-color: currentColor;
    background: var(--hm-panel) !important; border-color: var(--hm-line) !important;
    caret-color: var(--hm-text); font: inherit; min-height: 44px;
}
html input::placeholder, html textarea::placeholder {
    color: var(--hm-soft-text); -webkit-text-fill-color: var(--hm-soft-text); opacity: 1;
}
html input:autofill { -webkit-text-fill-color: var(--hm-text); box-shadow: 0 0 0 1000px var(--hm-panel) inset; }
html :is(button,a,input,select,textarea):focus-visible { outline: 3px solid #27a6ba; outline-offset: 3px; }
html :is(.main,.page,.dashboard-panel,.dashboard-stat-card,.chat-conversation-panel) { min-width: 0; }
html .topbar { align-items: center; gap: 16px; }
html :is(.topbar-settings,.list-box-header,.manual-header-actions) { align-items: center; gap: 12px; flex-wrap: wrap; }
html :is(.dashboard-stat-card,.dashboard-panel,.dashboard-action-card) { box-sizing: border-box; }
html .dashboard-stats-grid { align-items: stretch; }
html .dashboard-stat-card { padding: 22px !important; }
html table { border-collapse: collapse; font-variant-numeric: tabular-nums; }
html th, html td { vertical-align: middle; line-height: 1.5; }
html .auth-container { width: min(440px, calc(100% - 32px)); box-sizing: border-box; box-shadow: var(--hm-shadow); }
html .auth-settings button, html .topbar-setting-button { min-height: 44px; min-width: 44px; }
@media (max-width: 760px) {
    html .topbar { flex-wrap: wrap; padding: 16px; }
    html .page { padding: 16px; }
    html .dashboard-stats-grid { grid-template-columns: 1fr !important; }
    html :is(.list-box-content,.table-container,.table-responsive) { overflow-x: auto; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* Theme-aware controls and semantic text; both themes reset every property. */
html :is(.auth-settings button,.topbar-setting-button) {
    background: var(--hm-panel) !important; color: var(--hm-text) !important;
    border: 1px solid var(--hm-line); border-radius: 12px;
}
html :is(.auth-settings button,.topbar-setting-button) * { color: inherit !important; }
html :is(.chat-user-time,.chat-user-last-msg,.tx-kpi-card .label,.tx-kpi-card small) { color: var(--hm-soft-text) !important; }
html .btn-unravel { color: #155e89 !important; background: #e4f2fc !important; }
html .approve { background: #18764e !important; color: white !important; }
html .reject { background: #b42335 !important; color: white !important; }
html #login_history th { background: #176442 !important; color: white !important; }
html .roi-badge { color: var(--hm-text); }
html .preview-body :is(h1,h2) { color: var(--hm-text); }
html .preview-body :is(p,small), html .preview-links a:not(.preview-primary) { color: var(--hm-soft-text); }
html .preview-body .eyebrow, html .manual-header > div > span { color: #08717e; }
html .preview-result-grid strong, html .preview-workflow-grid b { color: #08717e; }
html[data-theme="dark"] .preview-body :is(.eyebrow,.preview-secondary),
html[data-theme="dark"] .manual-header > div > span { color: #6dd8df; }
html[data-theme="dark"] .preview-body :is(h3,b,strong) { color: var(--hm-text); }
html[data-theme="dark"] .preview-body :is(p,small) { color: var(--hm-soft-text); }
html[data-theme="dark"] .auth-footer a { color: #9cdbf5 !important; }

html[data-theme="light"] :is(.page,.modal,.tx-modal,.auth-container) [style*="color: #718096"],
html[data-theme="light"] :is(.page,.modal,.tx-modal,.auth-container) [style*="color:#718096"],
html[data-theme="light"] :is(.page,.modal,.tx-modal,.auth-container) [style*="color: #94a3b8"],
html[data-theme="light"] :is(.page,.modal,.tx-modal,.auth-container) [style*="color:#94a3b8"],
html[data-theme="light"] :is(.page,.modal,.tx-modal,.auth-container) [style*="color: #a0aec0"],
html[data-theme="light"] :is(.page,.modal,.tx-modal,.auth-container) [style*="color:#a0aec0"],
html[data-theme="light"] :is(.page,.modal,.tx-modal,.auth-container) [style*="color: #6b8490"],
html[data-theme="light"] :is(.page,.modal,.tx-modal,.auth-container) [style*="color:#6b8490"] { color: var(--hm-soft-text) !important; }

html[data-theme="dark"] :is(.page,.modal,.tx-modal,.auth-container) [style*="color: #718096"],
html[data-theme="dark"] :is(.page,.modal,.tx-modal,.auth-container) [style*="color:#718096"],
html[data-theme="dark"] :is(.page,.modal,.tx-modal,.auth-container) [style*="color: #94a3b8"],
html[data-theme="dark"] :is(.page,.modal,.tx-modal,.auth-container) [style*="color:#94a3b8"],
html[data-theme="dark"] :is(.page,.modal,.tx-modal,.auth-container) [style*="color: #a0aec0"],
html[data-theme="dark"] :is(.page,.modal,.tx-modal,.auth-container) [style*="color:#a0aec0"],
html[data-theme="dark"] :is(.page,.modal,.tx-modal,.auth-container) [style*="color: #6b8490"],
html[data-theme="dark"] :is(.page,.modal,.tx-modal,.auth-container) [style*="color:#6b8490"],
html[data-theme="dark"] :is(.page,.modal,.tx-modal,.auth-container) [style*="color: #64748b"],
html[data-theme="dark"] :is(.page,.modal,.tx-modal,.auth-container) [style*="color:#64748b"],
html[data-theme="dark"] :is(.page,.modal,.tx-modal,.auth-container) [style*="color: #2d3748"],
html[data-theme="dark"] :is(.page,.modal,.tx-modal,.auth-container) [style*="color:#2d3748"],
html[data-theme="dark"] :is(.page,.modal,.tx-modal,.auth-container) [style*="color: #1e293b"],
html[data-theme="dark"] :is(.page,.modal,.tx-modal,.auth-container) [style*="color:#1e293b"],
html[data-theme="dark"] :is(.page,.modal,.tx-modal,.auth-container) [style*="color: #1e3c72"],
html[data-theme="dark"] :is(.page,.modal,.tx-modal,.auth-container) [style*="color:#1e3c72"],
html[data-theme="dark"] :is(.page,.modal,.tx-modal,.auth-container) [style*="color: #334155"],
html[data-theme="dark"] :is(.page,.modal,.tx-modal,.auth-container) [style*="color:#334155"],
html[data-theme="dark"] :is(.page,.modal,.tx-modal,.auth-container) [style*="color: #4a5568"],
html[data-theme="dark"] :is(.page,.modal,.tx-modal,.auth-container) [style*="color:#4a5568"],
html[data-theme="dark"] :is(.page,.modal,.tx-modal,.auth-container) [style*="color: #0f172a"],
html[data-theme="dark"] :is(.page,.modal,.tx-modal,.auth-container) [style*="color:#0f172a"],
html[data-theme="dark"] :is(.page,.modal,.tx-modal,.auth-container) [style*="color: #173042"],
html[data-theme="dark"] :is(.page,.modal,.tx-modal,.auth-container) [style*="color:#173042"] { color: var(--hm-soft-text) !important; }

html[data-theme="dark"] :is(.page,.modal,.tx-modal) [style*="background:#fff"],
html[data-theme="dark"] :is(.page,.modal,.tx-modal) [style*="background: #fff"],
html[data-theme="dark"] :is(.page,.modal,.tx-modal) [style*="background-color:#fff"],
html[data-theme="dark"] :is(.page,.modal,.tx-modal) [style*="background-color: #fff"] { background: var(--hm-panel) !important; border-color: var(--hm-line) !important; }

html[data-theme="dark"] :is(.page,.modal,.tx-modal) [style*="background:#ffffff"],
html[data-theme="dark"] :is(.page,.modal,.tx-modal) [style*="background: #ffffff"],
html[data-theme="dark"] :is(.page,.modal,.tx-modal) [style*="background-color:#ffffff"],
html[data-theme="dark"] :is(.page,.modal,.tx-modal) [style*="background-color: #ffffff"] { background: var(--hm-panel) !important; border-color: var(--hm-line) !important; }

html[data-theme="dark"] :is(.page,.modal,.tx-modal) [style*="background:#f8fafc"],
html[data-theme="dark"] :is(.page,.modal,.tx-modal) [style*="background: #f8fafc"],
html[data-theme="dark"] :is(.page,.modal,.tx-modal) [style*="background-color:#f8fafc"],
html[data-theme="dark"] :is(.page,.modal,.tx-modal) [style*="background-color: #f8fafc"] { background: var(--hm-panel) !important; border-color: var(--hm-line) !important; }

html[data-theme="dark"] :is(.page,.modal,.tx-modal) [style*="background:#f1f5f9"],
html[data-theme="dark"] :is(.page,.modal,.tx-modal) [style*="background: #f1f5f9"],
html[data-theme="dark"] :is(.page,.modal,.tx-modal) [style*="background-color:#f1f5f9"],
html[data-theme="dark"] :is(.page,.modal,.tx-modal) [style*="background-color: #f1f5f9"] { background: var(--hm-panel) !important; border-color: var(--hm-line) !important; }

html[data-theme="dark"] :is(.page,.modal,.tx-modal) [style*="background:#f7fafc"],
html[data-theme="dark"] :is(.page,.modal,.tx-modal) [style*="background: #f7fafc"],
html[data-theme="dark"] :is(.page,.modal,.tx-modal) [style*="background-color:#f7fafc"],
html[data-theme="dark"] :is(.page,.modal,.tx-modal) [style*="background-color: #f7fafc"] { background: var(--hm-panel) !important; border-color: var(--hm-line) !important; }

html[data-theme="dark"] :is(.page,.modal,.tx-modal) [style*="background:white"],
html[data-theme="dark"] :is(.page,.modal,.tx-modal) [style*="background: white"],
html[data-theme="dark"] :is(.page,.modal,.tx-modal) [style*="background-color:white"],
html[data-theme="dark"] :is(.page,.modal,.tx-modal) [style*="background-color: white"] { background: var(--hm-panel) !important; border-color: var(--hm-line) !important; }

html[data-theme="light"] .page [style*="color: #3182ce"], html[data-theme="light"] .page [style*="color:#3182ce"] { color: #17649c !important; }

html[data-theme="dark"] .page [style*="color: #3182ce"], html[data-theme="dark"] .page [style*="color:#3182ce"] { color: #8aceff !important; }

html[data-theme="light"] .page [style*="color: #38a169"], html[data-theme="light"] .page [style*="color:#38a169"] { color: #187447 !important; }

html[data-theme="dark"] .page [style*="color: #38a169"], html[data-theme="dark"] .page [style*="color:#38a169"] { color: #85e3af !important; }

html[data-theme="light"] .page [style*="color: #e53e3e"], html[data-theme="light"] .page [style*="color:#e53e3e"] { color: #ba2635 !important; }

html[data-theme="dark"] .page [style*="color: #e53e3e"], html[data-theme="dark"] .page [style*="color:#e53e3e"] { color: #ffa4ad !important; }

html[data-theme="light"] .page [style*="color: #0284c7"], html[data-theme="light"] .page [style*="color:#0284c7"] { color: #036b9f !important; }

html[data-theme="dark"] .page [style*="color: #0284c7"], html[data-theme="dark"] .page [style*="color:#0284c7"] { color: #8aceff !important; }

html[data-theme="light"] .page [style*="color: #16a34a"], html[data-theme="light"] .page [style*="color:#16a34a"] { color: #187447 !important; }

html[data-theme="dark"] .page [style*="color: #16a34a"], html[data-theme="dark"] .page [style*="color:#16a34a"] { color: #85e3af !important; }

html[data-theme="light"] .page [style*="color: #dc2626"], html[data-theme="light"] .page [style*="color:#dc2626"] { color: #ba2635 !important; }

html[data-theme="dark"] .page [style*="color: #dc2626"], html[data-theme="dark"] .page [style*="color:#dc2626"] { color: #ffa4ad !important; }

html[data-theme="light"] .page [style*="color: #9a3412"], html[data-theme="light"] .page [style*="color:#9a3412"] { color: #9a3412 !important; }

html[data-theme="dark"] .page [style*="color: #9a3412"], html[data-theme="dark"] .page [style*="color:#9a3412"] { color: #ffc69e !important; }

html .page button[style*="background: #ef4444"] { background: #b42335 !important; }
html .page button[style*="background: #0284c7"] { background: #036b9f !important; }
html .profit-text { color: #187447; }
html[data-theme="dark"] .profit-text { color: #85e3af !important; }
/* Public preview surfaces follow the same theme as the working application. */
html[data-theme="dark"] :is(.preview-window-bar,.preview-mini-content,.preview-mini-grid > div,
.preview-mini-table,.preview-capabilities,.preview-feature,.preview-step,.preview-role-card) {
    background: var(--hm-panel) !important; border-color: var(--hm-line) !important;
}
html .preview-body .preview-mini-banner small { color: #b9e7ea; }
html .preview-body .preview-mini-banner strong { color: white; }
html .preview-body .preview-trust :is(.eyebrow,h2) { color: #d5f5f3; }
html .preview-step > b { color: #08717e; }
html[data-theme="dark"] .preview-step > b { color: #6dd8df; }
html[data-theme="dark"] .auth-brand { color: #6dd8df; }
html[data-theme="dark"] .auth-container > :is(h1,.logo),
html[data-theme="dark"] .auth-container .brand-name { color: #6dd8df; }
html .catch-card :is(.catch-date,.date,.submitted-date) { color: var(--hm-soft-text); }
html[data-theme="dark"] .page [style*="color: #805ad5"] { color: #c6b1ff !important; }
html .catch-info > span { color: var(--hm-soft-text) !important; }
html[data-theme="dark"] :is(.tx-admin-review-box,.tx-admin-review-header) { background: var(--hm-panel) !important; border-color: var(--hm-line); }
html[data-theme="dark"] .preview-body em { color: #6dd8df; }

/* Bound the conversation so flex children scroll instead of stretching the page. */
html .chat-shell { height: min(680px, 80dvh) !important; min-height: 360px; }
html .chat-conversation-panel { min-height: 0 !important; overflow: hidden; }
html #chatMessagesThread { min-height: 0; overflow-y: auto !important; overscroll-behavior-y: contain; overflow-anchor: none; }
html #chatMessagesThread > * { flex-shrink: 0; }
html :is(.chat-active-header,.chat-composer) { flex-shrink: 0; }
@media (max-width: 820px) {
    html .chat-shell { height: 80dvh !important; min-height: 480px; }
    html .chat-user-panel { flex: 0 0 150px !important; min-height: 0; overflow-y: auto; }
    html .chat-conversation-panel { flex: 1 1 0 !important; }
}

/* Professional finish: restrained surfaces, consistent hierarchy and spacing. */
html body { font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
html .main { background: var(--hm-cream); }
html .sidebar { box-sizing: border-box; box-shadow: none; }
html .sidebar li { font-size: 13px; font-weight: 500; min-height: 44px; }
html .sidebar li:hover { transform: none; }
html .sidebar li.active { font-weight: 600; }
html .topbar { padding: 18px 28px; box-shadow: none; border-bottom: 1px solid var(--hm-line); border-radius: 0; }
html .topbar h2 { font-size: 20px; letter-spacing: -.5px; margin: 0; }
html .page { padding: 28px; }
html .page > h2 { font-size: 26px; line-height: 1.25; letter-spacing: -.7px; margin: 0 0 24px; }
html :is(.dashboard-stat-card,.dashboard-panel,.list-box,.tx-kpi-card,.catch-card,.guide-card) {
    border: 1px solid var(--hm-line); border-radius: 14px; box-shadow: 0 3px 12px rgb(8 30 44 / 4%);
}
html .dashboard-stats-grid { gap: 18px !important; }
html .dashboard-stat-card { padding: 24px !important; }
html :is(.dashboard-stat-card h2,.dashboard-stat-card h3) { letter-spacing: -.8px; font-variant-numeric: tabular-nums; }
html .dashboard-panel { padding: 24px !important; }
html .dashboard-action-card { border-radius: 12px; box-shadow: none; }
html .list-box-header { padding: 18px 20px; border-bottom: 1px solid var(--hm-line); }
html th { padding: 13px 16px; font-size: 11px; font-weight: 700; letter-spacing: .5px; }
html td { padding: 15px 16px; font-size: 13px; border-bottom: 1px solid var(--hm-line); }
html :is(.btn,.approve,.reject,.btn-unravel,.chat-send-button) { border-radius: 9px; font-weight: 600; letter-spacing: 0; box-shadow: none; }
html :is(input:not([type=checkbox]):not([type=radio]),select,textarea) { border-radius: 10px; border-width: 1px; }
html .auth-container { padding: 36px; border: 1px solid var(--hm-line); border-radius: 20px; }
html .auth-container h2 { font-size: 26px; letter-spacing: -.7px; margin-bottom: 10px; }
html .auth-brand { margin-bottom: 26px; }
html .auth-subtitle { line-height: 1.65; }
html .auth-container button[type=submit] { min-height: 48px; border-radius: 10px; font-weight: 600; }
html .chat-shell { box-shadow: 0 4px 18px rgb(8 30 44 / 5%) !important; }
html .chat-active-header { padding: 16px 20px !important; border-bottom: 1px solid var(--hm-line); }
html .chat-composer { padding: 14px 16px; border-top: 1px solid var(--hm-line); }
html .chat-bubble { line-height: 1.6; overflow-wrap: anywhere; }
html .chat-time { color: var(--hm-soft-text) !important; }
html :is(.preview-feature,.preview-step,.preview-result-grid > div) { border-radius: 16px; }
@media(max-width:760px) {
 html .page { padding: 16px; }
 html .topbar { padding: 16px; }
 html .auth-container { padding: 26px 22px; }
 html .dashboard-panel { padding: 18px !important; }
 html .page > h2 { font-size: 23px; }
}
html[data-theme="light"] .page [style*="color: #64748b"],
html[data-theme="light"] .page [style*="color:#64748b"] { color: var(--hm-soft-text) !important; }
html #dashboard > div:first-child h1 { color: #ffffff !important; }
html #dashboard > div:first-child [style*="color: #a0aec0"] { color: #d6e8ff !important; }

/* =========================================================
   HULIMO PRODUCT UI POLISH — 2026-09-15
   Presentation-only guardrail layer. Keep last.
   ========================================================= */
:root {
    --hm-navy: #0d3857;
    --hm-blue: #0c7280;
    --hm-ocean: #0f7f8b;
    --hm-teal: #1996a5;
    --hm-cyan: #43c6bf;
    --hm-mint: #9be7df;
    --hm-deep: #071f2e;
    --hm-cream: #f6fafb;
    --hm-panel: #ffffff;
    --hm-line: #dce8ec;
    --hm-text: #123044;
    --hm-soft-text: #5c7480;
    --hm-success: #18744f;
    --hm-warning: #a75b12;
    --hm-danger: #b42335;
    --hm-focus: rgba(24, 154, 165, .34);
    --hm-shadow: 0 12px 34px rgba(9, 44, 62, .08);
    --hm-shadow-hover: 0 18px 42px rgba(9, 44, 62, .13);
    --hm-radius-sm: 10px;
    --hm-radius: 16px;
    --hm-radius-lg: 22px;
}

html[data-theme="dark"] {
    --hm-cream: #061923;
    --hm-panel: #0c2836;
    --hm-line: #294a59;
    --hm-text: #edf7f7;
    --hm-soft-text: #abc0c8;
    --hm-success: #8be0b6;
    --hm-warning: #ffd09f;
    --hm-danger: #ffadb8;
    --hm-focus: rgba(80, 205, 211, .42);
    --hm-shadow: 0 14px 38px rgba(0, 0, 0, .26);
    --hm-shadow-hover: 0 20px 46px rgba(0, 0, 0, .34);
    color-scheme: dark;
}

html, body { min-width: 0; }
body {
    background: var(--hm-cream) !important;
    color: var(--hm-text);
    font-size: 14px;
    line-height: 1.55;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(67, 198, 191, .28); }

.sidebar {
    width: 264px;
    flex-basis: 264px;
    padding: 26px 16px 22px;
    background: linear-gradient(180deg, #0d3857 0%, #082c46 58%, #071f2e 100%) !important;
    border-right: 1px solid rgba(255,255,255,.07);
}
.sidebar h2 { margin: 0 10px 28px; font-size: 21px; letter-spacing: -.45px; }
.sidebar li {
    position: relative;
    min-height: 46px;
    margin: 4px 0;
    padding: 11px 13px;
    border: 0 !important;
    border-radius: 11px;
    color: rgba(235, 248, 250, .76);
    font-weight: 560;
}
.sidebar li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 11px;
    bottom: 11px;
    width: 3px;
    border-radius: 3px;
    background: transparent;
}
.sidebar li:hover { background: rgba(255,255,255,.075) !important; color: #fff; }
.sidebar li.active {
    background: linear-gradient(90deg, rgba(67,198,191,.19), rgba(255,255,255,.075)) !important;
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(155,231,223,.1);
}
.sidebar li.active::before { background: #62d6ce; }
.sidebar li i { color: #8bdcd8 !important; }
.sidebar li:focus-visible { outline: 3px solid rgba(98,214,206,.36); outline-offset: 2px; }

.main { background: var(--hm-cream) !important; }
.topbar {
    min-height: 72px;
    padding: 14px clamp(16px, 2.7vw, 32px) !important;
    background: color-mix(in srgb, var(--hm-panel) 94%, transparent) !important;
    border-bottom: 1px solid var(--hm-line) !important;
    box-shadow: none !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
@media (min-width: 901px) {
    .topbar { position: sticky !important; top: 0; z-index: 80 !important; }
}
.topbar h2 { color: var(--hm-text) !important; font-weight: 760; letter-spacing: -.45px; }
.topbar-setting-button {
    min-height: 42px;
    border-color: var(--hm-line) !important;
    background: var(--hm-panel) !important;
    color: var(--hm-text) !important;
    box-shadow: none !important;
}
.topbar-setting-button:hover { border-color: rgba(15,127,139,.48) !important; background: rgba(25,150,165,.07) !important; }

.page { padding: clamp(18px, 2.6vw, 30px) !important; }
.page > h2 { color: var(--hm-text); font-weight: 760; letter-spacing: -.65px; }

.dashboard-hero {
    background:
        radial-gradient(circle at 88% 16%, rgba(120, 231, 222, .22), transparent 16rem),
        linear-gradient(135deg, #0d3857 0%, #0b5b6a 100%) !important;
    border: 1px solid rgba(255,255,255,.1) !important;
    border-radius: var(--hm-radius-lg) !important;
    box-shadow: 0 18px 46px rgba(13,56,87,.17) !important;
}
.dashboard-stat-card,
.dashboard-panel,
.dashboard-action-card,
.list-box,
.card-box,
.catch-card,
.tx-kpi-card,
.tx-season-card,
.guide-card,
.chat-shell,
.modal-content,
.tx-modal-content {
    background: var(--hm-panel) !important;
    border-color: var(--hm-line) !important;
    color: var(--hm-text) !important;
}
.dashboard-stat-card,
.dashboard-panel,
.list-box,
.card-box,
.catch-card,
.tx-kpi-card,
.tx-season-card,
.guide-card {
    border-radius: var(--hm-radius) !important;
    box-shadow: var(--hm-shadow) !important;
}
.dashboard-stat-card { min-height: 142px; padding: 22px !important; }
.dashboard-stat-card:hover { transform: translateY(-2px) !important; box-shadow: var(--hm-shadow-hover) !important; }
.dashboard-stat-card h2 { color: var(--hm-text) !important; font-size: 27px !important; }
.dashboard-stat-card > div:last-child { border-radius: 14px !important; }
.dashboard-panel { padding: clamp(18px, 2.4vw, 24px) !important; }
.dashboard-panel h3 { color: var(--hm-text) !important; }
.dashboard-action-card { min-height: 102px; padding: 16px !important; border-radius: 13px !important; box-shadow: none !important; }
.dashboard-action-card:hover { background: rgba(25,150,165,.055) !important; border-color: rgba(15,127,139,.42) !important; }

.list-box-header { background: var(--hm-panel); border-bottom: 1px solid var(--hm-line) !important; }
.list-box-content { background: var(--hm-panel); }
.hm-table-scroll { width: 100%; overflow-x: auto !important; overscroll-behavior-inline: contain; scrollbar-width: thin; }
table { border-color: var(--hm-line) !important; background: var(--hm-panel) !important; }
th {
    background: #0d3857 !important;
    color: #f7ffff !important;
    padding: 13px 15px !important;
    font-size: 10.5px !important;
    font-weight: 760 !important;
    letter-spacing: .055em !important;
    white-space: nowrap;
}
td { color: var(--hm-text) !important; border-bottom-color: var(--hm-line) !important; vertical-align: middle; }
tbody tr { transition: background .16s ease; }
tbody tr:hover { background: rgba(25,150,165,.055) !important; }

button, .btn, input, select, textarea { font: inherit; }
button, .btn, a.preview-primary, a.preview-secondary {
    min-height: 44px;
    border-radius: 10px;
    font-weight: 650;
}
button:not(:disabled):hover, .btn:not(:disabled):hover { transform: translateY(-1px); }
button:disabled, .btn:disabled { opacity: .56; cursor: not-allowed; transform: none !important; }
button:focus-visible, .btn:focus-visible, a:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
    outline: 3px solid var(--hm-focus) !important;
    outline-offset: 2px !important;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
textarea, select {
    min-height: 44px;
    border: 1px solid #c8d8df !important;
    border-radius: 10px !important;
    background: #fff !important;
    color: #102a3a !important;
    -webkit-text-fill-color: #102a3a !important;
    caret-color: #0c7280;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
input::placeholder, textarea::placeholder { color: #738995 !important; opacity: 1; }
input[aria-invalid="true"] { border-color: var(--hm-danger) !important; box-shadow: 0 0 0 3px rgba(180,35,53,.12); }

html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
    color-scheme: dark;
    background: #102f3e !important;
    border-color: #375b6b !important;
    color: #eef8f9 !important;
    -webkit-text-fill-color: #eef8f9 !important;
    caret-color: #72d9d3;
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color: #9db4be !important; }
html[data-theme="dark"] option { background: #102f3e; color: #eef8f9; }

.badge, .pending, .approved { border-radius: 999px !important; font-weight: 700; }
.modal, .tx-modal { backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal-content, .tx-modal-content { border-radius: 20px !important; box-shadow: 0 28px 70px rgba(2,21,32,.25) !important; }

.auth-body {
    background:
        radial-gradient(circle at 12% 18%, rgba(89,211,202,.28), transparent 22rem),
        radial-gradient(circle at 90% 88%, rgba(28,115,135,.28), transparent 24rem),
        linear-gradient(135deg, #071f2e 0%, #0d3857 48%, #0b6570 100%) !important;
}
.auth-container {
    width: min(100%, 430px) !important;
    background: color-mix(in srgb, var(--hm-panel) 96%, transparent) !important;
    border: 1px solid rgba(255,255,255,.2) !important;
    box-shadow: 0 28px 72px rgba(2,21,32,.34) !important;
}
.auth-container h2 { color: var(--hm-text) !important; font-weight: 780; }
.auth-subtitle, .auth-footer, .remember-option { color: var(--hm-soft-text) !important; }
.auth-container button[type="submit"] {
    background: linear-gradient(135deg, #0d3857, #0c7280) !important;
    color: #fff !important;
    box-shadow: 0 10px 24px rgba(12,114,128,.18);
}
.auth-settings button { min-width: 46px; min-height: 44px; border-radius: 11px; }

.preview-body { background: var(--hm-cream) !important; }
.preview-nav { min-height: 82px; }
.preview-window, .preview-feature, .preview-step, .preview-result-grid > div, .preview-faq details {
    border-color: var(--hm-line) !important;
    box-shadow: var(--hm-shadow);
}
.preview-primary { box-shadow: 0 10px 24px rgba(13,56,87,.14); }


html[data-theme="dark"] .dashboard-stat-card,
html[data-theme="dark"] .dashboard-panel,
html[data-theme="dark"] .dashboard-action-card,
html[data-theme="dark"] .list-box,
html[data-theme="dark"] .list-box-header,
html[data-theme="dark"] .list-box-content,
html[data-theme="dark"] .catch-card,
html[data-theme="dark"] .card-box,
html[data-theme="dark"] .tx-kpi-card,
html[data-theme="dark"] .tx-season-card,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .tx-modal-content,
html[data-theme="dark"] table,
html[data-theme="dark"] .dropdown,
html[data-theme="dark"] .guide-card {
    background: var(--hm-panel) !important;
    border-color: var(--hm-line) !important;
    color: var(--hm-text) !important;
}
html[data-theme="dark"] .page [style*="background: white"],
html[data-theme="dark"] .page [style*="background:white"],
html[data-theme="dark"] .page [style*="background: #fff"],
html[data-theme="dark"] .page [style*="background:#fff"],
html[data-theme="dark"] .page [style*="background: #ffffff"],
html[data-theme="dark"] .page [style*="background:#ffffff"],
html[data-theme="dark"] .page [style*="background: #f8fafc"],
html[data-theme="dark"] .page [style*="background:#f8fafc"] {
    background: var(--hm-panel) !important;
    border-color: var(--hm-line) !important;
}
html[data-theme="dark"] .page [style*="color: #2d3748"],
html[data-theme="dark"] .page [style*="color:#2d3748"],
html[data-theme="dark"] .page [style*="color: #1e293b"],
html[data-theme="dark"] .page [style*="color:#1e293b"],
html[data-theme="dark"] .page [style*="color: #334155"],
html[data-theme="dark"] .page [style*="color:#334155"],
html[data-theme="dark"] .page [style*="color: #4a5568"],
html[data-theme="dark"] .page [style*="color:#4a5568"] { color: var(--hm-text) !important; }
html[data-theme="dark"] .page [style*="color: #718096"],
html[data-theme="dark"] .page [style*="color:#718096"],
html[data-theme="dark"] .page [style*="color: #64748b"],
html[data-theme="dark"] .page [style*="color:#64748b"],
html[data-theme="dark"] .page [style*="color: #94a3b8"],
html[data-theme="dark"] .page [style*="color:#94a3b8"],
html[data-theme="dark"] .page [style*="color: #a0aec0"],
html[data-theme="dark"] .page [style*="color:#a0aec0"] { color: var(--hm-soft-text) !important; }
html[data-theme="dark"] tbody tr:hover { background: rgba(67,198,191,.065) !important; }
html[data-theme="dark"] th { background: #082c46 !important; }

@media (max-width: 900px) {
    .sidebar { width: min(86vw, 304px); flex-basis: auto; }
    .topbar { backdrop-filter: none; -webkit-backdrop-filter: none; }
}
@media (max-width: 720px) {
    .page { padding: 16px 13px 24px !important; }
    .topbar { min-height: 66px; padding: 12px 13px !important; }
    .topbar-settings { gap: 6px; margin-right: 6px; }
    .dashboard-hero { padding: 22px 20px !important; margin-bottom: 20px !important; }
    .dashboard-stats-grid { gap: 12px !important; margin-bottom: 22px !important; }
    .dashboard-stat-card { min-height: 124px; }
    .dashboard-overview-grid { gap: 14px !important; }
    .dashboard-panel { min-width: 0 !important; }
    .dashboard-panel > div[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
    .auth-settings { top: 12px; right: 12px; }
}
@media (max-width: 480px) {
    .topbar-setting-button { min-width: 42px; padding-inline: 8px; }
    .profile span { display: none; }
    .dashboard-stat-card { min-height: 116px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
/* Login: explicit return to public preview */
.auth-back-preview {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 8px 11px;
    margin: -6px 0 18px;
    border: 1px solid var(--hm-line);
    border-radius: 10px;
    background: color-mix(in srgb, var(--hm-panel) 82%, transparent);
    color: var(--hm-soft-text) !important;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none !important;
    transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease;
}
.auth-back-preview svg { width: 17px; height: 17px; stroke-width: 2.2; }
.auth-back-preview:hover {
    color: var(--hm-text) !important;
    border-color: #75a9b4;
    background: color-mix(in srgb, var(--hm-panel) 68%, #dff6f4 32%);
    transform: translateX(-2px);
}
.auth-back-preview:focus-visible {
    outline: 3px solid color-mix(in srgb, #0c7280 28%, transparent);
    outline-offset: 3px;
}
html[data-theme="dark"] .auth-back-preview {
    background: rgba(255,255,255,.04);
    border-color: #365867;
    color: #b8ccd3 !important;
}
html[data-theme="dark"] .auth-back-preview:hover {
    background: rgba(109,216,223,.08);
    border-color: #5b9ba4;
    color: #eef8f9 !important;
}
@media (max-width: 480px) {
    .auth-back-preview { margin-bottom: 16px; }
}


/* Login header polish: compact return link + centered brand */
.auth-container .auth-back-preview {
    display: flex !important;
    width: max-content;
    min-height: 36px;
    padding: 6px 2px;
    margin: -4px 0 16px;
    border: 0 !important;
    border-radius: 8px;
    background: transparent !important;
    color: #55707d !important;
    font-size: 12.5px;
    font-weight: 650;
    box-shadow: none !important;
}
.auth-container .auth-back-preview svg {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}
.auth-container .auth-back-preview:hover {
    color: var(--hm-ocean) !important;
    border-color: transparent !important;
    background: transparent !important;
    transform: translateX(-2px);
}
.auth-container .auth-back-preview:focus-visible {
    outline: 3px solid color-mix(in srgb, #0c7280 24%, transparent);
    outline-offset: 2px;
}
.auth-container .auth-brand {
    display: flex;
    width: max-content;
    margin: 0 auto 28px !important;
    color: var(--hm-ocean) !important;
    font-size: 19px;
}
.auth-container .auth-brand svg {
    width: 38px;
    height: 38px;
    padding: 9px;
    border-radius: 12px;
    box-sizing: border-box;
    box-shadow: 0 7px 18px rgba(7, 48, 67, .12);
}
.auth-container h2 {
    margin-top: 0 !important;
    text-align: center;
}
.auth-container .auth-subtitle,
.auth-container .auth-footer {
    text-align: center;
}
html[data-theme="dark"] .auth-container .auth-back-preview {
    color: #a9c0ca !important;
    background: transparent !important;
    border-color: transparent !important;
}
html[data-theme="dark"] .auth-container .auth-back-preview:hover {
    color: #76dce0 !important;
    background: transparent !important;
}
@media (max-width: 480px) {
    .auth-container .auth-back-preview {
        margin-bottom: 14px;
    }
    .auth-container .auth-brand {
        margin-bottom: 24px !important;
    }
}


/* Android app download experience */
.preview-download-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 47px;
    padding: 0 18px;
    border: 1px solid color-mix(in srgb, var(--hm-ocean) 38%, var(--hm-line));
    border-radius: 9px;
    background: color-mix(in srgb, #ffffff 88%, #e6f8f5 12%);
    color: var(--hm-ocean) !important;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none !important;
    box-shadow: 0 7px 18px rgba(12,114,128,.08);
    transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.preview-download-button svg { width: 16px; height: 16px; }
.preview-download-button:hover {
    transform: translateY(-1px);
    border-color: var(--hm-ocean);
    background: #edf9f7;
    box-shadow: 0 10px 24px rgba(12,114,128,.12);
}
.preview-cta-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
html[data-theme="dark"] .preview-download-button {
    background: rgba(91,205,199,.08);
    border-color: #315c66;
    color: #79dbd4 !important;
}

.download-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 14% 10%, rgba(78, 206, 196, .16), transparent 28rem),
        radial-gradient(circle at 90% 82%, rgba(16, 89, 118, .12), transparent 30rem),
        var(--hm-cream);
}
.download-page {
    width: min(1080px, calc(100% - 40px));
    margin: 0 auto;
    padding: 72px 0 90px;
}
.download-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--hm-soft-text);
    font-size: 12px;
    font-weight: 750;
    text-decoration: none;
    margin-bottom: 28px;
}
.download-back:hover { color: var(--hm-ocean); }
.download-back svg { width: 16px; }
.download-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(340px, .75fr);
    gap: clamp(30px, 7vw, 82px);
    align-items: center;
    min-height: 540px;
}
.download-copy .eyebrow { margin-bottom: 16px; }
.download-copy h1 {
    max-width: 650px;
    margin: 0;
    color: var(--hm-deep);
    font-size: clamp(40px, 5vw, 66px);
    line-height: 1.04;
    letter-spacing: -3.2px;
}
.download-copy > p:not(.eyebrow) {
    max-width: 610px;
    margin: 24px 0 0;
    color: var(--hm-soft-text);
    font-size: 15px;
    line-height: 1.75;
}
.download-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 26px;
}
.download-meta span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 0 11px;
    border: 1px solid var(--hm-line);
    border-radius: 999px;
    background: color-mix(in srgb, var(--hm-panel) 92%, transparent);
    color: var(--hm-soft-text);
    font-size: 10px;
    font-weight: 800;
}
.download-meta svg { width: 13px; }
.download-card {
    position: relative;
    overflow: hidden;
    padding: 32px;
    border: 1px solid var(--hm-line);
    border-radius: 24px;
    background: color-mix(in srgb, var(--hm-panel) 96%, transparent);
    box-shadow: 0 28px 70px rgba(9,44,61,.13);
}
.download-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, var(--hm-navy), var(--hm-ocean), #54cfc3);
}
.download-app-icon {
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    border-radius: 22px;
    background: linear-gradient(145deg, var(--hm-navy), var(--hm-ocean));
    color: #fff;
    box-shadow: 0 16px 30px rgba(10,70,91,.2);
}
.download-app-icon svg { width: 32px; height: 32px; }
.download-card small {
    display: block;
    margin-top: 26px;
    color: var(--hm-ocean);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}
.download-card h2 { margin: 8px 0 0; color: var(--hm-text); font-size: 26px; }
.download-card p { margin: 10px 0 0; color: var(--hm-soft-text); font-size: 12px; line-height: 1.65; }
.download-apk-button {
    width: 100%;
    min-height: 52px;
    margin-top: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--hm-navy), var(--hm-ocean));
    color: #fff !important;
    font-size: 13px;
    font-weight: 850;
    text-decoration: none !important;
    box-shadow: 0 13px 28px rgba(10,79,101,.2);
}
.download-apk-button:hover { transform: translateY(-1px); box-shadow: 0 17px 34px rgba(10,79,101,.24); }
.download-apk-button svg { width: 18px; }
.download-note {
    display: flex;
    gap: 9px;
    margin-top: 16px;
    color: var(--hm-soft-text);
    font-size: 10px;
    line-height: 1.55;
}
.download-note svg { flex: 0 0 auto; width: 15px; margin-top: 1px; color: var(--hm-ocean); }
.download-feature-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 36px;
}
.download-feature-list > div {
    padding: 18px;
    border: 1px solid var(--hm-line);
    border-radius: 15px;
    background: color-mix(in srgb, var(--hm-panel) 86%, transparent);
}
.download-feature-list svg { width: 19px; color: var(--hm-ocean); }
.download-feature-list b { display: block; margin-top: 10px; color: var(--hm-text); font-size: 11px; }
.download-feature-list span { display: block; margin-top: 5px; color: var(--hm-soft-text); font-size: 10px; line-height: 1.45; }
html[data-theme="dark"] .download-copy h1 { color: var(--hm-text); }
html[data-theme="dark"] .download-card,
html[data-theme="dark"] .download-feature-list > div,
html[data-theme="dark"] .download-meta span { background: var(--hm-panel); }

@media (max-width: 760px) {
    .preview-cta-actions { width: 100%; }
    .preview-cta-actions .preview-primary,
    .preview-cta-actions .preview-download-button { width: 100%; }
    .download-page { width: min(100% - 28px, 1080px); padding-top: 38px; }
    .download-shell { grid-template-columns: 1fr; min-height: 0; gap: 36px; }
    .download-copy h1 { font-size: 44px; letter-spacing: -2.4px; }
    .download-feature-list { grid-template-columns: 1fr; }
    .download-card { padding: 26px; }
}

/* === Dark-mode fix for transaction analytics / seasonal insight cards === */
html[data-theme="dark"] .tx-season-card {
    background: #0d2b3d !important;
    border-color: #23485a !important;
}
html[data-theme="dark"] .tx-season-header {
    background: linear-gradient(90deg, #14384a 0%, #184458 100%) !important;
    border-left-color: #38bdf8 !important;
    color: #edf8fb !important;
}
html[data-theme="dark"] .tx-season-header.dry {
    background: linear-gradient(90deg, rgba(249,115,22,.18) 0%, rgba(154,52,18,.12) 100%) !important;
    border-left-color: #f97316 !important;
}
html[data-theme="dark"] .tx-season-header.wet {
    background: linear-gradient(90deg, rgba(37,99,235,.18) 0%, rgba(30,64,175,.12) 100%) !important;
    border-left-color: #3b82f6 !important;
}
html[data-theme="dark"] .tx-season-header h4,
html[data-theme="dark"] .tx-season-header h4 * {
    color: #edf8fb !important;
}
html[data-theme="dark"] .tx-season-header .season-badge {
    background: rgba(8, 44, 70, .9) !important;
    color: #d9f7fb !important;
    border: 1px solid rgba(103, 232, 249, .22);
}
html[data-theme="dark"] .tx-season-header .season-badge.dry {
    background: rgba(249,115,22,.16) !important;
    color: #fdba74 !important;
    border-color: rgba(249,115,22,.28) !important;
}
html[data-theme="dark"] .tx-season-header .season-badge.wet {
    background: rgba(59,130,246,.16) !important;
    color: #93c5fd !important;
    border-color: rgba(59,130,246,.28) !important;
}
html[data-theme="dark"] .tx-season-body,
html[data-theme="dark"] .tx-season-body p,
html[data-theme="dark"] .tx-season-body > div[style*="font-size: 12.5px"] {
    color: #c4d7df !important;
}
html[data-theme="dark"] #weatherListContainer > div,
html[data-theme="dark"] #toolsListContainer > div {
    background: #143447 !important;
    border: 1px solid #2b5568 !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}
html[data-theme="dark"] #weatherListContainer strong,
html[data-theme="dark"] #toolsListContainer strong {
    color: #eef8fb !important;
}
html[data-theme="dark"] #weatherListContainer > div > div:first-child > div,
html[data-theme="dark"] #toolsListContainer > div > div:first-child > div {
    color: #a9c2cc !important;
}
html[data-theme="dark"] #weatherListContainer > div > div:last-child > div:first-child {
    color: #7dd3fc !important;
}
html[data-theme="dark"] #weatherListContainer > div > div:last-child > div:last-child,
html[data-theme="dark"] #toolsListContainer > div > div:last-child > div:first-child {
    color: #86efac !important;
}
html[data-theme="dark"] #drySeasonStat {
    background: rgba(249,115,22,.14) !important;
    border: 1px solid rgba(249,115,22,.28) !important;
    color: #fed7aa !important;
}
html[data-theme="dark"] #wetSeasonStat {
    background: rgba(59,130,246,.14) !important;
    border: 1px solid rgba(59,130,246,.28) !important;
    color: #bfdbfe !important;
}
html[data-theme="dark"] .species-pill.dry {
    background: rgba(249,115,22,.14) !important;
    border-color: rgba(249,115,22,.34) !important;
    color: #fdba74 !important;
}
html[data-theme="dark"] .species-pill.wet {
    background: rgba(59,130,246,.14) !important;
    border-color: rgba(59,130,246,.34) !important;
    color: #93c5fd !important;
}
html[data-theme="dark"] .list-box-header small,
html[data-theme="dark"] .tx-season-body small {
    color: #a9c2cc !important;
}


/* === 2026-09-15 final viewport + contrast reliability pass === */
/* Colored surfaces must keep high-contrast copy even when generic theme rules run later. */
html .tx-header-banner :is(h1,h2,h3,h4,p),
html .tx-header-banner :is(h1,h2,h3,h4,p) *,
html .dashboard-hero :is(h1,h2,h3,h4,p),
html .dashboard-hero :is(h1,h2,h3,h4,p) *,
html .tx-modal-header h3,
html .tx-modal-header h3 *,
html .tx-modal-close {
    color: #ffffff !important;
    -webkit-text-fill-color: currentColor !important;
}
html .tx-header-banner .btn-tx-primary { color: #082536 !important; -webkit-text-fill-color: currentColor !important; }
html .tx-header-banner .btn-tx-secondary { color: #ffffff !important; -webkit-text-fill-color: currentColor !important; }

/* Keep the transaction dialog inside every viewport. Header/footer stay visible and body scrolls. */
.tx-modal-overlay {
    padding: 16px;
    box-sizing: border-box;
    overflow: hidden;
}
.tx-modal-content {
    width: min(540px, 100%);
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.tx-modal-content > form {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}
.tx-modal-header,
.tx-modal-footer { flex: 0 0 auto; }
.tx-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    -webkit-overflow-scrolling: touch;
}
.tx-modal-body::-webkit-scrollbar { width: 9px; }
.tx-modal-body::-webkit-scrollbar-thumb { background: #9fb3bf; border: 2px solid transparent; border-radius: 999px; background-clip: padding-box; }
html[data-theme="dark"] .tx-modal-body::-webkit-scrollbar-thumb { background-color: #547485; }

/* Other dialogs should never extend beyond a short laptop/mobile viewport either. */
.modal { overflow-y: auto !important; overscroll-behavior: contain; }
.modal-content {
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    box-sizing: border-box;
}

/* Shared readable text in both themes. Specific semantic colors still win where explicitly styled. */
html[data-theme="dark"] .page :is(.list-box-header,.tx-filter-bar,.tx-admin-review-box,.chat-page-header) :is(h1,h2,h3,h4,label) {
    color: var(--hm-text) !important;
}
html[data-theme="dark"] .page :is(.list-box-header,.tx-filter-bar,.tx-admin-review-box,.chat-page-header) :is(p,small) {
    color: var(--hm-soft-text) !important;
}
html[data-theme="dark"] .tx-filter-bar,
html[data-theme="dark"] .tx-admin-review-box {
    background: var(--hm-panel) !important;
    border-color: var(--hm-line) !important;
}
html[data-theme="dark"] .tx-kpi-info h3 { color: var(--hm-text) !important; }
html[data-theme="dark"] .tx-kpi-info #txKpiCost { color: #ffa4ad !important; }
html[data-theme="dark"] .tx-kpi-info #txKpiNetProfit { color: #85e3af !important; }

@media (max-width: 640px), (max-height: 760px) {
    .tx-modal-overlay { padding: 8px; align-items: center; }
    .tx-modal-content {
        width: 100%;
        max-height: calc(100vh - 16px);
        max-height: calc(100dvh - 16px);
        border-radius: 14px !important;
    }
    .tx-modal-header { padding: 14px 16px; }
    .tx-modal-body { padding: 16px; }
    .tx-modal-footer { padding: 12px 16px; position: relative; }
    .tx-form-row { grid-template-columns: 1fr; gap: 0; }
}

/* =========================================================
   2026-09-15 Catch detail readability + responsive card pass
   Keeps expanded report details readable in both themes.
   ========================================================= */
.catch-card .unravel-content.active {
    background: #f8fafc;
    border: 1px solid #dbe7ee;
    border-top-color: #dbe7ee;
    border-radius: 12px;
    margin-top: 14px;
    padding: 16px;
    overflow: visible;
}

.catch-card .details-grid {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
}

.catch-card .detail-item {
    min-width: 0;
    padding: 12px 13px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
}

.catch-card .detail-item label {
    color: #64748b;
    font-size: 10px;
    line-height: 1.35;
    margin-bottom: 6px;
}

.catch-card .detail-item label i {
    color: #0f7891;
}

.catch-card .detail-item span {
    display: block;
    color: #163247;
    line-height: 1.45;
    overflow-wrap: anywhere;
    word-break: normal;
}

.catch-card .detail-item .weather-badge,
.catch-card .detail-item .tool-tag {
    display: inline-flex;
    max-width: 100%;
    white-space: normal;
}

html[data-theme="dark"] .catch-card .unravel-content.active {
    background: #0a2330 !important;
    border-color: #2b4c5d !important;
}

html[data-theme="dark"] .catch-card .detail-item {
    background: #102f3d !important;
    border-color: #2b4c5d !important;
}

html[data-theme="dark"] .catch-card .detail-item label {
    color: #9fc0cc !important;
}

html[data-theme="dark"] .catch-card .detail-item label i {
    color: #5ed0dc !important;
}

html[data-theme="dark"] .catch-card .detail-item span {
    color: #f1fbfc !important;
}

html[data-theme="dark"] .catch-card .detail-item .weather-badge,
html[data-theme="dark"] .catch-card .detail-item .tool-tag {
    background: #163c4d !important;
    color: #eaf8fa !important;
    border-color: #356174 !important;
}

@media (max-width: 900px) {
    .catch-card {
        padding: 14px;
    }
    .catch-card-header {
        align-items: flex-start;
        gap: 12px;
    }
    .catch-card .details-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .catch-card .details-grid {
        grid-template-columns: 1fr;
    }
    .catch-card .unravel-content.active {
        padding: 12px;
    }
    .catch-card .detail-item {
        padding: 11px 12px;
    }
}

/* === HuliMo Super Admin + reporting refinements === */
.role-badge {
    display:inline-flex; align-items:center; justify-content:center;
    min-height:20px; padding:2px 7px; border-radius:999px;
    font-size:9px; line-height:1; font-weight:800; letter-spacing:.08em;
    border:1px solid transparent;
}
.role-badge.super { background:#fff7ed; color:#c2410c; border-color:#fed7aa; }
.role-badge.admin { background:#eff6ff; color:#1d4ed8; border-color:#bfdbfe; }
.super-admin-only { display:none !important; }
body .page.super-admin-only { display:none !important; }

.print-report-summary { display:none; }
.tx-filter-group { flex-wrap:wrap; }
#txPersonFilter { min-width:220px; }
#txPeriodFilter { min-width:150px; }

@media (max-width: 900px) {
    .tx-filter-group > .tx-select,
    .tx-filter-group > div { width:100%; min-width:0 !important; }
    #txPersonFilter, #txPeriodFilter { width:100%; }
}

@media print {
    #txPrintNarrative.print-report-summary {
        display:block !important;
        margin:0 0 18px !important;
        padding:14px 16px !important;
        border:1px solid #cbd5e1 !important;
        border-radius:10px !important;
        background:#fff !important;
        color:#0f172a !important;
        break-inside:avoid;
    }
    .print-summary-heading { font-size:12px; margin-bottom:10px; color:#334155; }
    .print-summary-grid {
        display:grid !important;
        grid-template-columns:repeat(3,1fr) !important;
        gap:8px !important;
        margin-bottom:12px !important;
    }
    .print-summary-grid > div {
        border:1px solid #e2e8f0 !important;
        border-radius:8px !important;
        padding:9px 10px !important;
        background:#f8fafc !important;
    }
    .print-summary-grid span { display:block; font-size:9px; color:#64748b; text-transform:uppercase; font-weight:700; }
    .print-summary-grid strong { display:block; margin-top:3px; font-size:13px; color:#0f172a; }
    .print-summary-narrative h3 { font-size:13px; margin:0 0 5px; color:#0f172a; }
    .print-summary-narrative p { font-size:10.5px; line-height:1.55; margin:4px 0; color:#334155; }
    #transactions .tx-chart-wrap {
        height:520px !important;
        min-height:520px !important;
        width:100% !important;
        break-inside:avoid !important;
        page-break-inside:avoid !important;
    }
    #transactions .tx-chart-wrap canvas {
        width:100% !important;
        height:500px !important;
        max-height:500px !important;
    }
}

html[data-theme="dark"] .role-badge.super { background:#431407; color:#fdba74; border-color:#9a3412; }
html[data-theme="dark"] .role-badge.admin { background:#172554; color:#93c5fd; border-color:#1e40af; }

@media print {
    #reports .report-chart-wrap {
        min-height:420px !important;
        height:420px !important;
        break-inside:avoid !important;
        page-break-inside:avoid !important;
    }
    #reports .report-chart-wrap canvas {
        width:100% !important;
        height:390px !important;
        max-height:390px !important;
    }
}

/* Super Admin / private inbox polish */
.chat-private-thread-note{margin-top:5px;font-size:10.5px;color:#64748b;display:flex;align-items:center;gap:5px;font-weight:600}
body.dark .chat-private-thread-note{color:#94a3b8}

/* =========================================================
   2026-09-16 Chat, rejection workflow, table & print hardening
   ========================================================= */
.chat-list-section-label {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 8px 14px;
    background: #eef6f8;
    border-bottom: 1px solid #d9e8ec;
    color: #58717e;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .12em;
}
.chat-user-item { display:flex; align-items:center; gap:12px; padding:13px 14px; border-bottom:1px solid #e9f0f3; cursor:pointer; transition:background .18s ease,border-color .18s ease,transform .18s ease; }
.chat-user-item:hover { transform: translateY(-1px); }
.chat-user-item.chat-thread-pinned { background: #f0f9ff; border-left: 3px solid #0284c7; }
.chat-thread-avatar-wrap { position:relative; flex:0 0 auto; }
.chat-thread-avatar { width:44px; height:44px; border-radius:50%; object-fit:cover; border:1.5px solid #cbd5e1; background:#fff; }
.chat-thread-dot { position:absolute; right:0; bottom:1px; width:11px; height:11px; border:2px solid #fff; border-radius:50%; background:#94a3b8; }
.chat-thread-dot.online { background:#10b981; }
.chat-thread-role-dot { position:absolute; right:-2px; bottom:-1px; width:18px; height:18px; border:2px solid #fff; border-radius:50%; display:grid; place-items:center; font-size:8px; color:#fff; background:#0f6b7a; }
.chat-thread-copy { flex:1; min-width:0; }
.chat-thread-title-row { display:flex; align-items:center; gap:6px; min-width:0; }
.chat-thread-title-row .user-name { color:#173042; font-size:13.5px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.chat-user-time { margin-left:auto; color:#8ba0aa; font-size:10.5px; white-space:nowrap; }
.chat-thread-meta,.chat-user-last-msg { color:#647985; font-size:11.5px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; margin-top:2px; }
.chat-thread-presence,.chat-thread-security { display:inline-flex; align-items:center; gap:4px; margin-top:3px; color:#64748b; font-size:10.5px; font-weight:700; }
.chat-thread-presence.online { color:#0f8a5f; }
.chat-thread-security { color:#0369a1; }
.chat-unread-pill { display:inline-flex; min-width:18px; height:18px; padding:0 5px; align-items:center; justify-content:center; border-radius:999px; background:#dc2626; color:#fff; font-size:9.5px; font-weight:800; }
.chat-default-state,.chat-empty-thread { margin:auto; display:flex; flex-direction:column; align-items:center; text-align:center; gap:7px; color:#718591; padding:28px; }
.chat-default-state i,.chat-empty-thread i { font-size:36px; color:#9db1ba; }
.chat-default-state strong,.chat-empty-thread strong { color:#29414f; font-size:14px; }
.chat-default-state.compact { padding:26px 14px; }
.chat-default-state.compact i { font-size:28px; }
.chat-system-greeting { align-self:center; max-width:680px; display:flex; align-items:flex-start; gap:10px; padding:10px 13px; margin:2px auto 12px; border:1px solid #bae6fd; border-radius:12px; background:#f0f9ff; color:#31576b; font-size:11.5px; line-height:1.45; }
.chat-system-greeting i { color:#0284c7; margin-top:2px; }
.chat-system-greeting div { display:flex; flex-direction:column; gap:2px; }
.chat-system-greeting strong { color:#075985; }
.chat-message-row { display:flex; flex-direction:column; margin-bottom:4px; }
.chat-message-row.mine { align-items:flex-end; }
.chat-message-row.theirs { align-items:flex-start; }
.chat-message-row .chat-time { color:#8ba0aa; font-size:10.5px; margin-top:3px; padding:0 4px; }
.chat-bubble.admin { background:linear-gradient(135deg,#124a62,#0f6b7a); color:#fff; }
.chat-bubble.fisherman { background:#fff; color:#173042; border:1px solid #dbe7eb; }

.rejection-review-modal { position:relative; width:min(620px,calc(100vw - 28px)); max-height:calc(100vh - 36px); overflow:auto; padding:24px; }
.modal-close-icon { position:absolute; top:14px; right:14px; width:40px; height:40px; border:0; border-radius:10px; background:transparent; color:#64748b; cursor:pointer; }
.modal-close-icon:hover { background:#f1f5f9; }
.rejection-review-header { display:flex; gap:12px; align-items:flex-start; padding-right:42px; margin-bottom:18px; }
.rejection-review-header h3 { margin:0; color:#173042; font-size:18px; }
.rejection-review-header p { margin:4px 0 0; color:#64748b; font-size:12.5px; }
.rejection-review-icon { width:42px; height:42px; border-radius:12px; display:grid; place-items:center; background:#fff1f2; color:#be123c; font-size:18px; flex:0 0 auto; }
.rejection-file-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-bottom:16px; }
.rejection-file-option { display:flex; gap:10px; align-items:flex-start; padding:13px; border:1px solid #dbe4ea; border-radius:12px; background:#f8fbfc; cursor:pointer; }
.rejection-file-option:has(input:checked) { border-color:#f43f5e; background:#fff1f2; box-shadow:0 0 0 2px rgba(244,63,94,.08); }
.rejection-file-option input { margin-top:3px; accent-color:#e11d48; }
.rejection-file-option span { display:flex; flex-direction:column; gap:3px; }
.rejection-file-option strong { color:#263e4b; font-size:13px; }
.rejection-file-option small { color:#718591; line-height:1.4; }
.rejection-reason-label { display:block; margin-bottom:7px; font-weight:700; color:#263e4b; font-size:12.5px; }
#rejectReasonInput { width:100%; box-sizing:border-box; resize:vertical; min-height:100px; padding:12px; border:1px solid #cbd5e1; border-radius:10px; }
.rejection-review-note { display:flex; gap:8px; margin:12px 0 16px; padding:10px 12px; border-radius:10px; background:#eff6ff; color:#31576b; font-size:11.5px; }
.modal-actions { display:flex; justify-content:flex-end; gap:10px; flex-wrap:wrap; }

.resubmission-card { margin-top:18px; padding:16px; border:1px solid #d7e5e8; border-radius:14px; background:#f8fbfc; }
.resubmission-card-head { display:flex; gap:10px; align-items:flex-start; }
.resubmission-card-head>span { width:34px; height:34px; border-radius:10px; background:#e0f2fe; color:#0369a1; display:grid; place-items:center; flex:0 0 auto; }
.resubmission-card h3 { margin:0; color:#173042; font-size:14px; }
.resubmission-card p { margin:3px 0 0; color:#64748b; font-size:11.5px; line-height:1.45; }
.resubmission-check-row { display:flex; gap:8px; margin-top:12px; }
.resubmission-check-row input { margin:0 !important; min-width:0; flex:1; }
.resubmission-check-row button,.resubmission-submit { border:0; border-radius:9px; padding:0 14px; min-height:44px; background:#0f6b7a; color:white; font-weight:800; cursor:pointer; }
.resubmission-panel { margin-top:12px; padding-top:12px; border-top:1px solid #d7e5e8; }
.resubmission-alert { display:flex; gap:9px; padding:10px; border-radius:10px; background:#fff7ed; color:#9a3412; }
.resubmission-alert div { display:flex; flex-direction:column; gap:2px; }
.resubmission-alert p { color:#9a3412; margin:0; }
.resubmission-flags { display:flex; flex-wrap:wrap; gap:7px; margin:10px 0; }
.resubmission-flags span { display:inline-flex; align-items:center; gap:5px; padding:5px 8px; border-radius:999px; background:#fee2e2; color:#991b1b; font-size:10.5px; font-weight:800; }
.resubmission-panel label { display:block; margin:9px 0; color:#344a56; font-size:12px; font-weight:700; }
.resubmission-panel input[type=file] { width:100%; margin-top:5px; }
.resubmission-submit { width:100%; margin-top:10px; display:flex; align-items:center; justify-content:center; gap:7px; }
.resubmission-status { min-height:16px; margin-top:8px !important; font-weight:700; }


/* Rejected-application correction status */
.archive-correction-status {
    display:inline-flex; align-items:center; gap:6px; padding:6px 9px; border-radius:999px;
    font-size:10.5px; font-weight:800; line-height:1; white-space:nowrap; border:1px solid transparent;
}
.archive-correction-status.waiting { background:#fff7ed; color:#9a3412; border-color:#fed7aa; }
.archive-correction-status.submitted { background:#eff6ff; color:#1d4ed8; border-color:#bfdbfe; }
.archive-correction-status.approved { background:#ecfdf5; color:#047857; border-color:#a7f3d0; }
html[data-theme="dark"] .archive-correction-status.waiting { background:#44230d; color:#fdba74; border-color:#7c3f15; }
html[data-theme="dark"] .archive-correction-status.submitted { background:#102c50; color:#93c5fd; border-color:#1e4d83; }
html[data-theme="dark"] .archive-correction-status.approved { background:#0d382c; color:#6ee7b7; border-color:#17634d; }

/* Dark-mode tables: deliberate surfaces rather than inverted light tables. */
html[data-theme="dark"] table { background:#0b2432 !important; border-color:#2b4a58 !important; }
html[data-theme="dark"] table th { background:#12384a !important; color:#f3fbfc !important; border-color:#315462 !important; }
html[data-theme="dark"] table td { background:#0b2432 !important; color:#dcecef !important; border-color:#254754 !important; }
html[data-theme="dark"] table tbody tr:nth-child(even) td { background:#0e2a39 !important; }
html[data-theme="dark"] table tbody tr:hover td { background:#153a49 !important; }
html[data-theme="dark"] table a { color:#78d7ff !important; text-decoration-color:#4eaed3; }
html[data-theme="dark"] .chat-list-section-label { background:#102f3e; border-color:#274b59; color:#9fc0ca; }
html[data-theme="dark"] .chat-user-item { border-color:#213f4c; }
html[data-theme="dark"] .chat-user-item.chat-thread-pinned { background:#0b3145; }
html[data-theme="dark"] .chat-thread-title-row .user-name,html[data-theme="dark"] .chat-default-state strong,html[data-theme="dark"] .chat-empty-thread strong { color:#eaf7f8; }
html[data-theme="dark"] .chat-thread-meta,html[data-theme="dark"] .chat-user-last-msg,html[data-theme="dark"] .chat-user-time { color:#9ab1bb; }
html[data-theme="dark"] .chat-system-greeting { background:#0c3144; border-color:#21546a; color:#b9d4dc; }
html[data-theme="dark"] .chat-system-greeting strong { color:#8edfff; }
html[data-theme="dark"] .chat-bubble.fisherman { background:#153441; color:#effafa; border-color:#315362; }
html[data-theme="dark"] .rejection-file-option,html[data-theme="dark"] .resubmission-card { background:#0f2b38; border-color:#2d4c59; }
html[data-theme="dark"] .rejection-file-option strong,html[data-theme="dark"] .rejection-reason-label,html[data-theme="dark"] .resubmission-card h3,html[data-theme="dark"] .resubmission-panel label { color:#e8f5f6; }
html[data-theme="dark"] .rejection-file-option small,html[data-theme="dark"] .resubmission-card p { color:#a7bec7; }

@media (max-width:640px) {
    .rejection-file-grid { grid-template-columns:1fr; }
    .resubmission-check-row { flex-direction:column; }
}

@media print {
    @page { size: A4 landscape; margin: 9mm; }
    body { font-family: Arial, sans-serif !important; }
    .page.active table { table-layout:auto !important; width:100% !important; border:1px solid #7b8790 !important; background:#fff !important; }
    .page.active thead { display:table-header-group !important; }
    .page.active tfoot { display:table-footer-group !important; }
    .page.active th { background:#123f5a !important; color:#fff !important; border:1px solid #6f7e87 !important; padding:6px 7px !important; font-size:8.5pt !important; line-height:1.2 !important; text-align:left !important; vertical-align:middle !important; }
    .page.active td { background:#fff !important; color:#111827 !important; border:1px solid #aab4ba !important; padding:5px 7px !important; font-size:8.5pt !important; line-height:1.3 !important; vertical-align:top !important; overflow-wrap:anywhere !important; word-break:normal !important; }
    .page.active tbody tr:nth-child(even) td { background:#f4f7f8 !important; }
    .page.active tr { break-inside:avoid-page !important; page-break-inside:avoid !important; }
    .page.active a { color:#111827 !important; text-decoration:none !important; }
    .page.active .badge,.page.active .status-badge { border:1px solid #77858d !important; color:#111827 !important; background:#f4f7f8 !important; }
    .table-responsive,.list-box-content { overflow:visible !important; max-height:none !important; }
    #reports canvas,#transactions canvas { min-height:250px !important; max-height:340px !important; }
}

/* =========================================================
   2026-09-16 PRINT CONTRAST OVERRIDE
   Printed reports must remain readable regardless of the active UI theme.
   This block intentionally comes last so dark-mode screen styles cannot
   leak into printed table cells, labels, badges, or inline descendants.
   ========================================================= */
@media print {
    html,
    html[data-theme="dark"],
    body,
    body.dark {
        background: #ffffff !important;
        color: #111827 !important;
        color-scheme: light !important;
    }

    /* Printed report surfaces are always paper-white. */
    .page.active,
    .page.active .list-box,
    .page.active .list-box-content,
    .page.active .card,
    .page.active .card-box,
    .page.active .tx-kpi-card,
    .page.active .report-chart-wrap,
    .page.active .tx-chart-wrap {
        background: #ffffff !important;
        color: #111827 !important;
        box-shadow: none !important;
    }

    /* A dark UI theme must never make printed table content pale/invisible. */
    .page.active table,
    html[data-theme="dark"] .page.active table,
    body.dark .page.active table {
        background: #ffffff !important;
        color: #111827 !important;
        border-color: #7b8790 !important;
    }

    .page.active table thead th,
    html[data-theme="dark"] .page.active table thead th,
    body.dark .page.active table thead th {
        background: #123f5a !important;
        color: #ffffff !important;
        border-color: #6f7e87 !important;
        text-shadow: none !important;
    }

    .page.active table thead th *,
    html[data-theme="dark"] .page.active table thead th *,
    body.dark .page.active table thead th * {
        color: #ffffff !important;
        -webkit-text-fill-color: #ffffff !important;
        text-shadow: none !important;
        opacity: 1 !important;
    }

    .page.active table tbody td,
    html[data-theme="dark"] .page.active table tbody td,
    body.dark .page.active table tbody td {
        background: #ffffff !important;
        color: #111827 !important;
        border-color: #aab4ba !important;
        text-shadow: none !important;
        opacity: 1 !important;
    }

    .page.active table tbody tr:nth-child(even) td,
    html[data-theme="dark"] .page.active table tbody tr:nth-child(even) td,
    body.dark .page.active table tbody tr:nth-child(even) td {
        background: #f3f6f8 !important;
    }

    /* Reset every nested element because several table cells use inline or
       dark-theme colors on strong/small/span elements. */
    .page.active table tbody td *,
    html[data-theme="dark"] .page.active table tbody td *,
    body.dark .page.active table tbody td * {
        color: #111827 !important;
        -webkit-text-fill-color: #111827 !important;
        text-shadow: none !important;
        opacity: 1 !important;
    }

    /* Preserve useful semantic colors at print-safe contrast. */
    .page.active table .cost-text,
    .page.active table .cost-text *,
    .page.active table td[style*="color:#dc2626"],
    .page.active table td[style*="color: #dc2626"] {
        color: #b91c1c !important;
        -webkit-text-fill-color: #b91c1c !important;
    }

    .page.active table .profit-text,
    .page.active table .profit-text *,
    .page.active table td[style*="color:#059669"],
    .page.active table td[style*="color: #059669"] {
        color: #047857 !important;
        -webkit-text-fill-color: #047857 !important;
    }

    .page.active table td strong[style*="color:#0284c7"],
    .page.active table td strong[style*="color: #0284c7"] {
        color: #0369a1 !important;
        -webkit-text-fill-color: #0369a1 !important;
    }

    /* Print badges as light pills with dark text instead of inheriting dark UI. */
    .page.active table .season-badge,
    .page.active table .weather-badge,
    .page.active table .tool-tag,
    .page.active table .roi-badge,
    .page.active table .badge,
    .page.active table .status-badge,
    .page.active table td span[style*="background"] {
        background: #eef3f6 !important;
        color: #172a3a !important;
        -webkit-text-fill-color: #172a3a !important;
        border: 1px solid #aebdc5 !important;
        box-shadow: none !important;
    }

    .page.active table .roi-badge.good,
    .page.active table .roi-badge.excellent {
        background: #dcfce7 !important;
        color: #166534 !important;
        -webkit-text-fill-color: #166534 !important;
        border-color: #86efac !important;
    }

    .page.active table small {
        color: #475569 !important;
        -webkit-text-fill-color: #475569 !important;
        opacity: 1 !important;
    }

    /* Section headings should also remain readable on paper. */
    .page.active .list-box-header,
    html[data-theme="dark"] .page.active .list-box-header {
        background: #f8fafc !important;
        color: #0f172a !important;
        border-color: #cbd5e1 !important;
    }
    .page.active .list-box-header h1,
    .page.active .list-box-header h2,
    .page.active .list-box-header h3,
    .page.active .list-box-header h4,
    .page.active .list-box-header h1 *,
    .page.active .list-box-header h2 *,
    .page.active .list-box-header h3 *,
    .page.active .list-box-header h4 * {
        color: #0f172a !important;
        -webkit-text-fill-color: #0f172a !important;
        opacity: 1 !important;
    }
}

/* =========================================================
   HULIMO DESIGN SYSTEM — DEEP UI PASS · 2026-09-16
   Presentation-only. Intentionally scoped to screen media so
   existing print/report behavior and application logic stay intact.
   ========================================================= */
@media screen {
    :root {
        --hm-space-1: 4px;
        --hm-space-2: 8px;
        --hm-space-3: 12px;
        --hm-space-4: 16px;
        --hm-space-5: 20px;
        --hm-space-6: 24px;
        --hm-space-7: 32px;
        --hm-control-h: 44px;
        --hm-control-h-lg: 50px;
        --hm-radius-xs: 8px;
        --hm-radius-sm: 10px;
        --hm-radius-md: 14px;
        --hm-radius-lg: 18px;
        --hm-radius-xl: 24px;
        --hm-ease: cubic-bezier(.2,.8,.2,1);
        --hm-fast: 160ms;
        --hm-normal: 240ms;
        --hm-blue-soft: #eaf5f8;
        --hm-green-soft: #eaf7f1;
        --hm-red-soft: #fff0f2;
        --hm-amber-soft: #fff7e9;
    }

    html { scroll-behavior: smooth; }
    body { overflow-x: hidden; }
    *, *::before, *::after { box-sizing: border-box; }

    /* Typography and icon rhythm */
    :is(h1,h2,h3,h4,h5,h6) {
        text-wrap: balance;
        color: var(--hm-text);
    }
    :is(p,span,small,label,td,th,a,button,input,select,textarea) {
        text-rendering: optimizeLegibility;
    }
    :is(button,.btn,a,.dropdown-item,.sidebar li,.dashboard-action-card,.chat-user-item) > i,
    :is(h1,h2,h3,h4,label) > i,
    .catch-card i,
    .list-box-header i,
    .tx-season-header i {
        display: inline-grid;
        place-items: center;
        flex: 0 0 auto;
        width: 1.1em;
        min-width: 1.1em;
        height: 1.1em;
        line-height: 1;
        vertical-align: -0.12em;
        text-align: center;
    }
    select, option, #toolsListContainer strong, #weatherListContainer strong {
        font-family: Inter, "Segoe UI", "Segoe UI Emoji", "Apple Color Emoji", sans-serif !important;
    }

    /* App shell */
    .wrapper { min-width: 0; background: var(--hm-cream); }
    .main { min-width: 0; }
    .sidebar {
        width: 260px !important;
        flex: 0 0 260px !important;
        padding: 22px 14px 20px !important;
        overflow-y: auto;
        scrollbar-width: thin;
        scrollbar-color: rgba(255,255,255,.22) transparent;
    }
    .sidebar h2 {
        display: flex;
        align-items: center;
        min-height: 44px;
        margin: 0 10px 20px !important;
        font-size: 20px !important;
        line-height: 1.2;
    }
    .sidebar ul { margin: 0; padding: 0; }
    .sidebar li {
        display: flex !important;
        align-items: center !important;
        gap: 11px;
        min-height: 46px !important;
        padding: 10px 12px !important;
        margin: 3px 0 !important;
        border-radius: 11px !important;
        line-height: 1.25;
        transition: background var(--hm-fast) var(--hm-ease), color var(--hm-fast) var(--hm-ease), box-shadow var(--hm-fast) var(--hm-ease) !important;
    }
    .sidebar li > i {
        width: 20px !important;
        min-width: 20px !important;
        margin-right: 0 !important;
        font-size: 15px;
    }
    .sidebar li > span:not(.pending-badge):not(.chat-unread-badge) {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .topbar {
        gap: 16px;
        min-height: 70px !important;
        padding: 12px clamp(16px, 2.4vw, 30px) !important;
    }
    .topbar > h2 {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: clamp(17px, 1.7vw, 20px) !important;
    }
    .topbar-settings,
    .profile {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    .topbar-setting-button,
    .mobile-nav-toggle {
        min-width: var(--hm-control-h);
        min-height: var(--hm-control-h);
        padding: 0 12px !important;
        border-radius: 11px !important;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        gap: 7px;
    }
    .profile > div:first-child,
    .admin-role-trigger {
        min-height: var(--hm-control-h);
        display: inline-flex !important;
        align-items: center;
        gap: 9px;
        border-radius: 999px;
    }
    .avatar,
    #adminProfileImg,
    #adminProfileImgDropdown,
    .chat-thread-avatar,
    .chat-active-header img {
        display: block;
        aspect-ratio: 1;
        object-fit: cover !important;
        object-position: center !important;
        background: color-mix(in srgb, var(--hm-panel) 84%, var(--hm-line));
        border: 2px solid color-mix(in srgb, var(--hm-line) 78%, transparent) !important;
        box-shadow: 0 0 0 3px color-mix(in srgb, var(--hm-panel) 72%, transparent);
    }
    .dropdown {
        width: min(320px, calc(100vw - 24px));
        padding: 10px !important;
        border: 1px solid var(--hm-line) !important;
        border-radius: var(--hm-radius-md) !important;
        box-shadow: 0 18px 50px rgba(7,31,46,.16) !important;
        overflow: hidden;
    }
    .dropdown-item {
        min-height: 42px;
        padding: 9px 10px !important;
        border-radius: 9px;
        display: flex !important;
        align-items: center;
        gap: 9px;
    }

    /* Page surfaces and hierarchy */
    .page {
        width: 100%;
        max-width: 1920px;
        margin-inline: auto;
        padding: clamp(16px, 2.3vw, 30px) !important;
    }
    .page > h2 {
        margin: 0 0 20px !important;
        font-size: clamp(22px, 2.2vw, 28px) !important;
        line-height: 1.2;
    }
    :is(.dashboard-stat-card,.dashboard-panel,.dashboard-action-card,.list-box,.card-box,.catch-card,.tx-kpi-card,.tx-season-card,.guide-card,.modal-content,.tx-modal-content) {
        border: 1px solid var(--hm-line) !important;
        border-radius: var(--hm-radius-md) !important;
        box-shadow: 0 6px 22px rgba(7,31,46,.055) !important;
    }
    :is(.dashboard-stat-card,.dashboard-action-card,.catch-card,.tx-kpi-card,.guide-card) {
        transition: transform var(--hm-normal) var(--hm-ease), box-shadow var(--hm-normal) var(--hm-ease), border-color var(--hm-normal) var(--hm-ease);
    }
    :is(.dashboard-action-card,.catch-card,.guide-card):hover {
        transform: translateY(-2px);
        box-shadow: 0 12px 30px rgba(7,31,46,.09) !important;
        border-color: color-mix(in srgb, var(--hm-ocean) 30%, var(--hm-line)) !important;
    }
    .dashboard-stats-grid,
    .dashboard-overview-grid,
    .tx-kpi-grid,
    .tx-seasonal-grid {
        gap: clamp(12px, 1.5vw, 18px) !important;
    }
    .dashboard-stat-card,
    .tx-kpi-card { min-width: 0; }
    .dashboard-stat-card :is(h2,h3), .tx-kpi-info :is(h2,h3) {
        overflow-wrap: anywhere;
        font-variant-numeric: tabular-nums;
    }

    /* Buttons */
    button,
    .btn,
    .btn-tx-primary,
    .btn-tx-secondary,
    .btn-unravel,
    .chat-send-button,
    .preview-primary,
    .preview-secondary {
        min-height: 42px;
        border-radius: 10px !important;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        gap: 8px;
        line-height: 1.15;
        font-weight: 650 !important;
        transition: transform var(--hm-fast) var(--hm-ease), box-shadow var(--hm-fast) var(--hm-ease), background-color var(--hm-fast) var(--hm-ease), border-color var(--hm-fast) var(--hm-ease), color var(--hm-fast) var(--hm-ease) !important;
    }
    button:hover:not(:disabled),
    .btn:hover:not(:disabled),
    .btn-tx-primary:hover:not(:disabled),
    .btn-tx-secondary:hover:not(:disabled),
    .chat-send-button:hover:not(:disabled) {
        transform: translateY(-1px);
    }
    button:active:not(:disabled),
    .btn:active:not(:disabled) { transform: translateY(0) scale(.985); }
    button:disabled,
    .btn:disabled,
    [aria-disabled="true"] {
        opacity: .52 !important;
        cursor: not-allowed !important;
        box-shadow: none !important;
        transform: none !important;
    }
    :is(button,.btn,a,input,select,textarea,[tabindex]):focus-visible {
        outline: 3px solid var(--hm-focus) !important;
        outline-offset: 2px !important;
    }

    /* Forms */
    :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea,.tx-input,.tx-select,.list-search) {
        min-height: var(--hm-control-h);
        padding: 10px 13px !important;
        border: 1px solid var(--hm-line) !important;
        border-radius: 10px !important;
        background: var(--hm-panel) !important;
        color: var(--hm-text) !important;
        line-height: 1.35;
        transition: border-color var(--hm-fast) var(--hm-ease), box-shadow var(--hm-fast) var(--hm-ease), background var(--hm-fast) var(--hm-ease);
    }
    textarea { min-height: 92px; resize: vertical; }
    :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea,.tx-input,.tx-select,.list-search):hover {
        border-color: color-mix(in srgb, var(--hm-ocean) 35%, var(--hm-line)) !important;
    }
    :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea,.tx-input,.tx-select,.list-search):focus {
        border-color: var(--hm-ocean) !important;
        box-shadow: 0 0 0 3px var(--hm-focus) !important;
        outline: none !important;
    }
    input::placeholder, textarea::placeholder { color: var(--hm-soft-text) !important; opacity: .74; }
    .tx-form-group label,
    .form-group label {
        display: block;
        margin-bottom: 7px;
        color: var(--hm-text) !important;
        font-size: 12.5px;
        font-weight: 700;
    }
    .list-search-container { min-width: min(100%, 260px); }
    .list-search-container .search-icon { top: 50% !important; transform: translateY(-50%); }
    .list-search { padding-left: 38px !important; }

    /* Tables */
    .hm-table-scroll,
    .table-responsive,
    .list-box-content {
        scrollbar-width: thin;
        scrollbar-color: color-mix(in srgb, var(--hm-soft-text) 45%, transparent) transparent;
    }
    .hm-table-scroll {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        border-radius: 0 0 var(--hm-radius-md) var(--hm-radius-md);
    }
    table {
        border-spacing: 0;
        font-variant-numeric: tabular-nums;
    }
    thead th {
        position: sticky;
        top: 0;
        z-index: 2;
        white-space: nowrap;
        letter-spacing: .035em !important;
        text-transform: uppercase;
    }
    th, td {
        vertical-align: middle !important;
        line-height: 1.35;
    }
    tbody tr { transition: background-color var(--hm-fast) ease; }
    tbody tr:last-child td { border-bottom-color: transparent; }
    td :is(.badge,.status-badge,.roi-badge,.weather-badge,.tool-tag,.season-badge) {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        max-width: 100%;
        line-height: 1.2;
    }

    /* Card/list headers */
    .list-box { overflow: hidden; }
    .list-box-header {
        min-height: 62px;
        padding: 15px 18px !important;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        flex-wrap: wrap;
    }
    .list-box-header :is(h2,h3,h4) { margin: 0 !important; line-height: 1.25; }
    .list-box-header small { line-height: 1.4; }

    /* Catch/report details */
    .catch-card { overflow: clip; }
    .catch-card-header {
        display: flex;
        align-items: center;
        gap: 14px;
        padding: 16px 18px !important;
    }
    .catch-info { min-width: 0; }
    .catch-info h4 {
        display: flex;
        align-items: center;
        gap: 8px;
        margin: 0 0 4px !important;
        line-height: 1.25;
    }
    .details-grid {
        display: grid !important;
        grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)) !important;
        gap: 10px !important;
    }
    .detail-item {
        min-width: 0;
        padding: 12px !important;
        border-radius: 10px !important;
    }
    .detail-item label {
        display: flex !important;
        align-items: center;
        gap: 6px;
        margin-bottom: 6px !important;
        font-size: 10px !important;
        letter-spacing: .045em;
        text-transform: uppercase;
    }
    .detail-item span { overflow-wrap: anywhere; }

    /* Transaction/reporting */
    .tx-header-banner {
        border-radius: var(--hm-radius-lg) !important;
        padding: clamp(18px, 2.4vw, 26px) !important;
    }
    .tx-header-banner h2 { display: flex; align-items: center; gap: 10px; }
    .tx-header-actions { gap: 8px !important; flex-wrap: wrap; }
    .tx-kpi-card { padding: 17px !important; }
    .tx-kpi-icon {
        display: grid !important;
        place-items: center;
        flex: 0 0 42px;
        width: 42px !important;
        height: 42px !important;
        border-radius: 12px !important;
    }
    .tx-chart-wrap,
    .report-chart-wrap {
        min-width: 0;
        overflow: hidden;
        border-radius: var(--hm-radius-md) !important;
    }
    .tx-filter-bar {
        display: flex;
        align-items: end;
        gap: 12px !important;
        flex-wrap: wrap;
        border-radius: var(--hm-radius-md) !important;
    }
    .tx-filter-group { min-width: min(100%, 180px); }

    /* Modal system */
    .modal,
    .tx-modal {
        padding: clamp(10px, 2.5vw, 24px) !important;
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
    }
    .modal-content,
    .tx-modal-content {
        width: min(100%, 680px) !important;
        max-height: calc(100dvh - 24px) !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column;
    }
    .modal-header,
    .tx-modal-header {
        flex: 0 0 auto;
        min-height: 64px;
        padding: 16px 20px !important;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }
    .modal-header h3,
    .tx-modal-header h3 {
        display: flex;
        align-items: center;
        gap: 8px;
        margin: 0 !important;
        min-width: 0;
        line-height: 1.25;
    }
    .modal-body,
    .tx-modal-body {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto !important;
        overscroll-behavior: contain;
        padding: 18px 20px !important;
    }
    .modal-actions,
    .tx-modal-footer {
        flex: 0 0 auto;
        display: flex;
        justify-content: flex-end;
        align-items: center;
        gap: 10px;
        padding: 14px 20px !important;
        border-top: 1px solid var(--hm-line);
    }
    .modal-close-icon,
    .close {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
        padding: 0 !important;
        border-radius: 10px !important;
        display: grid !important;
        place-items: center !important;
    }

    /* Chat */
    .chat-page-header { margin-bottom: 14px; }
    .chat-shell {
        border: 1px solid var(--hm-line) !important;
        border-radius: var(--hm-radius-lg) !important;
        overflow: hidden;
        background: var(--hm-panel);
    }
    .chat-user-panel { border-right: 1px solid var(--hm-line); }
    .chat-search-panel { padding: 12px !important; }
    .chat-user-item {
        min-height: 68px;
        padding: 10px 12px !important;
        gap: 11px;
        border-radius: 10px;
        margin: 2px 6px;
        transition: background var(--hm-fast) ease, box-shadow var(--hm-fast) ease;
    }
    .chat-user-item:hover { background: color-mix(in srgb, var(--hm-ocean) 7%, var(--hm-panel)); }
    .chat-user-item.active { background: color-mix(in srgb, var(--hm-ocean) 11%, var(--hm-panel)); }
    .chat-thread-avatar-wrap { width: 44px; height: 44px; }
    .chat-thread-avatar { width: 44px !important; height: 44px !important; }
    .chat-thread-role-dot,
    .chat-thread-dot {
        box-shadow: 0 0 0 2px var(--hm-panel);
    }
    .chat-active-header { min-height: 66px; }
    #chatMessagesThread {
        padding: 18px !important;
        scroll-behavior: smooth;
    }
    .chat-bubble {
        max-width: min(76%, 620px) !important;
        padding: 10px 13px !important;
        border-radius: 14px !important;
        box-shadow: 0 2px 8px rgba(7,31,46,.04);
    }
    .chat-message-image {
        display: block;
        width: auto;
        max-width: min(320px, 100%);
        max-height: 340px;
        object-fit: contain;
        object-position: center;
        border-radius: 11px !important;
    }
    .chat-composer { gap: 8px; }
    .chat-composer input,
    .chat-composer textarea { margin: 0 !important; }

    /* Images / previews */
    img {
        max-width: 100%;
        image-orientation: from-image;
    }
    .page img:not(.avatar):not(.chat-thread-avatar):not(.chat-message-image) {
        object-fit: contain;
        object-position: center;
    }
    .chat-image-link { display: inline-block; line-height: 0; border-radius: 12px; overflow: hidden; }

    /* Auth / public */
    .auth-body { min-height: 100dvh !important; height: auto !important; padding: 18px; }
    .auth-container {
        width: min(100%, 430px) !important;
        padding: clamp(24px, 5vw, 36px) !important;
    }
    .auth-container input { margin: 7px 0 !important; }
    .auth-brand {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 9px;
    }
    .preview-body { overflow-x: hidden; }

    /* Status pills / badges */
    :is(.badge,.status-badge,.roi-badge,.season-badge,.role-badge,.archive-correction-status,.weather-badge,.tool-tag) {
        vertical-align: middle;
        line-height: 1.15;
        border-radius: 999px !important;
        font-weight: 700;
        letter-spacing: 0;
    }

    /* Custom scrollbar kept subtle and usable */
    :is(.modal-body,.tx-modal-body,#chatMessagesThread,.chat-user-panel,.hm-table-scroll,.list-box-content)::-webkit-scrollbar { width: 8px; height: 8px; }
    :is(.modal-body,.tx-modal-body,#chatMessagesThread,.chat-user-panel,.hm-table-scroll,.list-box-content)::-webkit-scrollbar-track { background: transparent; }
    :is(.modal-body,.tx-modal-body,#chatMessagesThread,.chat-user-panel,.hm-table-scroll,.list-box-content)::-webkit-scrollbar-thumb {
        background: color-mix(in srgb, var(--hm-soft-text) 38%, transparent);
        border: 2px solid transparent;
        background-clip: padding-box;
        border-radius: 999px;
    }

    /* Dark theme gets purpose-built surfaces, not inverted colors. */
    html[data-theme="dark"] {
        --hm-blue-soft: #0c3142;
        --hm-green-soft: #10392f;
        --hm-red-soft: #40232a;
        --hm-amber-soft: #402d16;
    }
    html[data-theme="dark"] .dropdown {
        background: #0d2a38 !important;
        border-color: #2a4b59 !important;
        box-shadow: 0 22px 56px rgba(0,0,0,.36) !important;
    }
    html[data-theme="dark"] .dropdown-item:hover { background: rgba(91,210,202,.09) !important; }
    html[data-theme="dark"] tbody tr:hover td { background: #153846 !important; }
    html[data-theme="dark"] .detail-item { background: #102e3b !important; border-color: #294b59 !important; }
    html[data-theme="dark"] .chat-user-item:hover { background: #103746 !important; }
    html[data-theme="dark"] .chat-user-item.active { background: #124052 !important; }
    html[data-theme="dark"] .modal-actions,
    html[data-theme="dark"] .tx-modal-footer { background: #0b2634 !important; }

    /* Accessible motion */
    @media (prefers-reduced-motion: reduce) {
        html { scroll-behavior: auto; }
        *, *::before, *::after {
            scroll-behavior: auto !important;
            transition-duration: .001ms !important;
            animation-duration: .001ms !important;
            animation-iteration-count: 1 !important;
        }
    }
}

@media screen and (max-width: 1100px) {
    .dashboard-stats-grid,
    .tx-kpi-grid { grid-template-columns: repeat(2, minmax(0,1fr)) !important; }
    .dashboard-overview-grid,
    .tx-seasonal-grid { grid-template-columns: 1fr !important; }
    .tx-header-banner { align-items: flex-start !important; }
}

@media screen and (max-width: 900px) {
    .sidebar {
        width: min(84vw, 300px) !important;
        flex-basis: auto !important;
    }
    .topbar { min-height: 64px !important; }
    .topbar-setting-button { min-width: 40px; min-height: 40px; padding-inline: 10px !important; }
    .chat-shell {
        height: min(780px, 82dvh) !important;
        min-height: 560px !important;
    }
}

@media screen and (max-width: 720px) {
    .page { padding: 14px !important; }
    .topbar { padding: 10px 12px !important; gap: 8px; }
    .topbar h2 { font-size: 16px !important; }
    .topbar-settings { gap: 5px; }
    .profile span:not(.role-badge) { display: none !important; }
    #adminProfileImg { width: 38px !important; height: 38px !important; }
    .dashboard-stats-grid,
    .tx-kpi-grid { grid-template-columns: 1fr !important; }
    .dashboard-stat-card,
    .dashboard-panel,
    .tx-kpi-card { padding: 16px !important; }
    .tx-header-actions { width: 100%; }
    .tx-header-actions > * { flex: 1 1 160px; }
    .tx-form-row { grid-template-columns: 1fr !important; }
    .modal,
    .tx-modal { padding: 8px !important; align-items: flex-end !important; }
    .modal-content,
    .tx-modal-content {
        width: 100% !important;
        max-height: calc(100dvh - 16px) !important;
        border-radius: 18px 18px 12px 12px !important;
    }
    .modal-header,
    .tx-modal-header { padding: 14px 16px !important; }
    .modal-body,
    .tx-modal-body { padding: 16px !important; }
    .modal-actions,
    .tx-modal-footer { padding: 12px 16px !important; }
    .modal-actions > *,
    .tx-modal-footer > * { flex: 1 1 0; }
    .details-grid { grid-template-columns: 1fr 1fr !important; }
    .list-box-header { align-items: stretch; }
    .list-search-container { width: 100%; }
    .list-search { width: 100% !important; }

    .chat-shell {
        height: 82dvh !important;
        min-height: 560px !important;
        border-radius: 14px !important;
    }
    .chat-user-panel { flex-basis: 136px !important; }
    .chat-user-item { margin-inline: 4px; padding: 8px !important; }
    .chat-thread-avatar-wrap,
    .chat-thread-avatar { width: 38px !important; height: 38px !important; }
    .chat-user-item .user-name { font-size: 12px !important; }
    .chat-user-last-msg { font-size: 10px !important; }
    .chat-bubble { max-width: 88% !important; }
    #chatMessagesThread { padding: 12px !important; }
}

@media screen and (max-width: 480px) {
    .page { padding: 10px !important; }
    .topbar-setting-button { padding-inline: 8px !important; }
    .topbar-setting-button span { display: none; }
    .details-grid { grid-template-columns: 1fr !important; }
    .catch-card-header { align-items: flex-start; flex-wrap: wrap; }
    .catch-actions { width: 100%; display: flex; gap: 8px; }
    .catch-actions > * { flex: 1 1 0; }
    .tx-filter-group { width: 100%; }
    .tx-filter-group :is(input,select,button) { width: 100%; }
    .auth-body { padding: 10px; }
    .auth-container { border-radius: 16px !important; padding: 22px 18px !important; }
    .chat-shell { height: calc(100dvh - 150px) !important; min-height: 500px !important; }
    .chat-user-panel { flex-basis: 112px !important; }
    .chat-thread-avatar-wrap,
    .chat-thread-avatar { width: 34px !important; height: 34px !important; }
    .chat-user-last-msg,
    .chat-thread-meta { display: none !important; }
    .chat-composer { padding: 10px !important; }
    .chat-send-button { min-width: 46px !important; padding-inline: 10px !important; }
}

/* =========================================================
   HULIMO FINAL ALIGNMENT + DARK MODE CORRECTION · 2026-09-16
   Presentation-only. No backend/API/database behavior changed.
   ========================================================= */
@media screen {
  /* Desktop uses the permanent sidebar; hamburger is mobile-only. */
  .mobile-nav-toggle { display: none !important; }

  /* Top bar/profile alignment */
  .topbar {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
  }
  .topbar > h2 { flex: 1 1 auto; margin: 0 !important; }
  .topbar-settings { flex: 0 0 auto; margin-left: auto; }
  .profile {
    flex: 0 0 auto;
    min-height: 46px !important;
    padding: 4px 9px 4px 4px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    border: 1px solid transparent;
  }
  #adminProfileImg {
    flex: 0 0 38px;
    width: 38px !important;
    height: 38px !important;
    margin: 0 !important;
  }
  .admin-role-trigger {
    margin: 0 !important;
    padding: 0 !important;
    min-height: 38px !important;
    line-height: 1 !important;
    white-space: nowrap;
  }
  .role-badge { display: inline-flex; align-items: center; justify-content: center; min-height: 22px; padding: 3px 8px; }
  .dropdown { margin-top: 0 !important; }

  /* Page header/action alignment */
  .tx-header-banner,
  .list-box-header {
    align-items: center !important;
  }
  .tx-header-banner > div:first-child { min-width: 0; flex: 1 1 420px; }
  .tx-header-banner h2 { margin: 0 0 6px !important; display: flex; align-items: center; gap: 10px; }
  .tx-header-banner p { margin: 0 !important; }
  .tx-header-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end;
    gap: 8px !important;
    flex-wrap: wrap;
  }
  .tx-header-actions > button { white-space: nowrap; }

  /* KPI cards keep content and icon on one visual axis. */
  .tx-kpi-card,
  .dashboard-stat-card {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 14px !important;
    min-height: 148px;
  }
  .tx-kpi-info,
  .dashboard-stat-card > div:first-child { min-width: 0; flex: 1 1 auto; }
  .tx-kpi-icon,
  .dashboard-stat-card > div:last-child {
    flex: 0 0 auto;
    align-self: center !important;
  }
  .tx-kpi-info .label { display: block; min-height: 30px; }
  .tx-kpi-info h3 { margin: 4px 0 6px !important; line-height: 1.08; }

  /* Seasonal cards */
  .tx-season-header {
    min-height: 58px;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
  }
  .tx-season-header h4 { margin: 0 !important; display: flex; align-items: center; gap: 8px; min-width: 0; }
  .tx-season-header .season-badge { flex: 0 0 auto; }
  .tx-season-body { min-width: 0; }

  /* Catch listing header/search alignment */
  #catch .list-box-header > h3 { flex: 1 1 320px; min-width: 0; }
  #catch .list-box-header > div { justify-content: flex-end; }
  .list-search-container .search-icon {
    top: 50% !important;
    transform: translateY(-50%);
    left: 13px !important;
    pointer-events: none;
    z-index: 2;
  }
  .list-search-container .list-search {
    min-height: 44px !important;
    height: 44px !important;
    padding-left: 40px !important;
  }

  /* Catch cards */
  .catch-card-header { align-items: center !important; gap: 14px; }
  .catch-info { min-width: 0; flex: 1 1 auto; }
  .catch-info h4 { margin: 0 0 7px !important; display: flex; align-items: center; gap: 8px; }
  .catch-info > span { display: flex; align-items: center; gap: 7px; }
  .catch-actions { margin-left: auto; justify-content: flex-end; }
  .btn-unravel { min-width: 142px; }

  /* Dashboard quick actions / storage rows */
  .dashboard-action-card { min-height: 106px; display: flex; flex-direction: column; justify-content: center; }
  .dashboard-action-card i { margin-bottom: 7px; }
  #dashCoolerBars > div { min-width: 0; }

  /* Normalize decorative emoji/icon baselines without changing text content. */
  :is(.tx-season-body,#weatherListContainer,#toolsListContainer,.species-pills) i,
  :is(.tx-season-body,#weatherListContainer,#toolsListContainer,.species-pills) .fa-solid {
    vertical-align: middle;
  }

  /* DARK MODE: purpose-built topbar/profile/dropdown and content contrast. */
  html[data-theme="dark"] .profile {
    background: #102f3d !important;
    border-color: #294b59 !important;
  }
  html[data-theme="dark"] .profile:hover { background: #153846 !important; }
  html[data-theme="dark"] .admin-role-trigger,
  html[data-theme="dark"] .profile > span,
  html[data-theme="dark"] .dropdown strong,
  html[data-theme="dark"] .dropdown span,
  html[data-theme="dark"] .dropdown i {
    color: #eefafa !important;
    -webkit-text-fill-color: #eefafa !important;
  }
  html[data-theme="dark"] .dropdown > div:first-child { border-bottom-color: #294b59 !important; }
  html[data-theme="dark"] .dropdown-item { color: #e6f4f4 !important; }
  html[data-theme="dark"] .dropdown-item i { color: #9fd8d8 !important; }

  html[data-theme="dark"] .dashboard-stat-card,
  html[data-theme="dark"] .dashboard-panel,
  html[data-theme="dark"] .dashboard-action-card,
  html[data-theme="dark"] .tx-kpi-card,
  html[data-theme="dark"] .tx-season-card,
  html[data-theme="dark"] .catch-card,
  html[data-theme="dark"] .list-box,
  html[data-theme="dark"] .list-box-content {
    background: #0d2a38 !important;
    border-color: #294b59 !important;
    color: #e8f5f5 !important;
  }
  html[data-theme="dark"] :is(.dashboard-stat-card,.dashboard-panel,.dashboard-action-card,.tx-kpi-card,.tx-season-card,.catch-card,.list-box) :is(h2,h3,h4,strong,label) {
    color: #f1fbfb !important;
    -webkit-text-fill-color: #f1fbfb !important;
  }
  html[data-theme="dark"] :is(.dashboard-stat-card,.dashboard-panel,.dashboard-action-card,.tx-kpi-card,.tx-season-card,.catch-card,.list-box) :is(p,small,.label) {
    color: #abc4cd !important;
    -webkit-text-fill-color: #abc4cd !important;
  }
  html[data-theme="dark"] .tx-season-header {
    background: #123544 !important;
    border-color: #2b5665 !important;
  }
  html[data-theme="dark"] .tx-season-header h4 { color: #f0fbfb !important; }
  html[data-theme="dark"] .tx-season-body [style*="color: #475569"],
  html[data-theme="dark"] .tx-season-body [style*="color:#475569"],
  html[data-theme="dark"] .tx-season-body [style*="color: #334155"],
  html[data-theme="dark"] .tx-season-body [style*="color:#334155"],
  html[data-theme="dark"] .tx-season-body [style*="color: #64748b"],
  html[data-theme="dark"] .tx-season-body [style*="color:#64748b"] {
    color: #b9cfd6 !important;
    -webkit-text-fill-color: #b9cfd6 !important;
  }
  html[data-theme="dark"] #catch > .list-box > div[style*="background: #f8fafc"] {
    background: #0b2634 !important;
    border-color: #294b59 !important;
  }
  html[data-theme="dark"] .list-search,
  html[data-theme="dark"] .tx-input,
  html[data-theme="dark"] .tx-select {
    background: #102f3d !important;
    color: #eefafa !important;
    -webkit-text-fill-color: #eefafa !important;
    border-color: #355865 !important;
  }
  html[data-theme="dark"] .list-search::placeholder,
  html[data-theme="dark"] .tx-input::placeholder { color: #8faab4 !important; opacity: 1; }
  html[data-theme="dark"] select option { background: #102f3d !important; color: #eefafa !important; }
}

@media screen and (max-width: 1100px) {
  .tx-header-banner { align-items: flex-start !important; }
  .tx-header-actions { width: 100%; justify-content: flex-start; }
}

@media screen and (max-width: 900px) {
  .mobile-nav-toggle { display: inline-flex !important; }
  .topbar > h2 { max-width: min(48vw, 420px); }
  .tx-kpi-card,.dashboard-stat-card { min-height: 130px; }
}

@media screen and (max-width: 720px) {
  .topbar { flex-wrap: nowrap !important; }
  .topbar > h2 { display: none; }
  .topbar-settings { margin-left: auto; }
  .profile { max-width: 150px; }
  .admin-role-trigger { max-width: 86px; overflow: hidden; }
  .role-badge { flex-shrink: 0; }
  .tx-header-actions > button { flex: 1 1 100% !important; width: 100%; }
  #catch .list-box-header > div { width: 100%; justify-content: stretch; }
  #catch .list-box-header > div > button { flex: 1 1 160px; }
  .catch-card-header { align-items: flex-start !important; }
  .catch-actions { width: 100%; margin-left: 0; justify-content: flex-start; }
}

@media screen and (max-width: 480px) {
  .profile { padding-right: 5px !important; }
  .admin-role-trigger { display: none !important; }
  .tx-kpi-card,.dashboard-stat-card { min-height: 118px; }
  .tx-season-header { align-items: flex-start !important; }
  .season-badge { margin-top: 1px; }
}

/* =========================================================
   HULIMO MICRO-ALIGNMENT PATCH · 2026-09-17
   Presentation only: sidebar rows, search fields, dashboard links.
   ========================================================= */
@media screen {
  /* Sidebar rows with nested content (Messages / Pending Applicants)
     must share the same icon/text axis as standard nav rows. */
  .sidebar li > div:first-child {
    display: flex !important;
    align-items: center !important;
    gap: 11px !important;
    min-width: 0;
    flex: 1 1 auto;
    line-height: 1.25;
  }
  .sidebar li > div:first-child > i {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 20px !important;
    min-width: 20px !important;
    height: 20px !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
    text-align: center !important;
    vertical-align: middle !important;
  }
  .sidebar li > div:first-child > span {
    display: inline-flex !important;
    align-items: center !important;
    min-width: 0;
    margin: 0 !important;
    line-height: 1.25 !important;
  }
  #sidebarMessageBadge,
  #sidebarPendingBadge {
    flex: 0 0 auto;
    align-self: center;
  }

  /* Search controls: reserve a fixed icon lane so the glyph can never
     collide with the placeholder/value, regardless of font/icon rendering. */
  .list-search-container {
    display: flex;
    align-items: center;
  }
  .list-search-container .search-icon {
    position: absolute !important;
    left: 14px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 18px !important;
    height: 18px !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 14px !important;
    line-height: 1 !important;
    pointer-events: none !important;
    z-index: 3 !important;
  }
  .list-search-container .list-search {
    padding-left: 46px !important;
    padding-right: 14px !important;
    line-height: 1.35 !important;
  }

  /* Dashboard stat-card helper links: icon, text and status dot use one
     consistent baseline/vertical center. */
  .dashboard-stat-card > div:first-child > span:last-child {
    display: inline-flex !important;
    align-items: center !important;
    gap: 7px !important;
    min-height: 20px;
    margin: 0 !important;
    line-height: 1.25 !important;
    vertical-align: middle !important;
  }
  .dashboard-stat-card > div:first-child > span:last-child > i {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 16px !important;
    min-width: 16px !important;
    height: 16px !important;
    margin: 0 !important;
    line-height: 1 !important;
    vertical-align: middle !important;
  }
  .dashboard-stat-card > div:first-child > span:last-child > span {
    flex: 0 0 auto;
    align-self: center;
  }
}

/* ======================================================================
   HuliMo search-field alignment hotfix — presentation only (2026-09-17)
   Gives the magnifying-glass glyph a dedicated lane so it can never
   collide with placeholder/value text, including inline-styled inputs.
   ====================================================================== */

/* Catch listings search */
#catch .list-search-container {
    position: relative !important;
    display: block !important;
}

#catch .list-search-container > .search-icon,
#catch .list-search-container > i.fa-search,
#catch .list-search-container > i.fa-magnifying-glass {
    position: absolute !important;
    left: 16px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 20px !important;
    height: 20px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
    font-size: 15px !important;
    pointer-events: none !important;
    z-index: 4 !important;
}

#catchSearch {
    padding-left: 52px !important;
    padding-right: 16px !important;
    text-indent: 0 !important;
    min-height: 44px !important;
    height: 44px !important;
    line-height: 1.35 !important;
}

/* Messaging search */
.chat-search-panel > div {
    position: relative !important;
}

.chat-search-panel > div > i.fa-magnifying-glass,
.chat-search-panel > div > i.fa-search {
    position: absolute !important;
    left: 16px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 20px !important;
    height: 20px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
    font-size: 15px !important;
    pointer-events: none !important;
    z-index: 4 !important;
}

#chatSearchInput {
    padding-left: 52px !important;
    padding-right: 16px !important;
    text-indent: 0 !important;
    min-height: 44px !important;
    height: 44px !important;
    line-height: 1.35 !important;
}

/* Ensure placeholder starts where typed content starts. */
#catchSearch::placeholder,
#chatSearchInput::placeholder {
    text-indent: 0 !important;
    opacity: .82;
}

/* =========================================================
   Rejected-application lookup: keep the identifier field usable
   inside the auth card. The generic auth button width rule must
   not force the flex input down to a tiny sliver.
   ========================================================= */
.resubmission-card .resubmission-check-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 108px;
    align-items: stretch;
    gap: 10px;
    width: 100%;
    margin-top: 14px;
}
.resubmission-card .resubmission-check-row input#resubmitIdentifier {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 46px;
    margin: 0 !important;
    padding: 11px 14px !important;
    box-sizing: border-box;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.35;
}
.resubmission-card .resubmission-check-row #checkResubmissionBtn {
    width: 108px !important;
    min-width: 108px;
    max-width: 108px;
    min-height: 46px;
    margin: 0 !important;
    padding: 0 16px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    white-space: nowrap;
}
.resubmission-card .resubmission-check-row input#resubmitIdentifier:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--hm-ocean, #0f6b7a) 22%, transparent);
    outline-offset: 1px;
    border-color: var(--hm-ocean, #0f6b7a);
}
@media (max-width: 430px) {
    .resubmission-card .resubmission-check-row {
        grid-template-columns: 1fr;
    }
    .resubmission-card .resubmission-check-row #checkResubmissionBtn {
        width: 100% !important;
        min-width: 0;
        max-width: none;
    }
}
\n\n/* ======================================================================\n   Rejected application lookup — definitive stacked layout hotfix\n   Keeps the identifier field usable regardless of older auth flex/grid rules.\n   ====================================================================== */\n.resubmission-card .resubmission-check-row {\n    display: block !important;\n    width: 100% !important;\n    margin: 16px 0 0 !important;\n}\n.resubmission-card .resubmission-identifier-label {\n    display: block !important;\n    width: 100% !important;\n    margin: 0 0 7px !important;\n    text-align: left !important;\n    color: #334155 !important;\n    font-size: 12px !important;\n    font-weight: 700 !important;\n    line-height: 1.35 !important;\n}\n.resubmission-card #resubmitIdentifier {\n    display: block !important;\n    position: static !important;\n    float: none !important;\n    flex: none !important;\n    width: 100% !important;\n    min-width: 100% !important;\n    max-width: 100% !important;\n    height: 46px !important;\n    min-height: 46px !important;\n    margin: 0 0 10px !important;\n    padding: 0 14px !important;\n    box-sizing: border-box !important;\n    border: 1px solid #b9ccd4 !important;\n    border-radius: 10px !important;\n    background: #ffffff !important;\n    color: #173042 !important;\n    font: inherit !important;\n    font-size: 13px !important;\n    line-height: 46px !important;\n    text-align: left !important;\n    opacity: 1 !important;\n    visibility: visible !important;\n}\n.resubmission-card #resubmitIdentifier::placeholder {\n    color: #7b8f9a !important;\n    opacity: 1 !important;\n}\n.resubmission-card #resubmitIdentifier:focus {\n    outline: none !important;\n    border-color: #0f7a89 !important;\n    box-shadow: 0 0 0 3px rgba(15,122,137,.14) !important;\n}\n.resubmission-card #checkResubmissionBtn {\n    display: flex !important;\n    width: 100% !important;\n    min-width: 100% !important;\n    max-width: 100% !important;\n    height: 46px !important;\n    min-height: 46px !important;\n    margin: 0 !important;\n    padding: 0 16px !important;\n    align-items: center !important;\n    justify-content: center !important;\n    box-sizing: border-box !important;\n}\nhtml[data-theme="dark"] .resubmission-card .resubmission-identifier-label {\n    color: #d7e8ed !important;\n}\nhtml[data-theme="dark"] .resubmission-card #resubmitIdentifier {\n    background: #0b2532 !important;\n    color: #effbfc !important;\n    border-color: #365865 !important;\n}\nhtml[data-theme="dark"] .resubmission-card #resubmitIdentifier::placeholder {\n    color: #9cb6bf !important;\n}\n