/* app.css — application shell, layout, dashboard, upload UI */

html, body{ height: 100%; }

.app-body{
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

/* ---------- Shell layout ---------- */
.app-shell{ display: flex; min-height: 100vh; min-height: 100dvh; }

.app-main{
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ---------- Sidebar (desktop only) ---------- */
.sidebar{
  width: 250px;
  background: var(--primary-dark);
  color: #b8c4dc;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  flex-shrink: 0;
  z-index: 1040;
  border-right: 1px solid rgba(255, 255, 255, .06);
}

.sidebar-brand{ padding: 22px 20px 10px; }

.brand-link{
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}

.brand-mark{
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--secondary);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  box-shadow: 0 4px 12px rgba(246, 132, 29, .3);
}

.brand-text{
  color: #fff;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -.03em;
}

.brand-accent{ color: var(--secondary); }

.sidebar-nav{
  padding: 14px 12px;
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.sidebar-nav::-webkit-scrollbar{ display: none; }

.sidebar-nav .nav-link{
  display: flex;
  align-items: center;
  gap: 12px;
  color: #a8b5cc;
  border-radius: 11px;
  padding: 11px 13px;
  margin-bottom: 3px;
  font-weight: 500;
  font-size: .9rem;
  text-decoration: none;
  position: relative;
  transition: background .16s var(--ease), color .16s var(--ease);
}

.sidebar-nav .nav-link i{ font-size: 1.1rem; opacity: .9; width: 1.25rem; text-align: center; }
.sidebar-nav .nav-link:hover{ background: rgba(255, 255, 255, .06); color: #fff; }

.sidebar-nav .nav-link.active{
  background: rgba(255, 255, 255, .1);
  color: #fff;
  font-weight: 600;
}
.sidebar-nav .nav-link.active::before{
  content: "";
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 20px;
  border-radius: 0 4px 4px 0;
  background: var(--secondary);
}
.sidebar-nav .nav-link.active i{ color: var(--secondary); opacity: 1; }

.nav-section{
  text-transform: uppercase;
  font-size: .65rem;
  letter-spacing: .12em;
  color: #6e7da0;
  padding: 16px 13px 5px;
  font-weight: 700;
}

.sidebar-foot{
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, .06);
}

.btn-create{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px;
  border-radius: 11px;
  background: var(--secondary);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: .88rem;
  border: 0;
  box-shadow: 0 4px 14px rgba(246, 132, 29, .28);
  transition: background .16s var(--ease), transform .12s var(--ease), box-shadow .16s var(--ease);
}
.btn-create:hover{ background: #e5760f; color: #fff; transform: translateY(-1px); box-shadow: 0 8px 20px rgba(246, 132, 29, .34); }
.btn-create:active{ transform: translateY(0); }

.sidebar-version{
  color: #5c6b88;
  font-size: .68rem;
  text-align: center;
  margin: 12px 0 0;
}

/* ---------- Mobile footer navigation ---------- */
.mobile-nav{
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1050;
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-top: 1px solid var(--border);
  padding: 6px 8px;
  padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
}

.mobile-nav-item{
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 4px;
  min-height: 52px;
  text-decoration: none;
  color: var(--muted);
  border-radius: 12px;
  transition: color .16s var(--ease), background .16s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.mobile-nav-item:active{ background: rgba(11, 31, 77, .05); }

.mobile-nav-icon{
  font-size: 1.35rem;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: transform .16s var(--ease);
}

.mobile-nav-label{
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .01em;
}

.mobile-nav-item.active{ color: var(--primary); }
.mobile-nav-item.active .mobile-nav-icon{ color: var(--primary); transform: translateY(-1px); }

.mobile-nav-item--accent .mobile-nav-icon{
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--secondary);
  color: #fff;
  font-size: 1.3rem;
  margin-top: -12px;
  box-shadow: 0 6px 16px rgba(246, 132, 29, .4);
  border: 3px solid var(--surface);
}

.mobile-nav-item--accent.active .mobile-nav-icon{
  background: var(--secondary);
  color: #fff;
}

.mobile-nav-item--accent .mobile-nav-label{ margin-top: 0; }

/* ---------- Topbar ---------- */
.topbar{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  padding-top: calc(13px + env(safe-area-inset-top, 0px));
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1020;
}

.topbar-title{
  font-size: 1.12rem;
  font-weight: 700;
  margin: 0;
  flex: 1;
  letter-spacing: -.025em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-right{
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.credit-pill{
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: rgba(246, 132, 29, .1);
  color: var(--secondary-dark);
  border: 1px solid rgba(246, 132, 29, .22);
  padding: 6px 11px;
  border-radius: 999px;
  font-weight: 600;
  font-size: .78rem;
  white-space: nowrap;
}
.credit-pill i{ font-size: .9rem; }
.credit-pill .credit-count{ font-weight: 700; }

.user-chip{
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px 4px 4px;
  font-weight: 600;
  font-size: .85rem;
  color: var(--text);
  transition: border-color .16s var(--ease), background .16s var(--ease);
}
.user-chip:hover{ border-color: #cbd3e0; background: var(--bg); }
.user-chip::after{ display: none; }

.avatar{
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: .8rem;
}

/* ---------- Content ---------- */
.app-content{
  padding: 16px;
  padding-bottom: calc(16px + 72px + env(safe-area-inset-bottom, 0px));
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
  animation: pagein .3s var(--ease);
}
@keyframes pagein{ from{ opacity: 0; transform: translateY(6px); } }

@media (min-width: 768px){
  .app-content{ padding: 24px; }
}

@media (min-width: 992px){
  .app-content{
    padding: 28px 32px;
    padding-bottom: 28px;
  }
}

/* ---------- Stat cards ---------- */
.stat-grid{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 768px){
  .stat-grid{
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
  }
}

.stat-card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), transform .18s var(--ease);
}
.stat-card:hover{
  border-color: #dce2ec;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat-icon{
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  margin-bottom: 6px;
}

.stat-value{
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.035em;
}

.stat-label{
  color: var(--muted);
  font-size: .78rem;
  font-weight: 500;
}

.i-blue{ background: rgba(11, 31, 77, .08); color: var(--primary); }
.i-green{ background: rgba(21, 128, 61, .1); color: var(--success); }
.i-amber{ background: rgba(180, 83, 9, .1); color: var(--warning); }
.i-red{ background: rgba(185, 28, 28, .1); color: var(--danger); }
.i-gold{ background: rgba(246, 132, 29, .12); color: var(--secondary-dark); }

/* ---------- Section / cards ---------- */
.section-card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

@media (min-width: 768px){
  .section-card{ padding: 24px; }
}

.section-title{
  font-weight: 700;
  font-size: 1.05rem;
  margin: 0;
  letter-spacing: -.025em;
}

.hero-cta{
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.hero-cta::after{
  content: "";
  position: absolute;
  right: -60px;
  top: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(246, 132, 29, .22), transparent 70%);
  pointer-events: none;
}

@media (min-width: 576px){
  .hero-cta{
    flex-direction: row;
    align-items: center;
    padding: 26px 28px;
  }
}

.hero-cta > *{ position: relative; z-index: 1; }

.hero-cta h3{
  font-weight: 800;
  font-size: 1.25rem;
  margin: 0 0 5px;
  letter-spacing: -.03em;
}

.hero-cta p{
  margin: 0;
  opacity: .82;
  font-size: .9rem;
}

.hero-cta .btn{ flex-shrink: 0; width: 100%; }

@media (min-width: 576px){
  .hero-cta .btn{ width: auto; }
}

/* ---------- Video cards ---------- */
.video-grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 480px){
  .video-grid{ grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 992px){
  .video-grid{ grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
}

.video-card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), transform .18s var(--ease);
}
.video-card:hover{
  border-color: #dce2ec;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.video-thumb{
  aspect-ratio: 16 / 10;
  background: #0b1220 center / cover no-repeat;
  display: grid;
  place-items: center;
  color: #5b6b8c;
  position: relative;
}
.video-thumb::after{
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(7, 20, 53, .35));
  opacity: 0;
  transition: opacity .2s var(--ease);
}
.video-card:hover .video-thumb::after{ opacity: 1; }

.video-thumb .ph{ color: #3d4865; font-size: 2rem; }

.video-card-body{
  padding: 13px 15px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
}

.video-name{
  font-weight: 600;
  font-size: .9rem;
  word-break: break-word;
  letter-spacing: -.01em;
}

.video-meta{ color: var(--muted); font-size: .75rem; }

.video-actions{
  display: flex;
  gap: 6px;
  margin-top: auto;
  padding-top: 6px;
}

.video-actions .btn{
  flex: 1;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.video-actions .btn.btn-outline-danger{ flex: 0 0 auto; }

/* ---------- Upload ---------- */
.dropzone{
  border: 2px dashed #d3dae6;
  border-radius: var(--radius);
  background: #fafbfc;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s var(--ease), background .2s var(--ease), transform .12s var(--ease);
}

.dropzone:hover,
.dropzone.dragover{
  border-color: var(--secondary);
  background: rgba(246, 132, 29, .05);
}
.dropzone.dragover{ transform: scale(1.01); }

.dropzone .dz-icon{
  font-size: 2.6rem;
  color: var(--primary);
  opacity: .8;
}
.dropzone.dragover .dz-icon{ color: var(--secondary); opacity: 1; }

.dropzone h5{
  font-weight: 700;
  font-size: 1.05rem;
  margin: 12px 0 4px;
  letter-spacing: -.02em;
}

.dropzone p{ color: var(--muted); margin: 0 0 14px; font-size: .85rem; }

.progress-thin{ height: 8px; border-radius: 999px; }
.progress-thin .progress-bar{ background: var(--secondary); }

/* ---------- Manual pipeline wizard (stepper) ---------- */
.pipeline-wizard{ display: flex; flex-direction: column; gap: 0; }

.pipeline-step{
  position: relative;
  padding: 16px 0 16px 44px;
  transition: opacity .2s var(--ease);
}
.pipeline-step:last-child{ padding-bottom: 0; }

/* Connector line linking the dots */
.pipeline-step:not(:last-child)::before{
  content: "";
  position: absolute;
  left: 15px;
  top: 40px;
  bottom: -4px;
  width: 2px;
  background: var(--border);
}
.pipeline-step--done:not(:last-child)::before{ background: var(--success); opacity: .45; }

/* Pending (future) steps are dimmed — EXCEPT the one awaiting action */
.pipeline-step--pending{ opacity: .5; }
.pipeline-step--done,
.pipeline-step--active,
.pipeline-step--failed,
.pipeline-step--current{ opacity: 1; }

/* The step the user can act on right now: highlighted, never faded */
.pipeline-step--current{
  background: rgba(246, 132, 29, .05);
  border-radius: 12px;
  margin: 0 -12px;
  padding-left: 56px;
}
.pipeline-step--current:not(:last-child)::before{ left: 27px; }
.pipeline-step--current .pipeline-dot{ left: 12px; }
.pipeline-step--current .pipeline-step-label{ color: var(--text); }

.pipeline-step-head{
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
  min-height: 30px;
}

.pipeline-dot{
  position: absolute;
  left: 0;
  top: 15px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: .8rem;
  font-weight: 700;
  background: #eef1f6;
  color: #9aa4bd;
  border: 2px solid #eef1f6;
  transition: background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}

.pipeline-step--done .pipeline-dot{
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}

.pipeline-step--active .pipeline-dot{
  background: var(--secondary);
  color: #fff;
  border-color: var(--secondary);
}

.pipeline-step--current .pipeline-dot{
  background: #fff;
  color: var(--secondary-dark);
  border-color: var(--secondary);
  box-shadow: 0 0 0 4px rgba(246, 132, 29, .16);
}

.pipeline-step--failed .pipeline-dot{
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.pipeline-step-label{ font-weight: 600; font-size: .92rem; letter-spacing: -.01em; color: var(--muted); }
.pipeline-step--done .pipeline-step-label,
.pipeline-step--active .pipeline-step-label{ color: var(--text); }

.pipeline-step-hint{ margin: 0 0 8px 0; }

.pipeline-action{ margin: 6px 0 0 0; min-height: 40px; }
.pipeline-redo{ margin-top: 6px; }

.pipeline-processing{
  display: flex;
  align-items: center;
  padding: 12px 14px;
  background: rgba(246, 132, 29, .08);
  border: 1px solid rgba(246, 132, 29, .25);
  border-radius: 11px;
  color: var(--secondary-dark);
}

.pipeline-preview-img{
  border-radius: 11px;
  border: 1px solid var(--border);
  width: 100%;
  display: block;
}

.pipeline-compare{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 480px){
  .pipeline-compare{ grid-template-columns: 1fr; }
}

/* ---------- Auth pages ---------- */
.auth-wrap{
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr;
}

@media (min-width: 992px){
  .auth-wrap{ grid-template-columns: 1fr 1fr; }
}

.auth-aside{
  background: linear-gradient(160deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: #fff;
  padding: 48px 44px;
  display: none;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.auth-aside::after{
  content: "";
  position: absolute;
  right: -80px;
  bottom: -80px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(246, 132, 29, .18), transparent 70%);
}
.auth-aside > *{ position: relative; z-index: 1; }

@media (min-width: 992px){
  .auth-aside{ display: flex; }
}

.auth-aside h2{
  font-weight: 800;
  font-size: 2rem;
  line-height: 1.15;
  letter-spacing: -.035em;
}

.auth-aside .feat{
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 18px;
  font-size: .9rem;
}

.auth-aside .feat i{
  color: var(--secondary);
  font-size: 1.25rem;
  margin-top: 2px;
}

.auth-main{
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px 20px;
  padding-top: calc(24px + env(safe-area-inset-top, 0px));
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  background: var(--bg);
  min-height: 100vh;
  min-height: 100dvh;
}

.auth-card{
  width: 100%;
  max-width: 390px;
  margin: 0 auto;
  animation: pagein .35s var(--ease);
}

.auth-logo{
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 30px;
}

.auth-logo .brand-mark{
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  box-shadow: none;
}

.auth-logo .brand-name{
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--primary);
  letter-spacing: -.035em;
}

.auth-heading{
  font-weight: 800;
  font-size: 1.6rem;
  margin: 0 0 5px;
  letter-spacing: -.035em;
}

.auth-sub{
  color: var(--muted);
  font-size: .92rem;
  margin-bottom: 26px;
}

.pw-wrap{ position: relative; }
.pw-wrap .form-control{ padding-right: 2.8rem; }

.pw-toggle{
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  -webkit-tap-highlight-color: transparent;
  transition: color .15s var(--ease);
}
.pw-toggle:hover{ color: var(--text); }

.auth-footer{
  text-align: center;
  color: var(--muted);
  font-size: .88rem;
  margin-top: 26px;
  margin-bottom: 0;
}

.auth-footer a{
  color: var(--secondary-dark);
  font-weight: 600;
  text-decoration: none;
}
.auth-footer a:hover{ text-decoration: underline; }

/* ---------- Misc ---------- */
.empty-state{
  text-align: center;
  padding: 48px 16px;
  color: var(--muted);
}

.empty-state i{
  font-size: 2.8rem;
  color: #cbd3e0;
}

.video-player{
  width: 100%;
  border-radius: 12px;
  background: #000;
}

.compare-grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 768px){
  .compare-grid{ grid-template-columns: 1fr 1fr; }
}

.toast-container{ z-index: 1090; }

/* Mobile credit pill — icon only */
@media (max-width: 399px){
  .credit-pill .credit-label{ display: none; }
}

/* Touch-friendly tap targets */
@media (max-width: 991px){
  .btn{ min-height: 44px; }
  .btn-sm{ min-height: 40px; }
}

/* ---------- Admin console ---------- */
.admin-subnav{
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.admin-subnav::-webkit-scrollbar{ display: none; }

.admin-tab{
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: 10px;
  font-size: .86rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
}
.admin-tab:hover{ background: var(--surface); color: var(--text); border-color: var(--border); }
.admin-tab.active{
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.admin-tab i{ font-size: 1rem; }

/* KPI cards (compact metric tiles) */
.kpi-grid{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
@media (min-width: 768px){
  .kpi-grid{ grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
}
.kpi{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.kpi-label{ color: var(--muted); font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; display: flex; align-items: center; gap: 6px; }
.kpi-value{ font-size: 1.5rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; margin-top: 6px; }
.kpi-value.sm{ font-size: 1.15rem; }
.kpi-sub{ font-size: .74rem; color: var(--muted); margin-top: 2px; }
.kpi--accent{ background: linear-gradient(135deg, var(--primary), var(--primary-light)); border-color: transparent; color: #fff; }
.kpi--accent .kpi-label{ color: rgba(255,255,255,.75); }
.kpi--accent .kpi-sub{ color: rgba(255,255,255,.7); }
.kpi--profit .kpi-value{ color: var(--success); }
.kpi--loss .kpi-value{ color: var(--danger); }

/* Filters bar */
.admin-filters{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
.admin-filters .form-control,
.admin-filters .form-select{ min-height: 42px; font-size: .9rem; }
.admin-filters .search-field{ flex: 1 1 220px; min-width: 180px; }
.admin-filters .filter-field{ flex: 0 0 auto; min-width: 140px; }

/* Data table */
.table-wrap{
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
}
.data-table{
  width: 100%;
  border-collapse: collapse;
  font-size: .86rem;
  min-width: 640px;
}
.data-table thead th{
  text-align: left;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  white-space: nowrap;
  position: sticky;
  top: 0;
}
.data-table tbody td{
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tbody tr:last-child td{ border-bottom: 0; }
.data-table tbody tr{ transition: background .12s var(--ease); }
.data-table tbody tr:hover{ background: var(--bg); }
.data-table .num{ font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.data-table .cell-strong{ font-weight: 600; letter-spacing: -.01em; }
.data-table .cell-sub{ color: var(--muted); font-size: .76rem; }

.tbl-user{ display: flex; align-items: center; gap: 10px; }
.tbl-avatar{
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: .8rem; flex-shrink: 0;
}

.role-pill,
.status-pill{
  display: inline-flex; align-items: center; gap: 5px;
  padding: .3em .65em; border-radius: 999px;
  font-size: .72rem; font-weight: 600; white-space: nowrap;
}
.role-user{ background: rgba(107,114,128,.12); color: #4b5563; }
.role-admin{ background: rgba(11,31,77,.1); color: var(--primary); }
.role-super_admin{ background: rgba(246,132,29,.14); color: var(--secondary-dark); }
.status-active{ background: rgba(21,128,61,.12); color: var(--success); }
.status-blocked{ background: rgba(185,28,28,.1); color: var(--danger); }

.row-actions{ display: flex; gap: 6px; justify-content: flex-end; flex-wrap: nowrap; }
.icon-btn{
  width: 34px; height: 34px; padding: 0;
  display: inline-grid; place-items: center;
  border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  cursor: pointer; font-size: .9rem;
  transition: background .14s var(--ease), color .14s var(--ease), border-color .14s var(--ease);
}
.icon-btn:hover{ background: var(--bg); border-color: #cbd3e0; }
.icon-btn.danger:hover{ background: #fef2f2; border-color: #fecaca; color: var(--danger); }
.icon-btn.warning:hover{ background: rgba(246,132,29,.08); border-color: rgba(246,132,29,.4); color: var(--secondary-dark); }
.icon-btn.success:hover{ background: #f0fdf4; border-color: #bbf7d0; color: var(--success); }

.amount-pos{ color: var(--success); font-weight: 700; }
.amount-neg{ color: var(--danger); font-weight: 700; }

/* Pagination */
.pager{ display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.pager .pager-info{ color: var(--muted); font-size: .82rem; }
.pager .pager-links{ display: flex; gap: 6px; }

/* Editable cost cell */
.cost-input{
  width: 110px; min-height: 40px; text-align: right;
  font-variant-numeric: tabular-nums;
}
.cost-input-group{ display: inline-flex; align-items: center; gap: 8px; }

/* Modal polish */
.modal-content{ border: 0; border-radius: 16px; box-shadow: var(--shadow-lg); }
.modal-header{ border-bottom: 1px solid var(--border); padding: 18px 20px; }
.modal-title{ font-weight: 700; letter-spacing: -.02em; font-size: 1.05rem; }
.modal-body{ padding: 20px; }
.modal-footer{ border-top: 1px solid var(--border); padding: 14px 20px; }

@media (max-width: 575px){
  .data-table .hide-sm{ display: none; }
}
