* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: system-ui, sans-serif;
    display: grid;
    grid-template: 60px 1fr / 250px 1fr 250px;
    height: 100vh;
    background: #fafafa;
    color: #333;
    transition: background 0.3s, color 0.3s;
}

body.dark-mode {
    background: #1a1a1a;
    color: #e0e0e0;
}

header {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    background: white;
    border-bottom: 1px solid #e0e0e0;
    transition: background 0.3s, border-color 0.3s;
}

body.dark-mode header {
    background: #2a2a2a;
    border-bottom: 1px solid #3a3a3a;
}

h1 { font-size: 1.2rem; font-weight: 500; }

.header-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.custom-range {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.custom-range input[type="date"] {
    padding: 0.3rem 0.4rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    color: #333;
    font-size: 0.85rem;
}

body.dark-mode .custom-range input[type="date"] {
    border: 1px solid #444;
    background: #333;
    color: #e0e0e0;
}

.custom-range button {
    padding: 0.35rem 0.6rem;
    border: 1px solid #4caf50;
    border-radius: 4px;
    background: #4caf50;
    color: white;
    font-size: 0.85rem;
    cursor: pointer;
}

.custom-range span {
    opacity: 0.7;
}

#theme-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    transition: transform 0.2s;
}

#theme-toggle:hover {
    transform: scale(1.1);
}

#season-display {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    min-width: 2rem;
    text-align: center;
}

select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    color: #333;
    cursor: pointer;
    transition: background 0.3s, border-color 0.3s, color 0.3s;
}

body.dark-mode select {
    border: 1px solid #444;
    background: #333;
    color: #e0e0e0;
}

select:focus {
    outline: none;
    border-color: #4caf50;
}

main {
    display: flex;
    height: calc(100vh - 60px);
}

#sidebar {
    overflow-y: auto;
    padding: 1rem;
    background: white;
    border-right: 1px solid #e0e0e0;
    transition: background 0.3s, border-color 0.3s;
}

body.dark-mode #sidebar {
    background: #2a2a2a;
    border-right: 1px solid #3a3a3a;
}

#search {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    background: white;
    color: #333;
    transition: background 0.3s, border-color 0.3s, color 0.3s;
}

body.dark-mode #search {
    border: 1px solid #444;
    background: #333;
    color: #e0e0e0;
}

#search:focus {
    outline: none;
    border-color: #4caf50;
}

.custom-path-section {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #ddd;
    transition: border-color 0.3s;
}

body.dark-mode .custom-path-section {
    border-top: 1px solid #444;
}

.custom-path-section h3 {
    font-size: 0.85rem;
    margin-bottom: 0.6rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

body.dark-mode .custom-path-section h3 {
    color: #aaa;
}

.custom-path-section input {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    background: white;
    color: #333;
    transition: background 0.3s, border-color 0.3s, color 0.3s;
}

body.dark-mode .custom-path-section input {
    border: 1px solid #444;
    background: #333;
    color: #e0e0e0;
}

.custom-path-section input:focus {
    outline: none;
    border-color: #4caf50;
}

#custom-path-load {
    width: 100%;
    padding: 0.5rem;
    background: #4caf50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background 0.3s;
}

#custom-path-load:hover {
    background: #45a049;
}

#custom-path-load:active {
    transform: scale(0.98);
}

.custom-results {
    margin-top: 0.8rem;
    font-size: 0.8rem;
    max-height: 150px;
    overflow-y: auto;
}

.custom-results .result-item {
    padding: 0.4rem;
    margin: 0.2rem 0;
    background: #f5f5f5;
    border-radius: 3px;
    word-break: break-word;
    cursor: pointer;
    transition: background 0.3s;
}

body.dark-mode .custom-results .result-item {
    background: #333;
}

.custom-results .result-item:hover {
    background: #efefef;
}

body.dark-mode .custom-results .result-item:hover {
    background: #444;
}

#sidebar label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s;
}

#sidebar label:hover { background: #f5f5f5; }
body.dark-mode #sidebar label:hover { background: #333; }
#sidebar input { cursor: pointer; }

#flowers-sidebar {
    overflow-y: auto;
    padding: 1.2rem;
    background: white;
    border-left: 1px solid #e0e0e0;
    transition: background 0.3s, border-color 0.3s;
}

.right-tabs {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.8rem;
    flex-wrap: wrap;
}

.right-tab {
    border: 1px solid #e0e0e0;
    background: #f7f7f7;
    color: #555;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.right-tab.active {
    background: #4caf50;
    border-color: #4caf50;
    color: #fff;
}

body.dark-mode .right-tab {
    background: #2a2a2a;
    border-color: #3a3a3a;
    color: #ccc;
}

body.dark-mode .right-tab.active {
    background: #4caf50;
    border-color: #4caf50;
    color: #fff;
}

.right-panel {
    display: none;
}

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

.right-placeholder {
    font-size: 0.8rem;
    color: #777;
    line-height: 1.4;
}

body.dark-mode .right-placeholder {
    color: #aaa;
}

.fishing-season {
    font-size: 0.8rem;
    color: #777;
    margin-bottom: 0.6rem;
}

body.dark-mode .fishing-season {
    color: #aaa;
}

.fishing-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.fish-group {
    border-bottom: 1px solid #eee;
    padding-bottom: 0.6rem;
    margin-bottom: 0.6rem;
}

body.dark-mode .fish-group {
    border-bottom: 1px solid #333;
}

.fish-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.fish-group h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #999;
    letter-spacing: 0.5px;
    margin-bottom: 0.4rem;
    font-weight: 600;
}

body.dark-mode .fish-group h3 {
    color: #777;
}

.fish-card {
    padding: 0.8rem 0;
    border-bottom: none;
    transition: opacity 0.2s;
}

.fish-card:hover {
    opacity: 0.85;
}

.fish-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
    color: inherit;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fish-stock {
    font-size: 0.8rem;
    font-weight: 500;
    color: #4caf50;
}

body.dark-mode .fish-stock {
    color: #66bb6a;
}

.fish-info {
    font-size: 0.8rem;
    color: #777;
    margin-bottom: 0.4rem;
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

body.dark-mode .fish-info {
    color: #999;
}

.fish-recipe {
    font-size: 0.75rem;
    line-height: 1.6;
    color: #666;
    margin-top: 0.4rem;
}

body.dark-mode .fish-recipe {
    color: #aaa;
}

body.dark-mode #flowers-sidebar {
    background: #1a1a1a;
    border-left: 1px solid #333;
}

#flowers-sidebar h2 {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 0.8rem;
    color: #999;
    text-transform: uppercase;
}

body.dark-mode #flowers-sidebar h2 {
    color: #777;
}

#flowers-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.flower-group {
    border-bottom: 1px solid #eee;
    padding-bottom: 0.6rem;
    margin-bottom: 0.6rem;
}

body.dark-mode .flower-group {
    border-bottom: 1px solid #333;
}

.flower-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.flower-group h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #999;
    letter-spacing: 0.5px;
    margin-bottom: 0.4rem;
    font-weight: 600;
}

body.dark-mode .flower-group h3 {
    color: #777;
}

.flower-card {
    padding: 0.8rem 0;
    border-bottom: none;
    transition: opacity 0.2s;
}

body.dark-mode .flower-card {
    border-bottom: none;
}

.flower-card:last-child {
    border-bottom: none;
}

.flower-card:hover {
    opacity: 0.85;
}

.flower-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
    color: inherit;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flower-stock {
    font-size: 0.8rem;
    font-weight: 500;
    color: #4caf50;
}

body.dark-mode .flower-stock {
    color: #66bb6a;
}

.flower-info {
    font-size: 0.8rem;
    color: #777;
    margin-bottom: 0.4rem;
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

body.dark-mode .flower-info {
    color: #999;
}

.flower-recipe {
    font-size: 0.75rem;
    line-height: 1.6;
    color: #666;
    margin-top: 0.4rem;
}

body.dark-mode .flower-recipe {
    color: #aaa;
}

.food-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.food-group {
    border-bottom: 1px solid #eee;
    padding-bottom: 0.6rem;
    margin-bottom: 0.6rem;
}

body.dark-mode .food-group {
    border-bottom: 1px solid #333;
}

.food-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.food-group h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #999;
    letter-spacing: 0.5px;
    margin-bottom: 0.4rem;
    font-weight: 600;
}

body.dark-mode .food-group h3 {
    color: #777;
}

.food-card {
    padding: 0.8rem 0;
    border-bottom: none;
    transition: opacity 0.2s;
}

.food-card:hover {
    opacity: 0.85;
}

.food-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
    color: inherit;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.food-stock {
    font-size: 0.8rem;
    font-weight: 500;
    color: #4caf50;
}

body.dark-mode .food-stock {
    color: #66bb6a;
}

.food-info {
    font-size: 0.8rem;
    color: #777;
    margin-bottom: 0.4rem;
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

body.dark-mode .food-info {
    color: #999;
}

.food-recipe {
    font-size: 0.75rem;
    line-height: 1.6;
    color: #666;
    margin-top: 0.4rem;
}

body.dark-mode .food-recipe {
    color: #aaa;
}

.recipe-step {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0.2rem 0;
}

.recipe-base {
    font-weight: 500;
    color: inherit;
}

.recipe-status-good {
    color: #4caf50;
    font-weight: 600;
}

.recipe-status-bad {
    color: #ff9800;
    font-weight: 600;
}

/* ========== VEGETABLES PANEL ========== */
.vegetable-group {
    border-bottom: 1px solid #eee;
    padding-bottom: 0.6rem;
    margin-bottom: 0.6rem;
}

body.dark-mode .vegetable-group {
    border-bottom: 1px solid #333;
}

.vegetable-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.vegetable-group h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #999;
    letter-spacing: 0.5px;
    margin-bottom: 0.4rem;
    font-weight: 600;
}

body.dark-mode .vegetable-group h3 {
    color: #777;
}

.vegetable-card {
    padding: 0.8rem 0;
    border-bottom: none;
    transition: opacity 0.2s;
}

.vegetable-card:hover {
    opacity: 0.85;
}

.vegetable-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
    color: inherit;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.veg-right {
    display: flex;
    gap: 0.6rem;
    align-items: center;
}

.veg-to-top {
    font-weight: 600;
    font-size: 0.8rem;
}

.vegetable-stock {
    font-size: 0.8rem;
    font-weight: 500;
    min-width: 50px;
    text-align: right;
}

.vegetable-info {
    font-size: 0.8rem;
    color: #777;
    margin-bottom: 0.4rem;
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    justify-content: space-between;
}

.veg-max {
    min-width: 50px;
    text-align: right;
}

body.dark-mode .vegetable-info {
    color: #999;
}

/* Urgency color classes */
.urgent-critical {
    color: #d32f2f !important;
    font-weight: 600;
}

body.dark-mode .urgent-critical {
    color: #ef5350 !important;
}

.urgent-very-high {
    color: #f4511e !important;
    font-weight: 600;
}

body.dark-mode .urgent-very-high {
    color: #ff5722 !important;
}

.urgent-high {
    color: #f57c00 !important;
    font-weight: 600;
}

body.dark-mode .urgent-high {
    color: #ff9800 !important;
}

.urgent-medium {
    color: #ffa726 !important;
    font-weight: 600;
}

body.dark-mode .urgent-medium {
    color: #ffb74d !important;
}

.urgent-low {
    color: #7cb342 !important;
    font-weight: 500;
}

body.dark-mode .urgent-low {
    color: #9ccc65 !important;
}

.urgent-good {
    color: #4caf50 !important;
    font-weight: 500;
}

body.dark-mode .urgent-good {
    color: #66bb6a !important;
}

/* ========== FRUITS PANEL ========== */
.fruit-group {
    border-bottom: 1px solid #eee;
    padding-bottom: 0.6rem;
    margin-bottom: 0.6rem;
}

body.dark-mode .fruit-group {
    border-bottom: 1px solid #333;
}

.fruit-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.fruit-group h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #999;
    letter-spacing: 0.5px;
    margin-bottom: 0.4rem;
    font-weight: 600;
}

body.dark-mode .fruit-group h3 {
    color: #777;
}

.fruit-card {
    padding: 0.8rem 0;
    border-bottom: none;
    transition: opacity 0.2s;
}

.fruit-card:hover {
    opacity: 0.85;
}

.fruit-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
    color: inherit;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fruit-right {
    display: flex;
    gap: 0.6rem;
    align-items: center;
}

.fruit-to-top {
    font-weight: 600;
    font-size: 0.8rem;
}

.fruit-stock {
    font-size: 0.8rem;
    font-weight: 500;
    min-width: 50px;
    text-align: right;
}

.fruit-info {
    font-size: 0.8rem;
    color: #777;
    margin-bottom: 0.4rem;
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    justify-content: space-between;
}

.fruit-max {
    min-width: 50px;
    text-align: right;
}

body.dark-mode .fruit-info {
    color: #999;
}

/* ========== GREENHOUSE PANEL ========== */
.greenhouse-group {
    border-bottom: 1px solid #eee;
    padding-bottom: 0.6rem;
    margin-bottom: 0.6rem;
}

body.dark-mode .greenhouse-group {
    border-bottom: 1px solid #333;
}

.greenhouse-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.greenhouse-group h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #999;
    letter-spacing: 0.5px;
    margin-bottom: 0.4rem;
    font-weight: 600;
}

body.dark-mode .greenhouse-group h3 {
    color: #777;
}

.greenhouse-card {
    padding: 0.8rem 0;
    border-bottom: none;
    transition: opacity 0.2s;
}

.greenhouse-card:hover {
    opacity: 0.85;
}

.greenhouse-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
    color: inherit;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.greenhouse-right {
    display: flex;
    gap: 0.6rem;
    align-items: center;
}

.greenhouse-to-top {
    font-weight: 600;
    font-size: 0.8rem;
}

.greenhouse-stock {
    font-size: 0.8rem;
    font-weight: 500;
    min-width: 50px;
    text-align: right;
}

.greenhouse-info {
    font-size: 0.8rem;
    color: #777;
    margin-bottom: 0.4rem;
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    justify-content: space-between;
}

.greenhouse-max {
    min-width: 50px;
    text-align: right;
}

body.dark-mode .greenhouse-info {
    color: #999;
}

/* ========== RESOURCES PANEL ========== */
.resource-group {
    border-bottom: 1px solid #eee;
    padding-bottom: 0.6rem;
    margin-bottom: 0.6rem;
}

body.dark-mode .resource-group {
    border-bottom: 1px solid #333;
}

.resource-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.resource-group h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #999;
    letter-spacing: 0.5px;
    margin-bottom: 0.4rem;
    font-weight: 600;
}

body.dark-mode .resource-group h3 {
    color: #777;
}

.resource-card {
    padding: 0.8rem 0;
    border-bottom: none;
    transition: opacity 0.2s;
}

.resource-card:hover {
    opacity: 0.85;
}

.resource-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
    color: inherit;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.resource-right {
    display: flex;
    gap: 0.6rem;
    align-items: center;
}

.resource-to-top {
    font-weight: 600;
    font-size: 0.8rem;
}

.resource-stock {
    font-size: 0.8rem;
    font-weight: 500;
    min-width: 50px;
    text-align: right;
}

.resource-info {
    font-size: 0.8rem;
    color: #777;
    margin-bottom: 0.4rem;
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    justify-content: space-between;
}

.resource-max {
    min-width: 50px;
    text-align: right;
}

body.dark-mode .resource-info {
    color: #999;
}

/* ========== ANIMALS PANEL ========== */
.animal-group {
    border-bottom: 1px solid #eee;
    padding-bottom: 0.6rem;
    margin-bottom: 0.6rem;
}

body.dark-mode .animal-group {
    border-bottom: 1px solid #333;
}

.animal-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.animal-group h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #999;
    letter-spacing: 0.5px;
    margin-bottom: 0.4rem;
    font-weight: 600;
}

body.dark-mode .animal-group h3 {
    color: #777;
}

.animal-card {
    padding: 0.8rem 0;
    border-bottom: none;
    transition: opacity 0.2s;
}

.animal-card:hover {
    opacity: 0.85;
}

.animal-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
    color: inherit;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.animal-right {
    display: flex;
    gap: 0.6rem;
    align-items: center;
}

.animal-to-top {
    font-weight: 600;
    font-size: 0.8rem;
}

.animal-stock {
    font-size: 0.8rem;
    font-weight: 500;
    min-width: 50px;
    text-align: right;
}

.animal-info {
    font-size: 0.8rem;
    color: #777;
    margin-bottom: 0.4rem;
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    justify-content: space-between;
}

.animal-max {
    min-width: 50px;
    text-align: right;
}

body.dark-mode .animal-info {
    color: #999;
}

/* ========== COMPOSTERS PANEL ========== */
.composter-group {
    border-bottom: 1px solid #eee;
    padding-bottom: 0.6rem;
    margin-bottom: 0.6rem;
}

body.dark-mode .composter-group {
    border-bottom: 1px solid #333;
}

.composter-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.composter-group h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #999;
    letter-spacing: 0.5px;
    margin-bottom: 0.4rem;
    font-weight: 600;
}

body.dark-mode .composter-group h3 {
    color: #777;
}

.composter-card {
    padding: 0.8rem 0;
    border-bottom: none;
    transition: opacity 0.2s;
}

.composter-card:hover {
    opacity: 0.85;
}

.composter-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
    color: inherit;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.composter-right {
    display: flex;
    gap: 0.6rem;
    align-items: center;
}

.composter-to-top {
    font-weight: 600;
    font-size: 0.8rem;
}

.composter-stock {
    font-size: 0.8rem;
    font-weight: 500;
    min-width: 50px;
    text-align: right;
}

.composter-info {
    font-size: 0.8rem;
    color: #777;
    margin-bottom: 0.4rem;
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    justify-content: space-between;
}

.composter-max {
    min-width: 50px;
    text-align: right;
}

body.dark-mode .composter-info {
    color: #999;
}

/* ========== CRUSTACEANS PANEL ========== */
.crustacean-group {
    border-bottom: 1px solid #eee;
    padding-bottom: 0.6rem;
    margin-bottom: 0.6rem;
}

body.dark-mode .crustacean-group {
    border-bottom: 1px solid #333;
}

.crustacean-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.crustacean-group h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #999;
    letter-spacing: 0.5px;
    margin-bottom: 0.4rem;
    font-weight: 600;
}

body.dark-mode .crustacean-group h3 {
    color: #777;
}

.crustacean-card {
    padding: 0.8rem 0;
    border-bottom: none;
    transition: opacity 0.2s;
}

.crustacean-card:hover {
    opacity: 0.85;
}

.crustacean-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
    color: inherit;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.crustacean-stock {
    font-size: 0.8rem;
    font-weight: 500;
    min-width: 50px;
    text-align: right;
}

.crustacean-info {
    font-size: 0.8rem;
    color: #777;
    margin-bottom: 0.3rem;
}

body.dark-mode .crustacean-info {
    color: #999;
}

.crustacean-recipe {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.75rem;
}

.crustacean-recipe .recipe-step {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ========== FISH MARKET PANEL ========== */
.fish-market-group {
    border-bottom: 1px solid #eee;
    padding-bottom: 0.6rem;
    margin-bottom: 0.6rem;
}

body.dark-mode .fish-market-group {
    border-bottom: 1px solid #333;
}

.fish-market-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.fish-market-group h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #999;
    letter-spacing: 0.5px;
    margin-bottom: 0.4rem;
    font-weight: 600;
}

body.dark-mode .fish-market-group h3 {
    color: #777;
}

.fish-market-card {
    padding: 0.8rem 0;
    border-bottom: none;
    transition: opacity 0.2s;
}

.fish-market-card:hover {
    opacity: 0.85;
}

.fish-market-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
    color: inherit;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fish-market-stock {
    font-size: 0.8rem;
    font-weight: 500;
    min-width: 50px;
    text-align: right;
}

.fish-market-recipe {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.75rem;
}

.fish-market-recipe .recipe-step {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#flowers-sidebar::-webkit-scrollbar { width: 8px; }
#flowers-sidebar::-webkit-scrollbar-track { background: #f1f1f1; }
body.dark-mode #flowers-sidebar::-webkit-scrollbar-track { background: #2a2a2a; }
#flowers-sidebar::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }
body.dark-mode #flowers-sidebar::-webkit-scrollbar-thumb { background: #444; }
#flowers-sidebar::-webkit-scrollbar-thumb:hover { background: #999; }
body.dark-mode #flowers-sidebar::-webkit-scrollbar-thumb:hover { background: #555; }

.fav-star {
    font-size: 0.9rem;
    cursor: pointer;
    user-select: none;
    padding: 0 0.2rem;
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.2s;
    flex-shrink: 0;
}

.fav-star:hover {
    opacity: 1;
    transform: scale(1.2);
}

.category-title {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #666;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    padding: 0.5rem 0.3rem;
    border-bottom: 1px solid #e0e0e0;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s, color 0.3s, border-color 0.3s;
}

body.dark-mode .category-title {
    color: #aaa;
    border-bottom: 1px solid #3a3a3a;
}

.category-title:hover {
    background: #f0f0f0;
}

body.dark-mode .category-title:hover {
    background: #333;
}

.category-title:first-child {
    margin-top: 0;
}

.category-title input {
    margin-right: 0.5rem;
}

/* Collapsible lists for dynamic categories and Others */
.items.collapsed { display: none; }
.category-title { display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.category-title .caret { font-size: 12px; opacity: 0.8; cursor: pointer; }
.category-title .name { flex: 1; }
.category-title input { cursor: pointer; }

#chart {
    padding: 0;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background: #fafafa;
    transition: background 0.3s;
}

body.dark-mode #chart {
    background: #2a2a2a;
}

.chart-wrapper {
    width: 100%;
    max-width: 1400px;
    background: #fff;
    border-radius: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin: 0rem auto;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

body.dark-mode .chart-wrapper {
    background: #1e1e1e;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

#svg-container {
    width: 100%;
    padding: 0rem 0rem;
    box-sizing: border-box;
    flex-shrink: 0;
}

#svg-container svg {
    width: 100%;
    height: auto;
    display: block;
}

#legend {
    width: 100%;
    padding: 1rem 2rem 1.25rem 2rem;
    box-sizing: border-box;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    background: #fafafa;
}

body.dark-mode #legend {
    background: #252525;
    border-top: 1px solid #333;
}

#legend.hidden {
    display: none;
}

.legend-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: grid;
    grid-template-columns: 12px minmax(80px, 120px) repeat(4, minmax(90px, 1fr)) minmax(180px, 2fr);
    align-items: center;
    column-gap: 0.75rem;
    background: #f2f2f2;
    border-bottom: 1px solid #e5e5e5;
    padding: 0.35rem 0.5rem;
}

body.dark-mode .legend-header {
    background: #1f1f1f;
    border-bottom: 1px solid #333;
}

.legend-header .hcell {
    background: none;
    border: none;
    color: inherit;
    text-align: left;
    font-weight: 600;
    font-size: 0.72rem;
    padding: 0;
    cursor: pointer;
}

/* Aligner les colonnes numériques de l'en-tête à droite pour correspondre aux valeurs */
.legend-header > .hcell:nth-child(3),
.legend-header > .hcell:nth-child(4),
.legend-header > .hcell:nth-child(5),
.legend-header > .hcell:nth-child(6),
.legend-header > .hcell:nth-child(7) {
    text-align: right;
}

.legend-item {
    display: grid;
    grid-template-columns: 12px minmax(80px, 120px) repeat(4, minmax(90px, 1fr)) minmax(180px, 2fr);
    align-items: center;
    column-gap: 0.75rem;
    font-size: 0.78rem;
    padding: 0.3rem 0.5rem;
    background: #f9f9f9;
    border-radius: 0;
    transition: background 0.2s;
}

body.dark-mode .legend-item {
    background: #333;
}

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

body.dark-mode .legend-item:hover {
    background: #3a3a3a;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 0;
    margin: 0;
}

.legend-details { display: none; }

.legend-name {
    font-weight: 600;
    font-size: 0.8rem;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.legend-stats { display: none; }

.legend-stat {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    min-width: 0;
        justify-content: flex-end;
    }

    .legend-stat .stat-value {
        text-align: right;
        font-variant-numeric: tabular-nums;
    }

body.dark-mode .legend-stats {
    color: #999;
}

.stat-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.2rem;
}

.stat-label {
    color: #999;
    font-size: 0.6rem;
    margin-right: 0;
    transition: color 0.3s;
}

body.dark-mode .stat-label {
    color: #777;
}

.stat-value {
    font-weight: 600;
    color: #333;
    width: 100%;
    transition: color 0.3s;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.dark-mode .stat-value {
    color: #bbb;
}


svg { width: 100%; height: 100%; display: block; }

/* Tooltip */
.chart-tooltip {
    position: absolute;
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 12px;
    pointer-events: none;
    opacity: 0;
    transition: opacity .1s ease;
    z-index: 20;
}

/* Loader */
.loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.loader.hidden {
    display: none;
}

.loader-bar {
    width: 200px;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.loader-bar::after {
    content: '';
    display: block;
    width: 50%;
    height: 100%;
    background: #4caf50;
    border-radius: 2px;
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(300%); }
}

.loader-text {
    color: #666;
    font-size: 0.9rem;
}

/* Scrollbar */
#sidebar::-webkit-scrollbar { width: 8px; }
#sidebar::-webkit-scrollbar-track { background: #f1f1f1; }
body.dark-mode #sidebar::-webkit-scrollbar-track { background: #2a2a2a; }
#sidebar::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }
body.dark-mode #sidebar::-webkit-scrollbar-thumb { background: #444; }
#sidebar::-webkit-scrollbar-thumb:hover { background: #999; }
body.dark-mode #sidebar::-webkit-scrollbar-thumb:hover { background: #555; }

#chart::-webkit-scrollbar { width: 8px; }
#chart::-webkit-scrollbar-track { background: #e0e0e0; }
body.dark-mode #chart::-webkit-scrollbar-track { background: #1a1a1a; }
#chart::-webkit-scrollbar-thumb { background: #aaa; border-radius: 4px; }
body.dark-mode #chart::-webkit-scrollbar-thumb { background: #555; }
#chart::-webkit-scrollbar-thumb:hover { background: #888; }
body.dark-mode #chart::-webkit-scrollbar-thumb:hover { background: #666; }