/* super.udayraj.com — base styles */
:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --text: #1c2433;
  --muted: #6b7486;
  --line: #e3e7ee;
  --side: #17213a;
  --side-text: #c4cbdc;
  --side-hover: #22304f;
  --brand: #1f6feb;
  --brand-dark: #1557c0;
  --green: #17803d;
  --green-bg: #e6f4ea;
  --red: #b42318;
  --red-bg: #fdecea;
  --amber-bg: #fff6e0;
  --blue-bg: #e8f0fe;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .04);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.5 var(--font); color: var(--text); background: var(--bg); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h2 { font-size: 18px; }
h3 { font-size: 15px; margin-bottom: 12px; }
.icon { width: 18px; height: 18px; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.c { text-align: center; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* ---------- app shell ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; flex: none; background: var(--side); color: var(--side-text);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px 14px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 8px; background: var(--brand); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 13px; letter-spacing: .5px;
}
.brand-logo {
  height: 46px; width: 46px; padding: 4px; border-radius: 9px; background: #fff;
  display: inline-flex; align-items: center; justify-content: center; flex: none; overflow: hidden;
}
.brand-logo img { max-height: 38px; max-width: 38px; width: auto; height: auto; display: block; }
.plain-brand .brand-logo { height: 76px; width: 76px; padding: 6px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.plain-brand .brand-logo img { max-height: 64px; max-width: 64px; }
.brand-text strong, .plain-brand strong { display: block; color: #fff; font-size: 16px; }
.brand-text small { display: block; font-size: 11px; color: var(--side-text); }
.nav { flex: 1; overflow-y: auto; padding: 6px 10px; }
.nav-link {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px;
  color: var(--side-text); margin-bottom: 1px;
}
.nav-link:hover { background: var(--side-hover); color: #fff; text-decoration: none; }
.nav-link.is-active { background: var(--brand); color: #fff; }
.nav-link span { flex: 1; }
.soon {
  font-style: normal; font-size: 10px; text-transform: uppercase; letter-spacing: .4px;
  padding: 1px 6px; border-radius: 99px; background: rgba(255, 255, 255, .08); color: var(--side-text);
}
.perm-grid .soon { background: var(--bg); color: var(--muted); }
.nav-section { margin: 16px 10px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: #7d88a3; }
.me { border-top: 1px solid rgba(255, 255, 255, .08); padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.me-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.me-who strong { display: block; color: #fff; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-who small { display: block; font-size: 11px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--side-hover); color: #fff; display: grid; place-items: center; font-weight: 600; flex: none; }
.me-actions { display: flex; gap: 4px; }
.me-actions form { margin: 0; }
.me-actions a, .me-actions button {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 6px;
  color: var(--side-text); background: none; border: 0; cursor: pointer;
}
.me-actions a:hover, .me-actions button:hover { background: var(--side-hover); color: #fff; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: var(--surface); border-bottom: 1px solid var(--line);
  padding: 14px 28px; display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 5;
}
.topbar h1 { font-size: 20px; font-weight: 600; flex: 1; }
.menu-btn { display: none; background: none; border: 0; padding: 4px; cursor: pointer; color: var(--text); }
.content { padding: 24px 28px 48px; max-width: 1200px; width: 100%; }

/* ---------- components ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; }
.card.flush { padding: 0; overflow-x: auto; }
.card.narrow { max-width: 640px; }
.callout { border-left: 4px solid var(--brand); max-width: 640px; }
.temp-pw { font-size: 18px; background: var(--blue-bg); padding: 2px 10px; border-radius: 6px; margin-left: 6px; user-select: all; }
.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; border: 1px solid transparent; }
.alert-success { background: var(--green-bg); color: var(--green); border-color: #bfe3c9; }
.alert-error { background: var(--red-bg); color: var(--red); border-color: #f5c2bd; }
.alert-info { background: var(--blue-bg); color: #1d4ed8; border-color: #c7d7fb; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface);
  color: var(--text); font: inherit; font-weight: 500; cursor: pointer; text-decoration: none;
}
.btn:hover { background: #f8f9fb; text-decoration: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-block { width: 100%; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 500; }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-grey { background: #eef0f4; color: var(--muted); }
.badge-blue { background: var(--blue-bg); color: #1d4ed8; }

/* forms */
.form .field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-weight: 500; margin-bottom: 5px; }
.field small { font-weight: 400; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid #cfd5df; border-radius: 8px; font: inherit; color: var(--text); background: #fff;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31, 111, 235, .15); }
input[readonly], textarea[readonly] { background: #f6f7f9; }
.check { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.form-actions { display: flex; gap: 10px; margin-top: 6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

/* tables */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 600; background: #fafbfc; }
.table th, .table td { padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafbfd; }
.table .c { text-align: center; }
.is-muted td { color: var(--muted); }
.perm-grid input { width: 16px; height: 16px; }
.details { font-size: 12px; max-width: 420px; word-break: break-word; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.toolbar p { margin: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.filters select { width: auto; min-width: 180px; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 12px; }
.crumbs { margin: 0 0 14px; color: var(--muted); }
.section-title { margin: 24px 0 12px; }

/* dashboard */
.welcome h2 { margin-bottom: 6px; }
.welcome p { margin: 0; max-width: 720px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.tile {
  display: flex; gap: 12px; align-items: center; padding: 14px 16px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); box-shadow: var(--shadow);
}
.tile:hover { border-color: var(--brand); text-decoration: none; }
.tile-icon { width: 38px; height: 38px; border-radius: 9px; background: var(--blue-bg); color: var(--brand); display: grid; place-items: center; }
.tile-body small { display: block; color: var(--muted); }

.empty { text-align: center; padding: 48px 20px; }
.empty-code { font-size: 44px; font-weight: 700; color: var(--line); }

/* plain (login/setup) */
.plain { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.plain-wrap { width: 100%; max-width: 400px; }
.plain-brand { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 18px; }
.plain-brand strong { color: var(--text); }
.plain-brand small { display: block; color: var(--muted); font-size: 12px; }
.plain-card { padding: 26px; }
.plain-title { margin-bottom: 16px; }

/* ---------- mobile ---------- */
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 20; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.is-open { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
  .menu-btn { display: block; }
  .topbar { padding: 12px 16px; }
  .content { padding: 16px 16px 40px; }
  .grid2 { grid-template-columns: 1fr; }
  .toolbar { flex-direction: column; align-items: stretch; }
}

/* ---------- batch 2 ---------- */
.count { font-style: normal; font-size: 11px; font-weight: 600; min-width: 20px; text-align: center; padding: 1px 6px; border-radius: 99px; background: #f59e0b; color: #1c2433; }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-amber { background: var(--amber-bg); color: #92400e; }
.note { background: var(--blue-bg); color: #1e3a8a; border-radius: 8px; padding: 9px 14px; margin-bottom: 14px; font-size: 13px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-2 > .card { margin-bottom: 0; }
.grid-2 + * { margin-top: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.card-head h3 { margin-bottom: 2px; }
.card-head p { margin: 0; }
.card-head form { margin: 0; }
.mt { margin-top: 18px; }
.select { user-select: all; }
.table.compact th, .table.compact td { padding: 7px 12px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tabs a { padding: 8px 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.is-on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg a { padding: 7px 14px; color: var(--muted); border-right: 1px solid var(--line); }
.seg a:last-child { border-right: 0; }
.seg a:hover { text-decoration: none; background: #f8f9fb; }
.seg a.is-on { background: var(--brand); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip { padding: 5px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font-size: 13px; }
.chip b { margin-left: 4px; color: var(--muted); }
.chip:hover { text-decoration: none; border-color: var(--brand); }
.chip.is-on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip.is-on b { color: #dbe7ff; }
.stats { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.stats > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 16px; min-width: 140px; }
.stats span { display: block; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stats small { color: var(--muted); }
.stats.in-card > div { border: 0; background: var(--bg); }
.filters input[type=text] { width: auto; min-width: 240px; flex: 1; max-width: 360px; }
.filters select { min-width: 150px; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.kv.money dd { text-align: right; font-variant-numeric: tabular-nums; }
tr.has-issue td:first-child { box-shadow: inset 3px 0 0 #f59e0b; }
.btn-sm { padding: 4px 10px; font-size: 13px; }
.inline-actions { display: flex; gap: 6px; align-items: center; margin: 0; }
.note-input { width: 150px !important; padding: 5px 8px !important; font-size: 13px; }
.btn[disabled] { opacity: .6; cursor: wait; }
.dash-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 8px; }
.dash-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); color: var(--text); display: block; }
.dash-card:hover { text-decoration: none; border-color: var(--brand); }
.dash-card .big { font-size: 24px; font-weight: 600; display: block; }
.dash-card small { color: var(--muted); }
.dash-card.warn .big { color: #b45309; }
.dash-card.bad .big { color: var(--red); }
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 110px 1fr; }
  .filters input[type=text] { max-width: none; min-width: 0; width: 100%; }
  .inline-actions { flex-wrap: wrap; }
}
