
/* ========================================
   VINTADO — COMPLETE TICKET.CSS
   Ticket System + Admin Dashboard
   ======================================== */

/* Main ticket layout */
.ticket-main {
    display: block;
    width: 100%;
    max-width: 1100px;
    min-height: 65vh;
    margin: 0 auto;
    padding: 68px 24px 80px;
    box-sizing: border-box;
}

/* Ticket cards */
.ticket-box {
    display: block;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 36px;
    background: #141416;
    border: 1px solid #303035;
    border-radius: 22px;
    box-sizing: border-box;
    color: #f5f5f5;
}

.ticket-box h1 {
    font-size: clamp(1.7rem, 4vw, 2.5rem);
    line-height: 1.2;
    margin: 4px 0 15px;
    color: #fafafa;
}

.ticket-box .hint {
    color: #a7a7aa;
    font-size: 14px;
    line-height: 1.65;
}

/* Forms */
.ticket-box form {
    display: grid;
    gap: 20px;
    margin-top: 25px;
}

.ticket-box label,
.ticket-box legend {
    display: block;
    color: #ededed;
    font-weight: 600;
    font-size: 14px;
}

.ticket-box input:not([type="radio"]),
.ticket-box textarea,
.ticket-box select {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 13px 14px;
    background: #0d0d0e;
    border: 1px solid #3b3b40;
    border-radius: 10px;
    box-sizing: border-box;
    color: #fff;
    font: inherit;
}

.ticket-box input:focus,
.ticket-box textarea:focus,
.ticket-box select:focus {
    outline: 2px solid #777;
    outline-offset: 2px;
}

.ticket-box textarea {
    min-height: 110px;
    resize: vertical;
}

.ticket-box fieldset {
    border: 1px solid #343438;
    border-radius: 12px;
    padding: 14px;
}

.ticket-box .radio {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 0;
    font-weight: 400;
}

.ticket-box .radio input {
    accent-color: #fff;
}

.ticket-box .primary-button {
    display: block;
    width: 100%;
    padding: 14px 18px;
    border: 0;
    border-radius: 10px;
    background: #f5f5f5;
    color: #121212;
    font: inherit;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
}

.ticket-box .primary-button:hover {
    background: #dcdcdc;
}

.hidden-field {
    position: absolute;
    left: -9999px;
}

.ticket-box .error {
    color: #ffb6b6;
}

/* Ticket conversations */
.thread {
    display: grid;
    gap: 12px;
    margin: 24px 0;
}

.message {
    padding: 15px;
    background: #202023;
    border: 1px solid #333338;
    border-radius: 12px;
}

.message.staff {
    background: #24262a;
    border-color: #41434a;
}

.message small {
    color: #aaa;
    font-size: 12px;
}

.message p {
    line-height: 1.6;
    overflow-wrap: anywhere;
}

/* Ticket list */
.ticket-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
    padding: 18px 12px;
    border-bottom: 1px solid #383838;
    box-sizing: border-box;
    color: #fff;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.ticket-row:hover {
    background: #202023;
}

.ticket-row span {
    min-width: 0;
}

/* ========================================
   ADMIN DASHBOARD
   ======================================== */

.ticket-box.admin-box {
    display: block;
    width: 100%;
    max-width: 1100px;
    min-width: 0;
    margin: 0 auto;
    padding: 36px;
    box-sizing: border-box;
}

.admin-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    width: 100%;
    margin-bottom: 24px;
}

.admin-top h1 {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-size: 32px;
    line-height: 1.2;
}

.admin-top a {
    flex-shrink: 0;
    color: #ddd;
    font-size: 14px;
    text-decoration: none;
    white-space: nowrap;
}

.admin-top a:hover {
    color: #fff;
}

.ticket-box a:not(.primary-button) {
    color: #ddd;
}

/* Repair layouts constrained by parent containers */
body:has(.admin-box) .ticket-main,
body:has(.admin-box) main.ticket-main {
    display: block !important;
    width: min(1100px, 96%) !important;
    max-width: none !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
}

body:has(.admin-box) .admin-box {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

body:has(.admin-box) .admin-top {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 24px !important;
}

body:has(.admin-box) .admin-top h1 {
    flex: 1 !important;
    margin: 0 !important;
}

/* Responsive layouts */
@media (max-width: 600px) {
    .ticket-main {
        padding: 28px 14px 50px;
    }

    .ticket-box,
    .ticket-box.admin-box {
        padding: 20px;
        border-radius: 16px;
    }

    .ticket-row {
        display: grid;
        gap: 8px;
    }

    .admin-top {
        gap: 12px;
    }

    .admin-top h1 {
        font-size: 26px;
    }

    body:has(.admin-box) .ticket-main {
        width: 100% !important;
    }
}
