/* Custom Returns Hub – front-end dashboard */
.crhub {
	--crhub-brand: #0c203f;
	--crhub-text: #1e1e1e;
	--crhub-muted: #646970;
	--crhub-line: #e3e5e8;
	--crhub-bg: #f6f7f8;
	--crhub-card: #fff;
	--crhub-radius: 10px;
	color: var(--crhub-text);
	font-size: 15px;
	line-height: 1.5;
	max-width: 1280px;
	margin: 0 auto;
}
.crhub *, .crhub *::before, .crhub *::after { box-sizing: border-box; }
.crhub .screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }

/* Header */
.crhub-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 0 0 20px; }
.crhub-title { margin: 0; font-size: 1.6em; line-height: 1.2; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.crhub-sub { margin: 4px 0 0; color: var(--crhub-muted); }
.crhub-header-actions { display: flex; gap: 8px; }

/* Buttons & links */
.crhub-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 18px; border-radius: 6px; border: 1px solid var(--crhub-brand); background: var(--crhub-brand); color: #fff !important; font-weight: 600; font-size: 14px; line-height: 1.2; text-decoration: none !important; cursor: pointer; }
.crhub-btn:hover { filter: brightness(1.12); }
.crhub-btn:disabled { opacity: .6; cursor: wait; }
.crhub-btn--ghost { background: #fff; color: var(--crhub-brand) !important; }
.crhub-btn--ghost:hover { background: var(--crhub-bg); filter: none; }
.crhub-btn--block { width: 100%; }
.crhub-link { color: var(--crhub-brand); font-weight: 600; text-decoration: none; }
.crhub-link:hover { text-decoration: underline; }

/* Notices */
.crhub-notice { padding: 12px 16px; border-radius: 8px; margin: 0 0 16px; border: 1px solid; }
.crhub-notice--success { background: #edf7ef; border-color: #b8e0c2; color: #1d6b35; }
.crhub-notice--info { background: #eef4fb; border-color: #c4d8ef; color: #0a4b8c; }
.crhub-notice--error { background: #fdeeee; border-color: #f2c4c4; color: #9f0f0f; }

/* Status tabs */
.crhub-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 14px; }
.crhub-tab { display: inline-flex; gap: 8px; align-items: center; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--crhub-line); background: #fff; color: var(--crhub-text); text-decoration: none; font-weight: 600; font-size: 14px; }
.crhub-tab span { background: var(--crhub-bg); border-radius: 999px; padding: 0 8px; font-size: 12px; color: var(--crhub-muted); }
.crhub-tab:hover { border-color: var(--crhub-brand); }
.crhub-tab.is-active { background: var(--crhub-brand); border-color: var(--crhub-brand); color: #fff; }
.crhub-tab.is-active span { background: rgba(255,255,255,.2); color: #fff; }

/* Filters */
.crhub-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 14px; background: var(--crhub-bg); border-radius: var(--crhub-radius); margin: 0 0 16px; }
.crhub-field { display: flex; flex-direction: column; gap: 4px; margin: 0 0 12px; font-size: 13px; }
.crhub-filters .crhub-field { margin: 0; min-width: 130px; }
.crhub-field--grow { flex: 1 1 240px; }
.crhub-field > span { font-weight: 600; color: var(--crhub-muted); }
.crhub-field input, .crhub-field select, .crhub-field textarea, .crhub-form--inline select {
	width: 100%; padding: 8px 10px; border: 1px solid #cfd3d8; border-radius: 6px; background: #fff; font: inherit; font-size: 14px; color: var(--crhub-text);
}
.crhub-field input:focus, .crhub-field select:focus, .crhub-field textarea:focus { outline: 2px solid var(--crhub-brand); outline-offset: 0; border-color: var(--crhub-brand); }
.crhub-filter-actions { display: flex; align-items: center; gap: 12px; }

/* Tables */
.crhub-table-wrap { overflow-x: auto; background: var(--crhub-card); border: 1px solid var(--crhub-line); border-radius: var(--crhub-radius); }
.crhub-card .crhub-table-wrap { border: 0; border-radius: 0; margin: 0 -4px; }
.crhub-table { width: 100%; border-collapse: collapse; margin: 0; font-size: 14px; }
.crhub-table th, .crhub-table td { padding: 12px 14px; text-align: left; border: 0; border-bottom: 1px solid var(--crhub-line); vertical-align: middle; }
.crhub-table thead th { background: #fafbfc; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--crhub-muted); font-weight: 700; }
.crhub-table tbody tr:last-child td { border-bottom: 0; }
.crhub-table small { display: block; color: var(--crhub-muted); font-size: 12px; }
.crhub-row { cursor: pointer; }
.crhub-row:hover td { background: #fafbfc; }
.crhub-num { text-align: center !important; }
.crhub-rma { font-weight: 700; color: var(--crhub-brand); text-decoration: none; }
.crhub-flag { display: inline-flex; width: 18px; height: 18px; border-radius: 50%; background: #9f0f0f; color: #fff; font-size: 12px; font-weight: 700; align-items: center; justify-content: center; margin-left: 6px; }
.crhub-empty { text-align: center !important; color: var(--crhub-muted); padding: 32px !important; }
.crhub-thumb { width: 64px; }
.crhub-thumb img { display: block; width: 48px; height: 48px; object-fit: cover; border-radius: 6px; }

/* Badges */
.crhub-badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 1.7; background: #eef0f2; color: #3c434a; white-space: nowrap; vertical-align: middle; }
.crhub-badge--pending   { background: #fff4d6; color: #7a5b00; }
.crhub-badge--approved  { background: #e3f1ff; color: #0a4b8c; }
.crhub-badge--received  { background: #ece6ff; color: #4b2aa8; }
.crhub-badge--completed { background: #e0f4e6; color: #1d6b35; }
.crhub-badge--rejected  { background: #fde5e5; color: #9f0f0f; }
.crhub-badge--cancelled { background: #eef0f2; color: #555; }
.crhub-tag { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--crhub-muted); background: var(--crhub-bg); border-radius: 4px; padding: 1px 6px; }

/* Pagination */
.crhub-pagination { display: flex; gap: 6px; justify-content: center; margin: 18px 0; flex-wrap: wrap; }
.crhub-page { min-width: 36px; padding: 6px 10px; text-align: center; border-radius: 6px; border: 1px solid var(--crhub-line); text-decoration: none; color: var(--crhub-text); }
.crhub-page.is-active { background: var(--crhub-brand); border-color: var(--crhub-brand); color: #fff; }
.crhub-page-gap { padding: 6px 4px; color: var(--crhub-muted); }

/* Detail layout */
.crhub-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.crhub-main, .crhub-side { display: grid; gap: 20px; }
.crhub-card { background: var(--crhub-card); border: 1px solid var(--crhub-line); border-radius: var(--crhub-radius); padding: 18px 20px; }
.crhub-card h3 { margin: 0 0 14px; font-size: 16px; }
.crhub-card h4 { margin: 16px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--crhub-muted); }
.crhub-card--accent { border-top: 4px solid var(--crhub-brand); }
.crhub-card--warn { border-color: #f2c4c4; background: #fffafa; }
.crhub-lines { margin: 0; }
.crhub-pre { white-space: pre-wrap; }
.crhub-dl { margin: 16px 0 0; }
.crhub-dl dt { font-weight: 700; font-size: 13px; color: var(--crhub-muted); margin-top: 10px; }
.crhub-dl dd { margin: 2px 0 0; }
.crhub-dl--compact { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 12px; }
.crhub-dl--compact dt, .crhub-dl--compact dd { margin: 0; }
.crhub-mini-list { list-style: none; margin: 0; padding: 0; }
.crhub-mini-list li { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; }

.crhub-form .crhub-field { margin-bottom: 12px; }
.crhub-form--inline { display: flex; gap: 8px; }
.crhub-check { display: flex; gap: 8px; align-items: center; margin: 0 0 14px; font-size: 14px; }
.crhub-quick { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 12px; }
.crhub-chip { border: 1px solid var(--crhub-line); background: #fff; border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--crhub-text); }
.crhub-chip:hover, .crhub-chip.is-active { border-color: var(--crhub-brand); color: var(--crhub-brand); background: var(--crhub-bg); }

/* Timeline */
.crhub-timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--crhub-line); }
.crhub-event { position: relative; padding: 0 0 18px 12px; }
.crhub-event::before { content: ""; position: absolute; left: -25px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--crhub-brand); }
.crhub-event--note::before { border-color: #a7aaad; }
.crhub-event--created::before { background: var(--crhub-brand); }
.crhub-event-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 14px; }
.crhub-event-head time { margin-left: auto; color: var(--crhub-muted); font-size: 12px; }
.crhub-event-body { margin-top: 6px; padding: 10px 12px; background: var(--crhub-bg); border-radius: 6px; font-size: 14px; }
.crhub-event-meta { margin-top: 4px; font-size: 12px; color: var(--crhub-muted); }

/* Login */
.crhub-login { max-width: 380px; margin: 40px auto; padding: 28px; background: #fff; border: 1px solid var(--crhub-line); border-radius: var(--crhub-radius); }
.crhub-login h2 { margin-top: 0; }
.crhub-login input[type="text"], .crhub-login input[type="password"] { width: 100%; padding: 9px 10px; border: 1px solid #cfd3d8; border-radius: 6px; }
.crhub-login input[type="submit"] { background: var(--crhub-brand); color: #fff; border: 0; border-radius: 6px; padding: 10px 20px; font-weight: 600; cursor: pointer; }

/* Responsive */
@media (max-width: 960px) {
	.crhub-grid { grid-template-columns: 1fr; }
	.crhub-side { order: -1; }
}
@media (max-width: 720px) {
	.crhub-filters .crhub-field { flex: 1 1 45%; }
	.crhub-table thead { display: none; }
	.crhub-table, .crhub-table tbody, .crhub-table tr, .crhub-table td { display: block; width: 100%; }
	.crhub-table tr { border-bottom: 1px solid var(--crhub-line); padding: 8px 0; }
	.crhub-table td { border: 0; padding: 4px 14px; text-align: left !important; }
	.crhub-table td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--crhub-muted); }
	.crhub-table--items .crhub-thumb { display: none; }
}

/* ---- 1.1.0: labels, SMS, manual RMA ---- */
.crhub [hidden] { display: none !important; }
.crhub-hint { margin: 0 0 12px; font-size: 13px; color: var(--crhub-muted); }
.crhub-field small { color: var(--crhub-muted); font-weight: 400; font-size: 12px; }
.crhub-field--spaced { margin-top: 16px; }
.crhub-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 14px; }
.crhub-form-grid--3 { grid-template-columns: 2fr 1fr 1fr; }
.crhub-dims { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.crhub-details { border: 1px solid var(--crhub-line); border-radius: 8px; padding: 10px 14px; margin: 4px 0 14px; background: #fafbfc; }
.crhub-details summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.crhub-details summary span { font-weight: 400; color: var(--crhub-muted); }
.crhub-details[open] summary { margin-bottom: 12px; }
.crhub-label-notify { border-top: 1px solid var(--crhub-line); padding-top: 14px; margin-top: 6px; }
.crhub-label-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 12px; }
.crhub-copy { flex: 1 1 220px; min-width: 0; padding: 8px 10px; border: 1px solid var(--crhub-line); border-radius: 6px; font-size: 12px; color: var(--crhub-muted); background: #fafbfc; }
.crhub-inline { display: inline-block; margin: 0 12px 0 0; }
.crhub-link--danger { color: #b32d2e !important; background: none; border: 0; padding: 0; cursor: pointer; font-weight: 600; font-size: 14px; }
.crhub-link--danger:hover { text-decoration: underline; }
.crhub-items { display: grid; gap: 8px; margin-bottom: 10px; }
.crhub-item-row { display: grid; grid-template-columns: 2.2fr 1.3fr .7fr .9fr 28px; gap: 8px; align-items: center; }
.crhub-item-row input { width: 100%; padding: 8px 10px; border: 1px solid #cfd3d8; border-radius: 6px; font: inherit; font-size: 14px; }
.crhub-item-row--head { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--crhub-muted); }
.crhub-item-remove { font-size: 20px !important; line-height: 1; }
.crhub-event--label::before { border-color: #3b82f6; }
.crhub-event--sms::before { border-color: #22a55b; }
@media (max-width: 720px) {
	.crhub-item-row { grid-template-columns: 1fr 1fr; }
	.crhub-item-row--head { display: none; }
	.crhub-form-grid--3 { grid-template-columns: 1fr 1fr; }
}

/* ---- 1.2.0: address checks ---- */
.crhub-addr-check { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 8px; font-size: 13px; margin: 0 0 12px; border: 1px solid; }
.crhub-addr-check form { margin: 6px 0 0; }
.crhub-addr-check--ok { background: #edf7ef; border-color: #b8e0c2; color: #1d6b35; }
.crhub-addr-check--warn { background: #fff8e6; border-color: #f2d58a; color: #7a5b00; }
.crhub-addr-check--bad { background: #fdeeee; border-color: #f2c4c4; color: #9f0f0f; }
.crhub-addr-check--muted { background: #f6f8fa; border-color: var(--crhub-line); color: var(--crhub-muted); }
.crhub-btn--sm { padding: 6px 12px; font-size: 13px; }
.crhub-form-grid--2 { grid-template-columns: 1.4fr 1fr; }
.crhub-addr-recheck { margin: 8px 0 0; }
.crhub-addr-recheck .crhub-link { background: none; border: 0; padding: 0; cursor: pointer; font-size: 13px; }
.crhub-event--address::before { border-color: #f0b429; }
.crhub-field select { min-width: 0; }
.crhub-link--muted { color: var(--crhub-muted) !important; background: none; border: 0; padding: 0; cursor: pointer; font-size: 13px; }
.crhub-link--muted:hover { text-decoration: underline; }
