* {
    box-sizing: border-box;
    margin: 0;
}

html,
body {
    height: 100%;
    overflow: hidden;
    font-family: "Segoe UI", sans-serif;
    color: #fff;
}

p {
    margin: 0;
    font-size: 12px;
    color: var(--help-color);
}

.page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100vw;
    padding: 16px;
    gap: 16px;
}

.bottom {

    position: relative;
    display: flex;
    gap: 16px;
    flex: 1;
    min-height: 0;
}

.left {

    background-color: #10151cf5;
    top: 0;
    left: 0;
    height: 100%;
    z-index: 2000;
    overflow-y: auto;
    width: 350px;
    min-width: 350px;
}

.right {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-height: -webkit-fill-available;
}

.fl_row {
    display: flex;
    gap: 20px;
    align-items: center;
}

.fl_row label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.left,
.right>div {
    border: 1px solid var(--track-color);
    border-radius: 10px;
}

.right>div {
    padding: 10px;
}

.disable {
    pointer-events: none;
    opacity: 0.3;
}

.top {
    padding: 12px 16px;
    overflow-y: auto;
    border-radius: 10px;
    background: linear-gradient(to bottom, rgba(22, 29, 38, 1) 30%, rgba(22, 29, 38, 0.5) 60%, rgba(22, 29, 38, 0.0) 100%);
    font-weight: bold;
    color: var(--text-color);
}

@media (max-width: 830px) {
    .left {
        width: 100%;
        min-width: unset;
    }

    .results-row.result {
        display: flex !important;
        max-height: 100%;
    }
}

@media (min-width: 1201px) {
    .left.close {
        width: 40px !important;
        min-width: 40px !important;
        overflow-y: unset;
    }
}

@media (min-width: 561px) and (max-width: 1200px) {
    .left {
        position: absolute !important;
        width: 350px;
        min-width: 350px;
    }

    .left.close {
        width: 40px !important;
        min-width: 40px !important;
        overflow-y: unset;
    }

    .bottom {
        padding-left: 50px;
    }
}

@media (max-width: 560px) {
    .left.close {
        position: absolute;
        width: 100%;
        height: 40px !important;
        min-height: 40px !important;
        overflow-y: unset !important;
        top: 0;
        left: 0;
    }

    .left:not(.close) {
        position: absolute !important;
    }

    .bottom {
        position: relative;
        flex-direction: column;
        padding-top: 50px;
    }
}

.FreeWin .resize-handle {
    position: sticky;
    right: 100vw;
    left: 100vw;
    bottom: -10px;
    margin-right: -10px;
    width: 14px;
    height: 14px;
    cursor: se-resize;
    background: rgba(255, 255, 255, 0.5);
    user-select: none;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.5) 25%, transparent 25%) -4px 0,
        linear-gradient(225deg, rgba(255, 255, 255, 0.5) 25%, transparent 25%) -4px 0;
    background-size: 8px 8px;
    background-repeat: repeat;
}

#results .close-btn {
    display: none;
}

.FreeWin .close-btn {
    display: inline !important;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
}

.FreeWin .close-btn:hover {
    color: #e74c3c;
    /* رنگ هنگام هاور */
}

.FreeWin {
    position: fixed !important;
    background-color: var(--bg-color);
    height: 70vh;
    width: 70vw;
    border: 1px solid var(--brand-color) !important;
    z-index: 3000;
}

.FreeWin h3 {
    position: sticky;
    margin: 0;
    top: -40px;
    cursor: move;
    margin-top: -40px;
    z-index: 10;
    user-select: none;
}

.results-row {
    display: flex;
    flex-wrap: wrap;
    padding: 10px;
}

.results-row.result {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/*///////////////////////*/
.design-panel {
    font-family: "Inter", "Segoe UI", sans-serif;
    color: #e5e7eb;
    padding: 18px;
    max-width: 720px;
    width: 100%;
    border-radius: 10px;
    border: 1px solid var(--track-color);
}

.result-banner {
    display: flex;
    gap: 14px;
    padding: 14px;
    border-radius: 10px;
    margin-bottom: 16px;
}

.result-banner.pass {
    background: linear-gradient(135deg, #16a34a, #22c55e);
}

.result-icon {
    font-size: 28px;
}

.result-title {
    font-weight: 700;
    letter-spacing: 1px;
}

.result-sub {
    font-size: 12px;
    opacity: 0.85;
}

.block-holder {
    grid: 1ft 1ft;
    display: grid;
    grid-template-columns: 1fr 1fr;
    flex-wrap: wrap;
    grid-area: auto;
    grid-auto-columns: max-content;
    gap: 10px;
}

.block {
    min-width: 220px;
    background: #11171e;
    border-radius: 10px;
    padding: 14px;
    margin-top: 14px;
    box-shadow: inset 0 0 0 1px #1f2937;
}

.block>header {
    font-size: 11px;
    color: #38bdf8;
    margin-bottom: 10px;
    text-transform: uppercase;
    border-bottom: 1px solid #1e293b;
    padding-bottom: 6px;
}

.check-grid {
    position: relative;
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 8px 12px;
    font-size: 13px;
}

.check-grid.grid2 {
    grid-template-columns: 2fr auto !important;
}

.formula {
    grid-column: span 1;
    font-family: monospace;
}

.ok {
    color: #22c55e;
    font-weight: 600;
}

.NA {
    color: #bac522;
    font-weight: 600;
}

.Nok {
    color: #eb1b00ff;
    font-weight: 600;
}

.des {
    color: #a7a4a4;
    font-size: smaller;
}

.result-banner.fail {
    background: linear-gradient(135deg, #991b1b, #dc2626);
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.4);
}

.result-banner.fail .result-icon {
    color: #fee2e2;
}

.result-banner.fail .result-title {
    color: #fff;
}

.result-banner.fail .result-sub {
    color: #fecaca;
    font-weight: 500;
}

.inline-stats {
    display: flex;
    justify-content: space-around;
    font-size: 13px;
    text-align: center;
}

.inline-stats span,
.rebar-list li span {
    color: #94a3b8;
    display: block;
}

.inline-stats b {
    font-size: 15px;
}

/*
.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
*/
.rebar-list {
    list-style: none;
    padding: 0;
    font-size: 13px;
}

.rebar-list li {
    padding: 4px 0;
    display: flex;
}

.weight {
    color: #facc15;
    font-weight: 600;
}

.total-bar {
    display: flex;
    justify-content: space-between;
    padding: 14px;
    border-radius: 10px;
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    font-size: 14px;
}

.total-bar>div {
    display: flex;
    flex-direction: column;
    text-align: center;
}

/*///////////////////// Load Input //////*/

.panel-header {
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 18px;
    color: #38bdf8;
}

.design-grid {
    display: grid;
    gap: 16px;
}

.design-card {
    background: #11171e;
    ;
    border-radius: 12px;
    padding: 14px;
    box-shadow: inset 0 0 0 1px #1e293b;
}

/*
.design-card.highlight {
    box-shadow: inset 0 0 0 2px #38bdf8;
}
*/

.row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 8px;
    padding: 6px 0;
    font-size: 13px;
}

.row span:last-child {
    text-align: right;
}

.row.ok {
    color: #22c55e;
}

.row.warn {
    color: #facc15;
}

.row.final {
    font-weight: 600;
    border-top: 1px dashed #334155;
    margin-top: 6px;
    padding-top: 8px;
}

.badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    width: fit-content;
    height: fit-content;
    margin: auto;
}

.badge.ok {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.badge.Nok {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.badge.NA {
    background: rgb(188, 201, 20, 0.15);
    color: #bac522;
}

/*//////////////////////  Menu  */
.design-panel {
    position: relative;
}

/* HAMBURGER */
.panel-menu {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 24px;
    height: 22px;
    cursor: pointer;
    z-index: 9999;
    pointer-events: auto;
}

.panel-menu span {
    display: block;
    height: 3px;
    background: var(--brand-color);
    margin: 4px 0;
    border-radius: 3px;
}

/* MENU BOX */
.panel-dropdown {
    position: absolute;
    top: 48px;
    right: 12px;
    background: var(--track-color);
    border-radius: 10px;
    min-width: 180px;
    display: none;
    flex-direction: column;
    z-index: 9999;
    overflow: hidden;
}

.panel-dropdown .menu-item {
    padding: 12px 16px;
    color: #eee;
    cursor: pointer;
}

.panel-dropdown .menu-item:hover {
    background: #1e88e5;
}

/*//////////////////// Menu-Config ////////*/

#Menu-Config {
    position: relative;
    display: none;
    margin-top: 10px;
}

.form-grid>div:nth-child(2) {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
}

#Menu-Config .configHeader {
    color: var(--text-color);
}

#Menu-Config .configHeader p {
    font-size: 12px;
    color: var(--help-color);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--help-color);
}

.form-group .note {
    font-size: 11px;
    color: #888;
    font-weight: 400;
}

/* INPUT + SELECT */
.form-group input {
    height: 40px;
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 6px;
    background: var(--container-bg);
    transition: 0.2s ease;
    color: var(--help-color);
    border-radius: 6px;
    line-height: 30px;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
    outline: none;
}

/*////////////// Apply Buttom */
.btn {
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 26px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.4px;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(31, 122, 224, 0.25);
    transition: all 0.25s ease;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.btn-apply {
    background: linear-gradient(135deg, #1f7ae0, #145bb5);

}

.btn-other {
    background: linear-gradient(135deg, #16a34a, #22c55e);
    min-width: 200px;
    margin: auto;
}

.uploadExcel p {
    display: block !important;
    margin-left: 15px;
    line-height: 34px;
}

/* Hover */
.btn-apply:hover {
    background: linear-gradient(135deg, #145bb5, #0f4690);
    box-shadow: 0 8px 18px rgba(31, 122, 224, 0.35);
    transform: translateY(-1px);
}

/* Active (Click) */
.btn-apply:active {
    transform: translateY(0);
    box-shadow: 0 4px 10px rgba(31, 122, 224, 0.2);
}

/* Disabled state */
.btn-apply:disabled {

    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.8;
}

.dropdown-toggle {
    position: absolute;
    background-color: unset;
    border: unset;
    color: var(--brand-color);
    width: 10px;
    bottom: auto;
    top: 10px;
    outline: none;
    right: 20px;
}

.arrow {
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--brand-color);
    border-bottom: 2px solid var(--brand-color);
    transform: rotate(-135deg);
    transition: transform 0.25s ease;
    display: inline-block;
    cursor: pointer;
}

.arrow.leftArrow {
    transform: rotate(135deg) !important;
}

.arrow.open {
    transform: rotate(45deg);

}

.left.close #dataForm {
    display: none;
}

.left.close .arrow.leftArrow {
    transform: rotate(-45deg) !important;
}

.left.close .main-wins-header {
    text-orientation: sideways;
    height: 100%;
    top: 0;
    left: auto;
    right: 0;
    bottom: 0;
    padding: 5px;
    padding-left: 10px;
    padding-top: 10px;
    font-size: 12px;
    color: var(--help-color);
    border-radius: 10px;
}

#Menu-Config.compact {
    height: 40px;
}

/*/////////////////////////////////////// Auto Result table */
.auto-result-box {
    position: relative;
    border-radius: 10px;
    padding: 16px;
    margin-top: 12px;
    color: var(--text-color, #c9d1d9);
    width: 100%;
    background: linear-gradient(180deg,
            rgba(30, 107, 184, 0.06),
            rgba(13, 17, 23, 0.6));
    border: 1px solid rgba(48, 54, 61, 0.8);
}

/* Title */
.result-title {
    color: #fff;
    font-size: 15px;
    margin-bottom: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* Table */
.auto-result-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 10px;
}

/* Header */
.auto-result-table thead {
    background: linear-gradient(180deg,
            rgba(88, 166, 255, 0.25),
            rgba(30, 107, 184, 0.25));
    color: #e6edf3;
}

.auto-result-table th {
    font-weight: 600;
    font-size: 12.5px;
    border-bottom: 1px solid rgba(88, 166, 255, 0.35);
}

/* Cells */
.auto-result-table th,
.auto-result-table td {
    padding: 8px 6px;
    text-align: center;
    border: 1px solid rgba(88, 166, 255, 0.12);
}

/* Rows */
.auto-result-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.025);
}

.auto-result-table tbody tr:hover {
    background: rgba(88, 166, 255, 0.12);
    transition: background 0.15s ease-in-out;
}

/* Results */
.res-ok {
    color: #3fb950;
    font-weight: 600;
}

.res-failed {
    color: #f85149;
    font-weight: 600;
}

/* Failed row emphasis */
.failed-row {
    background: rgba(248, 81, 73, 0.08);
}

.detail-link {
    color: #58a6ff;
    text-decoration: none;
    font-weight: 500;
}

.detail-link:hover {
    text-decoration: underline;
}

/*////Menu Passed*/
.auto-result-header {
    position: absolute;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    top: 10px;
    right: 10px;
}

.result-filter {
    display: flex;
    gap: 6px;
}

.result-filter label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 12px;
    color: #9fb3c8;
}

.result-filter input {
    display: none;
}

.result-filter span {
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid rgba(88, 166, 255, 0.3);
    transition: all 0.15s ease;
}

/* Active */
.result-filter input:checked+span {
    background: rgba(88, 166, 255, 0.25);
    color: #ffffff;
    border-color: #58a6ff;
}

/* Hover */
.result-filter span:hover {
    background: rgba(88, 166, 255, 0.15);
}

/*/////////// print */
.main-wins-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 18px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.print-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-color);
}

.print-btn:hover {
    color: #0077cc;
}

.close-btn {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
}
