
body{
    margin:0;
    padding:20px;
    background:#f4f6f9;
    font:14px Arial,sans-serif;
    color:#101828;
}

.loader-wrap{
    display:none;
    padding:18px;
    text-align:center;
}

.loader-wrap.active{
    display:block;
}

.spinner{
    display:inline-block;
    width:22px;
    height:22px;
    border:3px solid #ccd3df;
    border-top-color:#2b6df6;
    border-radius:50%;
    animation:spin .8s linear infinite;
    vertical-align:middle;
    margin-right:8px;
}

@keyframes spin{
    to{transform:rotate(360deg)}
}

.fade-in{
    animation:fadeIn .35s ease;
}

@keyframes fadeIn{
    from{opacity:0;transform:translateY(8px)}
    to{opacity:1;transform:translateY(0)}
}

.table{
    overflow-x:auto;
    background:#fff;
    border-radius:10px;
    box-shadow:0 2px 12px rgba(0,0,0,.12);
}

table{
    width:100%;
    border-collapse:collapse;
    white-space:nowrap;
}

th{
    position:sticky;
    top:0;
    background:#2b6df6;
    color:#fff;
    padding:10px;
    text-align:left;
}

td{
    padding:8px 10px;
    border-bottom:1px solid #eee;
}

tr:nth-child(even){
    background:#fafafa;
}

tr:hover{
    background:#eef5ff;
}

code{
    background:#eee;
    padding:2px 4px;
    border-radius:4px;
    font-size:13px;
}

.cell-filter {
    color:#175cd3;
    text-decoration:none;
    border-bottom:1px dotted rgba(23,92,211,.45);
}

.cell-filter:hover {
    color:#0b4db3;
    border-bottom-style:solid;
}

.other-role {
    background: #fff8e6!important;
}

.pagination {
    padding:14px 16px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    flex-wrap:wrap;
}

.pager-actions {
    display:flex;
    align-items:center;
    gap:8px;
    flex-wrap:wrap;
}

.page-link,
.page-disabled,
.pager-form button {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:34px;
    padding:7px 12px;
    background:#2b6df6;
    color:#fff;
    border-radius:6px;
    text-decoration:none;
    border:0;
    font:inherit;
}

.page-link:hover,
.pager-form button:hover {
    opacity:.85;
}

.page-disabled {
    background:#e4e7ec;
    color:#98a2b3;
    cursor:default;
}

.page-info {
    color:#666;
}

.pager-form {
    display:flex;
    align-items:center;
    gap:7px;
    color:#475467;
}

.pager-form input[type="number"] {
    width:76px;
    padding:7px 9px;
    border:1px solid #ccd3df;
    border-radius:6px;
    font:inherit;
}

.toolbar {
    margin-bottom:16px;
}

.filter-panel {
    background:#fff;
    border:1px solid #e4e7ec;
    border-radius:10px;
    box-shadow:0 2px 10px rgba(16,24,40,.06);
    overflow:hidden;
}

.filter-head {
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:16px;
    padding:16px 18px;
    border-bottom:1px solid #eef1f5;
}

.toolbar-title {
    display:flex;
    flex-direction:column;
    gap:4px;
    min-width:0;
}

.toolbar-title strong {
    font-size:17px;
}

.toolbar-title span {
    color:#667085;
    font-size:13px;
}

.filter-body {
    padding:16px 18px 18px;
}

.filters {
    display:flex;
    flex-direction:column;
    gap:12px;
    margin:0;
}

.filter-top {
    display:grid;
    grid-template-columns:minmax(260px, 1fr) auto;
    gap:12px;
    align-items:end;
}

.search-field input[type="text"] {
    min-height:40px;
}

.filter-sections {
    display:grid;
    grid-template-columns:minmax(300px, .9fr) minmax(420px, 1.6fr) minmax(170px, .45fr);
    gap:12px;
    align-items:stretch;
}

.filter-card {
    padding:12px;
    background:#f9fafb;
    border:1px solid #eef1f5;
    border-radius:8px;
}

.section-title {
    margin-bottom:10px;
    color:#667085;
    font-size:12px;
    font-weight:700;
    text-transform:uppercase;
}

.group-card {
    display:flex;
    flex-direction:column;
    gap:10px;
}

.detail-card {
    min-width:0;
}

.compact-card {
    display:flex;
    flex-direction:column;
}

.filter-grid {
    display:grid;
    grid-template-columns:repeat(auto-fit, minmax(145px, 1fr));
    gap:12px;
}

.segmented {
    display:flex;
    gap:4px;
    padding:4px;
    background:#eef1f5;
    border-radius:8px;
}

.segmented label {
    flex:1;
    cursor:pointer;
}

.segmented input {
    position:absolute;
    opacity:0;
    pointer-events:none;
}

.segmented span {
    display:flex;
    align-items:center;
    justify-content:center;
    min-height:30px;
    padding:5px 8px;
    border-radius:6px;
    color:#475467;
    font-size:13px;
    white-space:nowrap;
}

.segmented input:checked + span {
    background:#fff;
    color:#175cd3;
    box-shadow:0 1px 3px rgba(16,24,40,.12);
}

.filter-actions {
    display:flex;
    gap:8px;
    /*align-items:center;*/
    flex-wrap:wrap;
}

.field {
    display:flex;
    flex-direction:column;
    gap:6px;
    color:#344054;
    font-size:12px;
    font-weight:600;
}

.field input[type="text"],
.field select {
    width:100%;
    min-height:38px;
    box-sizing:border-box;
    padding:8px 10px;
    border:1px solid #ccd3df;
    border-radius:6px;
    background:#fff;
    color:#101828;
    font:14px Arial,sans-serif;
    font-weight:400;
}

.field input[type="text"]:focus,
.field select:focus {
    outline:2px solid rgba(43,109,246,.16);
    border-color:#2b6df6;
}

.check {
    display:inline-flex;
    align-items:center;
    gap:7px;
    min-height:36px;
    color:#344054;
    white-space:nowrap;
    margin-top:2px;
}

.check input {
    width:16px;
    height:16px;
}

.active-filters {
    display:flex;
    gap:8px;
    align-items:center;
    flex-wrap:wrap;
    margin-top:14px;
    padding-top:14px;
    border-top:1px solid #eef1f5;
}

.active-label {
    color:#667085;
    font-size:12px;
    font-weight:600;
}

.filter-chip {
    display:inline-flex;
    align-items:center;
    gap:7px;
    min-height:28px;
    padding:5px 9px;
    border-radius:999px;
    background:#eef5ff;
    color:#175cd3;
    text-decoration:none;
    font-size:12px;
    border:1px solid #c9dcff;
}

.filter-chip span {
    color:#475467;
}

.filter-chip:hover {
    background:#dceaff;
}

.btn {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:36px;
    padding:8px 14px;
    border:0;
    border-radius:6px;
    text-decoration:none;
    cursor:pointer;
    font:inherit;
    line-height:1;
    white-space:nowrap;
}

.btn-primary {
    background:#2b6df6;
    color:#fff;
}

.btn-secondary {
    background:#667085;
    color:#fff;
}

.btn-export {
    background:#198754;
    color:#fff;
}

.btn:hover {
    opacity:.88;
}

.reload-btn {
  margin-right: 5px;
  cursor: pointer;
}
.reload-btn:active {
  transform: scale(0.8);
  outline: none;
}

@media (max-width: 1100px) {
    .filter-sections {
        grid-template-columns:1fr 1fr;
    }

    .compact-card {
        grid-column:1 / -1;
    }
}

@media (max-width: 760px) {
    body {
        padding:12px;
    }

    .filter-head {
        align-items:stretch;
        flex-direction:column;
    }

    .filter-top,
    .filter-sections {
        grid-template-columns:1fr;
    }

    .filter-grid {
        grid-template-columns:1fr;
    }

    .filter-actions,
    .btn {
        width:100%;
    }

    .btn {
        box-sizing:border-box;
    }

    .pagination {
        align-items:stretch;
    }

    .page-info,
    .pager-actions,
    .pager-form {
        width:100%;
    }

    .pager-actions {
        justify-content:center;
    }

    .pager-form {
        justify-content:center;
    }
}
/* Оверлей загрузки поверх таблицы */
#loader-overlay {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.7);
  justify-content: center;
  align-items: center;
  z-index: 10;
  border-radius: 10px;
}
#loader-overlay .spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e0e0e0;
  border-top-color: #2b6df6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.table {
  position: relative; /* чтобы оверлей позиционировался внутри таблицы */
}
/* Модал */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
}
.modal-box {
  background: #fff;
  padding: 24px 32px;
  border-radius: 12px;
  min-width: 320px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.modal-box h3 {
  margin: 0 0 16px 0;
}
.modal-box input[type="password"] {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 16px;
  box-sizing: border-box;
}
.modal-box button {
  margin-top: 16px;
  padding: 10px 20px;
  background: #2b6df6;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
}
.modal-box button:hover {
  opacity: 0.85;
}
#secret-error {
  margin-top: 8px;
  color: red;
  font-size: 14px;
}
