/* TipTorro Dashboard - Styles */

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

:root {
    --bg-primary: #000000;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-muted: #858585;
    --tiptorro-green: #269947;
    --tiptorro-green-hover: #1e7a38;
    --tiptorro-green-light: #32b857;
    --accent-blue: #269947;
    --accent-blue-hover: #1e7a38;
    --status-online: #269947;
    --status-offline: #f44336;
    --status-warning: #ff9800;
    --border-color: #2a2a2a;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Custom Scrollbar - Tiptorro Style */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--tiptorro-green);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--tiptorro-green-hover);
}

.container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 12px;
}

/* Header */
.header {
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--tiptorro-green);
    padding: 8px 0;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(38, 153, 71, 0.2);
}

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

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

.header .logo {
    height: 50px;
    width: auto;
    filter: drop-shadow(0 0 6px rgba(38, 153, 71, 0.3));
}

.header h1 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    letter-spacing: 0.5px;
}

.header .version {
    background: var(--tiptorro-green);
    color: #000;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 10px;
}

/* Navigation */
.main-nav {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0;
    margin-bottom: 20px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0;
    margin: 0;
    padding: 0;
}

.nav-link {
    display: block;
    padding: 8px 16px;
    color: var(--text-secondary);
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    font-weight: 500;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.nav-link.active {
    color: var(--tiptorro-green);
    border-bottom-color: var(--tiptorro-green);
    background: var(--bg-tertiary);
}

/* Section Visibility */
.section-content {
    display: block;
}

.section-content.hidden {
    display: none;
}

/* Statistiken */
.stats-section {
    margin-bottom: 15px;
}

/* Einheitliche Überschriften für alle Reiter */
.stats-section h2,
.bulk-section h2,
.section-header h2,
.alerts-section h2,
.dmh-update-section h2,
.maintenance-section h2,
.shops-section h2 {
    font-size: 16px;
    margin-bottom: 10px;
    font-weight: 600;
}

/* Einheitliche h3 Überschriften */
.dmh-update-section h3,
.maintenance-section h3,
.shops-section h3,
.bulk-section h3,
.stats-section h3 {
    font-size: 14px;
    margin-bottom: 8px;
    font-weight: 600;
}

/* Einheitliche h4 Überschriften */
.shop-terminals h4,
.dmh-update-section h4,
.maintenance-section h4,
.shops-section h4 {
    font-size: 13px;
    margin-bottom: 8px;
    font-weight: 600;
}

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

.stat-card {
    background: var(--bg-secondary);
    padding: 8px;
    border-radius: 6px;
    text-align: center;
    border: 2px solid var(--border-color);
    transition: transform 0.15s, box-shadow 0.15s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.stat-card.stat-online { border-color: var(--status-online); }
.stat-card.stat-offline { border-color: var(--status-offline); }
.stat-card.stat-warnings { border-color: var(--status-warning); }
.stat-card.stat-total { border-color: var(--accent-blue); }

.stat-icon {
    font-size: 18px;
    margin-bottom: 3px;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 2px;
}

.stat-label {
    font-size: 9px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Bulk Operations */
.bulk-section {
    margin-bottom: 15px;
}

.bulk-section h2 {
    font-size: 16px;
    margin-bottom: 10px;
}

.bulk-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}

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

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--accent-blue);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-blue-hover);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: white;
}

.btn-secondary:hover {
    background: #4e4e52;
}

.btn-warning {
    background: var(--status-warning);
    color: white;
}

.btn-warning:hover {
    background: #e68900;
}

.btn-success {
    background: var(--tiptorro-green);
    color: #000;
    font-weight: 700;
}

.btn-success:hover {
    background: var(--tiptorro-green-hover);
}

.btn-danger {
    background: var(--status-offline);
    color: white;
}

.btn-danger:hover {
    background: #d32f2f;
}

.btn-info {
    background: #2196F3;
    color: white;
}

.btn-info:hover {
    background: #1976D2;
}

.btn-small {
    padding: 5px 10px;
    font-size: 10px;
}

.btn-tiny {
    padding: 4px 8px;
    font-size: 9px;
}

.btn-fix {
    background: var(--status-warning);
    padding: 5px 10px;
    font-size: 10px;
}

/* Terminals Section */
.terminals-section {
    margin-bottom: 15px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.section-header h2 {
    font-size: 16px;
}

.terminals-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.terminal-card {
    background: var(--bg-secondary);
    padding: 8px;
    border-radius: 5px;
    border-left: 3px solid var(--tiptorro-green);
    transition: transform 0.15s, box-shadow 0.15s;
    border: 1px solid var(--border-color);
}

.terminal-card:hover {
    transform: translateX(2px);
    box-shadow: -2px 0 10px rgba(38, 153, 71, 0.2);
}

.terminal-card.offline {
    border-left-color: var(--status-offline);
    opacity: 0.6;
}

.terminal-card.warning {
    border-left-color: var(--status-warning);
    box-shadow: 0 0 8px rgba(255, 152, 0, 0.1);
}

.terminal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.terminal-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--tiptorro-green-light);
}

.device-type-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 500;
    padding: 1px 5px;
    border-radius: 4px;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.06);
    margin-left: 6px;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.terminal-status {
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 6px;
    background: var(--bg-tertiary);
    font-weight: 600;
}

.terminal-status.online {
    background: var(--tiptorro-green);
    color: #000;
    font-weight: 700;
}

.terminal-status.offline {
    background: var(--status-offline);
    color: white;
    font-weight: 700;
}

.terminal-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(75px, 1fr));
    gap: 4px;
    margin-bottom: 6px;
}

.metric {
    background: rgba(255, 255, 255, 0.03);
    padding: 4px 5px;
    border-radius: 3px;
    font-size: 9px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.metric-label {
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    margin-bottom: 2px;
    letter-spacing: 0.3px;
    font-weight: 600;
}

.metric-value {
    font-size: 11px;
    font-weight: 700;
}

.metric.error .metric-value {
    color: var(--status-offline);
}

.metric.warning .metric-value {
    color: var(--status-warning);
}

.metric.success .metric-value {
    color: var(--tiptorro-green);
}

.terminal-actions {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 6px;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 16px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    overflow: auto;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 12px;
    max-width: 900px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    border: 2px solid var(--tiptorro-green);
    box-shadow: 0 0 30px rgba(38, 153, 71, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 2px solid var(--tiptorro-green);
    background: rgba(38, 153, 71, 0.05);
}

.modal-header h2 {
    font-size: 20px;
    color: var(--tiptorro-green-light);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 32px;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    line-height: 32px;
}

.modal-close:hover {
    color: var(--status-offline);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
}

.logs-modal-content {
    max-width: 1200px;
    width: 95%;
}

.logs-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
}

.logs-filters {
    display: flex;
    gap: 6px;
}

.log-filter-btn {
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    cursor: pointer;
    font-size: 10px;
    font-weight: 600;
    transition: all 0.15s;
}

.log-filter-btn:hover {
    background: rgba(38, 153, 71, 0.1);
    border-color: var(--tiptorro-green);
}

.log-filter-btn.active {
    background: var(--tiptorro-green);
    color: #000;
    border-color: var(--tiptorro-green);
}

.auto-scroll-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-secondary);
    cursor: pointer;
}

.auto-scroll-toggle input[type="checkbox"] {
    cursor: pointer;
}

.logs-content {
    background: var(--bg-primary);
    padding: 12px;
    border-radius: 6px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 11px;
    line-height: 1.6;
    max-height: 65vh;
    overflow-y: auto;
}

.log-entry {
    margin-bottom: 2px;
    padding: 6px 8px;
    border-radius: 3px;
    display: flex;
    gap: 8px;
    align-items: flex-start;
    transition: background 0.15s;
}

.log-entry:hover {
    background: rgba(255, 255, 255, 0.03);
}

.log-entry.hidden {
    display: none;
}

.log-entry.log-grouped {
    padding-left: 20px;
    margin-left: 10px;
    border-left: 2px solid rgba(255, 255, 255, 0.1);
}

.log-entry.INFO {
    color: var(--text-secondary);
}

.log-entry.WARN {
    color: var(--status-warning);
    background: rgba(255, 152, 0, 0.08);
}

.log-entry.ERROR {
    color: var(--status-offline);
    background: rgba(244, 67, 54, 0.1);
}

.log-group {
    margin-bottom: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.02);
    overflow: hidden;
}

.log-group-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(38, 153, 71, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: 600;
    font-size: 12px;
}

.log-group-icon {
    font-size: 14px;
}

.log-group-title {
    flex: 1;
    color: var(--tiptorro-green-light);
}

.log-group-time {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: normal;
}

.log-group-content {
    padding: 4px 0;
}

.log-timestamp {
    color: var(--text-muted);
    font-size: 10px;
    min-width: 140px;
    font-family: 'Consolas', 'Courier New', monospace;
}

.log-timestamp-indent {
    min-width: 140px;
    display: inline-block;
}

.log-icon {
    font-size: 12px;
    min-width: 20px;
    text-align: center;
}

.log-level {
    font-weight: 700;
    min-width: 50px;
    font-size: 10px;
    text-transform: uppercase;
}

.log-component {
    color: var(--tiptorro-green-light);
    font-size: 10px;
    min-width: 80px;
}

.log-message {
    flex: 1;
    word-break: break-word;
    line-height: 1.5;
}

.log-highlight {
    color: var(--tiptorro-green-light);
    font-weight: 600;
}

.log-path {
    color: #4fc3f7;
    font-family: 'Consolas', 'Courier New', monospace;
}

.log-size {
    color: #ffb74d;
    font-weight: 600;
}

.log-version {
    color: #81c784;
    font-weight: 600;
}

/* Metrics Modal */
.metrics-modal-content {
    max-width: 1400px;
    width: 95%;
}

.metrics-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
}

.time-range-buttons {
    display: flex;
    gap: 6px;
}

.time-range-btn {
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.15s;
}

.time-range-btn:hover {
    background: rgba(38, 153, 71, 0.1);
    border-color: var(--tiptorro-green);
}

.time-range-btn.active {
    background: var(--tiptorro-green);
    color: #000;
    border-color: var(--tiptorro-green);
}

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

.charts-container canvas {
    max-height: 300px;
}

/* Alerts Section */
.alerts-section {
    margin-bottom: 20px;
    background: var(--bg-secondary);
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid var(--status-warning);
}

.alerts-section h2 {
    font-size: 16px;
    margin-bottom: 12px;
    color: var(--status-warning);
}

.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.alert-item {
    background: rgba(255, 152, 0, 0.1);
    padding: 10px;
    border-radius: 5px;
    border-left: 3px solid var(--status-warning);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.alert-item.critical {
    background: rgba(244, 67, 54, 0.1);
    border-left-color: var(--status-offline);
}

.alert-content {
    flex: 1;
}

.alert-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
    font-size: 12px;
}

.alert-severity {
    font-size: 16px;
}

.alert-terminal {
    font-weight: 700;
    color: var(--tiptorro-green-light);
}

.alert-location {
    color: var(--text-muted);
    font-size: 11px;
}

.alert-time {
    color: var(--text-muted);
    font-size: 10px;
    margin-left: auto;
}

.alert-message {
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.alert-rule {
    font-size: 11px;
    color: var(--text-muted);
}

/* Maintenance Section */
.maintenance-section {
    margin-bottom: 20px;
}

.maintenance-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.maintenance-item {
    background: var(--bg-secondary);
    padding: 12px;
    border-radius: 6px;
    border-left: 3px solid var(--tiptorro-green);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.maintenance-content {
    flex: 1;
}

.maintenance-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.maintenance-name {
    font-weight: 700;
    font-size: 14px;
    color: var(--tiptorro-green-light);
}

.maintenance-status {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.maintenance-status.active {
    background: rgba(255, 152, 0, 0.2);
    color: var(--status-warning);
}

.maintenance-status.scheduled {
    background: rgba(33, 150, 243, 0.2);
    color: #2196F3;
}

.maintenance-status.completed {
    background: rgba(38, 153, 71, 0.2);
    color: var(--tiptorro-green);
}

.maintenance-description {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.maintenance-details {
    display: flex;
    gap: 15px;
    font-size: 11px;
    color: var(--text-muted);
}

/* Form Styles */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group input[type="text"],
.form-group input[type="datetime-local"],
.form-group textarea {
    width: 100%;
    padding: 8px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 13px;
}

.form-group input[type="checkbox"] {
    margin-right: 6px;
}

.terminal-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    background: var(--bg-primary);
    border-radius: 4px;
}

.terminal-checkbox {
    display: flex;
    align-items: center;
    font-size: 12px;
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Terminal in Wartung */
.terminal-card.maintenance {
    border-left-color: var(--status-warning);
    opacity: 0.7;
    background: rgba(255, 152, 0, 0.05);
}

.log-entry.ERROR {
    color: var(--status-offline);
    background: rgba(244, 67, 54, 0.1);
}

.log-timestamp {
    color: var(--text-muted);
    margin-right: 10px;
}

.log-level {
    font-weight: bold;
    margin-right: 10px;
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    border-top: 2px solid var(--border-color);
    padding: 20px 0;
    margin-top: 40px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* Responsive */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .bulk-actions {
        flex-direction: column;
    }
    
    .terminal-metrics {
        grid-template-columns: 1fr;
    }
}

/* Location Filters */
.location-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: 8px;
}

/* DMH Shop Select Dropdown */
.dmh-shop-select-wrapper {
    position: relative;
    margin-bottom: 10px;
}

.dmh-shop-select {
    position: relative;
    width: 100%;
}

.dmh-shop-search {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 13px;
    transition: border-color 0.15s;
}

.dmh-shop-search:focus {
    outline: none;
    border-color: var(--tiptorro-green);
    box-shadow: 0 0 0 2px rgba(38, 153, 71, 0.2);
}

.dmh-shop-search::placeholder {
    color: var(--text-muted);
}

.dmh-shop-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 300px;
    overflow-y: auto;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 4px 4px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    margin-top: -1px;
    display: none;
}

.dmh-shop-dropdown.active {
    display: block;
}

.dmh-shop-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dmh-shop-option:last-child {
    border-bottom: none;
}

.dmh-shop-option:hover {
    background: var(--bg-tertiary);
}

.dmh-shop-option-name {
    flex: 1;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
}

.dmh-shop-option-id {
    color: var(--tiptorro-green-light);
    font-size: 11px;
    font-weight: 600;
}

.dmh-shop-option-count {
    color: var(--text-muted);
    font-size: 11px;
    margin-left: auto;
}

.dmh-selected-shop {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--tiptorro-green);
    border-radius: 4px;
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-primary);
}

.filter-btn {
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}

.filter-btn:hover {
    background: rgba(38, 153, 71, 0.1);
    border-color: var(--tiptorro-green);
    color: var(--tiptorro-green-light);
}

.filter-btn.active {
    background: var(--tiptorro-green);
    color: #000;
    border-color: var(--tiptorro-green);
    font-weight: 700;
    box-shadow: 0 0 15px rgba(38, 153, 71, 0.3);
}

/* Shop-Verwaltung */
.shops-section {
    margin-bottom: 20px;
}

.shops-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.shop-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.shop-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.shop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

.shop-header:hover {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
    padding: 10px;
    margin: -10px -10px 5px -10px;
}

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

.shop-toggle-icon {
    font-size: 14px;
    transition: transform 0.2s;
    user-select: none;
}

.shop-title h3 {
    margin: 0 0 5px 0;
    color: var(--text-primary);
    font-size: 16px;
}

.shop-id {
    color: var(--text-muted);
    font-size: 12px;
}

.shop-actions {
    display: flex;
    gap: 10px;
}

.shop-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    color: var(--text-secondary);
    font-size: 14px;
}

.shop-terminals {
    margin-top: 15px;
}

.shop-content {
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
    max-height: 0;
    opacity: 0;
}

.shop-content-expanded {
    max-height: 10000px;
    opacity: 1;
}

.shop-terminals h4 {
    margin-bottom: 10px;
    color: var(--text-primary);
    font-size: 16px;
}

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

.terminal-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    margin-bottom: 8px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    border-left: 3px solid var(--border-color);
}

.terminal-item.online {
    border-left-color: var(--status-online);
}

.terminal-item.offline {
    border-left-color: var(--status-offline);
}

.terminal-item-actions {
    display: flex;
    gap: 10px;
}

.btn-link {
    background: none;
    border: none;
    color: var(--tiptorro-green);
    cursor: pointer;
    text-decoration: underline;
    font-size: 12px;
    padding: 0;
}

.btn-link:hover {
    color: var(--tiptorro-green-hover);
}

/* Unassigned Section in Shops */
.shop-card.unassigned-section {
    border-left: 3px solid var(--status-warning);
    margin-top: 20px;
}

.shop-card.unassigned-section .shop-title h3 {
    color: var(--status-warning);
}

/* Terminal-Karten in Shops */
.shop-terminals .terminals-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.shop-terminals .terminal-card {
    margin: 0;
}

/* =============================================================================
   GRUPPEN-VERWALTUNG (Phase 21B)
   ============================================================================= */

.groups-section {
    margin-bottom: 20px;
}

.groups-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Gruppen-Karte */
.group-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--tiptorro-green);
    border-radius: 8px;
    padding: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.group-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.group-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.group-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.group-icon {
    font-size: 18px;
}

.group-card-title h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 16px;
}

.group-card-actions {
    display: flex;
    gap: 10px;
}

.group-description {
    color: var(--text-muted);
    font-size: 13px;
    margin: 6px 0 10px 0;
}

.group-card-stats {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.group-region-badge {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.group-shops-list {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.group-shop-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.group-shop-item .shop-id {
    font-size: 11px;
    color: var(--text-muted);
}

/* shop-group-section / group-select-inline CSS entfernt (Phase 26: Shop-primäres Modell) */

/* =============================================================================
   NAVIGATION & LANGUAGE (Phase 21C)
   ============================================================================= */

/* Alert-Zähler Badge im Nav-Tab */
.nav-alert-badge {
    display: inline-block;
    background: var(--status-critical, #dc3545);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 10px;
    padding: 1px 6px;
    margin-left: 4px;
    vertical-align: middle;
    line-height: 1.4;
    min-width: 16px;
    text-align: center;
}

/* Alerts-Nav-Section (dedizierte Section für den Alerts-Tab) */
.alerts-nav-section {
    margin-bottom: 20px;
}

.alerts-nav-section .section-header {
    margin-bottom: 20px;
}

/* Phase 22: Struktur-Header mit zwei Aktions-Buttons */
.structure-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* =============================================================================
   GERÄTE-FILTERANSICHT (Phase 21D)
   ============================================================================= */

.devices-section {
    margin-bottom: 20px;
}

/* Count-Label neben dem Sektions-Titel */
.devices-count-label {
    font-size: 13px;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 3px 12px;
    font-weight: 600;
    align-self: center;
}

/* Filter-Bar */
.devices-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 20px;
}

.devices-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 140px;
}

.devices-filter-group label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.devices-filter-group select {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 13px;
    cursor: pointer;
    min-width: 140px;
}

.devices-filter-group select:focus {
    outline: none;
    border-color: var(--tiptorro-green);
}

/* Geräte-Grid: responsive Spalten, nutzt bestehende terminal-card Styles */
.devices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

/* Empty State */
.devices-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}

.devices-empty-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.devices-empty-state p {
    margin-bottom: 16px;
    font-size: 15px;
}

/* Phase 23: Verwaltungs-Sub-Sections */
.admin-section {
    padding: 0;
}

.admin-subsection {
    background: var(--card-bg, #1e1e2e);
    border: 1px solid var(--border-color, #2a2a3e);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.admin-subsection-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color, #2a2a3e);
}

.admin-subsection-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary, #e0e0e0);
}

.admin-subsection h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary, #a0a0b0);
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
