.dina-tickets {
    padding: 5px;
}

/* Neutral translucent colors are used on purpose so the UI works in light mode, dark mode and both account panel styles. */
.dina-tickets-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px
}

.dina-tickets-title {
    margin: 0;
    font-size: 18px
}

.dina-ticket-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap
}

.dina-tickets-table-wrap {
    overflow-x: auto
}

.dina-tickets-table td,
.dina-tickets-table th {
    vertical-align: middle
}

.woocommerce table.shop_table_responsive.dina-tickets-table tr:nth-child(2n) td,
.woocommerce-page table.shop_table_responsive.dina-tickets-table tr:nth-child(2n) td {
    background-color: inherit;
}

/* Badges */
.dina-ticket-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    line-height: 1.8;
    white-space: nowrap;
    background: rgba(128, 128, 128, .15);
    border: 1px solid rgba(128, 128, 128, .35)
}

.dina-ticket-status-open {
    background: rgba(34, 113, 177, .15);
    border-color: rgba(34, 113, 177, .5);
    color: #2271b1
}

.dina-ticket-status-awaiting-support {
    background: rgba(240, 130, 27, .15);
    border-color: rgba(240, 130, 27, .5);
    color: #d9730d
}

.dina-ticket-status-answered {
    background: rgba(70, 180, 80, .15);
    border-color: rgba(70, 180, 80, .5);
    color: #2e9a3a
}

.dina-ticket-status-awaiting-customer {
    background: rgba(123, 47, 177, .15);
    border-color: rgba(123, 47, 177, .5);
    color: #8e44ad
}

.dina-ticket-status-closed {
    opacity: .75
}

.dina-ticket-priority-high {
    background: rgba(240, 130, 27, .15);
    border-color: rgba(240, 130, 27, .5);
    color: #d9730d
}

.dina-ticket-priority-urgent {
    background: rgba(220, 50, 50, .15);
    border-color: rgba(220, 50, 50, .5);
    color: #d63638
}

.dina-ticket-new-reply {
    display: inline-block;
    margin-inline-start: 6px;
    padding: 1px 8px;
    border-radius: 20px;
    font-size: 11px;
    background: #d63638;
    color: #fff;
    white-space: nowrap
}

/* Ticket meta */
.dina-ticket-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    list-style: none;
    margin: 0 0 20px;
    padding: 12px 14px;
    border: 1px solid rgba(128, 128, 128, .25);
    border-radius: 8px;
    background: rgba(128, 128, 128, .06)
}

.dina-ticket-meta li {
    margin: 0;
    font-size: 13px
}

.dina-ticket-meta-label {
    opacity: .7;
    margin-inline-end: 4px
}

.dina-ticket-meta-label::after {
    content: ':'
}

/* Conversation */
.dina-ticket-thread {
    margin-bottom: 20px
}

.dina-ticket-reply {
    margin-bottom: 12px;
    padding: 12px 14px;
    border: 1px solid rgba(128, 128, 128, .25);
    border-radius: 8px;
    background: rgba(128, 128, 128, .06);
    border-inline-start: 3px solid rgba(70, 180, 80, .8)
}

.dina-ticket-reply-support {
    border-inline-start-color: #2271b1;
    background: rgba(34, 113, 177, .07)
}

.dina-ticket-reply-head {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
    font-size: 13px
}

.dina-ticket-reply-tag {
    padding: 0 8px;
    border-radius: 20px;
    font-size: 11px;
    background: rgba(34, 113, 177, .15);
    color: #2271b1
}

.dina-ticket-reply-date {
    opacity: .65;
    font-size: 12px;
    margin-inline-start: auto
}

.dina-ticket-reply-body p {
    margin: 0 0 .6em
}

.dina-ticket-reply-body p:last-child {
    margin-bottom: 0
}

/* Forms */
.dina-ticket-form textarea,
.dina-ticket-form input[type=text],
.dina-ticket-form select {
    width: 100%;
    box-sizing: border-box
}

.dina-ticket-message {
    margin: 0 0 12px;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    border: 1px solid rgba(128, 128, 128, .35)
}

.dina-ticket-message.is-error {
    background: rgba(220, 50, 50, .12);
    border-color: rgba(220, 50, 50, .5);
    color: #d63638
}

.dina-ticket-message.is-success {
    background: rgba(70, 180, 80, .12);
    border-color: rgba(70, 180, 80, .5);
    color: #2e9a3a
}

.dina-ticket-form .is-busy,
.dina-ticket-action.is-busy {
    opacity: .6;
    cursor: wait
}

.woocommerce .dina-tickets-header a.button,
.woocommerce .dina-tickets-header .dina-ticket-action,
.woocommerce .dina-tickets-header .dina-ticket-action:disabled[disabled],
.woocommerce .dina-tickets-header .dina-ticket-action:disabled,
.woocommerce .dina-tickets-header .dina-ticket-action.disabled {
    margin: 0;
    padding: 8px 12px;
}

.woocommerce button.dina-ticket-submit,
.woocommerce button.dina-ticket-submit:disabled[disabled],
.woocommerce button.dina-ticket-submit:disabled,
.woocommerce button.dina-ticket-submit.disabled {
    padding: 12px 25px;
    margin-top: 10px;
}

.dina-ticket-rating-form button.dina-ticket-submit,
.dina-ticket-rating-form button.dina-ticket-submit:disabled[disabled],
.dina-ticket-rating-form button.dina-ticket-submit:disabled,
.dina-ticket-rating-form button.dina-ticket-submit.disabled {
    margin: 0 auto;
    padding: 8px 20px;
}

.dina-ticket-dropzone-wrap {
    width: 100%;
}

/* wp-admin */
.dina-ticket-admin-box .dina-ticket-thread {
    margin-top: 10px
}

.dina-ticket-admin-box textarea {
    width: 100%;
    box-sizing: border-box
}

.dina-ticket-admin-details label {
    display: block;
    margin: 10px 0 4px;
    font-weight: 600
}

.dina-ticket-admin-details select,
.dina-ticket-admin-details input[type=text] {
    width: 100%
}

.dina-ticket-admin-customer {
    margin: 0 0 6px
}

.dina-ticket-admin-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 14px
}

.column-dina_number {
    width: 70px
}

.dina-ticket-admin-unread {
    display: inline-block;
    margin-inline-start: 6px;
    padding: 0 6px;
    border-radius: 10px;
    font-size: 10px;
    background: #d63638;
    color: #fff;
    vertical-align: middle
}

/* Attachments */
.dina-ticket-attachments {
    list-style: none;
    margin: 10px 0 0;
    padding: 8px 0 0;
    border-top: 1px dashed rgba(128, 128, 128, .35)
}

.dina-ticket-attachments li {
    margin: 0 0 4px;
    font-size: 13px
}

.dina-ticket-attachments small {
    opacity: .65
}

.dina-ticket-hint {
    display: block;
    margin-top: 4px;
    opacity: .7;
    font-size: 12px
}

.dina-ticket-order-button {
    margin-top: 15px
}

/* Internal notes (wp-admin only, never rendered for customers) */
.dina-ticket-note {
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(240, 180, 30, .5);
    border-inline-start: 3px solid #dba617;
    border-radius: 6px;
    background: rgba(240, 180, 30, .12)
}

.dina-ticket-note-head {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 4px;
    font-size: 12px
}

.dina-ticket-note-date {
    opacity: .65;
    margin-inline-start: auto
}

.dina-ticket-note-body p {
    margin: 0 0 .5em
}

.dina-ticket-notes+textarea {
    margin-top: 6px
}

.dina-ticket-canned {
    max-width: 100%
}

/* Rating, hours notice, dashboard note, count badge */
.dina-ticket-stars {
    color: #dba617;
    letter-spacing: 2px;
    white-space: nowrap
}

.dina-ticket-rating {
    margin-top: 20px;
    padding: 14px;
    border: 1px solid rgba(128, 128, 128, .25);
    border-radius: 8px;
    background: rgba(128, 128, 128, .06)
}

.dina-rating-field {
    border: 0;
    margin: 0 0 10px;
    padding: 0;
    text-align: center;
}

.dina-rating-field legend {
    font-weight: 600;
    margin-bottom: 8px
}

/* Star rating input: same look as the WooCommerce review stars */
.dina-ticket-stars-input {
    display: inline-flex;
    flex-direction: row-reverse;
    font-size: 24px;
    line-height: 1
}

.dina-ticket-stars-input input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
    pointer-events: none
}

.dina-ticket-stars-input label {
    position: relative;
    display: block;
    width: 1em;
    height: 1em;
    margin: 0;
    cursor: pointer;
    color: var(--dina-star-color, #ffb900)
}

.dina-ticket-stars-input label::before {
    content: "\e021";
    position: absolute;
    top: 0;
    inset-inline-start: 0;
    width: 1em;
    height: 1em;
    line-height: 1;
    font-family: WooCommerce
}

/* Resting state: the chosen star and every lower star are filled */
.dina-ticket-stars-input:not(:hover) input:checked+label::before,
.dina-ticket-stars-input:not(:hover) input:checked~label::before {
    content: "\e020"
}

/* Hover preview: the hovered star and every lower star are filled */
.dina-ticket-stars-input label:hover::before,
.dina-ticket-stars-input label:hover~label::before {
    content: "\e020"
}

.dina-ticket-stars-input input:focus-visible+label {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
    border-radius: 2px
}

.dina-ticket-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0
}

.dina-ticket-hours-notice small {
    opacity: .75
}

.dina-ticket-count-badge {
    display: inline-block;
    min-width: 18px;
    margin-inline-start: 4px;
    padding: 0 6px;
    border-radius: 10px;
    font-size: 11px;
    line-height: 18px;
    text-align: center;
    background: #d63638;
    color: #fff
}

.dina-user-dropdown>.dropdown-menu li .dina-ticket-count-badge {
    margin-inline-start: 2px
}

/* wp-admin: overdue rows and reports */
.wp-list-table tr.dina-ticket-overdue {
    background: rgba(220, 50, 50, .08)
}

.dina-report-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    margin: 16px 0
}

.dina-report-box h3 {
    margin: 0 0 6px
}

.dina-report-filter {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin: 10px 0
}

/* Upload box (drag and drop, previews). Translucent colors keep it readable in dark mode. */
.dina-ticket-dropzone {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 1.2em 1em;
    border: 2px dashed #a9d9e0;
    border-radius: 10px;
    background-color: rgba(17, 159, 178, .06);
    text-align: center;
    cursor: pointer;
    transition: border-color .2s ease, background-color .2s ease
}

.dina-ticket-dropzone:hover {
    border-color: #81d4fa;
    background-color: rgba(17, 159, 178, .12)
}

.dina-ticket-dropzone.dina-dragover {
    border-color: #2563eb;
    background-color: rgba(37, 99, 235, .1)
}

.dina-ticket-dropzone::before {
    content: '';
    display: block;
    width: 32px;
    height: 32px;
    margin-bottom: 5px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23119fb2' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 18a4 4 0 0 1-.6-7.96A5.5 5.5 0 0 1 17 8.5a4.5 4.5 0 0 1 .5 8.97'/%3E%3Cpath d='M12 12v8'/%3E%3Cpath d='M9 15l3-3 3 3'/%3E%3C/svg%3E") center/contain no-repeat
}

.dina-ticket-dropzone input[type=file] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.dina-ticket-dropzone-text {
    font-size: .9em;
    pointer-events: none
}

.dina-ticket-limit-text {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    opacity: .7;
    pointer-events: none
}

.dina-ticket-preview-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: .6em;
    margin-top: .8em
}

.dina-ticket-preview-list:empty {
    display: none
}

.dina-ticket-preview-item {
    position: relative;
    aspect-ratio: 1/1;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--dina-sec-border-color, rgba(128, 128, 128, .35));
    animation: dina-ticket-item-in .2s ease
}

.dina-ticket-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block
}

.dina-ticket-preview-item.is-file {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(128, 128, 128, .08)
}

.dina-ticket-preview-ext {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    background: rgba(17, 159, 178, .18);
    color: #119fb2
}

.dina-ticket-preview-name {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    padding: 2px 6px;
    font-size: 10px;
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: rgba(0, 0, 0, .55);
    color: #fff
}

.dina-ticket-preview-remove {
    position: absolute;
    top: 4px;
    inset-inline-end: 4px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .6);
    color: #fff;
    border-radius: 50%;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    transition: background-color .15s ease
}

.dina-ticket-preview-remove:hover,
.dina-ticket-preview-remove:focus {
    background: rgba(220, 38, 38, .85);
    outline: 0
}

.dina-ticket-upload-error {
    display: none;
    margin-top: .6em;
    padding: .6em 1em;
    font-size: 12px;
    color: #b91c1c;
    background-color: rgba(220, 38, 38, .1);
    border: 1px solid rgba(220, 38, 38, .35);
    border-radius: 6px;
    animation: dina-ticket-item-in .2s ease
}

@keyframes dina-ticket-item-in {
    from {
        opacity: 0;
        transform: scale(.9)
    }

    to {
        opacity: 1;
        transform: scale(1)
    }
}