/* IT Advance Solution — Help Desk portal styles */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: 'Manrope', system-ui, sans-serif; color: #161d33; background: #eef2f9; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
input, select, textarea, button { font-family: inherit; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #3f9d2f !important; background: #fff !important; }

/* headings/numbers */
h1, h2, h3, .grotesk { font-family: 'Space Grotesk', sans-serif; }

/* layout shells */
.app { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0,1fr); }
.sidebar { background: linear-gradient(180deg,#16245e,#0f1c3f); padding: 22px 18px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 6px 22px; }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; background: #fff; display: flex; align-items: center; justify-content: center; font-family: 'Space Grotesk'; font-weight: 700; font-size: 17px; overflow: hidden; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand-mark .i { color: #3f9d2f; } .brand-mark .t { color: #16245e; }
.brand-name { font-family: 'Space Grotesk'; font-weight: 600; font-size: 14px; color: #fff; line-height: 1.1; }
.brand-sub { font-size: 10px; font-weight: 700; letter-spacing: 1.5px; color: #7fe06a; text-transform: uppercase; }
.nav { flex: 1; padding-top: 8px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 11px; text-decoration: none; font-size: 14px; font-weight: 600; color: #9fb0d4; margin-bottom: 3px; }
.nav a.active { background: rgba(127,224,106,.14); color: #bfeeb1; }
.nav a:hover:not(.active) { background: rgba(255,255,255,.05); color: #cdd8ef; }
.side-user { border-top: 1px solid rgba(255,255,255,.1); padding-top: 14px; display: flex; align-items: center; gap: 10px; }
.side-user .av { width: 34px; height: 34px; border-radius: 9px; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.content { overflow-y: auto; height: 100vh; }
.wrap { padding: 32px 36px 60px; }
.wrap-narrow { max-width: 720px; }

/* topbar (customer/tech) */
.topbar { height: 64px; background: #fff; border-bottom: 1px solid #e4e9f2; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; position: sticky; top: 0; z-index: 10; }
.main { max-width: 900px; margin: 0 auto; padding: 36px 28px 60px; }

/* type */
.h1 { font-family: 'Space Grotesk'; font-weight: 700; font-size: 26px; color: #16245e; margin: 0 0 6px; }
.sub { font-size: 14.5px; color: #6b7689; margin: 0 0 22px; }
.section-title { font-family: 'Space Grotesk'; font-weight: 600; font-size: 16px; color: #16245e; margin: 0 0 14px; }

/* cards */
.card { background: #fff; border: 1px solid #e4e9f2; border-radius: 16px; padding: 22px; }
.card + .card { margin-top: 18px; }
.grid { display: grid; gap: 14px; }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.stat { background: #fff; border: 1px solid #e4e9f2; border-radius: 14px; padding: 18px 20px; }
.stat .l { font-size: 13px; color: #7c879c; font-weight: 600; margin-bottom: 8px; }
.stat .v { font-family: 'Space Grotesk'; font-size: 30px; font-weight: 700; color: #16245e; }

/* forms */
label.f { display: block; font-size: 13px; font-weight: 600; color: #3c4661; margin-bottom: 7px; }
.in { width: 100%; padding: 11px 13px; border: 1.5px solid #dde3ef; border-radius: 11px; font-size: 14px; background: #fbfcfe; }
textarea.in { resize: vertical; font-family: inherit; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mb { margin-bottom: 16px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: none; border-radius: 11px; padding: 11px 20px; cursor: pointer; font-size: 14px; font-weight: 700; text-decoration: none; }
.btn-primary { background: linear-gradient(180deg,#1d3a7a,#16245e); color: #fff; box-shadow: 0 8px 20px rgba(22,36,94,.22); }
.btn-green { background: linear-gradient(180deg,#48ab33,#3f9d2f); color: #fff; box-shadow: 0 8px 18px rgba(63,157,47,.28); }
.btn-sm { padding: 8px 13px; font-size: 12.5px; border-radius: 9px; }
.btn-ghost { background: #f1f4fa; border: 1px solid #e4e9f2; color: #6b7689; }
.btn-blue { background: #eef4fb; border: 1px solid #cdd7e8; color: #2563a8; }
.btn-danger { background: #fff; border: 1px solid #e8c9c4; color: #c0392b; }
.btn-danger:hover { background: #fbe3e0; }
.btn-navy { background: #16245e; color: #fff; }

/* list rows */
.list { display: flex; flex-direction: column; gap: 11px; }
.item { background: #fff; border: 1px solid #e4e9f2; border-radius: 14px; padding: 15px 18px; display: flex; align-items: center; gap: 16px; text-decoration: none; color: inherit; }
.item:hover { border-color: #c3d0e6; box-shadow: 0 6px 18px rgba(22,36,94,.08); }
.muted { color: #7c879c; font-size: 12.5px; }
.avatar { width: 34px; height: 34px; border-radius: 9px; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }

/* table */
.tbl { width: 100%; border-collapse: collapse; }
.tbl thead th { text-align: left; background: #f6f8fc; font-size: 12px; font-weight: 700; color: #8290ac; text-transform: uppercase; letter-spacing: .3px; padding: 12px 14px; }
.tbl tbody td { padding: 13px 14px; border-top: 1px solid #f0f3f8; font-size: 13.5px; color: #3c4661; vertical-align: middle; }

/* filter tabs / chips */
.tabs { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 20px; }
.tab { padding: 8px 14px; border-radius: 10px; border: 1px solid #e4e9f2; background: #fff; color: #3c4661; font-size: 13px; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 7px; }
.tab.active { background: #16245e; border-color: #16245e; color: #fff; }
.tab .cnt { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 100px; background: #eef1f7; color: #6b7689; }
.tab.active .cnt { background: rgba(255,255,255,.2); color: #fff; }

/* toast */
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 100; padding: 13px 20px; border-radius: 12px; background: #16245e; color: #fff; font-size: 14px; font-weight: 600; box-shadow: 0 14px 34px rgba(0,0,0,.28); transition: opacity .4s; }
.toast-err { background: #c0392b; }

/* modal via :target */
.modal { position: fixed; inset: 0; background: rgba(15,28,63,.5); display: none; align-items: center; justify-content: center; padding: 24px; z-index: 60; }
.modal:target { display: flex; }
.modal-box { background: #fff; border-radius: 18px; padding: 26px; width: 100%; max-width: 440px; box-shadow: 0 30px 70px rgba(8,18,45,.4); max-height: 90vh; overflow-y: auto; }
.modal-title { font-family: 'Space Grotesk'; font-weight: 700; font-size: 17px; color: #16245e; }
.x { text-decoration: none; color: #6b7689; font-weight: 700; }

/* auth */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-left { background: radial-gradient(130% 90% at 20% 10%, #1b3066 0%, #0f1c3f 60%, #0c1733 100%); padding: 48px 56px; display: flex; flex-direction: column; justify-content: center; color: #fff; }
.auth-right { display: flex; align-items: center; justify-content: center; padding: 40px; background: #fff; }
.right-inner { width: 100%; max-width: 380px; }
@media (max-width: 820px) {
  .auth { grid-template-columns: 1fr; }
  .auth-left { display: none; }
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px 14px; }
  .brand { padding: 0 10px 0 4px; }
  .nav { flex: 1 1 100%; display: flex; flex-wrap: nowrap; overflow-x: auto; padding-top: 10px; gap: 4px; -webkit-overflow-scrolling: touch; }
  .nav a { white-space: nowrap; margin-bottom: 0; padding: 9px 12px; }
  .side-user { border-top: none; padding-top: 0; margin-left: auto; }
  .content { height: auto; }
}
@media (max-width: 640px) {
  .wrap { padding: 20px 16px 48px; }
  .main { padding: 20px 16px 48px; }
  .topbar { padding: 0 16px; height: 58px; }
  .h1 { font-size: 22px; }
  .card { padding: 16px; border-radius: 14px; }
  /* collapse every grid to a single column, including inline grid-template-columns */
  .content .grid, .main .grid, .grid.g2, .grid.g3, .grid.g4 { grid-template-columns: 1fr !important; }
  .row { grid-template-columns: 1fr !important; }
  /* stat cards can stay two-up */
  .grid.g4 { grid-template-columns: 1fr 1fr !important; }
  /* let list rows wrap instead of overflowing */
  .item { flex-wrap: wrap; gap: 10px; padding: 14px; }
  .item > span[style*="width:110px"], .item > span[style*="width: 110px"] { width: auto !important; }
  /* tables scroll horizontally rather than squish */
  .card > .tbl, .tbl { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  .tbl thead th, .tbl tbody td { padding: 10px 12px; }
  /* modal fits small screens */
  .modal { padding: 12px; }
  .modal-box { padding: 20px; max-height: 94vh; }
  /* tabs scroll instead of wrapping tall */
  .tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
  .tab { white-space: nowrap; }
}
