:root {
    --rdr-red: #c5162e;
    --rdr-red-dark: #991226;
    --rdr-gray: #f3f4f6;
    --rdr-ink: #20242a;
}

body {
    background: var(--rdr-gray);
    color: var(--rdr-ink);
}

a {
    color: var(--rdr-red);
}

.bg-rdr {
    background: linear-gradient(90deg, var(--rdr-red-dark), var(--rdr-red));
}

.brand-title {
    line-height: 1.05;
}

.brand-title span {
    display: block;
    font-size: 0.72rem;
    font-weight: 500;
    opacity: 0.9;
}

.so-subnav {
    background: #fff;
    border-bottom: 1px solid #e4e7ec;
    box-shadow: 0 8px 18px rgba(32, 36, 42, 0.04);
    position: sticky;
    top: 56px;
    z-index: 1010;
}

.so-subnav-inner {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 48px;
    padding: 8px 0;
}

.so-subnav-link {
    border-radius: 8px;
    color: #20242a;
    font-size: 0.9rem;
    font-weight: 800;
    padding: 8px 12px;
    text-decoration: none;
}

.so-subnav-link:hover,
.so-subnav-link:focus,
.so-subnav-link.active {
    background: var(--rdr-red);
    color: #fff;
}

.nota-subnav {
    background: #fff;
    border-bottom: 1px solid #e4e7ec;
    box-shadow: 0 8px 18px rgba(32, 36, 42, 0.04);
    position: sticky;
    top: 56px;
    z-index: 1010;
}

.nota-subnav-inner {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 48px;
    padding: 8px 0;
}

.nota-subnav-link {
    border-radius: 8px;
    color: #20242a;
    font-size: 0.9rem;
    font-weight: 800;
    padding: 8px 12px;
    text-decoration: none;
}

.nota-subnav-link:hover,
.nota-subnav-link:focus,
.nota-subnav-link.active {
    background: var(--rdr-red);
    color: #fff;
}

.page-shell {
    padding: 28px;
}

.page-title {
    font-size: clamp(1.6rem, 2.4vw, 2.4rem);
    font-weight: 800;
    letter-spacing: 0;
    margin: 0;
}

.section-title {
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.panel,
.metric {
    background: #fff;
    border: 1px solid #e4e7ec;
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(32, 36, 42, 0.05);
    padding: 20px;
}

.metric span {
    display: block;
    color: #687182;
    font-size: 0.88rem;
    margin-bottom: 8px;
}

.metric strong {
    display: block;
    font-size: clamp(1.25rem, 2vw, 1.8rem);
    line-height: 1.15;
}

.module-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.module-card {
    align-items: flex-start;
    background: #fff;
    border: 1px solid #e4e7ec;
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(32, 36, 42, 0.05);
    color: #20242a;
    display: flex;
    gap: 14px;
    min-height: 142px;
    padding: 20px;
    text-decoration: none;
}

.module-card:hover,
.module-card:focus {
    border-color: #c5162e;
    color: #20242a;
    transform: translateY(-1px);
}

.module-card-icon {
    align-items: center;
    background: #fff1f3;
    border-radius: 8px;
    color: #c5162e;
    display: inline-flex;
    flex: 0 0 44px;
    font-size: 1.35rem;
    height: 44px;
    justify-content: center;
    width: 44px;
}

.module-card h2 {
    font-size: 1.08rem;
    font-weight: 800;
    line-height: 1.2;
    margin: 0 0 6px;
}

.module-card p {
    color: #687182;
    font-size: 0.92rem;
    margin: 0;
}

.btn-rdr {
    background: var(--rdr-red);
    border-color: var(--rdr-red);
    color: #fff;
    font-weight: 700;
}

.btn-rdr:hover,
.btn-rdr:focus {
    background: var(--rdr-red-dark);
    border-color: var(--rdr-red-dark);
    color: #fff;
}

.table-panel {
    padding-bottom: 8px;
}

.table th {
    color: #555f6f;
    font-size: 0.82rem;
    text-transform: uppercase;
}

.status-pill {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.82rem;
    font-weight: 700;
    min-height: 28px;
    padding: 4px 10px;
    white-space: nowrap;
}

.status-belum-dp {
    background: #ffe5e5;
    color: #991226;
}

.status-dp {
    background: #fff6d8;
    color: #856404;
}

.status-lunas {
    background: #e8f6ee;
    color: #17633a;
}

.status-desain,
.status-produksi,
.status-selesai,
.status-diambil {
    background: #e8f2ff;
    color: #084298;
}

.info-label {
    color: #687182;
    font-size: 0.82rem;
    margin-bottom: 4px;
}

.info-value {
    font-weight: 700;
}

.summary-row {
    border-bottom: 1px solid #eceff3;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    padding: 12px 0;
}

.summary-row.highlight {
    border-bottom: 0;
    color: var(--rdr-red-dark);
    font-size: 1.08rem;
}

.item-table-wrap {
    border: 1px solid #e4e7ec;
    border-radius: 8px;
}

.item-table {
    margin-bottom: 0;
    min-width: 920px;
}

.item-table .qty-col {
    width: 100px;
}

.item-table .money-col {
    width: 160px;
}

.item-table .action-col {
    width: 92px;
}

.drag-handle {
    color: #9aa3b2;
    cursor: grab;
}

.invoice-total-box {
    background: #fff1f3;
    border: 1px solid #ffd7de;
    border-radius: 8px;
    min-width: 260px;
    padding: 14px 18px;
    text-align: right;
}

.invoice-total-box span {
    color: #687182;
    display: block;
    font-size: 0.82rem;
}

.invoice-total-box strong {
    color: var(--rdr-red-dark);
    font-size: 1.45rem;
}

.print-body {
    background: #fff;
}

.print-sheet {
    background: #fff;
    margin: 32px auto;
    padding: 32px;
    width: min(900px, 100%);
}

.print-brand {
    color: var(--rdr-red);
    font-weight: 900;
    margin: 0;
}

.print-title {
    font-weight: 900;
    text-transform: uppercase;
}

.print-total {
    margin-left: auto;
    width: min(360px, 100%);
}

.print-total div {
    display: flex;
    gap: 16px;
    justify-content: space-between;
    padding: 8px 0;
}

.print-total strong {
    font-size: 1.05rem;
}

.print-actions {
    margin-top: 32px;
    text-align: center;
}

.brand-badge {
    border-radius: 8px;
    color: #fff;
    display: inline-flex;
    font-weight: 800;
    min-width: 48px;
    justify-content: center;
    padding: 8px 10px;
}

.so-table {
    min-width: 640px;
}

.report-table {
    min-width: 860px;
}

.report-brand-title {
    background: #f8fafc;
    border: 1px solid #e4e7ec;
    border-radius: 8px;
    color: #20242a;
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 10px;
    padding: 10px 12px;
}

.report-subtotal-row td {
    background: #f3f5f7;
    font-weight: 800;
}

.report-grand-total {
    align-items: center;
    background: #20242a;
    border-radius: 8px;
    color: #fff;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    justify-content: space-between;
    padding: 14px 16px;
}

.report-grand-total span {
    color: #d9dee7;
    font-size: 0.9rem;
}

.report-grand-total strong {
    font-size: 1rem;
}

.dashboard-target-summary {
    border-bottom: 1px solid #e4e7ec;
    border-top: 1px solid #e4e7ec;
    display: grid;
    gap: 0;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-target-summary > div {
    min-width: 0;
    padding: 14px 16px;
}

.dashboard-target-summary > div + div {
    border-left: 1px solid #e4e7ec;
}

.dashboard-target-summary span {
    color: #687182;
    display: block;
    font-size: 0.82rem;
    margin-bottom: 6px;
}

.dashboard-target-summary strong {
    display: block;
    font-size: 1.15rem;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.so-media-preview,
.so-media-placeholder {
    background: #fafafa;
    height: 360px;
    object-fit: contain;
}

.so-notes-box {
    min-height: 140px;
    overflow-wrap: anywhere;
    white-space: pre-line;
}

.so-summary dd,
.so-summary strong,
.form-text {
    overflow-wrap: anywhere;
}

.production-stepper {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.production-step {
    align-items: center;
    background: #f3f4f6;
    border: 1px solid #d9dee7;
    border-radius: 8px;
    color: #555f6f;
    display: flex;
    flex: 1 1 136px;
    gap: 8px;
    max-width: 180px;
    min-height: 52px;
    min-width: 136px;
    padding: 10px;
}

.production-step-marker {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    flex: 0 0 28px;
    font-size: 0.84rem;
    font-weight: 800;
    height: 28px;
    justify-content: center;
}

.production-step-label {
    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1.15;
    overflow-wrap: normal;
    white-space: normal;
    word-break: normal;
}

.production-step-badge {
    display: none;
}

.production-step-done {
    background: #e8f6ee;
    border-color: #9fd6b4;
    color: #17633a;
}

.production-step-done .production-step-marker {
    background: #198754;
    color: #fff;
}

.production-step-active {
    background: #e9f2ff;
    border-color: #9ec5fe;
    color: #084298;
}

.production-step-active .production-step-marker {
    background: #0d6efd;
    color: #fff;
}

.production-step-upcoming .production-step-marker {
    background: #d9dee7;
    color: #555f6f;
}

.production-metric {
    min-height: 112px;
}

.production-metric-secondary {
    border-top: 4px solid #6c757d;
}

.production-metric-primary {
    border-top: 4px solid #0d6efd;
}

.production-metric-warning {
    border-top: 4px solid #ffc107;
}

.production-metric-info {
    border-top: 4px solid #0dcaf0;
}

.production-metric-success {
    border-top: 4px solid #198754;
}

.production-metric-danger {
    border-top: 4px solid #dc3545;
}

.production-vendor-grid {
    display: grid;
    gap: 0;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.production-vendor-grid > div {
    border-left: 1px solid #e4e7ec;
    min-width: 0;
    padding: 4px 14px;
}

.production-vendor-grid > div:first-child {
    border-left: 0;
    padding-left: 0;
}

.production-vendor-grid span {
    color: #687182;
    display: block;
    font-size: 0.82rem;
    margin-bottom: 6px;
}

.production-vendor-grid strong {
    display: block;
    font-size: 1.35rem;
}

.production-table {
    min-width: 1280px;
}

.production-inline-form {
    align-items: center;
    display: flex;
    gap: 8px;
    min-width: 220px;
}

.production-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 280px;
}

.priority-badge {
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.82rem;
    font-weight: 800;
    min-width: 74px;
    padding: 5px 10px;
    justify-content: center;
}

.priority-urgent {
    background: #ffe5e5;
    color: #991226;
}

.priority-tinggi {
    background: #fff6d8;
    color: #856404;
}

.priority-normal {
    background: #e8f6ee;
    color: #17633a;
}

.so-status-badge {
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1;
    padding: 7px 10px;
    white-space: nowrap;
}

.so-status-badge-approval {
    background: #e8f2ff;
    color: #084298;
}

.so-status-badge-setting,
.so-status-badge-packing {
    background: #dbeafe;
    color: #0b4f9f;
}

.so-status-badge-printing {
    background: #e8e7ff;
    color: #3730a3;
}

.so-status-badge-jahit {
    background: #fff3cd;
    color: #8a5a00;
}

.so-status-badge-qc {
    background: #d7e3ff;
    color: #12356b;
}

.so-status-badge-finish {
    background: #dff3e8;
    color: #17633a;
}

.so-status-badge-taken {
    background: #14532d;
    color: #fff;
}

.track-hero {
    align-items: center;
    background: #fff;
    border: 1px solid #e4e7ec;
    border-radius: 8px;
    display: flex;
    gap: 18px;
    padding: 20px;
}

.track-brand {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e4e7ec;
    border-radius: 8px;
    display: flex;
    flex: 0 0 88px;
    height: 88px;
    justify-content: center;
    padding: 10px;
    width: 88px;
}

.track-brand img {
    max-height: 68px;
    max-width: 68px;
    object-fit: contain;
}

.track-brand span {
    border-radius: 8px;
    color: #fff;
    display: inline-flex;
    font-weight: 800;
    justify-content: center;
    min-width: 56px;
    padding: 10px;
}

.portal-action-bar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.track-summary dd,
.track-status-badge {
    overflow-wrap: anywhere;
}

.customer-progress-grid {
    border: 1px solid #e4e7ec;
    border-radius: 8px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: hidden;
}

.customer-progress-grid > div {
    background: #f8fafc;
    min-width: 0;
    padding: 14px 16px;
}

.customer-progress-grid > div + div {
    border-left: 1px solid #e4e7ec;
}

.customer-progress-grid span {
    color: #687182;
    display: block;
    font-size: 0.82rem;
    margin-bottom: 6px;
}

.customer-progress-grid strong {
    display: block;
    font-size: 1.15rem;
}

.empty-state {
    align-items: center;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    color: #687182;
    display: flex;
    justify-content: center;
    min-height: 104px;
    padding: 18px;
    text-align: center;
}

.production-photo-upload {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.production-photo-upload .form-control {
    max-width: 320px;
}

.production-photo-admin-grid,
.production-photo-gallery {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.production-photo-admin-card,
.production-photo-card {
    background: #fff;
    border: 1px solid #e4e7ec;
    border-radius: 8px;
    overflow: hidden;
}

.production-photo-admin-card img,
.production-photo-card img {
    aspect-ratio: 4 / 3;
    background: #f8fafc;
    display: block;
    object-fit: cover;
    width: 100%;
}

.production-photo-admin-meta,
.production-photo-card-body {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    min-height: 54px;
    padding: 10px;
}

.production-photo-admin-meta span,
.production-photo-card-body span {
    font-size: 0.9rem;
    font-weight: 800;
}

.player-total-box {
    background: #f8fafc;
    border: 1px solid #e4e7ec;
    border-radius: 8px;
    min-width: 132px;
    padding: 10px 14px;
}

.player-total-box span {
    color: #687182;
    display: block;
    font-size: 0.78rem;
    margin-bottom: 2px;
}

.player-total-box strong {
    display: block;
    font-size: 1.25rem;
}

.portal-player-list {
    display: none;
}

.portal-design-player-section {
    border-bottom: 1px solid #e4e7ec;
    padding-bottom: 18px;
}

.portal-design-player-section:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.portal-player-card {
    border: 1px solid #e4e7ec;
    border-radius: 8px;
    padding: 12px;
}

.portal-player-card-head {
    align-items: flex-start;
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.portal-player-card-head strong,
.portal-player-card-grid strong {
    overflow-wrap: anywhere;
}

.portal-player-card-head span {
    background: #e8f2ff;
    border-radius: 999px;
    color: #084298;
    flex: 0 0 auto;
    font-size: 0.8rem;
    font-weight: 800;
    padding: 5px 9px;
}

.portal-player-card-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 10px;
}

.portal-player-card-grid span {
    color: #687182;
    display: block;
    font-size: 0.78rem;
    margin-bottom: 2px;
}

.portal-size-total-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.portal-size-total-grid > div {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e4e7ec;
    border-radius: 8px;
    display: inline-flex;
    gap: 8px;
    min-height: 36px;
    padding: 6px 10px;
}

.portal-size-total-grid span {
    color: #555f6f;
    font-size: 0.86rem;
}

.portal-size-total-grid strong {
    font-size: 0.95rem;
}

@media (max-width: 768px) {
    .page-shell {
        padding: 18px 12px;
    }

    .panel,
    .metric {
        padding: 16px;
    }

    .customer-production-stepper {
        display: flex;
        flex-direction: column;
        gap: 10px;
        position: relative;
    }

    .customer-production-stepper::before {
        background: #d9dee7;
        bottom: 18px;
        content: "";
        left: 18px;
        position: absolute;
        top: 18px;
        width: 2px;
        z-index: 0;
    }

    .customer-production-stepper .production-step {
        align-items: center;
        display: grid;
        flex: none;
        gap: 10px;
        grid-template-columns: 36px minmax(0, 1fr) auto;
        max-width: none;
        min-height: 58px;
        min-width: 0;
        padding: 10px 12px;
        position: relative;
        z-index: 1;
    }

    .customer-production-stepper .production-step-marker {
        flex: 0 0 36px;
        height: 36px;
        width: 36px;
    }

    .customer-production-stepper .production-step-label {
        font-size: 0.95rem;
        line-height: 1.25;
        overflow-wrap: normal;
        word-break: normal;
    }

    .customer-production-stepper .production-step-badge {
        border-radius: 999px;
        display: inline-flex;
        font-size: 0.75rem;
        font-weight: 800;
        justify-content: center;
        line-height: 1;
        min-width: 76px;
        padding: 7px 9px;
        white-space: nowrap;
    }

    .customer-production-stepper .production-step-done .production-step-badge {
        background: #dff3e8;
        color: #17633a;
    }

    .customer-production-stepper .production-step-active .production-step-badge {
        background: #dbeafe;
        color: #084298;
    }

    .customer-production-stepper .production-step-upcoming .production-step-badge {
        background: #eceff3;
        color: #555f6f;
    }

    .track-hero {
        align-items: flex-start;
    }

    .dashboard-target-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .customer-progress-grid {
        grid-template-columns: 1fr;
    }

    .customer-progress-grid > div + div {
        border-left: 0;
        border-top: 1px solid #e4e7ec;
    }

    .portal-player-table {
        display: none;
    }

    .portal-player-list {
        display: grid;
        gap: 10px;
    }

    .dashboard-target-summary > div + div {
        border-left: 0;
    }

    .dashboard-target-summary > div:nth-child(even) {
        border-left: 1px solid #e4e7ec;
    }
}

@media (max-width: 576px) {
    .page-title {
        line-height: 1.15;
    }

    .so-toolbar {
        align-items: stretch !important;
    }

    .so-toolbar .btn,
    .so-page-actions,
    .so-page-actions .btn,
    .so-page-actions form {
        width: 100%;
    }

    .so-media-preview,
    .so-media-placeholder {
        height: 240px;
    }

    textarea.font-monospace {
        font-size: 0.875rem;
    }

    .track-hero {
        flex-direction: column;
    }

    .portal-action-bar .btn {
        width: 100%;
    }

    .production-photo-upload,
    .production-photo-upload .form-control,
    .production-photo-upload .btn {
        width: 100%;
    }

    .production-photo-admin-grid,
    .production-photo-gallery {
        grid-template-columns: 1fr;
    }

    .production-photo-admin-meta,
    .production-photo-card-body {
        align-items: stretch;
        flex-direction: column;
    }

    .production-photo-card-body .btn,
    .production-photo-admin-meta .btn,
    .production-photo-admin-meta form {
        width: 100%;
    }

    .portal-player-card-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-target-summary {
        grid-template-columns: 1fr;
    }

    .dashboard-target-summary > div:nth-child(even) {
        border-left: 0;
    }

    .dashboard-target-summary > div + div {
        border-top: 1px solid #e4e7ec;
    }
}
