﻿
* {
    box-sizing: border-box;
}

.batch-page {
    direction: rtl;
    width: 100%;
    min-height: 100vh;
    padding: 24px 28px 40px;
    background: #f6f9fb;
    color: #123447;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.title-area {
    display: flex;
    align-items: center;
    gap: 14px;
}

.title-area h1 {
    margin: 0;
    color: #006b70;
    font-size: 34px;
    font-weight: 800;
}

.title-area p {
    margin: 4px 0 0;
    color: #81909b;
    font-size: 14px;
}

.title-badge {
    width: 48px;
    height: 48px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    color: #00787d;
    background: #e8f5f5;
    font-size: 24px;
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.ai-btn,
.back-btn,
.small-ai-btn,
.add-row,
.action-btn,
.row-menu,
.row-actions-menu button {
    font-family: inherit;
    cursor: pointer;
}

.ai-btn {
    border: 0;
    border-radius: 11px;
    background: #087d82;
    color: #fff;
    min-height: 46px;
    padding: 0 18px;
    font-weight: 700;
    font-size: 15px;
}

.ai-btn span {
    display: inline-grid;
    place-items: center;
    min-width: 34px;
    height: 30px;
    margin-left: 8px;
    border-radius: 8px;
    background: rgba(255,255,255,.17);
}

.back-btn {
    min-width: 108px;
    min-height: 46px;
    border: 1px solid #078188;
    border-radius: 10px;
    background: #fff;
    color: #006b70;
    font-size: 16px;
    font-weight: 700;
}

.batch-info,
.table-card,
.summary-card {
    background: #fff;
    border: 1px solid #d8e4e9;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(16, 60, 75, .03);
}

.batch-info {
    display: grid;
    grid-template-columns: 1.15fr 1fr 1.2fr 1fr;
    gap: 22px;
    align-items: end;
    padding: 20px 24px;
    margin-bottom: 20px;
}

.info-box label,
.user-box > label {
    display: block;
    color: #006b70;
    font-size: 14px;
    font-weight: 800;
    margin-bottom: 8px;
}

.batch-number,
.info-box input,
.info-box select {
    width: 100%;
    height: 46px;
    border: 1px solid #cad9df;
    border-radius: 9px;
    background: #fff;
    padding: 0 14px;
    color: #16384a;
    font-size: 15px;
}

.batch-number {
    display: flex;
    align-items: center;
    justify-content: center;
    border-color: #00949a;
    color: #005d63;
    font-weight: 800;
    font-size: 17px;
    direction: ltr;
}

.user-name {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #e8f5f5;
    color: #00757a;
    font-weight: 800;
}

.user-copy {
    display: flex;
    flex-direction: column;
}

.user-copy strong {
    color: #17384a;
}

.user-copy span {
    color: #8b9aa3;
    font-size: 12px;
    margin-top: 2px;
}

.table-card {
    position: relative;
    padding: 0 0 14px;
    overflow: visible;
    margin-bottom: 18px;
}

.table-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px 12px;
}

.table-title-row h2 {
    margin: 0;
    color: #006b70;
    font-size: 19px;
    font-weight: 800;
}

.table-title-row span {
    display: block;
    margin-top: 4px;
    color: #95a1a8;
    font-size: 12px;
}

.small-ai-btn {
    border: 1px solid #b9dedf;
    border-radius: 9px;
    background: #eefafa;
    color: #00757a;
    min-height: 40px;
    padding: 0 14px;
    font-weight: 700;
}

.table-scroll {
    width: 100%;
    overflow-x: auto;
    border-top: 1px solid #dbe6ea;
    border-bottom: 1px solid #dbe6ea;
}

.batch-table {
    width: 100%;
    min-width: 1320px;
    border-collapse: collapse;
    table-layout: fixed;
    direction: rtl;
}

.batch-table th {
    height: 48px;
    padding: 8px 9px;
    background: #06767b;
    color: #fff;
    border-left: 1px solid rgba(255,255,255,.18);
    font-size: 13px;
    font-weight: 800;
    text-align: center;
    white-space: nowrap;
}

.batch-table th small {
    display: block;
    font-size: 10px;
    opacity: .9;
}

.batch-table td {
    position: relative;
    height: 52px;
    padding: 0;
    background: #fff;
    border-left: 1px solid #d8e3e8;
    border-bottom: 1px solid #d8e3e8;
    text-align: center;
    vertical-align: middle;
}

.batch-table tbody tr:hover td {
    background: #fbfefe;
}

.batch-table input,
.batch-table select {
    width: 100%;
    height: 51px;
    border: 0;
    outline: 0;
    background: transparent;
    padding: 0 10px;
    color: #17384a;
    text-align: center;
    font-family: inherit;
    font-size: 13px;
}

.batch-table input:focus,
.batch-table select:focus {
    box-shadow: inset 0 0 0 2px #00a0a5;
    background: #f4ffff;
}

.money-input {
    direction: ltr;
    font-variant-numeric: tabular-nums;
}

.number-col,
.row-number {
    width: 54px;
}

.row-number {
    font-weight: 800;
    color: #17384a;
}

.actions-col {
    width: 66px;
}

.calculated-cell {
    direction: ltr;
    color: #005c63;
    font-size: 15px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.bonus-cell {
    direction: ltr;
    background: #fff8e9 !important;
    color: #a86800;
    font-weight: 900;
    font-size: 15px;
}

.bonus-cell small {
    font-size: 10px;
    font-weight: 700;
    margin-left: 3px;
}

.row-menu {
    width: 38px;
    height: 31px;
    border: 0;
    border-radius: 8px;
    background: #edf4f6;
    color: #007078;
    font-weight: 900;
    letter-spacing: 1px;
}

.row-actions-menu {
    position: absolute;
    z-index: 50;
    left: 6px;
    top: 44px;
    width: 140px;
    padding: 6px;
    border: 1px solid #d6e2e7;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(18,52,71,.16);
}

.row-actions-menu button {
    display: block;
    width: 100%;
    border: 0;
    border-radius: 7px;
    background: transparent;
    padding: 9px 8px;
    text-align: right;
    color: #17384a;
}

.row-actions-menu button:hover {
    background: #f1f7f8;
}

.row-actions-menu button.danger {
    color: #c52c2c;
}

.add-row {
    display: block;
    margin: 14px 14px 0 auto;
    min-height: 39px;
    padding: 0 15px;
    border: 1px dashed #61b8bb;
    border-radius: 9px;
    background: #f8ffff;
    color: #00757a;
    font-size: 14px;
    font-weight: 800;
}

.summary-card {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    padding: 14px 10px;
    margin-bottom: 18px;
}

.summary-item {
    min-height: 68px;
    padding: 5px 12px;
    text-align: center;
    border-left: 1px solid #dbe5e9;
}

.summary-item:last-child {
    border-left: 0;
}

.summary-item span {
    display: block;
    margin-bottom: 7px;
    color: #006b70;
    font-size: 13px;
    font-weight: 800;
}

.summary-item strong {
    display: inline-block;
    min-width: 110px;
    padding: 7px 9px;
    border: 1px solid #d3e0e5;
    border-radius: 7px;
    background: #f9fbfc;
    direction: ltr;
    color: #123447;
    font-size: 17px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.bonus-summary strong {
    color: #a86800;
    background: #fffaf0;
}

.action-bar {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 18px;
    max-width: 1000px;
    margin: 0 auto;
}

.action-btn {
    min-height: 52px;
    border: 0;
    border-radius: 9px;
    color: #fff;
    font-size: 16px;
    font-weight: 800;
}

.save-btn {
    background: #079895;
}

.close-btn {
    background: #219447;
}

.print-btn {
    background: #087e94;
}

.more-btn {
    background: #284f73;
}

.bonus-info {
    max-width: 1000px;
    margin: 15px auto 0;
    padding: 12px 16px;
    border: 1px solid #ead6a8;
    border-radius: 10px;
    background: #fffaf0;
    color: #6c5731;
    text-align: center;
    font-size: 13px;
}

.bonus-info span {
    margin: 0 8px;
    color: #c99a3b;
}

@media (max-width: 1100px) {
    .batch-info {
        grid-template-columns: repeat(2, 1fr);
    }

    .summary-card {
        grid-template-columns: repeat(3, 1fr);
    }

    .summary-item:nth-child(3) {
        border-left: 0;
    }

    .action-bar {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 700px) {
    .batch-page {
        padding: 16px 12px 30px;
    }

    .page-header {
        align-items: stretch;
        flex-direction: column;
    }

    .header-actions {
        flex-wrap: wrap;
    }

    .title-area h1 {
        font-size: 27px;
    }

    .batch-info {
        grid-template-columns: 1fr;
    }

    .summary-card {
        grid-template-columns: repeat(2, 1fr);
    }

    .summary-item {
        border-bottom: 1px solid #dbe5e9;
    }

    .action-bar {
        grid-template-columns: 1fr;
    }
}
