/* CIO-AI-Driven: Extracted from custom/Agency/templates/admin/ticket/edit.html.twig
   Purpose: Keep EasyAdmin/Ticket edit template free of inline styles.
*/

body.agency-ticket-edit-page .ticket-status-badge {
    display: inline-block;
    padding: 0.35rem 0.6rem;
    border-radius: 0.25rem;
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1;
    color: #ffffff;
}

body.agency-ticket-edit-page .ticket-status-badge--open { background: #6c757d; }
body.agency-ticket-edit-page .ticket-status-badge--question { background: #0d6efd; }
body.agency-ticket-edit-page .ticket-status-badge--review { background: #f0ad4e; } /* legacy-like orange */
body.agency-ticket-edit-page .ticket-status-badge--approved { background: #198754; }
body.agency-ticket-edit-page .ticket-status-badge--nextupdate { background: #6c757d; }
body.agency-ticket-edit-page .ticket-status-badge--online { background: #28a745; }
body.agency-ticket-edit-page .ticket-status-badge--closed { background: #343a40; }
body.agency-ticket-edit-page .ticket-status-badge--pause { background: #6c757d; }
body.agency-ticket-edit-page .ticket-status-badge--default { background: #6c757d; }

body.agency-ticket-edit-page .ticket-stoerer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

body.agency-ticket-edit-page .ticket-stoerer-actions .btn {
    border-radius: 0.25rem;
}

body.agency-ticket-edit-page .ticket-stoerer-actions .btn-ticket-action {
    background: #f8f9fa;
    border: 1px solid #dcdfe3;
    color: #212529;
}

body.agency-ticket-edit-page .ticket-stoerer-actions .btn-ticket-action:hover {
    background: #eef0f2;
    border-color: #cfd4da;
    color: #212529;
}

body.agency-ticket-edit-page .ticket-stoerer-actions .btn-hotfix {
    margin-left: auto;
}

body.agency-ticket-edit-page .ticket-callout {
    border-radius: 0.25rem;
    padding: 1.5rem 1.75rem;
    margin-top: 0.75rem;
    color: #ffffff;
}

body.agency-ticket-edit-page .ticket-callout h5 {
    margin: 0 0 0.75rem 0;
    font-weight: 700;
    color: #ffffff;
}

body.agency-ticket-edit-page .ticket-callout ul {
    margin: 0;
    padding-left: 1.25rem;
}

body.agency-ticket-edit-page .ticket-callout--info { background: #00bcd4; }
body.agency-ticket-edit-page .ticket-callout--warning { background: #f0ad4e; }
body.agency-ticket-edit-page .ticket-callout--danger { background: #dc3545; }
body.agency-ticket-edit-page .ticket-callout--success { background: #198754; }

body.agency-ticket-edit-page .ticket-estimate-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

body.agency-ticket-edit-page .ticket-estimate-grid .btn {
    background: #f8f9fa;
    border: 1px solid #dcdfe3;
    color: #212529;
    min-width: 4.25rem;
}

/* CIO-AI-Driven: Make ticket edit page more lightweight/compact (legacy-like) */
body.agency-ticket-edit-page {
    font-size: 0.95rem;
}

body.agency-ticket-edit-page .form-label,
body.agency-ticket-edit-page legend.form-label {
    font-size: 0.85rem;
    margin-bottom: 0.15rem;
}

body.agency-ticket-edit-page .form-control,
body.agency-ticket-edit-page .form-select {
    font-size: 0.9rem;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
}

/* Smaller section headings */
body.agency-ticket-edit-page h5 {
    font-size: 1rem;
}

/* Offer/Order block (legacy-like "Angebot") */
body.agency-ticket-edit-page .agency-ticket-offerorder .content-header .title {
    font-size: 1rem;
    font-weight: 700;
}

body.agency-ticket-edit-page .agency-ticket-offerorder-card {
    border: 1px solid #e6e8ec;
    background: #ffffff;
    border-radius: 0.25rem;
    padding: 0.75rem 0.75rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem 1rem;
}

body.agency-ticket-edit-page .agency-ticket-offerorder-card + .agency-ticket-offerorder-card {
    margin-top: 0.75rem;
}

body.agency-ticket-edit-page .agency-ticket-offerorder-card__label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #6c757d;
    margin-bottom: 0.2rem;
}

body.agency-ticket-edit-page .agency-ticket-offerorder-card__value {
    font-size: 0.9rem;
    color: #212529;
}

body.agency-ticket-edit-page .agency-ticket-offerorder-card__description {
    white-space: pre-wrap;
}

body.agency-ticket-edit-page .agency-ticket-offerorder-card__price-toggle {
    font-weight: 600;
    text-decoration: underline;
}

body.agency-ticket-edit-page .agency-ticket-offerorder-card__price {
    font-weight: 700;
    margin-left: 0.35rem;
}

/* CIO-AI-Driven: Originally injected inline in the template */
body.agency-ticket-edit-page .content-wrapper {
    display: block;
}

/* CIO-AI-Driven: Embed-mode (used in Kanban iframe) -> hide EasyAdmin chrome and remove page framing
 * Goal: In Kanban we provide our own overlay header actions ("Close", "Save & close"),
 * so we hide the EasyAdmin content header/actions entirely.
 */
body.agency-embed .main-header,
body.agency-embed .sidebar,
body.agency-embed .content-top,
body.agency-embed #sfToolbarMainContent,
body.agency-embed .sf-toolbar {
    display: none !important;
}

/* CIO-AI-Driven: Hide the EasyAdmin header (title + action buttons) in iframe embed mode */
body.agency-embed .content-header {
    display: none !important;
}

/*
 * CIO-AI-Driven: In Kanban overlay we provide our own header actions ("Schließen", "Speichern & schließen").
 * Therefore we hide EasyAdmin's form action buttons inside the embedded page as well.
 *
 * Important: We only hide them visually; they stay in the DOM so JS can still trigger
 * `button.action-saveAndContinue` via `.click()` when the parent sends `agency-kanban-save-and-close`.
 */
body.agency-embed .form-actions,
body.agency-embed .ea-crud-form-actions,
body.agency-embed .ea-crud-form-actions-wrapper,
body.agency-embed .content-footer,
body.agency-embed .page-actions,
body.agency-embed .page-actions-wrapper,
body.agency-embed button.action-save,
body.agency-embed button.action-saveAndContinue,
body.agency-embed button.action-saveAndReturn,
body.agency-embed button.action-saveAndAddAnother,
body.agency-embed a.action-edit,
body.agency-embed a.action-delete,
body.agency-embed button.action-delete {
    display: none !important;
}

/*
 * CIO-AI-Driven: EasyAdmin layout uses a CSS grid `.wrapper` with a fixed sidebar column.
 * Even if `.sidebar` is hidden, the grid column can still reserve ~230px (seen in DevTools).
 * For embed we force a single-column flow so the content fills the iframe.
 */
body.agency-embed .wrapper {
    display: block !important;
    padding: 0 !important;
}

/* Remove any leftover framing/padding */
body.agency-embed .content-wrapper {
    margin-left: 0 !important;
    padding: 0 !important;
}

/* In embed we want the content to start flush (no mysterious 1px offset) */
body.agency-embed article.content {
    margin-top: 0 !important;
    padding: 0 !important;
    border-top: 0 !important;
}

/* CIO-AI-Driven: Prevent tiny horizontal scroll in iframe (Bootstrap .row has negative margins) */
html.agency-embed,
html.agency-embed body,
body.agency-embed {
    overflow-x: hidden;
}

body.agency-embed .content-body {
    padding: 15px !important;
    overflow-x: hidden;
}

/* Match gutter to padding: gutter-x = 2 * padding => row margins become -15px (no overflow) */
body.agency-embed .content-body .row {
    --bs-gutter-x: 30px;
}

/* CIO-AI-Driven: EasyAdmin sidebar menu badges right-aligned in one vertical line */
#main-menu .menu-item-contents {
    display: flex;
    width: 100% !important; /* ensure full clickable width inside li */
    align-items: center !important; /* override EasyAdmin defaults */
    gap: 0.5rem;
    box-sizing: border-box;
}

#main-menu .menu-item-contents .menu-item-label {
    flex: 1 1 auto;
    min-width: 0;
}

#main-menu .menu-item-contents .menu-item-badge {
    margin-left: auto !important;
    min-width: 2.25rem;
    flex: 0 0 auto;
    display: inline-flex !important;
    justify-content: center;
    align-items: center;
    text-align: center;
}