.tech-units-section {
    padding: 2rem 0 4rem;
}

.units-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.units-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
}

.toolbar-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-tool {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s, border-color 0.2s;
}

.btn-tool:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-clear {
    background: #fef3e8;
    border-color: #f5c99a;
    color: #b45309;
}

.btn-print {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.btn-print:hover {
    background: var(--primary-light);
    color: #fff;
}

.units-filters {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

.filter-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr auto auto;
    gap: 1rem;
    align-items: end;
}

.filter-group label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.filter-group input,
.filter-group select {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.88rem;
    background: var(--bg);
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(11, 79, 122, 0.12);
}

.btn-filter-submit {
    padding: 0.55rem 1.25rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    white-space: nowrap;
    height: fit-content;
}

.btn-filter-submit:hover {
    background: var(--primary-light);
}

.units-summary {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.print-only {
    display: none;
}

.table-wrap {
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.units-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.units-table thead {
    background: linear-gradient(180deg, #e8f2fa 0%, #dceaf5 100%);
}

.units-table th {
    padding: 0.85rem 1rem;
    text-align: right;
    font-weight: 700;
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
    white-space: nowrap;
}

.units-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
    line-height: 1.6;
}

.units-table tbody tr:hover {
    background: #f8fafc;
}

.units-table tbody tr:nth-child(even) {
    background: #fafbfc;
}

.units-table tbody tr:nth-child(even):hover {
    background: #f0f6fb;
}

.units-table a {
    color: var(--primary-light);
    word-break: break-all;
}

.units-table a:hover {
    color: var(--accent);
    text-decoration: underline;
}

.status-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
}

.status-رشد {
    background: #d1fae5;
    color: #065f46;
}

.status-پسارشد {
    background: #dbeafe;
    color: #1e40af;
}

.text-muted {
    color: var(--text-muted);
}

.empty-row {
    text-align: center;
    padding: 2.5rem !important;
    color: var(--text-muted);
}

.units-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.page-link {
    padding: 0.5rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--primary);
}

.page-link:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.page-info {
    font-size: 0.88rem;
    color: var(--text-muted);
}

@media (max-width: 1024px) {
    .filter-row {
        grid-template-columns: 1fr 1fr;
    }

    .filter-search {
        grid-column: 1 / -1;
    }

    .btn-filter-submit {
        grid-column: 1 / -1;
        width: 100%;
        padding: 0.75rem;
    }
}

@media (max-width: 768px) {
    .units-table thead {
        display: none;
    }

    .units-table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 0.5rem;
    }

    .units-table td {
        display: block;
        border: none;
        padding: 0.4rem 0.75rem;
    }

    .units-table td::before {
        content: attr(data-label) ": ";
        font-weight: 700;
        color: var(--primary);
        font-size: 0.78rem;
    }
}

@media print {
    .no-print,
    .site-header,
    .top-bar,
    .site-footer,
    .page-banner {
        display: none !important;
    }

    .print-only {
        display: inline !important;
    }

    .tech-units-section {
        padding: 0;
    }

    .units-table {
        font-size: 0.75rem;
    }

    .units-table th,
    .units-table td {
        padding: 0.4rem 0.5rem;
    }

    .units-table a {
        color: #000;
    }

    .status-badge {
        border: 1px solid #999;
        background: none !important;
        color: #000 !important;
    }
}
