:root {
    --bg: #f6f7fb;
    --card: rgba(255, 255, 255, .72);
    --line: rgba(148, 163, 184, .25);
    --text: #0f172a;
    --muted: #64748b;
    --brand: #0ea5e9;
    --brand2: #2563eb;
    --danger: #dc2626;
    --ok: #16a34a;
    --shadow: 0 22px 60px rgba(2, 6, 23, .10);
    --radius: 22px;
}

.return-page {
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 14px;
}

.return-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 22px;
}

.glass {
    background: var(--card);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, .55);
    box-shadow: var(--shadow);
    border-radius: var(--radius);
}

.panel {
    padding: 22px;
}

.header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--brand), var(--brand2));
    color: #fff;
    font-weight: 700;
    font-size: 13px;
}

.customer {
    margin-top: 12px;
    padding: 16px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(14, 165, 233, .10), rgba(37, 99, 235, .10));
    border: 1px solid var(--line);
}

.customer .name {
    font-weight: 800;
    font-size: 16px;
    margin-bottom: 6px;
}

.customer .meta {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.8;
}

.table-wrap {
    margin-top: 16px;
    overflow: auto;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .55);
}

.t {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.t th {
    background: linear-gradient(135deg, #0b4f6c, #0ea5e9);
    color: #fff;
    text-align: right;
    padding: 12px;
    font-size: 13px;
    position: sticky;
    top: 0;
    z-index: 1;
}

.t td {
    padding: 12px;
    border-bottom: 1px solid rgba(226, 232, 240, .8);
    font-size: 14px;
    color: var(--text);
    vertical-align: top;
}

.t tr:hover td {
    background: rgba(14, 165, 233, .05);
}

.qty {
    width: 86px;
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, .35);
    outline: none;
    font-weight: 700;
}

.qty:focus {
    border-color: rgba(14, 165, 233, .9);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, .15);
}

.small {
    font-size: 12px;
    color: var(--muted);
    margin-top: 6px;
}

.warn {
    margin-top: 6px;
    color: var(--danger);
    font-size: 12px;
    font-weight: 700;
    display: none;
}

.controls {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.control {
    padding: 14px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .55);
}

.control label {
    display: block;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text);
}

.control select,
.control textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, .35);
    outline: none;
    background: rgba(255, 255, 255, .85);
}

.control textarea {
    height: 80px;
    resize: vertical;
}

.checks {
    display: grid;
    gap: 10px;
}

/* Custom checkbox (Echo style) */
.chk {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    color: var(--text);
    user-select: none;
}

.chk input {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 6px;
    border: 1.6px solid rgba(148, 163, 184, .65);
    background: rgba(255, 255, 255, .85);
    display: inline-grid;
    place-items: center;
    transition: .18s ease;
}

.chk input:checked {
    background: linear-gradient(135deg, var(--brand), var(--brand2));
    border-color: transparent;
}

.chk input:checked::after {
    content: "✓";
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
}

.chk small {
    color: var(--muted);
    font-weight: 700;
}

/* Submit */
.footer-actions {
    margin-top: 16px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.btn {
    flex: 1;
    padding: 12px 14px;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    font-weight: 900;
    letter-spacing: .2px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand), var(--brand2));
    color: #fff;
    box-shadow: 0 16px 40px rgba(37, 99, 235, .20);
}

.btn-primary:disabled {
    opacity: .55;
    cursor: not-allowed;
    box-shadow: none;
}

.hint {
    font-size: 12px;
    color: var(--muted);
}

/* Right panel */
.kpi-title {
    font-size: 16px;
    font-weight: 900;
    margin-bottom: 10px;
}

.kpi {
    display: flex;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .55);
    margin-bottom: 10px;
}

.kpi span {
    color: var(--muted);
    font-weight: 800;
}

.kpi b {
    color: var(--text);
    font-weight: 900;
}

.total {
    padding: 12px;
    border-radius: 16px;
    border: 1px solid rgba(14, 165, 233, .25);
    background: linear-gradient(135deg, rgba(14, 165, 233, .08), rgba(37, 99, 235, .08));
    font-weight: 900;
    display: flex;
    justify-content: space-between;
}

.note-box {
    margin-top: 12px;
    padding: 12px;
    border-radius: 16px;
    border: 1px dashed rgba(148, 163, 184, .55);
    color: var(--muted);
    font-size: 12px;
    line-height: 1.7;
}

/* tiny chart */
.chart-wrap {
    margin-top: 14px;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .55);
}

canvas {
    width: 100%;
    height: 160px;
    display: block;
}

.btn-view-invoice {
    padding: 8px 14px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none !important;
    background: linear-gradient(135deg, #0ea5e9, #2563eb);
    color: #fff !important;
    box-shadow: 0 8px 22px rgba(37, 99, 235, .25);
    transition: .2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    outline: none;
}

.btn-view-invoice:hover,
.btn-view-invoice:focus,
.btn-view-invoice:active,
.btn-view-invoice:visited {
    color: #fff !important;
    background: linear-gradient(135deg, #0284c7, #1d4ed8) !important;
    text-decoration: none !important;
    outline: none !important;
}

/* ===== Customer Button ===== */
.btn-view-customer {
    padding: 8px 14px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    background: linear-gradient(135deg, #16a34a, #22c55e);
    color: #fff !important;
    box-shadow: 0 8px 22px rgba(22, 163, 74, .25);
    transition: .2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-view-customer:hover {
    background: linear-gradient(135deg, #15803d, #16a34a);
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(22, 163, 74, .35);
}

.btn-view-customer:active {
    transform: translateY(0);
    box-shadow: 0 6px 16px rgba(22, 163, 74, .25);
}