/* IT-Doku Tool Connector – Styles */

.it-doku-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    color: #1f2937;
    max-width: 100%;
    width: 100%;
}

/* ----------------------------------------------------------------
   Sections
   ---------------------------------------------------------------- */
.it-doku-section {
    margin-bottom: 2rem;
}

.it-doku-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
}

/* ----------------------------------------------------------------
   Notices
   ---------------------------------------------------------------- */
.it-doku-notice {
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.9rem;
}

.it-doku-notice small {
    display: block;
    margin-top: 0.25rem;
    color: #6b7280;
    font-size: 0.82rem;
}

.it-doku-notice-info {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    color: #0c4a6e;
}

.it-doku-notice-error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

/* ----------------------------------------------------------------
   Badges
   ---------------------------------------------------------------- */
.it-doku-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

.it-doku-badge-available {
    background: #dcfce7;
    color: #15803d;
}

.it-doku-badge-occupied {
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #fed7aa;
}

.it-doku-badge-reserved {
    background: #fef9c3;
    color: #854d0e;
}

.it-doku-badge-active {
    background: #dcfce7;
    color: #15803d;
}

/* ----------------------------------------------------------------
   Meine Leihen (Cards)
   ---------------------------------------------------------------- */
.it-doku-loans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.it-doku-loan-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-left: 4px solid #3b82f6;
    border-radius: 0.375rem;
    overflow: hidden;
}

.it-doku-loan-card-header {
    padding: 0.75rem 1rem 0.5rem;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.it-doku-loan-card-header strong {
    font-size: 0.95rem;
    color: #111827;
}

.it-doku-loan-card-body {
    padding: 0 1rem 0.75rem;
}

.it-doku-loan-dates {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: #374151;
    margin-bottom: 0.4rem;
}

.it-doku-loan-dates-sep {
    color: #9ca3af;
}

.it-doku-loan-purpose {
    font-size: 0.82rem;
    color: #6b7280;
    margin: 0.35rem 0 0;
    line-height: 1.4;
}

/* ----------------------------------------------------------------
   Leihgeräte-Liste
   ---------------------------------------------------------------- */
.it-doku-devices-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    overflow: hidden;
}

.it-doku-device-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1rem;
    background: #fff;
    border-bottom: 1px solid #f3f4f6;
}

.it-doku-device-item:last-child {
    border-bottom: none;
}

.it-doku-device-item:hover {
    background: #fafafa;
}

.it-doku-device-info {
    flex: 1;
    min-width: 0;
}

.it-doku-device-title-row {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.it-doku-device-name {
    font-weight: 600;
    color: #111827;
}

.it-doku-device-type {
    font-size: 0.8rem;
    color: #6b7280;
    background: #f3f4f6;
    padding: 0.1rem 0.4rem;
    border-radius: 0.2rem;
}

.it-doku-device-image {
    flex-shrink: 0;
    width: 72px;
    height: 56px;
    border-radius: 0.35rem;
    overflow: hidden;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.it-doku-device-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.it-doku-device-inv {
    font-size: 0.75rem;
    color: #9ca3af;
    display: block;
    margin-bottom: 0.1rem;
}

.it-doku-device-desc {
    font-size: 0.83rem;
    color: #6b7280;
    margin: 0.25rem 0 0;
    line-height: 1.4;
}

.it-doku-device-status-col {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.4rem;
    flex-shrink: 0;
}

.it-doku-hint {
    font-size: 0.78rem;
    color: #9ca3af;
    text-align: right;
    max-width: 180px;
}

/* ----------------------------------------------------------------
   Buttons
   ---------------------------------------------------------------- */
.it-doku-btn {
    display: inline-block;
    padding: 0.4rem 0.85rem;
    border-radius: 0.25rem;
    font-size: 0.83rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    transition: background 0.15s;
    line-height: 1.4;
}

.it-doku-btn-request {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
}

.it-doku-btn-request:hover {
    background: #2563eb;
    color: #fff;
}

.it-doku-btn-primary {
    background: #16a34a;
    color: #fff;
    border-color: #16a34a;
}

.it-doku-btn-primary:hover {
    background: #15803d;
    color: #fff;
}

.it-doku-btn-cancel {
    background: #fff;
    color: #374151;
    border-color: #d1d5db;
}

.it-doku-btn-cancel:hover {
    background: #f3f4f6;
}

.it-doku-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ----------------------------------------------------------------
   Anfrageformular
   ---------------------------------------------------------------- */
.it-doku-request-form {
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    border-left: 4px solid #3b82f6;
    padding: 1rem 1.25rem;
}

.it-doku-form-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0 0 0.75rem;
    color: #111827;
}

.it-doku-form-title em {
    font-style: normal;
    color: #3b82f6;
}

.it-doku-form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.it-doku-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.it-doku-form-group label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #374151;
}

.it-doku-form-group input[type="date"],
.it-doku-form-group textarea {
    padding: 0.4rem 0.65rem;
    border: 1px solid #d1d5db;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    color: #1f2937;
    background: #fff;
    font-family: inherit;
}

.it-doku-form-group input[type="date"] {
    min-width: 150px;
}

.it-doku-form-group textarea {
    width: 100%;
    min-width: 300px;
    resize: vertical;
}

.it-doku-form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.it-doku-form-feedback {
    margin-top: 0.5rem;
    padding: 0.4rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.85rem;
}

.it-doku-feedback-success {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.it-doku-feedback-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.it-doku-success-panel {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1rem 1.25rem;
    margin: 0.5rem 0;
    background: #dcfce7;
    border: 1px solid #86efac;
    border-radius: 0.5rem;
    color: #15803d;
}

.it-doku-success-panel__icon {
    font-size: 1.5rem;
    line-height: 1;
    flex-shrink: 0;
}

.it-doku-success-panel__body {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.it-doku-success-panel__title {
    font-weight: 600;
    font-size: 1rem;
}

.it-doku-success-panel__text {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* ----------------------------------------------------------------
   Asset-Tabelle
   ---------------------------------------------------------------- */
.it-doku-assets-table-wrap {
    overflow-x: auto;
}

.it-doku-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    overflow: hidden;
    background: #fff;
}

.it-doku-table th {
    text-align: left;
    padding: 0.65rem 1rem;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    white-space: nowrap;
}

.it-doku-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.875rem;
    color: #374151;
    vertical-align: middle;
}

.it-doku-table tr:last-child td {
    border-bottom: none;
}

.it-doku-table tbody tr:hover td {
    background: #fafafa;
}

.it-doku-inv-number {
    font-family: monospace;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
}

/* ----------------------------------------------------------------
   Responsive
   ---------------------------------------------------------------- */
@media (max-width: 600px) {
    .it-doku-device-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .it-doku-device-status-col {
        align-items: flex-start;
    }

    .it-doku-form-group textarea {
        min-width: unset;
        width: 100%;
    }

    .it-doku-table th:nth-child(3),
    .it-doku-table td:nth-child(3) {
        display: none;
    }
}

/* ----------------------------------------------------------------
   Verfügbarkeitsfilter
   ---------------------------------------------------------------- */
.it-doku-filter-box {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem 1.25rem 0.75rem;
    margin-bottom: 1.25rem;
}

.it-doku-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
}

.it-doku-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1 1 auto;
    min-width: 130px;
}

.it-doku-filter-group label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #374151;
}

.it-doku-filter-select,
.it-doku-filter-date {
    padding: 0.45rem 0.6rem;
    border: 1px solid #d1d5db;
    border-radius: 0.4rem;
    font-size: 0.875rem;
    color: #111827;
    background: #fff;
    width: 100%;
    box-sizing: border-box;
}

.it-doku-filter-btn-group {
    flex: 0 0 auto;
    min-width: unset;
}

.it-doku-filter-status {
    margin-top: 0.6rem;
    font-size: 0.82rem;
    padding: 0.4rem 0.6rem;
    border-radius: 0.35rem;
}

.it-doku-filter-info    { background: #eff6ff; color: #1d4ed8; }
.it-doku-filter-error   { background: #fef2f2; color: #dc2626; }
.it-doku-filter-loading { background: #f0fdf4; color: #166534; }

/* Zubehör-Hinweis im Reservierungsformular */
.it-doku-accessory-note {
    background: #eff6ff;
    border-left: 3px solid #3b82f6;
    color: #1e40af;
    font-size: 0.82rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0 0.35rem 0.35rem 0;
    margin-bottom: 0.85rem;
}

@media (max-width: 600px) {
    .it-doku-filter-group {
        min-width: 100%;
    }
}

/* ----------------------------------------------------------------
   Ticket-Formular
   ---------------------------------------------------------------- */
.it-doku-ticket-form {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1.25rem 1.5rem;
    max-width: 680px;
}

.it-doku-form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.35rem;
}

.it-doku-form-value {
    font-size: 0.9rem;
    color: #1f2937;
    padding: 0.45rem 0;
}

.it-doku-form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.9rem;
    color: #1f2937;
    background: #fff;
    font-family: inherit;
    box-sizing: border-box;
}

.it-doku-form-control:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}

textarea.it-doku-form-control {
    resize: vertical;
    min-height: 110px;
}

.it-doku-ticket-form .it-doku-form-row {
    flex-direction: column;
    gap: 0.25rem;
}

.it-doku-required {
    color: #dc2626;
}

.it-doku-notice-success {
    background: #dcfce7;
    border: 1px solid #86efac;
    color: #15803d;
}

/* ----------------------------------------------------------------
   Ticket-Formular – Dateianhang + optionales Feld
   ---------------------------------------------------------------- */
.it-doku-optional {
    font-size: 0.8em;
    color: #9ca3af;
    font-weight: 400;
}

.it-doku-field-hint {
    font-size: 0.8rem;
    color: #9ca3af;
    margin: 0.2rem 0 0;
}

.it-doku-file-input {
    padding: 0.3rem 0 !important;
    border: none !important;
    background: transparent !important;
    cursor: pointer;
}

.it-doku-attachment-preview {
    font-size: 0.82rem;
    color: #374151;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 0.3rem;
    padding: 0.35rem 0.65rem;
    margin-top: 0.35rem;
    display: inline-block;
}

/* ----------------------------------------------------------------
   Meine Tickets – Ticket-Karten
   ---------------------------------------------------------------- */
.it-doku-ticket-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.it-doku-ticket-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.9rem 1.1rem;
}

.it-doku-ticket-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.45rem;
}

.it-doku-ticket-subject {
    font-weight: 600;
    font-size: 0.95rem;
    color: #111827;
    flex: 1;
}

.it-doku-ticket-status {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.73rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

.it-doku-status-new     { background: #dbeafe; color: #1d4ed8; }
.it-doku-status-open    { background: #fef9c3; color: #a16207; }
.it-doku-status-waiting { background: #ffedd5; color: #c2410c; }
.it-doku-status-solved  { background: #dcfce7; color: #15803d; }
.it-doku-status-closed  { background: #f3f4f6; color: #6b7280; }

.it-doku-ticket-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1.1rem;
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 0.35rem;
}

.it-doku-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.it-doku-ticket-latest-reply {
    font-size: 0.82rem;
    color: #374151;
    background: #f9fafb;
    border: 1px solid #f3f4f6;
    border-radius: 0.3rem;
    padding: 0.4rem 0.65rem;
    margin-top: 0.45rem;
}

@media (max-width: 600px) {
    .it-doku-ticket-card-header { flex-direction: column; gap: 0.35rem; }
}

/* ----------------------------------------------------------------
   Ticket-Karten – farbiger linker Rand je Status
   ---------------------------------------------------------------- */
.it-doku-ticket-card {
    border-left: 4px solid #e5e7eb;
}

.it-doku-ticket-card[data-status="new"]     { border-left-color: #3b82f6; }
.it-doku-ticket-card[data-status="open"]    { border-left-color: #ca8a04; }
.it-doku-ticket-card[data-status="waiting"] { border-left-color: #ea580c; }
.it-doku-ticket-card[data-status="solved"]  { border-left-color: #16a34a; }
.it-doku-ticket-card[data-status="closed"]  { border-left-color: #9ca3af; }

/* ----------------------------------------------------------------
   Asset-Karten (Grid wie Leihen)
   ---------------------------------------------------------------- */
.it-doku-assets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.it-doku-asset-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-left: 4px solid #3b82f6;
    border-radius: 0.375rem;
    overflow: hidden;
}

.it-doku-asset-location {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 0.3rem;
}

/* ----------------------------------------------------------------
   Durchsuchbare Dropdown-Komponente (Combo)
   ---------------------------------------------------------------- */
.it-doku-combo {
    position: relative;
}

.it-doku-combo-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #3b82f6;
    border-top: none;
    border-radius: 0 0 0.375rem 0.375rem;
    max-height: 210px;
    overflow-y: auto;
    z-index: 9999;
    box-shadow: 0 4px 10px -2px rgba(0, 0, 0, .12);
}

.it-doku-combo-search:focus {
    border-radius: 0.375rem 0.375rem 0 0;
}

.it-doku-combo-option {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: #1f2937;
    border-bottom: 1px solid #f3f4f6;
}

.it-doku-combo-option:last-child {
    border-bottom: none;
}

.it-doku-combo-option.it-doku-combo-hover,
.it-doku-combo-option:hover {
    background: #eff6ff;
    color: #1d4ed8;
}

.it-doku-combo-option.it-doku-combo-selected {
    background: #dbeafe;
    color: #1d4ed8;
    font-weight: 600;
}

.it-doku-combo-option.it-doku-combo-option-none {
    color: #9ca3af;
    font-style: italic;
}
