/* Allocation Requests: the pending-requests list (AllocationRequests.razor)
   and its per-JMDO review screen (AllocationRequestReview.razor) share this
   one stylesheet and the .alreq-page scope - see FieldDashboard.css /
   TasksAllocation.css for why every selector here is prefixed (this
   stylesheet loads globally alongside every other page's). */

.alreq-page {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #1f2937;
}

.alreq-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    padding: 0;
    margin-bottom: 14px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
}

    .alreq-back-link:hover {
        color: #111827;
        text-decoration: underline;
    }

.alreq-title {
    margin: 0 0 6px;
    font-size: 1.6rem;
    font-weight: 700;
    color: #111827;
}

.alreq-subtitle {
    margin: 0 0 1.25rem;
    font-size: 0.92rem;
    color: #6b7280;
}

.alreq-notice-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    color: #4338ca;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.5;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

    .alreq-notice-banner i {
        flex-shrink: 0;
        margin-top: 2px;
    }

.alreq-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.4rem 1.6rem;
    margin-bottom: 20px;
}

.alreq-card-title {
    margin: 0 0 1.1rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: #111827;
}

/* ---------- Dealer Tasks table ---------- */
.alreq-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1.25rem;
}

.alreq-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

    .alreq-table th {
        text-align: left;
        font-size: 0.85rem;
        font-weight: 700;
        color: #111827;
        padding: 0.75rem;
        border-bottom: 1px solid #e5e7eb;
        white-space: nowrap;
    }

    .alreq-table th:first-child,
    .alreq-table td:first-child {
        padding-left: 0;
    }

    .alreq-table td {
        padding: 0.9rem 0.75rem;
        border-bottom: 1px solid #f1f5f9;
        font-size: 0.9rem;
        color: #111827;
        vertical-align: middle;
    }

    .alreq-table tr:last-child td {
        border-bottom: none;
    }

.alreq-task-code {
    font-weight: 700;
    color: #111827;
}

.alreq-task-sub {
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 2px;
}

.alreq-type-pill {
    display: inline-block;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: 12px;
    padding: 3px 10px;
}

/* ---------- Pending-requests list (AllocationRequests.razor) ---------- */
.alreq-list-card {
    padding: 0.5rem 1.5rem;
}

.alreq-list-table th,
.alreq-list-table td {
    white-space: nowrap;
}

.alreq-jmdo-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
}

.alreq-avatar {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #15803d;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.alreq-jmdo-name {
    font-weight: 700;
    color: #111827;
}

.alreq-jmdo-sub {
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 2px;
}

.alreq-btn-review {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #4f46e5;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.55rem 1.1rem;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
}

    .alreq-btn-review:hover {
        background: #4338ca;
    }

.alreq-icon-btn-danger {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid #fecaca;
    background: #fff;
    color: #dc2626;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

    .alreq-icon-btn-danger:hover {
        background: #fef2f2;
    }

.alreq-add-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 6px;
}

.alreq-select {
    width: 100%;
    max-width: 460px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 0.65rem 0.9rem;
    font-size: 0.92rem;
    color: #111827;
    outline: none;
}

    .alreq-select:focus {
        border-color: #4f46e5;
    }

.alreq-assign-select {
    max-width: 180px;
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
}

.alreq-add-row {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    flex-wrap: wrap;
}

.alreq-add-field {
    display: flex;
    flex-direction: column;
    flex: 1 1 220px;
    min-width: 0;
}

.alreq-add-field-date {
    flex: 0 1 160px;
}

    .alreq-add-row .alreq-select {
        max-width: 320px;
        width: auto;
    }

    .alreq-add-field .alreq-select {
        max-width: none;
        width: 100%;
    }

.alreq-date-select {
    max-width: 160px;
}

.alreq-btn-add {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #15803d;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.65rem 1.2rem;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

    .alreq-btn-add:hover {
        background: #166534;
    }

/* ---------- Today's Targets / MD Programs ---------- */
.alreq-two-col {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

    .alreq-two-col .alreq-card {
        margin-bottom: 0;
    }

.alreq-target-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.1rem 1.5rem;
}

.alreq-field-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 6px;
}

.alreq-input {
    width: 100%;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 0.65rem 0.9rem;
    font-size: 0.92rem;
    color: #111827;
    outline: none;
}

    .alreq-input:focus {
        border-color: #4f46e5;
    }

.alreq-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 1.25rem;
}

.alreq-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #eef2ff;
    color: #4338ca;
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: 14px;
    padding: 5px 8px 5px 12px;
}

.alreq-chip-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4338ca;
    flex-shrink: 0;
}

.alreq-chip-remove {
    background: none;
    border: none;
    color: #4338ca;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
}

    .alreq-chip-remove:hover {
        color: #312e81;
    }

.alreq-chip-empty {
    font-size: 0.85rem;
    color: #9ca3af;
}

/* ---------- Summary / approve bar ---------- */
.alreq-summary-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.1rem 1.5rem;
}

.alreq-summary-text {
    font-size: 0.85rem;
    color: #6b7280;
    flex: 1 1 320px;
    min-width: 0;
}

.alreq-btn-approve {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #4f46e5;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.7rem 1.3rem;
    font-weight: 700;
    font-size: 0.92rem;
    cursor: pointer;
    white-space: nowrap;
}

    .alreq-btn-approve:hover {
        background: #4338ca;
    }

/* ---------- Tablet (768px - 1199.98px) ---------- */
@media (min-width: 768px) and (max-width: 1199.98px) {
    .alreq-two-col {
        grid-template-columns: 1fr;
    }
}

/* ---------- Phone (<= 767.98px) ---------- */
@media (max-width: 767.98px) {
    .alreq-page {
        padding-top: 12px !important;
        padding-bottom: calc(16px + var(--safe-bottom, 0px)) !important;
    }

    .alreq-title {
        font-size: 1.25rem;
    }

    .alreq-card {
        padding: 1.1rem 1.1rem;
    }

    .alreq-two-col {
        grid-template-columns: 1fr;
    }

    .alreq-target-grid {
        grid-template-columns: 1fr;
    }

    .alreq-select,
    .alreq-input {
        font-size: 16px; /* prevents iOS zoom on focus */
    }

    .alreq-select {
        max-width: none;
    }

    .alreq-summary-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .alreq-btn-approve {
        justify-content: center;
        min-height: 44px;
    }

    .alreq-back-link {
        min-height: 44px;
    }

    .alreq-list-card {
        padding: 0.5rem 1rem;
    }

    .alreq-btn-review {
        min-height: 40px;
        width: 100%;
        justify-content: center;
    }

    /* Tables become a stack of cards, one per row, instead of a
       horizontally-scrolling grid - the header row is dropped and each
       remaining cell prints its own column name (from data-label) next to
       its value. The first cell (task/JMDO identity) and the last
       (actions) opt out via their own modifier classes since they read
       better as a card heading / full-width footer than a label:value row. */
    .alreq-table-scroll {
        overflow-x: visible;
    }

    .alreq-table {
        min-width: 0;
    }

    .alreq-table thead {
        display: none;
    }

    .alreq-table,
    .alreq-table tbody,
    .alreq-table tr,
    .alreq-table td {
        display: block;
        width: 100%;
    }

    .alreq-table tr {
        border: 1px solid #e5e7eb;
        border-radius: 10px;
        padding: 0.9rem 1rem;
        margin-bottom: 12px;
    }

    .alreq-table tr:last-child {
        margin-bottom: 0;
    }

    .alreq-table td {
        border-bottom: none !important;
        padding: 6px 0;
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        text-align: right;
    }

    .alreq-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #6b7280;
        text-align: left;
        flex-shrink: 0;
    }

    .alreq-table td.alreq-cell-header {
        display: block;
        text-align: left;
        padding-bottom: 10px;
        margin-bottom: 4px;
        border-bottom: 1px solid #f1f5f9 !important;
    }

    .alreq-table td.alreq-cell-actions {
        display: flex;
        justify-content: flex-end;
        margin-top: 4px;
    }

    .alreq-assign-select,
    .alreq-date-select {
        max-width: none;
    }

    .alreq-add-row {
        flex-direction: column;
        align-items: stretch;
    }

    .alreq-add-field-date {
        flex-basis: auto;
    }

    .alreq-btn-add {
        justify-content: center;
        min-height: 44px;
    }
}
