/* Unified desktop presentation for the complete messaging system. */
body:not(.ua-android-app):is(
  .ua-p-messages-outbox,
  .ua-p-messages-campaigns,
  .ua-p-message-log,
  .ua-p-messages-templates,
  .ua-p-settings-sms,
  .ua-p-settings-whatsapp
) .ua-atabs-wrap{
  margin:10px 0 14px;
}

body:not(.ua-android-app):is(
  .ua-p-messages-outbox,
  .ua-p-messages-campaigns,
  .ua-p-message-log,
  .ua-p-messages-templates,
  .ua-p-settings-sms,
  .ua-p-settings-whatsapp
) .ua-atabs{
  min-height:44px;
  border-radius:13px;
}

body:not(.ua-android-app):is(
  .ua-p-messages-outbox,
  .ua-p-messages-campaigns,
  .ua-p-message-log,
  .ua-p-messages-templates,
  .ua-p-settings-sms,
  .ua-p-settings-whatsapp
) .ua-atab{
  min-width:0;
  min-height:44px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:8px 10px;
  font-size:11px;
}

body:not(.ua-android-app):is(
  .ua-p-message-log,
  .ua-p-messages-templates,
  .ua-p-settings-whatsapp
) .content-wrapper>.content>.container-fluid{
  padding-inline:26px;
}

.msg-page-hero{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  margin-bottom:12px;
  padding:14px 16px;
  border:1px solid var(--ua-ds-line);
  border-radius:14px;
  background:linear-gradient(135deg,color-mix(in srgb,var(--ua-theme-surface) 90%,var(--ua-accent) 10%),var(--ua-theme-surface-2));
  box-shadow:0 14px 32px rgba(0,0,0,.18);
}
.msg-page-hero__title{display:flex;align-items:center;gap:11px;min-width:0}
.msg-page-hero__icon{
  display:grid;
  flex:0 0 42px;
  width:42px;
  height:42px;
  place-items:center;
  border:1px solid rgba(56,189,248,.28);
  border-radius:12px;
  background:rgba(14,165,233,.09);
  color:#59d4fa;
  font-size:17px;
}
.msg-page-hero small,.msg-panel-title small{
  display:block;
  color:var(--ua-sem-muted);
  font-size:9px;
  font-weight:900;
  letter-spacing:.08em;
}
.msg-page-hero h1{margin:2px 0;color:var(--ua-ds-title);font-size:19px;font-weight:900}
.msg-page-hero p{margin:0;color:var(--ua-sem-muted);font-size:10px}
.msg-page-hero__meta{
  display:flex;
  align-items:center;
  gap:7px;
  flex:0 0 auto;
  padding:7px 10px;
  border:1px solid rgba(52,211,153,.22);
  border-radius:9px;
  background:rgba(16,185,129,.07);
  color:#8fe2c2;
  font-size:10px;
  font-weight:900;
}
.msg-page-hero__meta i{width:7px;height:7px;border-radius:50%;background:#2bd498}

.msg-panel{
  min-width:0;
  padding:14px;
  border:1px solid var(--ua-ds-line);
  border-radius:14px;
  background:linear-gradient(145deg,var(--ua-theme-surface),var(--ua-theme-surface-2));
  box-shadow:0 10px 24px rgba(0,0,0,.16);
}
.msg-panel-title{display:flex;align-items:center;gap:9px;margin-bottom:12px}
.msg-panel-title>i{
  display:grid;
  flex:0 0 34px;
  width:34px;
  height:34px;
  place-items:center;
  border-radius:9px;
  background:rgba(14,165,233,.09);
  color:#59d4fa;
}
.msg-panel-title h2{margin:2px 0 0;color:var(--ua-ds-title);font-size:15px;font-weight:900}

.msg-feedback{
  display:flex;
  align-items:center;
  gap:8px;
  margin-bottom:10px;
  padding:10px 12px;
  border:1px solid rgba(52,211,153,.3);
  border-radius:11px;
  background:rgba(13,57,46,.88);
  color:#86e6c3;
  font-size:11px;
  font-weight:900;
}
.msg-feedback.is-error{border-color:rgba(248,113,113,.42);background:rgba(49,25,34,.92);color:#ffadb5}

.msg-field{display:grid;min-width:0;gap:5px;margin:0}
.msg-field>span{color:#b9c7d6;font-size:10px;font-weight:900}
.msg-field>small{color:#71869d;font-size:9px;line-height:1.55}
.msg-field :is(input,select,textarea){
  width:100%;
  min-width:0;
  height:39px;
  padding:0 9px;
  border:1px solid rgba(126,151,182,.25);
  border-radius:9px;
  outline:0;
  background:#071423;
  color:#f4f8fc;
  font-size:11px;
  box-shadow:none;
  box-sizing:border-box;
}
.msg-field textarea{height:84px;padding-block:8px;resize:vertical}
.msg-field :is(input,select,textarea):focus{border-color:rgba(56,189,248,.65);box-shadow:0 0 0 3px rgba(56,189,248,.08)}
.msg-field input::placeholder,.msg-field textarea::placeholder{color:#587087}
.msg-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
.msg-field.is-wide{grid-column:1/-1}
.msg-switch{
  display:flex;
  align-items:center;
  gap:9px;
  margin-bottom:10px;
  padding:9px 10px;
  border:1px solid rgba(52,211,153,.2);
  border-radius:10px;
  background:rgba(16,185,129,.06);
  cursor:pointer;
}
.msg-switch input{width:17px;height:17px;accent-color:#22c991}
.msg-switch span{display:grid;gap:2px}
.msg-switch b{color:#e9fff7;font-size:12px}
.msg-switch small{color:#86a89d;font-size:9px}
.msg-primary-action,.msg-secondary-action{
  display:inline-flex;
  min-height:39px;
  align-items:center;
  justify-content:center;
  gap:7px;
  padding:0 15px;
  border:1px solid rgba(52,211,153,.38);
  border-radius:9px;
  background:linear-gradient(135deg,#169b70,#11785c);
  color:#fff;
  font-size:10px;
  font-weight:900;
}
.msg-secondary-action{border-color:rgba(56,189,248,.3);background:rgba(14,165,233,.09);color:#67d9fa}
.msg-form-actions{display:flex;justify-content:flex-start;margin-top:11px}
.msg-inline-note{
  display:flex;
  align-items:flex-start;
  gap:8px;
  margin-top:10px;
  padding:10px;
  border:1px solid rgba(56,189,248,.2);
  border-radius:10px;
  background:rgba(14,165,233,.06);
  color:#91b9ca;
  font-size:9px;
  line-height:1.7;
}
.msg-inline-note i{margin-top:3px;color:#5ed4f8}

/* WhatsApp */
.wa-settings-grid{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(320px,.8fr);gap:10px;padding-bottom:14px}
.wa-settings-grid .msg-panel{align-self:start}
.wa-test-panel .msg-primary-action{width:100%;background:linear-gradient(135deg,#169b70,#126d50)}
.wa-token-wrap{position:relative}
.wa-token-wrap input{padding-left:40px}
.wa-token-toggle{
  position:absolute;
  left:5px;
  bottom:5px;
  width:30px;
  height:29px;
  padding:0;
  border:0;
  border-radius:7px;
  background:#10253a;
  color:#87a9c2;
}

/* Message log */
.msg-log-filters{display:grid;grid-template-columns:minmax(180px,1.5fr) repeat(4,minmax(115px,1fr)) auto;gap:8px;align-items:end}
.msg-log-filters .msg-primary-action{width:100%;padding-inline:13px}
.msg-log-danger{margin-top:10px;border:1px solid rgba(248,113,113,.24);border-radius:12px;background:rgba(67,20,28,.22);overflow:hidden}
.msg-log-danger>summary{display:flex;min-height:43px;align-items:center;gap:8px;padding:0 12px;color:#ff9da5;font-size:10px;font-weight:900;cursor:pointer;list-style:none}
.msg-log-danger>summary::-webkit-details-marker{display:none}
.msg-log-danger[open]>summary{border-bottom:1px solid rgba(248,113,113,.18)}
.msg-log-delete-form{display:grid;grid-template-columns:repeat(2,minmax(150px,1fr)) auto;gap:8px;padding:11px;align-items:end}
.msg-log-delete-form button{min-height:39px;border:1px solid rgba(248,113,113,.38);border-radius:9px;background:linear-gradient(135deg,#dc4351,#9e2836);color:#fff;font-size:10px;font-weight:900}
.msg-table-shell{margin-top:10px;padding:0;overflow:auto;max-height:calc(100dvh - 350px);border:1px solid var(--ua-ds-line);border-radius:14px;background:var(--ua-theme-surface)}
.msg-table-shell table{width:100%;min-width:880px;margin:0!important;border-collapse:separate;border-spacing:0}
.msg-table-shell thead{position:sticky;z-index:2;top:0}
.msg-table-shell th{background:var(--ua-theme-table-head)!important;color:var(--ua-ds-title)!important;font-size:10px;white-space:nowrap}
.msg-table-shell td{font-size:10px;vertical-align:middle}
.msg-table-shell .msg-response{max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* Templates */
.msg-template-meta{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:10px}
.msg-template-meta span{padding:5px 8px;border-radius:7px;background:#071423;color:#7890a7;font-size:9px}
.msg-template-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.msg-template-card{display:grid;min-width:0;grid-template-rows:auto 1fr;border:1px solid rgba(126,151,182,.22);border-radius:13px;background:linear-gradient(145deg,rgba(17,34,55,.98),rgba(8,21,37,.98));overflow:hidden}
.msg-template-card__head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;border-bottom:1px solid rgba(126,151,182,.14)}
.msg-template-card__head>div{display:grid;min-width:0}
.msg-template-card__head b{overflow:hidden;color:#f4f8fc;font-size:12px;text-overflow:ellipsis;white-space:nowrap}
.msg-template-card__head small{color:#6f879f;font-size:8px}
.msg-template-card__body{display:grid;grid-template-columns:minmax(0,1fr) 130px;gap:8px;padding:11px}
.msg-template-card__body .msg-field.is-body{grid-column:1/-1}
.msg-template-card__body textarea{height:86px}
.msg-template-switch{display:flex;align-items:center;gap:6px;color:#9eb1c5;font-size:9px;font-weight:900;white-space:nowrap}
.msg-template-switch input{width:16px;height:16px;accent-color:#22c991}
.msg-template-save{
  position:sticky;
  z-index:6;
  bottom:8px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-top:11px;
  padding:9px 10px;
  border:1px solid rgba(52,211,153,.28);
  border-radius:11px;
  background:rgba(6,24,32,.96);
  box-shadow:0 12px 32px rgba(0,0,0,.32);
  backdrop-filter:blur(14px);
}
.msg-template-save span{color:#83aa9e;font-size:9px}
.msg-template-save button{min-height:38px;padding:0 16px;border:0;border-radius:9px;background:linear-gradient(135deg,#169b70,#11785c);color:#fff;font-size:10px;font-weight:900}

@media(max-width:1050px){
  .wa-settings-grid{grid-template-columns:1fr}
  .msg-log-filters{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:760px){
  body:not(.ua-android-app):is(.ua-p-message-log,.ua-p-messages-templates,.ua-p-settings-whatsapp) .content-wrapper>.content>.container-fluid{padding-inline:10px}
  .msg-page-hero{align-items:flex-start}
  .msg-page-hero p{display:none}
  .msg-page-hero__meta{display:none}
  .msg-form-grid,.msg-template-grid,.msg-log-filters,.msg-log-delete-form{grid-template-columns:1fr}
  .msg-field.is-wide{grid-column:auto}
  .msg-template-card__body{grid-template-columns:1fr}
  .msg-template-card__body .msg-field.is-body{grid-column:auto}
  .msg-table-shell{max-height:none}
}
