/*
 * KingEmpire V2.1.0
 * Clarity Table Engine + Legal Attribution UI
 */

/* ---------- Shared compact table behavior ---------- */
.ke-table-owners,
.ke-table-reports,
.ke-daily-report-table{
  width:100%;
  min-width:0!important;
  table-layout:fixed;
}
.ke-table-owners td,
.ke-table-reports td,
.ke-daily-report-table td{
  min-width:0;
  overflow-wrap:anywhere;
}
.ke-table-owners th,
.ke-table-reports th,
.ke-daily-report-table th{
  overflow:hidden;
  text-overflow:ellipsis;
}
.ke-table-panel:has(.ke-table-owners) .ke-table-wrap,
.ke-table-panel:has(.ke-table-reports) .ke-table-wrap,
.ke-table-panel:has(.ke-daily-report-table) .ke-table-wrap{
  overflow-x:clip;
}

/* ---------- Owner directory ---------- */
.ke-table-owners th:nth-child(1),
.ke-table-owners td:nth-child(1){width:40%}
.ke-table-owners th:nth-child(2),
.ke-table-owners td:nth-child(2){width:25%}
.ke-table-owners th:nth-child(3),
.ke-table-owners td:nth-child(3){width:9%}
.ke-table-owners th:nth-child(4),
.ke-table-owners td:nth-child(4){width:12%}
.ke-table-owners th:nth-child(5),
.ke-table-owners td:nth-child(5){width:14%}
.ke-table-owners .ke-person-row{width:100%;max-width:100%}
.ke-owner-name-copy{display:block;min-width:0;flex:1}
.ke-owner-name-line{display:flex;align-items:center;gap:8px;min-width:0}
.ke-owner-name-line>strong{min-width:0;line-height:1.35;white-space:normal;word-break:break-word}
.ke-owner-name-line .ke-badge{flex:0 0 auto;padding:4px 8px;font-size:8px}
.ke-table-owners td:nth-child(2)>strong{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ke-table-owners td:nth-child(3),
.ke-table-owners td:nth-child(4){text-align:center}
.ke-table-owners td:nth-child(3)>strong,
.ke-table-owners td:nth-child(4)>strong{font-size:17px}

/* ---------- Report attribution ---------- */
.ke-table-reports th:nth-child(1),.ke-table-reports td:nth-child(1){width:42px;text-align:center}
.ke-table-reports th:nth-child(2),.ke-table-reports td:nth-child(2){width:12%}
.ke-table-reports th:nth-child(3),.ke-table-reports td:nth-child(3){width:12%}
.ke-table-reports th:nth-child(4),.ke-table-reports td:nth-child(4){width:19%}
.ke-table-reports th:nth-child(5),.ke-table-reports td:nth-child(5){width:23%}
.ke-table-reports th:nth-child(6),.ke-table-reports td:nth-child(6){width:7%}
.ke-table-reports th:nth-child(7),.ke-table-reports td:nth-child(7){width:11%}
.ke-table-reports th:nth-child(8),.ke-table-reports td:nth-child(8){width:8%}
.ke-table-reports th:nth-child(9),.ke-table-reports td:nth-child(9){width:8%}
.ke-table-reports td{padding-top:12px;padding-bottom:12px}
.ke-reporter-cell strong,.ke-reporter-cell small{display:block}
.ke-reporter-name{color:#eef5ff;line-height:1.35}
.ke-reporter-cell small{margin-top:4px;color:#7187a5;font-size:8px;line-height:1.35}
.ke-reporter-missing{display:inline-flex;padding:4px 8px;border:1px solid rgba(255,184,83,.22);border-radius:999px;background:rgba(255,184,83,.08);color:#ffc36e;font-size:9px;font-weight:850}
.ke-table-reports .ke-auto-report-badge{margin:5px 0 0;display:table}
.ke-table-reports .ke-appeal-alarm-badge{margin-top:5px}
.ke-table-reports .ke-row-actions{flex-wrap:nowrap}
.ke-icon-button.is-loading .dashicons{animation:ke-v21-spin .8s linear infinite}
@keyframes ke-v21-spin{to{transform:rotate(360deg)}}

/* ---------- Daily report ---------- */
.ke-daily-report-table th:nth-child(1),.ke-daily-report-table td:nth-child(1){width:42px;text-align:center}
.ke-daily-report-table th:nth-child(2),.ke-daily-report-table td:nth-child(2){width:14%}
.ke-daily-report-table th:nth-child(3),.ke-daily-report-table td:nth-child(3){width:14%}
.ke-daily-report-table th:nth-child(4),.ke-daily-report-table td:nth-child(4){width:11%}
.ke-daily-report-table th:nth-child(5),.ke-daily-report-table td:nth-child(5){width:8%}
.ke-daily-report-table th:nth-child(6),.ke-daily-report-table td:nth-child(6){width:15%}
.ke-daily-report-table th:nth-child(7),.ke-daily-report-table td:nth-child(7){width:13%}
.ke-daily-report-table th:nth-child(8),.ke-daily-report-table td:nth-child(8){width:15%}
.ke-daily-report-table th:nth-child(9),.ke-daily-report-table td:nth-child(9){width:10%}
.ke-daily-report-table td{padding:14px 12px}
.ke-daily-report-table .ke-report-device{max-width:100%;overflow:hidden;text-overflow:ellipsis}
.ke-report-inline-status{display:none;margin-top:7px;width:max-content;max-width:100%}
.ke-daily-report-table .ke-report-number{font-size:11px;color:#7890b7}
.ke-daily-report-table .ke-report-result{max-width:none}
.ke-report-studio-list{display:flex;flex-wrap:wrap;align-items:flex-start;gap:5px;max-width:100%}
.ke-report-studio-chip{display:inline-flex;align-items:center;gap:5px;max-width:100%;padding:4px 7px;border:1px solid rgba(91,160,255,.18);border-radius:999px;background:rgba(48,105,184,.10);line-height:1.15}
.ke-report-studio-chip strong{min-width:0;max-width:132px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#edf5ff;font-size:10px;font-weight:850}
.ke-report-studio-chip small{flex:0 0 auto;margin:0;padding:2px 5px;border-radius:999px;background:rgba(91,160,255,.12);color:#86bfff;font-size:8px;font-weight:850;line-height:1}
.ke-report-studio-empty{display:inline-flex;padding:4px 7px;border:1px solid rgba(130,148,176,.14);border-radius:999px;color:#778aa7;font-size:9px;font-weight:750}

/* ---------- Footer + pagination ---------- */
#ke-reports-footer{gap:14px}
#ke-reports-footer .ke-footer-controls{display:flex;align-items:center;gap:10px;min-width:0}
#ke-reports-footer .ke-page-size .ke-select{width:70px}

/* ---------- Laptop refinements, still no horizontal scrollbar ---------- */
@media (max-width:1400px) and (min-width:901px){
  .ke-table-reports th:nth-child(6),.ke-table-reports td:nth-child(6){display:none}
  .ke-table-reports th:nth-child(1),.ke-table-reports td:nth-child(1){width:42px}
  .ke-table-reports th:nth-child(2),.ke-table-reports td:nth-child(2){width:13%}
  .ke-table-reports th:nth-child(3),.ke-table-reports td:nth-child(3){width:13%}
  .ke-table-reports th:nth-child(4),.ke-table-reports td:nth-child(4){width:20%}
  .ke-table-reports th:nth-child(5),.ke-table-reports td:nth-child(5){width:24%}
  .ke-table-reports th:nth-child(7),.ke-table-reports td:nth-child(7){width:12%}
  .ke-table-reports th:nth-child(8),.ke-table-reports td:nth-child(8){width:8%}
  .ke-table-reports th:nth-child(9),.ke-table-reports td:nth-child(9){width:6%}
}

@media (max-width:1280px) and (min-width:901px){
  .ke-daily-report-table th:nth-child(1),.ke-daily-report-table td:nth-child(1){display:none}
  .ke-daily-report-table th:nth-child(2),.ke-daily-report-table td:nth-child(2){width:16%}
  .ke-daily-report-table th:nth-child(3),.ke-daily-report-table td:nth-child(3){width:15%}
  .ke-daily-report-table th:nth-child(4),.ke-daily-report-table td:nth-child(4){width:12%}
  .ke-daily-report-table th:nth-child(5),.ke-daily-report-table td:nth-child(5){width:8%}
  .ke-daily-report-table th:nth-child(6),.ke-daily-report-table td:nth-child(6){width:16%}
  .ke-daily-report-table th:nth-child(7),.ke-daily-report-table td:nth-child(7){width:14%}
  .ke-daily-report-table th:nth-child(8),.ke-daily-report-table td:nth-child(8){width:13%}
  .ke-daily-report-table th:nth-child(9),.ke-daily-report-table td:nth-child(9){width:6%}
  .ke-daily-report-table td{padding-left:9px;padding-right:9px}
  .ke-daily-report-table .ke-badge{padding-left:7px;padding-right:7px;font-size:8px}
}

@media (max-width:1120px) and (min-width:901px){
  .ke-table-owners th:nth-child(2),.ke-table-owners td:nth-child(2){width:24%}
  .ke-table-owners th:nth-child(3),.ke-table-owners td:nth-child(3){width:8%}
  .ke-table-owners th:nth-child(4),.ke-table-owners td:nth-child(4){width:11%}
  .ke-table-owners th:nth-child(5),.ke-table-owners td:nth-child(5){width:14%}

  .ke-daily-report-table th:nth-child(9),.ke-daily-report-table td:nth-child(9){display:none}
  .ke-report-inline-status{display:inline-flex}
  .ke-daily-report-table th:nth-child(2),.ke-daily-report-table td:nth-child(2){width:18%}
  .ke-daily-report-table th:nth-child(3),.ke-daily-report-table td:nth-child(3){width:16%}
  .ke-daily-report-table th:nth-child(4),.ke-daily-report-table td:nth-child(4){width:12%}
  .ke-daily-report-table th:nth-child(5),.ke-daily-report-table td:nth-child(5){width:8%}
  .ke-daily-report-table th:nth-child(6),.ke-daily-report-table td:nth-child(6){width:17%}
  .ke-daily-report-table th:nth-child(7),.ke-daily-report-table td:nth-child(7){width:14%}
  .ke-daily-report-table th:nth-child(8),.ke-daily-report-table td:nth-child(8){width:15%}
}

/* ---------- Responsive cards ---------- */
@media (max-width:900px){
  .ke-table-panel:has(.ke-table-owners) .ke-table-wrap,
  .ke-table-panel:has(.ke-table-reports) .ke-table-wrap,
  .ke-table-panel:has(.ke-daily-report-table) .ke-table-wrap{overflow:visible}
  .ke-table-owners,.ke-table-reports,.ke-daily-report-table{min-width:0!important}
  .ke-owner-name-line{flex-wrap:wrap}
  .ke-owner-name-line .ke-badge{order:2}
  .ke-table-reports td,.ke-daily-report-table td{overflow-wrap:normal}
  .ke-daily-report-table .ke-report-number{display:none!important}
  .ke-report-inline-status{display:none}
  .ke-report-studio-list{gap:4px}
  .ke-report-studio-chip strong{max-width:none;white-space:normal}
  #ke-reports-footer .ke-footer-controls{width:100%;flex-wrap:wrap;justify-content:space-between}
}

@media (max-width:560px){
  .ke-reporter-cell small{font-size:8px}
  .ke-table-reports .ke-row-actions{gap:7px}
  .ke-owner-name-line>strong{font-size:13px}
}


/* ---------- V6.3.2 Report-3 Transition Radar ---------- */
.ke-report-limit-today-panel{border-color:rgba(255,91,118,.22);background:linear-gradient(180deg,rgba(255,73,112,.055),rgba(7,16,29,.16))}
.ke-report-limit-today-panel.is-empty{border-color:rgba(65,225,164,.14);background:rgba(65,225,164,.025)}
.ke-report-limit-today-panel .ke-panel-head{align-items:flex-start;gap:16px}
.ke-report-limit-today-panel .ke-panel-head small{display:block;margin-top:5px;color:#7892b8}
.ke-report-limit-today-list{display:grid;gap:8px}
.ke-report-limit-event{display:grid;grid-template-columns:40px minmax(0,1fr) auto 40px;gap:12px;align-items:center;padding:12px 14px;border:1px solid rgba(255,106,133,.16);border-radius:14px;background:rgba(7,16,29,.54)}
.ke-report-limit-event-icon{width:36px;height:36px;border-radius:12px;display:grid;place-items:center;color:#ff708d;background:rgba(255,75,111,.11);border:1px solid rgba(255,95,127,.17)}
.ke-report-limit-event-main{min-width:0;display:grid;gap:3px}.ke-report-limit-event-main strong{color:#f7fbff;font-size:13px}.ke-report-limit-event-main span{color:#ff8ca2;font-size:11px;font-weight:800}.ke-report-limit-event-main small{color:#7088aa;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ke-report-limit-event-main b{padding:0 3px;color:#617997}.ke-report-limit-event-meta{text-align:right;display:grid;gap:3px}.ke-report-limit-event-meta strong{color:#ffd0da;font-size:12px}.ke-report-limit-event-meta time{color:#7188aa;font-size:10px;white-space:nowrap}
.ke-report-limit-empty{display:flex;align-items:center;gap:12px;padding:12px 14px;border:1px dashed rgba(65,225,164,.16);border-radius:14px;color:#7f98ba}.ke-report-limit-empty>.dashicons{color:#44dca4}.ke-report-limit-empty div{display:grid;gap:2px}.ke-report-limit-empty strong{color:#c7d7ec;font-size:12px}.ke-report-limit-empty small{font-size:10px}
#ke-shop-report-limit-today-filter span{display:inline-grid;place-items:center;min-width:18px;height:18px;margin-left:5px;padding:0 5px;border-radius:999px;background:rgba(255,89,121,.14);color:#ff92a6;font-size:9px;font-weight:900}
@media (max-width:720px){.ke-report-limit-event{grid-template-columns:36px minmax(0,1fr) 36px}.ke-report-limit-event-meta{grid-column:2/3;text-align:left;display:flex;gap:8px;align-items:center}.ke-report-limit-event>.ke-icon-button{grid-column:3;grid-row:1/3}.ke-report-limit-event-main small{white-space:normal}}

/* V6.3.8 Report bulk selection */
#ke-report-bulkbar{margin-top:0}
#ke-report-bulkbar .ke-danger-button{min-height:32px;padding:0 12px;font-size:9px}
.ke-table-reports .ke-report-check{cursor:pointer}
