/* ===== PDF PREVIEW ===== */

.pdf-frame {
    width: 100%;
    height: 100%;
    min-height: 0;
    border: 0;
    display: block;
    background: #525659;
}

.pdf-preview-body {
    padding: 0;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    background: #525659;
}

/* ===== LOG PREVIEW ===== */

.modal-window--log {
    width: min(980px, 95vw);
    height: auto;
    max-height: 88vh;
}

.log-preview-body {
    padding: 20px 24px;
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    background: #fff;
}

.log-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    border: 1px solid #E5E5E8;
    border-radius: 14px;
    overflow: hidden;
    font-size: 0.84rem;
    background: #fff;
}

.log-table th,
.log-table td {
    vertical-align: top;
    word-break: break-word;
    padding: 10px 12px;
    border-bottom: 1px solid #F4F4F6;
    color: #374151;
}

.log-table th {
    background: #FAFAFA;
    color: #9CA3AF;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

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

.log-table tbody tr:hover {
    background: #EAF1FF;
}

.log-message-cell {
    white-space: pre-wrap;
}

.log-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.log-details-text {
    white-space: pre-wrap;
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: 0.78rem;
    line-height: 1.45;
    color: #374151;
}

.log-details-toggle {
    align-self: flex-start;
    border: 1px solid #E5E5E8;
    border-radius: 12px;
    background: #fff;
    color: #6B7280;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.76rem;
    font-weight: 600;
    padding: 5px 10px;
    transition: all 0.15s;
}

.log-details-toggle:hover {
    background: #EAF1FF;
    border-color: #8B9EE8;
    color: #474570;
}

.log-empty-state {
    color: #9CA3AF;
    font-size: 0.9rem;
    padding: 24px;
    text-align: center;
}

/* ===== MESSAGES PAGE ===== */

.msg-filters {
    background: #fff;
    border-radius: 20px;
    padding: 14px 18px 12px;
    margin: 16px 15rem 10px;
    border: 1px solid #E5E5E8;
    border-top: 3px solid #8B9EE8;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.filter-field.sm  { flex: 0.5; min-width: 60px;  }
.filter-field.md  { flex: 1;   min-width: 90px;  }
.filter-field.lg  { flex: 2;   min-width: 130px; }
.filter-field.xl  { flex: 2.4; min-width: 150px; }

.filter-label {
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #9CA3AF;
}

.filter-input {
    width: 100%;
    padding: 6px 11px;
    border-radius: 14px;
    border: 1.5px solid #E5E5E8;
    font-size: 0.82rem;
    font-family: inherit;
    background: #fff;
    color: #111111;
    transition: border-color 0.18s, box-shadow 0.18s;
    box-sizing: border-box;
}

/* modrá pre focus */
.filter-input:focus {
    outline: none;
    border-color: #8B9EE8;
    box-shadow: 0 0 0 2px rgba(139,158,232,0.35);
}

.filter-input::placeholder {
    color: #D1D5DB;
}

.filter-actions {
    display: flex;
    align-items: flex-end;
    flex-shrink: 0;
}

.btn-clear {
    padding: 6px 14px;
    border-radius: 14px;
    border: 1.5px solid #E5E5E8;
    background: #fff;
    color: #9CA3AF;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.18s;
    white-space: nowrap;
}

.btn-clear:hover {
    border-color: #8B9EE8;
    color: #8B9EE8;
    background: #EAF1FF;
}

/* ===== TABLE KARTA ===== */

.msg-table-card {
    background: #fff;
    border-radius: 20px;
    margin: 0 15rem;
    border: 1px solid #E5E5E8;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    overflow: visible;
}

/* ===== TABUĽKA ===== */

.msg-table {
    width: 100%;
    border-collapse: collapse;
}

.msg-table thead {
    border-bottom: 2px solid #F4F4F6;
}

.msg-table thead th {
    text-align: left;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #9CA3AF;
    padding: 14px 18px;
    background: #FAFAFA;
    white-space: nowrap;
}

.msg-table thead th:first-child {
    border-radius: 20px 0 0 0;
}

.msg-table thead th:last-child {
    border-radius: 0 20px 0 0;
}

/* fialová pri hover na sortable hlavičkách */
.msg-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: color 0.15s;
}

.msg-table th.sortable:hover {
    color: #474570;
}

.msg-table tbody tr {
    border-bottom: 1px solid #F4F4F6;
    transition: background 0.12s;
}

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

/* veľmi jemný hover na riadkoch */
.msg-table tbody tr:hover {
    background: #EAF1FF;
}

.msg-row td {
    padding: 14px 18px;
    font-size: 0.875rem;
    color: #374151;
    vertical-align: middle;
}

.msg-empty td {
    text-align: center;
    padding: 56px 18px;
    color: #D1D5DB;
    font-style: italic;
    font-size: 0.9rem;
}

/* ===== OVERLAY (zatvorenie menu kliknutím mimo) ===== */

.actions-overlay {
    position: fixed;
    inset: 0;
    z-index: 9998;
}

/* ===== AKČNÉ MENU ===== */

.actions-cell {
    width: 52px;
    text-align: right;
    padding-right: 12px !important;
}

.actions-dropdown-wrap {
    position: relative;
    display: inline-block;
}

/* oranžová pre akčné tlačidlo */
.actions-dots-btn {
    width: 32px;
    height: 32px;
    border-radius: 12px;
    border: 1.5px solid transparent;
    background: transparent;
    color: #D1D5DB;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    line-height: 1;
}

.msg-row:hover .actions-dots-btn {
    background: #fff;
    border-color: #E5E5E8;
    color: #9CA3AF;
}

.actions-dots-btn:hover {
    background: #EAF1FF;
    border-color: #8B9EE8;
    color: #8B9EE8;
}

.actions-menu {
    position: absolute;
    right: 0;
    top: 36px;
    min-width: 0;
    width: max-content;
    background: #fff;
    border-radius: 14px;
    border: 1px solid #E5E5E8;
    box-shadow: 0 8px 24px rgba(0,0,0,0.10);
    z-index: 9999;
    overflow: hidden;
    padding: 3px;
}

.actions-menu button {
    display: flex;
    align-items: center;
    gap: 7px;
    width: 100%;
    padding: 7px 11px;
    border: none;
    background: transparent;
    border-radius: 10px;
    text-align: left;
    font-size: 0.82rem;
    font-family: inherit;
    color: #374151;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
}

.actions-menu button i {
    font-size: 0.9rem;
    width: 16px;
    text-align: center;
    opacity: 0.7;
}

.actions-menu button:hover {
    background: #EAF1FF;
    color: #8B9EE8;
}

/* fialová pre primárnu akciu v menu */
.actions-menu .primary-menu-item {
    color: #374151;
    font-weight: 400;
}

/* ===== STRÁNKOVANIE ===== */

.msg-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 15rem 36px;
    padding: 0 4px;
}

.msg-pagination-info {
    font-size: 0.82rem;
    color: #9CA3AF;
}

.msg-pagination-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-page {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    border: 1.5px solid #E5E5E8;
    background: #fff;
    color: #374151;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    font-family: inherit;
}

.btn-page:hover:not(:disabled) {
    background: #EAF1FF;
    border-color: #8B9EE8;
    color: #8B9EE8;
}

.btn-page:disabled {
    color: #D1D5DB;
    border-color: #F3F4F6;
    background: #FAFAFA;
    cursor: not-allowed;
}

.page-label {
    font-size: 0.85rem;
    color: #9CA3AF;
}

.page-label strong {
    color: #111111;
    font-weight: 700;
}
