﻿/* ═══════════════════════════════════════════════════════════════
   trips-panels.css  —  shared styles for all trip panel components
   Role accents:
     Admin   → indigo  #4f46e5 / #7c3aed
     Shipper → blue    #2563eb / #4f46e5
     Carrier → teal    #0d9488 / #059669
   Add to wwwroot/css/ and reference in index.html
   ═══════════════════════════════════════════════════════════════ */

/* ── Reset old panel backgrounds ────────────────────────────── */
.page-wrap {
    background: #f8fafc !important;
    min-height: 100vh;
}

.page-header {
    display: none !important;
}

/* ── Panel shell ─────────────────────────────────────────────── */
.tp-shell {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem 1.75rem;
    max-width: 175  0px;
    margin: 0 auto;
}

/* ── Header card ─────────────────────────────────────────────── */
.tp-hdr {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 1.5rem 1.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.tp-hdr-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.tp-hdr-meta {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
    margin-top: .85rem;
}

.tp-hdr-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-shrink: 0;
}

.tp-bread {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .72rem;
    color: #94a3b8;
    font-weight: 500;
    letter-spacing: .03em;
    text-transform: uppercase;
    margin-bottom: .4rem;
}

.tp-bread-sep {
    opacity: .4;
}

.tp-title-row {
    display: flex;
    align-items: center;
    gap: .85rem;
}

.tp-title-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
    flex-shrink: 0;
}

.tp-title-icon--admin {
    background: linear-gradient(135deg,#4f46e5,#7c3aed);
    box-shadow: 0 2px 8px rgba(79,70,229,.35);
}

.tp-title-icon--shipper {
    background: linear-gradient(135deg,#2563eb,#4f46e5);
    box-shadow: 0 2px 8px rgba(37,99,235,.35);
}

.tp-title-icon--carrier {
    background: linear-gradient(135deg,#0d9488,#059669);
    box-shadow: 0 2px 8px rgba(13,148,136,.35);
}

.tp-title-text h1 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -.02em;
    margin: 0;
}

.tp-title-text p {
    font-size: .8rem;
    color: #475569;
    margin: .15rem 0 0;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.tp-live {
    display: inline-flex;
    align-items: center;
    gap: .28rem;
    padding: .2rem .55rem;
    border-radius: 99px;
    font-size: .67rem;
    font-weight: 600;
    background: #e0e7ff;
    color: #4338ca;
}

    .tp-live i {
        font-size: .6rem;
    }

.tp-scope {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .22rem .65rem;
    border-radius: 99px;
    font-size: .67rem;
    font-weight: 600;
    border: 1px solid #e2e8f0;
    color: #475569;
}

.tp-scope--admin {
    background: #eef2ff;
    border-color: #c7d2fe;
    color: #4338ca;
}

.tp-scope--shipper {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.tp-scope--carrier {
    background: #f0fdfa;
    border-color: #99f6e4;
    color: #0f766e;
}

.tp-scope--bids {
    background: #fffbeb;
    border-color: #fcd34d;
    color: #92400e;
}

.tp-scope--access {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

/* Role accent top border */
.tp-hdr--admin {
    border-top: 3px solid #4f46e5;
}

.tp-hdr--shipper {
    border-top: 3px solid #2563eb;
}

.tp-hdr--carrier {
    border-top: 3px solid #0d9488;
}

/* ── Section label ───────────────────────────────────────────── */
.tp-sec {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-size: .7rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: -.25rem;
}

    .tp-sec::after {
        content: '';
        flex: 1;
        height: 1px;
        background: #e2e8f0;
    }

    .tp-sec i {
        font-size: .65rem;
    }

.tp-sec--admin i {
    color: #4f46e5;
}

.tp-sec--shipper i {
    color: #2563eb;
}

.tp-sec--carrier i {
    color: #0d9488;
}

/* ── Stat cards ──────────────────────────────────────────────── */
.tp-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(150px,1fr));
    gap: .85rem;
}

.tp-stat {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1.1rem 1.15rem;
    display: flex;
    flex-direction: column;
    gap: .4rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    transition: all .18s ease;
    position: relative;
    overflow: hidden;
    cursor: default;
}

    .tp-stat::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: var(--sc, #4f46e5);
        border-radius: 14px 14px 0 0;
    }

    .tp-stat:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0,0,0,.08);
        border-color: var(--sc, #4f46e5);
    }

    .tp-stat.clickable {
        cursor: pointer;
    }

.tp-stat--active-bids {
    background: #fffbeb !important;
}

.tp-stat-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    flex-shrink: 0;
}

.tp-stat-num {
    font-size: 1.65rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -.03em;
    line-height: 1;
}

.tp-stat-lbl {
    font-size: .7rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* Skeleton stat card */
.tp-stat-sk {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1.1rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .55rem;
}

.tp-sk {
    background: linear-gradient(90deg,#f1f5f9 25%,#e2e8f0 50%,#f1f5f9 75%);
    background-size: 700px 100%;
    animation: tpShimmer 1.4s infinite linear;
    border-radius: 6px;
}

@keyframes tpShimmer {
    0% {
        background-position: -700px 0
    }

    100% {
        background-position: 700px 0
    }
}

/* ── Main panel card ─────────────────────────────────────────── */
.tp-panel {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    overflow: hidden;
}

/* ── Toolbar ─────────────────────────────────────────────────── */
.tp-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.1rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    background: linear-gradient(to bottom,#fcfcfd,#ffffff);
    flex-wrap: wrap;
    gap: .75rem;
}

.tp-toolbar-title {
    font-size: .92rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.tp-toolbar-count {
    font-weight: 400;
    color: #94a3b8;
    font-size: .82rem;
}

.tp-toolbar-right {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

/* ── Filter bar ──────────────────────────────────────────────── */
.tp-filters {
    display: flex;
    gap: .4rem;
    padding: .75rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    overflow-x: auto;
    background: #fafafa;
    scrollbar-width: none;
}

    .tp-filters::-webkit-scrollbar {
        display: none;
    }

.tp-f {
    border: 1px solid #e2e8f0;
    background: #ffffff;
    border-radius: 20px;
    padding: .3rem .75rem;
    font-size: .75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .18s ease;
    white-space: nowrap;
    color: #475569;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: .3rem;
}

    .tp-f:hover {
        border-color: #4f46e5;
        color: #4f46e5;
    }

    .tp-f.on--admin {
        background: #4f46e5;
        border-color: #4f46e5;
        color: #ffffff;
    }

    .tp-f.on--shipper {
        background: #2563eb;
        border-color: #2563eb;
        color: #ffffff;
    }

    .tp-f.on--carrier {
        background: #0d9488;
        border-color: #0d9488;
        color: #ffffff;
    }

.tp-f--bids {
    border-color: #fcd34d;
    color: #92400e;
    background: #fffbeb;
}

.tp-f--accept {
    border-color: #6ee7b7;
    color: #065f46;
    background: #ecfdf5;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.tp-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .45rem .9rem;
    border-radius: 10px;
    font-size: .78rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all .18s ease;
    white-space: nowrap;
    line-height: 1;
    font-family: inherit;
}

    .tp-btn:disabled {
        opacity: .5;
        cursor: not-allowed;
    }

.tp-btn--ghost {
    background: #fff;
    border-color: #e2e8f0;
    color: #1e293b;
}

    .tp-btn--ghost:hover:not(:disabled) {
        border-color: #94a3b8;
        background: #f8fafc;
    }

.tp-btn--admin {
    background: linear-gradient(135deg,#4f46e5,#7c3aed);
    color: #fff;
    box-shadow: 0 2px 6px rgba(79,70,229,.3);
}

    .tp-btn--admin:hover:not(:disabled) {
        opacity: .92;
    }

.tp-btn--shipper {
    background: linear-gradient(135deg,#2563eb,#4f46e5);
    color: #fff;
    box-shadow: 0 2px 6px rgba(37,99,235,.3);
}

    .tp-btn--shipper:hover:not(:disabled) {
        opacity: .92;
    }

.tp-btn--carrier {
    background: linear-gradient(135deg,#0d9488,#059669);
    color: #fff;
    box-shadow: 0 2px 6px rgba(13,148,136,.3);
}

    .tp-btn--carrier:hover:not(:disabled) {
        opacity: .92;
    }

.tp-btn--success {
    background: linear-gradient(135deg,#059669,#047857);
    color: #fff;
}

.tp-btn--warning {
    background: linear-gradient(135deg,#d97706,#b45309);
    color: #fff;
}

.tp-btn--danger {
    background: linear-gradient(135deg,#dc2626,#b91c1c);
    color: #fff;
}

.tp-btn--teal {
    background: linear-gradient(135deg,#0d9488,#0f766e);
    color: #fff;
}

.tp-btn--bids {
    background: #f5f3ff;
    color: #7c3aed;
    border: 1px solid #ddd6fe;
}

    .tp-btn--bids:hover:not(:disabled) {
        background: #ede9fe;
    }

.tp-btn--sm {
    font-size: .72rem;
    padding: .35rem .6rem;
    border-radius: 7px;
    margin-right: 3px;
}

/* ── Action banner ───────────────────────────────────────────── */
.tp-banner {
    padding: .85rem 1.25rem;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
}

.tp-banner-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
    flex-shrink: 0;
}

/* ── State box (empty / error) ───────────────────────────────── */
.tp-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3.5rem 2rem;
    text-align: center;
    gap: .6rem;
    color: #94a3b8;
}

.tp-state-ico {
    font-size: 2.75rem;
    opacity: .25;
    margin-bottom: .5rem;
}

.tp-state h5 {
    font-size: .95rem;
    font-weight: 600;
    color: #475569;
}

.tp-state p {
    font-size: .8rem;
    max-width: 320px;
    line-height: 1.6;
}

/* ── Access denied ───────────────────────────────────────────── */
.tp-denied {
    text-align: center;
    padding: 5rem 2rem;
    max-width: 480px;
    margin: 0 auto;
}

.tp-denied-ico {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #fef2f2;
    border: 1px solid #fecaca;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #dc2626;
    margin: 0 auto 1.25rem;
}

/* ── Bid badges ──────────────────────────────────────────────── */
.tp-bid-pending {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fcd34d;
    border-radius: 20px;
    font-size: .65rem;
    font-weight: 700;
    padding: .1rem .45rem;
    white-space: nowrap;
    margin-top: .25rem;
}

    .tp-bid-pending .pd {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: #f59e0b;
        flex-shrink: 0;
        animation: tpPd 1.6s ease-in-out infinite;
    }

@keyframes tpPd {
    0%,100% {
        opacity: 1;
        transform: scale(1)
    }

    50% {
        opacity: .45;
        transform: scale(.75)
    }
}

.tp-bid-accepted {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    background: #f0fdf4;
    color: #065f46;
    border: 1px solid #6ee7b7;
    border-radius: 20px;
    font-size: .65rem;
    font-weight: 700;
    padding: .1rem .45rem;
    white-space: nowrap;
    margin-top: .25rem;
}

.tp-bid-bubble {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    background: #f5f3ff;
    color: #7c3aed;
    border: 1px solid #ddd6fe;
    border-radius: 20px;
    font-size: .68rem;
    font-weight: 700;
    padding: .12rem .5rem;
    white-space: nowrap;
    line-height: 1.4;
}

.tp-accepted-badge {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #86efac;
    border-radius: 5px;
    font-size: .62rem;
    font-weight: 800;
    letter-spacing: .03em;
    padding: .1rem .4rem;
    text-transform: uppercase;
    margin-bottom: .2rem;
}

.tp-pulse {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
    animation: tpPd 1.6s ease-in-out infinite;
}

/* ── Status pill ─────────────────────────────────────────────── */
.tp-spill {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    border-radius: 20px;
    padding: .22rem .65rem;
    font-size: .7rem;
    font-weight: 600;
    white-space: nowrap;
}

    .tp-spill .dot {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        flex-shrink: 0;
    }

/* ── Stop badge ──────────────────────────────────────────────── */
.stop-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    font-size: .72rem;
    font-weight: 700;
    color: #475569;
}

/* ── Trip icon ───────────────────────────────────────────────── */
.tp-ico {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: .8rem;
    flex-shrink: 0;
    position: relative;
}

/* ── Loading overlay ─────────────────────────────────────────── */
.tp-overlay {
    position: fixed;
    inset: 0;
    background: rgba(248,250,252,.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    gap: .85rem;
}

.tp-overlay-spin {
    width: 36px;
    height: 36px;
    border: 3px solid #e2e8f0;
    border-top-color: #4f46e5;
    border-radius: 50%;
    animation: tpSpin .7s linear infinite;
}

@keyframes tpSpin {
    to {
        transform: rotate(360deg)
    }
}

/* ── Modal ───────────────────────────────────────────────────── */
.tp-modal-bg {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.tp-modal {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
    width: 100%;
    max-width: 480px;
    overflow: hidden;
    animation: tpMod .2s ease-out;
}

@keyframes tpMod {
    from {
        opacity: 0;
        transform: scale(.95)
    }

    to {
        opacity: 1;
        transform: scale(1)
    }
}

.tp-modal-hdr {
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #f1f5f9;
}

.tp-modal-title {
    font-size: .95rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: .5rem;
    color: #0f172a;
}

.tp-modal-body {
    padding: 1.25rem;
}

.tp-modal-foot {
    padding: 1rem 1.25rem;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: flex-end;
    gap: .5rem;
}

.tp-modal-close {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: #94a3b8;
}

    .tp-modal-close:hover {
        color: #0f172a;
    }

/* ── Form ────────────────────────────────────────────────────── */
.tp-lbl {
    font-size: .78rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: .3rem;
    display: block;
}

.tp-input {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: .55rem .75rem;
    font-size: .85rem;
    outline: none;
    background: #fff;
    color: #0f172a;
    font-family: inherit;
}

    .tp-input:focus {
        border-color: #4f46e5;
        box-shadow: 0 0 0 3px rgba(79,70,229,.1);
    }

    .tp-input.err {
        border-color: #dc2626;
    }

/* ── Toast ───────────────────────────────────────────────────── */
.tp-toast-wrap {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    width: 320px;
    animation: tpUp .3s ease-out;
}

@keyframes tpUp {
    from {
        opacity: 0;
        transform: translateY(8px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

.tp-toast {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .85rem 1rem;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0,0,0,.09);
    border: 1px solid transparent;
    background: #fff;
}

.tp-toast--success {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.tp-toast--info {
    border-color: #bfdbfe;
    background: #eff6ff;
}

.tp-toast--warning {
    border-color: #fde68a;
    background: #fffbeb;
}

.tp-toast--danger {
    border-color: #fecaca;
    background: #fef2f2;
}

.tp-toast-ico {
    font-size: .9rem;
    flex-shrink: 0;
    margin-top: .1rem;
}

.tp-toast--success .tp-toast-ico {
    color: #15803d;
}

.tp-toast--info .tp-toast-ico {
    color: #1d4ed8;
}

.tp-toast--warning .tp-toast-ico {
    color: #a16207;
}

.tp-toast--danger .tp-toast-ico {
    color: #b91c1c;
}

.tp-toast-title {
    font-size: .78rem;
    font-weight: 700;
    color: #0f172a;
}

.tp-toast-msg {
    font-size: .73rem;
    color: #475569;
    margin-top: .1rem;
}

.tp-toast-close {
    margin-left: auto;
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    font-size: .8rem;
}

/* Telerik grid overrides */
.tp-grid .k-grid {
    border: none !important;
    font-family: inherit !important;
    font-size: .82rem !important;
}

.tp-grid .k-grid-header {
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

    .tp-grid .k-grid-header th {
        font-size: .67rem !important;
        font-weight: 700 !important;
        text-transform: uppercase !important;
        letter-spacing: .06em !important;
        color: #94a3b8 !important;
        padding: .65rem 1rem !important;
    }

.tp-grid .k-grid td {
    padding: .75rem 1rem !important;
    border-bottom: 1px solid #f1f5f9 !important;
    vertical-align: middle !important;
}

.tp-grid .k-grid tr:hover td {
    background: #fafafa !important;
}

.tp-grid .k-pager-wrap {
    border-top: 1px solid #f1f5f9 !important;
    background: #f8fafc !important;
    font-size: .75rem !important;
}

/* Skeleton table */
.sk-tw {
    padding: 0 1.5rem 1.5rem;
}

.sk-th-row {
    display: grid;
    gap: .5rem;
    padding: .65rem .75rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 6px 6px 0 0;
}

.sk-th {
    height: 14px;
    border-radius: 4px;
}

.sk-row {
    display: grid;
    gap: .5rem;
    padding: .75rem;
    border-bottom: 1px solid #f1f5f9;
    align-items: center;
}

.sk-c {
    height: 20px;
    border-radius: 4px;
}

@media (max-width:768px) {
    .tp-shell {
        padding: 1rem;
        gap: 1rem;
    }

    .tp-hdr-top {
        flex-direction: column;
    }

    .tp-hdr-actions {
        flex-wrap: wrap;
    }

    .tp-stats {
        grid-template-columns: 1fr 1fr;
    }

    .tp-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .tp-toolbar-right {
        justify-content: flex-start;
    }
}
