/* =============================================================
   Hexicore Design System
   Brand: #1ab394 teal | IoT Dashboard
   ============================================================= */

/* ── 1. Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;600;700&display=swap');

/* ── 2. Design Tokens ────────────────────────────────────────── */
:root {
    --hx-primary:        #1ab394;
    --hx-primary-dark:   #148a72;
    --hx-primary-light:  #e8f8f5;
    --hx-success:        #27ae60;
    --hx-success-light:  #eafaf1;
    --hx-warning:        #f39c12;
    --hx-warning-light:  #fef9e7;
    --hx-danger:         #e74c3c;
    --hx-danger-light:   #fdedec;
    --hx-neutral:        #95a5a6;
    --hx-neutral-light:  #f4f6f7;
    --hx-bg-page:        #f4f6f9;
    --hx-bg-sidebar:     #2c3e50;
    --hx-bg-card:        #ffffff;
    --hx-text-primary:   #2c3e50;
    --hx-text-muted:     #7f8c8d;
    --hx-border:         #e8ecef;
    --hx-border-radius:  8px;
    --hx-border-radius-sm: 4px;
    --hx-shadow:         0 2px 8px rgba(0, 0, 0, 0.08);
    --hx-shadow-hover:   0 6px 20px rgba(26, 179, 148, 0.18);
    --hx-transition:     all 0.2s ease;
    --hx-navbar-height:  56px;
}

/* ── 3. Base Reset & Body ────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--hx-bg-page);
    color: var(--hx-text-primary);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ── 4. Navbar Override ──────────────────────────────────────── */
.navbar.hx-navbar {
    background-color: var(--hx-primary) !important;
    min-height: var(--hx-navbar-height);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    padding: 0 1rem;
}

/* Allow the collapsed menu to expand below the navbar on mobile */
.navbar.hx-navbar .navbar-collapse {
    background-color: var(--hx-primary);
    padding: 0.5rem 0;
}

.navbar.hx-navbar .navbar-collapse .nav-item {
    border-top: 1px solid rgba(255,255,255,0.1);
}

.navbar.hx-navbar .navbar-collapse .nav-link {
    padding: 0.65rem 0.75rem;
}

.navbar.hx-navbar .navbar-brand {
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    color: #fff !important;
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar.hx-navbar .navbar-brand img {
    height: 28px;
    filter: brightness(0) invert(1); /* Makes logo white on teal */
}

.navbar.hx-navbar .navbar-brand img.hx-navbar-logo {
    filter: none;
    height: 44px;
}

.hx-navbar-title {
    color: rgba(255,255,255,0.9);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    margin-left: 0.75rem;
    border-left: 1px solid rgba(255,255,255,0.3);
    padding-left: 0.75rem;
}

#hxThemeToggle { display: none !important; }
    color: rgba(255,255,255,0.85) !important;
    font-weight: 600;
    font-size: 0.875rem;
    transition: var(--hx-transition);
}

.navbar.hx-navbar .nav-link:hover,
.navbar.hx-navbar .nav-link.active {
    color: #fff !important;
}

/* Logout link styling */
.navbar.hx-navbar .nav-link.hx-logout {
    color: rgba(255,255,255,0.7) !important;
}
.navbar.hx-navbar .nav-link.hx-logout:hover {
    color: #fff !important;
}

/* ── 5. Breadcrumb ───────────────────────────────────────────── */
.hx-breadcrumb {
    background: #fff;
    border-bottom: 1px solid var(--hx-border);
    padding: 0.5rem 1.25rem;
    font-size: 0.8rem;
}

.hx-breadcrumb .breadcrumb {
    margin-bottom: 0;
    background: transparent;
    padding: 0;
}

.hx-breadcrumb .breadcrumb-item a {
    color: var(--hx-primary);
    text-decoration: none;
}

.hx-breadcrumb .breadcrumb-item a:hover {
    text-decoration: underline;
}

.hx-breadcrumb .breadcrumb-item.active {
    color: var(--hx-text-muted);
}

/* ── 6. Cards ────────────────────────────────────────────────── */
.hx-card {
    background: var(--hx-bg-card);
    border: 1px solid var(--hx-border);
    border-radius: var(--hx-border-radius);
    box-shadow: var(--hx-shadow);
    transition: var(--hx-transition);
}

.hx-card:hover {
    box-shadow: var(--hx-shadow-hover);
}

.hx-card .card-header {
    background: transparent;
    border-bottom: 1px solid var(--hx-border);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--hx-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.75rem 1rem;
}

/* ── 7. KPI Stat Cards ───────────────────────────────────────── */
.hx-stat-card {
    background: var(--hx-bg-card);
    border: 1px solid var(--hx-border);
    border-radius: var(--hx-border-radius);
    padding: 1.25rem 1rem;
    box-shadow: var(--hx-shadow);
    position: relative;
    overflow: hidden;
}

.hx-stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px; height: 100%;
    background: var(--hx-primary);
}

.hx-stat-card.stat-success::before { background: var(--hx-success); }
.hx-stat-card.stat-warning::before { background: var(--hx-warning); }
.hx-stat-card.stat-danger::before  { background: var(--hx-danger);  }
.hx-stat-card.stat-neutral::before { background: var(--hx-neutral); }

.hx-stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--hx-text-primary);
    line-height: 1.1;
}

.hx-stat-card .stat-label {
    font-size: 0.75rem;
    color: var(--hx-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
}

.hx-stat-card .stat-sub {
    font-size: 0.78rem;
    color: var(--hx-text-muted);
    margin-top: 0.4rem;
}

.hx-stat-card .stat-icon {
    position: absolute;
    top: 1rem; right: 1rem;
    font-size: 1.6rem;
    opacity: 0.12;
    color: var(--hx-text-primary);
}

/* ── 8. Device Cards ─────────────────────────────────────────── */
.hx-device-card {
    background: var(--hx-bg-card);
    border: 1px solid var(--hx-border);
    border-radius: var(--hx-border-radius);
    box-shadow: var(--hx-shadow);
    transition: var(--hx-transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    border-left: 4px solid var(--hx-neutral);
}

.hx-device-card:hover {
    box-shadow: var(--hx-shadow-hover);
    transform: translateY(-2px);
}

.hx-device-card.device-online   { border-left-color: var(--hx-success); }
.hx-device-card.device-alarm    { border-left-color: var(--hx-danger); }
.hx-device-card.device-warning  { border-left-color: var(--hx-warning); }
.hx-device-card.device-offline  { border-left-color: var(--hx-neutral); }
.hx-device-card.device-nodata   { border-left-color: var(--hx-neutral); opacity: 0.75; }

.hx-device-card .device-card-header {
    padding: 0.75rem 1rem 0.5rem 1rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.hx-device-card .device-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--hx-text-primary);
    flex: 1;
    word-break: break-word;
}

.hx-device-card .device-card-body {
    padding: 0 1rem 0.75rem 1rem;
    flex: 1;
}

.hx-device-card .device-card-footer {
    padding: 0.5rem 1rem;
    border-top: 1px solid var(--hx-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--hx-text-muted);
    background: var(--hx-neutral-light);
}

/* ── 9. Status Badges ────────────────────────────────────────── */
.hx-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.hx-badge-online  { background: var(--hx-success-light);  color: var(--hx-success); }
.hx-badge-offline { background: var(--hx-neutral-light);  color: var(--hx-neutral); }
.hx-badge-alarm   { background: var(--hx-danger-light);   color: var(--hx-danger);  }
.hx-badge-warning { background: var(--hx-warning-light);  color: var(--hx-warning); }
.hx-badge-running { background: var(--hx-primary-light);  color: var(--hx-primary-dark); }
.hx-badge-stopped { background: var(--hx-neutral-light);  color: var(--hx-neutral); }

/* Pulsing dot for live/online */
.hx-pulse {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--hx-success);
    box-shadow: 0 0 0 0 rgba(39, 174, 96, 0.4);
    animation: hx-pulse 2s infinite;
}

@keyframes hx-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(39,174,96,0.4); }
    70%  { box-shadow: 0 0 0 8px rgba(39,174,96,0); }
    100% { box-shadow: 0 0 0 0 rgba(39,174,96,0); }
}

/* ── 10. Alarm Count Badge ───────────────────────────────────── */
.hx-alarm-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
}

.hx-alarm-badge.no-alarms  { background: var(--hx-success-light); color: var(--hx-success); }
.hx-alarm-badge.has-alarms { background: var(--hx-danger-light);  color: var(--hx-danger);  }

/* ── 11. Progress Bars (oil levels) ─────────────────────────── */
.hx-level-row {
    margin-bottom: 0.5rem;
}

.hx-level-row .level-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--hx-text-muted);
    margin-bottom: 3px;
}

.hx-level-row .level-label .level-pct {
    font-weight: 700;
    color: var(--hx-text-primary);
}

.hx-progress {
    height: 8px;
    border-radius: 4px;
    background: var(--hx-border);
    overflow: hidden;
}

.hx-progress-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

.hx-progress-bar.level-high    { background: var(--hx-success); }
.hx-progress-bar.level-medium  { background: var(--hx-warning); }
.hx-progress-bar.level-low     { background: var(--hx-danger);  }

/* ── 12. Fleet Summary Bar ───────────────────────────────────── */
.hx-fleet-bar {
    background: #fff;
    border-bottom: 1px solid var(--hx-border);
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.hx-fleet-bar .fleet-logo img {
    height: 36px;
}

.hx-fleet-bar .fleet-stats {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.hx-fleet-bar .fleet-stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    font-weight: 600;
}

.hx-fleet-bar .fleet-stat-item .stat-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.hx-fleet-bar .fleet-stat-item .stat-dot.dot-online  { background: var(--hx-success); }
.hx-fleet-bar .fleet-stat-item .stat-dot.dot-offline { background: var(--hx-neutral); }
.hx-fleet-bar .fleet-stat-item .stat-dot.dot-alarm   { background: var(--hx-danger);  }
.hx-fleet-bar .fleet-stat-item .stat-dot.dot-total   { background: var(--hx-primary); }

.hx-fleet-bar .fleet-refresh {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.78rem;
    color: var(--hx-text-muted);
}

/* ── 13. Filter Toolbar ──────────────────────────────────────── */
.hx-filter-bar {
    background: #fff;
    border: 1px solid var(--hx-border);
    border-radius: var(--hx-border-radius);
    padding: 0.65rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    box-shadow: var(--hx-shadow);
}

.hx-filter-bar .filter-search {
    flex: 1;
    min-width: 160px;
    position: relative;
}

.hx-filter-bar .filter-search i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--hx-text-muted);
    font-size: 0.85rem;
}

.hx-filter-bar .filter-search input {
    padding-left: 30px;
    border-radius: 20px;
    border: 1px solid var(--hx-border);
    font-size: 0.85rem;
    height: 34px;
    width: 100%;
}

.hx-filter-bar .filter-search input:focus {
    border-color: var(--hx-primary);
    box-shadow: 0 0 0 2px rgba(26,179,148,0.15);
    outline: none;
}

.hx-filter-bar select,
.hx-filter-bar .btn-filter {
    height: 34px;
    font-size: 0.82rem;
    border-radius: var(--hx-border-radius-sm);
    border: 1px solid var(--hx-border);
    padding: 0 0.75rem;
    background: #fff;
    color: var(--hx-text-primary);
    cursor: pointer;
}

.hx-filter-bar select:focus {
    border-color: var(--hx-primary);
    box-shadow: 0 0 0 2px rgba(26,179,148,0.15);
    outline: none;
}

.hx-view-toggle .btn {
    padding: 4px 10px;
    font-size: 0.8rem;
    border-color: var(--hx-border);
    color: var(--hx-text-muted);
}

.hx-view-toggle .btn.active {
    background: var(--hx-primary);
    border-color: var(--hx-primary);
    color: #fff;
}

/* ── 14. Skeleton Loader ─────────────────────────────────────── */
.hx-skeleton {
    background: linear-gradient(90deg, #e8ecef 25%, #f4f6f9 50%, #e8ecef 75%);
    background-size: 200% 100%;
    animation: hx-shimmer 1.4s infinite;
    border-radius: var(--hx-border-radius-sm);
}

@keyframes hx-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.hx-skeleton-card {
    background: var(--hx-bg-card);
    border: 1px solid var(--hx-border);
    border-radius: var(--hx-border-radius);
    padding: 1rem;
    height: 220px;
}

.hx-skeleton-line {
    height: 12px;
    margin-bottom: 8px;
    border-radius: 4px;
}

.hx-skeleton-line.w-75  { width: 75%; }
.hx-skeleton-line.w-50  { width: 50%; }
.hx-skeleton-line.w-90  { width: 90%; }
.hx-skeleton-line.w-40  { width: 40%; }
.hx-skeleton-line.h-20  { height: 20px; }
.hx-skeleton-line.h-8   { height: 8px; }

/* ── 15. Alarm Panel ─────────────────────────────────────────── */
.hx-alarm-panel .alarm-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.75rem;
    border-left: 3px solid transparent;
    border-bottom: 1px solid var(--hx-border);
    font-size: 0.85rem;
    gap: 0.75rem;
}

.hx-alarm-panel .alarm-item:last-child {
    border-bottom: none;
}

.hx-alarm-panel .alarm-item.alarm-active {
    border-left-color: var(--hx-danger);
    background: var(--hx-danger-light);
}

.hx-alarm-panel .alarm-item.alarm-clear {
    border-left-color: var(--hx-success);
    color: var(--hx-text-muted);
}

.hx-alarm-panel .alarm-name {
    flex: 1;
    font-weight: 600;
}

.hx-alarm-panel .alarm-count {
    min-width: 70px;
    text-align: right;
    font-weight: 700;
}

.hx-alarm-panel .alarm-bar {
    width: 80px;
}

.hx-alarm-all-clear {
    padding: 1.25rem;
    text-align: center;
    color: var(--hx-success);
    font-weight: 600;
    font-size: 0.9rem;
}

/* ── 16. Insights Panel ──────────────────────────────────────── */
.hx-insights-panel .insight-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--hx-border);
    font-size: 0.85rem;
}

.hx-insights-panel .insight-item:last-child {
    border-bottom: none;
}

.hx-insights-panel .insight-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.hx-insights-panel .insight-icon.icon-ok      { background: var(--hx-success-light); color: var(--hx-success); }
.hx-insights-panel .insight-icon.icon-warn    { background: var(--hx-warning-light); color: var(--hx-warning); }
.hx-insights-panel .insight-icon.icon-danger  { background: var(--hx-danger-light);  color: var(--hx-danger);  }
.hx-insights-panel .insight-icon.icon-info    { background: var(--hx-primary-light); color: var(--hx-primary); }

.hx-insights-panel .insight-text {
    line-height: 1.4;
    color: var(--hx-text-primary);
}

.hx-insights-panel .insight-text strong {
    display: block;
    font-weight: 600;
    margin-bottom: 1px;
}

.hx-insights-panel .insight-text span {
    color: var(--hx-text-muted);
    font-size: 0.8rem;
}

/* ── 17. Gauge Chart Container ───────────────────────────────── */
.hx-gauge-wrapper {
    position: relative;
    text-align: center;
    margin-bottom: 0.5rem;
}

.hx-gauge-label {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--hx-text-primary);
    pointer-events: none;
}

.hx-gauge-sublabel {
    font-size: 0.7rem;
    color: var(--hx-text-muted);
    display: block;
    line-height: 1;
}

/* ── 18. Live Refresh Indicator ──────────────────────────────── */
.hx-live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--hx-text-muted);
    padding: 3px 10px;
    border-radius: 20px;
    background: var(--hx-neutral-light);
    border: 1px solid var(--hx-border);
}

.hx-live-indicator.is-live .live-dot { background: var(--hx-success); animation: hx-pulse 2s infinite; }
.hx-live-indicator .live-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--hx-neutral);
}

/* ── 19. Details Page Header ─────────────────────────────────── */
.hx-device-header {
    background: #fff;
    border-bottom: 1px solid var(--hx-border);
    padding: 1rem 1.25rem;
}

.hx-device-header .device-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--hx-text-primary);
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.hx-device-header .device-meta {
    font-size: 0.8rem;
    color: var(--hx-text-muted);
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 0.25rem;
}

/* Date range inline panel */
.hx-date-range-panel {
    background: var(--hx-primary-light);
    border: 1px solid var(--hx-primary);
    border-radius: var(--hx-border-radius);
    padding: 0.75rem 1rem;
    margin-top: 0.75rem;
    display: none;
}

.hx-date-range-panel.open {
    display: block;
}

.hx-date-range-trigger {
    background: none;
    border: 1px solid var(--hx-primary);
    color: var(--hx-primary);
    border-radius: 20px;
    padding: 3px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--hx-transition);
    white-space: nowrap;
}

.hx-date-range-trigger:hover {
    background: var(--hx-primary);
    color: #fff;
}

/* ── 20. Utility / Overrides ─────────────────────────────────── */
.btn-hx-primary {
    background: var(--hx-primary);
    border-color: var(--hx-primary);
    color: #fff;
    font-weight: 600;
    border-radius: var(--hx-border-radius-sm);
    transition: var(--hx-transition);
}

.btn-hx-primary:hover {
    background: var(--hx-primary-dark);
    border-color: var(--hx-primary-dark);
    color: #fff;
}

.btn-hx-outline {
    background: transparent;
    border: 1px solid var(--hx-primary);
    color: var(--hx-primary);
    font-weight: 600;
    border-radius: var(--hx-border-radius-sm);
    transition: var(--hx-transition);
}

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

/* Page container max width */
.hx-page-wrap {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 1rem 1rem;
}

/* Toast container */
.hx-toast-container {
    position: fixed;
    top: calc(var(--hx-navbar-height) + 8px);
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 360px;
}

/* Side menu kept for details page date range */
.side-menu {
    position: fixed;
    top: 0;
    right: -380px;
    width: 380px;
    height: 100%;
    background-color: #fff;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.15);
    transition: right 0.3s ease;
    z-index: 1050;
}

.side-menu.open { right: 0; }

.side-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background-color: var(--hx-primary);
    color: white;
}

.side-menu-header h5 { margin: 0; font-weight: 700; }

.side-menu-content { padding: 1.25rem; }

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

/* ── 21. Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
    .hx-fleet-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .hx-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .hx-filter-bar .filter-search { min-width: 100%; }

    .hx-device-header .device-title { font-size: 1.1rem; }

    .hx-stat-card .stat-value { font-size: 1.5rem; }
}

@media (max-width: 576px) {
    .hx-page-wrap { padding: 0.75rem; }

    .hx-fleet-bar .fleet-stats { gap: 0.75rem; }
}

/* -- Data Timeline (inside side menu) ----------------------------------------
   30-day availability grid. Click a day to load it.                          */
.hx-tl-sm-label {
    font-size: 0.75rem; font-weight: 700; color: var(--hx-text-primary);
    text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.2rem;
}
.hx-tl-sm-hint { font-size: 0.75rem; color: var(--hx-text-muted); margin-bottom: 0.4rem; }
.hx-tl-sm-legend { display: flex; gap: 1rem; font-size: 0.7rem; color: var(--hx-text-muted); margin-bottom: 0.6rem; }
.hx-tl-sm-legend span { display: flex; align-items: center; gap: 4px; }
.hx-tl-legend-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex-shrink: 0; }
.hx-tl-legend-dot.dot-data     { background: var(--hx-primary-light); border: 1.5px solid var(--hx-primary); }
.hx-tl-legend-dot.dot-selected { background: rgba(245,158,11,0.18); border: 1.5px solid #f59e0b; }
.hx-tl-legend-dot.dot-empty    { background: var(--hx-bg-card); border: 1.5px solid var(--hx-border); }
.hx-tl-sm {
    display: grid; grid-template-columns: repeat(6, 1fr);
    gap: 4px; user-select: none; -webkit-user-select: none;
}
.hx-tl-month-header {
    grid-column: 1 / -1; font-size: 0.7rem; font-weight: 700;
    color: var(--hx-text-primary); text-transform: uppercase; letter-spacing: 0.05em;
    padding: 6px 0 2px; border-top: 1px solid var(--hx-border); margin-top: 2px;
}
.hx-tl-month-header:first-child { border-top: none; padding-top: 0; margin-top: 0; }
.hx-tl-cell.hx-tl-empty { visibility: hidden; pointer-events: none; }
.hx-tl-cell {
    height: 40px; border-radius: 6px; background: var(--hx-bg-card);
    border: 1.5px solid var(--hx-border); cursor: pointer;
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 4px;
    transition: border-color 0.12s, background 0.12s, transform 0.08s; position: relative;
}
.hx-tl-cell:hover { border-color: var(--hx-primary); transform: scale(1.04); z-index: 2; }
.hx-tl-label { font-size: 0.72rem; font-weight: 700; color: var(--hx-text-muted); line-height: 1; pointer-events: none; }
.hx-tl-dot   { font-size: 0.58rem; font-weight: 700; color: transparent; line-height: 1; pointer-events: none; }
.hx-tl-cell.has-data { background: var(--hx-primary-light); border-color: var(--hx-primary); }
.hx-tl-cell.has-data .hx-tl-label { color: var(--hx-primary-dark); }
.hx-tl-cell.has-data .hx-tl-dot   { color: var(--hx-primary-dark); }
.hx-tl-cell.has-data::after {
    content: ''; position: absolute; inset: -3px; border-radius: 8px;
    border: 2px solid rgba(26, 179, 148, 0.25); pointer-events: none;
}
.hx-tl-cell.in-range { background: rgba(245,158,11,0.10) !important; border-color: rgba(245,158,11,0.60) !important; }
.hx-tl-cell.in-range .hx-tl-label { color: var(--hx-text-primary); }
.hx-tl-cell.range-start,
.hx-tl-cell.range-end {
    background: rgba(245,158,11,0.18) !important; border-color: #f59e0b !important;
    box-shadow: 0 0 0 2px rgba(245,158,11,0.35);
}
.hx-tl-cell.range-start .hx-tl-label,
.hx-tl-cell.range-end .hx-tl-label { color: #92400e; font-weight: 700; }
.hx-tl-cell.has-data.range-start,
.hx-tl-cell.has-data.range-end {
    background: var(--hx-primary-light) !important; border-color: #f59e0b !important;
    box-shadow: 0 0 0 2px rgba(245,158,11,0.45);
}
.hx-tl-cell.range-start::after, .hx-tl-cell.range-end::after, .hx-tl-cell.in-range::after { display: none; }
@media (max-width: 576px) {
    .hx-tl-sm { grid-template-columns: repeat(6, 1fr); gap: 3px; }
    .hx-tl-cell { height: 36px; }
    .hx-tl-label { font-size: 0.65rem; }
}

/* ── 1-Hour Time Slot Grid ── */
.hx-hour-grid           { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; padding: 6px 0; }
.hx-tp-chip             { padding: 8px 2px; text-align: center; font-size: 0.72rem;
                           font-weight: 600; border-radius: 5px; cursor: pointer;
                           border: 1px solid var(--hx-border,#e0e0e0);
                           background: var(--hx-card-bg,#f7f7f7); color: var(--hx-text,#444);
                           transition: background 0.1s, color 0.1s; }
.hx-tp-chip:hover,
.hx-tp-chip.active      { background: var(--hx-primary,#00897b); color: #fff; border-color: var(--hx-primary,#00897b); }
.hx-tp-chip.hx-tp-now-chip { border-color: var(--hx-primary,#00897b); font-weight: 700; }
.hx-tp-chip.hx-tp-past  { opacity: 0.45; }
.hx-tp-chip.has-data    { border-color: var(--hx-primary,#00897b); }
.hx-slot-dot            { display: block; width: 4px; height: 4px; border-radius: 50%;
                           background: var(--hx-primary,#00897b); margin: 2px auto 0; }
.hx-tp-chip.active .hx-slot-dot,
.hx-tp-chip:hover  .hx-slot-dot { background: #fff; }
