*{box-sizing:border-box}body{margin:0;font-family:Inter,Arial,sans-serif;background:#f4f7fb;color:#18212f}a{text-decoration:none;color:inherit}code,pre{font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.public-body{display:flex;align-items:center;justify-content:center;min-height:100vh;background:linear-gradient(135deg,#0f172a,#1d4ed8)}.public-wrap{width:100%;max-width:420px;padding:24px}.app-shell{display:grid;grid-template-columns:260px 1fr;min-height:100vh}.sidebar{background:#0f172a;color:#fff;padding:24px;display:flex;flex-direction:column;gap:24px}.brand{font-size:28px;font-weight:800}.nav{display:flex;flex-direction:column;gap:10px}.nav a{padding:12px 14px;border-radius:12px;background:rgba(255,255,255,.05)}.nav a:hover{background:rgba(255,255,255,.12)}.main{padding:24px}.topbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:18px}.page-title{font-size:28px;font-weight:800}.content{display:block}.card{background:#fff;border-radius:20px;padding:20px;box-shadow:0 10px 30px rgba(15,23,42,.08)}.narrow{max-width:520px;margin:0 auto}.center{text-align:center}.card-title{font-size:20px;font-weight:700;margin-bottom:16px}.form-grid{display:grid;gap:14px}.filters-grid{display:grid;gap:12px;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));align-items:end}.grid{display:grid}.cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.gap{gap:16px}.mt-16{margin-top:16px}.btn{border:none;background:#2563eb;color:#fff;padding:12px 16px;border-radius:12px;cursor:pointer;font-weight:700}.btn:hover{opacity:.95}.btn-secondary{background:#334155}.btn-danger{background:#dc2626}.btn-small{padding:8px 12px;border-radius:10px;font-size:13px}.logout-form{margin-top:auto}.alert{padding:12px 14px;border-radius:12px}.alert-error{background:#fee2e2;color:#991b1b}.badge{display:inline-flex;align-items:center;justify-content:center;padding:6px 10px;border-radius:999px;background:#e2e8f0;font-size:12px;font-weight:700}.badge-success{background:#dcfce7;color:#166534}.badge-danger{background:#fee2e2;color:#991b1b}.badge-warning{background:#fef3c7;color:#92400e}.badge-muted{background:#e5e7eb;color:#374151}.stat{text-align:center}.stat-value{font-size:34px;font-weight:800}.stat-label{color:#475569;margin-top:8px}.chips{display:flex;flex-wrap:wrap;gap:8px}.chip{padding:8px 12px;border-radius:999px;background:#eff6ff;color:#1d4ed8;font-weight:700}.table{width:100%;border-collapse:collapse}.table th,.table td{text-align:left;padding:12px;border-bottom:1px solid #e5e7eb;vertical-align:top}.wrap{white-space:pre-wrap;word-break:break-word}.muted{color:#64748b}.kv{display:flex;justify-content:space-between;gap:12px;padding:10px 0;border-bottom:1px solid #e5e7eb}.kv:last-child{border-bottom:none}.inline-actions{display:flex;gap:8px;flex-wrap:wrap}.action-row{margin-top:10px}.json-box{background:#0f172a;color:#e2e8f0;padding:14px;border-radius:14px;overflow:auto;white-space:pre-wrap;word-break:break-word;min-height:100px}.checkbox{display:flex;align-items:center;gap:10px}input,select,textarea{width:100%;padding:12px 14px;border:1px solid #cbd5e1;border-radius:12px;background:#fff;font:inherit}label{display:grid;gap:8px;font-weight:600;color:#334155}.list{margin:0;padding-left:20px;display:grid;gap:10px}@media (max-width:1100px){.cols-4{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (max-width:900px){.app-shell{grid-template-columns:1fr}.sidebar{position:sticky;top:0;z-index:1}.cols-2,.cols-4{grid-template-columns:1fr}.main{padding:16px}}

.settings-grid {
  align-items: start;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

.form-grid > label,
.form-grid > .full-width {
  min-width: 0;
}

.full-width {
  grid-column: 1 / -1;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 500;
}

.form-grid input,
.form-grid textarea,
.form-grid select {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.checkbox {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

.checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  flex: 0 0 auto;
}

.kv {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.code-wrap {
  display: inline-block;
  max-width: 100%;
  white-space: normal;
  word-break: break-all;
  overflow-wrap: anywhere;
  text-align: right;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.action-row form {
  margin: 0;
}

.action-row .btn,
.action-row button {
  width: auto;
  max-width: 100%;
}

.hint,
.json-box,
code {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.mb-12 {
  margin-bottom: 12px;
}

.mt-16 {
  margin-top: 16px;
}

@media (max-width: 900px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .stack-on-mobile {
    flex-direction: column;
    align-items: stretch;
  }

  .code-wrap {
    text-align: left;
  }

  .action-row .btn,
  .action-row button {
    width: 100%;
  }
}

.checkbox-row {
  display: block;
}

.checkbox-inline {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  margin: 0;
}

.checkbox-inline input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  flex: 0 0 auto;
}

.checkbox-inline span {
  line-height: 1.3;
}

.toggle-cell {
  display: flex;
  align-items: center;
  min-height: 40px;
}

.toggle-inline {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  margin: 0;
  white-space: nowrap;
  font-weight: 500;
}

.toggle-inline input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  flex: 0 0 auto;
}

.toggle-inline span {
  line-height: 1.2;
}

.rule-checkbox-row {
  display: block;
}

.rule-checkbox-inline {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-weight: 500;
}

.rule-checkbox-inline input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  flex: 0 0 auto;
}

.rule-checkbox-inline span {
  line-height: 1.2;
}

.user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}

.actions-menu {
  position: relative;
}

.actions-menu summary {
  list-style: none;
  cursor: pointer;
}

.actions-menu summary::-webkit-details-marker {
  display: none;
}

.actions-menu-box {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 230px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.14);
  padding: 10px;
  z-index: 40;
  display: grid;
  gap: 8px;
}

.menu-action-btn {
  width: 100%;
  border: 0;
  background: #f8fafc;
  border-radius: 10px;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.menu-action-btn:hover {
  background: #eef2ff;
}

.menu-action-btn.danger {
  background: #fff1f2;
  color: #b42318;
}

.menu-action-btn.danger:hover {
  background: #ffe4e6;
}

.password-reset-box summary {
  list-style: none;
}

.password-reset-box summary::-webkit-details-marker {
  display: none;
}

.password-inline-form {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.password-inline-form input[type="password"] {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

@media (max-width: 900px) {
  .actions-menu-box {
    position: static;
    margin-top: 8px;
    min-width: 0;
    width: 100%;
  }

  .user-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .user-actions .btn,
  .actions-menu summary {
    width: 100%;
  }
}

.btn-disabled {
  pointer-events: none;
  opacity: 0.55;
}

.chip[data-insert-token] {
  cursor: pointer;
}

.chip[data-insert-token]:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.card-mini {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 16px;
  background: rgba(255,255,255,0.04);
}

.sidebar-clock-label {
  font-size: 12px;
  opacity: 0.8;
  margin-bottom: 6px;
}

.sidebar-clock-time {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  word-break: break-word;
}

.sidebar-clock-zone {
  font-size: 12px;
  opacity: 0.75;
  margin-top: 6px;
  word-break: break-word;
}

.user-actions {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: nowrap;
  min-width: 180px;
  position: relative;
}

.user-actions > .btn,
.user-actions > .actions-menu > summary {
  flex: 0 0 auto;
  white-space: nowrap;
}

.actions-menu {
  position: relative;
}

.actions-menu[open] {
  z-index: 60;
}

.actions-menu summary {
  list-style: none;
  cursor: pointer;
}

.actions-menu summary::-webkit-details-marker {
  display: none;
}

.actions-menu-box {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.menu-action-btn {
  width: 100%;
  border: 0;
  background: #f8fafc;
  border-radius: 10px;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: background .15s ease;
}

.menu-action-btn:hover {
  background: #eef2ff;
}

.menu-action-btn.danger {
  background: #fff1f2;
  color: #b42318;
}

.menu-action-btn.danger:hover {
  background: #ffe4e6;
}

.menu-divider {
  height: 1px;
  background: rgba(15, 23, 42, 0.08);
  margin: 2px 0;
}

.password-reset-wrap {
  display: grid;
  gap: 8px;
}

.password-reset-title {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.password-inline-form {
  display: grid;
  gap: 8px;
}

.password-inline-form input[type="password"] {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.btn-disabled {
  pointer-events: none;
  opacity: 0.55;
}

@media (max-width: 1100px) {
  .user-actions {
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
  }

  .user-actions > .btn,
  .user-actions > .actions-menu > summary {
    width: 100%;
  }

  .actions-menu-box {
    position: static;
    width: 100%;
    margin-top: 8px;
  }
}

/* Users actions layout fix */
.table td.actions-col {
  min-width: 260px;
  width: 260px;
  vertical-align: top;
}

.user-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
  width: 100%;
  position: relative;
}

.user-actions > a.btn,
.user-actions > .actions-menu {
  flex: 0 0 auto;
}

.user-actions > a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
}

.actions-menu {
  position: relative;
  min-width: 84px;
}

.actions-menu > summary.btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 84px;
  white-space: nowrap;
}

.actions-menu-box {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: auto;
  width: 280px;
  max-width: 280px;
  box-sizing: border-box;
  z-index: 100;
}

@media (max-width: 1400px) {
  .table td.actions-col {
    min-width: 220px;
    width: 220px;
  }

  .user-actions > a.btn,
  .actions-menu > summary.btn {
    min-width: 0;
  }
}

@media (max-width: 1100px) {
  .table td.actions-col {
    min-width: 0;
    width: auto;
  }

  .user-actions {
    flex-direction: column !important;
    align-items: stretch;
  }

  .user-actions > a.btn,
  .actions-menu,
  .actions-menu > summary.btn {
    width: 100%;
  }

  .actions-menu-box {
    position: static;
    width: 100%;
    max-width: none;
    margin-top: 8px;
  }
}

/* FINAL FIX: admin users actions */
.table td.actions-col {
  width: 170px !important;
  min-width: 170px !important;
  vertical-align: top !important;
}

.user-actions.user-actions-vertical {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 8px !important;
  width: 100% !important;
  min-width: 0 !important;
}

.user-actions.user-actions-vertical > a.btn,
.user-actions.user-actions-vertical > .actions-menu {
  width: 100% !important;
}

.user-actions.user-actions-vertical > a.btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 0 !important;
}

.actions-menu-inline {
  position: relative !important;
}

.actions-menu-inline > summary.btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

.actions-menu-inline .actions-menu-box {
  position: absolute !important;
  top: calc(100% + 8px) !important;
  right: 0 !important;
  left: auto !important;
  width: 280px !important;
  max-width: 280px !important;
  box-sizing: border-box !important;
  z-index: 999 !important;
}

@media (max-width: 1200px) {
  .table td.actions-col {
    width: 150px !important;
    min-width: 150px !important;
  }

  .actions-menu-inline .actions-menu-box {
    right: auto !important;
    left: 0 !important;
  }
}

@media (max-width: 900px) {
  .table td.actions-col {
    width: auto !important;
    min-width: 0 !important;
  }

  .actions-menu-inline .actions-menu-box {
    position: static !important;
    width: 100% !important;
    max-width: none !important;
    margin-top: 8px !important;
  }
}

.progress-wrap {
  display: grid;
  gap: 8px;
  min-width: 160px;
}

.progress-bar {
  width: 100%;
  height: 14px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0;
  background: #2563eb;
  border-radius: 999px;
  transition: width .25s ease;
}

.campaign-live {
  display: grid;
  gap: 10px;
}

.campaign-status-line,
.campaign-progress-text {
  line-height: 1.5;
}
