/* POSTEX Partner Pages — unified with shipments / CRM identity */

.pxp-page {
    min-height: calc(100vh - 86px);
    padding: 24px;
    color: #f8fafc;
    max-width: 1280px;
    margin: 0 auto;
}

/* Hero */
.pxp-hero {
    border: 1px solid rgba(249, 115, 22, 0.28);
    background: linear-gradient(135deg, rgba(25, 27, 85, 0.92), rgba(19, 23, 50, 0.88) 48%, rgba(249, 115, 22, 0.16));
    border-radius: 18px;
    padding: 22px 24px;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

.pxp-hero-main { flex: 1; min-width: 240px; }

.pxp-hero-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.45rem;
    font-weight: 950;
    margin: 0 0 8px;
    color: #fff;
}

.pxp-hero-icon {
    color: #f97316;
    background: rgba(249, 115, 22, 0.14);
    border: 1px solid rgba(249, 115, 22, 0.28);
    width: 44px;
    height: 44px;
    border-radius: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.1rem;
}

.pxp-hero-icon.portal {
    background: rgba(165, 14, 21, 0.18);
    border-color: rgba(165, 14, 21, 0.35);
    color: #fb923c;
}

.pxp-hero-sub {
    margin: 0;
    color: rgba(226, 232, 240, 0.82);
    font-weight: 700;
    line-height: 1.75;
    max-width: 720px;
    font-size: 0.92rem;
}

.pxp-hero-sub a {
    color: #fb923c;
    font-weight: 800;
    text-decoration: none;
    border-bottom: 1px solid rgba(251, 146, 60, 0.4);
}

.pxp-hero-sub a:hover { color: #fed7aa; }

.pxp-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 850;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(15, 23, 42, 0.55);
    color: rgba(226, 232, 240, 0.9);
}

.pxp-hero-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Stats */
.pxp-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin: 18px 0;
}

.pxp-stat {
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(15, 23, 42, 0.72);
    border-radius: 16px;
    padding: 16px 18px;
    min-height: 96px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: border-color 0.18s ease, transform 0.18s ease;
}

.pxp-stat:hover {
    border-color: rgba(249, 115, 22, 0.35);
    transform: translateY(-1px);
}

.pxp-stat strong {
    display: block;
    font-size: 1.55rem;
    color: #fff;
    direction: ltr;
    text-align: right;
    line-height: 1.1;
}

.pxp-stat span {
    display: block;
    color: rgba(226, 232, 240, 0.72);
    font-weight: 800;
    font-size: 0.82rem;
    margin-top: 6px;
}

.pxp-stat i {
    color: #f97316;
    font-size: 0.85rem;
    margin-inline-start: 4px;
}

.pxp-stat.accent strong { color: #fb923c; }

/* Tabs */
.pxp-tabs {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0 0 18px;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, 0.20);
    background: rgba(15, 23, 42, 0.64);
    border-radius: 16px;
}

.pxp-tab {
    border: 1px solid rgba(148, 163, 184, 0.26);
    background: rgba(30, 41, 59, 0.72);
    color: #e5e7eb;
    border-radius: 999px;
    min-height: 42px;
    padding: 8px 16px;
    font-family: var(--font);
    font-weight: 950;
    font-size: 0.88rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.pxp-tab:hover {
    transform: translateY(-1px);
    border-color: rgba(249, 115, 22, 0.52);
    background: rgba(249, 115, 22, 0.16);
}

.pxp-tab.active {
    color: #111827;
    border-color: rgba(249, 115, 22, 0.78);
    background: linear-gradient(135deg, #fb923c, #fed7aa);
}

.pxp-tab i { color: #fb923c; }
.pxp-tab.active i { color: #111827; }

.pxp-tab-count {
    direction: ltr;
    min-width: 22px;
    min-height: 22px;
    padding: 2px 7px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: rgba(15, 23, 42, 0.84);
    font-size: 0.74rem;
}

.pxp-tab.active .pxp-tab-count {
    background: rgba(17, 24, 39, 0.88);
}

/* Panel */
.pxp-panel {
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: rgba(15, 23, 42, 0.78);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
}

.pxp-panel-head {
    padding: 16px 18px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.58);
}

.pxp-panel-head h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 950;
    color: #f8fafc;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pxp-panel-head h3 i { color: #f97316; }

.pxp-panel-body { padding: 16px; }

/* Toolbar */
.pxp-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.58);
}

.pxp-toolbar select,
.pxp-field input,
.pxp-field select,
.pxp-field textarea,
.pxp-card select {
    min-height: 44px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: #111827;
    color: #ffffff;
    font-family: var(--font);
    padding: 10px 12px;
    outline: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    width: 100%;
    font-weight: 700;
    font-size: 0.88rem;
}

.pxp-toolbar select { max-width: 280px; width: auto; min-width: 200px; }

.pxp-toolbar select option,
.pxp-field select option {
    background: #111827;
    color: #fff;
}

.pxp-field textarea { min-height: 80px; resize: vertical; }

.pxp-field label {
    display: block;
    font-size: 0.78rem;
    color: rgba(226, 232, 240, 0.72);
    margin-bottom: 6px;
    font-weight: 800;
}

/* Buttons */
.pxp-btn {
    border-radius: 12px;
    min-height: 44px;
    padding: 10px 16px;
    font-family: var(--font);
    font-weight: 950;
    font-size: 0.86rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
    border: 1px solid transparent;
    white-space: nowrap;
}

.pxp-btn:hover { transform: translateY(-1px); }
.pxp-btn:active { transform: translateY(0); }

.pxp-btn-primary {
    border-color: rgba(249, 115, 22, 0.42);
    background: linear-gradient(135deg, #f97316, #fb923c);
    color: #111827;
    box-shadow: 0 12px 28px rgba(249, 115, 22, 0.24);
}

.pxp-btn-secondary {
    border-color: rgba(148, 163, 184, 0.28);
    background: rgba(30, 41, 59, 0.82);
    color: #e5e7eb;
}

.pxp-btn-secondary:hover {
    border-color: rgba(249, 115, 22, 0.45);
    background: rgba(249, 115, 22, 0.12);
}

.pxp-btn-ghost {
    border-color: rgba(148, 163, 184, 0.22);
    background: transparent;
    color: rgba(226, 232, 240, 0.88);
    min-height: 40px;
    padding: 8px 12px;
}

.pxp-btn-success {
    border-color: rgba(34, 197, 94, 0.35);
    background: rgba(22, 101, 52, 0.35);
    color: #86efac;
}

.pxp-btn-danger {
    border-color: rgba(239, 68, 68, 0.35);
    background: rgba(127, 29, 29, 0.35);
    color: #fca5a5;
}

.pxp-btn-icon {
    min-width: 44px;
    padding: 10px;
}

/* List & cards */
.pxp-list {
    display: grid;
    gap: 12px;
    padding: 16px;
}

.pxp-card {
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(17, 24, 39, 0.86);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    transition: border-color 0.16s ease, background 0.16s ease;
}

.pxp-card:hover {
    border-color: rgba(249, 115, 22, 0.35);
}

.pxp-card.selected {
    border-color: rgba(249, 115, 22, 0.55);
    background: rgba(249, 115, 22, 0.08);
}

.pxp-card-main {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.pxp-card-main input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 4px;
    accent-color: #f97316;
    flex-shrink: 0;
    cursor: pointer;
}

.pxp-waybill {
    direction: ltr;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 1.02rem;
    font-weight: 950;
}

.pxp-waybill i { color: #f97316; }

.pxp-meta {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pxp-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(30, 41, 59, 0.72);
    color: rgba(248, 250, 252, 0.86);
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 850;
}

.pxp-pill i { color: #fb923c; font-size: 0.72rem; }

.pxp-pill.success {
    color: #86efac;
    border-color: rgba(34, 197, 94, 0.35);
    background: rgba(22, 101, 52, 0.22);
}

.pxp-pill.warning {
    color: #fde68a;
    border-color: rgba(234, 179, 8, 0.38);
    background: rgba(113, 63, 18, 0.22);
}

.pxp-pill.info {
    color: #93c5fd;
    border-color: rgba(59, 130, 246, 0.35);
    background: rgba(30, 58, 138, 0.22);
}

.pxp-pill.danger {
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.35);
    background: rgba(127, 29, 29, 0.22);
}

.pxp-card-side {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    min-width: 180px;
}

.pxp-card-side .pxp-btn { width: 100%; }

.pxp-card-time {
    font-size: 0.74rem;
    color: rgba(148, 163, 184, 0.85);
    font-weight: 700;
    direction: ltr;
    text-align: left;
}

.pxp-empty {
    text-align: center;
    color: rgba(226, 232, 240, 0.68);
    padding: 48px 20px;
    font-weight: 800;
}

.pxp-empty i {
    display: block;
    font-size: 2.2rem;
    color: rgba(249, 115, 22, 0.45);
    margin-bottom: 14px;
}

.pxp-empty p { margin: 0 0 6px; font-size: 1rem; }
.pxp-empty small { font-size: 0.82rem; font-weight: 700; opacity: 0.85; }

.pxp-loading {
    text-align: center;
    padding: 40px;
    color: rgba(226, 232, 240, 0.7);
    font-weight: 800;
}

.pxp-loading i {
    color: #f97316;
    margin-left: 8px;
    animation: pxp-spin 0.9s linear infinite;
}

@keyframes pxp-spin {
    to { transform: rotate(360deg); }
}

/* Form sections */
.pxp-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.pxp-form-grid .span-full { grid-column: 1 / -1; }

.pxp-divider {
    border: 0;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
    margin: 20px 0;
}

.pxp-section-title {
    margin: 0 0 14px;
    font-size: 0.95rem;
    font-weight: 950;
    color: #f8fafc;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pxp-section-title i { color: #f97316; }

/* Access / no permission */
.pxp-access {
    border: 1px solid rgba(249, 115, 22, 0.28);
    background: linear-gradient(135deg, rgba(25, 27, 85, 0.75), rgba(19, 23, 50, 0.82));
    border-radius: 18px;
    padding: 32px 28px;
    text-align: center;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
}

.pxp-access i {
    font-size: 2.5rem;
    color: #fb923c;
    margin-bottom: 16px;
}

.pxp-access p {
    margin: 0;
    color: rgba(226, 232, 240, 0.88);
    font-weight: 700;
    line-height: 1.8;
    max-width: 520px;
    margin-inline: auto;
}

.pxp-access a {
    color: #fb923c;
    font-weight: 900;
}

/* Company mini cards */
.pxp-company-grid {
    display: grid;
    gap: 12px;
}

.pxp-company-card {
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(17, 24, 39, 0.86);
    border-radius: 16px;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.pxp-company-name {
    font-size: 1rem;
    font-weight: 950;
    color: #fff;
}

.pxp-company-meta {
    margin-top: 6px;
    font-size: 0.78rem;
    color: rgba(148, 163, 184, 0.9);
    font-weight: 700;
}

@media (max-width: 760px) {
    .pxp-page { padding: 16px; }
    .pxp-form-grid { grid-template-columns: 1fr; }
    .pxp-toolbar select { max-width: 100%; width: 100%; }
    .pxp-card-side { min-width: 100%; }
}
