﻿/* =========================================================
   Resident Tickets
   ========================================================= */

.resident-tickets-page {
    min-height: calc(100vh - 70px);
    background: radial-gradient(circle at 8% 12%, rgba(20, 184, 166, .10), transparent 25%), radial-gradient(circle at 92% 18%, rgba(59, 130, 246, .10), transparent 25%), #f5f7fb;
    color: #172033;
}

.resident-tickets-container {
    max-width: 1500px;
    margin: 0 auto;
    padding: 32px 28px 50px;
}


/* Header */

.resident-tickets-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    margin-bottom: 25px;
}

.resident-tickets-eyebrow {
    display: block;
    margin-bottom: 5px;
    color: #94a3b8;
    font-size: .72rem;
    font-weight: 600;
}

.resident-tickets-header h1 {
    margin: 0 0 6px;
    font-size: clamp(1.55rem, 2.5vw, 2rem);
    font-weight: 750;
}

.resident-tickets-header p {
    margin: 0;
    color: #718096;
    font-size: .82rem;
    line-height: 1.8;
}

.resident-tickets-new-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: 15px;
    color: #fff;
    background: linear-gradient(135deg, #14b8a6, #0891b2);
    box-shadow: 0 10px 25px rgba(20, 184, 166, .20);
    text-decoration: none;
    font-size: .78rem;
    font-weight: 700;
    white-space: nowrap;
    transition: .25s ease;
}

    .resident-tickets-new-button:hover {
        color: #fff;
        text-decoration: none;
        transform: translateY(-2px);
    }


/* Statistics */

.resident-tickets-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.resident-ticket-stat {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 17px;
    border-radius: 20px;
    background: rgba(255,255,255,.60);
    border: 1px solid rgba(255,255,255,.78);
    box-shadow: 0 15px 35px rgba(31,41,55,.06), inset 0 1px 0 rgba(255,255,255,.85);
    backdrop-filter: blur(20px);
}

.resident-ticket-stat-icon {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    color: #0891b2;
    background: rgba(6,182,212,.11);
}

    .resident-ticket-stat-icon.stat-open {
        color: #f97316;
        background: rgba(249,115,22,.11);
    }

    .resident-ticket-stat-icon.stat-progress {
        color: #8b5cf6;
        background: rgba(139,92,246,.11);
    }

    .resident-ticket-stat-icon.stat-resolved {
        color: #10b981;
        background: rgba(16,185,129,.11);
    }

.resident-ticket-stat span {
    display: block;
    margin-bottom: 3px;
    color: #94a3b8;
    font-size: .66rem;
}

.resident-ticket-stat strong {
    font-size: 1.15rem;
}


/* Grid */

.resident-tickets-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}


/* Ticket Card */

.resident-ticket-card {
    position: relative;
    min-height: 215px;
    display: flex;
    flex-direction: column;
    padding: 22px;
    overflow: hidden;
    border-radius: 25px;
    background: rgba(255,255,255,.60);
    border: 1px solid rgba(255,255,255,.80);
    box-shadow: 0 18px 45px rgba(31,41,55,.07), inset 0 1px 0 rgba(255,255,255,.85);
    backdrop-filter: blur(20px);
    color: inherit;
    text-decoration: none;
    transition: .3s ease;
}

    .resident-ticket-card::before {
        content: "";
        position: absolute;
        width: 130px;
        height: 130px;
        top: -65px;
        right: -55px;
        border-radius: 50%;
        background: #06b6d4;
        opacity: .10;
        filter: blur(5px);
    }

    .resident-ticket-card:hover {
        color: inherit;
        text-decoration: none;
        transform: translateY(-6px);
        border-color: rgba(255,255,255,.95);
        box-shadow: 0 25px 55px rgba(31,41,55,.11), inset 0 1px 0 rgba(255,255,255,.95);
    }

.resident-ticket-card-top {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.resident-ticket-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 17px;
    color: #0891b2;
    background: rgba(6,182,212,.11);
    border: 1px solid rgba(255,255,255,.75);
}

.resident-ticket-id {
    color: #a0aec0;
    font-size: .63rem;
    direction: ltr;
}

.resident-ticket-card-content {
    position: relative;
    z-index: 2;
    flex: 1;
    margin-top: 20px;
}

    .resident-ticket-card-content h2 {
        margin: 0 0 12px;
        color: #172033;
        font-size: 1rem;
        font-weight: 700;
        line-height: 1.7;
    }

.resident-ticket-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

    .resident-ticket-meta span {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        color: #718096;
        font-size: .67rem;
    }

    .resident-ticket-meta i {
        color: #94a3b8;
    }

    .resident-ticket-meta .ticket-priority-urgent {
        color: #dc2626;
    }

    .resident-ticket-meta .ticket-priority-high {
        color: #ea580c;
    }

.resident-ticket-card-bottom {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid rgba(148,163,184,.12);
}

.ticket-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .67rem;
    font-weight: 600;
}

    .ticket-status i {
        font-size: .38rem;
    }

.ticket-status-open {
    color: #f97316;
}

.ticket-status-progress {
    color: #8b5cf6;
}

.ticket-status-waiting {
    color: #eab308;
}

.ticket-status-resolved {
    color: #10b981;
}

.ticket-status-closed {
    color: #64748b;
}

.ticket-status-default {
    color: #94a3b8;
}

.resident-ticket-message-count {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #94a3b8;
    font-size: .65rem;
}

.resident-ticket-arrow {
    margin-right: auto;
    color: #94a3b8;
    font-size: .7rem;
    transition: .25s ease;
}

.resident-ticket-card:hover .resident-ticket-arrow {
    color: #0891b2;
    transform: translateX(-4px);
}


/* Empty */

.resident-tickets-empty {
    padding: 65px 25px;
    border-radius: 27px;
    text-align: center;
}

.resident-tickets-empty-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 22px;
    color: #0891b2;
    background: rgba(6,182,212,.10);
    font-size: 1.5rem;
}

.resident-tickets-empty h2 {
    margin: 0 0 8px;
    font-size: 1.05rem;
}

.resident-tickets-empty p {
    margin: 0 auto 20px;
    max-width: 430px;
    color: #718096;
    font-size: .78rem;
    line-height: 1.9;
}


/* Responsive */

@media (max-width: 1100px) {
    .resident-tickets-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {

    .resident-tickets-container {
        padding: 20px 14px 35px;
    }

    .resident-tickets-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 15px;
    }

    .resident-tickets-new-button {
        width: 100%;
    }

    .resident-tickets-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .resident-ticket-stat {
        padding: 13px;
        border-radius: 17px;
    }

    .resident-ticket-stat-icon {
        width: 39px;
        height: 39px;
        flex-basis: 39px;
        border-radius: 12px;
        font-size: .85rem;
    }

    .resident-ticket-stat span {
        font-size: .59rem;
    }

    .resident-ticket-stat strong {
        font-size: .98rem;
    }

    .resident-tickets-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .resident-ticket-card {
        min-height: 190px;
        padding: 18px;
        border-radius: 21px;
    }

    .resident-ticket-icon {
        width: 46px;
        height: 46px;
        border-radius: 15px;
    }

    .resident-ticket-card-content h2 {
        font-size: .9rem;
    }
}

/* =========================================================
   Create Ticket
   ========================================================= */

.ticket-create-header {
    margin-bottom: 22px;
}

.ticket-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    color: #64748b;
    text-decoration: none;
    font-size: .75rem;
    font-weight: 600;
    transition: .25s ease;
}

    .ticket-back-link:hover {
        color: #0891b2;
        text-decoration: none;
    }

.ticket-create-header h1 {
    margin: 0 0 7px;
    font-size: clamp(1.45rem, 2.5vw, 1.9rem);
    font-weight: 750;
}

.ticket-create-header p {
    margin: 0;
    color: #718096;
    font-size: .8rem;
}

.ticket-create-card {
    max-width: 900px;
    margin: 0 auto;
    padding: 32px;
    border-radius: 28px;
}

.ticket-form-group {
    margin-bottom: 22px;
}

    .ticket-form-group label {
        display: block;
        margin-bottom: 8px;
        color: #334155;
        font-size: .78rem;
        font-weight: 700;
    }

.ticket-form-input {
    width: 100%;
    min-height: 48px;
    padding: 11px 14px;
    border: 1px solid rgba(203, 213, 225, .75);
    border-radius: 14px;
    outline: none;
    color: #334155;
    background: rgba(255,255,255,.72);
    font-family: inherit;
    font-size: .8rem;
    transition: .25s ease;
}

    .ticket-form-input:focus {
        border-color: rgba(6, 182, 212, .55);
        box-shadow: 0 0 0 4px rgba(6, 182, 212, .08);
        background: rgba(255,255,255,.9);
    }

.ticket-form-textarea {
    min-height: 170px;
    resize: vertical;
    line-height: 2;
}

.ticket-form-hint {
    display: block;
    margin-top: 6px;
    color: #94a3b8;
    font-size: .63rem;
    line-height: 1.7;
}

.ticket-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.ticket-form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding-top: 8px;
}

.ticket-submit-button,
.ticket-cancel-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 10px 20px;
    border-radius: 14px;
    font-family: inherit;
    font-size: .76rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: .25s ease;
}

.ticket-submit-button {
    border: 0;
    color: #fff;
    background: linear-gradient(135deg, #14b8a6, #0891b2);
    box-shadow: 0 9px 22px rgba(20,184,166,.18);
}

    .ticket-submit-button:hover {
        transform: translateY(-2px);
        box-shadow: 0 13px 28px rgba(20,184,166,.25);
    }

.ticket-cancel-button {
    color: #64748b;
    background: rgba(241,245,249,.8);
    border: 1px solid rgba(226,232,240,.8);
}

    .ticket-cancel-button:hover {
        color: #334155;
        text-decoration: none;
        background: #fff;
    }


/* Mobile */

@media (max-width: 767.98px) {

    .ticket-create-card {
        padding: 20px 17px;
        border-radius: 22px;
    }

    .ticket-form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .ticket-form-input {
        min-height: 45px;
        font-size: .76rem;
    }

    .ticket-form-textarea {
        min-height: 145px;
    }

    .ticket-form-actions {
        flex-direction: column-reverse;
    }

    .ticket-submit-button,
    .ticket-cancel-button {
        width: 100%;
    }
}

/* =========================================================
   Ticket Details
   ========================================================= */

.ticket-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 23px 25px;
    margin-bottom: 14px;
    border-radius: 24px;
}

.ticket-detail-header-main {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.ticket-detail-icon {
    width: 55px;
    height: 55px;
    flex: 0 0 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 17px;
    color: #0891b2;
    background: rgba(6,182,212,.11);
    border: 1px solid rgba(255,255,255,.75);
}

.ticket-detail-title {
    min-width: 0;
}

.ticket-detail-id {
    margin-bottom: 3px;
    color: #94a3b8;
    font-size: .62rem;
    direction: ltr;
    text-align: right;
}

.ticket-detail-title h1 {
    margin: 0;
    color: #172033;
    font-size: 1.1rem;
    font-weight: 750;
    line-height: 1.6;
}

.ticket-detail-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 13px;
    border-radius: 12px;
    font-size: .68rem;
    font-weight: 700;
    white-space: nowrap;
}

    .ticket-detail-status i {
        font-size: .38rem;
    }

.ticket-detail-status-open {
    color: #f97316;
    background: rgba(249,115,22,.09);
}

.ticket-detail-status-progress {
    color: #7c3aed;
    background: rgba(124,58,237,.09);
}

.ticket-detail-status-waiting {
    color: #ca8a04;
    background: rgba(234,179,8,.10);
}

.ticket-detail-status-resolved {
    color: #059669;
    background: rgba(16,185,129,.09);
}

.ticket-detail-status-closed {
    color: #64748b;
    background: rgba(100,116,139,.09);
}

.ticket-detail-status-default {
    color: #94a3b8;
    background: rgba(148,163,184,.09);
}


/* Meta */

.ticket-detail-meta {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    margin-bottom: 18px;
    overflow: hidden;
    border-radius: 20px;
}

.ticket-detail-meta-item {
    padding: 17px 19px;
    background: rgba(255,255,255,.30);
}

    .ticket-detail-meta-item span {
        display: block;
        margin-bottom: 6px;
        color: #94a3b8;
        font-size: .63rem;
    }

    .ticket-detail-meta-item strong {
        display: flex;
        align-items: center;
        gap: 6px;
        color: #475569;
        font-size: .75rem;
    }

        .ticket-detail-meta-item strong i {
            color: #0891b2;
        }

.ticket-detail-priority-urgent {
    color: #dc2626 !important;
}

.ticket-detail-priority-high {
    color: #ea580c !important;
}

.ticket-detail-priority-normal {
    color: #64748b !important;
}


/* Conversation */

.ticket-conversation {
    overflow: hidden;
    border-radius: 27px;
}

.ticket-conversation-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 25px;
    border-bottom: 1px solid rgba(148,163,184,.12);
}

.ticket-conversation-eyebrow {
    display: block;
    margin-bottom: 3px;
    color: #94a3b8;
    font-size: .62rem;
}

.ticket-conversation-header h2 {
    margin: 0;
    color: #334155;
    font-size: .98rem;
    font-weight: 750;
}

.ticket-message-count {
    color: #94a3b8;
    font-size: .66rem;
}


/* Messages */

.ticket-messages {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 24px;
    background: rgba(248,250,252,.28);
}

.ticket-message-row {
    display: flex;
    width: 100%;
}

.ticket-message-mine {
    justify-content: flex-start;
}

.ticket-message-admin {
    justify-content: flex-end;
}

.ticket-message {
    max-width: 72%;
    padding: 14px 17px;
    border-radius: 18px;
    box-shadow: 0 8px 22px rgba(31,41,55,.04);
}

.ticket-message-mine .ticket-message {
    border-bottom-right-radius: 5px;
    background: rgba(255,255,255,.82);
    border: 1px solid rgba(226,232,240,.72);
}

.ticket-message-admin .ticket-message {
    border-bottom-left-radius: 5px;
    background: linear-gradient( 135deg, rgba(6,182,212,.10), rgba(20,184,166,.08) );
    border: 1px solid rgba(6,182,212,.12);
}

.ticket-message-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 8px;
}

    .ticket-message-top strong {
        color: #475569;
        font-size: .7rem;
    }

.ticket-message-admin .ticket-message-top strong {
    color: #0891b2;
}

.ticket-message-top span {
    color: #a0aec0;
    font-size: .58rem;
    white-space: nowrap;
}

.ticket-message-body {
    color: #475569;
    font-size: .77rem;
    line-height: 2;
    white-space: pre-line;
    word-break: break-word;
}


/* Reply */

.ticket-reply-section {
    padding: 22px 24px 24px;
    border-top: 1px solid rgba(148,163,184,.12);
}

.ticket-reply-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: #475569;
    font-size: .76rem;
    font-weight: 700;
}

    .ticket-reply-title i {
        color: #0891b2;
    }

.ticket-reply-input {
    display: block;
    width: 100%;
    min-height: 130px;
    padding: 13px 15px;
    resize: vertical;
    outline: none;
    border-radius: 15px;
    border: 1px solid rgba(203,213,225,.75);
    background: rgba(255,255,255,.70);
    color: #334155;
    font-family: inherit;
    font-size: .76rem;
    line-height: 2;
    transition: .25s ease;
}

    .ticket-reply-input:focus {
        border-color: rgba(6,182,212,.55);
        box-shadow: 0 0 0 4px rgba(6,182,212,.08);
        background: rgba(255,255,255,.9);
    }

.ticket-reply-actions {
    display: flex;
    justify-content: flex-start;
    margin-top: 10px;
}

.ticket-closed-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 20px;
    border-top: 1px solid rgba(148,163,184,.12);
    color: #94a3b8;
    font-size: .7rem;
}

    .ticket-closed-message i {
        color: #64748b;
    }


/* Mobile */

@media (max-width: 767.98px) {

    .ticket-detail-header {
        align-items: flex-start;
        flex-direction: column;
        padding: 18px;
        border-radius: 21px;
    }

    .ticket-detail-header-main {
        width: 100%;
    }

    .ticket-detail-icon {
        width: 47px;
        height: 47px;
        flex-basis: 47px;
        border-radius: 14px;
    }

    .ticket-detail-title h1 {
        font-size: .92rem;
    }

    .ticket-detail-status {
        align-self: flex-start;
    }

    .ticket-detail-meta {
        grid-template-columns: repeat(2, 1fr);
        border-radius: 18px;
    }

    .ticket-detail-meta-item {
        padding: 13px;
    }

        .ticket-detail-meta-item span {
            font-size: .57rem;
        }

        .ticket-detail-meta-item strong {
            font-size: .65rem;
        }

    .ticket-conversation {
        border-radius: 21px;
    }

    .ticket-conversation-header {
        padding: 17px;
    }

    .ticket-messages {
        gap: 10px;
        padding: 15px;
    }

    .ticket-message {
        max-width: 88%;
        padding: 12px 14px;
    }

    .ticket-message-body {
        font-size: .7rem;
        line-height: 1.95;
    }

    .ticket-reply-section {
        padding: 17px;
    }

    .ticket-reply-input {
        min-height: 115px;
    }
}