:root {
  --blue: #E91E63;
  --blue-dark: #1a4fc7;
  --blue-light: #eff4ff;
  --blue-mid: #dbeafe;
  --green: #10b981;
  --green-light: #d1fae5;
  --red: #ef4444;
  --red-light: #fee2e2;
  --orange: #f59e0b;
  --orange-light: #fef3c7;
  --g50: #f8fafc;
  --g100: #f1f5f9;
  --g200: #e2e8f0;
  --g300: #cbd5e1;
  --g400: #94a3b8;
  --g500: #64748b;
  --g600: #475569;
  --g700: #334155;
  --g800: #1e293b;
  --g900: #0f172a;
  --white: #fff;
  --sw: 256px;
  --r: 12px;
  --rlg: 16px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--g50);
  color: var(--g800);
  overflow-x: hidden;
  min-height: 100vh;
  width: 100%;
}

html {
  width: 100%;
  height: 100%;
}

#loginScreen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f0f0;
}

.lcard {
  background: var(--white);
  border-radius: 16px;
  padding: 44px 40px;
  width: 420px;
  max-width: 92vw;
  box-shadow: 0 4px 24px rgba(0,0,0,.10);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.llogo-img {
  height: 90px;
  object-fit: contain;
  margin-bottom: 28px;
}

.llogo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.llogo-icon {
  width: 44px;
  height: 44px;
  background: #E91E63;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
}

.llogo-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--g900);
}

.llogo-text span {
  color: #E91E63;
}

.lcard h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--g900);
}

.lcard p {
  color: var(--g500);
  font-size: .875rem;
  margin-bottom: 28px;
}

.fl {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--g600);
  margin-bottom: 6px;
  text-align: left;
  width: 100%;
}

.fi {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--g200);
  border-radius: var(--r);
  font-family: inherit;
  font-size: .9rem;
  outline: none;
  transition: .2s;
  color: var(--g800);
  margin-bottom: 16px;
  background: var(--g50);
  text-align: left;
}

.fi:focus {
  border-color: #E91E63;
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(233,30,99,.1);
}

.btn-login {
  width: 100%;
  padding: 13px;
  background: #E91E63;
  color: white;
  border: none;
  border-radius: var(--r);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: .2s;
  margin-top: 4px;
  letter-spacing: .3px;
}

.btn-login:hover {
  background: #C2185B;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(233,30,99,.3);
}

.lerr {
  color: var(--red);
  font-size: .82rem;
  margin-top: 10px;
  display: none;
  align-items: center;
  gap: 6px;
}

.ldemo {
  margin-top: 20px;
  padding: 12px 14px;
  background: var(--g50);
  border-radius: var(--r);
  font-size: .78rem;
  color: var(--g500);
  line-height: 1.9;
  width: 100%;
  text-align: left;
}

.lfooter {
  margin-top: 20px;
  font-size: .73rem;
  color: var(--g400);
}

.lfooter {
  margin-top: 20px;
  font-size: .75rem;
  color: var(--g400);
}

/* ── APP ── */
#appScreen {
  display: none;
  width: 100%;
}

.app {
  display: flex;
  min-height: 100vh;
  width: 100vw;
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sw);
  background: var(--white);
  border-right: 1px solid var(--g200);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 20;
  flex-shrink: 0;
}

.slogo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--g100);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.slogo-icon {
  width: 34px;
  height: 34px;
  min-width: 34px;
  background: var(--blue);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
}

.slogo-text {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--g900);
  white-space: nowrap;
  overflow: hidden;
}

.slogo-text span {
  color: var(--blue);
}

.snav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.snav-sect {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--g400);
  padding: 12px 8px 6px;
  white-space: nowrap;
  overflow: hidden;
}

.nitem {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: .875rem;
  font-weight: 500;
  color: var(--g600);
  cursor: pointer;
  transition: .15s;
  white-space: nowrap;
  overflow: hidden;
  position: relative;
}

.nitem i {
  width: 18px;
  text-align: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.nitem:hover {
  background: var(--g100);
  color: var(--g800);
}

.nitem.active {
  background: var(--blue-light);
  color: var(--blue);
  font-weight: 600;
}

.nbadge {
  margin-left: auto;
  background: var(--red);
  color: white;
  font-size: .68rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
  flex-shrink: 0;
}

.sbot {
  padding: 12px;
  border-top: 1px solid var(--g100);
}

.ucard {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--r);
  cursor: pointer;
  transition: .15s;
}

.ucard:hover {
  background: var(--g100);
}

.uav {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  background: var(--blue-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .8rem;
  color: var(--blue);
  overflow: hidden;
}

.uav img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.uinfo {
  overflow: hidden;
}

.uname {
  font-size: .85rem;
  font-weight: 600;
  color: var(--g800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.urole {
  font-size: .72rem;
  color: var(--g500);
}

/* ── MAIN ── */
.main {
  margin-left: var(--sw);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  width: calc(100% - var(--sw));
  overflow-x: hidden;
}

/* ── TOPBAR ── */
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--g200);
  padding: 0 28px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
  width: 100%;
}

.topbar-l h1 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--g900);
}

.topbar-l p {
  font-size: .78rem;
  color: var(--g500);
  margin-top: 1px;
}

.topbar-r {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nbell {
  position: relative;
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--g200);
  border-radius: 10px;
  background: white;
  color: var(--g600);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: .2s;
}

.nbell:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.ndot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 16px;
  height: 16px;
  background: var(--red);
  border-radius: 50%;
  border: 2px solid white;
  font-size: .6rem;
  color: white;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-new {
  background: var(--blue);
  color: white;
  border: none;
  border-radius: var(--r);
  padding: 8px 16px;
  font-family: inherit;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: .2s;
}

.btn-new:hover {
  background: var(--blue-dark);
  transform: translateY(-1px);
}

/* ── CONTENT ── */
.content {
  padding: 24px 28px;
  flex: 1;
  width: 100%;
  min-width: 0;
}

/* ── STATS ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.scard {
  background: var(--white);
  border: 1px solid var(--g200);
  border-radius: var(--rlg);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.scard-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.si-blue { background: var(--blue-light); color: var(--blue); }
.si-orange { background: var(--orange-light); color: var(--orange); }
.si-green { background: var(--green-light); color: var(--green); }
.si-red { background: var(--red-light); color: var(--red); }

.scard-num {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--g900);
  line-height: 1;
}

.scard-lbl {
  font-size: .78rem;
  color: var(--g500);
  margin-top: 3px;
}

/* ── FILTERS ── */
.fbar {
  background: var(--white);
  border: 1px solid var(--g200);
  border-radius: var(--rlg);
  padding: 16px 20px;
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  width: 100%;
}

.fg {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-width: 130px;
}

.fg label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--g500);
}

.fg input,
.fg select {
  padding: 8px 12px;
  border: 1.5px solid var(--g200);
  border-radius: 10px;
  font-family: inherit;
  font-size: .85rem;
  outline: none;
  color: var(--g800);
  background: var(--white);
  transition: .2s;
}

.fg input:focus,
.fg select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(36,99,235,.08);
}

.btn-clear {
  padding: 8px 16px;
  background: var(--g100);
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: .82rem;
  font-weight: 500;
  color: var(--g600);
  cursor: pointer;
  height: 36px;
  transition: .2s;
  white-space: nowrap;
}

.btn-clear:hover {
  background: var(--g200);
}

/* ── TABLE ── */
.toastwrap {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .845rem;
  table-layout: auto;
}

thead th {
  padding: 13px 16px;
  background: var(--g50);
  border-bottom: 1px solid var(--g200);
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--g500);
  text-align: left;
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--g100);
  cursor: pointer;
  transition: background .15s;
}

tbody tr:last-child {
  border-bottom: none;
}

tbody tr:hover {
  background: #f0f7ff;
}

tbody td {
  padding: 13px 16px;
  vertical-align: middle;
}

.td-id {
  font-size: .78rem;
  font-weight: 700;
  color: var(--g400);
  white-space: nowrap;
}

.td-title {
  font-weight: 600;
  color: var(--g800);
}

.td-sub {
  font-size: .75rem;
  color: var(--g500);
  margin-top: 2px;
}

.acell {
  display: flex;
  gap: 4px;
  align-items: center;
}

.ibtn {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  transition: .15s;
  background: transparent;
  color: var(--g400);
}

.ibtn:hover {
  background: var(--g100);
  color: var(--g700);
}

.ibtn.reopen {
  color: var(--orange);
}

.ibtn.reopen:hover {
  background: var(--orange-light);
}

/* ── BADGES ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 700;
  white-space: nowrap;
}

.b-ab { background: #fee2e2; color: #b91c1c; }
.b-and { background: #fef3c7; color: #92400e; }
.b-res { background: #d1fae5; color: #065f46; }
.b-fec { background: var(--g100); color: var(--g500); }
.p-alt { background: #fee2e2; color: #b91c1c; }
.p-med { background: #fef3c7; color: #92400e; }
.p-bai { background: #eff6ff; color: #1d4ed8; }

/* ── EMPTY ── */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--g400);
}

.empty i {
  font-size: 2.5rem;
  margin-bottom: 12px;
  display: block;
}

/* ── DETAIL PANEL ── */
.dovl {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.3);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: .25s;
}

.dovl.open {
  opacity: 1;
  visibility: visible;
}

.dpanel {
  position: fixed;
  top: 0;
  right: -440px;
  width: 420px;
  max-width: 95vw;
  height: 100vh;
  background: var(--white);
  box-shadow: 0 25px 50px -12px rgba(0,0,0,.2);
  z-index: 101;
  transition: right .3s cubic-bezier(.4,0,.2,1);
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--g200);
}

.dpanel.open {
  right: 0;
}

.dhead {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--g200);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.dhead-info {
  flex: 1;
  min-width: 0;
}

.did {
  font-size: .75rem;
  font-weight: 700;
  color: var(--g400);
  margin-bottom: 4px;
}

.dtitle {
  font-size: 1rem;
  font-weight: 700;
  color: var(--g900);
  line-height: 1.3;
}

.dmeta {
  padding: 14px 20px;
  border-bottom: 1px solid var(--g100);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.dm-lbl {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--g400);
  margin-bottom: 3px;
}

.dm-val {
  font-size: .82rem;
  font-weight: 500;
  color: var(--g700);
}

/* ── CHAT ── */
.covl {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: .25s;
}

.covl.open {
  opacity: 1;
  visibility: visible;
}

.cwin {
  background: var(--white);
  width: 760px;
  max-width: 95vw;
  height: 84vh;
  max-height: 720px;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,.25);
  overflow: hidden;
  transform: scale(.96) translateY(8px);
  transition: transform .25s;
}

.covl.open .cwin {
  transform: scale(1) translateY(0);
}

.chead {
  background: var(--blue);
  color: white;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.chead-info {
  flex: 1;
  min-width: 0;
}

.chead-title {
  font-size: 1rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chead-sub {
  font-size: .75rem;
  opacity: .85;
  margin-top: 2px;
}

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

.btn-cc {
  width: 30px;
  height: 30px;
  background: rgba(255,255,255,.2);
  border: none;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: .15s;
}

.btn-cc:hover {
  background: rgba(255,255,255,.3);
}

.btn-ct {
  background: rgba(255,255,255,.15);
  border: 1.5px solid rgba(255,255,255,.4);
  color: white;
  padding: 6px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: .2s;
}

.btn-ct:hover {
  background: rgba(255,255,255,.25);
}

.btn-ro {
  background: rgba(245,158,11,.3);
  border: 1.5px solid rgba(245,158,11,.6);
  color: white;
  padding: 6px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: .2s;
}

.cstrip {
  background: var(--g50);
  border-bottom: 1px solid var(--g200);
  padding: 10px 20px;
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.cstrip-item {
  font-size: .76rem;
  color: var(--g600);
}

.cstrip-item strong {
  color: var(--g800);
}

.cmsgs {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f8fafc;
}

.mwrap {
  display: flex;
  flex-direction: column;
  max-width: 72%;
}

.mwrap.mine {
  align-self: flex-end;
  align-items: flex-end;
}

.mwrap.other {
  align-self: flex-start;
  align-items: flex-start;
}

.msender {
  font-size: .7rem;
  font-weight: 700;
  color: var(--g500);
  margin-bottom: 3px;
}

.mbubble {
  padding: 9px 14px;
  border-radius: 14px;
  font-size: .875rem;
  line-height: 1.5;
  word-break: break-word;
}

.mwrap.other .mbubble {
  background: white;
  border: 1px solid var(--g200);
  border-bottom-left-radius: 4px;
}

.mwrap.mine .mbubble {
  background: var(--blue);
  color: white;
  border-bottom-right-radius: 4px;
}

.mtime {
  font-size: .68rem;
  color: var(--g400);
  margin-top: 3px;
}

.matt {
  margin-top: 6px;
  padding: 10px 14px;
  background: rgba(36,99,235,.08);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: .75rem;
  color: var(--blue);
  cursor: pointer;
  width: 80px;
  text-align: center;
}
.matt i {
  font-size: 1.6rem;
}
.matt a {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 72px;
  width: 72px;
  display: block;
  color: inherit;
}


.mwrap.mine .matt {
  background: rgba(255,255,255,.2);
  color: white;
}

.cinput-area {
  padding: 14px 20px;
  border-top: 1px solid var(--g200);
  background: white;
  flex-shrink: 0;
}

.cinput-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.ctextarea {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid var(--g200);
  border-radius: 12px;
  font-family: inherit;
  font-size: .875rem;
  resize: none;
  outline: none;
  max-height: 200px;
  min-height: 80px;
  line-height: 1.5;
  transition: .2s;
}

.ctextarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(36,99,235,.08);
}

.cacts-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.att-btn {
  background: var(--g100);
  border: none;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  color: var(--g500);
  font-size: .9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: .15s;
}

.att-btn:hover {
  background: var(--g200);
  color: var(--g700);
}

.att-prev {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.att-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--blue-light);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: .75rem;
  color: var(--blue);
  font-weight: 500;
}

.att-chip button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--blue);
  font-size: .8rem;
  padding: 0;
  line-height: 1;
}

.btn-send {
  width: 42px;
  height: 42px;
  background: var(--blue);
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: .2s;
}

.btn-send:hover {
  background: var(--blue-dark);
}

.closed-notice {
  text-align: center;
  padding: 10px;
  font-size: .82rem;
  color: var(--g500);
  background: var(--g50);
  border-top: 1px solid var(--g200);
}

/* ── MODALS ── */
.movl {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(4px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: .25s;
}

.movl.open {
  opacity: 1;
  visibility: visible;
}

.mbox {
  background: var(--white);
  width: 600px;
  max-width: 95vw;
  max-height: 92vh;
  border-radius: 20px;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(.96) translateY(10px);
  transition: transform .25s;
}

.movl.open .mbox {
  transform: scale(1) translateY(0);
}

.mhead {
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--g200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mhead h3 {
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.mhead h3 i {
  color: var(--blue);
}

.mbody {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.mfoot {
  padding: 16px 24px;
  border-top: 1px solid var(--g200);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.fgrp {
  margin-bottom: 16px;
}

.fgrp label {
  display: block;
  font-size: .78rem;
  font-weight: 700;
  color: var(--g600);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .3px;
}

.finput {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--g200);
  border-radius: 10px;
  font-family: inherit;
  font-size: .9rem;
  outline: none;
  transition: .2s;
  color: var(--g800);
}

.finput:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(36,99,235,.08);
}

.finput[readonly] {
  background: var(--g50);
  color: var(--g500);
}

textarea.finput {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

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

/* ── CONFIRM ── */
.cfovl {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: .2s;
}

.cfovl.open {
  opacity: 1;
  visibility: visible;
}

.cfbox {
  background: white;
  border-radius: 16px;
  padding: 28px;
  width: 380px;
  max-width: 90vw;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,.25);
}

.cf-icon {
  font-size: 2.5rem;
  margin-bottom: 14px;
}

.cfbox h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.cfbox p {
  font-size: .875rem;
  color: var(--g500);
  margin-bottom: 22px;
  line-height: 1.5;
}

.cf-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.btn-cy {
  padding: 9px 24px;
  background: var(--red);
  color: white;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
  transition: .2s;
}

.btn-cy:hover {
  background: #dc2626;
}

.btn-cy.g {
  background: var(--green);
}

.btn-cy.g:hover {
  background: #059669;
}

.btn-cn {
  padding: 9px 24px;
  background: var(--g100);
  color: var(--g700);
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
  transition: .2s;
}

.btn-cn:hover {
  background: var(--g200);
}

/* ── NOTIF ── */
.npanel {
  position: fixed;
  top: 66px;
  right: 20px;
  width: 340px;
  background: white;
  border: 1px solid var(--g200);
  border-radius: var(--rlg);
  box-shadow: 0 10px 25px -5px rgba(0,0,0,.12);
  z-index: 50;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: .2s;
}

.npanel.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nphead {
  padding: 14px 16px;
  border-bottom: 1px solid var(--g100);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nphead h4 {
  font-size: .9rem;
  font-weight: 700;
}

.npm-all {
  font-size: .75rem;
  color: var(--blue);
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

.nlist {
  max-height: 320px;
  overflow-y: auto;
}

.nitem-n {
  padding: 12px 16px;
  border-bottom: 1px solid var(--g100);
  cursor: pointer;
  transition: .15s;
  display: flex;
  gap: 10px;
}

.nitem-n:hover {
  background: var(--g50);
}

.nitem-n.unread {
  background: var(--blue-light);
}

.nitem-n.unread:hover {
  background: #dbeafe;
}

.ndot2 {
  width: 8px;
  height: 8px;
  background: var(--blue);
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}

.ni-text {
  font-size: .8rem;
  color: var(--g700);
  line-height: 1.4;
}

.ni-time {
  font-size: .7rem;
  color: var(--g400);
  margin-top: 3px;
}

.n-empty {
  padding: 28px;
  text-align: center;
  color: var(--g400);
  font-size: .85rem;
}

/* ── ADMIN ── */
.agrid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.acard {
  background: white;
  border: 1px solid var(--g200);
  border-radius: var(--rlg);
  overflow: hidden;
}

.acard-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--g100);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.acard-head h3 {
  font-size: .9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--g800);
}

.btn-sm {
  padding: 5px 12px;
  border-radius: 8px;
  font-family: inherit;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: .15s;
  border: none;
  display: flex;
  align-items: center;
  gap: 5px;
}

.btn-sm.pr {
  background: var(--blue);
  color: white;
}

.btn-sm.pr:hover {
  background: var(--blue-dark);
}

.btn-sm.dr {
  background: var(--red-light);
  color: var(--red);
}

.btn-sm.dr:hover {
  background: #fecaca;
}

.alist {
  padding: 8px 0;
  max-height: 220px;
  overflow-y: auto;
}

.alist-item {
  padding: 9px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .85rem;
  border-bottom: 1px solid var(--g100);
  transition: .1s;
}

.alist-item:last-child {
  border-bottom: none;
}

.alist-item:hover {
  background: var(--g50);
}

.ai-name {
  font-weight: 500;
  color: var(--g800);
}

.add-row {
  padding: 10px 18px 14px;
  border-top: 1px solid var(--g100);
  display: flex;
  gap: 8px;
}

.ainput {
  flex: 1;
  padding: 8px 12px;
  border: 1.5px solid var(--g200);
  border-radius: 8px;
  font-family: inherit;
  font-size: .85rem;
  outline: none;
  transition: .2s;
}

.ainput:focus {
  border-color: var(--blue);
}

/* ── DASHBOARD ── */
.drow {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.dcard {
  background: white;
  border: 1px solid var(--g200);
  border-radius: var(--rlg);
  padding: 20px;
}

.dcard h4 {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--g500);
  margin-bottom: 12px;
}

.dbar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.dbar-lbl {
  font-size: .78rem;
  color: var(--g600);
  width: 90px;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dbar-track {
  flex: 1;
  height: 8px;
  background: var(--g100);
  border-radius: 20px;
  overflow: hidden;
}

.dbar-fill {
  height: 100%;
  border-radius: 20px;
}

.dbar-val {
  font-size: .78rem;
  font-weight: 700;
  color: var(--g700);
  width: 20px;
  text-align: right;
}

/* ── USERS ── */
.uwrap {
  background: white;
  border: 1px solid var(--g200);
  border-radius: var(--rlg);
  overflow: hidden;
}

.rbadge {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 700;
}

.r-adm {
  background: #ede9fe;
  color: #5b21b6;
}

.r-usr {
  background: var(--g100);
  color: var(--g600);
}

/* ── TOAST ── */
.toastwrap {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.twrap {
  background: var(--white);
  border: 1px solid var(--g200);
  border-radius: var(--rlg);
  overflow-x: auto;
  width: 100%;
}

.toast {
  background: var(--g900);
  color: white;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: .85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 25px -5px rgba(0,0,0,.12);
  animation: tin .3s ease;
  max-width: 320px;
}

.toast.s { background: #065f46; }
.toast.e { background: #991b1b; }
.toast.w { background: #92400e; }

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

#fileInput {
  display: none;
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .sidebar {
    width: 64px;
  }
  .slogo-text,
  .nitem span,
  .snav-sect,
  .uname,
  .urole {
    display: none;
  }
  .nitem {
    justify-content: center;
    padding: 10px;
  }
  .nitem i {
    width: auto;
  }
  .ucard {
    justify-content: center;
    padding: 8px;
  }
  .main {
    margin-left: 64px;
    width: calc(100% - 64px);
  }
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .frow {
    grid-template-columns: 1fr;
  }
  .agrid {
    grid-template-columns: 1fr;
  }
  .drow {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .content {
    padding: 16px;
  }
  .topbar {
    padding: 0 16px;
  }
  table {
    font-size: .78rem;
  }
  thead th,
  tbody td {
    padding: 10px;
  }
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

  #pageTickets,
#pageDashboard,
#pageAdmin,
#pageUsers {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  position: static !important;
  float: none !important;
}
}