/* ── Xaelios TAM — Shared Styles ───────────────────────────────────────── */

/* Admin layout */
.xtam-wrap .xtam-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 16px;
}

@media (max-width: 900px) {
    .xtam-wrap .xtam-grid { grid-template-columns: 1fr; }
}

.xtam-card {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 16px 20px;
}

/* Tables */
.xtam-table { width: 100%; border-collapse: collapse; }
.xtam-table th,
.xtam-table td { padding: 8px 10px; text-align: left; vertical-align: middle; }

/* Status badges */
.xtam-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.8em;
    font-weight: 600;
    white-space: nowrap;
}

.xtam-status-open        { background: #d0e8ff; color: #004070; }
.xtam-status-in_progress { background: #fff3cd; color: #7a5800; }
.xtam-status-waiting     { background: #ffe0b2; color: #7a3900; }
.xtam-status-closed      { background: #e0e0e0; color: #444; }

/* ── Frontend ──────────────────────────────────────────────────────────── */
.xtam-frontend { font-family: inherit; }

.xtam-fe-table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.xtam-fe-table th { background: #f1f1f1; font-weight: 600; }
.xtam-fe-table th,
.xtam-fe-table td { padding: 8px 12px; border: 1px solid #ddd; }
.xtam-fe-table tr:hover td { background: #f9f9f9; }

.xtam-notice { padding: 10px 16px; border-radius: 4px; margin-bottom: 12px; }
.xtam-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.xtam-error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

.xtam-ticket-desc { white-space: pre-wrap; background: #f9f9f9; padding: 10px; border-radius: 4px; }

/* Form elements */
.xtam-input {
    width: 100%;
    max-width: 520px;
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 1em;
}
textarea.xtam-input { width: 100%; max-width: 520px; resize: vertical; }

.xtam-btn {
    display: inline-block;
    padding: 8px 18px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
}
.xtam-btn:hover { background: #005d8c; }

.xtam-btn-sm { padding: 4px 12px; font-size: 0.875em; }
.xtam-btn-secondary { background: #f0f0f0; color: #333; border: 1px solid #ccc; }
.xtam-btn-secondary:hover { background: #ddd; }

/* ── Adressbuch ─────────────────────────────────────────────────────────── */
.xtam-ab-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.xtam-ab-header h2 { margin: 0; }

.xtam-search-form { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.xtam-search-form .xtam-input { flex: 1; min-width: 180px; }

.xtam-ab-table td, .xtam-ab-table th { vertical-align: middle; }
.xtam-ab-table td:last-child { white-space: nowrap; }

/* Adressbuch-Formular Grid */
.xtam-ab-form { max-width: 640px; }
.xtam-ab-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}
.xtam-ab-col { display: flex; flex-direction: column; gap: 4px; }
.xtam-ab-col label { font-weight: 600; font-size: 0.9em; }
.xtam-ab-col-full { grid-column: 1 / -1; }
.xtam-ab-col-narrow { max-width: 120px; }
.xtam-ab-actions { display: flex; gap: 10px; align-items: center; margin-top: 16px; }

@media (max-width: 560px) {
    .xtam-ab-row { grid-template-columns: 1fr; }
    .xtam-ab-col-narrow { max-width: 100%; }
}

/* ── Stücklisten ────────────────────────────────────────────────────────── */
.xtam-badge.xtam-bom-active   { background: #2e7d32; color: #fff; }
.xtam-badge.xtam-bom-obsolete { background: #757575; color: #fff; }

/* Gerätetyp-Badges */
.xtam-device-badge { background: #1a237e; color: #fff; font-family: monospace; letter-spacing: 1px; }

#xtam-pos-table tbody tr.xtam-pos-row td:first-child { cursor: grab; }
#xtam-pos-table tbody tr.xtam-pos-row:hover { background: #f0f7ff; }
#xtam-pos-table input.xtam-qty { width: 70px; text-align: right; }
#xtam-pos-table select { max-width: 100%; }
.xtam-remove-row { color: #c00 !important; border-color: #c00 !important; font-weight: bold; }
