/* Approved Ticket polish: vertical evidence actions, compact 4x4 overview, layered history filters. */

/* Evidence upload: three vertical actions with one matching rule per row. */
.ticket-register-v3 .ticket-upload-layout{
  grid-template-columns:minmax(0,1.15fr) minmax(260px,1fr);
  gap:14px;
}
.ticket-register-v3 .ticket-register-main,
.ticket-register-v3 .ticket-media-card,
.ticket-register-v3 .ticket-upload-layout>*{min-width:0;max-width:100%}
.ticket-register-v3 .ticket-media-top{container-type:inline-size}
.ticket-register-v3 .ticket-form-card{container-type:inline-size}
.ticket-register-v3 .ticket-upload-layout .upload-actions{
  display:grid;
  grid-template-columns:1fr;
  grid-template-rows:repeat(3,minmax(64px,1fr));
  gap:8px;
}
.ticket-register-v3 .ticket-upload-layout .upload-actions button,
.ticket-register-v3 .ticket-upload-layout .upload-actions button:last-child{
  justify-content:flex-start;
  width:100%;
  min-height:64px;
  padding:10px 14px;
  border-style:solid;
  border-radius:11px;
  background:#fff;
}
.ticket-register-v3 .ticket-upload-layout .upload-actions button:first-child{
  border-color:#69c7ad;
  background:#f5fbf8;
}
.ticket-register-v3 .ticket-upload-layout .upload-actions svg{
  box-sizing:border-box;
  width:38px;
  height:38px;
  padding:9px;
  border-radius:10px;
  background:#e4f5ef;
}
.ticket-register-v3 .ticket-upload-layout .upload-actions span{display:block}
.ticket-register-v3 .ticket-upload-layout .upload-actions strong{font-size:12px;line-height:1.3}
.ticket-register-v3 .ticket-upload-layout .upload-actions small{margin-top:3px;font-size:9px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ticket-register-v3 .ticket-upload-layout .upload-rules{
  display:grid;
  grid-template-columns:1fr;
  grid-template-rows:auto 1fr;
  gap:7px;
  min-height:0;
  margin:0;
  padding:12px 14px;
  border-radius:11px;
  background:#fbfcfa;
}
.ticket-register-v3 .ticket-upload-layout .upload-rules>strong{padding-bottom:6px;border-bottom:1px solid #e4ece8;font-size:12px}
.ticket-register-v3 .ticket-upload-layout .upload-rules ol{
  counter-reset:upload-rule;
  display:grid;
  grid-template-rows:repeat(3,1fr);
  gap:0;
  min-height:0;
  margin:0;
  padding:0;
  list-style:none;
}
.ticket-register-v3 .ticket-upload-layout .upload-rules li{
  counter-increment:upload-rule;
  display:grid;
  grid-template-columns:23px minmax(0,1fr);
  align-items:center;
  gap:9px;
  min-height:0;
  padding:5px 0;
  border-bottom:1px solid #edf2ef;
  font-size:10px;
  line-height:1.4;
}
.ticket-register-v3 .ticket-upload-layout .upload-rules li:last-child{border-bottom:0}
.ticket-register-v3 .ticket-upload-layout .upload-rules li::before{
  content:counter(upload-rule);
  display:grid;
  place-items:center;
  width:22px;
  height:22px;
  border-radius:7px;
  background:#e9f7f2;
  color:#146250;
  font-size:10px;
  font-weight:750;
}

/* Ticket overview: two sections; every field owns one full row. */
.ticket-register-v3 .ticket-overview-grid{
  grid-template-columns:minmax(0,.92fr) minmax(0,1.08fr);
  margin:9px 0 13px;
  border-radius:12px;
}
.ticket-register-v3 .ticket-overview-identity,
.ticket-register-v3 .ticket-time-section{padding:16px 16px 18px}
.ticket-register-v3 .ticket-subsection-heading,
.ticket-register-v3 .ticket-time-section .section-heading{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:14px;
  height:42px;
  min-height:42px;
  margin-bottom:13px;
}
.ticket-register-v3 .ticket-subsection-heading>div{min-width:0}
.ticket-register-v3 .ticket-subsection-heading small,
.ticket-register-v3 .ticket-time-section .section-heading p{
  margin:0;
  color:#6f8882;
  font-size:9px;
  line-height:1.35;
  white-space:nowrap;
}
.ticket-register-v3 .ticket-time-section .section-heading p::before{
  content:"";
  display:inline-block;
  width:5px;
  height:5px;
  margin:0 6px 1px 0;
  border-radius:50%;
  background:#73cbb3;
}
.ticket-register-v3 .ticket-identity-core.form-grid,
.ticket-register-v3 .ticket-time-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:12px;
}
.ticket-register-v3 .ticket-identity-core.form-grid{padding-top:0}
.ticket-register-v3 .ticket-identity-core .field,
.ticket-register-v3 .ticket-time-grid .field{
  display:grid;
  grid-template-columns:78px minmax(0,1fr);
  align-items:center;
  gap:8px;
  min-width:0;
}
.ticket-register-v3 .ticket-identity-core .ticket-location-field{display:none}
.ticket-register-v3 .ticket-time-grid .occurred-field{grid-column:auto}
.ticket-register-v3 .ticket-identity-core .field>label,
.ticket-register-v3 .ticket-time-grid .field>label{
  display:block;
  margin:0;
  font-size:10.5px;
}
.ticket-register-v3 .ticket-form-card .ticket-identity-core :is(input,select),
.ticket-register-v3 .ticket-time-grid :is(input,select){width:100%;height:42px;min-height:42px;border-radius:8px;font-size:11px}
.ticket-register-v3 .ticket-time-grid .occurred-composite{
  grid-template-columns:minmax(120px,1.35fr) 1px minmax(96px,.8fr);
  gap:5px;
  align-items:center;
  min-width:0;
  height:42px;
  padding:0 6px;
  border:1px solid #cbdad5;
  border-radius:8px;
  background:#fff;
}
.ticket-register-v3 .ticket-time-grid .occurred-composite:focus-within{
  border-color:#55bea1;
  box-shadow:0 0 0 3px rgba(85,190,161,.13);
}
.ticket-register-v3 .ticket-time-grid .occurred-composite>input{
  width:100%;
  min-width:0;
  height:40px;
  min-height:40px;
  padding:0 2px;
  border:0;
  border-radius:0;
  background:transparent;
  box-shadow:none;
  font-size:11px;
}
.ticket-register-v3 .ticket-time-grid .occurred-composite>span{
  width:1px;
  height:20px;
  overflow:hidden;
  background:#dbe6e2;
  color:transparent;
}
.ticket-register-v3 .ticket-time-grid .occurred-composite>small{display:none}

/* Queue ownership switch sits immediately before the divider and queue controls. */
.ticket-register-v3 .ticket-context{grid-template-columns:minmax(220px,1fr) auto auto;gap:14px}
.ticket-register-v3 .ticket-queue-heading{display:flex;align-items:center}
.ticket-register-v3 .ticket-queue-heading>span{color:#173d39;font-size:12px;font-weight:750}
.ticket-register-v3 .ticket-queue-scope-slot{display:flex;align-items:center;justify-content:flex-end;padding-left:8px}
.ticket-register-v3 .ticket-queue-toggle{width:auto;min-height:29px;padding:4px 10px;border-color:#8fc8b9;background:#fff;color:#176454;font-size:10px}

/* Keep the two selectable shift roles and the creator record compact. */
.ticket-register-v3 .ticket-personnel-panel{grid-template-columns:108px minmax(0,1fr);gap:8px;padding:10px}
.ticket-register-v3 .ticket-personnel-panel>header{padding:0 2px}
.ticket-register-v3 .ticket-personnel-panel>header h3{font-size:13px}
.ticket-register-v3 .ticket-personnel-panel>header p{font-size:8.5px}
.ticket-register-v3 .ticket-personnel-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.ticket-register-v3 .ticket-personnel-panel .personnel-field{
  grid-template-columns:27px minmax(0,1fr);
  grid-template-rows:auto auto;
  gap:5px 6px;
  align-items:center;
}
.ticket-register-v3 .ticket-personnel-panel .personnel-role-mark{grid-column:1;grid-row:1;width:27px;height:27px;font-size:8.5px}
.ticket-register-v3 .ticket-personnel-panel .personnel-engineer-mark svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round}
.ticket-register-v3 .ticket-personnel-panel .personnel-field>div{display:contents}
.ticket-register-v3 .ticket-personnel-panel .personnel-field label{grid-column:2;grid-row:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ticket-register-v3 .ticket-personnel-panel .personnel-field :is(select,.personnel-readonly){grid-column:1/-1;grid-row:2}
.ticket-register-v3 .ticket-personnel-panel .personnel-field{padding:6px}
.ticket-register-v3 .ticket-personnel-panel .personnel-field label{font-size:8.8px}
.ticket-register-v3 .ticket-personnel-panel .personnel-field :is(select,.personnel-readonly){height:31px;min-height:31px;font-size:9.5px}
.ticket-register-v3 .ticket-personnel-panel .personnel-readonly{display:flex;align-items:center;min-width:0;padding:5px 8px;overflow:hidden;border:1px solid #cbdcd6;border-radius:7px;background:#f5faf8;color:#173d39;font-weight:700;text-overflow:ellipsis;white-space:nowrap}

/* The workflow bar belongs after the form and must never cover overview rows. */
.ticket-register-v3 .ticket-workflow-footer{position:static}

/* Classification mirrors the two-column overview above it. */
.ticket-register-v3 .ticket-form-card .ticket-classification>.form-grid{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:16px;align-items:start}
.ticket-register-v3 .ticket-form-card .ticket-classification .field:first-child{max-width:none}
.ticket-register-v3 .ticket-form-card .ticket-classification .ticket-follow-field{grid-column:auto;padding-top:0;border-top:0}

.ticket-close-dialog{width:min(560px,calc(100vw - 32px));padding:28px}
.ticket-close-symbol{display:grid;place-items:center;width:46px;height:46px;margin:0 auto 15px;border-radius:50%;background:#def3eb;color:#14705e;font-size:22px;font-weight:800}
.ticket-close-dialog>h2,.ticket-close-dialog>p{text-align:center}
.ticket-close-options{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:18px 0}
.ticket-close-options section{padding:13px;border:1px solid #d8e5e0;border-radius:9px;background:#f8fbf9}
.ticket-close-options strong,.ticket-close-options span{display:block}
.ticket-close-options strong{font-size:12px}
.ticket-close-options span{margin-top:5px;color:#667d77;font-size:10px;line-height:1.55}

/* History: display options join the status bar; filters are grouped by task. */
.ticket-status-tabs{overflow:visible}
.ticket-status-tabs .ticket-display-toolbar{
  display:flex;
  align-items:center;
  gap:8px;
  margin-left:auto;
  padding:0 0 9px 18px;
  background:#f4f1e9;
}
.ticket-status-tabs .ticket-display-toolbar>span{font-size:10px;white-space:nowrap}
.ticket-status-tabs .display-picker>summary{min-height:37px;padding:7px 11px;border-radius:9px;font-size:11px}
.ticket-status-tabs .display-picker-menu{right:0;left:auto}
.ticket-command-modern:has(.ticket-display-toolbar){overflow:hidden}
.ticket-command-split,
.ticket-command-split:has(>.ticket-voice-studio[hidden]){grid-template-columns:1fr}
.ticket-command-split>form{border-right:0}
.ticket-command-split .ticket-command-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) 112px;
  gap:9px;
  padding:15px 18px 11px;
}
.ticket-command-split .ticket-command-row .ticket-global-search{height:42px;min-height:42px;border-radius:9px}
.ticket-command-split .ticket-command-row .ticket-voice-trigger{display:flex;align-items:center;justify-content:center;height:42px;min-height:42px;border:1px solid #9fcfc1;border-radius:9px;background:#f3faf7;color:#165b4f;font-size:11px;font-weight:750}
.ticket-command-split .ticket-filter-panel{padding:0 18px 17px}
.ticket-filter-compact.ticket-command-split .ticket-filter-chips{
  display:block;
  overflow:hidden;
  border:1px solid #d6e3de;
  border-radius:12px;
  background:#fbfcfa;
}
.ticket-filter-section{
  display:grid;
  grid-template-columns:125px minmax(0,1fr);
  gap:14px;
  padding:13px 15px;
}
.ticket-filter-section+.ticket-filter-section{border-top:1px solid #e4ece8}
.ticket-filter-section>header{padding:7px 0 0 2px}
.ticket-filter-section>header strong{display:block;font-size:11px;line-height:1.3}
.ticket-filter-section>header span{display:block;margin-top:3px;color:#7b908c;font-size:9px;line-height:1.3}
.ticket-filter-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.ticket-filter-grid>label,
.ticket-filter-grid>.person-filter,
.ticket-filter-compact.ticket-command-split .ticket-filter-grid>.person-filter{
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  grid-template-rows:1fr;
  align-items:center;
  gap:8px;
  width:auto;
  max-width:none;
  min-width:0;
  height:38px;
  min-height:38px;
  margin:0;
  padding:0 10px;
  border:1px solid #d3dfdb;
  border-radius:8px;
  background:#fff;
}
.ticket-filter-grid>label>span,
.ticket-filter-grid>.person-filter>label,
.ticket-filter-compact.ticket-command-split .ticket-filter-grid>.person-filter>label{
  position:static;
  width:auto;
  height:auto;
  min-height:0;
  margin:0;
  overflow:visible;
  clip:auto;
  color:#385b56;
  font-size:10px;
  font-weight:750;
  line-height:1.2;
  white-space:nowrap;
}
.ticket-filter-grid :is(input,select),
.ticket-filter-compact.ticket-command-split .ticket-filter-grid :is(input,select),
.ticket-filter-compact.ticket-command-split .ticket-filter-grid .person-search-input,
.ticket-filter-compact.ticket-command-split .ticket-filter-grid .person-search-input input[type=search]{
  width:100%;
  min-width:0;
  height:30px;
  min-height:30px;
  margin:0;
  padding:4px 3px;
  border:0;
  border-radius:0;
  background:transparent;
  box-shadow:none;
  color:#173c39;
  font-size:10px;
}
.ticket-device-filter{display:grid;grid-template-columns:minmax(0,1fr) minmax(70px,.75fr);gap:5px;min-width:0}
.ticket-device-filter input{border-right:1px solid #e1e9e6!important}
.ticket-filter-compact.ticket-command-split .ticket-filter-grid .person-search-input{padding:0}
.ticket-filter-compact.ticket-command-split .ticket-filter-grid .person-search-input>span{left:2px;font-size:13px}
.ticket-filter-compact.ticket-command-split .ticket-filter-grid .person-search-input input[type=search]{padding-left:20px}
.ticket-filter-people .ticket-date-filter{grid-column:span 2}
.ticket-filter-grid .ticket-date-filter>div{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:3px;min-width:0}
.ticket-filter-grid .ticket-date-filter input[type=date]{width:100%;min-width:0;padding-inline:2px}
.ticket-filter-footer{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:11px 15px 12px 154px;
  border-top:1px solid #e4ece8;
}
.ticket-filter-context{display:flex;align-items:center;gap:6px;min-width:0;flex-wrap:wrap}
.ticket-filter-context>span,
.ticket-filter-context .ticket-applied-filters span{padding:5px 8px;border-radius:999px;background:#e9f5f0;color:#3a6b61;font-size:9px}
.ticket-filter-context .ticket-applied-filters{display:flex;gap:6px;margin:0;flex-wrap:wrap}
.ticket-filter-footer .ticket-filter-actions{display:flex;align-items:center;justify-content:flex-end;gap:7px}
.ticket-filter-footer .ticket-filter-actions button{height:34px;min-height:34px;padding:6px 12px;font-size:10px}
.ticket-filter-footer .ticket-filter-actions .primary{min-width:96px}
.ticket-command-split>.ticket-voice-studio:not([hidden]){border-top:1px solid #d9e5e1}

@container (max-width:620px){
  .ticket-register-v3 .ticket-upload-layout{grid-template-columns:1fr}
}

@media(max-width:900px){
  .ticket-register-v3 .ticket-upload-layout{grid-template-columns:1fr}
  .ticket-register-v3 .ticket-context{grid-template-columns:1fr auto;gap:8px 12px}
  .ticket-register-v3 .ticket-progress-head{grid-column:1/-1}
  .ticket-register-v3 .ticket-queue-scope-slot{grid-column:1;justify-content:flex-start;padding:2px 0 0}
  .ticket-register-v3 .compact-ticket-nav{grid-column:1/-1}
  .ticket-register-v3 .ticket-personnel-panel{grid-template-columns:1fr}
  .ticket-register-v3 .ticket-personnel-panel>header{display:flex;align-items:flex-end;justify-content:space-between;gap:16px}
  .ticket-register-v3 .ticket-personnel-panel>header p{max-width:340px;text-align:right}
  .ticket-filter-section{grid-template-columns:1fr;gap:8px}
  .ticket-filter-section>header{padding-top:0}
  .ticket-filter-footer{padding-left:15px}
}
@media(max-width:720px){
  .ticket-register-v3 .ticket-upload-layout .upload-actions{grid-template-columns:1fr;grid-template-rows:none}
  .ticket-register-v3 .ticket-overview-grid{grid-template-columns:1fr}
  .ticket-register-v3 .ticket-identity-core.form-grid,
  .ticket-register-v3 .ticket-time-grid{grid-template-columns:1fr}
  .ticket-register-v3 .ticket-identity-core .field,
  .ticket-register-v3 .ticket-time-grid .field{grid-template-columns:1fr;gap:5px}
  .ticket-register-v3 .ticket-time-section{border-top:1px solid #d8e6e1}
  .ticket-register-v3 .ticket-personnel-grid{grid-template-columns:1fr}
  .ticket-register-v3 .ticket-personnel-panel>header{display:block}
  .ticket-register-v3 .ticket-personnel-panel>header p{max-width:none;text-align:left}
  .ticket-register-v3 .ticket-form-card .ticket-classification>.form-grid{grid-template-columns:1fr}
  .ticket-register-v3 .ticket-form-card .ticket-classification .ticket-follow-field{padding-top:14px;border-top:1px solid #e2ece7}
  .ticket-close-options{grid-template-columns:1fr}
  .ticket-register-v3 .ticket-subsection-heading,
  .ticket-register-v3 .ticket-time-section .section-heading{align-items:flex-start;flex-direction:column;gap:4px;height:auto;min-height:0}
  .ticket-register-v3 .ticket-time-section .section-heading p{white-space:normal}
  .ticket-status-tabs{overflow-x:auto}
  .ticket-status-tabs .ticket-display-toolbar{position:sticky;right:0;padding-left:9px;background:#f4f1e9}
  .ticket-status-tabs .ticket-display-toolbar>span{display:none}
  .ticket-command-split .ticket-command-row{grid-template-columns:minmax(0,1fr) auto;padding:11px}
  .ticket-command-split .ticket-command-row .ticket-voice-trigger{display:flex;width:auto;padding:7px 10px}
  .ticket-command-split .ticket-filter-panel{padding:0 11px 11px}
  .ticket-filter-grid{grid-template-columns:1fr}
  .ticket-filter-people .ticket-date-filter{grid-column:1}
  .ticket-filter-footer{align-items:stretch;flex-direction:column;padding:10px}
  .ticket-filter-footer .ticket-filter-actions{display:grid;grid-template-columns:auto 1fr}
}
