:root {
    --bg: #ffffff;
    --panel: #ffffff;
    --panel-soft: #f8f9fb;
    --border: #d9dde3;
    --text: #1f2933;
    --muted: #6b7280;
    --accent: #c43b32;
    --accent-soft: #f3dedc;
    --sidebar: #252a31;
    --sidebar-soft: #2f3540;
    --sidebar-text: #d7dce3;
    --sidebar-muted: #8f98a6;
    --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
}

body.intra-app {
    height: 100vh;
    overflow: hidden;
}

.intra-shell {
    height: 100vh;
    min-height: 0;
    overflow: hidden;
}

#intra-content[data-current-page="fours"] {
    height: 100vh;
    min-height: 0;
    overflow: hidden;
}

.intra-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 248px 1fr;
}

.intra-sidebar {
    background: var(--sidebar);
    color: var(--sidebar-text);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    height: 84px;
    padding: 18px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--accent);
    color: white;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 22px;
}

.brand-title {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.brand-zone {
    margin-top: 2px;
    font-size: 13px;
    color: var(--sidebar-muted);
}

.sidebar-menu {
    padding: 14px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-link {
    height: 46px;
    padding: 0 13px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: 9px;
    font-size: 15px;
    font-weight: 500;
    transition: background 0.12s ease, color 0.12s ease, transform 0.12s ease;
}

.sidebar-link i {
    width: 22px;
    color: var(--sidebar-muted);
    text-align: center;
}

.sidebar-link:hover {
    background: var(--sidebar-soft);
    color: white;
}

.sidebar-link:hover i {
    color: white;
}

.sidebar-link.active {
    background: var(--accent);
    color: white;
    box-shadow: inset 3px 0 0 rgba(255, 255, 255, 0.45);
}

.sidebar-link.active i {
    color: white;
}

.intra-main {
    min-width: 0;
    padding: 28px;
}

.intra-page-title {
    min-height: 72px;
    margin-bottom: 22px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.intra-page-title h1 {
    margin: 0;
    font-size: 30px;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.intra-page-title p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 15px;
}

.intra-page-content {
    padding: 24px;
}

.card {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel);
    box-shadow: none;
}

.card h2 {
    margin: 0 0 16px;
    font-size: 18px;
    font-weight: 650;
}

.echart {
    width: 100%;
    height: 280px;
}

.echart.tall {
    height: 420px;
}

.meteo-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 18px;
}

.meteo-grid .large {
    grid-row: span 2;
}

.page-title {
    margin-bottom: 22px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    
    display: none;
}

.page-title h1 {
    margin: 0;
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.page-title p {
    margin: 6px 0 0;
    color: var(--muted);
}

.page-updated {
    color: var(--muted);
    font-size: 13px;
    background: var(--panel-soft);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 7px 12px;
}

.intra-content {
    padding: 28px;
    width: 100%;
}

.intra-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 248px 1fr;
    background: var(--bg);
}

.intra-home {
    background: #111827;
    color: white;
}

@media (max-width: 900px) {
    .intra-shell,
    .intra-page {
        grid-template-columns: 76px 1fr;
    }

    .sidebar-brand {
        justify-content: center;
        padding: 14px 8px;
    }

    .sidebar-brand > div:not(.brand-mark),
    .sidebar-link span {
        display: none;
    }

    .sidebar-link {
        justify-content: center;
        padding: 0;
    }

    .meteo-grid {
        grid-template-columns: 1fr;
    }

    .sidebar-toggle {
        display: none;
    }

}


.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

.tile {
    min-height: 150px;
    padding: 22px;
    display: flex;
    align-items: flex-start;
    gap: 18px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--panel);
    color: var(--text);
    text-decoration: none;
    box-shadow: var(--shadow);
    transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.tile:hover {
    transform: translateY(-2px);
    border-color: #c5cbd3;
    color: var(--text);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
}

.tile i {
    width: 46px;
    height: 46px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 21px;
}

.tile h2 {
    margin: 0;
    font-size: 19px;
    font-weight: 700;
}

.tile p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 14px;
}


.kuma-frame {
    width: 100%;
    height: calc(100vh - 170px);
    border: 0;
    border-radius: 14px;
    background: white;
}







.intra-content {
    padding: 48px 52px;
}

.page-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 32px;
    margin-bottom: 28px;
}

.page-title h1 {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 800;
    color: #111827;
}

.page-title p {
    margin: 0;
    max-width: 520px;
    color: #667085;
    line-height: 1.5;
}

.page-updated {
    padding: 9px 14px;
    border: 1px solid #d9dee8;
    border-radius: 999px;
    color: #667085;
    font-size: 13px;
    background: #f8fafc;
}

.tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin: 0 0 24px;
    padding: 6px;
    background: #f3f5f8;
    border: 1px solid #e1e6ef;
    border-radius: 14px;
}

.tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 14px;
    border-radius: 10px;
    color: #667085;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.tab:hover {
    color: #111827;
    background: #ffffff;
    text-decoration: none;
}

.tab.active {
    color: #ffffff;
    background: #c84f3f;
    box-shadow: 0 6px 16px rgba(200, 79, 63, .25);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.chart-card {
    padding: 18px;
    margin-bottom: 22px;
    background: #ffffff;
    border: 1px solid #e5e9f0;
    border-radius: 18px;
    box-shadow: 0 12px 30px rgba(16, 24, 40, .06);
}

.empty-card {
    padding: 24px;
    color: #667085;
    background: #ffffff;
    border: 1px dashed #d9dee8;
    border-radius: 18px;
}





.gauge-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 22px;
}

.gauge-card {
    padding: 18px;
    text-align: center;
    /*background: #ffffff;
    border: 1px solid #e5e9f0;
    border-radius: 18px;
    box-shadow: 0 12px 30px rgba(16, 24, 40, .06);*/
}

.gauge-card canvas {
    width: 100%;
    height: 150px;
}

.gauge-title {
    margin-bottom: 8px;
    color: #667085;
    font-size: 14px;
    font-weight: 600;
}

.gauge-value {
    margin-top: -8px;
    color: #111827;
    font-size: 18px;
}

.gauge-value strong {
    font-size: 28px;
}

@media (max-width: 900px) {
    .gauge-grid {
        grid-template-columns: 1fr;
    }
}


.gauge-grid-live {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.gauge-grid-live .gauge-card canvas {
    height: 125px;
}

.gauge-value small {
    display: block;
    min-height: 18px;
    margin-top: 2px;
    color: #667085;
    font-size: 12px;
    font-weight: 600;
}


.intra-shell,
.intra-page {
    transition: grid-template-columns .2s ease;
}

.sidebar-brand {
    position: relative;
}

.brand-copy {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    transition: opacity .15s ease, width .2s ease;
}

.sidebar-toggle {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    color: var(--sidebar-muted);
    background: transparent;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    transition: color .12s ease, background .12s ease;
}

.sidebar-toggle:hover {
    color: #ffffff;
    background: var(--sidebar-soft);
}

.sidebar-toggle i {
    font-size: 13px;
}

body.nav-compact .intra-shell,
body.nav-compact .intra-page {
    grid-template-columns: 76px 1fr;
}

body.nav-compact .sidebar-brand {
    justify-content: center;
    padding: 14px 8px;
}

body.nav-compact .brand-copy,
body.nav-compact .sidebar-link span {
    display: none;
}

body.nav-compact .sidebar-toggle {
    position: absolute;
    right: 4px;
    bottom: 4px;
    width: 24px;
    height: 24px;
    flex-basis: 24px;
}

body.nav-compact .sidebar-link {
    justify-content: center;
    padding: 0;
}

body.nav-compact .sidebar-link i {
    width: auto;
}







.battery-card {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.battery-gauge {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 125px;
}

.battery-body {
    position: relative;
    width: 150px;
    height: 72px;
    overflow: hidden;
    border: 4px solid #374151;
    border-radius: 10px;
    background: #eef2f7;
}

.battery-tip {
    width: 10px;
    height: 30px;
    margin-left: 4px;
    border-radius: 0 5px 5px 0;
    background: #374151;
}

.battery-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0;
    background: #22c55e;
    transition: width .5s ease, background-color .3s ease;
}

.battery-level {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    place-items: center;
    color: #111827;
    font-size: 25px;
    font-weight: 800;
}



.autarky-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 24px;
    align-items: stretch;
}

.autarky-chart {
    min-width: 0;
}

.autarky-chart .chart-card {
    height: 100%;
    margin-bottom: 0;
}

.autarky-gauges {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 16px;
}

.autarky-gauges .gauge-card {
    flex: 1;
    min-height: 0;
}

.autarky-gauges canvas {
    width: 100%;
    height: 115px;
}

@media (max-width: 1100px) {
    .autarky-layout {
        grid-template-columns: 1fr;
    }

    .autarky-gauges {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }
}








.ev-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 46px;
    margin-bottom: 12px;
    padding: 0 4px;
}

.ev-summary > div:first-child {
    display: flex;
    align-items: baseline;
    gap: 7px;
    color: #667085;
    font-size: 13px;
}

.ev-summary strong {
    color: #101828;
    font-size: 24px;
}

.ev-updated {
    color: #98a2b3;
    font-size: 11px;
}

.ev-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.ev-card {
    display: grid;
    grid-template-columns: 54px 1fr auto;
    align-items: center;
    min-height: 130px;
    padding: 18px;
    border: 1px solid #e4e7ec;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(16, 24, 40, .04);
}

.ev-card.is-charging {
    border-color: #86efac;
    background: linear-gradient(
        135deg,
        rgba(240, 253, 244, .9),
        #ffffff
    );
}

.ev-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: #f2f4f7;
    color: #98a2b3;
    font-size: 20px;
}

.ev-card.is-charging .ev-icon {
    background: #dcfce7;
    color: #16a34a;
}

.ev-name {
    overflow: hidden;
    color: #101828;
    font-size: 15px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ev-status {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    color: #667085;
    font-size: 12px;
}

.ev-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d0d5dd;
}

.ev-card.is-charging .ev-status-dot {
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, .12);
}

.ev-values {
    min-width: 105px;
    text-align: right;
}

.ev-power {
    color: #101828;
    font-size: 23px;
    font-weight: 800;
}

.ev-power small {
    color: #667085;
    font-size: 12px;
    font-weight: 500;
}

.ev-energy {
    margin-top: 5px;
    color: #98a2b3;
    font-size: 11px;
}

@media (max-width: 1200px) {
    .ev-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.ev-group {
    margin-bottom: 28px;
}

.ev-group-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 14px;
    padding: 0 4px;
}

.ev-group-title {
    color: #101828;
    font-size: 22px;
    font-weight: 800;
}

.ev-group-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #667085;
    font-size: 12px;
}

.ev-group-summary span {
    padding: 5px 9px;
    border-radius: 999px;
    background: #f2f4f7;
}

.ev-group-summary .is-occupied {
    color: #b54708;
    background: #fffaeb;
}

.ev-group-summary .is-available {
    color: #027a48;
    background: #ecfdf3;
}

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

.ev-card {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    min-height: 104px;
    padding: 16px 18px;
    overflow: hidden;
}

.ev-main {
    min-width: 0;
}

.ev-name {
    overflow: hidden;
    font-size: 15px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ev-values {
    min-width: 86px;
    margin-left: 12px;
    text-align: right;
}

.ev-power {
    font-size: 20px;
    font-weight: 800;
    white-space: nowrap;
}

.ev-power small {
    font-size: 11px;
}

.ev-energy {
    margin-top: 4px;
    font-size: 10px;
}




.ev-values {
    width: 112px;
    min-width: 112px;
    margin-left: 16px;
}

.ev-power-row {
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 4px;
    margin-bottom: 8px;
    white-space: nowrap;
}

.ev-power-row strong {
    color: #101828;
    font-size: 19px;
    font-weight: 800;
    line-height: 1;
}

.ev-power-row span {
    color: #98a2b3;
    font-size: 10px;
}

.ev-power-gauge {
    position: relative;
    width: 100%;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #eaecf0;
}

.ev-power-gauge-fill {
    display: block;
    width: 0;
    height: 100%;
    min-width: 0;
    border-radius: inherit;
    background: #22c55e;
    transition: width .35s ease;
}

.ev-card.is-occupied .ev-power-gauge-fill {
    background: #f59e0b;
}

.ev-card.is-charging .ev-power-gauge-fill {
    background: #22c55e;
}

.ev-card.is-disabled .ev-power-gauge-fill,
.ev-card.is-faulted .ev-power-gauge-fill {
    background: #ef4444;
}


.ev-power-gauge::before {
    content: "";
    position: absolute;
    z-index: 1;
    top: 0;
    bottom: 0;
    left: 2px;
    width: 2px;
    border-radius: 2px;
    background: #98a2b3;
    opacity: .7;
}


.battery-history {
    margin-top: 6px;
    font-size: 12px;
    font-weight: 700;
}

.battery-min {
    color: #64748b;
}

.battery-max {
    color: #22c55e;
}

#energySankey {
	width: 100%;
	height: 360px;
	min-height: 360px;
}






















/* Page Vault injectée dans la zone centrale */
.vault-page {
    height: calc(100vh - var(--header-height, 70px));
    min-height: 0;
    overflow: hidden;

    display: flex;
    flex-direction: column;
}

/* Zone sous la barre de recherche */
.vault-layout {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;

    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 16px;
}

/* Colonne de navigation Vault */
.vault-tree-column {
    min-height: 0;
    overflow: auto;
}

/* Colonne des pièces */
.vault-pieces-column {
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
}

.vault-header {
    display:flex;
    flex: 0 0 auto;
    align-items:center;
    justify-content:space-between;
    margin-bottom:18px;
}

.vault-header h1 {
    margin:0;
    font-size:24px;
}

.vault-cache-info {
    margin-top:4px;
    font-size:13px;
    opacity:.7;
}

.vault-refresh-button {
    width:auto;
    padding:9px 15px;
}

.vault-layout {
    display:grid;
    grid-template-columns:300px minmax(0, 1fr);
    min-height:650px;
    border:1px solid var(--border-color, #d1d5db);
    border-radius:10px;
    overflow:hidden;
    background:var(--panel-background, #fff);
}

.vault-sidebar {
    padding:14px;
    border-right:1px solid var(--border-color, #d1d5db);
    overflow:auto;
}

.vault-content {
    min-width:0;
    padding:18px;
    overflow:auto;
}

.vault-search {
    width:100%;
    margin-bottom:14px;
    padding:10px 12px;
    border:1px solid #cbd5e1;
    border-radius:7px;
}

.vault-tree-section {
    margin-bottom:8px;
}

.vault-tree-button {
    display:flex;
    align-items:center;
    width:100%;
    padding:8px 10px;
    border:0;
    border-radius:6px;
    background:transparent;
    color:inherit;
    text-align:left;
    cursor:pointer;
}

.vault-tree-button:hover,
.vault-tree-button.active {
    background:rgba(37, 99, 235, .12);
}

.vault-tree-level-1 {
    padding-left:12px;
}

.vault-tree-level-2 {
    padding-left:28px;
}

.vault-tree-count {
    margin-left:auto;
    font-size:12px;
    opacity:.65;
}

.vault-breadcrumb {
    margin-bottom:14px;
    font-size:15px;
    font-weight:600;
}

.vault-table {
    width:100%;
    border-collapse:collapse;
}

.vault-table th,
.vault-table td {
    padding:10px 12px;
    border-bottom:1px solid var(--border-color, #e5e7eb);
    text-align:left;
}

.vault-table th {
    position:sticky;
    top:0;
    background:var(--panel-background, #fff);
    font-size:13px;
}

.vault-number {
    font-family:monospace;
    font-weight:600;
}

.vault-extension {
    display:inline-block;
    margin:2px 3px 2px 0;
    padding:3px 7px;
    border-radius:12px;
    background:rgba(100, 116, 139, .15);
    font-size:12px;
    text-transform:uppercase;
}

.vault-empty {
    padding:40px;
    text-align:center;
    opacity:.65;
}

@media (max-width:900px) {
    .vault-layout {
        grid-template-columns:1fr;
    }

    .vault-sidebar {
        border-right:0;
        border-bottom:1px solid var(--border-color, #d1d5db);
    }
}


.sidebar-user {
    position: relative;
    padding: 14px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.sidebar-user-button {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 8px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.sidebar-user-button:hover {
    background: rgba(255, 255, 255, .06);
}

.sidebar-user-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #d43d35;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin-left: 11px;
    flex: 1;
}

.sidebar-user-info strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user-info small {
    margin-top: 2px;
    opacity: .6;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user-chevron {
    margin-left: 8px;
    font-size: 11px;
    opacity: .6;
    transition: transform .2s ease;
}

.sidebar-user.open .sidebar-user-chevron {
    transform: rotate(180deg);
}

.sidebar-user-menu {
    display: none;
    position: absolute;
    z-index: 1000;
    top: calc(100% - 6px);
    left: 12px;
    right: 12px;
    padding: 8px;
    border-radius: 8px;
    background: #2b3139;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .25);
}

.sidebar-user.open .sidebar-user-menu {
    display: block;
}

.sidebar-user-menu-header {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.sidebar-user-menu-header span {
    font-size: 12px;
    opacity: .6;
}

.sidebar-user-menu button {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    margin-top: 6px;
    padding: 9px 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: inherit;
    cursor: pointer;
    text-align: left;
}

.sidebar-user-menu button:hover {
    background: rgba(255, 255, 255, .07);
}

.dash-page {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.dash-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.dash-header h1 {
    margin: 2px 0 2px;
    font-size: 1.65rem;
    font-weight: 750;
}

.dash-header p {
    margin: 0;
    color: #7b8492;
    font-size: 0.86rem;
}

.dash-eyebrow,
.dash-card-eyebrow {
    color: #7d8796;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.dash-refresh {
    width: 38px;
    height: 38px;
    border: 1px solid #e2e6eb;
    border-radius: 9px;
    background: #fff;
    color: #657081;
    cursor: pointer;
}

.dash-refresh:hover {
    background: #f6f8fa;
}

.dash-kpi-grid {
    display: grid;
    grid-template-columns: 1.35fr 1fr 1fr;
    gap: 16px;
}

.dash-card {
    background: #fff;
    border: 1px solid #e2e6eb;
    border-radius: 12px;
    padding: 17px 18px;
}

.dash-card-head,
.dash-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.dash-card-head h2,
.dash-section-head h2 {
    margin: 2px 0 0;
    font-size: 1rem;
    font-weight: 750;
}

.dash-card-icon {
    color: #7b8797;
    font-size: 1.1rem;
}

.dash-kpi-value {
    margin-top: 16px;
    font-size: 2.25rem;
    line-height: 1;
    font-weight: 800;
}

.dash-kpi-sub {
    margin-top: 7px;
    color: #7e8794;
    font-size: 0.78rem;
}

.dash-kpi-warning .dash-kpi-value {
    color: #cf7a00;
}

.dash-weather-main {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 12px;
}

.dash-weather-icon {
    font-size: 2.4rem;
    line-height: 1;
}

.dash-weather-temp {
    font-size: 2.15rem;
    line-height: 1;
}

.dash-weather-range {
    margin-top: 4px;
    color: #7d8794;
    font-size: 0.78rem;
}

.dash-weather-details {
    display: flex;
    gap: 18px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #edf0f3;
    color: #687383;
    font-size: 0.76rem;
}

.dash-weather-details i {
    width: 16px;
}

.dash-main-card {
    padding: 0;
    overflow: hidden;
}

.dash-main-card .dash-section-head {
    padding: 17px 18px;
    border-bottom: 1px solid #e8ebef;
}

.dash-section-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #637083;
    font-size: 0.75rem;
    font-weight: 650;
    text-decoration: none;
}

.dash-section-link:hover {
    color: #2563eb;
}

.dash-interventions {
    display: flex;
    flex-direction: column;
}

.dash-intervention-row {
    display: grid;
    grid-template-columns: 54px 1fr auto;
    align-items: center;
    gap: 15px;
    width: 100%;
    padding: 13px 18px;
    border: 0;
    border-bottom: 1px solid #edf0f3;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.dash-intervention-row:last-child {
    border-bottom: 0;
}

.dash-intervention-row:hover {
    background: #f8fafc;
}

.dash-intervention-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 43px;
    border-radius: 8px;
    background: #f2f5f8;
}

.dash-intervention-date strong {
    font-size: 1rem;
}

.dash-intervention-date span {
    color: #778293;
    font-size: 0.62rem;
    font-weight: 750;
}

.dash-intervention-title {
    font-weight: 720;
}

.dash-intervention-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 4px;
    color: #7d8794;
    font-size: 0.73rem;
}

.dash-intervention-meta i {
    margin-right: 4px;
}

.dash-intervention-right {
    display: flex;
    align-items: center;
    gap: 11px;
}

.dash-intervention-right > strong {
    font-size: 0.84rem;
}

.dash-type {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    padding: 4px 7px;
    border-radius: 6px;
    background: #edf2f7;
    color: #5d6878;
    font-size: 0.66rem;
    font-weight: 800;
}

.dash-bottom-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.dash-action-list,
.dash-simple-list {
    margin-top: 12px;
}

.dash-action-row,
.dash-simple-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    border-bottom: 1px solid #edf0f3;
    color: inherit;
    text-decoration: none;
}

.dash-action-row:last-child,
.dash-simple-row:last-child {
    border-bottom: 0;
}

.dash-action-row:hover,
.dash-simple-row:hover {
    background: #f8fafc;
}

.dash-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    color: #758092;
}

.dash-action-label {
    flex: 1;
    font-size: 0.8rem;
}

.dash-action-row strong {
    font-size: 0.88rem;
}

.dash-simple-row {
    justify-content: space-between;
}

.dash-simple-row > div {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.dash-simple-row strong {
    overflow: hidden;
    font-size: 0.8rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dash-simple-row small {
    overflow: hidden;
    margin-top: 2px;
    color: #818a98;
    font-size: 0.68rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dash-simple-row time {
    flex: 0 0 auto;
    color: #929ba7;
    font-size: 0.7rem;
}

.dash-loading,
.dash-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 100px;
    color: #8b95a2;
    font-size: 0.8rem;
}

.dash-empty-small {
    padding: 18px 0;
    color: #8b95a2;
    font-size: 0.78rem;
}

@media (max-width: 1050px) {
    .dash-kpi-grid {
        grid-template-columns: 1fr;
    }

    .dash-bottom-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {
    .dash-intervention-row {
        grid-template-columns: 48px 1fr;
    }

    .dash-intervention-right {
        grid-column: 2;
        justify-content: flex-start;
    }
}

.kardex-page {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    padding: 24px;
}

.kardex-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 20px;
}

.kardex-header h1 {
    margin: 0;
    font-size: 2rem;
}

.kardex-header p {
    margin: 5px 0 0;
    color: var(--text-muted, #77808d);
}

.kardex-search {
    position: relative;
    width: min(650px, 100%);
}

.kardex-search > i {
    position: absolute;
    top: 50%;
    left: 18px;
    color: #77808d;
    transform: translateY(-50%);
    pointer-events: none;
}

.kardex-search input {
    width: 100%;
    min-height: 52px;
    padding: 10px 52px;
    color: var(--text-color, #212529);
    font: inherit;
    font-size: 1.05rem;
    background: var(--card-background, #fff);
    border: 1px solid var(--border-color, #d7dce2);
    border-radius: 12px;
    outline: none;
    transition:
        border-color 0.2s,
        box-shadow 0.2s;
}

.kardex-search input:focus {
    border-color: #2979ff;
    box-shadow: 0 0 0 3px rgb(41 121 255 / 15%);
}

.kardex-search button {
    position: absolute;
    top: 50%;
    right: 10px;
    width: 34px;
    height: 34px;
    color: #77808d;
    background: transparent;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    transform: translateY(-50%);
}

.kardex-search button:hover {
    color: #212529;
    background: rgb(127 127 127 / 12%);
}

.kardex-status {
    min-height: 24px;
    margin: 0 0 18px;
    color: var(--text-muted, #77808d);
}

.kardex-status.is-loading {
    color: #2979ff;
}

.kardex-status.is-error {
    color: #d32f2f;
}

.kardex-group {
    margin-bottom: 26px;
}

.kardex-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 12px;
}

.kardex-group-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 1.35rem;
}

.kardex-group-header h2 i {
    color: #2979ff;
}

.kardex-group-header span {
    color: var(--text-muted, #77808d);
    font-size: 0.9rem;
}

.kardex-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 14px;
}

.kardex-card {
    overflow: hidden;
    background: var(--card-background, #fff);
    border: 1px solid var(--border-color, #e1e5ea);
    border-radius: 12px;
    box-shadow: 0 3px 12px rgb(0 0 0 / 5%);
}

.kardex-card-content {
    display: flex;
    align-items: stretch;
    min-height: 120px;
}

.kardex-floor {
    display: flex;
    flex: 0 0 105px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: #2979ff;
}

.kardex-floor span {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.85;
}

.kardex-floor strong {
    margin-top: 3px;
    font-size: 2rem;
    line-height: 1;
}

.kardex-description {
    min-width: 0;
    padding: 18px;
}

.kardex-description h3 {
    margin: 5px 0 0;
    font-size: 1.05rem;
    line-height: 1.4;
}

.kardex-reference {
    color: #2979ff;
    font-size: 0.88rem;
    font-weight: 600;
}

.kardex-reference i {
    margin-right: 5px;
}

.kardex-keywords {
    margin-top: 8px;
    color: var(--text-muted, #77808d);
    font-size: 0.85rem;
    line-height: 1.35;
}

.kardex-images {
    display: flex;
    gap: 8px;
    padding: 10px;
    overflow-x: auto;
    background: rgb(127 127 127 / 6%);
    border-top: 1px solid var(--border-color, #e1e5ea);
}

.kardex-thumbnail {
	max-width: 100px;
	height: 50px;
	flex: 0 0 auto;
	object-fit: contain;
	background: #fff;
	border: 1px solid var(--border-color, #e1e5ea);
	border-radius: 7px;
	cursor: zoom-in;
	padding: 5px;
}

.kardex-thumbnail:hover {
    border-color: #2979ff;
    transform: scale(1.03);
}

.kardex-image-modal {
    position: fixed;
    z-index: 10000;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 50px;
    background: rgb(0 0 0 / 85%);
}

.kardex-image-modal[hidden] {
    display: none;
}

.kardex-image-modal img {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
    background: #fff;
    border-radius: 8px;
}

.kardex-image-close {
    position: absolute;
    top: 18px;
    right: 22px;
    width: 44px;
    height: 44px;
    color: #fff;
    font-size: 1.4rem;
    background: rgb(255 255 255 / 14%);
    border: 0;
    border-radius: 50%;
    cursor: pointer;
}

.kardex-modal-open {
    overflow: hidden;
}

@media (max-width: 800px) {
    .kardex-page {
        padding: 16px;
    }

    .kardex-header {
        align-items: stretch;
        flex-direction: column;
        gap: 16px;
    }

    .kardex-search {
        width: 100%;
    }

    .kardex-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .kardex-card-content {
        flex-direction: column;
    }

    .kardex-floor {
        min-height: 75px;
        flex-basis: auto;
        flex-direction: row;
        gap: 10px;
    }

    .kardex-floor strong {
        margin: 0;
        font-size: 1.7rem;
    }
}

.energy-flow-card {
    margin-bottom: 20px;
    padding: 18px;
    border: 1px solid #dbe3ee;
    border-radius: 16px;
    background: #ffffff;
}

.energy-flow-live {
    position: relative;
    min-height: 620px;
    overflow: hidden;
}

.energy-flow-lines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.energy-flow-node {
    position: absolute;
    z-index: 3;
    width: 190px;
    min-height: 92px;
    padding: 14px;
    border: 1px solid #d5deea;
    border-radius: 14px;
    background: rgba(255,255,255,1);
    box-shadow: 0 4px 14px rgba(15,23,42,.08);
    text-align: center;
}

.energy-flow-node i {
    display: block;
    margin-bottom: 6px;
    font-size: 24px;
}

.energy-flow-node span,
.energy-flow-node small {
    display: block;
}

.energy-flow-node strong {
    display: block;
    margin-top: 5px;
    font-size: 20px;
}

.node-inv3 {
    left: 10%;
    top: 50px;
}

.node-inv1 {
    left: 10%;
    top: 210px;
}

.node-inv2 {
    left: 10%;
    top: 370px;
}


.node-battery-site1 {
    right: 10%;
    top: 30%;
}

.node-battery-site2 {
    right: 10%;
    top: 56%;
}

.node-center {
    left: 53%;
    top: 245px;
    transform: translateX(-50%);
    width: 220px;
}

.node-load-site1 {
    left: 34%;
    top: 3%;
}

.node-load-site2 {
    left: 61%;
    top: 3%;
}

.node-load-site1 i,
.node-load-site2 i {
    color: #dc2626;
}

.node-grid {
    right: 20%;
    top: 255px;
}

.node-grid-virtual {
    left: 53%;
    bottom: 6%;
    right: auto;

    width: 210px;
    min-height: 125px;
    height: auto;

    transform: translateX(-50%);
}

.node-battery {
    right: 10%;
    top: 430px;
}

.node-pv i {
    color: #d6a700;
}

.node-load i {
    color: #dc2626;
}

.node-grid i {
    color: #2563eb;
}

.node-battery i {
    color: #0284c7;
}

.node-center i {
    color: #f59e0b;
}

.energy-flow-path {
    fill: none;
    stroke: #cbd5e1;
    stroke-width: 7;
    stroke-linecap: round;
    opacity: .35;
}

.energy-flow-path.active {
    opacity: 1;
    stroke-dasharray: 3 18;
    animation-name: energyFlowForward;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

.energy-flow-path.reverse {
    animation-name: energyFlowReverse;
}

.energy-flow-path.pv {
    stroke: #eab308;
}

.energy-flow-path.load {
    stroke: #ef4444;
}

.energy-flow-path.grid-export {
    stroke: #22c55e;
}

.energy-flow-path.grid-import {
    stroke: #ef4444;
}

.energy-flow-path.battery-charge,
.energy-flow-path.battery-discharge {
    stroke: #38bdf8;
}

@keyframes energyFlowForward {
    from {
        stroke-dashoffset: 42;
    }

    to {
        stroke-dashoffset: 0;
    }
}

@keyframes energyFlowReverse {
    from {
        stroke-dashoffset: 0;
    }

    to {
        stroke-dashoffset: 42;
    }
}

@media (max-width: 950px) {
    .energy-flow-live {
        min-height: auto;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .energy-flow-node {
        position: static;
        width: auto;
        transform: none;
    }

    .energy-flow-lines {
        display: none;
    }
}

/* ==================================================
 * Synoptique : deux batteries + réseau sous l'usine
 * ================================================== */

#energyFlowLive {
    position: relative;
    width: 100%;
    min-height: 700px;
}

#energyFlowLive .energy-flow-lines {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#energyFlowLive .energy-flow-node {
    position: absolute;
    z-index: 2;

    width: 190px;
    min-height: 140px;
    height: auto;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    padding: 16px;
}

/* Couleurs */

#energyFlowLive .node-battery-site1 i {
    color: #1593d1;
}

#energyFlowLive .node-battery-site2 i {
    color: #7047d7;
}

#energyFlowLive .node-grid-virtual i {
    color: #2563eb;
}

#energyFlowLive .node-grid-virtual small {
    color: #16a34a;
    font-weight: 700;
}

#energyFlowLive .energy-flow-path.battery-charge-site2 {
    stroke: #7047d7;
}

/* =========================================================
   ENERGY DAILY — onglet Journalier
   ========================================================= */

.energy-daily {
    position: relative;
    min-height: 560px;
    color: #263246;
}

.daily-top-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(360px, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.daily-panel {
    overflow: hidden;
    background: #fff;
    border: 1px solid #dde4ee;
    border-radius: 14px;
    box-shadow: 0 6px 20px rgba(15, 23, 42, .06);
}

.daily-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px 10px;
}

.daily-panel-header h2 {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    color: #263246;
    font-size: 18px;
    font-weight: 750;
}

.daily-panel-header h2 i {
    color: #61789f;
}

.daily-panel-header p {
    margin: 5px 0 0;
    color: #7a879b;
    font-size: 12px;
}

.daily-refresh {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1px solid #dce4ef;
    border-radius: 10px;
    color: #617089;
    background: #f8fafc;
    cursor: pointer;
}

.daily-refresh:hover {
    color: #fff;
    border-color: #c84f3f;
    background: #c84f3f;
}

.daily-sankey-chart {
    width: 100%;
    height: 420px;
    min-height: 420px;
}

.daily-timeseries-chart {
    width: 100%;
    height: 410px;
    min-height: 410px;
}

.daily-panel-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 42px;
    padding: 10px 18px;
    color: #7a879b;
    border-top: 1px solid #edf1f6;
    font-size: 11px;
}

.daily-panel-footer i {
    margin-right: 5px;
}

.daily-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding: 4px 16px 16px;
}

.daily-kpi {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    min-height: 105px;
    padding: 15px;
    border: 1px solid #dfe6ef;
    border-radius: 11px;
    background: linear-gradient(145deg, #fff, #fbfcfe);
}

.daily-kpi > i {
    margin-top: 3px;
    font-size: 23px;
}

.daily-kpi span {
    display: block;
    min-height: 30px;
    color: #445066;
    font-size: 12px;
    font-weight: 700;
}

.daily-kpi strong {
    display: inline-block;
    margin-top: 6px;
    color: #111827;
    font-size: 23px;
    line-height: 1;
}

.daily-kpi small {
    margin-left: 4px;
    color: #667085;
    font-size: 11px;
}

.daily-kpi em {
    display: block;
    margin-top: 8px;
    color: #7a879b;
    font-size: 10px;
    font-style: normal;
}

.daily-kpi-wide {
    grid-column: span 3;
    min-height: 90px;
}

.daily-kpi.is-pv {
    border-color: #f2c04b;
    box-shadow: inset 3px 0 #f4b400;
}
.daily-kpi.is-pv > i { color: #f4b400; }

.daily-kpi.is-consumption {
    border-color: #8ed9aa;
    box-shadow: inset 3px 0 #22a559;
}
.daily-kpi.is-consumption > i { color: #22a559; }

.daily-kpi.is-battery-out {
    border-color: #9fc1f5;
    box-shadow: inset 3px 0 #3b82f6;
}
.daily-kpi.is-battery-out > i { color: #3b82f6; }

.daily-kpi.is-battery-in {
    border-color: #c1a8f7;
    box-shadow: inset 3px 0 #8b5cf6;
}
.daily-kpi.is-battery-in > i { color: #8b5cf6; }

.daily-kpi.is-grid {
    border-color: #f4abab;
    box-shadow: inset 3px 0 #ef4444;
}
.daily-kpi.is-grid > i { color: #ef4444; }

.daily-kpi.is-autarky {
    border-color: #91d9dc;
    box-shadow: inset 3px 0 #0f9ca5;
}
.daily-kpi.is-autarky > i { color: #0f9ca5; }

.daily-kpi.is-self-consumption {
    border-color: #f2c76c;
    box-shadow: inset 3px 0 #f59e0b;
}
.daily-kpi.is-self-consumption > i { color: #f59e0b; }

.daily-kpi.is-throughput {
    border-color: #9dbdf4;
    box-shadow: inset 3px 0 #2563eb;
}
.daily-kpi.is-throughput > i { color: #2563eb; }

.daily-chart-panel {
    margin-bottom: 18px;
}

.daily-extrema {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    padding: 12px 18px;
    color: #617089;
    border-top: 1px solid #edf1f6;
    font-size: 11px;
}

.daily-extrema span {
    min-width: 0;
    white-space: nowrap;
}

.daily-extrema i {
    margin-right: 6px;
}

.daily-extrema strong {
    color: #263246;
}

.daily-loading,
.daily-error {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: grid;
    place-content: center;
    gap: 10px;
    color: #617089;
    border: 1px solid #dfe6ef;
    border-radius: 14px;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(4px);
}

.daily-error {
    color: #b42318;
    background: rgba(255, 248, 247, .96);
}

@media (max-width: 1300px) {
    .daily-top-grid {
        grid-template-columns: 1fr;
    }

    .daily-sankey-chart {
        height: 390px;
    }
}

@media (max-width: 850px) {
    .daily-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .daily-kpi-wide {
        grid-column: span 2;
    }

    .daily-extrema {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .daily-kpi-grid {
        grid-template-columns: 1fr;
    }

    .daily-kpi-wide {
        grid-column: auto;
    }

    .daily-extrema {
        grid-template-columns: 1fr;
    }

    .daily-sankey-chart,
    .daily-timeseries-chart {
        height: 340px;
        min-height: 340px;
    }
}

.daily-toolbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 10px;
}

.daily-date-picker {
    display: flex;
    align-items: center;
    gap: 7px;
    height: 34px;
    padding: 0 9px;
    color: #617089;
    border: 1px solid #dce4ef;
    border-radius: 9px;
    background: #f8fafc;
}

.daily-date-picker input {
    width: 128px;
    padding: 0;
    color: #263246;
    border: 0;
    outline: 0;
    background: transparent;
    font: inherit;
    cursor: pointer;
}

/* =========================================================
 * Furn Manager
 * ========================================================= */

.furn-manager {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.furn-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
}

.furn-header h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
}

.furn-header p {
    margin: 0.4rem 0 0;
    color: var(--bs-secondary-color);
}

.furn-eyebrow {
    margin-bottom: 0.3rem;
    color: var(--bs-primary);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.furn-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.furn-stats {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(190px, 1fr));
    gap: 1rem;
}

.furn-stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 96px;
    padding: 1rem 1.15rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.85rem;
    background: var(--bs-body-bg);
}

.furn-stat-card.has-error {
    border-color: rgba(220, 53, 69, 0.45);
}

.furn-stat-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border-radius: 0.75rem;
    background: rgba(var(--bs-primary-rgb), 0.1);
    color: var(--bs-primary);
    font-size: 1.25rem;
}

.furn-stat-card strong {
    display: block;
    font-size: 1.65rem;
    line-height: 1;
}

.furn-stat-card span:last-child {
    display: block;
    margin-top: 0.35rem;
    color: var(--bs-secondary-color);
    font-size: 0.88rem;
}

.furn-list-card {
    overflow: hidden;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.85rem;
    background: var(--bs-body-bg);
}

.furn-list-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--bs-border-color);
}

.furn-search {
    position: relative;
    width: min(480px, 100%);
}

.furn-search i {
    position: absolute;
    top: 50%;
    left: 0.9rem;
    transform: translateY(-50%);
    color: var(--bs-secondary-color);
    pointer-events: none;
}

.furn-search input {
    width: 100%;
    min-height: 42px;
    padding: 0.65rem 0.85rem 0.65rem 2.55rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.65rem;
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
}

.furn-table {
    margin: 0;
}

.furn-table th {
    padding: 0.8rem 1rem;
    background: var(--bs-tertiary-bg);
    color: var(--bs-secondary-color);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.035em;
    text-transform: uppercase;
    white-space: nowrap;
}

.furn-table td {
    padding: 0.85rem 1rem;
}

.furn-number {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 1rem;
}

.furn-type {
    display: inline-flex;
    padding: 0.2rem 0.5rem;
    border-radius: 0.4rem;
    background: var(--bs-tertiary-bg);
    font-size: 0.8rem;
    font-weight: 600;
}

.furn-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
}

.furn-status-project,
.furn-sync-pending {
    background: rgba(255, 193, 7, 0.15);
    color: #997404;
}

.furn-status-active,
.furn-sync-synced {
    background: rgba(25, 135, 84, 0.15);
    color: #146c43;
}

.furn-status-inactive {
    background: rgba(108, 117, 125, 0.15);
    color: #5c636a;
}

.furn-status-obsolete,
.furn-sync-error {
    background: rgba(220, 53, 69, 0.15);
    color: #b02a37;
}

.furn-sync-warning {
    background: rgba(253, 126, 20, 0.15);
    color: #bd5b00;
}

.furn-sync-date {
    margin-top: 0.25rem;
    color: var(--bs-secondary-color);
    font-size: 0.72rem;
}

.furn-sync-error {
    max-width: 260px;
    margin-top: 0.3rem;
    overflow: hidden;
    color: var(--bs-danger);
    font-size: 0.72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.furn-empty {
    padding: 3rem 1rem;
    text-align: center;
    color: var(--bs-secondary-color);
}

.furn-empty > i {
    margin-bottom: 1rem;
    font-size: 2.5rem;
}

.furn-empty h2 {
    color: var(--bs-body-color);
    font-size: 1.2rem;
}

@media (max-width: 900px) {
    .furn-header,
    .furn-list-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .furn-header-actions .btn,
    .furn-list-toolbar .btn {
        width: 100%;
    }

    .furn-search {
        width: 100%;
    }
}












.furn-details-panel {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.furn-details-header {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--bs-border-color);
}

.furn-details-title-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
}

.furn-details-title-row h2 {
    margin: 0;
}

.furn-details-actions {
    display: flex;
    gap: 0.5rem;
}

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

.furn-detail-card,
.furn-info-card {
    padding: 1rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.8rem;
    background: var(--bs-body-bg);
}

.furn-detail-card span {
    display: block;
    color: var(--bs-secondary-color);
    font-size: 0.78rem;
    text-transform: uppercase;
}

.furn-detail-card strong {
    display: block;
    margin-top: 0.4rem;
    font-size: 1.15rem;
}

.furn-details-tabs {
    margin-top: 1.25rem;
    overflow-x: auto;
    white-space: nowrap;
}

.furn-details-tabs .tab {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.furn-general-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.furn-info-card h3 {
    margin: 0 0 1rem;
    font-size: 1rem;
}

.furn-info-card dl {
    margin: 0;
}

.furn-info-card dl > div {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 1rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--bs-border-color);
}

.furn-info-card dl > div:last-child {
    border-bottom: 0;
}

.furn-info-card dt {
    color: var(--bs-secondary-color);
    font-weight: 500;
}

.furn-info-card dd {
    margin: 0;
    font-weight: 600;
}

.furn-details-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    min-height: 250px;
}

@media (max-width: 760px) {
    .furn-details-title-row {
        align-items: stretch;
        flex-direction: column;
    }

    .furn-info-card dl > div {
        grid-template-columns: 1fr;
        gap: 0.2rem;
    }
}




.plc-wizard-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.plc-wizard-step {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    color: var(--bs-secondary-color);
}

.plc-wizard-step span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 50%;
    background: var(--bs-secondary-bg);
    font-weight: 600;
}

.plc-wizard-step.active {
    border-color: var(--bs-primary);
    color: var(--bs-primary);
}

.plc-wizard-step.active span {
    color: #fff;
    background: var(--bs-primary);
}

.plc-wizard-step.done {
    border-color: var(--bs-success);
    color: var(--bs-success);
}

.plc-wizard-step.done span {
    color: #fff;
    background: var(--bs-success);
}

.plc-source-choice {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    height: 100%;
    padding: 1rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.65rem;
    cursor: pointer;
    transition:
        border-color 0.15s ease,
        background-color 0.15s ease;
}

.plc-source-choice:hover {
    border-color: var(--bs-primary);
    background: var(--bs-primary-bg-subtle);
}

.plc-source-choice:has(input:checked) {
    border-color: var(--bs-primary);
    background: var(--bs-primary-bg-subtle);
}

.plc-source-choice-body {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.plc-source-choice-body small {
    color: var(--bs-secondary-color);
}



/* =========================================================
   Sources automate
   ========================================================= */

#furn-source-list {
    display: grid;
    gap: 1rem;
}

.furn-source-card {
    padding: 1rem 1.1rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.75rem;
    background: var(--bs-body-bg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.furn-source-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.85rem;
}

.furn-source-name {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
}

.furn-source-card-header .text-body-secondary {
    margin-top: 0.2rem;
    font-size: 0.875rem;
}

.furn-source-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-bottom: 0.8rem;
}

.furn-source-stats span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    background: var(--bs-tertiary-bg);
    font-size: 0.85rem;
    font-weight: 600;
}

.furn-source-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--bs-border-color);
    color: var(--bs-secondary-color);
    font-size: 0.85rem;
}

.furn-source-comment {
    margin-top: 0.8rem;
    padding: 0.65rem 0.75rem;
    border-radius: 0.5rem;
    background: var(--bs-tertiary-bg);
    font-size: 0.9rem;
}

/* États */

.furn-source-status-success {
    color: #146c43;
    background: #d1e7dd;
}

.furn-source-status-running {
    color: #055160;
    background: #cff4fc;
}

.furn-source-status-error {
    color: #842029;
    background: #f8d7da;
}

.furn-source-status-draft {
    color: #664d03;
    background: #fff3cd;
}

.furn-source-card .furn-badge {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}





/* =========================================================
 * Furn Manager — variables et patterns
 * ========================================================= */

.furn-detail-section {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: var(--bs-body-bg, #fff);
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 0.75rem;
}

.furn-detail-section .section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.furn-detail-section .section-header h3,
.furn-detail-section .section-header h4 {
    margin: 0;
}

.furn-detail-section .section-header p {
    margin: 0.25rem 0 0;
    color: var(--bs-secondary-color, #6c757d);
    font-size: 0.875rem;
}

.furn-detail-section .table-wrapper {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 0.5rem;
}

.furn-detail-section .data-table {
    width: 100%;
    min-width: 1100px;
    margin: 0;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.furn-detail-section .data-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 0.7rem 0.75rem;
    background: var(--bs-tertiary-bg, #f8f9fa);
    border-bottom: 1px solid var(--bs-border-color, #dee2e6);
    color: var(--bs-emphasis-color, #212529);
    font-size: 0.75rem;
    font-weight: 700;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    white-space: nowrap;
}

.furn-detail-section .data-table td {
    padding: 0.7rem 0.75rem;
    border-bottom: 1px solid var(--bs-border-color, #dee2e6);
    vertical-align: top;
}

.furn-detail-section .data-table tbody tr:last-child td {
    border-bottom: 0;
}

.furn-detail-section .data-table tbody tr:hover {
    background: var(--bs-tertiary-bg, #f8f9fa);
}

.furn-detail-section .data-table tr.is-disabled {
    opacity: 0.55;
}

.furn-detail-section .data-table code {
    display: inline-block;
    max-width: 320px;
    padding: 0.15rem 0.35rem;
    overflow: hidden;
    background: var(--bs-tertiary-bg, #f8f9fa);
    border-radius: 0.25rem;
    color: inherit;
    font-size: 0.8rem;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

.furn-detail-section .cell-detail {
    display: block;
    margin-top: 0.2rem;
    color: var(--bs-secondary-color, #6c757d);
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.3;
}

.furn-detail-section .empty-cell {
    padding: 2rem !important;
    color: var(--bs-secondary-color, #6c757d);
    text-align: center;
}

#furn-variables-filter {
    width: min(320px, 100%);
}







.furn-detail-section .badge {
    display: inline-flex;
    align-items: center;
    min-height: 1.4rem;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.furn-detail-section .badge-neutral {
    background: var(--bs-secondary-bg, #e9ecef);
    color: var(--bs-emphasis-color, #212529);
}

.furn-detail-section .badge-info {
    background: rgba(13, 202, 240, 0.15);
    color: var(--bs-info-text-emphasis, #055160);
}

.furn-detail-section .badge-success {
    background: rgba(25, 135, 84, 0.15);
    color: var(--bs-success-text-emphasis, #0a3622);
}

.furn-detail-section .badge-muted {
    background: var(--bs-secondary-bg, #e9ecef);
    color: var(--bs-secondary-color, #6c757d);
}

.furn-detail-section .badge-scope {
    background: rgba(13, 110, 253, 0.14);
    color: var(--bs-primary-text-emphasis, #052c65);
}

.furn-detail-section .badge-mode {
    background: rgba(111, 66, 193, 0.14);
    color: #59359a;
}

@media (max-width: 768px) {
    .furn-detail-section {
        padding: 1rem;
    }

    .furn-detail-section .section-header {
        align-items: stretch;
        flex-direction: column;
    }

    #furn-variables-filter {
        width: 100%;
    }
}

.customers-page {
    min-height: calc(100vh - 40px);
}

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

.customers-header h1 {
    margin: 0;
    color: #101828;
    font-size: 28px;
    font-weight: 750;
}

.customers-header p {
    margin: 4px 0 0;
    color: #667085;
    font-size: 13px;
}

.customers-search {
    position: relative;
    width: min(420px, 100%);
}

.customers-search > i {
    position: absolute;
    top: 50%;
    left: 14px;
    color: #98a2b3;
    transform: translateY(-50%);
}

.customers-search input {
    width: 100%;
    height: 42px;
    padding: 0 44px 0 40px;
    border: 1px solid #d0d5dd;
    border-radius: 10px;
    outline: none;
    background: #fff;
    color: #101828;
}

.customers-search input:focus {
    border-color: #8b83de;
    box-shadow: 0 0 0 3px rgba(127, 117, 232, .12);
}

.customers-search button {
    position: absolute;
    top: 50%;
    right: 8px;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #667085;
    transform: translateY(-50%);
}

.customers-layout {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    min-height: 680px;
    overflow: hidden;
    border: 1px solid #e4e7ec;
    border-radius: 14px;
    background: #fff;
}

.customers-list-panel {
    min-width: 0;
    border-right: 1px solid #e4e7ec;
    background: #f9fafb;
}

.customers-list-header {
    display: flex;
    gap: 5px;
    padding: 13px 16px;
    border-bottom: 1px solid #e4e7ec;
    color: #667085;
    font-size: 12px;
    font-weight: 600;
}

.customers-list {
    max-height: calc(100vh - 235px);
    overflow-y: auto;
}

.customer-list-item {
    display: block;
    width: 100%;
    padding: 13px 16px;
    text-align: left;
    border: 0;
    border-bottom: 1px solid #eaecf0;
    background: transparent;
    cursor: pointer;
}

.customer-list-item:hover {
    background: #f2f4f7;
}

.customer-list-item.active {
    background: #eeecff;
    box-shadow: inset 3px 0 #756be5;
}

.customer-list-name {
    overflow: hidden;
    color: #101828;
    font-size: 13px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.customer-list-legal {
    margin-top: 2px;
    overflow: hidden;
    color: #667085;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.customer-list-meta {
    display: flex;
    gap: 12px;
    margin-top: 7px;
    color: #98a2b3;
    font-size: 10px;
}

.customer-detail {
    min-width: 0;
    padding: 24px;
}

.customer-empty {
    display: flex;
    min-height: 560px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: #98a2b3;
    text-align: center;
}

.customer-empty > i {
    margin-bottom: 16px;
    font-size: 46px;
}

.customer-empty h2 {
    margin: 0;
    color: #475467;
    font-size: 18px;
}

.customer-empty p {
    margin-top: 6px;
    font-size: 12px;
}

.customer-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.customer-title-row h2 {
    margin: 0;
    color: #101828;
    font-size: 24px;
}

.customer-legal-name {
    margin-top: 3px;
    color: #667085;
    font-size: 13px;
}

.customer-status {
    padding: 5px 9px;
    border-radius: 999px;
    background: #dcfae6;
    color: #067647;
    font-size: 11px;
    font-weight: 700;
}

.customer-status.inactive {
    background: #f2f4f7;
    color: #667085;
}

.customer-tabs {
    display: flex;
    gap: 3px;
    margin: 22px 0 20px;
    padding-bottom: 1px;
    border-bottom: 1px solid #e4e7ec;
}

.customer-tab {
    padding: 9px 13px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: #667085;
    font-size: 12px;
    font-weight: 650;
    cursor: pointer;
}

.customer-tab.active {
    border-bottom-color: #756be5;
    color: #554bc3;
}

.customer-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid #e4e7ec;
    border-radius: 12px;
    background: #e4e7ec;
}

.customer-info-item {
    min-height: 75px;
    padding: 14px 16px;
    background: #fff;
}

.customer-info-label {
    margin-bottom: 5px;
    color: #98a2b3;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.customer-info-value {
    color: #344054;
    font-size: 13px;
}

.customer-site-card,
.customer-contact-card {
    margin-bottom: 10px;
    padding: 15px 17px;
    border: 1px solid #e4e7ec;
    border-radius: 11px;
}

.customer-site-card h3,
.customer-contact-card h3 {
    margin: 0 0 6px;
    color: #101828;
    font-size: 14px;
}

.customer-site-address,
.customer-contact-meta {
    color: #667085;
    font-size: 12px;
    line-height: 1.6;
}

.customer-site-stats {
    display: flex;
    gap: 16px;
    margin-top: 9px;
    color: #475467;
    font-size: 11px;
}

.customers-loading,
.customers-no-result {
    padding: 30px 20px;
    color: #98a2b3;
    text-align: center;
    font-size: 12px;
}

@media (max-width: 900px) {
    .customers-layout {
        grid-template-columns: 1fr;
    }

    .customers-list-panel {
        border-right: 0;
        border-bottom: 1px solid #e4e7ec;
    }

    .customers-list {
        max-height: 300px;
    }

    .customers-header {
        align-items: stretch;
        flex-direction: column;
    }

    .customers-search {
        width: 100%;
    }
}

.customer-section-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.customer-section-count {
    margin-left: 6px;
    color: #98a2b3;
    font-size: 12px;
}

.customer-contact-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
}

.customer-contact-role {
    margin-top: 2px;
    color: #667085;
    font-size: 11px;
}

.customer-contact-primary {
    margin-left: 6px;
    padding: 3px 6px;
    border-radius: 999px;
    background: #dcfae6;
    color: #067647;
    font-size: 9px;
    font-weight: 700;
}

.customer-contact-body {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 18px;
    margin-top: 12px;
    font-size: 11px;
}

.customer-contact-body a {
    color: #475467;
    text-decoration: none;
}

.customer-contact-body a:hover {
    color: #554bc3;
}

.customer-contact-type {
    display: inline-block;
    padding: 3px 7px;
    border-radius: 6px;
    background: #f2f4f7;
    color: #475467;
    font-size: 10px;
    font-weight: 600;
}

.customer-contact-sites {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.customer-contact-sites label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

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

.customer-merge-site-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
    padding: 11px 13px;
    border: 1px solid #e4e7ec;
    border-radius: 9px;
    cursor: pointer;
}

.customer-merge-site-option:hover {
    background: #f9fafb;
}

.customer-merge-site-option input {
    margin-top: 3px;
}

.customer-merge-site-option span {
    display: flex;
    flex-direction: column;
}

.customer-merge-site-option strong {
    color: #344054;
    font-size: 13px;
}

.customer-merge-site-option small {
    margin-top: 2px;
    color: #667085;
    font-size: 11px;
}

.customer-site-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
}

.customer-site-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.customer-site-primary {
    margin-left: 6px;
    padding: 3px 6px;
    border-radius: 999px;
    background: #dcfae6;
    color: #067647;
    font-size: 9px;
    font-weight: 700;
}

.customer-site-references {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #eaecf0;
}

.customer-site-reference-title {
    margin-bottom: 8px;
    color: #667085;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.customer-site-reference {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    min-height: 28px;
    font-size: 11px;
}

.customer-site-reference-source {
    padding: 2px 6px;
    border-radius: 5px;
    background: #eef2f6;
    color: #475467;
    font-size: 9px;
    font-weight: 700;
}

.customer-site-reference-primary,
.customer-site-reference-secondary {
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 700;
}

.customer-site-reference-primary {
    background: #dcfae6;
    color: #067647;
}

.customer-site-reference-secondary {
    background: #f2f4f7;
    color: #667085;
}
.furn-storage-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
}

.furn-storage-toolbar h2 {
    margin: 0;
}

.furn-storage-toolbar p {
    margin: 4px 0 0;
    color: var(--text-muted);
}

.furn-storage-filters {
    display: flex;
    gap: 10px;
}

.furn-storage-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 20px;
    padding: 16px 18px;
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--card-bg);
}

.furn-storage-card-main {
    display: grid;
    grid-template-columns: 130px 220px minmax(240px, 1fr);
    align-items: center;
    gap: 18px;
}

.furn-storage-number {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.furn-storage-number strong {
    font-size: 18px;
}

.furn-storage-type {
    width: fit-content;
    padding: 3px 7px;
    border-radius: 5px;
    font-size: 11px;
    text-transform: uppercase;
}

.furn-storage-customer {
    display: flex;
    flex-direction: column;
}

.furn-storage-customer span {
    color: var(--text-muted);
    font-size: 13px;
}

.furn-storage-folder {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.furn-storage-folder div {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.furn-storage-folder strong,
.furn-storage-folder small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.furn-storage-folder small {
    color: var(--text-muted);
}

.furn-storage-warning {
    grid-column: 1 / -1;
    font-size: 13px;
}

.furn-storage-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.furn-storage-confidence {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-right: 5px;
}

.furn-storage-confidence span {
    font-size: 11px;
    color: var(--text-muted);
}

.furn-storage-empty,
.furn-storage-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 180px;
    color: var(--text-muted);
}

.furn-tab-count {
    margin-left: 5px;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
}



.furnace-attribute-group {
    margin-bottom: 24px;
}

.furnace-attribute-group h3 {
    margin: 0 0 12px;
    font-size: 15px;
}

.furnace-attribute-grid {
    display: grid;
    grid-template-columns: repeat(
        auto-fit,
        minmax(220px, 1fr)
    );
    gap: 10px;
}

.furnace-attribute-item {
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
}

.furnace-attribute-label {
    margin-bottom: 5px;
    font-size: 12px;
    color: var(--text-muted);
}

.furnace-attribute-value {
    font-size: 16px;
    font-weight: 600;
}

.furnace-attribute-unit {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
}

.furnace-attribute-source {
    margin-top: 5px;
    font-size: 10px;
    color: var(--text-muted);
}

.furnace-attribute-bool {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.furnace-technical-loading,
.furnace-technical-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    color: var(--text-muted);
}

.furnace-photo-gallery {
    display: grid;
    grid-template-columns:
        repeat(
            auto-fill,
            minmax(160px, 1fr)
        );
    gap: 12px;
}

.furnace-photo-card {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--bs-border-color);
    border-radius: 10px;
    background: var(--bs-body-bg);
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.furnace-photo-card img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.furnace-photo-name {
    padding: 0 9px 9px;
    overflow: hidden;
    font-size: .8rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 600px) {
    .furnace-photo-gallery {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
        gap: 7px;
    }

    .furnace-photo-name {
        display: none;
    }
}



.furnace-photo-card {
    cursor: pointer;
}

.furnace-photo-lightbox[hidden] {
    display: none;
}

.furnace-photo-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .9);
}

.furnace-photo-lightbox-name {
    margin-top: 10px;
    color: #fff;
    font-size: .9rem;
}

.furnace-photo-lightbox-close,
.furnace-photo-lightbox-prev,
.furnace-photo-lightbox-next {
    position: absolute;
    z-index: 1;
    border: 0;
    color: #fff;
    background: rgba(0, 0, 0, .4);
    cursor: pointer;
}

.furnace-photo-lightbox-close {
    top: 20px;
    right: 20px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    font-size: 1.4rem;
}

.furnace-photo-lightbox-prev,
.furnace-photo-lightbox-next {
    top: 50%;
    width: 52px;
    height: 72px;
    transform: translateY(-50%);
    border-radius: 10px;
    font-size: 1.5rem;
}

.furnace-photo-lightbox-prev {
    left: 20px;
}

.furnace-photo-lightbox-next {
    right: 20px;
}

.furnace-photo-lightbox-open {
    overflow: hidden;
}

.furnace-photo-lightbox-content {
    width: calc(100vw - 150px);
    height: calc(100vh - 70px);
    display: flex;
    flex-direction: column;
    text-align: center;
}

.furnace-photo-lightbox-viewport {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    touch-action: pinch-zoom;
    overscroll-behavior: contain;
}

.furnace-photo-lightbox-content img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}

@media (max-width: 768px) {
    .furnace-photo-lightbox-content {
        width: 100vw;
        height: 100vh;
        max-width: none;
        max-height: none;
    }

    .furnace-photo-lightbox-viewport {
        padding: 50px 0;
    }

    .furnace-photo-lightbox-prev,
    .furnace-photo-lightbox-next {
        display: none;
    }

    .furnace-photo-lightbox-name {
        position: absolute;
        left: 10px;
        right: 10px;
        bottom: 12px;
        margin: 0;
        pointer-events: none;
    }

    .furnace-photo-lightbox-close {
        top: 10px;
        right: 10px;
    }
}


.furnace-photo-date {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0 4px;
    color: var(--bs-secondary-color);
    font-size: .9rem;
    font-weight: 600;
}

.furnace-photo-date::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--bs-border-color);
}

.furnace-photo-date:first-child {
    margin-top: 0;
}

.furnace-photo-date span::first-letter {
    text-transform: uppercase;
}

.furnace-detail {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.furnace-title-row {
    flex: 0 0 auto;
}

.furnace-tabs {
    flex: 0 0 auto;
}

.furnaces-page {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.furnaces-header,
.furnaces-toolbar {
    flex: 0 0 auto;
}

.furnaces-layout {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.furnace-detail {
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.furnace-title-row,
.furnace-tabs {
    flex: 0 0 auto;
}

#furnaceTabContent {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.furnaces-list-panel {
    min-height: 0;
    overflow: hidden;
}

.furnaces-list {
    height: 100%;
    overflow-y: auto;
}

.furnace-title-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.furnace-qrcode {
    padding: 5px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    transition: transform .15s ease;
}

.furnace-qrcode:hover {
    transform: scale(1.05);
}

.furnace-qrcode img,
.furnace-qrcode canvas {
    display: block;
    width: 96px;
    height: 96px;
}

body.auth-locked #app {
    filter: blur(7px);
    pointer-events: none;
    user-select: none;
}

#loginModal .modal-dialog {
    max-width: 420px;
}

#loginModal .modal-content {
    border: 0;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,.22);
}

body.auth-locked .intra-shell {
    filter: blur(7px);
    pointer-events: none;
    user-select: none;
}

.auth-login-modal {
    border: 0;
    border-radius: 16px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .25);
}
.inter-page {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 24px 28px;
    box-sizing: border-box;
}

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

.inter-page-header h1 {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.15;
    color: var(--text-primary);
}

.inter-page-header p {
    margin: 5px 0 0;
    color: var(--text-muted);
    font-size: 13px;
}

.inter-create-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.inter-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 48px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.inter-status-filters {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

.inter-status-filter {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 38px;
    padding: 0 14px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition:
        background 0.15s ease,
        color 0.15s ease;
}

.inter-status-filter:hover {
    background: rgba(127, 127, 127, 0.07);
    color: var(--text-primary);
}

.inter-status-filter.active {
    background: rgba(211, 62, 55, 0.08);
    color: var(--primary-color);
    font-weight: 600;
}

.inter-status-filter.active::after {
    content: "";
    position: absolute;
    right: 12px;
    bottom: -13px;
    left: 12px;
    height: 2px;
    border-radius: 2px 2px 0 0;
    background: var(--primary-color);
}

.inter-status-filter > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: rgba(127, 127, 127, 0.1);
    color: var(--text-muted);
    font-size: 10px;
}

.inter-status-filter.active > span {
    background: rgba(211, 62, 55, 0.12);
    color: var(--primary-color);
}

.inter-search {
    position: relative;
    width: 320px;
    flex: 0 0 320px;
}

.inter-search > i {
    position: absolute;
    top: 50%;
    left: 13px;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.inter-search input {
    width: 100%;
    height: 38px;
    padding: 0 14px 0 38px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    outline: 0;
    background: var(--card-bg);
    color: var(--text-primary);
    box-sizing: border-box;
}

.inter-search input:focus {
    border-color: var(--primary-color);
}

.inter-workspace {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    flex: 1;
    min-height: 0;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--card-bg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.inter-list-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    border-right: 1px solid var(--border-color);
    background: var(--card-bg);
    overflow: hidden;
}

.inter-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
    flex: 0 0 48px;
    padding: 0 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 12px;
    font-weight: 600;
}

.inter-list-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 23px;
    height: 21px;
    padding: 0 7px;
    border-radius: 11px;
    background: rgba(127, 127, 127, 0.1);
    color: var(--text-muted);
    font-size: 10px;
}

.inter-list {
    min-height: 0;
    overflow-y: auto;
    padding: 10px;
    flex: 1 1 auto;
    height: 0;
    overscroll-behavior: contain;
}

.inter-list-item {
    display: block;
    width: 100%;
    margin: 0 0 8px;
    padding: 13px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
    box-sizing: border-box;
    transition:
        border-color 0.15s ease,
        background 0.15s ease,
        box-shadow 0.15s ease;
}

.inter-list-item:hover {
    border-color: rgba(211, 62, 55, 0.4);
    background: rgba(211, 62, 55, 0.025);
}

.inter-list-item.active {
    border-color: var(--primary-color);
    background: rgba(211, 62, 55, 0.055);
    box-shadow: inset 3px 0 0 var(--primary-color);
}

.inter-list-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.inter-list-number {
    overflow: hidden;
    font-size: 12px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inter-list-customer {
    margin-top: 8px;
    overflow: hidden;
    font-size: 15px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inter-list-meta {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 7px;
}

.inter-list-meta > span {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    color: var(--text-muted);
    font-size: 11px;
}

.inter-list-meta i {
    width: 13px;
    flex: 0 0 13px;
    text-align: center;
}

.inter-list-item-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 11px;
    padding-top: 9px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 10px;
}

.inter-list-item-bottom > span {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
}

.inter-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
}

.inter-status.planned {
    background: rgba(70, 130, 220, 0.13);
    color: #4a82d6;
}

.inter-status.in_progress {
    background: rgba(230, 160, 35, 0.14);
    color: #d49724;
}

.inter-status.completed {
    background: rgba(50, 170, 90, 0.14);
    color: #35a65e;
}

.inter-status.cancelled {
    background: rgba(127, 127, 127, 0.12);
    color: var(--text-muted);
}

.inter-detail-panel {
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    padding: 0;
    background: var(--page-bg);
}

.inter-detail-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 380px;
    padding: 30px;
    text-align: center;
    box-sizing: border-box;
}

.inter-detail-empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin-bottom: 15px;
    border-radius: 16px;
    background: rgba(127, 127, 127, 0.08);
    color: var(--text-muted);
    font-size: 25px;
}

.inter-detail-empty h2 {
    margin: 0;
    font-size: 18px;
}

.inter-detail-empty p {
    max-width: 420px;
    margin: 7px 0 18px;
    color: var(--text-muted);
    font-size: 12px;
}

.inter-empty-list,
.inter-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 180px;
    color: var(--text-muted);
    font-size: 12px;
}

.inter-empty-list i {
    font-size: 23px;
}

.inter-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 26px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--card-bg);
}

.inter-detail-eyebrow {
    margin-bottom: 4px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.inter-detail-header h2 {
    margin: 0;
    font-size: 21px;
    font-weight: 700;
    line-height: 1.2;
}

.inter-detail-subtitle {
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 12px;
}

.inter-info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding: 20px 26px 0;
}

.inter-info-item {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    padding: 13px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
}

.inter-info-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 7px;
    background: rgba(127, 127, 127, 0.07);
    color: var(--text-muted);
    font-size: 12px;
}

.inter-info-item > div:last-child {
    min-width: 0;
}

.inter-info-label {
    margin-bottom: 3px;
    color: var(--text-muted);
    font-size: 10px;
}

.inter-info-value {
    margin: 0;
    overflow: hidden;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: pre-line;
}

.inter-section,
.inter-form-section {
    margin: 20px 26px 0;
}

.inter-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 700;
}

.inter-section-title i {
    width: 16px;
    color: var(--text-muted);
    text-align: center;
}

.inter-furnaces {
    display: grid;
    grid-template-columns: repeat(
        auto-fill,
        minmax(190px, 1fr)
    );
    gap: 10px;
}

.inter-furnace-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
}

.inter-furnace-card strong {
    font-size: 14px;
}

.inter-furnace-card span {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 10px;
}

.inter-text-block {
    min-height: 48px;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
    font-size: 13px;
    line-height: 1.55;
    white-space: pre-wrap;
    box-sizing: border-box;
}

.inter-section-empty {
    padding: 18px;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 12px;
    text-align: center;
}

.inter-parts {
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
}

.inter-part {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 11px 13px;
    border-bottom: 1px solid var(--border-color);
}

.inter-part:last-child {
    border-bottom: 0;
}

.inter-part > div {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.inter-part span {
    color: var(--text-muted);
    font-size: 10px;
}

.inter-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.inter-form-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.inter-form-field.full {
    grid-column: 1 / -1;
}

.inter-form-field > span {
    color: var(--text-muted);
    font-size: 11px;
}

.inter-form-field input,
.inter-form-field select,
.inter-form-field textarea {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid var(--border-color);
    border-radius: 7px;
    outline: 0;
    background: var(--card-bg);
    color: var(--text-primary);
    font: inherit;
    box-sizing: border-box;
}

.inter-form-field input,
.inter-form-field select {
    height: 39px;
}

.inter-form-field textarea {
    min-height: 110px;
    resize: vertical;
}

.inter-form-field input:focus,
.inter-form-field select:focus,
.inter-form-field textarea:focus {
    border-color: var(--primary-color);
}

.inter-form-field select:disabled,
.inter-form-field input:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.inter-input-unit {
    display: flex;
    align-items: center;
    gap: 8px;
}

.inter-input-unit input {
    flex: 1;
}

.inter-input-unit > span {
    color: var(--text-muted);
    font-size: 11px;
}

.inter-furnace-selector {
    display: grid;
    grid-template-columns: repeat(
        auto-fit,
        minmax(190px, 1fr)
    );
    gap: 8px;
}

.inter-furnace-check {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 9px 11px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
    cursor: pointer;
    box-sizing: border-box;
}

.inter-furnace-check:hover {
    border-color: var(--primary-color);
}

.inter-furnace-check input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.inter-furnace-check-main {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.inter-furnace-check-main strong {
    font-size: 14px;
}

.inter-furnace-check-main small {
    margin-top: 2px;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inter-furnace-checkmark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: transparent;
    font-size: 10px;
}

.inter-furnace-check:has(input:checked) {
    border-color: var(--primary-color);
    background: rgba(211, 62, 55, 0.06);
}

.inter-furnace-check:has(input:checked)
.inter-furnace-checkmark {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: #fff;
}

.inter-create-modal .modal-header {
    align-items: flex-start;
}

.inter-create-modal .modal-title {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    font-weight: 700;
}

.inter-modal-subtitle {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 12px;
}

.inter-modal-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 250px;
    color: var(--text-muted);
}

.inter-modal-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.inter-modal-section {
    margin-bottom: 22px;
}

.inter-modal-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 11px;
    font-size: 13px;
    font-weight: 700;
}

.inter-modal-section-title > i {
    width: 17px;
    color: var(--text-muted);
    text-align: center;
}

.inter-modal-selected-count {
    margin-left: auto;
    padding: 3px 8px;
    border-radius: 10px;
    background: rgba(127, 127, 127, 0.1);
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 500;
}

.inter-modal-fields {
    display: grid;
    gap: 10px;
}

.inter-modal-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.inter-modal-field > span {
    color: var(--text-muted);
    font-size: 11px;
}

.inter-modal-furnaces {
    display: grid;
    grid-template-columns: repeat(
        auto-fill,
        minmax(185px, 1fr)
    );
    gap: 8px;
}

.inter-modal-empty {
    grid-column: 1 / -1;
    padding: 20px;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 12px;
    text-align: center;
}

.inter-modal-furnace {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 58px;
    padding: 10px 11px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
    cursor: pointer;
    transition:
        border-color 0.15s ease,
        background 0.15s ease;
}

.inter-modal-furnace:hover {
    border-color: var(--primary-color);
}

.inter-modal-furnace input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.inter-modal-furnace-main {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.inter-modal-furnace-main strong {
    font-size: 14px;
}

.inter-modal-furnace-main small {
    margin-top: 2px;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inter-modal-furnace-check {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 23px;
    height: 23px;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: transparent;
    font-size: 10px;
}

.inter-modal-furnace:has(input:checked) {
    border-color: var(--primary-color);
    background: rgba(211, 62, 55, 0.06);
}

.inter-modal-furnace:has(input:checked)
.inter-modal-furnace-check {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: #fff;
}

.inter-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin: 6px -16px -16px;
    padding: 15px 16px 0;
    border-top: 1px solid var(--border-color);
}

.inter-modal-error {
    margin-bottom: 18px;
}

@media (max-width: 1200px) {
    .inter-workspace {
        grid-template-columns: 320px minmax(0, 1fr);
    }

    .inter-info-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .inter-search {
        width: 270px;
        flex-basis: 270px;
    }
}

@media (max-width: 900px) {
    .inter-page {
        padding: 18px;
    }

    .inter-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .inter-status-filters {
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .inter-status-filter.active::after {
        display: none;
    }

    .inter-search {
        width: 100%;
        flex-basis: auto;
    }

    .inter-workspace {
        display: flex;
        flex-direction: column;
        overflow: visible;
    }

    .inter-list-panel {
        max-height: 360px;
        border-right: 0;
        border-bottom: 1px solid var(--border-color);
    }

    .inter-detail-panel {
        min-height: 500px;
    }

    .inter-info-grid {
        grid-template-columns: 1fr;
    }

    .inter-form-grid,
    .inter-modal-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 650px) {
    .inter-page-header {
        align-items: stretch;
        flex-direction: column;
    }

    .inter-page-header .btn {
        width: 100%;
    }

    .inter-detail-header {
        flex-direction: column;
    }

    .inter-info-grid,
    .inter-section,
    .inter-form-section,
    .inter-detail-actions {
        margin-right: 16px;
        margin-left: 16px;
    }

    .inter-info-grid {
        padding-right: 0;
        padding-left: 0;
    }

    .inter-detail-header {
        padding-right: 16px;
        padding-left: 16px;
    }
}



.inter-workspace.calendar-mode {
    display: block;
    overflow: auto;
    background: var(--card-bg);
}

.inter-calendar {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.inter-calendar-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 20px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-color);
    background: var(--card-bg);
}

.inter-calendar-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
}

.inter-calendar-navigation {
    display: flex;
    align-items: center;
    gap: 6px;
}

.inter-calendar-legend {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    color: var(--text-muted);
    font-size: 10px;
}

.inter-calendar-legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.inter-calendar-legend span::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.inter-calendar-legend .planned::before {
    background: #4a82d6;
}

.inter-calendar-legend .in_progress::before {
    background: #d49724;
}

.inter-calendar-legend .completed::before {
    background: #35a65e;
}

.inter-calendar-weekdays {
    display: grid;
    grid-template-columns:
        repeat(7, minmax(0, 1fr));
    border-bottom: 1px solid var(--border-color);
    background: var(--card-bg);
}

.inter-calendar-weekdays > div {
    padding: 9px 10px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
}

.inter-calendar-grid {
    display: grid;
    grid-template-columns:
        repeat(7, minmax(0, 1fr));
    grid-template-rows:
        repeat(6, minmax(115px, 1fr));
    flex: 1;
}

.inter-calendar-day {
    position: relative;
    min-width: 0;
    min-height: 115px;
    padding: 7px;
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    background: var(--card-bg);
}

.inter-calendar-day:nth-child(7n) {
    border-right: 0;
}

.inter-calendar-day.outside {
    background: rgba(127, 127, 127, 0.025);
}

.inter-calendar-day.outside
.inter-calendar-day-number {
    opacity: 0.35;
}

.inter-calendar-day.today {
    background: rgba(211, 62, 55, 0.025);
}

.inter-calendar-day-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 25px;
    margin-bottom: 5px;
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
}

.inter-calendar-day.today
.inter-calendar-day-number {
    background: var(--primary-color);
    color: #fff;
}

.inter-calendar-events {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.inter-calendar-event {
    display: block;
    width: 100%;
    padding: 5px 7px;
    overflow: hidden;
    border: 0;
    border-left: 3px solid;
    border-radius: 5px;
    background: rgba(127, 127, 127, 0.06);
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
}

.inter-calendar-event:hover {
    filter: brightness(0.97);
}

.inter-calendar-event.planned {
    border-left-color: #4a82d6;
    background: rgba(70, 130, 220, 0.08);
}

.inter-calendar-event.in_progress {
    border-left-color: #d49724;
    background: rgba(230, 160, 35, 0.09);
}

.inter-calendar-event.completed {
    border-left-color: #35a65e;
    background: rgba(50, 170, 90, 0.08);
}

.inter-calendar-event.cancelled {
    border-left-color: #999;
    opacity: 0.55;
}

.inter-calendar-event-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
    margin-bottom: 2px;
    color: var(--text-muted);
    font-size: 9px;
}

.inter-calendar-event strong {
    display: block;
    overflow: hidden;
    font-size: 10px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inter-calendar-event small {
    display: block;
    margin-top: 2px;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 1000px) {
    .inter-calendar-header {
        grid-template-columns: 1fr;
    }

    .inter-calendar-header h2 {
        grid-row: 1;
    }

    .inter-calendar-navigation {
        justify-content: center;
    }

    .inter-calendar-legend {
        justify-content: center;
    }

    .inter-calendar-grid {
        min-width: 900px;
    }

    .inter-calendar-weekdays {
        min-width: 900px;
    }
}

.inter-workspace {
    grid-template-columns:
        380px
        minmax(0, 1fr);
}

.inter-detail-panel > #interventionDetail {
    width: min(
        100%,
        1180px
    );

    margin: 0 auto;

    background:
        var(--card-bg);
}

.inter-detail-header {
    position: sticky;
    top: 0;
    z-index: 5;

    align-items: center;

    padding:
        20px
        24px;

    background:
        var(--card-bg);

    box-shadow:
        0 1px 0
        var(--border-color);
}

.inter-detail-header h2 {
    font-size: 22px;
}

.inter-detail-subtitle {
    margin-top: 4px;

    font-size: 13px;
}

.inter-info-grid {
    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );

    gap: 10px;

    padding:
        18px
        24px
        0;
}

.inter-info-item {
    min-height: 64px;

    padding:
        11px
        13px;

    border-radius:
        10px;
}

.inter-info-icon {
    width: 36px;
    height: 36px;

    flex-basis: 36px;

    border-radius:
        9px;

    background:
        rgba(127, 127, 127, 0.06);

    font-size:
        13px;
}

.inter-info-label {
    margin-bottom: 2px;

    font-size: 10px;

    text-transform:
        uppercase;

    letter-spacing:
        0.04em;
}

.inter-info-value {
    font-size: 13px;
}

.inter-section {
    margin:
        18px
        24px
        0;

    padding:
        16px;

    border:
        1px solid
        var(--border-color);

    border-radius:
        10px;

    background:
        var(--card-bg);
}

.inter-section-title {
    margin-bottom:
        12px;

    font-size:
        13px;
}

.inter-section-title i {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 28px;
    height: 28px;

    border-radius:
        7px;

    background:
        rgba(127, 127, 127, 0.07);
}

.inter-furnaces {
    grid-template-columns:
        repeat(
            auto-fit,
            minmax(
                220px,
                1fr
            )
        );
}

.inter-furnace-card {
    position: relative;

    padding:
        13px
        14px
        13px
        18px;

    border-radius:
        9px;

    overflow:
        hidden;
}

.inter-furnace-card::before {
    content: "";

    position: absolute;

    top: 0;
    bottom: 0;
    left: 0;

    width: 4px;

    background:
        var(--primary-color);
}

.inter-furnace-card strong {
    font-size:
        15px;
}

.inter-text-block {
    min-height: 0;

    padding: 0;

    border: 0;

    background:
        transparent;

    font-size:
        13px;

    line-height:
        1.6;
}

.inter-detail-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;

    margin:
        20px
        24px
        24px;

    padding-top:
        16px;

    border-top:
        1px solid
        var(--border-color);

    background:
        transparent;
}

.inter-detail-actions .btn {
    min-width:
        100px;
}

.inter-list {
    padding: 8px;
}

.inter-list-item {
    margin-bottom: 6px;

    padding:
        11px
        12px;

    border-radius:
        9px;
}

.inter-list-customer {
    margin-top: 6px;

    font-size:
        14px;
}

.inter-list-meta {
    gap: 3px;

    margin-top: 5px;
}

.inter-list-item-bottom {
    margin-top: 8px;

    padding-top: 7px;
}

.inter-list-item.active {
    border-color:
        rgba(
            211,
            62,
            55,
            0.35
        );

    background:
        rgba(
            211,
            62,
            55,
            0.055
        );

    box-shadow:
        inset
        4px
        0
        0
        var(--primary-color);
}

.inter-info-item,
.inter-section {
    border-color:
        rgba(127, 127, 127, 0.18);

    background:
        rgba(127, 127, 127, 0.075);
}

.inter-info-icon,
.inter-section-title i {
    background:
        rgba(127, 127, 127, 0.11);
}

.inter-list-group {
    margin-bottom: 14px;
}

.inter-list-group-title {
    position: sticky;
    top: 0;
    z-index: 2;

    display: flex;
    align-items: center;
    justify-content: space-between;

    margin: 0 -2px 7px;
    padding: 7px 8px;

    background:
        var(--card-bg);

    color:
        var(--text-muted);

    font-size:
        10px;

    font-weight:
        700;

    text-transform:
        uppercase;

    letter-spacing:
        0.05em;
}

.inter-list-group-title > span:last-child {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 20px;
    height: 20px;

    padding: 0 6px;

    border-radius: 10px;

    background:
        rgba(127, 127, 127, 0.1);

    font-size:
        9px;
}

.inter-workspace.map-mode {
    display: block;
    min-height: 0;
}

.inter-map-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 600px;
}

.inter-map {
    flex: 1;
    width: 100%;
    min-height: 600px;
    border-radius: 10px;
    overflow: hidden;
}

.inter-map-info {
    padding: 10px 0 0;
    font-size: 13px;
    color: #64748b;
}

.inter-list-plan {
    display: inline-flex;
    align-items: center;
    gap: 5px;

    margin-left: auto;

    color: var(--primary-color);

    font-weight: 600;

    cursor: pointer;
}

.inter-list-plan:hover {
    text-decoration: underline;
}

/* =========================================================
   GESTION DES ACCÈS
   ========================================================= */

.access-page {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.access-page .page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.access-page .page-eyebrow {
    margin-bottom: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted, #6b7280);
}

.access-page .page-header h1 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 1.6rem;
    font-weight: 700;
}

.access-page .page-header h1 i {
    font-size: 1.25rem;
}

.access-page .page-header p {
    margin: 5px 0 0;
    color: var(--text-muted, #6b7280);
}


/* Onglets */

.access-tabs {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px;
    width: fit-content;
    max-width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 10px;
    background: var(--card-bg, #fff);
}

.access-tab {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 13px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--text-muted, #6b7280);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition:
        background-color 0.15s ease,
        color 0.15s ease;
}

.access-tab:hover {
    background: var(--hover-bg, #f3f4f6);
    color: var(--text-color, #111827);
}

.access-tab.active {
    background: var(--primary, #2563eb);
    color: #fff;
}

.access-tab i {
    width: 16px;
    text-align: center;
}


/* Contenu */

.access-content {
    min-height: 180px;
    overflow: hidden;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 12px;
    background: var(--card-bg, #fff);
}

.access-content .table-responsive {
    overflow-x: auto;
}

.access-content table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
}

.access-content thead {
    background: var(--table-header-bg, #f8fafc);
}

.access-content th {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    color: var(--text-muted, #6b7280);
    font-size: 0.75rem;
    font-weight: 700;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.035em;
    white-space: nowrap;
}

.access-content td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    vertical-align: middle;
    font-size: 0.9rem;
}

.access-content tbody tr:last-child td {
    border-bottom: 0;
}

.access-content tbody tr:hover {
    background: var(--hover-bg, #f8fafc);
}


/* Login / codes */

.access-content code {
    padding: 3px 6px;
    border-radius: 5px;
    background: var(--code-bg, #f3f4f6);
    color: inherit;
    font-size: 0.82rem;
}


/* Badges */

.access-content .badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 7px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
}

.access-content .text-bg-success {
    background: #dcfce7;
    color: #166534;
}

.access-content .text-bg-secondary {
    background: #e5e7eb;
    color: #374151;
}

.access-content .text-bg-danger {
    background: #fee2e2;
    color: #991b1b;
}


/* Chargement */

.access-content .inter-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 180px;
    color: var(--text-muted, #6b7280);
}


/* Erreurs */

.access-content .alert {
    margin: 16px;
    padding: 12px 14px;
    border-radius: 8px;
}

.access-content .alert-danger {
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #991b1b;
}


/* Mobile */

@media (max-width: 700px) {
    .access-page .page-header h1 {
        font-size: 1.35rem;
    }

    .access-tabs {
        width: 100%;
    }

    .access-content th,
    .access-content td {
        padding: 9px 10px;
    }
}

.access-permission-table th,
.access-permission-table td {
    text-align: center;
    white-space: nowrap;
}

.access-permission-table .access-user-column {
    position: sticky;
    left: 0;
    z-index: 2;
    min-width: 190px;
    text-align: left;
    background: var(--card-bg, #fff);
}

.access-permission-table thead .access-user-column {
    z-index: 3;
    background: var(--table-header-bg, #f8fafc);
}

.access-user-column small {
    display: block;
    margin-top: 2px;
    color: var(--text-muted, #6b7280);
    font-weight: 400;
}

.access-permission-level {
    width: 48px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
}

.access-permission-level.level-no {
    background: #f3f4f6;
    color: #9ca3af;
}

.access-permission-level.level-r {
    background: #dbeafe;
    color: #1d4ed8;
}

.access-permission-level.level-rw {
    background: #dcfce7;
    color: #15803d;
}

.access-permission-level.level-adm {
    background: #fee2e2;
    color: #b91c1c;
}

.access-permission-level:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.12);
}

.access-permission-level:disabled {
    opacity: 0.45;
    cursor: default;
}

.access-role-row td {
    border-top: 2px solid var(--border-color, #e5e7eb);
    background: var(--table-header-bg, #f8fafc);
}

.access-role-row .access-user-column > strong {
    display: block;
}

.access-role-row .access-user-column > small {
    color: var(--text-muted, #6b7280);
}

.access-user-indent {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 18px;
}

.access-user-indent > i {
    font-size: 0.65rem;
    color: var(--text-muted, #9ca3af);
}

.access-user-indent strong,
.access-user-indent small {
    display: block;
}

.access-user-indent small {
    margin-top: 2px;
    color: var(--text-muted, #6b7280);
    font-weight: 400;
}

.access-user-permission {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    min-height: 42px;
    padding: 3px 6px;
    border: 0;
    border-radius: 7px;
    cursor: pointer;
}

.access-user-permission strong {
    line-height: 1;
    font-size: 0.78rem;
}

.access-user-permission small {
    margin-top: 4px;
    line-height: 1;
    font-size: 0.65rem;
    opacity: 0.65;
}

.access-user-permission.level-inherit {
    background: #f3f4f6;
    color: #4b5563;
}

.access-user-permission.level-no {
    background: #f3f4f6;
    color: #9ca3af;
}

.access-user-permission.level-r {
    background: #dbeafe;
    color: #1d4ed8;
}

.access-user-permission.level-rw {
    background: #dcfce7;
    color: #15803d;
}

.access-user-permission.level-adm {
    background: #fee2e2;
    color: #b91c1c;
}

.access-hover-highlight {
    font-weight: 800 !important;
}

.access-permission-table thead th.access-hover-highlight {
    background: rgba(0, 0, 0, 0.06);
}

.access-permission-table .access-user-column.access-hover-highlight {
    background: rgba(0, 0, 0, 0.06);
}
/* =========================================================
   GESTION DES RESSOURCES
   ========================================================= */

.resources-page {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.resources-page .page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.resources-page .page-eyebrow {
    margin-bottom: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted, #6b7280);
}

.resources-page .page-header h1 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 1.6rem;
    font-weight: 700;
}

.resources-page .page-header h1 i {
    font-size: 1.25rem;
}

.resources-page .page-header p {
    margin: 5px 0 0;
    color: var(--text-muted, #6b7280);
}

.resources-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.resources-filters {
    display: flex;
    gap: 8px;
}

.resources-filters .form-select {
    width: auto;
    min-width: 140px;
}

.resources-search .form-control {
    min-width: 220px;
}

.resources-content {
    min-height: 180px;
    overflow: hidden;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 12px;
    background: var(--card-bg, #fff);
}

.resources-content .table-responsive {
    overflow-x: auto;
}

.resources-content table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
}

.resources-content thead {
    background: var(--table-header-bg, #f8fafc);
}

.resources-content th {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    color: var(--text-muted, #6b7280);
    font-size: 0.75rem;
    font-weight: 700;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.035em;
    white-space: nowrap;
}

.resources-content td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    vertical-align: middle;
    font-size: 0.9rem;
}

.resources-content tbody tr:last-child td {
    border-bottom: 0;
}

.resources-content tbody tr:hover {
    background: var(--hover-bg, #f8fafc);
}

.resources-content code {
    padding: 3px 6px;
    border-radius: 5px;
    background: var(--code-bg, #f3f4f6);
    font-size: 0.82rem;
}

.resources-content .badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 7px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
}

.resources-content .inter-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 180px;
    color: var(--text-muted, #6b7280);
}

.resources-content .alert {
    margin: 16px;
    padding: 12px 14px;
    border-radius: 8px;
}

@media (max-width: 700px) {
    .resources-page .page-header h1 {
        font-size: 1.35rem;
    }
    .resources-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .resources-filters {
        flex-direction: column;
    }
    .resources-search .form-control {
        min-width: 0;
    }
}



/* ── Sidebar group / submenu ── */

.sidebar-group {
    display: flex;
    flex-direction: column;
}

.sidebar-group-toggle {
    justify-content: flex-start;
    cursor: pointer;
    background: transparent;
    border: 0;
    width: 100%;
    color: var(--sidebar-text);
    font: inherit;
}

.sidebar-group-toggle:hover {
    background: var(--sidebar-soft);
    color: white;
}

.sidebar-group-chevron {
    margin-left: auto;
    font-size: 11px;
    opacity: .5;
    transition: transform .2s ease;
}

.sidebar-group.open .sidebar-group-chevron {
    transform: rotate(180deg);
}

.sidebar-submenu {
    display: none;
    flex-direction: column;
    gap: 2px;
    padding: 4px 0 4px 10px;
}

.sidebar-group.open .sidebar-submenu {
    display: flex;
}

.sidebar-sublink {
    height: 40px;
    font-size: 14px;
    color: var(--sidebar-muted);
}

.sidebar-sublink:hover {
    color: white;
}

.sidebar-sublink.active {
    color: white;
    opacity: 1;
}



body.nav-compact .sidebar-group-toggle span,
body.nav-compact .sidebar-group-chevron {
    display: none;
}

body.nav-compact .sidebar-submenu {
    position: absolute;
    left: 76px;
    z-index: 100;
    min-width: 200px;
    padding: 8px;
    border-radius: 10px;
    background: var(--sidebar);
    box-shadow: 0 8px 24px rgba(0,0,0,.25);
}

body.nav-compact .sidebar-group.open .sidebar-submenu {
    display: flex;
}

body.nav-compact .sidebar-sublink span {
    display: inline;
}

/* ── Drag'n'drop menu ── */

[data-nav-key] {
    cursor: grab;
}

[data-nav-key]:active {
    cursor: grabbing;
}

.nav-dragging {
    opacity: 0.4;
}

[data-nav-key]:hover {
    box-shadow: 0 0 0 1px rgba(255,255,255,.1) inset;
}