@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  font-family: 'Plus Jakarta Sans', Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #0c232c;
  background: #f7fafb;
  font-size: 14px;
  --teal: #1f9aa7;
  --teal-hover: #17838e;
  --teal-light: #e6f6f7;
  --teal-border: #bfe8ec;
  --teal-dark: #072733;
  --dark: #072531;
  --dark-surface: #0a2d3b;
  --muted: #5e7380;
  --line: #e4eef2;
  --subtle: #f7fafb;
  --blue: #e8f7f8;
  --card-shadow: 0 4px 20px -2px rgba(8, 38, 49, 0.05), 0 1px 3px 0 rgba(8, 38, 49, 0.03);
  --card-shadow-hover: 0 10px 30px -4px rgba(8, 38, 49, 0.1), 0 2px 8px -1px rgba(8, 38, 49, 0.04);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f7fafb;
  color: var(--dark);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, textarea, select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid #28b0be;
  outline-offset: 2px;
}

h1, h2, h3, p {
  margin: 0;
}

h1, h2, h3 {
  font-family: 'Plus Jakarta Sans', Inter, sans-serif;
  letter-spacing: -.035em;
  color: var(--dark);
}

h1 {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.25;
}

h2 {
  font-size: 18px;
  font-weight: 750;
  line-height: 1.35;
}

h3 {
  font-size: 14px;
  font-weight: 700;
}

svg {
  height: 19px;
  width: 19px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

input, textarea, select {
  color: var(--dark);
  border: 1px solid #dbe6ec;
  background: #ffffff;
  border-radius: 11px;
  padding: 11px 14px;
  width: 100%;
  outline: 0;
  font-size: 13px;
  transition: border-color .15s ease, box-shadow .15s ease;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3.5px rgba(31, 154, 167, 0.16);
}

input::placeholder, textarea::placeholder {
  color: #9cb0bb;
}

textarea {
  resize: vertical;
  line-height: 1.6;
}

label {
  display: block;
  font-weight: 700;
  font-size: 12px;
  margin-bottom: 7px;
  color: #3b505c;
  letter-spacing: -.01em;
}

.muted {
  color: var(--muted);
}

.tiny {
  font-size: 11px;
}

.small {
  font-size: 12px;
}

/* Finpay Modern Buttons */
.btn {
  border: 1px solid #dce7ec;
  border-radius: 11px;
  padding: 10px 16px;
  background: #ffffff;
  color: #3d505c;
  font-weight: 700;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  white-space: nowrap;
  transition: all .16s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.btn:hover {
  background: #f4f9fa;
  border-color: #c7dbe2;
  color: #1a323d;
  transform: translateY(-1px);
}

.btn.primary {
  color: #ffffff;
  background: linear-gradient(135deg, #24a4b1 0%, #16818e 100%);
  border: 1px solid #1a8f9c;
  box-shadow: 0 4px 14px 0 rgba(22, 129, 142, 0.28);
}

.btn.primary:hover {
  background: linear-gradient(135deg, #29b2bf 0%, #198d9c 100%);
  border-color: #1f98a5;
  box-shadow: 0 6px 20px 0 rgba(22, 129, 142, 0.38);
  transform: translateY(-1px);
}

.btn.danger {
  color: #c44747;
  border-color: #f6d1d1;
  background: #fdf5f5;
}

.btn.danger:hover {
  background: #fbe6e6;
  border-color: #e59d9d;
}

.btn.quiet {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.btn.quiet:hover {
  background: #eff6f7;
}

.btn.icon-only {
  width: 40px;
  padding: 8px;
}

.btn.sm {
  min-height: 33px;
  padding: 6px 11px;
  font-size: 12px;
  border-radius: 9px;
}

.btn svg {
  width: 17px;
  height: 17px;
}

.field {
  margin-bottom: 17px;
}

.field small {
  display: block;
  color: var(--muted);
  margin-top: 5px;
  font-size: 11px;
}

/* Finpay Layout Structure */
.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  background: #f7fafb;
}

/* Rail Navigation */
.rail {
  grid-column: 1;
  grid-row: 1;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  padding: 24px 10px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  background: #ffffff;
  z-index: 12;
  box-shadow: 1px 0 4px rgba(7, 39, 51, 0.02);
}

.logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, #072a36 0%, #104e5f 100%);
  color: #37d6e2;
  display: grid;
  place-items: center;
  font-size: 26px;
  font-weight: 800;
  box-shadow: 0 6px 16px rgba(7, 42, 54, 0.28);
  margin-bottom: 18px;
  transition: transform .2s ease;
}

.logo:hover {
  transform: scale(1.05);
}

.logo svg {
  width: 27px;
  height: 27px;
  stroke-width: 2.1;
}

.rail-line {
  width: 36px;
  height: 1px;
  background: var(--line);
  margin: 3px 0 10px;
}

.rail-label {
  font-size: 10px;
  letter-spacing: .1em;
  color: #9cb0ba;
  text-transform: uppercase;
  font-weight: 800;
  margin: 0 0 5px;
}

.nav-icon {
  height: 42px;
  width: 44px;
  border-radius: 12px;
  background: transparent;
  border: 1px solid transparent;
  color: #5d7380;
  display: grid;
  place-items: center;
  position: relative;
  transition: all .15s ease;
}

.nav-icon:hover {
  background: #f0f7f8;
  color: var(--teal);
}

.nav-icon.active {
  border-color: var(--teal-border);
  background: var(--teal-light);
  color: #107782;
  box-shadow: 0 2px 6px rgba(16, 119, 130, 0.08);
}

.nav-icon.active:after {
  content: '';
  position: absolute;
  left: -10px;
  width: 3px;
  height: 24px;
  background: var(--teal);
  border-radius: 0 3px 3px 0;
}

.rail-spacer {
  flex: 1;
}

.main-frame {
  grid-column: 2;
  min-width: 0;
  background: #f7fafb;
}

/* Topbar */
.topbar {
  height: 80px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  display: flex;
  align-items: center;
  padding: 0 30px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 3px rgba(7, 39, 51, 0.02);
}

.top-search {
  width: min(440px, 38vw);
  height: 42px;
  border: 1px solid #e1ecf0;
  border-radius: 9999px;
  background: #f7fafb;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  color: #98abb6;
  transition: all .15s ease;
}

.top-search:focus-within {
  border-color: var(--teal);
  background: #ffffff;
  box-shadow: 0 0 0 3.5px rgba(31, 154, 167, 0.12);
  color: var(--teal);
}

.top-search input {
  border: 0;
  padding: 0;
  min-width: 0;
  font-size: 13px;
  background: transparent;
}

.top-search input:focus {
  box-shadow: none;
}

.top-search kbd {
  border: 1px solid #dce6eb;
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 11px;
  white-space: nowrap;
  background: #ffffff;
  color: #79909c;
}

.top-spacer {
  flex: 1;
}

.env-pill {
  border: 1px solid #d3ece6;
  background: #eef9f6;
  color: #278870;
  padding: 5px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
}

.env-pill.live {
  background: #e2f7f1;
  border-color: #bbf0e2;
  color: #0f765e;
}

.top-brand {
  border: 1px solid #e1ebef;
  background: #ffffff;
  border-radius: 9999px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
  color: #3b505c;
  display: flex;
  align-items: center;
  gap: 9px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: .15s;
}

.top-brand:hover {
  background: #f8fafb;
  border-color: #c7dbe2;
}

.brand-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

.user-chip {
  border: 1px solid #e1ebef;
  border-radius: 9999px;
  background: #ffffff;
  padding: 6px 12px 6px 7px;
  display: flex;
  gap: 9px;
  align-items: center;
  color: #3b505c;
  font-weight: 700;
  font-size: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: .15s;
}

.user-chip:hover {
  background: #f8fafb;
  border-color: #c7dbe2;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--teal-light);
  color: #107a85;
  font-size: 11px;
  font-weight: 800;
}

/* Workspace & Inner Sidebar */
.workspace {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: calc(100vh - 80px);
}

.sidebar {
  background: #fcfdfd;
  border-right: 1px solid var(--line);
  padding: 28px 16px 24px;
}

.sidebar h1 {
  font-size: 22px;
  margin: 0 10px 22px;
  font-weight: 800;
  letter-spacing: -.03em;
}

.sidebar .section-note {
  font-size: 10px;
  text-transform: uppercase;
  color: #9cb0ba;
  letter-spacing: .1em;
  font-weight: 800;
  padding: 16px 10px 8px;
}

.side-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  border: 0;
  background: transparent;
  border-radius: 11px;
  padding: 10px 12px;
  text-align: left;
  color: #4b606c;
  font-weight: 600;
  margin: 2px 0;
  font-size: 13px;
  transition: all .14s ease;
}

.side-item svg {
  width: 17px;
  height: 17px;
  color: #7d939e;
  transition: color .14s ease;
}

.side-item:hover {
  background: #f0f7f8;
  color: var(--dark);
}

.side-item:hover svg {
  color: var(--teal);
}

.side-item.active {
  background: #ffffff;
  color: #072a36;
  box-shadow: 0 2px 8px rgba(7, 42, 54, 0.06);
  font-weight: 700;
}

.side-item.active svg {
  color: var(--teal);
}

.side-item .count {
  margin-left: auto;
  color: #9ab0bb;
  font-size: 11px;
  font-weight: 600;
  background: #f2f7f8;
  padding: 2px 7px;
  border-radius: 9999px;
}

.side-foot {
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding: 20px 10px;
}

.side-foot strong {
  font-size: 11px;
  color: var(--dark);
}

.side-foot p {
  font-size: 11px;
  line-height: 1.6;
  color: #8c9ea7;
  margin-top: 7px;
}

/* Main Content Area */
.content {
  min-width: 0;
  padding: 30px 36px 60px;
  background: #f7fafb;
}

.head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 22px;
  margin-bottom: 24px;
}

.head p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.head-actions .btn {
  flex-shrink: 0;
}

.heading-eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--teal);
  font-weight: 800;
  margin-bottom: 8px;
}

.welcome h1 {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -.035em;
}

.welcome p {
  margin-top: 8px;
  color: #697d89;
  font-size: 14px;
}

/* Finpay Signature Hero Banner (Deep Petrol Navy) */
.campaign-hero {
  padding: 28px 32px;
  background: linear-gradient(135deg, #072a36 0%, #0b3745 60%, #114c5c 100%);
  border: 1px solid #144958;
  border-radius: 20px;
  margin-bottom: 22px;
  color: #ffffff;
  box-shadow: 0 14px 38px -6px rgba(7, 42, 54, 0.22);
  position: relative;
  overflow: hidden;
}

.campaign-hero::after {
  content: '';
  position: absolute;
  right: -50px;
  top: -50px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(36, 164, 177, 0.22) 0%, transparent 70%);
  pointer-events: none;
}

.campaign-hero .line {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  position: relative;
  z-index: 1;
}

.campaign-hero .heading-eyebrow {
  color: #4ee2eb;
  letter-spacing: .12em;
}

.campaign-hero h2 {
  font-size: 22px;
  line-height: 1.35;
  margin: 8px 0 6px;
  color: #ffffff;
  font-weight: 800;
}

.campaign-hero p {
  color: #bad3db;
  font-size: 13px;
  line-height: 1.6;
}

.campaign-hero .actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  position: relative;
  z-index: 1;
}

.campaign-hero .btn.primary {
  background: linear-gradient(135deg, #25a4b0 0%, #17838e 100%);
  border-color: #2bb5c2;
  box-shadow: 0 4px 16px rgba(37, 164, 176, 0.4);
}

.campaign-hero .btn:not(.primary) {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: none;
  backdrop-filter: blur(8px);
}

.campaign-hero .btn:not(.primary):hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.35);
}

/* Finpay Bento Metrics Cards */
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  border: 0;
  margin: 22px 0 22px;
}

.metric {
  padding: 22px;
  min-width: 0;
  background: #ffffff;
  border: 1px solid #e4edf1;
  border-radius: 18px;
  box-shadow: var(--card-shadow);
  transition: transform .18s ease, box-shadow .18s ease;
}

.metric:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow-hover);
  border-color: #d8e5ea;
}

.metric .metric-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #6d828f;
  font-size: 12px;
  font-weight: 700;
  gap: 8px;
}

.metric-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #eef8f8;
  color: var(--teal);
  border: 0;
}

.metric-icon svg {
  height: 18px;
  width: 18px;
}

.metric strong {
  display: block;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -.04em;
  margin: 12px 0 3px;
  color: var(--dark);
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.metric small {
  color: #92a4af;
  font-size: 11px;
}

.metric small b {
  color: #17838e;
  font-weight: 700;
}

.metric:nth-child(2) .metric-icon {
  background: #e9f2fa;
  color: #2779b5;
}

.metric:nth-child(3) .metric-icon {
  background: #fbf5e7;
  color: #b78326;
}

.metric:nth-child(4) .metric-icon {
  background: #f4ecf8;
  color: #8c529f;
}

/* Finpay Bento Cards */
.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(320px, .9fr);
  gap: 20px;
}

.card {
  border: 1px solid #e4edf1;
  border-radius: 18px;
  background: #ffffff;
  min-width: 0;
  box-shadow: var(--card-shadow);
}

.card-pad {
  padding: 24px;
}

.card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title h2 {
  font-size: 17px;
  font-weight: 800;
}

.card-title .meta {
  color: #93a5b0;
  font-size: 11px;
  font-weight: 600;
}

/* Finpay Aesthetic Chart */
.chart {
  height: 230px;
  display: flex;
  align-items: end;
  gap: 10px;
  padding: 12px 16px 28px;
  position: relative;
  background: repeating-linear-gradient(to top, transparent 0, transparent 55px, #f0f4f6 56px, #f0f4f6 57px);
  margin-top: 18px;
  border-radius: 12px;
}

.bar-set {
  display: flex;
  gap: 4px;
  align-items: end;
  flex: 1;
  height: 100%;
  z-index: 1;
}

.bar {
  width: 50%;
  border-radius: 6px 6px 0 0;
  min-height: 2px;
  transition: height .3s ease;
}

.bar.teal {
  background: linear-gradient(180deg, #2cb3c0 0%, #1a8f9c 100%);
  box-shadow: 0 2px 6px rgba(26, 143, 156, 0.25);
}

.bar.light {
  background: #dbeef1;
}

.bar-set small {
  position: absolute;
  bottom: 4px;
  font-size: 10px;
  color: #98abb6;
  font-weight: 600;
  transform: translateX(-2px);
}

.legend {
  display: flex;
  justify-content: center;
  gap: 20px;
  color: #798e9b;
  font-size: 12px;
  font-weight: 600;
  margin-top: 14px;
}

.legend i {
  width: 9px;
  height: 9px;
  display: inline-block;
  border-radius: 50%;
  margin-right: 6px;
}

/* Finpay Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  background: #edf3f6;
  color: #556975;
}

.badge.teal, .badge.sent, .badge.check {
  background: #e2f7f1;
  color: #0f765e;
}

.badge.pending {
  background: #e7f3fd;
  color: #1e6fa8;
}

.badge.failed {
  background: #fdeeee;
  color: #b93838;
}

.badge.retry, .badge.quota {
  background: #fef5e6;
  color: #9c6716;
}

.badge.paused {
  background: #f2eefc;
  color: #7055b3;
}

.badge.warn {
  background: #fff3e6;
  color: #b56214;
}

/* Health Rows */
.health-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid #edf2f5;
  font-size: 13px;
}

.health-row:last-child {
  border: 0;
}

.health-row span:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #3b505c;
  font-weight: 600;
}

.health-row svg {
  width: 17px;
  height: 17px;
  color: #8c9ea8;
}

.health-state {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 11px;
  color: #1a8268;
}

.health-state.off {
  color: #b36e47;
}

.health-state:before {
  content: '';
  width: 8px;
  height: 8px;
  background: #1cb58e;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(28, 181, 142, 0.2);
}

.health-state.off:before {
  background: #e58852;
  box-shadow: 0 0 0 2px rgba(229, 136, 82, 0.2);
}

/* Activity Audit */
.activity {
  list-style: none;
  padding: 0;
  margin: 0;
}

.activity li {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid #edf2f5;
}

.activity li:last-child {
  border: 0;
}

.activity-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #eef8f8;
  color: var(--teal);
  display: grid;
  place-items: center;
  flex: none;
}

.activity-icon svg {
  width: 16px;
  height: 16px;
}

.activity li p {
  font-size: 12px;
  line-height: 1.5;
  color: #556a77;
}

.activity li strong {
  font-size: 13px;
  color: var(--dark);
}

.activity li time {
  display: block;
  color: #9cb0bb;
  font-size: 11px;
  margin-top: 4px;
}

.empty {
  padding: 40px 20px;
  text-align: center;
  color: #90a3ae;
  font-size: 13px;
  line-height: 1.7;
}

.empty svg {
  width: 32px;
  height: 32px;
  display: block;
  margin: 0 auto 10px;
  color: #a8c7cd;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, .85fr);
  gap: 20px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.section-head h2 {
  font-size: 17px;
  font-weight: 800;
}

.section-head small {
  color: #9cb0bb;
  font-weight: 600;
}

.split-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.mini-stat {
  border: 1px solid #e1edf1;
  border-radius: 14px;
  padding: 16px;
  background: #fbfdfd;
}

.mini-stat span {
  display: block;
  color: #8c9ea8;
  font-size: 12px;
  font-weight: 600;
}

.mini-stat strong {
  font: 800 22px 'Plus Jakarta Sans', sans-serif;
  display: block;
  margin-top: 6px;
  color: var(--dark);
}

/* Modern Data Table */
.table-wrap {
  border: 1px solid #e4edf1;
  border-radius: 16px;
  overflow: auto;
  box-shadow: var(--card-shadow);
  background: #ffffff;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
  min-width: 650px;
}

.data-table th {
  background: #f8fafc;
  color: #637885;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 800;
  padding: 14px 18px;
  white-space: nowrap;
}

.data-table td {
  border-top: 1px solid #edf2f5;
  padding: 14px 18px;
  vertical-align: middle;
  color: #3b505c;
}

.data-table tr:hover td {
  background: #f7fafb;
}

.table-name {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  color: var(--dark);
}

.avatar {
  height: 32px;
  width: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #eef7f8;
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
  flex: none;
}

.table-sub {
  color: #9cb0bb;
  font-size: 11px;
  margin-top: 3px;
}

.table-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.table-toolbar .search {
  max-width: 320px;
  margin-left: auto;
  position: relative;
}

.table-toolbar .search svg {
  position: absolute;
  left: 14px;
  top: 12px;
  color: #9cb0bb;
  width: 16px;
}

.table-toolbar .search input {
  padding-left: 38px;
  height: 40px;
  font-size: 13px;
  border-radius: 9999px;
  background: #ffffff;
}

/* Campaign Compose Layout */
.compose-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, .8fr);
  gap: 0;
  margin: -30px -36px -60px;
}

.compose-main {
  padding: 28px 34px 60px;
  min-width: 0;
  background: #f7fafb;
}

.compose-preview {
  border-left: 1px solid var(--line);
  background: #ffffff;
  padding: 30px 26px;
  min-width: 0;
}

.compose-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 22px;
  margin-bottom: 22px;
  gap: 16px;
}

.compose-head h1 {
  font-size: 24px;
}

.step {
  display: flex;
  gap: 16px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.step-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: #eef7f8;
  color: var(--teal);
  display: grid;
  place-items: center;
  flex: none;
}

.step-icon svg {
  width: 18px;
  height: 18px;
}

.step-body {
  min-width: 0;
  flex: 1;
}

.step-body h3 {
  margin: 3px 0 6px;
  font-size: 15px;
  font-weight: 800;
}

.step-body p {
  font-size: 12px;
  color: #798e9b;
  line-height: 1.6;
}

.step-body .field {
  margin-top: 18px;
}

.step-body textarea {
  min-height: 175px;
}

.step-body .input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.option {
  border: 1px solid #dbe6ec;
  background: #ffffff;
  border-radius: 14px;
  text-align: left;
  padding: 16px;
  transition: all .15s ease;
}

.option:hover {
  border-color: #bfe1e5;
  background: #fafdff;
}

.option.active {
  border-color: var(--teal);
  background: var(--teal-light);
  box-shadow: 0 2px 8px rgba(31, 154, 167, 0.1);
}

.option strong {
  display: block;
  font-size: 13px;
  margin-top: 10px;
  color: var(--dark);
}

.option small {
  display: block;
  color: #798e9b;
  font-size: 11px;
  margin-top: 4px;
  line-height: 1.5;
}

/* Finpay Segmented Pill Tabs */
.preview-tabs {
  display: inline-flex;
  gap: 5px;
  background: #edf3f6;
  padding: 5px;
  border-radius: 9999px;
  margin-bottom: 20px;
}

.preview-tabs button {
  border: 0;
  background: transparent;
  color: #6c808d;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 9999px;
  transition: all .15s ease;
}

.preview-tabs button:hover {
  color: var(--dark);
}

.preview-tabs button.active {
  color: #072a36;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(7, 42, 54, 0.08);
}

/* Finpay Mockup Phone */
.phone {
  width: 265px;
  max-width: 100%;
  height: 460px;
  border: 7px solid #082935;
  border-radius: 40px;
  margin: 0 auto;
  background: #fbfdfd;
  box-shadow: 0 24px 60px -8px rgba(8, 41, 53, 0.22);
  padding: 20px 16px;
  position: relative;
}

.phone:before {
  content: '';
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 70px;
  height: 16px;
  border-radius: 20px;
  background: #143d4c;
}

.phone-header {
  border-bottom: 1px solid #edf2f5;
  padding: 16px 0 12px;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--dark);
}

.phone-sub {
  color: #9cb0ba;
  font-weight: 500;
  font-size: 11px;
  margin-top: 3px;
}

.bubble {
  background: #e6f6f7;
  border-radius: 16px 16px 4px 16px;
  padding: 14px;
  font-size: 11px;
  color: #0b3442;
  white-space: pre-wrap;
  line-height: 1.6;
  overflow-wrap: anywhere;
  margin-top: 22px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.phone-bottom {
  position: absolute;
  bottom: 18px;
  left: 16px;
  right: 16px;
  border: 1px solid #dce6eb;
  border-radius: 9999px;
  padding: 9px 14px;
  color: #9cb0ba;
  font-size: 10px;
  background: #ffffff;
}

.email-preview {
  border: 1px solid #e4edf1;
  background: #ffffff;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(7, 42, 54, 0.05);
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.email-preview h3 {
  font-size: 14px;
  margin: 14px 0;
  font-weight: 800;
}

.email-preview pre {
  white-space: pre-wrap;
  font: inherit;
  color: #4b606c;
}

/* Alerts */
.alert {
  border: 1px solid #c7ecec;
  background: #eff9fa;
  color: #176570;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert svg {
  color: var(--teal);
}

.alert.warn {
  border-color: #f7dec9;
  background: #fdf6ee;
  color: #945823;
}

.alert.warn svg {
  color: #d97706;
}

.progress-line {
  height: 8px;
  border-radius: 9999px;
  background: #edf3f5;
  overflow: hidden;
  margin: 10px 0;
}

.progress-line i {
  height: 100%;
  display: block;
  background: linear-gradient(90deg, #24a4b1, #17838e);
  border-radius: 9999px;
}

.link {
  border: 0;
  background: transparent;
  color: var(--teal);
  padding: 0;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}

.link:hover {
  text-decoration: underline;
}

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

.form-card {
  padding: 26px;
}

.form-card h2 {
  margin-bottom: 20px;
  font-weight: 800;
}

.form-card .btn {
  margin-top: 6px;
}

.settings-list {
  display: grid;
  gap: 12px;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #edf2f5;
  padding: 12px 0;
  font-size: 13px;
}

.setting-row strong {
  color: #3b505c;
}

.setting-row span {
  color: #8c9ea8;
}

/* Finpay Login Aesthetic */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  background: #ffffff;
}

.login-art {
  background: linear-gradient(145deg, #072a36 0%, #0c3d4c 55%, #135567 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 55px 70px;
  overflow: hidden;
  position: relative;
  color: #ffffff;
}

.login-art .heading-eyebrow {
  color: #38dbe8;
}

.login-art .logo {
  height: 52px;
  width: 52px;
  background: #ffffff;
  color: #072a36;
}

.login-art h1 {
  font-size: 44px;
  max-width: 580px;
  line-height: 1.2;
  color: #ffffff;
  font-weight: 800;
  letter-spacing: -.035em;
}

.login-art p {
  color: #bad3db;
  max-width: 500px;
  margin-top: 18px;
  line-height: 1.7;
  font-size: 15px;
}

.login-art .decor {
  position: absolute;
  width: 480px;
  height: 480px;
  border: 70px solid rgba(36, 164, 177, 0.22);
  border-radius: 50%;
  right: -90px;
  bottom: -150px;
}

.login-art .decor:after {
  content: '';
  position: absolute;
  width: 190px;
  height: 190px;
  border: 40px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  top: 55px;
  left: -220px;
}

.login-box {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: #ffffff;
}

.login-form {
  width: min(380px, 100%);
}

.login-form h1 {
  font-size: 30px;
  margin: 15px 0 8px;
  font-weight: 800;
}

.login-form p {
  color: #7d939e;
  line-height: 1.7;
  margin-bottom: 28px;
}

.login-form .btn {
  width: 100%;
  margin-top: 14px;
}

.login-form .logo {
  margin-bottom: 35px;
}

.login-note {
  font-size: 11px;
  color: #9cb0ba;
  line-height: 1.6;
  margin-top: 25px;
}

/* Toast & Dialog */
#toast:not(:empty) {
  position: fixed;
  bottom: 24px;
  right: 24px;
  border-radius: 12px;
  padding: 13px 18px;
  background: #072a36;
  color: #ffffff;
  z-index: 50;
  box-shadow: 0 12px 32px rgba(7, 42, 54, 0.28);
  font-size: 13px;
  font-weight: 600;
  max-width: 360px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  animation: toastFadeIn .2s ease;
}

@keyframes toastFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

dialog {
  border: 1px solid #e4edf1;
  border-radius: 20px;
  padding: 0;
  max-width: 540px;
  width: calc(100vw - 32px);
  box-shadow: 0 24px 70px -10px rgba(7, 42, 54, 0.28);
  background: #ffffff;
}

dialog::backdrop {
  background: rgba(7, 39, 51, 0.45);
  backdrop-filter: blur(4px);
}

#dialog-content {
  padding: 28px;
}

#dialog-content h2 {
  font-size: 21px;
  margin-bottom: 10px;
  font-weight: 800;
}

#dialog-content p {
  font-size: 13px;
  color: #738793;
  line-height: 1.6;
  margin-bottom: 20px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

.dialog-summary {
  background: #f7fafb;
  border: 1px solid #e4edf1;
  border-radius: 12px;
  padding: 15px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  font-size: 13px;
}

.dialog-summary span {
  color: #798e9b;
}

.dialog-summary strong {
  text-align: right;
  color: var(--dark);
}

/* Inbox & Live Chat Styles */
.inbox-layout {
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 18px;
  height: calc(100vh - 180px);
  min-height: 560px;
}

.inbox-sidebar {
  background: #ffffff;
  border: 1px solid #e4edf1;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

.inbox-header {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: #fafcfd;
}

.inbox-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.inbox-card {
  padding: 14px 16px;
  border-bottom: 1px solid #edf2f5;
  cursor: pointer;
  transition: .14s ease;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.inbox-card:hover {
  background: #f8fafb;
}

.inbox-card.active {
  background: var(--teal-light);
  border-left: 3px solid var(--teal);
}

.inbox-card .avatar {
  width: 36px;
  height: 36px;
  font-size: 12px;
  background: #eef8f8;
  color: var(--teal);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  flex-shrink: 0;
}

.inbox-card-content {
  flex: 1;
  min-width: 0;
}

.inbox-card-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 3px;
}

.inbox-card-name {
  font-weight: 700;
  font-size: 13px;
  color: var(--dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inbox-card-time {
  font-size: 10px;
  color: #9cb0ba;
}

.inbox-card-msg {
  font-size: 12px;
  color: #556a77;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inbox-card-phone {
  font-size: 11px;
  color: #9cb0ba;
  margin-bottom: 2px;
}

.inbox-chat-pane {
  background: #ffffff;
  border: 1px solid #e4edf1;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

.inbox-chat-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: #fafcfd;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.inbox-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.inbox-chat-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: #ffffff;
}

.chat-bubble {
  max-width: 72%;
  padding: 10px 15px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  word-break: break-word;
}

.chat-bubble.out {
  align-self: flex-end;
  background: linear-gradient(135deg, #24a4b1 0%, #16818e 100%);
  color: #ffffff;
  border-bottom-right-radius: 3px;
}

.chat-bubble.in {
  align-self: flex-start;
  background: #ffffff;
  color: var(--dark);
  border: 1px solid #e2edf1;
  border-bottom-left-radius: 3px;
}

.chat-bubble-time {
  font-size: 10px;
  opacity: 0.75;
  text-align: right;
  margin-top: 4px;
}

/* Responsive Media Queries */
@media (max-width: 1180px) {
  .overview-grid {
    grid-template-columns: 1fr;
  }
  .compose-layout {
    grid-template-columns: minmax(0, 1.3fr) minmax(260px, .7fr);
  }
  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .workspace {
    grid-template-columns: 200px minmax(0, 1fr);
  }
  .content {
    padding: 24px;
  }
  .sidebar {
    padding: 24px 12px;
  }
  .topbar {
    padding: 0 18px;
  }
  .top-search {
    display: none;
  }
  .two-col, .compose-layout {
    grid-template-columns: 1fr;
  }
  .compose-layout {
    margin: -24px -24px -50px;
  }
  .compose-preview {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .phone {
    height: 380px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .inbox-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
}

@media (max-width: 640px) {
  .app {
    grid-template-columns: 60px 1fr;
  }
  .rail {
    padding: 18px 6px;
  }
  .rail-label {
    display: none;
  }
  .logo {
    width: 38px;
    height: 38px;
  }
  .logo svg {
    width: 24px;
  }
  .nav-icon.active:after {
    left: -6px;
  }
  .topbar {
    height: 68px;
  }
  .top-brand {
    font-size: 11px;
  }
  .user-chip span:last-child {
    display: none;
  }
  .workspace {
    display: block;
  }
  .sidebar {
    border-bottom: 1px solid var(--line);
    border-right: 0;
    padding: 14px 16px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
  }
  .sidebar h1, .sidebar .section-note, .side-foot {
    display: none;
  }
  .side-item {
    white-space: nowrap;
    width: auto;
    padding: 8px 12px;
  }
  .side-item .count {
    display: none;
  }
  .content {
    padding: 20px 16px;
  }
  .head {
    align-items: flex-start;
    flex-direction: column;
  }
  .head-actions {
    justify-content: flex-start;
  }
  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }
  .metric {
    padding: 15px;
  }
  .metric strong {
    font-size: 24px;
  }
  .overview-grid {
    gap: 15px;
  }
  .compose-layout {
    margin: -20px -16px -50px;
  }
  .compose-main {
    padding: 20px 16px;
  }
  .compose-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .option-grid {
    grid-template-columns: 1fr;
  }
  .step-body .input-row {
    grid-template-columns: 1fr;
  }
  .login-page {
    display: block;
  }
  .login-art {
    min-height: 290px;
    padding: 35px;
  }
  .login-art h1 {
    font-size: 28px;
  }
  .login-box {
    padding: 42px 30px;
  }
}
