/**
 * Hi Express Admin Styles
 */

/* Settings Page Layout */
.hi-express-settings {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    max-width: 1400px;
    padding-top: 20px;
}

.hi-express-header {
    width: 100%;
    background: #fff;
    color: #1d2327;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.hi-express-logo h1 {
    display: inline-flex;
    align-items: center;
    font-size: 32px;
    margin: 0;
    padding: 0;
    color: white;
}

.hi-express-logo .hi {
    font-weight: 800;
}

.hi-express-logo .dash {
    margin: 0 2px;
}

.hi-express-logo .express {
    font-weight: 300;
}

.hi-express-logo .version {
    background: #e6f0f7;
    color: #1C76BC;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    margin-left: 15px;
    vertical-align: middle;
}

.hi-express-header .description {
    margin: 10px 0 0;
    font-size: 16px;
    color: #646970;
}

.hi-express-content {
    flex: 1;
    min-width: 500px;
}

.hi-express-sidebar {
    width: 300px;
}

.hi-express-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.hi-express-card h2 {
    margin: 0 0 5px;
    font-size: 18px;
    color: #1d2327;
}

.hi-express-card h3 {
    margin: 0 0 15px;
    font-size: 16px;
    color: #1d2327;
}

.hi-express-card .card-description {
    color: #646970;
    margin: 0 0 20px;
}

.hi-express-card .form-table th {
    padding-left: 0;
}

/* Toggle Switch */
.hi-express-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.hi-express-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.hi-express-toggle .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 26px;
}

.hi-express-toggle .slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.hi-express-toggle input:checked+.slider {
    background-color: #1C76BC;
}

.hi-express-toggle input:checked+.slider:before {
    transform: translateX(24px);
}

/* Save Button */
.hi-express-save-btn {
    background: #1C76BC !important;
    border-color: #155a91 !important;
    padding: 8px 30px !important;
    height: auto !important;
    font-size: 14px !important;
}

.hi-express-save-btn:hover {
    background: #155a91 !important;
}

/* Test Connection */
#connection-status {
    margin-left: 10px;
    display: inline-block;
}

#connection-status.success {
    color: #00a32a;
}

#connection-status.error {
    color: #d63638;
}

/* Sidebar Cards */
.hi-express-help ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.hi-express-help li {
    margin-bottom: 12px;
}

.hi-express-help a {
    text-decoration: none;
    color: #1C76BC;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hi-express-help a:hover {
    color: #155a91;
}

/* Rates Table */
.rates-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.rates-table th,
.rates-table td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.rates-table th {
    background: #f9f9f9;
    font-weight: 600;
}

.rates-note {
    font-size: 11px;
    color: #888;
    margin-top: 10px;
    font-style: italic;
}

/* Order Metabox Styles */
.hi-express-metabox {
    padding: 5px 0;
}

.hi-express-status-card,
.hi-express-send-card {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
}

.status-header {
    margin-bottom: 15px;
}

.status-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-picked_up {
    background: #d1ecf1;
    color: #0c5460;
}

.status-in_transit {
    background: #cce5ff;
    color: #004085;
}

.status-out_for_delivery {
    background: #d4edda;
    color: #155724;
}

.status-delivered {
    background: #28a745;
    color: white;
}

.status-returned {
    background: #f8d7da;
    color: #721c24;
}

.status-cancelled {
    background: #6c757d;
    color: white;
}

.tracking-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}

.tracking-info label {
    font-weight: 600;
    color: #555;
}

.tracking-code {
    background: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    border: 1px solid #ddd;
}

.copy-tracking {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
}

.copy-tracking:hover {
    opacity: 0.7;
}

.tracking-timeline {
    background: white;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    height: auto;
    /* max-height removed for dynamic height */
}

.timeline-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.timeline-item:last-child {
    border-bottom: none;
}

.timeline-dot {
    width: 12px;
    height: 12px;
    background: #1C76BC;
    border-radius: 50%;
    margin-top: 4px;
    flex-shrink: 0;
}

.timeline-content .status-label {
    font-weight: 600;
    color: #333;
}

.timeline-content .status-desc {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

.timeline-content .status-time {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}

.loading-timeline {
    text-align: center;
    color: #888;
    font-style: italic;
}

.metabox-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.metabox-actions .button {
    flex: 1;
    text-align: center;
    justify-content: center;
}

/* Send Card */
.send-description {
    margin: 0 0 15px;
    color: #555;
}

.order-summary {
    background: white;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 15px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-item .label {
    color: #666;
    font-size: 12px;
}

.summary-item .value {
    font-weight: 500;
}

.summary-item.cod {
    background: #fff3cd;
    margin: 8px -12px -12px;
    padding: 10px 12px;
    border-radius: 0 0 6px 6px;
}

.summary-item.cod .value {
    color: #856404;
    font-weight: 700;
}

.hi-express-send-order {
    width: 100%;
    background: #1C76BC !important;
    border-color: #155a91 !important;
    font-size: 14px !important;
}

.hi-express-send-order:hover {
    background: #155a91 !important;
}

.send-note {
    font-size: 11px;
    color: #888;
    text-align: center;
    margin: 12px 0 0;
}

/* Order List Column Badge */
.hi-express-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.hi-express-status-none {
    color: #999;
}

.hi-express-status-pending {
    background: #fff3cd;
    color: #856404;
}

.hi-express-status-picked_up {
    background: #d1ecf1;
    color: #0c5460;
}

.hi-express-status-in_transit {
    background: #cce5ff;
    color: #004085;
}

.hi-express-status-out_for_delivery {
    background: #d4edda;
    color: #155724;
}

.hi-express-status-delivered {
    background: #28a745;
    color: white;
}

.hi-express-status-returned {
    background: #f8d7da;
    color: #721c24;
}

.hi-express-status-cancelled {
    background: #6c757d;
    color: white;
}

/* Responsive */
@media (max-width: 1200px) {
    .hi-express-settings {
        flex-direction: column;
    }

    .hi-express-content,
    .hi-express-sidebar {
        width: 100%;
        min-width: auto;
    }
}

/* Contact & Info Card Styles */
.hi-express-info {
    border-left: 4px solid #1C76BC;
}

.hi-express-promo h3 {
    color: #1C76BC;
    font-size: 18px;
    margin-top: 5px;
    line-height: 1.3;
}

.hi-express-promo p {
    font-size: 14px;
    line-height: 1.5;
    color: #555;
    margin: 10px 0 20px;
}

.hi-express-contact-section h4,
.hi-express-social-section h4 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #8c8f94;
    margin: 20px 0 10px;
}

.contact-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.contact-links li {
    margin-bottom: 8px;
}

.contact-links a {
    text-decoration: none;
    color: #1d2327;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    transition: color 0.2s;
}

.contact-links a:hover {
    color: #1C76BC;
}

.contact-links .dashicons {
    color: #1C76BC;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.social-icons {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f0f0f1;
    color: #50575e;
    text-decoration: none;
    transition: all 0.2s ease;
}

.social-icon:hover {
    background: #1C76BC;
    color: white;
    transform: translateY(-2px);
}

.social-icon.facebook:hover {
    background: #1877F2;
}

.social-icon.instagram:hover {
    background: #E4405F;
}

.social-icon.tiktok:hover {
    background: #000000;
}

.social-icon.linkedin:hover {
    background: #0A66C2;
}

.social-icon .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.hi-express-more-info .button {
    width: 100%;
    text-align: center;
    padding: 6px 0 !important;
    font-weight: 500 !important;
}

/* Webhook UI Elements */
.hi-express-form-group {
    margin-bottom: 20px;
}

.hi-express-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1d2327;
}

.hi-express-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.hi-express-input-group input[readonly] {
    background-color: #f0f0f1;
    cursor: default;
    border-color: #dcdcde;
    flex: 1;
}

#hi-express-webhook-status {
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.4;
}

#hi-express-webhook-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

#hi-express-webhook-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.hi-express-badge.success {
    background: #28a745;
    color: white;
}

.hi-express-badge.warning {
    background: #ffc107;
    color: #212529;
}

.hi-express-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.hi-express-card-header h3 {
    margin: 0;
}

/* Bulk Action Loader */
.hi-express-bulk-loading {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.85);
    z-index: 999999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    text-align: center;
}

.hi-express-bulk-loading .hi-express-spinner {
    width: 60px;
    height: 60px;
    border: 6px solid #f3f3f3;
    border-top: 6px solid #1C76BC;
    border-radius: 50%;
    animation: hi-express-spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes hi-express-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.hi-express-bulk-loading p {
    font-size: 20px;
    font-weight: 600;
    color: #1C76BC;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.hi-express-bulk-loading .sub-text {
    font-size: 14px;
    color: #666;
    margin-top: 5px;
}

/* Setup Checklist */
.hi-express-setup-checklist {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    border-left: 5px solid #1C76BC;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.hi-express-setup-checklist h2 {
    margin-top: 0;
    color: #1C76BC;
    display: flex;
    align-items: center;
    gap: 10px;
}

.checklist-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.checklist-item {
    display: flex;
    gap: 15px;
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #eee;
    transition: transform 0.2s;
}

.checklist-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.step-number {
    background: #1C76BC;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    flex-shrink: 0;
}

.step-content h4 {
    margin: 0 0 5px;
    font-size: 14px;
    color: #1d2327;
}

.step-content p {
    margin: 0;
    font-size: 13px;
    color: #646970;
    line-height: 1.4;
}

/* RTL Support */
.rtl .hi-express-setup-checklist {
    border-left: none;
    border-right: 5px solid #1C76BC;
    text-align: right;
}

.rtl .hi-express-setup-checklist h2,
.rtl .checklist-item {
    text-align: right;
}

.rtl .checklist-item {
    flex-direction: row-reverse;
}

.rtl .hi-express-badge {
    margin-left: 0 !important;
    margin-right: 5px !important;
}
/* Disabled Sections */
.hi-express-disabled-section {
    opacity: 0.5;
    pointer-events: none;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.hi-express-disabled-section::before {
    content: "Connect API Key to Enable";
    position: absolute;
    top: 10px;
    right: 15px;
    background: #f0f0f1;
    color: #646970;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    z-index: 10;
    border: 1px solid #dcdcde;
}

.rtl .hi-express-disabled-section::before {
    right: auto;
    left: 15px;
}

/* ==========================================================================
   Documentation Page
   ========================================================================== */

.hi-express-docs-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    width: 100%;
    align-items: flex-start;
}

.hi-express-docs-toc {
    width: 260px;
    flex-shrink: 0;
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border-left: 4px solid #1C76BC;
    position: sticky;
    top: 50px;
}

.hi-express-docs-toc h3 {
    margin: 0 0 12px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #646970;
}

.hi-express-docs-toc ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.hi-express-docs-toc li {
    margin: 0;
}

.hi-express-docs-toc a {
    display: block;
    padding: 6px 8px;
    border-radius: 6px;
    text-decoration: none;
    color: #1d2327;
    font-size: 13px;
    line-height: 1.4;
}

.hi-express-docs-toc a:hover,
.hi-express-docs-toc a:focus {
    background: #e6f0f7;
    color: #1C76BC;
}

.hi-express-docs-cta {
    margin-top: 15px !important;
    width: 100%;
    text-align: center;
}

.hi-express-docs-content {
    flex: 1;
    min-width: 480px;
}

.hi-express-docs-content .hi-express-card {
    margin-bottom: 20px;
    scroll-margin-top: 50px;
}

.hi-express-docs-content .hi-express-card h3 {
    margin: 22px 0 8px;
    font-size: 15px;
    color: #1d2327;
}

.hi-express-docs-content p {
    font-size: 14px;
    line-height: 1.7;
    color: #3c434a;
}

.hi-express-docs-list {
    margin: 10px 0 0 18px;
    list-style: disc;
}

.hi-express-docs-list li {
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.6;
    color: #3c434a;
}

.hi-express-docs-steps {
    counter-reset: hi-express-step;
    list-style: none;
    margin: 15px 0 0;
    padding: 0;
}

.hi-express-docs-steps li {
    counter-increment: hi-express-step;
    position: relative;
    padding: 0 0 16px 42px;
    margin: 0;
    border-left: 2px solid #e6f0f7;
}

.hi-express-docs-steps li:last-child {
    border-left-color: transparent;
    padding-bottom: 0;
}

.hi-express-docs-steps li::before {
    content: counter(hi-express-step);
    position: absolute;
    left: -15px;
    top: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #1C76BC;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hi-express-docs-steps li strong {
    display: block;
    font-size: 14px;
    color: #1d2327;
    margin-bottom: 2px;
}

.hi-express-docs-steps li span {
    display: block;
    font-size: 13px;
    line-height: 1.6;
    color: #646970;
}

.hi-express-docs-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    font-size: 13px;
}

.hi-express-docs-table th,
.hi-express-docs-table td {
    padding: 10px 12px;
    border: 1px solid #e2e4e7;
    text-align: left;
    vertical-align: top;
    line-height: 1.6;
}

.hi-express-docs-table thead th {
    background: #f6f7f7;
    font-weight: 600;
    color: #1d2327;
}

.hi-express-docs-table tbody th {
    background: #fafafa;
    font-weight: 600;
    width: 32%;
}

.hi-express-docs-code {
    background: #1d2327;
    color: #e6f0f7;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.6;
    margin: 12px 0 0;
}

.hi-express-docs-code code {
    background: none;
    color: inherit;
    padding: 0;
    font-size: inherit;
}

.hi-express-docs-note {
    background: #fff8e5;
    border-left: 4px solid #ffc107;
    padding: 12px 15px;
    border-radius: 0 6px 6px 0;
    margin-top: 15px !important;
    font-size: 13px !important;
}

.hi-express-docs .hi-express-input-group {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.hi-express-docs .hi-express-input-group input[type="text"] {
    flex: 1;
    min-width: 260px;
}

@media screen and (max-width: 960px) {

    .hi-express-docs-toc {
        width: 100%;
        position: static;
    }

    .hi-express-docs-content {
        min-width: 100%;
    }
}

.hi-express-header-actions {
    margin: 15px 0 0;
}

.hi-express-header-actions .button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.hi-express-header-actions .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Documentation — language switcher */
.hi-express-lang-switch {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
}

.hi-express-lang-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #646970;
}

.hi-express-lang-switch a {
    padding: 5px 14px;
    border: 1px solid #dcdcde;
    border-radius: 20px;
    text-decoration: none;
    color: #1d2327;
    font-size: 13px;
    line-height: 1.6;
}

.hi-express-lang-switch a:hover {
    border-color: #1C76BC;
    color: #1C76BC;
}

.hi-express-lang-switch a.is-active {
    background: #1C76BC;
    border-color: #1C76BC;
    color: #fff;
    font-weight: 600;
}

/* Documentation — RTL */
.hi-express-docs-rtl {
    direction: rtl;
    text-align: right;
}

.hi-express-docs-rtl .hi-express-docs-toc {
    border-left: none;
    border-right: 4px solid #1C76BC;
}

.hi-express-docs-rtl .hi-express-docs-table th,
.hi-express-docs-rtl .hi-express-docs-table td {
    text-align: right;
}

.hi-express-docs-rtl .hi-express-docs-list {
    margin-left: 0;
    margin-right: 18px;
}

.hi-express-docs-rtl .hi-express-docs-steps li {
    padding: 0 42px 16px 0;
    border-left: none;
    border-right: 2px solid #e6f0f7;
}

.hi-express-docs-rtl .hi-express-docs-steps li:last-child {
    border-right-color: transparent;
}

.hi-express-docs-rtl .hi-express-docs-steps li::before {
    left: auto;
    right: -15px;
}

.hi-express-docs-rtl .hi-express-docs-note {
    border-left: none;
    border-right: 4px solid #ffc107;
    border-radius: 6px 0 0 6px;
}

.hi-express-docs-rtl .hi-express-card {
    border-left: none;
}

/* Code samples and URLs stay left-to-right inside the RTL page */
.hi-express-docs-rtl .hi-express-docs-code,
.hi-express-docs-rtl input[dir="ltr"],
.hi-express-docs-rtl a[dir="ltr"] {
    direction: ltr;
    text-align: left;
}

.hi-express-docs-rtl .contact-links a {
    justify-content: flex-end;
}

/* Arabic reads better with a little more line height */
.hi-express-docs-rtl p,
.hi-express-docs-rtl .hi-express-docs-list li,
.hi-express-docs-rtl .hi-express-docs-steps li span {
    line-height: 1.9;
}

/* ==========================================================================
   Support Ticket System Styles
   ========================================================================== */

.hi-express-tickets-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

.tickets-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.tickets-title {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tickets-count-badge {
    background: #e0f2fe;
    color: #0369a1;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 12px;
}

.tickets-list-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hi-express-ticket-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transition: background 0.15s ease;
}

.hi-express-ticket-item:hover {
    background: #f1f5f9;
}

.ticket-item-main {
    flex: 1;
    min-width: 0;
}

.ticket-item-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.ticket-item-id {
    font-weight: 700;
    font-size: 12px;
    color: #64748b;
}

.ticket-item-title {
    font-weight: 600;
    font-size: 13px;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ticket-item-meta {
    font-size: 11px;
    color: #64748b;
    display: flex;
    gap: 10px;
}

.ticket-status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.ticket-status-new {
    background: #e0f2fe;
    color: #0284c7;
}

.ticket-status-in_progress,
.ticket-status-pending {
    background: #fef3c7;
    color: #b45309;
}

.ticket-status-closed {
    background: #f1f5f9;
    color: #475569;
}

/* Modals */
.hi-express-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 100050;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hi-express-modal[style*="display: block"] {
    display: flex !important;
}

.hi-express-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(2px);
}

.hi-express-modal-dialog {
    position: relative;
    margin: auto;
    width: 90%;
    max-width: 540px;
    max-height: 90vh;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: hiExpressModalFadeIn 0.2s ease-out;
}

.hi-express-modal-lg {
    max-width: 720px;
}

@keyframes hiExpressModalFadeIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

.hi-express-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
}

.hi-express-modal-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
}

.hi-express-ticket-submeta {
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #64748b;
}

.hi-express-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hi-express-status-select {
    font-size: 12px;
    padding: 2px 8px;
    height: 30px;
}

.hi-express-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
}

.hi-express-modal-close:hover {
    color: #0f172a;
}

.hi-express-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.hi-express-form-group {
    margin-bottom: 16px;
}

.hi-express-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 13px;
    color: #334155;
}

.hi-express-form-group .required {
    color: #ef4444;
}

.hi-express-modal-footer {
    padding: 14px 20px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Chat & Conversation */
.hi-express-ticket-card {
    background: #f1f5f9;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 16px;
}

.ticket-card-header {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
}

.ticket-card-body {
    font-size: 13px;
    line-height: 1.6;
    color: #1e293b;
    white-space: pre-wrap;
}

.ticket-attachment {
    margin-top: 8px;
}

.ticket-attachment a.ticket-attachment-img-link {
    display: inline-block;
    padding: 0;
    background: transparent;
    border: none;
}

.ticket-attachment a.ticket-attachment-img-link img {
    max-width: 220px;
    max-height: 200px;
    border-radius: 6px;
    object-fit: contain;
    margin-top: 4px;
    display: block;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ticket-attachment a.ticket-attachment-img-link:hover img {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.ticket-attachment a.ticket-file-link,
.ticket-attachment a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #0369a1;
    text-decoration: none;
    margin-top: 4px;
    transition: background 0.15s ease, color 0.15s ease;
}

.ticket-attachment a.ticket-file-link:hover,
.ticket-attachment a:hover {
    background: #f1f5f9;
    color: #0284c7;
}

.hi-express-price-change-card {
    background: #fffbeb;
    border: 1px solid #fef3c7;
    border-left: 4px solid #f59e0b;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 16px;
}

.price-change-header {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #92400e;
    margin-bottom: 6px;
}

.price-change-body .price-row {
    font-size: 13px;
    display: flex;
    gap: 12px;
    margin-bottom: 4px;
}

.price-change-body .price-reason {
    font-size: 12px;
    color: #78350f;
    font-style: italic;
}

.hi-express-comments-timeline {
    margin-top: 16px;
}

.timeline-title {
    margin: 0 0 12px 0;
    font-size: 13px;
    font-weight: 700;
    color: #334155;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 280px;
    overflow-y: auto;
    padding-right: 4px;
}

.hi-express-comment-bubble {
    padding: 10px 14px;
    border-radius: 10px;
    max-width: 85%;
    font-size: 13px;
    line-height: 1.5;
}

.comment-from-merchant {
    align-self: flex-end;
    background: #e0f2fe;
    border: 1px solid #bae6fd;
    color: #0369a1;
}

.comment-from-support {
    align-self: flex-start;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #1e293b;
}

.comment-from-driver {
    align-self: flex-start;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.comment-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 11px;
    margin-bottom: 4px;
    opacity: 0.85;
}

.comment-internal-badge {
    font-size: 10px;
    font-weight: normal;
    background: #fef3c7;
    color: #92400e;
    padding: 1px 6px;
    border-radius: 4px;
    margin-inline-start: 6px;
    display: inline-block;
    vertical-align: middle;
}

.comment-body {
    white-space: pre-wrap;
    word-break: break-word;
}

.reply-input-box {
    margin-top: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px;
}

.reply-input-box textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 8px;
    font-size: 13px;
    resize: vertical;
}

.reply-actions-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.attachment-label {
    cursor: pointer;
    font-size: 12px;
    color: #64748b;
}

.attachment-label:hover {
    color: #0f172a;
}

.reply-submit-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.driver-private-label {
    font-size: 12px;
    color: #64748b;
}

/* Dedicated Page Toolbar */
.hi-express-tickets-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.hi-express-filter-tabs {
    display: flex;
    gap: 6px;
}

.hi-express-tab-btn {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
}

.hi-express-tab-btn:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

.hi-express-tab-btn.active {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
}

.hi-express-search-box {
    display: flex;
    gap: 6px;
}

.hi-express-search-box input {
    height: 32px;
    width: 240px;
}

.hi-express-pagination-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}


.timeline-content .status-attachment img {
  display: block;
  margin-top: 6px;
  max-width: 240px;
  max-height: 180px;
  border-radius: 8px;
  border: 1px solid #dcdfe4;
  object-fit: cover;
}
