:root{
  --bg:#070707;
  --bg-soft:#0d0d0d;
  --panel:#111111;
  --panel-2:#151515;
  --panel-3:#1a1a1a;
  --line:#232323;
  --line-strong:#303030;
  --text:#ffffff;
  --text-soft:#b7b7b7;
  --text-dim:#8f8f8f;
  --accent:#e53935;
  --accent-2:#b71c1c;
  --success:#22c55e;
  --warning:#f59e0b;
  --danger:#ef4444;
  --radius:20px;
  --radius-md:16px;
  --radius-sm:12px;
  --shadow:0 20px 60px rgba(0,0,0,.35);
}

*{box-sizing:border-box}

html,body{
  margin:0;
  padding:0;
  background:
    radial-gradient(circle at top right, rgba(229,57,53,.10), transparent 26%),
    radial-gradient(circle at top left, rgba(229,57,53,.06), transparent 20%),
    linear-gradient(180deg, #090909 0%, #070707 100%);
  color:var(--text);
  font-family:Arial,sans-serif;
}

a{
  color:inherit;
  text-decoration:none;
}

button,
input,
select{
  font:inherit;
}

.app-shell{
  min-height:100vh;
  display:grid;
  grid-template-columns:280px minmax(0,1fr);
}

.sidebar{
  position:sticky;
  top:0;
  height:100vh;
  padding:24px 18px;
  border-right:1px solid rgba(255,255,255,.05);
  background:linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.01));
  backdrop-filter:blur(10px);
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
  padding:10px 12px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.06);
  background:rgba(255,255,255,.02);
}

.brand-mark{
  width:42px;
  height:42px;
  border-radius:14px;
  position:relative;
  background:linear-gradient(180deg, #ff4a46, #c51f1b);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.18);
}

.brand-mark::before{
  content:"";
  position:absolute;
  left:15px;
  top:11px;
  width:0;
  height:0;
  border-top:10px solid transparent;
  border-bottom:10px solid transparent;
  border-left:15px solid #fff;
}

.brand-copy{
  min-width:0;
}

.brand-title{
  font-size:15px;
  font-weight:900;
  letter-spacing:.4px;
}

.brand-sub{
  margin-top:3px;
  color:var(--text-dim);
  font-size:12px;
}

.side-group{
  margin-top:24px;
}

.side-label{
  margin:0 0 10px;
  padding:0 10px;
  color:var(--text-dim);
  font-size:11px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.9px;
}

.side-nav{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.side-link{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:13px 14px;
  border-radius:14px;
  border:1px solid transparent;
  color:#ddd;
  background:transparent;
  transition:.18s ease;
}

.side-link:hover{
  background:rgba(255,255,255,.03);
  border-color:rgba(255,255,255,.06);
  color:#fff;
}

.side-link.active{
  background:linear-gradient(180deg, rgba(229,57,53,.20), rgba(183,28,28,.14));
  border-color:rgba(229,57,53,.30);
  color:#fff;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.05);
}

.side-chip{
  padding:4px 8px;
  border-radius:999px;
  font-size:11px;
  font-weight:800;
  color:#fff;
  background:rgba(255,255,255,.08);
}

.side-box{
  margin-top:24px;
  padding:14px;
  border:1px solid rgba(255,255,255,.06);
  background:rgba(255,255,255,.02);
  border-radius:16px;
}

.side-box-title{
  margin:0 0 8px;
  font-size:13px;
  font-weight:800;
}

.side-box-text{
  margin:0;
  color:var(--text-soft);
  font-size:12px;
  line-height:1.45;
}

.main{
  min-width:0;
  padding:26px;
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin-bottom:22px;
}

.page-head h1{
  margin:0;
  font-size:30px;
  line-height:1.1;
  letter-spacing:.2px;
}

.page-head p{
  margin:8px 0 0;
  color:var(--text-soft);
  font-size:14px;
}

.top-actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:46px;
  padding:0 16px;
  border-radius:14px;
  border:1px solid var(--line-strong);
  background:#141414;
  color:#fff;
  font-weight:800;
  cursor:pointer;
  transition:.18s ease;
}

.btn:hover{
  border-color:#444;
  transform:translateY(-1px);
}

.btn-primary{
  background:linear-gradient(180deg, #e53935, #c62828);
  border-color:#d32f2f;
}

.btn-danger{
  background:linear-gradient(180deg, #d32f2f, #a61b1b);
  border-color:#b71c1c;
}

.btn-ghost{
  background:rgba(255,255,255,.02);
}

.grid{
  display:grid;
  gap:18px;
}

.grid-3{
  grid-template-columns:repeat(3,minmax(0,1fr));
}

.grid-2{
  grid-template-columns:repeat(2,minmax(0,1fr));
}

.card{
  border:1px solid rgba(255,255,255,.06);
  background:linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.015));
  border-radius:22px;
  padding:20px;
  box-shadow:var(--shadow);
  backdrop-filter:blur(10px);
}

.card-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:16px;
}

.card-title{
  margin:0;
  font-size:20px;
}

.card-subtitle{
  margin:6px 0 0;
  color:var(--text-soft);
  font-size:13px;
  line-height:1.45;
}

.stat-card{
  padding:20px;
  border-radius:20px;
  border:1px solid rgba(255,255,255,.06);
  background:
    linear-gradient(180deg, rgba(229,57,53,.08), rgba(255,255,255,.01)),
    #111;
}

.stat-label{
  color:var(--text-soft);
  font-size:13px;
  font-weight:700;
}

.stat-value{
  margin-top:10px;
  font-size:34px;
  font-weight:900;
  line-height:1;
}

.stat-note{
  margin-top:10px;
  color:var(--text-dim);
  font-size:12px;
}

.alert{
  padding:14px 16px;
  border-radius:16px;
  border:1px solid transparent;
  font-size:14px;
  line-height:1.45;
}

.alert-success{
  color:#dbffe4;
  background:rgba(34,197,94,.12);
  border-color:rgba(34,197,94,.22);
}

.alert-error{
  color:#ffd2d2;
  background:rgba(239,68,68,.12);
  border-color:rgba(239,68,68,.22);
}

.form-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
}

.field{
  min-width:0;
}

.field label{
  display:block;
  margin:0 0 8px;
  color:#d3d3d3;
  font-size:13px;
  font-weight:800;
}

.input,
.select{
  width:100%;
  height:50px;
  border-radius:14px;
  border:1px solid #2a2a2a;
  background:#0f0f0f;
  color:#fff;
  padding:0 14px;
  outline:none;
}

.input:focus,
.select:focus{
  border-color:#494949;
  box-shadow:0 0 0 3px rgba(229,57,53,.14);
}

.table-wrap{
  width:100%;
  overflow:hidden;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.05);
}

.table-wrap.no-scroll {
  overflow-x: hidden;
}

.table-wrap.no-scroll table {
  width: 100%;
  table-layout: fixed;
}

.table-wrap.no-scroll td,
.table-wrap.no-scroll th {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table{
  width:100%;
  min-width:720px;
  border-collapse:collapse;
}

.table th,
.table td{
  padding:14px 16px;
  text-align:left;
  border-top:1px solid rgba(255,255,255,.05);
}

.table th{
  color:var(--text-soft);
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.7px;
  font-weight:800;
  background:rgba(255,255,255,.02);
}

.table tr:first-child th,
.table tr:first-child td{
  border-top:none;
}

.badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:7px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:800;
  border:1px solid rgba(255,255,255,.08);
}

.badge-green{
  background:rgba(34,197,94,.12);
  color:#d9ffe5;
  border-color:rgba(34,197,94,.22);
}

.badge-gray{
  background:rgba(255,255,255,.06);
  color:#ededed;
}

.section-stack{
  display:flex;
  flex-direction:column;
  gap:18px;
}

.mobile-topbar{
  display:none;
}

@media (max-width: 1100px){
  .grid-3{
    grid-template-columns:1fr;
  }

  .grid-2{
    grid-template-columns:1fr;
  }

  .form-grid{
    grid-template-columns:1fr 1fr;
  }
}

@media (max-width: 860px){
  .app-shell{
    grid-template-columns:1fr;
  }

  .sidebar{
    display:none;
  }

  .main{
    padding:18px 14px 28px;
  }

  .mobile-topbar{
    display:flex;
    align-items:center;
    gap:10px;
    margin-bottom:16px;
  }

  .mobile-brand{
    display:flex;
    align-items:center;
    gap:10px;
    min-width:0;
  }

  .mobile-brand .brand-mark{
    width:36px;
    height:36px;
    border-radius:12px;
  }

  .topbar{
    flex-direction:column;
    align-items:flex-start;
  }

  .top-actions{
    width:100%;
  }

  .top-actions .btn{
    flex:1;
  }
}

@media (max-width: 640px){
  .page-head h1{
    font-size:26px;
  }

  .card{
    padding:16px;
    border-radius:18px;
  }

  .form-grid{
    grid-template-columns:1fr;
  }

  .table{
    min-width:620px;
  }

  .stat-value{
    font-size:30px;
  }
}

.inline-form{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}

.toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom:16px;
}

.toolbar .inline-form{
  flex:1;
}

.toolbar-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.kpi-row{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.kpi-pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-height:42px;
  padding:0 14px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.06);
  background:rgba(255,255,255,.03);
  color:#fff;
  font-weight:800;
}

.empty-state{
  padding:24px;
  border-radius:18px;
  border:1px dashed rgba(255,255,255,.10);
  background:rgba(255,255,255,.02);
  color:var(--text-soft);
}

.table-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.text-soft{
  color:var(--text-soft);
}

.text-dim{
  color:var(--text-dim);
}

@media (max-width: 640px){
  .toolbar{
    align-items:stretch;
  }

  .toolbar .inline-form{
    width:100%;
  }

  .toolbar-actions{
    width:100%;
  }

  .toolbar-actions .btn{
    flex:1;
  }
}

.info-grid{
  display:grid;
  grid-template-columns:180px minmax(0,1fr);
  gap:14px 18px;
}

.info-label{
  color:var(--text-dim);
  font-size:12px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.6px;
}

.info-value{
  color:#fff;
  font-weight:700;
  word-break:break-word;
}

.hr{
  height:1px;
  margin:18px 0;
  background:rgba(255,255,255,.06);
  border:0;
}

.amount-plus{
  color:#86efac;
  font-weight:800;
}

.amount-minus{
  color:#fca5a5;
  font-weight:800;
}

.modal{
  position:fixed;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  padding:18px;
  background:rgba(0,0,0,.72);
  z-index:9999;
}

.modal-box{
  width:100%;
  max-width:460px;
  border-radius:22px;
  border:1px solid rgba(255,255,255,.08);
  background:linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.015));
  padding:22px;
  box-shadow:var(--shadow);
  backdrop-filter:blur(10px);
}

.modal-title{
  margin:0;
  font-size:22px;
}

.modal-text{
  margin:10px 0 0;
  color:var(--text-soft);
  line-height:1.5;
  font-size:14px;
}

.modal-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  flex-wrap:wrap;
  margin-top:18px;
}

@media (max-width: 700px){
  .info-grid{
    grid-template-columns:1fr;
  }
}

.filter-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
}

.wrap-inline{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}

@media (max-width: 900px){
  .filter-grid{
    grid-template-columns:1fr 1fr;
  }
}

@media (max-width: 640px){
  .filter-grid{
    grid-template-columns:1fr;
  }
}

.status-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:8px 12px;
  border-radius:999px;
  font-size:12px;
  font-weight:800;
  border:1px solid rgba(255,255,255,.08);
}

.status-active{
  background:rgba(34,197,94,.12);
  color:#dcffe6;
  border-color:rgba(34,197,94,.22);
}

.status-expired{
  background:rgba(245,158,11,.12);
  color:#ffe9be;
  border-color:rgba(245,158,11,.22);
}

.status-inactive{
  background:rgba(255,255,255,.06);
  color:#ededed;
}

.note-box{
  padding:14px 16px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.06);
  background:rgba(255,255,255,.02);
  color:var(--text-soft);
  line-height:1.5;
  font-size:14px;
}

.mobile-table-card{
  display:none;
}

@media (max-width: 760px){
  .desktop-table{
    display:none;
  }

  .mobile-table-card{
    display:flex;
    flex-direction:column;
    gap:12px;
  }

  .mobile-item{
    padding:14px;
    border-radius:16px;
    border:1px solid rgba(255,255,255,.06);
    background:rgba(255,255,255,.02);
  }

  .mobile-item-title{
    font-size:15px;
    font-weight:900;
  }

  .mobile-item-grid{
    display:grid;
    grid-template-columns:1fr;
    gap:8px;
    margin-top:10px;
  }

  .mobile-item-row{
    display:flex;
    justify-content:space-between;
    gap:10px;
  }

  .mobile-item-label{
    color:var(--text-dim);
    font-size:12px;
    font-weight:800;
    text-transform:uppercase;
    letter-spacing:.5px;
  }

  .mobile-item-value{
    text-align:right;
    font-size:13px;
    color:#fff;
    word-break:break-word;
  }
}

.form-stack{
  display:grid;
  grid-template-columns:1fr;
  gap:16px;
}

.checkbox-row{
  display:flex;
  gap:10px;
  align-items:flex-start;
}

.checkbox-row input[type="checkbox"]{
  width:18px;
  height:18px;
  margin-top:2px;
}

.helper-text{
  color:var(--text-dim);
  font-size:13px;
  line-height:1.45;
}

.stat-card.primary{
  background:
    linear-gradient(180deg, rgba(229,57,53,.16), rgba(255,255,255,.02)),
    #111;
  border-color:rgba(229,57,53,.20);
}

.modal-form{
  display:grid;
  gap:14px;
  margin-top:18px;
}

.modal-form .field{
  min-width:0;
}

.table-compact th,
.table-compact td{
  padding:13px 16px;
}

.mobile-menu-btn{
  display:none;
  align-items:center;
  justify-content:center;
  min-width:44px;
  height:44px;
  padding:0 14px;
  border-radius:12px;
  border:1px solid var(--line-strong);
  background:#141414;
  color:#fff;
  font-weight:900;
  cursor:pointer;
}

.sidebar-backdrop{
  display:none;
}

@media (max-width: 860px){
  .mobile-topbar{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin-bottom:16px;
  }

  .mobile-menu-btn{
    display:inline-flex;
  }

  .sidebar{
    display:block;
    position:fixed;
    left:0;
    top:0;
    height:100vh;
    width:280px;
    max-width:86vw;
    z-index:1001;
    transform:translateX(-100%);
    transition:transform .22s ease;
    box-shadow:0 20px 60px rgba(0,0,0,.45);
    background:#0b0b0b;
  }

  .sidebar.open{
    transform:translateX(0);
  }

  .sidebar-backdrop{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.58);
    z-index:1000;
  }

  .sidebar-backdrop.show{
    display:block;
  }
}

.page-head.compact h1{
  font-size:28px;
}

.page-head.compact p{
  margin-top:6px;
  font-size:13px;
}

.section-header-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom:14px;
}

.section-header-row .card-subtitle{
  margin:0;
}

.stat-card.admin-accent{
  background:
    linear-gradient(180deg, rgba(229,57,53,.14), rgba(255,255,255,.015)),
    #111;
  border-color:rgba(229,57,53,.22);
}

.table-admin th,
.table-admin td{
  padding:12px 15px;
}

.mono{
  font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.subtle-box{
  padding:14px 16px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.05);
  background:rgba(255,255,255,.02);
}

.subtle-title{
  font-size:13px;
  font-weight:800;
  color:#fff;
  margin:0 0 6px;
}

.subtle-text{
  margin:0;
  color:var(--text-soft);
  font-size:13px;
  line-height:1.45;
}

.toolbar-inline{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}

.toolbar-inline .input,
.toolbar-inline .select{
  flex:1;
  min-width:180px;
}

.topbar.minimal .top-actions{
  justify-content:flex-end;
}

.chip-scroll{
  display:flex;
  gap:10px;
  overflow-x:auto;
  padding-bottom:4px;
  scrollbar-width:thin;
}

.chip-scroll::-webkit-scrollbar{
  height:8px;
}

.chip-scroll::-webkit-scrollbar-thumb{
  background:rgba(255,255,255,.12);
  border-radius:999px;
}

.modal-lg{
  max-width:720px;
}

@media (max-width: 640px){
  .toolbar-inline{
    flex-direction:column;
    align-items:stretch;
  }

  .toolbar-inline .btn{
    width:100%;
  }
}

.btn{
  font-size:14px;
}

.select.compact-arrow{
  padding-right:44px;
  background-position:right 14px center;
}

.action-row-bottom{
  display:flex;
  align-items:flex-end;
}

@media (max-width: 860px){
  .action-row-bottom{
    width:100%;
  }

  .action-row-bottom .btn{
    width:100%;
  }
}


.table.no-hover tr:hover {
  background: transparent !important;
  transform: none !important;
  cursor: default !important;
}

.table.no-hover td,
.table.no-hover th {
  cursor: default !important;
}
