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

:root {
  /* Brand — keep original blue for buttons/accents */
  --sb-blue:    #2563EB;
  --sb-blue-d:  #1D4ED8;
  --white:      #FFFFFF;
  --surface:    #F8FAFC;
  --surface-2:  #F1F5F9;
  --text:       #0F172A;
  --text-2:     #334155;
  --text-3:     #64748B;
  --text-4:     #94A3B8;
  --border:     #E2E8F0;
  --border-2:   #F1F5F9;
  --blue:       #2563EB;
  --blue-d:     #1D4ED8;
  --blue-soft:  #EFF6FF;
  --green:      #16A34A;
  --green-l:    #DCFCE7;
  --danger:     #EF4444;
  --warning:    #F59E0B;
  --success:    #22C55E;
  --info:       #3B82F6;

  /* Sidebar — dark like AppsFlyer */
  --sb-bg:      #0F172A;
  --sb-bg-2:    #1E293B;
  --sb-active:  #1E3A5F;
  --sb-border:  rgba(255,255,255,0.07);
  --sb-text:    rgba(255,255,255,0.65);
  --sb-text-on: #FFFFFF;

  --sb-w:      220px;
  --sb-mini:   60px;
  --sb-margin: 0px;
  --t:         0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 13px;
  background: var(--surface);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }
ul { list-style: none; }

/* ═══════════════════════════════════════
   SIDEBAR — AppsFlyer dark style
   Full-height, no border-radius, dark bg
   ═══════════════════════════════════════ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sb-w);
  background: var(--sb-bg);
  border-right: 1px solid var(--sb-border);
  border-radius: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 100;
  transition: width var(--t);
}

body.sb-mini .sidebar {
  width: var(--sb-mini);
}

/* Brand */
.sb-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--sb-border);
  overflow: hidden;
  white-space: nowrap;
  flex-shrink: 0;
  min-height: 60px;
}

.sb-logo {
  width: 28px; height: 28px; flex-shrink: 0;
  background: var(--sb-blue);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
}
.sb-logo img {
  width: 18px; height: 18px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.sb-name {
  font-size: 15px; font-weight: 700; color: #fff;
  white-space: nowrap; overflow: hidden;
  letter-spacing: -0.2px;
  transition: opacity var(--t), width var(--t);
}
body.sb-mini .sb-name { opacity: 0; width: 0; }

/* Nav */
.sb-nav {
  flex: 1; padding: 10px 8px;
  overflow-y: auto; overflow-x: hidden;
}
.sb-nav::-webkit-scrollbar { width: 0; }

.sb-sec {
  font-size: 9px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: rgba(255,255,255,0.25);
  padding: 14px 10px 5px;
  white-space: nowrap;
  transition: opacity var(--t);
}
body.sb-mini .sb-sec { opacity: 0; }

.sb-a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--sb-text);
  font-size: 13px; font-weight: 500;
  white-space: nowrap;
  transition: background var(--t), color var(--t);
  margin-bottom: 1px;
  position: relative;
}
.sb-a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sb-a.on {
  background: var(--sb-active);
  color: #fff; font-weight: 600;
  border-left: 2px solid var(--sb-blue);
}

.sb-ic { font-size: 15px; flex-shrink: 0; width: 18px; display: flex; align-items: center; justify-content: center; }

.sb-txt, .sb-pill { transition: opacity var(--t); overflow: hidden; }
body.sb-mini .sb-txt,
body.sb-mini .sb-pill { opacity: 0; pointer-events: none; }

.sb-pill {
  margin-left: auto;
  font-size: 9px; font-weight: 700;
  padding: 2px 6px; border-radius: 4px;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.3px;
}

/* Tooltip when mini */
body.sb-mini .sb-a::after {
  content: attr(data-t);
  position: fixed;
  left: calc(var(--sb-mini) + 6px);
  background: #1E293B; color: white;
  font-size: 12px; font-weight: 600;
  padding: 6px 10px; border-radius: 6px;
  white-space: nowrap; opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 9999;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.08);
}
body.sb-mini .sb-a:hover::after { opacity: 1; }

/* Submenu */
.sb-sub {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.28s ease;
}
.sb-sub.open { max-height: 200px; }

.sb-sub-a {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px 7px 34px;
  border-radius: 6px;
  color: rgba(255,255,255,0.45);
  font-size: 12.5px; font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
  margin-bottom: 1px;
  text-decoration: none;
}
.sb-sub-a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sb-sub-a.on { background: var(--sb-active); color: #fff; font-weight: 600; }
.sb-sub-a i { font-size: 12px; flex-shrink: 0; }

.sb-chevron {
  margin-left: auto;
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  transition: transform 0.25s ease;
}
.sb-a.open .sb-chevron { transform: rotate(180deg); }

/* Footer */
.sb-foot {
  padding: 10px 8px;
  border-top: 1px solid var(--sb-border);
  flex-shrink: 0; overflow: hidden;
}
.sb-user {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px;
  border-radius: 6px;
  white-space: nowrap;
  transition: background 0.15s;
  cursor: pointer;
}
.sb-user:hover { background: rgba(255,255,255,0.06); }

.sb-av {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--sb-blue);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: white; flex-shrink: 0;
}
.sb-uinfo { flex: 1; min-width: 0; transition: opacity var(--t); }
body.sb-mini .sb-uinfo,
body.sb-mini .sb-out { opacity: 0; pointer-events: none; }
.sb-uname { font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.9); overflow: hidden; text-overflow: ellipsis; }
.sb-urole { font-size: 10px; color: rgba(255,255,255,0.35); text-transform: capitalize; margin-top: 1px; }
.sb-out {
  width: 24px; height: 24px; border-radius: 4px;
  background: rgba(255,255,255,0.08); border: none;
  color: rgba(255,255,255,0.45);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; flex-shrink: 0; text-decoration: none;
  transition: background 0.15s, color var(--t);
}
.sb-out:hover { background: rgba(255,255,255,0.15); color: white; }

/* ═══════════════════════════════════════
   MAIN
   ═══════════════════════════════════════ */
.main {
  margin-left: var(--sb-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--surface);
  transition: margin-left var(--t);
}
body.sb-mini .main { margin-left: var(--sb-mini); }

/* Topbar */
.topbar {
  height: 52px; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0; background: var(--white);
  position: sticky; top: 0; z-index: 50;
}
.topbar-l { display: flex; align-items: center; gap: 12px; }
.tog {
  width: 28px; height: 28px; border-radius: 5px;
  border: 1px solid var(--border); background: none; color: var(--text-3);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; transition: all 0.15s;
}
.tog:hover { background: var(--surface); color: var(--text); }
.pg-title { font-size: 14px; font-weight: 600; color: var(--text); }
.pg-crumb { font-size: 10.5px; color: var(--text-4); margin-top: 1px; }
.topbar-r { display: flex; align-items: center; gap: 8px; }
.tb-ic {
  width: 30px; height: 30px; border-radius: 6px;
  border: 1px solid var(--border); background: none; color: var(--text-3);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; position: relative; transition: all 0.15s;
}
.tb-ic:hover { background: var(--surface); color: var(--text); }
.tb-dot {
  position: absolute; top: 5px; right: 5px;
  width: 5px; height: 5px; border-radius: 50%;
  background: #EF4444; border: 1.5px solid white;
}
.tb-div { width: 1px; height: 14px; background: var(--border); margin: 0 4px; }
.tb-date {
  font-size: 11px; color: var(--text-3); text-align: right; line-height: 1.4;
  background: var(--surface); padding: 4px 10px; border-radius: 6px;
  border: 1px solid var(--border);
}
.tb-date strong { display: block; font-size: 11.5px; font-weight: 600; color: var(--text-2); }

/* Flash */
.flash-zone { padding: 12px 24px 0; }
.flash {
  padding: 10px 14px; border-radius: 8px;
  font-size: 12.5px; font-weight: 500;
  display: flex; align-items: center; gap: 7px;
  margin-bottom: 6px; animation: fIn 0.2s ease;
}
@keyframes fIn { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:none; } }
.flash-success { background:#F0FFF4; color:#166534; border: 1px solid #BBF7D0; }
.flash-danger  { background:#FFF5F5; color:#991B1B; border: 1px solid #FECACA; }
.flash-warning { background:#FFFBEB; color:#92400E; border: 1px solid #FDE68A; }
.flash-info    { background:#EFF6FF; color:#1E40AF; border: 1px solid #BFDBFE; }
.flash-close { margin-left:auto; background:none; border:none; font-size:12px; color:inherit; opacity:0.4; cursor:pointer; }

/* Page body */
.pg-body { padding: 24px; flex: 1; }

/* Mobile */
.sb-veil { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.5); z-index:90; }
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform var(--t); width: var(--sb-w) !important; border-radius: 0; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0 !important; }
  .sb-veil.show { display: block; }
}
/* Sr No */
.ml-tbl th:nth-child(1),
.ml-tbl td:nth-child(1) {
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 3;
}

/* UTM Content */
.ml-tbl th:nth-child(2),
.ml-tbl td:nth-child(2) {
  position: sticky;
  left: 60px;
  /* width of first column */
  background: #fff;
  z-index: 3;
}

.ml-date-field {
  position: relative;
  display: flex;
  align-items: center;
}

#daterange {
  padding-left: 26px;
  padding-right: 20px;
}

#prevDay,
#nextDay {
  position: absolute;
  cursor: pointer;
  font-size: 18px;
  z-index: 10;
}

#prevDay {
  left: 10px;
}

#nextDay {
  right: 10px;
}