/* Admin Printers - Subtabs */
.admin-subtabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.subtab-btn {
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--secondary-color);
    transition: color 0.2s, border-bottom-color 0.2s;
}

@media (hover: hover) {
.subtab-btn:hover {
    color: var(--primary-color);
}
}

.subtab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.admin-subpanel {
    /* Content determines height */
}

.admin-info {
    padding: 1rem;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.admin-info p {
    margin: 0;
    color: #0369a1;
}

/* Settings cards */
.settings-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
}
.settings-card h4 {
    margin: 0;
    padding: 0.875rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
}
.settings-card-body {
    padding: 1.25rem;
}
.settings-card .form-group {
    padding: 0;
    margin-bottom: 0.875rem;
}
.settings-card .form-group:last-child {
    margin-bottom: 0;
}
.settings-card .form-actions {
    padding: 0.875rem 1.25rem;
    margin-top: 0;
}
.settings-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.875rem;
}
.settings-toggles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.375rem 1.5rem;
}
.settings-toggles label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0;
    cursor: pointer;
    font-weight: normal;
    font-size: 0.9375rem;
}
.settings-toggles label input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    margin: 0;
    accent-color: var(--primary-color);
}
.settings-saved {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--success-color);
    opacity: 0;
    transition: opacity 0.3s ease;
    margin-left: 0.5rem;
}
.settings-saved.visible {
    opacity: 1;
}
.settings-sub {
    font-size: 0.8125rem;
    color: var(--secondary-color);
    margin-top: 0.25rem;
}
.settings-size-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.875rem;
}
.settings-size-grid > div > label {
    display: block;
    font-size: 0.8125rem;
    font-weight: normal;
    color: var(--secondary-color);
    margin-bottom: 0.25rem;
}
.settings-size-grid > div > select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.875rem;
}
.size-inputs {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.size-inputs select {
    width: 60px;
}

/* Print Queue Cards */

.queue-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.queue-card {
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
}

.queue-card.pending {
    background: #fef3c7;
    border: 1px solid #fcd34d;
}

.queue-card.printing {
    background: #dbeafe;
    border: 1px solid #93c5fd;
}

.queue-card.completed {
    background: #d1fae5;
    border: 1px solid #6ee7b7;
}

.queue-card.failed {
    background: #fee2e2;
    border: 1px solid #fca5a5;
}

.queue-count {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.queue-label {
    font-size: 0.875rem;
    color: var(--secondary-color);
    font-weight: 500;
}

.queue-warning {
    padding: 1rem;
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: 4px;
    color: #dc2626;
}

/* Queue filters */
.queue-filters {
    margin-top: 12px;
    display: flex;
    gap: 16px;
    align-items: center;
}

/* Queue table */
.queue-row-clickable {
    cursor: pointer;
}

@media (hover: hover) {
.queue-row-clickable:hover {
    background: var(--hover-color, #f3f4f6);
}
}

.queue-type-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.queue-type-badge.kitchen {
    background: #fef3c7;
    color: #92400e;
}

.queue-type-badge.receipt {
    background: #dbeafe;
    color: #1e40af;
}

.queue-type-badge.invoice {
    background: #ede9fe;
    color: #5b21b6;
}

.queue-status-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.queue-status-badge.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.queue-status-badge.status-printing {
    background: #dbeafe;
    color: #1e40af;
}

.queue-status-badge.status-completed {
    background: #d1fae5;
    color: #065f46;
}

.queue-status-badge.status-failed {
    background: #fee2e2;
    color: #991b1b;
    cursor: help;
}

.queue-fallback-badge {
    display: inline-block;
    padding: 0.1rem 0.35rem;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 3px;
    background: #fef3c7;
    color: #92400e;
    margin-left: 4px;
    cursor: help;
    vertical-align: middle;
}

.btn-sm.btn-preview {
    background: #6366f1;
    color: white;
    border: none;
}

@media (hover: hover) {
.btn-sm.btn-preview:hover {
    background: #4f46e5;
}
}

.btn-sm.btn-print {
    background: var(--primary-color);
    color: white;
    border: none;
}

@media (hover: hover) {
.btn-sm.btn-print:hover {
    background: var(--primary-hover);
}
}

.btn-sm.btn-print:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Preview modal */
.modal-preview {
    max-width: 480px;
}

.preview-body {
    padding: 20px;
    display: flex;
    justify-content: center;
    background: #f0f0f0;
    min-height: 200px;
    max-height: 70vh;
    overflow-y: auto;
}

/* Printer checkboxes in routing table */
.printer-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.printer-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.6rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

@media (hover: hover) {
.printer-checkbox:hover {
    border-color: var(--primary-color);
}
}

.printer-checkbox:has(input:checked) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.printer-checkbox input {
    margin: 0;
    cursor: pointer;
}

.no-printers {
    color: var(--secondary-color);
    font-style: italic;
}

.routing-table td {
    vertical-align: top;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

/* Test button states */
.btn-sm.btn-test {
    background: var(--success-color);
}

@media (hover: hover) {
.btn-sm.btn-test:hover {
    background: #059669;
}
}

.btn-sm.btn-test:disabled {
    background: var(--secondary-color);
    cursor: not-allowed;
}

/* Empty state hint */
.empty .hint {
    font-size: 0.875rem;
    color: var(--secondary-color);
    margin-top: 0.5rem;
}

/* Mobile responsive for queue cards */
@media (max-width: 768px) {
    .queue-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .queue-count {
        font-size: 2rem;
    }
}

/* Assign articles modal */
.assign-content {
    padding: 1.5rem;
}

.assign-info {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #f0f9ff;
    border-radius: 4px;
}

.assign-filter {
    margin-bottom: 1rem;
}

.search-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.assign-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 1rem;
}

.assign-items {
    display: flex;
    flex-direction: column;
}

.assign-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.15s;
}

.assign-item:last-child {
    border-bottom: none;
}

@media (hover: hover) {
.assign-item:hover {
    background: var(--bg-color);
}
}

.assign-item:has(input:checked) {
    background: #dbeafe;
}

.assign-item input {
    margin: 0;
}

.assign-item-name {
    flex: 1;
}

.assign-item-price {
    color: var(--secondary-color);
    font-weight: 500;
}

/* Badge styling */
.badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 3px;
    background: var(--primary-color);
    color: white;
    margin-right: 0.25rem;
}

.no-printer {
    color: var(--secondary-color);
    font-style: italic;
}

/* Code styling in tables */
code {
    background: var(--bg-color);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.85em;
}

/* Assign button */
.btn-sm.btn-assign {
    background: var(--warning-color);
}

@media (hover: hover) {
.btn-sm.btn-assign:hover {
    background: #d97706;
}
}
