/* POSTEX Agent Portal — standalone login + dashboard */

.agent-body {
    min-height: 100vh;
    background: #050510;
    color: #f8fafc;
    font-family: var(--font, 'Cairo', sans-serif);
}

.agent-body .stars-wrap {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.agent-screen {
    display: none;
    position: relative;
    z-index: 1;
    min-height: 100vh;
}

.agent-screen.active { display: block; }

/* Login */
.agent-login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.agent-login-card {
    width: 100%;
    max-width: 420px;
    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) 55%, rgba(249, 115, 22, 0.12));
    border-radius: 22px;
    padding: 32px 28px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.agent-login-logo {
    text-align: center;
    margin-bottom: 24px;
}

.agent-login-logo img {
    height: 48px;
    margin-bottom: 12px;
}

.agent-login-logo h1 {
    margin: 0 0 6px;
    font-size: 1.35rem;
    font-weight: 950;
    color: #fff;
}

.agent-login-logo p {
    margin: 0;
    font-size: 0.88rem;
    color: rgba(226, 232, 240, 0.75);
    font-weight: 700;
}

.agent-login-card .pxp-field { margin-bottom: 14px; }

.agent-login-error {
    display: none;
    margin-bottom: 14px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(127, 29, 29, 0.35);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
    font-size: 0.82rem;
    font-weight: 800;
}

.agent-login-error.show { display: block; }

/* App header bar */
.agent-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 24px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 20;
}

.agent-topbar-user {
    font-size: 0.82rem;
    color: rgba(148, 163, 184, 0.95);
    font-weight: 750;
}

.agent-topbar-user strong {
    display: block;
    color: #fff;
    font-size: 0.95rem;
}

/* Bulk toolbar */
.agent-bulk-bar {
    display: none;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 12px 16px;
    margin: 0 0 12px;
    border: 1px solid rgba(249, 115, 22, 0.35);
    background: rgba(249, 115, 22, 0.1);
    border-radius: 14px;
}

.agent-bulk-bar.visible { display: flex; }

.agent-bulk-count {
    font-weight: 950;
    color: #fed7aa;
    font-size: 0.88rem;
    margin-inline-end: auto;
}

/* Modal */
.agent-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.65);
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.agent-modal.open { display: flex; }

.agent-modal-sheet {
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: rgba(15, 23, 42, 0.96);
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.agent-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.agent-modal-head h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 950;
    color: #fff;
}

.agent-modal-body {
    padding: 16px 18px;
    overflow-y: auto;
    flex: 1;
}

.agent-modal-foot {
    padding: 14px 18px;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.agent-assign-row {
    display: grid;
    grid-template-columns: 1fr minmax(160px, 180px);
    gap: 10px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    font-size: 0.82rem;
}

.agent-assign-row:last-child { border-bottom: 0; }

.agent-assign-row .pxp-waybill { font-size: 0.88rem; }

.agent-quick-assign {
    margin-bottom: 16px;
    padding: 14px;
    border-radius: 12px;
    background: rgba(17, 24, 39, 0.75);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.agent-quick-assign label {
    display: block;
    font-size: 0.78rem;
    font-weight: 800;
    color: rgba(148, 163, 184, 0.95);
    margin-bottom: 8px;
}

.agent-card-check {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    accent-color: #f97316;
    cursor: pointer;
    margin-top: 4px;
}

.pxp-card.selectable { cursor: pointer; }

.pxp-card.selectable .pxp-card-main { cursor: pointer; }

@media (max-width: 600px) {
    .agent-assign-row { grid-template-columns: 1fr; }
    .agent-topbar { padding: 12px 16px; }
}
