#p3 {
    display: grid;
    grid-template-areas:
        "staff_3p  acrl_3p "
        "position_3p   position_3p  "
    ;
    gap: 10px;
    grid-template-rows: auto;
    grid-template-columns: 1fr 1fr;
    width: 100%;
}

#staff_3p {
    grid-area: staff_3p;
    width: 100%;
}

#acrl_3p {
    grid-area: acrl_3p;
    width: 100%;
}

#acrl_3p table {
    width: 100%;
}

#position_3p {
    grid-area: position_3p;
    border-radius: 15px;
    background: #f3f6fb;
}

#table-datalist_3p {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 4px;
    font-size: 11pt;
    background-color: #f7f8fa;
}

#table-datalist_3p tr {
    background-color: #fff;
    transition: background-color 0.15s ease;
}

#table-datalist_3p tr:hover {
    background-color: #f1f5ff;
}

#table-datalist_3p td,
#table-datalist_3p th {
    padding: 6px 8px;
    border: 1px solid #e0e0e0;
    vertical-align: middle;
    text-align: center;
}

#table-datalist_3p_result {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 4px;
    background-color: #f7f8fa;
    margin-top: 6px;
}

#table-datalist_3p_result tr {
    background-color: #fff;
    transition: background-color 0.15s ease;
}

#table-datalist_3p_result tr:hover {
    background-color: #f1f5ff;
}

#table-datalist_3p_result tr:nth-child(2) {
    background-color: #f1f5ff;
}

#table-datalist_3p_result td,
#table-datalist_3p_result th {
    padding: 6px 8px;
    border: 1px solid #e0e0e0;
    vertical-align: middle;
    text-align: center;
}

#table-datalist_3p_result thead th {
    background: #f3f6fb;
    font-weight: 600;
    border-bottom: 2px solid #dbe1ea;
}

#table-datalist_3p_result td:first-child {
    text-align: left;
    font-weight: 500;
    color: #1f2937;
}

#table-datalist_3p_result td:not(:first-child) {
    font-variant-numeric: tabular-nums;
}

#table-datalist_3p_result tr.total-row {
    background: #eef4ff;
    font-weight: 600;
}


@keyframes hintFadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 480px) {


    #p3 {
        display: grid;
        grid-template-areas:
            "staff_3p"
            "acrl_3p"
            "position_3p "
        ;
        gap: 10px;
        grid-template-rows: auto;
        grid-template-columns: auto;
        width: 100%;
    }

}

.locsmeta_time,
.locsmeta_value {
    min-height: 32px;
    padding: 6px 8px;
    border: 1px solid #cfd8dc;
    border-radius: 6px;
    outline: none;
    background-color: #fafafa;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.locsmeta_time,
.locsmeta_value {
    text-align: center;
}

.locsmeta_time:focus,
.locsmeta_value:focus {
    border-color: #1e88e5;
    background-color: #fff;
    box-shadow: 0 0 0 2px rgba(30, 136, 229, 0.15);
}


#divstaff_3p {
    display: flex;
    flex-direction: column;
    height: 400px;
    border: 1px solid #d0d7de;
    border-radius: 12px;
    background: #ffffff;
    overflow: hidden;
    padding-top: 5px;
    margin-top: 10px;

}

#staff_3p {
    flex: 1;
    overflow-y: auto;
    position: relative;

}

.staff-table {
    width: 100%;
}

.staff-table thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #f3f6fb;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #dbe1ea;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.staff-table tbody tr {
    transition: background-color 0.2s ease;
}

.staff-table tbody tr:hover {
    background: #f7faff;
}

.staff-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #e6ebf2;
    vertical-align: middle;
}

.staff-table tbody tr:last-child td {
    border-bottom: none;
}

.staff-table input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #2563eb;
}

.staff-title {
    font-weight: 500;
}

.staff-table .staff_value {
    min-width: 100px;
    padding: 4px 6px;
    border: 1px solid #ccd4e0;
    border-radius: 4px;
    text-align: center;
}

.staff-table tbody tr:has(.smeta_staff:checked) {
    background: #e9f1ff;
    box-shadow: inset 3px 0 0 #2563eb;
}

#footstaff_3p {
    height: 36px;

    background: linear-gradient(to bottom,
            #f6f8fa,
            #eef2f6);

    border-top: 1px solid #d0d7de;

    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 12px;
    color: #6b7280;
}

.modalSmeta-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: none;
    z-index: 2000;
}

.modalSmeta3p-window {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    width: 80vw;
    border-radius: 12px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
    display: none;
    z-index: 2001;
    overflow: hidden;
}

.modalSmeta3p-window-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--color-gray-light);
    padding: 12px 20px;
    border-bottom: 1px solid var(--color-gray-medium);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap:16px
}


.modalSmeta3p-window-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

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

/* Кнопка Excel */
.modalSmeta3p-excel {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    border-radius: 10px;
    background: #1d6f42;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.modalSmeta3p-excel:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    opacity: 0.95;
}

.modalSmeta3p-excel .icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Кнопка закрытия */
.modalSmeta3p-close {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 10px;
    background: #fff;
    color: #444;
    font-size: 18px;
    cursor: pointer;
    transition: 0.2s ease;
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}

.modalSmeta3p-close:hover {
    background: #f5f5f5;
    transform: scale(1.05);
}

.modalSmeta3p-window-body {
    max-height: calc(90vh - 60px);
    overflow-y: auto;
    padding: 20px;
}


#smeta_3p table {
    width: 100%;
}

#smeta_3p td {
    padding: 6px 8px;
    border: 1px solid #ccc;
    vertical-align: middle;
}

#smeta_3p td[colspan="5"] {
    text-align: center;
    border: none;
}

#smeta_3p td:first-child {
    font-weight: 500;
    color: #444;
}

#table-smeta_3p {
    width: 100%;
    table-layout: fixed;

}

#table-smeta_3p td,
#table-smeta_3p th {
    overflow-wrap: break-word;
    word-break: break-word;
}

#acrl_3p {
    display: flex;
    flex-direction: column;
    height: 400px;
    border: 1px solid #d0d7de;
    border-radius: 12px;
    background: #ffffff;
    overflow: hidden;
    padding-top: 5px;
    margin-top: 10px;
}

.acrl-body {
    flex: 1;
    overflow-y: auto;
}


#acrl_3p table {
    width: 100%;
}


#table_acrl_3p td {
    padding: 10px 12px;
    border-bottom: 1px solid #e6ebf2;
    vertical-align: middle;
}

#table_acrl_3p tr:first-child td {
    background: #f3f6fb;
    font-weight: 600;
    border-bottom: 2px solid #dbe1ea;
}

#table_acrl_3p tr:hover td {
    background: #f7faff;
}

#table_acrl_3p td:first-child {
    color: #1f2937;
}

#table_acrl_3p td:last-child {
    width: 120px;
    text-align: right;
}


.acrl-edit {
    min-width: 70px;
    padding: 4px 6px;
    border: 1px solid #ccd4e0;
    border-radius: 4px;
    text-align: center;
    background: #ffffff;
    cursor: text;
}

.acrl-edit:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

#footacrl_3p {
    height: 36px;
    background: linear-gradient(to bottom,
            #f6f8fa,
            #eef2f6);

    border-top: 1px solid #d0d7de;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 12px;
    color: #6b7280;
    flex-shrink: 0;
}

.add-btn-3p {
    padding: 8px 14px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    background: #d9d9d9;
    color: #666;
    cursor: not-allowed;
    transition: all 0.2s ease;
}

.add-btn-3p:not(:disabled) {
    background: linear-gradient(135deg, #4caf50, #66bb6a);
    color: white;
    cursor: pointer;
}

.add-btn-3p:not(:disabled):hover {
    transform: translateY(-1px);
}
.action-toolbar-3p {
    display: flex;
    gap: 12px;
    align-items: center;
    margin: 12px 0;
    flex-wrap: wrap;
}

.preview-btn-3p {
    min-width: 180px;
    padding: 10px 16px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    color: white;
    cursor: pointer;
    background:  #4caf50;
    box-shadow: 0 6px 16px rgba(0,0,0,0.18);
    transition: all 0.2s ease;
    animation: previewPulse3p 2.2s infinite;
}

.preview-btn-3p:hover {
    transform: translateY(-2px) scale(1.03);
}

@keyframes previewPulse3p {
    0% {
        box-shadow: 0 0 0 0 rgba(79,172,254,0.45);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(79,172,254,0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(79,172,254,0);
    }
}

.datalist-btn {
  position: relative;
}

.datalist-btn::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-gray-medium);
  color: var(--color-white);
  padding: 6px 10px;
  border: 1px solid var(--color-gray-dark);
  border-radius: 6px;
  white-space: normal;
  min-width: 160px;
  max-width: 240px;
  text-align: center;
  line-height: 1.3;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 9999;
  box-sizing: border-box;
}

.datalist-btn:hover::after {
  opacity: 1;
}
