:root{
    --ink:#17212d;
    --muted:#687484;
    --line:#e5e9ee;
    --surface:#ffffff;
    --page:#f8f9fc;
    --canvas:#f4f6f8;
    --brand:#8b1e2d;
    --brand-dark:#6e1724;
    --soft-brand:#fff5f7;
    --radius:18px;
}

*{
    box-sizing:border-box;
}

html{
    scroll-behavior:smooth;
}

body{
    margin:0;
    color:var(--ink);
    background:var(--page);
    font-family:'Poppins',sans-serif;
    font-size:14px;
    line-height:1.5;
    overflow-x:hidden;
}

button,
input,
select{
    font:inherit;
}

button{
    cursor:pointer;
}

.studio-page{
    width:min(1220px,calc(100% - 40px));
    margin:0 auto;
    padding:60px 0 58px;
}

.studio-heading{
    margin-bottom:28px;
}

.eyebrow{
    margin:0 0 6px;
    color:var(--brand);
    font-size:12px;
    font-weight:800;
    letter-spacing:3px;
}

.studio-heading h1{
    margin:0 0 7px;
    color: #222;
    font-size:36px;
    line-height:1.2;
    font-weight:800;
}

.studio-heading > p:last-child{
    margin:0;
    color:var(--muted);
    font-size:14px;
}

.studio-layout{
    display:grid;
    grid-template-columns:minmax(0,1.5fr) minmax(330px,.78fr);
    gap:24px;
    align-items:start;
}

.preview-panel,
.control-panel{
    background:var(--surface);
    border:1px solid var(--line);
    border-radius:var(--radius);
    box-shadow:0 10px 28px rgba(27,42,57,.06);
}

.preview-panel{
    padding:24px;
}

.control-panel{
    padding:24px;
}

.preview-panel__header,
.section-label,
.range-label{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
}

.preview-panel__header{
    margin-bottom:17px;
}

.panel-kicker{
    margin:0 0 3px;
    color:var(--brand);
    font-size:10px;
    font-weight:800;
    letter-spacing:2px;
}

.preview-panel__header h2{
    margin:0;
    color:var(--ink);
    font-size:21px;
    line-height:1.25;
    font-weight:800;
}

.selected-color{
    flex:0 0 auto;
    padding:6px 11px;
    border:1px solid var(--line);
    border-radius:999px;
    color:var(--brand);
    background:#fff;
    font-size:11px;
    font-weight:700;
}

.design-canvas{
    position:relative;
    isolation:isolate;
    width:100%;
    height:560px;
    overflow:hidden;
    border:1px solid #edf0f3;
    border-radius:14px;
    background:
        linear-gradient(45deg,#f0f2f4 25%,transparent 25%),
        linear-gradient(-45deg,#f0f2f4 25%,transparent 25%),
        linear-gradient(45deg,transparent 75%,#f0f2f4 75%),
        linear-gradient(-45deg,transparent 75%,#f0f2f4 75%);
    background-size:24px 24px;
    background-position:0 0,0 12px,12px -12px,-12px 0;
}

.design-canvas::before{
    content:"";
    position:absolute;
    inset:14px;
    z-index:0;
    border:1px dashed #dce2e7;
    border-radius:10px;
    pointer-events:none;
}

.garment-stage{
    position:absolute;
    z-index:1;
    top:5%;
    left:11%;
    width:78%;
    height:90%;
    pointer-events:none;
}

.garment-image,
.garment-color{
    position:absolute;
    inset:0;
    width:100%;
    height:100%;
    object-fit:contain;
}

.garment-image{
    position:absolute;
    inset:0;
    width:100%;
    height:100%;
    object-fit:contain;
    z-index:2;
    display:block;
    user-select:none;
    pointer-events:none;
}

.garment-color{
    position:absolute;
    inset:0;
    z-index:3;
    background:transparent;
    opacity:0;
    pointer-events:none;

    -webkit-mask-image:var(--mask-image);
    mask-image:var(--mask-image);
    -webkit-mask-repeat:no-repeat;
    mask-repeat:no-repeat;
    -webkit-mask-position:center;
    mask-position:center;
    -webkit-mask-size:contain;
    mask-size:contain;

    mix-blend-mode:multiply;
}

.design-layers{
    position:absolute;
    inset:0;
    z-index:5;
}

.design-element{
    position:absolute;
    min-width:30px;
    min-height:32px;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:4px 8px;
    border:2px solid transparent;
    border-radius:8px;
    transform:translate(-50%,-50%);
    line-height:1;
    white-space:nowrap;
    user-select:none;
    cursor:grab;
    touch-action:none;
}

.design-element.is-selected{
    border-color:rgba(139,30,45,.8);
    background:rgba(255,255,255,.16);
}

.design-element.is-dragging{
    cursor:grabbing;
}

.element-text{
    text-align:center;
}

.element-image{
    padding:0;
    min-width:0;
    min-height:0;
}

.element-image img{
    display:block;
    width:100%;
    height:100%;
    object-fit:contain;
    pointer-events:none;
    user-select:none;
}

.resize-handle{
    position:absolute;
    right:-8px;
    bottom:-8px;
    width:15px;
    height:15px;
    border:2px solid #fff;
    border-radius:4px;
    background:var(--brand);
    box-shadow:0 2px 7px rgba(0,0,0,.18);
    opacity:0;
    cursor:nwse-resize;
}

.design-element.is-selected .resize-handle{
    opacity:1;
}

.canvas-hint{
    position:absolute;
    left:50%;
    bottom:20px;
    z-index:8;
    width:max-content;
    max-width:calc(100% - 36px);
    margin:0;
    padding:8px 13px;
    border-radius:999px;
    color:#71808c;
    background:rgba(255,255,255,.92);
    box-shadow:0 3px 12px rgba(0,0,0,.06);
    font-size:11px;
    text-align:center;
    transform:translateX(-50%);
    pointer-events:none;
}

.canvas-hint i{
    margin-right:5px;
}

.preview-note{
    display:flex;
    align-items:flex-start;
    gap:6px;
    margin:12px 0 0;
    color:var(--muted);
    font-size:11px;
}

.preview-note i{
    margin-top:2px;
    color:var(--brand);
}

.control-group{
    margin:0 0 20px;
    padding:0;
    border:0;
}

.control-group > label,
.control-group legend,
.editor-tool > label,
.element-controls label{
    display:block;
    margin:0 0 7px;
    padding:0;
    color:var(--ink);
    font-size:12px;
    font-weight:700;
}

select,
input[type="text"]{
    width:100%;
    height:42px;
    padding:0 12px;
    border:1px solid #d9e0e6;
    border-radius:10px;
    outline:none;
    color:var(--ink);
    background:#fff;
}

select{
    appearance:none;
    padding-right:40px;
    background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2317212d' stroke-width='1.8'%3E%3Cpath d='m3 6 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 13px center;
}

select:focus,
input:focus,
button:focus-visible,
.upload-box:focus-within{
    outline:3px solid rgba(139,30,45,.16);
    outline-offset:2px;
}

.color-options{
    display:grid;
    grid-template-columns:repeat(5,1fr);
    gap:8px;
}

.color-choice{
    position:relative;
    width:100%;
    height:40px;
    display:grid;
    place-items:center;
    border:1px solid #e0e4e8;
    border-radius:9px;
    background:#fff;
}

.color-choice span{
    width:25px;
    height:25px;
    border:1px solid rgba(0,0,0,.14);
    border-radius:50%;
}

.color-choice.is-active{
    border:2px solid var(--brand);
    background:var(--soft-brand);
}

.color-choice.is-active::after{
    content:none;
    display:none;
}

.tool-tabs{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:3px;
    margin:0 0 16px;
    padding:3px;
    border-radius:10px;
    background:#f1f3f5;
}

.tool-tab{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:6px;
    min-height:38px;
    border:0;
    border-radius:8px;
    color:var(--muted);
    background:transparent;
    font-size:11px;
    font-weight:700;
}

.tool-tab.is-active{
    color:var(--brand);
    background:#fff;
    box-shadow:0 1px 5px rgba(19,30,42,.09);
}

.text-add-row{
    display:grid;
    grid-template-columns:1fr 42px;
    gap:8px;
}

.icon-button{
    border:0;
    border-radius:10px;
    color:#fff;
    background:var(--brand);
    font-size:22px;
    font-weight:600;
}

.upload-box{
    display:flex;
    align-items:center;
    gap:12px;
    min-height:62px;
    padding:12px;
    border:1.5px dashed #c8d0d7;
    border-radius:11px;
    cursor:pointer;
    background:#fff;
}

.upload-box:hover{
    border-color:var(--brand);
    background:#fff9fa;
}

.upload-icon{
    display:grid;
    place-items:center;
    flex:0 0 34px;
    width:34px;
    height:34px;
    border-radius:9px;
    color:var(--brand);
    background:#f9eaed;
    font-size:17px;
}

.upload-box strong,
.upload-box small{
    display:block;
}

.upload-box strong{
    font-size:12px;
}

.upload-box small{
    margin-top:2px;
    color:var(--muted);
    font-size:10px;
}

.tool-label{
    margin:13px 0 7px;
    color:var(--muted);
    font-size:10px;
    font-weight:700;
}

.quick-options{
    display:flex;
    flex-wrap:wrap;
    gap:7px;
}

.quick-option{
    min-width:36px;
    height:34px;
    border:1px solid #d9e0e6;
    border-radius:8px;
    color:var(--ink);
    background:#fff;
    font-size:16px;
}

.quick-option:hover{
    border-color:var(--brand);
    color:var(--brand);
    background:var(--soft-brand);
}

.quick-option--logo{
    font-size:11px;
    font-weight:800;
}

.element-controls,
.layers-panel{
    margin-top:20px;
    padding-top:18px;
    border-top:1px solid var(--line);
}

.section-label h3{
    margin:0;
    font-size:13px;
    font-weight:800;
}

.section-label > span{
    color:var(--muted);
    font-size:11px;
}

.element-actions{
    display:flex;
    gap:10px;
}

.duplicate-button,
.delete-button{
    border:0;
    background:transparent;
    font-size:11px;
    font-weight:700;
}

.duplicate-button{
    color:var(--brand);
}

.delete-button{
    color:#b12635;
}

.font-label{
    margin-top:12px!important;
}

.control-grid{
    display:grid;
    grid-template-columns:1fr 86px;
    gap:12px;
    margin-top:12px;
    align-items:end;
}

.control-grid label{
    margin:0!important;
}

.control-grid output{
    float:right;
    color:var(--brand);
    font-size:10px;
}

.control-grid input[type="color"]{
    display:block;
    width:100%;
    height:32px;
    margin-top:5px;
    padding:2px;
    border:1px solid #d9e0e6;
    border-radius:7px;
}

input[type="range"]{
    width:100%;
    margin:8px 0 0;
    accent-color:var(--brand);
}

.format-row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    margin-top:12px;
}

.format-button,
.alignment button{
    min-width:36px;
    height:32px;
    border:1px solid #d9e0e6;
    border-radius:7px;
    color:var(--ink);
    background:#fff;
}

.format-button.is-active,
.alignment button.is-active{
    border-color:var(--brand);
    color:var(--brand);
    background:var(--soft-brand);
}

.alignment{
    display:flex;
    gap:5px;
}

.alignment button:nth-child(1){text-align:left}
.alignment button:nth-child(3){text-align:right}

.control-help{
    margin:10px 0 0;
    color:var(--muted);
    font-size:10px;
    line-height:1.5;
}

.layers-list{
    display:grid;
    gap:7px;
    margin-top:11px;
}

.layer-item{
    display:flex;
    align-items:center;
    gap:9px;
    width:100%;
    min-height:40px;
    padding:7px 9px;
    border:1px solid var(--line);
    border-radius:9px;
    color:var(--ink);
    background:#fff;
    text-align:left;
}

.layer-item.is-active{
    border-color:var(--brand);
    background:#fff8f9;
}

.layer-badge{
    display:grid;
    place-items:center;
    flex:0 0 25px;
    width:25px;
    height:25px;
    border-radius:6px;
    color:var(--brand);
    background:#f9eaed;
    font-size:11px;
    font-weight:800;
}

.layer-name{
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    font-size:11px;
    font-weight:600;
}

.empty-layers{
    margin:0;
    color:var(--muted);
    font-size:11px;
}

.history-actions{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:8px;
    margin-top:19px;
}

.history-button{
    min-height:38px;
    border:1px solid #d9e0e6;
    border-radius:9px;
    color:var(--ink);
    background:#fff;
    font-size:11px;
    font-weight:600;
}

.history-button:disabled{
    opacity:.45;
    cursor:not-allowed;
}

.action-buttons{
    display:grid;
    gap:8px;
    margin-top:10px;
}

.button{
    min-height:43px;
    border:0;
    border-radius:10px;
    font-size:12px;
    font-weight:700;
}

.button--primary{
    color:#fff;
    background:var(--brand);
}

.button--primary:hover{
    background:var(--brand-dark);
}

.button--secondary{
    color:var(--ink);
    background:#eef1f3;
}

.button--secondary:hover{
    background:#e5e9ec;
}

.toast{
    position:fixed;
    left:50%;
    bottom:22px;
    z-index:1100;
    max-width:calc(100% - 32px);
    padding:10px 15px;
    border-radius:10px;
    color:#fff;
    background:#17212d;
    font-size:12px;
    opacity:0;
    pointer-events:none;
    transform:translate(-50%,12px);
    transition:.22s ease;
}

.toast.is-visible{
    opacity:1;
    transform:translate(-50%,0);
}

[hidden]{
    display:none!important;
}

footer{
    margin-top:auto;
}

@media(max-width:1050px){
    .nav-container{
        width:min(100% - 30px,1000px);
    }

    .menu{
        gap:18px;
    }

    .nav-right{
        gap:10px;
        margin-left:18px;
    }

    .search-box{
        width:210px;
    }

    .search-box input{
        width:210px;
    }

    .studio-layout{
        grid-template-columns:minmax(0,1.35fr) minmax(310px,.85fr);
    }
}

@media(max-width:900px){
    .nav-container{
        height:auto;
        min-height:76px;
        flex-wrap:wrap;
        padding:10px 0;
    }

    .navbar{
        height:auto;
    }

    .menu{
        order:3;
        width:100%;
        justify-content:center;
        margin:2px 0 0;
        padding-bottom:3px;
    }

    .nav-right{
        margin-left:auto;
    }

    .studio-page{
        padding-top:34px;
    }

    .studio-layout{
        grid-template-columns:1fr;
    }

    .control-panel{
        order:2;
    }

    .preview-panel{
        order:1;
    }
}

@media(max-width:650px){
    .nav-container{
        width:calc(100% - 24px);
    }

    .logo{
        width:130px;
    }

    .logo img{
        width:125px;
    }

    .menu{
        gap:12px;
        overflow-x:auto;
        justify-content:flex-start;
    }

    .menu a{
        white-space:nowrap;
        font-size:12px;
    }

    .nav-right{
        gap:7px;
    }

    .search-box{
        width:150px;
    }

    .search-box input{
        width:150px;
        height:40px;
        font-size:12px;
    }

    .btn-login{
        min-width:78px;
        height:40px;
        padding:0 12px;
        font-size:12px;
    }

    .studio-page{
        width:calc(100% - 24px);
        padding:28px 0 44px;
    }

    .studio-heading h1{
        font-size:29px;
    }

    .studio-heading{
        margin-bottom:20px;
    }

    .preview-panel,
    .control-panel{
        padding:17px;
        border-radius:15px;
    }

    .design-canvas{
        height:470px;
    }

    .garment-stage{
        top:4%;
        left:3%;
        width:94%;
        height:92%;
    }

    .color-options{
        grid-template-columns:repeat(5,1fr);
    }

    .color-choice{
        height:38px;
    }

    .color-choice span{
        width:23px;
        height:23px;
    }

    .canvas-hint{
        white-space:normal;
        width:max-content;
        max-width:calc(100% - 24px);
    }
}

@media(max-width:430px){
    .logo{
        width:110px;
    }

    .logo img{
        width:108px;
    }

    .search-box{
        width:125px;
    }

    .search-box input{
        width:125px;
    }

    .nav-right{
        margin-left:auto;
    }

    .studio-heading h1{
        font-size:26px;
    }

    .design-canvas{
        height:410px;
    }

    .color-options{
        gap:6px;
    }

    .color-choice{
        height:36px;
    }

    .color-choice span{
        width:21px;
        height:21px;
    }
}

.navbar .search-box {
    height: 42px !important;
    border-radius: 999px !important;
    overflow: hidden !important;
    background: #ffffff !important;
}

.navbar .search-box input {
    height: 42px !important;
    border: none !important;
    outline: none !important;
    border-radius: 999px !important;
    background: #ffffff !important;
    font-family: 'Poppins', sans-serif !important;
}

.navbar .search-box input:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* =========================================
   RINCIAN PESANAN DESIGN STUDIO
========================================= */

.order-detail-card {
    margin-top: 20px;
    padding: 18px;
    border: 1px solid #e3e3e3;
    border-radius: 14px;
    background: #fff;
}

.order-detail-header {
    margin-bottom: 14px;
}

.order-detail-header h2 {
    margin: 0 0 5px;
    color: #222;
    font-size: 18px;
    line-height: 1.25;
}

.order-detail-header p {
    margin: 0;
    color: #888;
    font-size: 12px;
    line-height: 1.5;
}

.design-order-rows {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.design-order-row {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.15fr) minmax(0, 1fr) 36px;
    gap: 8px;
    align-items: end;
    padding: 12px;
    border: 1px solid #e6e6e6;
    border-radius: 11px;
    background: #fafafa;
}

.design-order-field {
    min-width: 0;
}

.design-order-field label {
    display: block;
    margin-bottom: 6px;
    color: #333;
    font-size: 11px;
    font-weight: 700;
}

.design-order-field select {
    width: 100%;
    height: 42px;
    box-sizing: border-box;
    padding: 0 10px;
    border: 1px solid #ddd;
    border-radius: 9px;
    outline: none;
    background: #fff;
    color: #333;
    font: inherit;
    font-size: 13px;
}

.design-order-field select:focus {
    border-color: #9b1e32;
    box-shadow: 0 0 0 3px rgba(155,30,50,.08);
}

.design-quantity-control {
    display: grid;
    grid-template-columns: 38px minmax(40px, 1fr) 38px;
    height: 42px;
    overflow: hidden;
    border: 1px solid #ddd;
    border-radius: 9px;
    background: #fff;
}

.design-quantity-control button {
    border: 0;
    background: #fff;
    color: #222;
    font: inherit;
    font-size: 18px;
    cursor: pointer;
}

.design-quantity-control button:hover {
    background: #f4f4f4;
}

.design-qty-value {
    display: grid;
    place-items: center;
    border-right: 1px solid #eee;
    border-left: 1px solid #eee;
    color: #222;
    font-size: 13px;
    font-weight: 600;
}

.remove-design-row {
    width: 36px;
    min-width: 36px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid #ead2d7;
    border-radius: 9px;
    background: #fff;
    color: #9b1e32;
    cursor: pointer;
}

.remove-design-row:hover {
    background: #fff3f5;
}

.add-design-size {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 42px;
    margin-top: 12px;
    padding: 0 13px;
    border: 1px dashed #cfcfcf;
    border-radius: 9px;
    background: #fff;
    color: #333;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.add-design-size:hover {
    border-color: #9b1e32;
    color: #9b1e32;
    background: #fffafa;
}

.design-order-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 15px;
    padding-top: 14px;
    border-top: 1px solid #e7e7e7;
    color: #222;
    font-size: 14px;
}

.design-order-total strong {
    font-size: 16px;
    font-weight: 700;
}

@media (max-width: 650px) {
    .design-order-row {
        grid-template-columns: 1fr 1fr;
    }

    .design-quantity-field {
        grid-column: 1;
    }

    .remove-design-row {
        grid-column: 2;
        justify-self: end;
    }
}

@media (max-width: 430px) {
    .design-order-row {
        grid-template-columns: 1fr;
    }

    .design-quantity-field,
    .remove-design-row {
        grid-column: auto;
    }

    .remove-design-row {
        justify-self: start;
    }
}


/* FINAL ORDER DETAIL POLISH */
.order-detail-card{box-sizing:border-box;overflow:hidden;}
.design-order-row{grid-template-columns:minmax(90px,1fr) minmax(120px,1.2fr) minmax(120px,1fr) 42px;}
.design-quantity-control{min-width:0;}
.remove-design-row{width:42px;min-width:42px;}
@media(max-width:720px){.design-order-row{grid-template-columns:1fr 1fr;}.design-quantity-field{grid-column:auto;}.remove-design-row{justify-self:start;}}
@media(max-width:480px){.design-order-row{grid-template-columns:1fr;}.remove-design-row{justify-self:end;}}



/* FINAL COMPACT ORDER DETAIL - prevent quantity/action clipping */
.order-detail-card {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}
.design-order-row {
    grid-template-columns: minmax(0, .85fr) minmax(0, 1.05fr) minmax(118px, 1fr) 42px;
    gap: 8px;
    min-width: 0;
}
.design-order-field,
.design-quantity-field,
.design-quantity-control {
    min-width: 0;
}
.design-quantity-control {
    width: 100%;
    grid-template-columns: 34px minmax(32px, 1fr) 34px;
}
.design-quantity-control button {
    width: 34px;
    min-width: 34px;
}
.remove-design-row {
    width: 42px;
    min-width: 42px;
}
@media (max-width: 760px) {
    .design-order-row {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
    .design-quantity-field { grid-column: 1; }
    .remove-design-row { grid-column: 2; justify-self: end; }
}
@media (max-width: 480px) {
    .order-detail-card { padding: 14px; }
    .design-order-row { grid-template-columns: 1fr; }
    .design-quantity-field, .remove-design-row { grid-column: auto; }
    .remove-design-row { justify-self: end; }
}
