/* ==========================================================================
   Sluder CAD Portal — Frontend Styles
   ========================================================================== */

.sluder-portal { font-family: inherit; max-width: 900px; margin: 0 auto; padding: 20px 0; }

/* ── Order list ────────────────────────────────────────────────────────────── */
.sluder-order-list { list-style: none; margin: 0; padding: 0; }
.sluder-order-card {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.sluder-order-card:hover { border-color: #b8c8e0; background: #f8fafc; }
.sluder-order-meta { display: flex; flex-direction: column; gap: 4px; }
.sluder-order-id   { font-weight: 700; font-size: 15px; }
.sluder-order-date { color: #6b7280; font-size: 13px; }
.sluder-order-stone { font-size: 13px; }

/* ── Status badges ─────────────────────────────────────────────────────────── */
.sluder-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .3px;
    white-space: nowrap;
}
.sluder-badge--in_progress        { background: #fef3c7; color: #92400e; }
.sluder-badge--in_design          { background: #fde68a; color: #92400e; }
.sluder-badge--cad_uploaded       { background: #dbeafe; color: #1e40af; }
.sluder-badge--revision_requested { background: #ffedd5; color: #9a3412; }
.sluder-badge--cad_approved     { background: #d1fae5; color: #065f46; }
.sluder-badge--deposit_paid     { background: #ede9fe; color: #5b21b6; }
.sluder-badge--in_production    { background: #cffafe; color: #164e63; }
.sluder-badge--ring_complete    { background: #d1fae5; color: #065f46; }
.sluder-badge--awaiting_balance { background: #fee2e2; color: #991b1b; }
.sluder-badge--shipping_pending { background: #fce7f3; color: #9d174d; }
.sluder-badge--shipped          { background: #d1fae5; color: #065f46; }
.sluder-badge--delivered        { background: #e0f2fe; color: #0369a1; }

/* ── Order detail ──────────────────────────────────────────────────────────── */
.sluder-detail-section {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}
.sluder-detail-section h3 { margin: 0 0 14px; font-size: 16px; }
.sluder-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sluder-detail-row  { display: flex; flex-direction: column; gap: 2px; }
.sluder-detail-label { font-size: 12px; color: #6b7280; text-transform: uppercase; letter-spacing: .3px; }
.sluder-detail-value { font-size: 14px; font-weight: 500; }

/* ── Timeline ──────────────────────────────────────────────────────────────── */
.sluder-timeline { display: flex; align-items: flex-start; gap: 0; overflow-x: auto; padding: 10px 0; }
.sluder-timeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 80px;
    position: relative;
}
.sluder-timeline-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 14px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: #e2e8f0;
    z-index: 0;
}
.sluder-timeline-step.active::after,
.sluder-timeline-step.done::after { background: #4F331D; }
.sluder-timeline-dot {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: #e2e8f0;
    border: 2px solid #e2e8f0;
    z-index: 1;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; color: #6b7280;
}
.sluder-timeline-step.done  .sluder-timeline-dot { background: #4F331D; border-color: #4F331D; color: #fff; }
.sluder-timeline-step.active .sluder-timeline-dot { background: #fff; border-color: #4F331D; color: #4F331D; }
.sluder-timeline-label { font-size: 10px; text-align: center; color: #6b7280; margin-top: 6px; }
.sluder-timeline-step.active .sluder-timeline-label,
.sluder-timeline-step.done  .sluder-timeline-label { color: #4F331D; font-weight: 600; }

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.sluder-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 18px; border-radius: 6px;
    font-size: 14px; font-weight: 600; cursor: pointer;
    border: none; text-decoration: none; transition: background .2s, opacity .2s;
}
.sluder-btn--primary   { background: #4F331D !important; color: #fff !important; }
.sluder-btn--primary:hover  { background: #3d2718 !important; }
.sluder-btn--primary:active { background: #2e1d11 !important; }
.sluder-btn--secondary { background: #4F331D !important; color: #fff !important; border: none !important; }
.sluder-btn--secondary:hover  { background: #3d2718 !important; }
.sluder-btn--secondary:active { background: #2e1d11 !important; }
.sluder-btn--danger    { background: #4F331D !important; color: #fff !important; }
.sluder-btn--danger:hover  { background: #3d2718 !important; }
.sluder-btn--danger:active { background: #2e1d11 !important; }

/* ── Inline panels (approve / revise / payment / shipping) ─────────────────── */
.sluder-inline-panel {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 18px 20px;
    margin-top: 14px;
}
.sluder-inline-panel h4 { margin: 0 0 12px; }
.sluder-inline-panel label { display: block; margin-bottom: 4px; font-weight: 600; font-size: 13px; }
.sluder-inline-panel input[type="text"],
.sluder-inline-panel textarea {
    width: 100%; box-sizing: border-box;
    border: 1px solid #d1d5db; border-radius: 4px;
    padding: 8px 10px; font-size: 14px; margin-bottom: 10px;
}
.sluder-inline-panel textarea { min-height: 90px; resize: vertical; }
.sluder-inline-panel .sluder-btn { margin-right: 8px; }

/* ── Payment cards ─────────────────────────────────────────────────────────── */
.sluder-payment-cards { display: flex; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.sluder-payment-card {
    flex: 1; min-width: 180px;
    border: 2px solid #e2e8f0; border-radius: 8px;
    padding: 18px; cursor: pointer; text-align: center;
    transition: border-color .15s;
}
.sluder-payment-card.selected { border-color: #4F331D; background: #f5ede5; }
.sluder-payment-card .amount { font-size: 22px; font-weight: 700; margin: 6px 0; }

/* ── Attachment thumbnail ──────────────────────────────────────────────────── */
.sluder-thumb { width: 70px; height: 70px; object-fit: cover; border-radius: 4px; border: 1px solid #e2e8f0; margin-top: 8px; }

/* ── Alert messages ────────────────────────────────────────────────────────── */
.sluder-alert { padding: 10px 14px; border-radius: 6px; font-size: 13px; margin-top: 10px; }
.sluder-alert--success { background: #d1fae5; color: #065f46; }
.sluder-alert--error   { background: #fee2e2; color: #991b1b; }

/* ── Back link ─────────────────────────────────────────────────────────────── */
.sluder-back-link { font-size: 13px; color: #4F331D; text-decoration: none; margin-bottom: 16px; display: inline-block; transition: color .2s; }
.sluder-back-link:hover { color: #3d2718; text-decoration: underline; }

/* ==========================================================================
   Responsive — mobile & tablet
   ========================================================================== */
@media (max-width: 768px) {
    .sluder-portal { padding: 12px 0; }

    /* Order list cards stack vertically; the action button goes full-width. */
    .sluder-order-card {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 10px;
    }
    .sluder-order-card .sluder-order-meta { flex: 1 1 100%; }
    .sluder-order-card .sluder-btn {
        width: 100%;
        justify-content: center;
        margin-left: 0;
    }

    /* Detail grid collapses to a single column. */
    .sluder-detail-grid { grid-template-columns: 1fr; }
    .sluder-detail-section { padding: 16px; }

    /* Payment option cards stack instead of sitting side by side. */
    .sluder-payment-cards { flex-direction: column; }
    .sluder-payment-card { min-width: 0; width: 100%; box-sizing: border-box; }

    /* Buttons become full-width and stack for easier tapping. */
    .sluder-btn { width: 100%; justify-content: center; box-sizing: border-box; }
    .sluder-inline-panel .sluder-btn { margin-right: 0; margin-bottom: 8px; }
}

@media (max-width: 480px) {
    /* Tighten the horizontally-scrolling timeline on small phones. */
    .sluder-timeline-step { min-width: 62px; }
    .sluder-timeline-dot { width: 24px; height: 24px; font-size: 11px; }
    .sluder-timeline-step:not(:last-child)::after { top: 12px; }
    .sluder-timeline-label { font-size: 9px; }
    .sluder-detail-section h3 { font-size: 15px; }
    .sluder-detail-value { font-size: 13px; }
}

/* ── Revision request: photo attachments ──────────────────────────────── */
#sluder-revision-images {
    display: block;
    margin-top: 4px;
    font-size: 13px;
}

.sluder-revision-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.sluder-revision-preview {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e6e0d8;
}
