/* App theme tokens */
:root{
	--brand-primary: #0d6efd; /* Bootstrap primary as default */
	--brand-accent: #f6eddd;  /* Theme color */
	--device-oracle: #dc3545;
	--device-toshiba: #0d6efd;
    --uptime-violet: #6f42c1; /* Bootstrap purple */
}

/* Overrides/Utilities */
.badge-pos-oracle{ background: var(--device-oracle) !important; }
.badge-pos-toshiba{ background: var(--device-toshiba) !important; }

/* Uptime color utility to support violet stage */
.text-violet { color: var(--uptime-violet) !important; }
.bg-violet { background-color: var(--uptime-violet) !important; }

/* Alert Utilities - Persistent alerts */
.alert-persistent .btn-close,
.alert-dismissible-persistent .btn-close {
    display: none !important;
}

/* Optionale Klasse für Alerts, die dauerhaft angezeigt werden sollen */
.alert-permanent {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.alert-permanent .btn-close {
    display: none !important;
}

/* =====================================================================
   UI-Komponenten-Bibliothek (ui_* Helper + ui_data_table)
   ===================================================================== */

/* --- Empty State --- */
.ui-empty-state__icon {
    font-size: 2rem;
    line-height: 1;
    opacity: 0.55;
}

.ui-empty-state__title {
    font-size: 1rem;
}

/* --- Stat Card --- */
.ui-stat-card__value {
    font-variant-numeric: tabular-nums;
}

.ui-stat-card__icon {
    font-size: 1.1rem;
    opacity: 0.65;
}

/* --- Loading Overlay --- */
.ui-loading {
    position: relative;
    min-height: 4rem;
}

.ui-loading[aria-busy="true"]::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.6);
    z-index: 5;
    border-radius: inherit;
}

.ui-loading__spinner {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Skeleton Placeholders --- */
.ui-skeleton {
    display: block;
    background-color: #e9ecef;
    background-image: linear-gradient(
        90deg,
        rgba(233, 236, 239, 0) 0,
        rgba(255, 255, 255, 0.7) 50%,
        rgba(233, 236, 239, 0) 100%
    );
    background-size: 200% 100%;
    background-repeat: no-repeat;
    border-radius: 0.375rem;
    animation: ui-skeleton-shimmer 1.4s ease-in-out infinite;
}

.ui-skeleton--line {
    height: 0.85rem;
    margin-bottom: 0.55rem;
}

.ui-skeleton--short {
    width: 60%;
}

.ui-skeleton--card {
    height: 6rem;
}

.ui-skeleton--cell {
    height: 0.9rem;
    flex: 1 1 0;
}

.ui-skeleton-table__row {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

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

/* --- DataTable --- */
.ui-data-table__no-match td,
.ui-data-table__empty td {
    text-align: center;
}

/* --- Accessibility: sichtbarer Fokus + Reduced Motion --- */
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
.nav-link:focus-visible,
a:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .ui-skeleton {
        animation: none;
    }
}

/* --- Restaurant-Kommentare --- */
.restaurant-comment-composer {
    padding: 1rem;
    background: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.75rem;
}

.restaurant-comment-thread {
    display: grid;
    gap: 0.85rem;
}

.restaurant-comment-message {
    position: relative;
    padding: 1rem;
    margin-right: clamp(0rem, 4vw, 3rem);
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-left: 4px solid var(--bs-secondary-border-subtle);
    border-radius: 0.75rem;
    box-shadow: 0 0.125rem 0.35rem rgba(0, 0, 0, 0.06);
}

.restaurant-comment-message.is-important {
    background: var(--bs-warning-bg-subtle);
    border-color: var(--bs-warning-border-subtle);
    border-left-color: var(--bs-warning);
}

.restaurant-comment-message.is-hidden {
    opacity: 0.72;
    border-style: dashed;
}

.restaurant-comment-avatar {
    display: inline-flex;
    width: 2.25rem;
    height: 2.25rem;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    color: var(--bs-primary);
    background: var(--bs-primary-bg-subtle);
    border-radius: 50%;
}

.restaurant-comment-body {
    overflow-wrap: anywhere;
    white-space: normal;
}

.restaurant-comment-tag,
.restaurant-comment-tag-option {
    --comment-tag-color: #6c757d;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.55rem;
    color: #fff;
    background: var(--comment-tag-color);
    border: 1px solid var(--comment-tag-color);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.35;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
}

.restaurant-comment-tag-option {
    cursor: pointer;
}

.restaurant-comment-tag-option .form-check-input {
    margin: 0;
}

.restaurant-comment-tag-option:has(.form-check-input:checked) {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--comment-tag-color) 35%, transparent);
}

.restaurant-comment-actions form {
    margin: 0;
}

@media (max-width: 767.98px) {
    .restaurant-comment-message {
        margin-right: 0;
    }
}

/* --- Restaurant-Dokumente --- */
.restaurant-document-composer {
    padding: 1rem;
    background: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.75rem;
}

.restaurant-document-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.6rem;
}

.restaurant-document-item {
    position: relative;
    min-width: 0;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.625rem;
    box-shadow: 0 0.125rem 0.35rem rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.restaurant-document-item:hover {
    border-color: var(--bs-primary);
    box-shadow: 0 0.25rem 0.75rem rgba(13, 110, 253, 0.14);
    transform: translateY(-1px);
}

.restaurant-document-tile-link {
    display: flex;
    min-height: 100%;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.65rem;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.restaurant-document-tile-link:focus-visible {
    outline: 3px solid rgba(13, 110, 253, 0.35);
    outline-offset: -3px;
}

.restaurant-document-item.is-managing .restaurant-document-tile-link {
    padding-top: 2.75rem;
}

.restaurant-document-card-header {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    min-width: 0;
}

.restaurant-document-icon {
    display: inline-flex;
    width: 2rem;
    height: 2rem;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    color: var(--bs-primary);
    background: var(--bs-primary-bg-subtle);
    border-radius: 0.5rem;
    font-size: 1rem;
}

.restaurant-document-content {
    min-width: 0;
    flex: 1 1 auto;
}

.restaurant-document-title {
    margin: 0;
    font-size: 1rem;
    overflow-wrap: anywhere;
}

.restaurant-document-filename {
    overflow-wrap: anywhere;
}

.restaurant-document-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
    line-height: 1.3;
}

.restaurant-document-tag,
.restaurant-document-tag-option {
    --document-tag-color: #6c757d;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.55rem;
    color: #fff;
    background: var(--document-tag-color);
    border: 1px solid var(--document-tag-color);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.35;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
}

.restaurant-document-tag-option {
    cursor: pointer;
}

.restaurant-document-tag-option .form-check-input {
    margin: 0;
}

.restaurant-document-tag-option:has(.form-check-input:checked) {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--document-tag-color) 35%, transparent);
}

.restaurant-document-edit-action,
.restaurant-document-delete-action button {
    position: absolute;
    top: 0.55rem;
    z-index: 2;
    display: inline-flex;
    width: 2rem;
    height: 2rem;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 0.5rem;
    line-height: 1;
}

.restaurant-document-edit-action {
    left: 0.55rem;
    color: #664d03;
    background: #ffc107;
    border: 1px solid #ffca2c;
    text-decoration: none;
}

.restaurant-document-delete-action {
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    z-index: 2;
}

.restaurant-document-delete-action form {
    margin: 0;
}

.restaurant-document-delete-action button {
    position: static;
    color: #fff;
    background: #dc3545;
    border: 1px solid #dc3545;
}

.restaurant-document-edit-action:hover,
.restaurant-document-edit-action:focus-visible {
    color: #332701;
    background: #ffca2c;
}

.restaurant-document-delete-action button:hover,
.restaurant-document-delete-action button:focus-visible {
    background: #bb2d3b;
    border-color: #b02a37;
}

@media (max-width: 991.98px) {
    .restaurant-document-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .restaurant-document-list {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Meraki-Netzwerk auf der Restaurant-Geräteseite */
.meraki-stat {
    height: 100%;
    padding: 0.75rem 0.9rem;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    background: #f8f9fa;
}

.meraki-stat-value {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0.15rem 0 0.35rem;
}

.meraki-network,
.meraki-switch,
.meraki-port-grid {
    min-width: 0;
    max-width: 100%;
}

.meraki-network {
    overflow-x: clip;
}

.meraki-switch {
    overflow: hidden;
}

.meraki-port-grid {
    display: flex;
    gap: 4px;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    padding: 2px 2px 8px;
}

.meraki-port-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    width: 30px;
    flex: 0 0 30px;
}

.meraki-port-label {
    min-height: 12px;
    font-size: 9px;
    line-height: 12px;
    color: #6c757d;
}

.meraki-port {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 22px;
    padding: 0;
    border-radius: 3px;
    border: 1px solid transparent;
}

.meraki-port--empty {
    background: transparent;
    border-color: transparent;
}

.meraki-port--connected {
    background: #6ec52a;
    border-color: #3f8f12;
    color: #fff;
}

.meraki-port--reduced {
    background-color: #6ec52a;
    background-image: repeating-linear-gradient(
        -45deg,
        rgba(255, 255, 255, 0.72) 0 3px,
        transparent 3px 7px
    );
    border-color: #3f8f12;
    color: #1f4d08;
}

.meraki-port--disconnected {
    background: #4b5563;
    border-color: #374151;
    color: #fff;
}

.meraki-port--disabled {
    background: #d1d5db;
    border-color: #9ca3af;
    color: #4b5563;
}

.meraki-port:hover,
.meraki-port:focus-visible {
    outline: 2px solid #0d6efd;
    outline-offset: 1px;
}

.meraki-port-uplink {
    font-size: 0.72rem;
    line-height: 1;
}

.meraki-switch-meta {
    min-width: 0;
}

.meraki-switch-serial {
    word-break: break-all;
}

.meraki-port-pending {
    padding: 0.35rem 0;
}

.meraki-port-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    margin-top: 0.35rem;
    color: #6c757d;
    font-size: 0.78rem;
}

.meraki-port-legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.meraki-swatch {
    display: inline-block;
    width: 14px;
    height: 12px;
    border-radius: 2px;
    border: 1px solid transparent;
}

.meraki-port-tooltip .tooltip-inner {
    text-align: left;
    max-width: 360px;
}

.meraki-appliance-icons {
    white-space: nowrap;
}

