* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-weight: 300;
    background: #F5F5F5;
    padding: 20px;
    color: #1A1A1A;
}
.container {
    max-width: 1200px;
    margin: 0 auto;
}
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #eee;
    flex-wrap: wrap;
    gap: 1rem;
}
.header > div {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.header-logo {
    height: 60px;
    width: auto;
    max-width: 400px;
    flex-shrink: 0;
}
h1 { margin: 0; color: #000000; font-weight: 900; }
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid #ddd;
    flex-wrap: nowrap;
    overflow: visible;
    align-items: flex-end;
    position: relative;
}
.tab {
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 0.9rem;
    color: #666;
    white-space: nowrap;
    flex-shrink: 0;
}
.tab.active {
    color: #E50950;
    border-bottom-color: #E50950;
}

/* Priority+ overflow menu */
.tabs-more {
    position: relative;
    margin-left: auto;
    flex-shrink: 0;
}
.tabs-more-btn {
    letter-spacing: 0.1em;
    font-size: 1rem;
    padding: 0.75rem 0.75rem;
    color: #666;
}
.tabs-more-btn:hover,
.tabs-more-btn.has-active {
    color: #E50950;
}
body.dark-mode .tabs-more-btn {
    color: #aaa;
}
.tabs-overflow-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 2px);
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    z-index: 200;
    min-width: 160px;
    padding: 0.25rem 0;
    flex-direction: column;
}
.tabs-overflow-dropdown.open {
    display: flex;
}
.tabs-overflow-dropdown .tab {
    border-bottom: none;
    border-left: 3px solid transparent;
    padding: 0.6rem 1rem;
    text-align: left;
    width: 100%;
    font-size: 0.875rem;
}
.tabs-overflow-dropdown .tab.active {
    border-left-color: #E50950;
    color: #E50950;
    background: rgba(229, 9, 80, 0.05);
}
body.dark-mode .tabs-overflow-dropdown {
    background: #2A2A2A;
    border-color: #444;
}
body.dark-mode .tabs-overflow-dropdown .tab {
    color: #ccc;
}
body.dark-mode .tabs-overflow-dropdown .tab.active {
    background: rgba(229, 9, 80, 0.1);
}
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        align-items: flex-start;
    }
    .header > div {
        width: 100%;
        justify-content: flex-end;
    }
    .header-logo {
        max-width: 100%;
        height: auto;
        max-height: 50px;
    }
    .tabs {
        gap: 0.25rem;
        margin-bottom: 1rem;
    }
    .tab {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
    .container {
        padding: 0 10px;
    }
    body {
        padding: 10px;
    }
}
@media (max-width: 480px) {
    .tab {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
    .header-logo {
        max-height: 40px;
    }
}
.section {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    overflow-x: auto;
}
@media (max-width: 768px) {
    .section {
        padding: 1rem;
    }
}
table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
    font-size: 0.82rem;
}
th, td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
}
td.wrap, th.wrap {
    white-space: normal;
    min-width: 140px;
}
@media (max-width: 1024px) {
    .priority-low { display: none; }
}
@media (max-width: 768px) {
    table { font-size: 0.78rem; }
    th, td {
        padding: 0.4rem 0.5rem;
    }
    .priority-medium { display: none; }
    .recent-processing-table th,
    .recent-processing-table td {
        font-size: 0.75rem;
    }
    /* Hide Photo ID column on small screens to save space */
    .recent-processing-table .recent-photo-id {
        display: none;
    }
}
th {
    font-weight: 500;
    background: #F5F5F5;
    color: #000000;
}
/* Sticky first column */
table td:first-child,
table th:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: #fff;
}
table th:first-child {
    background: #F5F5F5;
    z-index: 2;
}
body.dark-mode table td:first-child {
    background: #1e1e1e;
}
body.dark-mode table th:first-child {
    background: #2A2A2A;
}
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    margin-right: 0.5rem;
}
.btn-secondary { background: #1A1A1A; color: white; font-weight: 500; }
.btn-secondary:hover { background: #000000; }
.btn-danger { background: #f44336; color: white; font-weight: 500; }
.btn-danger:hover { background: #d32f2f; }
.btn-success { background: #4caf50; color: white; font-weight: 500; }
.btn-success:hover { background: #388e3c; }
.btn-primary { background: #E50950; color: white; font-weight: 500; }
.btn-primary:hover { background: #FF1A6B; }
.loading { text-align: center; padding: 2rem; }
.error { color: #f44336; padding: 1rem; }
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}
@media (max-width: 768px) {
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .section-header h2 {
        width: 100%;
    }
}
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}
.modal-content {
    background: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.close {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
}
.close:hover { color: #000; }
.form-group {
    margin-bottom: 1rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}
.form-group textarea {
    min-height: 100px;
    resize: vertical;
}
.form-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}
.draggable-list {
    list-style: none;
    padding: 0;
}
.draggable-item {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    cursor: move;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s;
}
.draggable-item:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.draggable-item.dragging {
    opacity: 0.5;
    background: #f0f0f0;
}
.drag-handle {
    cursor: grab;
    color: #999;
    font-size: 1.2rem;
    user-select: none;
}
.drag-handle:active {
    cursor: grabbing;
}
.draggable-item-content {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}
.draggable-item-actions {
    display: flex;
    gap: 0.5rem;
}

/* Dark Mode Styles */
body.dark-mode {
    background: #1A1A1A;
    color: #dddddd;
}
body.dark-mode .header {
    border-bottom-color: #333;
}
body.dark-mode .section {
    background: #2A2A2A;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
body.dark-mode .tabs {
    border-bottom-color: #333;
}
body.dark-mode .tab {
    color: #999;
}
body.dark-mode .tab.active {
    color: #E50950;
    border-bottom-color: #E50950;
}
body.dark-mode table th {
    background: #333;
    color: #dddddd;
}
body.dark-mode table td {
    border-bottom-color: #333;
    color: #dddddd;
}
body.dark-mode .draggable-item {
    background: #2A2A2A;
    border-color: #333;
}
body.dark-mode .draggable-item:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}
body.dark-mode .draggable-item.dragging {
    background: #333;
}
body.dark-mode .modal-content {
    background: #2A2A2A;
    color: #dddddd;
}
body.dark-mode .form-group label {
    color: #dddddd;
}
body.dark-mode .form-group input,
body.dark-mode .form-group textarea,
body.dark-mode .form-group select {
    background: #1A1A1A;
    border-color: #333;
    color: #dddddd;
}
body.dark-mode .close:hover {
    color: #dddddd;
}
body.dark-mode .drag-handle {
    color: #666;
}

/* Dashboard Styles */
.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
body.dark-mode .stat-card {
    background: #2A2A2A;
}
.stat-card-value {
    font-size: 2rem;
    font-weight: 900;
    color: #666666;
}
body.dark-mode .stat-card-value {
    color: #CCCCCC;
}
/* Special coloring for key metrics */
.stat-card-cost .stat-card-value {
    color: #ebc515;
}
body.dark-mode .stat-card-cost .stat-card-value {
    color: #ebc515;
}
.stat-card-success .stat-card-value {
    color: #4caf50; /* same as Processing Success Rate chart */
}
body.dark-mode .stat-card-success .stat-card-value {
    color: #66bb6a;
}
.stat-card-failed .stat-card-value {
    color: #f44336; /* same as Processing Success Rate chart */
}
body.dark-mode .stat-card-failed .stat-card-value {
    color: #ef5350;
}
.stat-card-label {
    font-size: 0.875rem;
    color: #666;
    font-weight: 500;
}
body.dark-mode .stat-card-label {
    color: #999;
}
.stat-card-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}
.stat-card-icon svg {
    width: 48px;
    height: 48px;
    display: inline-block;
    vertical-align: middle;
    color: #666;
}
.stat-card-cost .stat-card-icon svg {
    color: #ebc515;
}
.stat-card-success .stat-card-icon svg {
    color: #4caf50;
}
.stat-card-failed .stat-card-icon svg {
    color: #f44336;
}
body.dark-mode .stat-card-icon svg {
    color: #999;
}
body.dark-mode .stat-card-success .stat-card-icon svg {
    color: #66bb6a;
}
body.dark-mode .stat-card-failed .stat-card-icon svg {
    color: #ef5350;
}
body.dark-mode .stat-card-cost .stat-card-icon svg {
    color: #ebc515;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    .stat-card {
        padding: 1rem;
    }
    .stat-card-value {
        font-size: 1.4rem;
    }
    .stat-card-label {
        font-size: 0.8rem;
    }
}
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}
@media (max-width: 768px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}
.chart-container {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
    min-height: 350px;
    height: 400px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.chart-container canvas {
    flex: 1;
    min-height: 250px;
}
/* Special styling for doughnut/pie charts to maintain aspect ratio */
.chart-container-doughnut {
    display: flex;
    flex-direction: column;
}
.chart-doughnut-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    position: relative;
    width: 100%;
    min-height: 250px;
}
.chart-doughnut-wrapper canvas {
    width: 280px !important;
    height: 280px !important;
    max-width: 280px !important;
    max-height: 280px !important;
}
body.dark-mode .chart-container {
    background: #2A2A2A;
}
.chart-title {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 1rem;
    color: #1A1A1A;
}
body.dark-mode .chart-title {
    color: #dddddd;
}

/* Dark Mode Toggle Button */
.dark-mode-toggle {
    background: white;
    color: #1A1A1A;
    border: 1px solid #ddd;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    margin-right: 0.5rem;
    transition: all 0.2s;
    font-family: 'Poppins', sans-serif;
}
.dark-mode-toggle:hover {
    background: #f5f5f5;
}
body.dark-mode .dark-mode-toggle {
    background: #E50950;
    border-color: #E50950;
    color: white;
}
body.dark-mode .dark-mode-toggle:hover {
    background: #FF1A6B;
}

/* SVG Dark Mode - zamienia czarny (#000, #000000, black) na #dddddd */
body.dark-mode .header-logo path[fill="#000000"],
body.dark-mode .header-logo path[fill="#000"],
body.dark-mode .header-logo path[fill="black"] {
    fill: #dddddd !important;
}
body.dark-mode .header-logo path[stroke="#000000"],
body.dark-mode .header-logo path[stroke="#000"],
body.dark-mode .header-logo path[stroke="black"] {
    stroke: #dddddd !important;
}
body.dark-mode .header-logo g[fill="#000000"],
body.dark-mode .header-logo g[fill="#000"],
body.dark-mode .header-logo g[fill="black"] {
    fill: #dddddd !important;
}

/* SVG klasa .text - teksty logo "Photo Booth" */
/* Light mode: SVG icons keep their own colours */
/* W dark mode - zamiana na jasnoszary */
body.dark-mode .header-logo .text path {
    fill: #ccc !important;
}

/* Icon buttons: shared styles */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    font-family: 'Poppins', sans-serif;
    background: white;
    color: #1A1A1A;
}
.icon-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}
.icon-btn:hover {
    opacity: 0.8;
}

/* Icon-only buttons (no label) */
.icon-btn-only {
    padding: 0.5rem;
    min-width: 36px;
    min-height: 36px;
}

/* Header buttons: no background or border */
.header-btn {
    background: transparent !important;
    border: none !important;
    margin-right: 0.5rem;
}
.header-btn:hover {
    opacity: 0.7;
}

/* Dark Mode Toggle Button */
.dark-mode-toggle svg * {
    fill: #1A1A1A;
}
body.dark-mode .dark-mode-toggle svg * {
    fill: #ccc;
}

/* YAML group: migrate and save buttons */
.yaml-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    margin-right: 0.5rem;
    padding: 0.25rem 0.4rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.02);
    height: 36px; /* same height as the icons */
    box-sizing: border-box;
    gap: 0.4rem;
    position: relative;
}
body.dark-mode .yaml-group {
    border-color: #444;
    background: rgba(255, 255, 255, 0.02);
}
.yaml-group::before {
    content: ".yaml";
    font-size: 0.66rem;
    font-weight: 500;
    color: #666;
    line-height: 1;
    white-space: nowrap;
    transform: rotate(-90deg);
    transform-origin: center;
    position: absolute;
    left: -1rem;
    top: 60%;
    margin-top: 0;
    width: 1em;
    height: 1em;
}
body.dark-mode .yaml-group::before {
    color: #999;
}
.yaml-buttons {
    display: flex;
    gap: 0.2rem;
    align-items: center;
    justify-content: center;
}
.yaml-buttons .header-btn {
    margin-right: 0;
    padding: 0;
}
.yaml-buttons .icon-btn-only {
    min-width: 24px;
    min-height: 24px;
    padding: 0.25rem;
}
.yaml-buttons svg {
    width: 20px;
    height: 20px;
}

/* Migrate button (YAML): no background, like the other header buttons */
.btn-migrate svg * {
    fill: #1A1A1A;
}
body.dark-mode .btn-migrate svg * {
    fill: #ccc;
}

/* Export button (Save): no background, like the other header buttons */
.btn-export {
    background: transparent !important;
    border: none !important;
}
.btn-export svg * {
    fill: #1A1A1A;
}
body.dark-mode .btn-export svg * {
    fill: #ccc;
}

/* Logout Button */
.btn-logout svg * {
    fill: #1A1A1A;
}
body.dark-mode .btn-logout svg * {
    fill: #ccc;
}

/* Edit button: black in light mode, dark grey in dark mode */
.btn-edit {
    background: #1A1A1A !important;
    border-color: #1A1A1A !important;
    color: white !important;
}
.btn-edit svg * {
    fill: white;
}
body.dark-mode .btn-edit {
    background: #444 !important;
    border-color: #444 !important;
}
body.dark-mode .btn-edit svg * {
    fill: white;
}

/* Delete button: magenta background */
.btn-delete {
    background: #E50950 !important;
    border-color: #E50950 !important;
    color: white !important;
}
.btn-delete svg * {
    fill: white;
}
body.dark-mode .btn-delete {
    background: #E50950 !important;
    border-color: #E50950 !important;
}
body.dark-mode .btn-delete svg * {
    fill: white;
}

/* Add button with a plus icon: magenta background */
.btn-add {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #E50950 !important;
    border-color: #E50950 !important;
    color: white !important;
}
.btn-add svg {
    width: 16px;
    height: 16px;
}
.btn-add svg * {
    fill: white;
}
body.dark-mode .btn-add {
    background: #E50950 !important;
    border-color: #E50950 !important;
}
body.dark-mode .btn-add svg * {
    fill: white;
}
.btn-print {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #1976d2 !important;
    border-color: #1976d2 !important;
    color: white !important;
}
.btn-print svg {
    width: 24px !important;
    height: 24px !important;
}
.btn-reset-stats {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #E50950 !important;
    border-color: #E50950 !important;
    color: white !important;
}
.btn-reset-stats svg {
    width: 28px !important;
    height: 28px !important;
}
.btn-reset-stats svg * {
    fill: white;

}
body.dark-mode .btn-reset-stats {
    background: #E50950 !important;
    border-color: #E50950 !important;
}
body.dark-mode .btn-reset-stats svg * {
    fill: white;

}
.btn-print svg * {
    stroke: white;
}
body.dark-mode .btn-print {
    background: #1565c0 !important;
    border-color: #1565c0 !important;
}
body.dark-mode .btn-print svg * {
    stroke: white;
}
@media (max-width: 768px) {
    .btn-print,
    .btn-reset-stats {
        padding: 0.5rem;
    }
    .btn-print::after,
    .btn-reset-stats::after {
        content: '';
    }
    .btn-print span,
    .btn-reset-stats span {
        display: none;
    }
}

/* UI Section Headers */
.ui-section-header {
    transition: background-color 0.2s, color 0.2s;
}
/* Collapsed state - light gray background in light mode, dark gray in dark mode */
.ui-section-collapsed {
    background: #999 !important;
    color: #eee !important;
}
body.dark-mode .ui-section-collapsed {
    background: #666 !important;
    color: #ccc !important;
}
.ui-section-collapsed:hover {
    background: #aaa !important;
}
body.dark-mode .ui-section-collapsed:hover {
    background: #777 !important;
}
/* Expanded state - magenta background */
.ui-section-expanded {
    background: #E50950 !important;
    color: white !important;
}
.ui-section-expanded:hover {
    background: #FF1A6B !important;
}
body.dark-mode .ui-section-expanded {
    background: #E50950 !important;
    color: white !important;
}
body.dark-mode .ui-section-expanded:hover {
    background: #FF1A6B !important;
}

/* Sales Hub Toggle - Dark Mode */
body.dark-mode .sales-hub-toggle {
    background: #2A2A2A !important;
}
body.dark-mode .sales-hub-toggle strong {
    color: #dddddd;
}
body.dark-mode .sales-hub-description {
    color: #999 !important;
}
body.dark-mode .sales-hub-status {
    color: #dddddd;
}

/* Migration Status Styles */
#migration-status {
    margin-top: 1rem;
    padding: 1rem;
    background: #f5f5f5;
    border-radius: 4px;
    display: none;
}
body.dark-mode #migration-status {
    background: #2A2A2A;
    border: 1px solid #333;
    color: #dddddd;
}
.migration-status-text {
    color: #666;
}
body.dark-mode .migration-status-text {
    color: #999;
}
.migration-status-success {
    color: green;
}
body.dark-mode .migration-status-success {
    color: #4ade80;
}
.migration-status-error {
    color: red;
}
body.dark-mode .migration-status-error {
    color: #ff6b6b;
}
.migration-status-loading {
    color: #666;
}
body.dark-mode .migration-status-loading {
    color: #999;
}
#migration-status strong {
    color: #1A1A1A;
}
body.dark-mode #migration-status strong {
    color: #dddddd;
}
#migration-status ul {
    color: #666;
}
body.dark-mode #migration-status ul {
    color: #999;
}
#migration-status li {
    color: #666;
}
body.dark-mode #migration-status li {
    color: #999;
}

/* ===== Phase 3: Responsive, Navigation & UX Improvements ===== */

/* --- Sticky header & tabs --- */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #F5F5F5;
    padding-top: 0.5rem;
}
body.dark-mode .header {
    background: #1A1A1A;
}
.tabs {
    position: sticky;
    top: 90px;
    z-index: 99;
    background: #F5F5F5;
    padding-top: 0.5rem;
}
body.dark-mode .tabs {
    background: #1A1A1A;
}
.tab:hover {
    color: #E50950;
    background: rgba(229, 9, 80, 0.05);
    border-radius: 4px 4px 0 0;
}
body.dark-mode .tab:hover {
    background: rgba(229, 9, 80, 0.1);
}

/* --- Toast notifications --- */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}
.toast {
    padding: 0.75rem 1.25rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: white;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    pointer-events: auto;
    max-width: 400px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-family: 'Poppins', sans-serif;
}
.toast.show {
    opacity: 1;
    transform: translateX(0);
}
.toast-success { background: #4caf50; }
.toast-error { background: #f44336; }
.toast-warning { background: #ff9800; }
.toast-info { background: #2196f3; }

/* --- Confirm dialog overlay --- */
.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 11000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.confirm-box {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    font-family: 'Poppins', sans-serif;
}
body.dark-mode .confirm-box {
    background: #2A2A2A;
    color: #dddddd;
}
.confirm-box h3 {
    margin-bottom: 0.75rem;
    font-weight: 500;
}
.confirm-box p {
    margin-bottom: 1.5rem;
    color: #666;
    font-size: 0.9rem;
}
body.dark-mode .confirm-box p {
    color: #999;
}
.confirm-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* --- Table wrapper: horizontal scroll + gradient hint --- */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: none;
    /* gradient hint that more content is to the right */
    mask-image: linear-gradient(to right, black 92%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black 92%, transparent 100%);
    margin-bottom: 0.5rem;
}
/* Remove gradient when fully scrolled to the right (JS adds .scrolled-end) */
.table-wrapper.scrolled-end {
    mask-image: none;
    -webkit-mask-image: none;
}
@media (max-width: 768px) {
    .table-wrapper {
        margin: 0 -1rem;
        padding: 0 1rem;
    }
}

/* --- Mobile modal fullscreen --- */
@media (max-width: 600px) {
    .modal-content {
        margin: 0;
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        display: flex;
        flex-direction: column;
    }
    .modal-header {
        flex-shrink: 0;
        position: sticky;
        top: 0;
        background: white;
        z-index: 1;
        padding-bottom: 1rem;
        border-bottom: 1px solid #eee;
    }
    body.dark-mode .modal-header {
        background: #2A2A2A;
        border-bottom-color: #444;
    }
    #modal-body {
        flex: 1;
        overflow-y: auto;
    }
    .form-actions {
        position: sticky;
        bottom: 0;
        background: white;
        padding: 1rem 0;
        border-top: 1px solid #eee;
        margin-top: auto;
    }
    body.dark-mode .form-actions {
        background: #2A2A2A;
        border-top-color: #444;
    }
}

/* --- Responsive adjustments for small screens --- */
@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    .stat-card-value {
        font-size: 1.2rem;
    }
    .draggable-item {
        flex-direction: column;
        align-items: flex-start;
    }
    .draggable-item-content {
        grid-template-columns: 1fr;
        width: 100%;
    }
    .draggable-item-actions {
        width: 100%;
        justify-content: flex-end;
    }
    .form-actions {
        flex-direction: column;
    }
    .form-actions .btn {
        width: 100%;
        text-align: center;
    }
    .section-header {
        gap: 0.75rem;
    }
    .section-header .btn {
        width: 100%;
        text-align: center;
    }
}

/* --- Sticky tabs adjustments --- */
@media (max-width: 768px) {
    .header {
        top: 0;
        padding-bottom: 0.5rem;
    }
    .tabs {
        top: 70px;
        padding-bottom: 0;
    }
}
@media (max-width: 480px) {
    .tabs {
        top: 60px;
    }
}

/* --- Improved focus/contrast --- */
.btn:focus-visible,
.tab:focus-visible,
.icon-btn:focus-visible {
    outline: 2px solid #E50950;
    outline-offset: 2px;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: #E50950;
    outline: none;
    box-shadow: 0 0 0 3px rgba(229, 9, 80, 0.15);
}

/* --- AI Radar snippet (deprecations) --- */
.radar-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}
@media (max-width: 768px) {
    .radar-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
}
.radar-list {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.radar-card {
    background: white;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    transition: border-color 0.12s;
}
.radar-card.upcoming {
    border-left: 3px solid #f0a832;
}
.radar-card.shutdown {
    border-left: 3px solid #e8445a;
}
.radar-card-name {
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
}
.radar-card-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
    font-size: 0.875rem;
    color: #666;
}
.radar-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 500;
}
.radar-badge-image {
    background: #ede7f6;
    color: #5e35b1;
    border: 1px solid #b39ddb;
}
.radar-badge-upcoming {
    background: #fff8e1;
    color: #f0a832;
    border: 1px solid #ffcc02;
}
.radar-badge-shutdown {
    background: #ffebee;
    color: #e8445a;
    border: 1px solid #ef5350;
}
.radar-days {
    font-weight: 500;
}
.radar-days.urgent {
    color: #e8445a;
}
.radar-days.soon {
    color: #f0a832;
}
.radar-days.ok {
    color: #666;
}
.radar-days.past {
    color: #999;
}
.radar-timestamp {
    font-size: 0.75rem;
    color: #999;
    margin-top: 0.75rem;
    text-align: right;
}
body.dark-mode .radar-card {
    background: #2A2A2A;
    border-color: #333;
}
body.dark-mode .radar-card.upcoming {
    border-left-color: #f0a832;
}
body.dark-mode .radar-card.shutdown {
    border-left-color: #e8445a;
}
body.dark-mode .radar-card-name {
    color: #dddddd;
}
body.dark-mode .radar-card-meta {
    color: #999;
}
body.dark-mode .radar-badge-image {
    background: #2a1a4a;
    color: #b39ddb;
    border-color: #4a2a6a;
}
body.dark-mode .radar-badge-upcoming {
    background: #3a3008;
    color: #f0a832;
    border-color: #5a5010;
}
body.dark-mode .radar-badge-shutdown {
    background: #3a0d14;
    color: #e8445a;
    border-color: #5a1622;
}
body.dark-mode .radar-days.ok {
    color: #999;
}
body.dark-mode .radar-days.past {
    color: #666;
}
body.dark-mode .radar-timestamp {
    color: #666;
}
body.dark-mode #ai-radar-snippet h4 {
    color: #999;
}
.radar-details {
    margin-top: 0.75rem;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 0 0.5rem;
}
.radar-details summary {
    cursor: pointer;
    padding: 0.5rem 0;
    font-size: 0.9rem;
    color: #666;
    list-style: none;
}
.radar-details summary::-webkit-details-marker {
    display: none;
}
.radar-details summary::before {
    content: '▶ ';
    font-size: 0.7rem;
}
.radar-details[open] summary::before {
    content: '▼ ';
}
.radar-details-inner {
    padding: 0 0 0.75rem 0;
}
.radar-details-heading {
    margin: 0.5rem 0 0.25rem 0;
    font-size: 0.85rem;
    color: #666;
}
.radar-details-empty {
    color: #666;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}
body.dark-mode .radar-details {
    border-color: #333;
}
body.dark-mode .radar-details summary {
    color: #999;
}
body.dark-mode .radar-details-heading {
    color: #999;
}
body.dark-mode .radar-details-empty {
    color: #999;
}
/* AI models table: deprecation status row coloring (same as AI Radar badges) */
tr.radar-row-urgent td:first-child {
    border-left: 3px solid #e8445a;
}
tr.radar-row-upcoming td:first-child {
    border-left: 3px solid #f0a832;
}
tr.radar-row-shutdown td:first-child {
    border-left: 3px solid #e8445a;
}
body.dark-mode tr.radar-row-urgent td:first-child,
body.dark-mode tr.radar-row-shutdown td:first-child {
    border-left-color: #e8445a;
}
body.dark-mode tr.radar-row-upcoming td:first-child {
    border-left-color: #f0a832;
}
.stat-card-warning .stat-card-value {
    color: #f0a832;
}
body.dark-mode .stat-card-warning .stat-card-value {
    color: #f0a832;
}
.stat-card-info .stat-card-value {
    color: #1976d2;
}
body.dark-mode .stat-card-info .stat-card-value {
    color: #64b5f6;
}
/* ── from Gamescom admin.css: reference image manager, prompt context [DIFF#4][DIFF#5] ── */
}
/* --- Reference image manager (styles) --- */
.ref-manager {
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 0.75rem;
    background: #fafafa;
}
.ref-upload-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}
.ref-manager .ref-name-input,
.ref-manager .ref-label-input {
    width: auto;
    font-size: 0.9rem;
}
.ref-name-input {
    flex: 1;
    min-width: 220px;
}
.ref-upload-row input[type="file"] {
    width: auto;
    flex: 0 1 auto;
    font-size: 0.85rem;
    max-width: 280px;
}
.ref-upload-row input[type="file"]::file-selector-button {
    padding: 0.4rem 0.75rem;
    border: none;
    border-radius: 4px;
    background: #E50950;
    color: #fff;
    font-weight: 500;
    cursor: pointer;
    margin-right: 0.5rem;
}
.ref-upload-row input[type="file"]::file-selector-button:hover {
    background: #c40844;
}
.ref-list {
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.ref-list:empty {
    margin-top: 0;
}
.ref-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
}
.ref-thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
    background: #eee;
}
.ref-label-input {
    flex: 1;
    min-width: 140px;
}
.ref-item .btn {
    flex-shrink: 0;
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
}
.ref-hint {
    color: #666;
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85em;
}
body.dark-mode .ref-manager {
    background: #141414;
    border-color: #333;
}
body.dark-mode .ref-item {
    background: #1A1A1A;
    border-color: #333;
}
body.dark-mode .ref-hint {
    color: #999;
}

.prompt-policy {
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 0.75rem 1rem 0.75rem;
    background: #fafafa;
    margin-bottom: 2rem;
}
.prompt-policy > summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    list-style-position: outside;
}
.prompt-policy[open] > summary {
    margin-bottom: 0.75rem;
}
.prompt-policy-textarea {
    min-height: 7rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.85rem;
    line-height: 1.4;
}
.prompt-policy code {
    font-size: 0.85em;
    background: #eee;
    padding: 0.1em 0.35em;
    border-radius: 3px;
}
body.dark-mode .prompt-policy {
    background: #141414;
    border-color: #333;
}
body.dark-mode .prompt-policy code {
    background: #222;
}

/* ── AI Experience additions (H7) ── */
.aix-wordmark { height: auto; font-size: 1.8rem; font-weight: 900; letter-spacing: -0.02em; white-space: nowrap; }
.aix-wordmark span { color: #E50950; }
.aix-deployment { padding: 0.5rem; border: 1px solid #ddd; border-radius: 4px; font: inherit; background: #fff; max-width: 320px; }
body.dark-mode .aix-wordmark { color: #fff; }
body.dark-mode .aix-deployment { background: #2A2A2A; color: #ddd; border-color: #444; }
.aix-switch { display: inline-block; margin-right: 0.5rem; text-decoration: none; vertical-align: middle; }
a.btn { text-decoration: none; display: inline-block; }
