/*
 * Sangu's shell: the header with its company switcher and navigation, the
 * page head, the flash band, the base table and the sign-in page. The
 * screens themselves are public/css/marketing.css. Mobile first: the header
 * stacks under 768px and the navigation scrolls sideways.
 */
:root {
  --bg: #f1f5f9; --surface: #fff; --ink: #222b39; --ink-2: #5b6472; --muted: #7d8695;
  --rule: #d8dee6; --rule-strong: #cfd6df; --navy: #0d3050; --em-600: #059669; --em-700: #047857;
  --em-100: #d1fae5; --em-800: #065f46; --red-100: #fee2e2; --red-800: #991b1b;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
a { color: var(--em-700); }
h1, h2, h3, h4, h5 { line-height: 1.25; }
img, svg { max-width: 100%; }

.sg-header { background: var(--navy); color: #fff; }
.sg-header-in { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding: .6rem 16px; }
.sg-brand { display: flex; align-items: center; gap: .5rem; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.05rem; letter-spacing: .01em; }
.sg-brand i { color: #6ee7b7; }
.sg-spacer { flex: 1; }
.sg-company { position: relative; }
.sg-company summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: .45rem; padding: .35rem .7rem; border: 1px solid rgba(255,255,255,.25); border-radius: .375rem; font-size: .875rem; max-width: 70vw; }
.sg-company summary::-webkit-details-marker { display: none; }
.sg-company summary span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-company-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; background: #fff; color: var(--ink); border: 1px solid var(--rule); border-radius: .5rem; box-shadow: 0 10px 30px rgba(15,23,42,.15); min-width: 14rem; max-width: 86vw; padding: .3rem; }
.sg-company-menu form { margin: 0; }
.sg-company-menu button { display: flex; width: 100%; align-items: center; gap: .5rem; text-align: left; background: none; border: 0; padding: .5rem .65rem; font: inherit; font-size: .875rem; color: inherit; border-radius: .35rem; cursor: pointer; }
.sg-company-menu button:hover { background: #f3f7fc; }
.sg-company-menu button.on { font-weight: 700; color: var(--em-700); }
.sg-company-menu .sg-empty { padding: .5rem .65rem; font-size: .8125rem; color: var(--ink-2); }
.sg-user { display: flex; align-items: center; gap: .6rem; font-size: .8125rem; color: #cbd5e1; }
.sg-user form { margin: 0; }
.sg-user button { background: none; border: 1px solid rgba(255,255,255,.25); color: #fff; border-radius: .375rem; padding: .3rem .6rem; font: inherit; font-size: .8125rem; cursor: pointer; }
.sg-user .sg-name { display: none; }
.sg-nav { display: flex; gap: .15rem; overflow-x: auto; padding: 0 12px; background: #0a2640; scrollbar-width: none; }
.sg-nav::-webkit-scrollbar { display: none; }
.sg-nav a { display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; color: #cbd5e1; text-decoration: none; font-size: .875rem; padding: .6rem .7rem; border-bottom: 2px solid transparent; }
.sg-nav a:hover { color: #fff; }
.sg-nav a.on { color: #fff; border-bottom-color: #34d399; font-weight: 600; }

.sg-head { background: var(--surface); border-bottom: 1px solid var(--rule); padding: .75rem 16px; }
.sg-head-in { display: flex; flex-direction: column; gap: .5rem; }
.sg-crumbs { font-size: .8125rem; color: var(--muted); overflow-wrap: anywhere; }
.sg-title { margin: 0; font-size: 1.05rem; font-weight: 700; overflow-wrap: anywhere; }
.sg-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.sg-main { padding: 12px 16px 32px; }

.sg-flash { margin: 12px 16px 0; padding: .65rem .9rem; border-radius: .375rem; font-size: .875rem; border: 1px solid; }
.sg-flash.ok { background: var(--em-100); color: var(--em-800); border-color: #a7f3d0; }
.sg-flash.err { background: var(--red-100); color: var(--red-800); border-color: #fecaca; }

.table, .table-modern { width: 100%; border-collapse: collapse; color: var(--ink); }
.table-modern thead th, .table-modern thead td, .table thead th { font-weight: 700; color: #2b3444; background: #edf1f6; border: 1px solid var(--rule-strong); padding: 12px 14px; white-space: nowrap; text-align: left; }
.table-modern tbody td, .table tbody td { padding: 12px 14px; border: 1px solid var(--rule); vertical-align: middle; background: #fff; }
.table-modern tbody tr:hover td { background: #f3f7fc; }
.table-sm thead th, .table-sm tbody td { padding: 6px 10px; font-size: .85rem; }
.table-modern .sub, .table .sub { color: var(--ink-2); font-size: .9em; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mb-0 { margin-bottom: 0; }

.pagination { display: flex; flex-wrap: wrap; gap: .25rem; list-style: none; padding: 0; margin: 0; }
.pagination .page-link { display: inline-block; min-width: 2rem; text-align: center; padding: .3rem .55rem; border: 1px solid var(--rule); border-radius: .3rem; background: #fff; color: var(--ink); text-decoration: none; font-size: .8125rem; }
.pagination .active .page-link { background: var(--em-600); border-color: var(--em-600); color: #fff; }
.pagination .disabled .page-link { color: var(--muted); }

.sg-login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.sg-login form { width: 100%; max-width: 22rem; background: #fff; border: 1px solid var(--rule); border-radius: .5rem; padding: 1.5rem; }
.sg-login h1 { margin: 0 0 1rem; font-size: 1.25rem; display: flex; align-items: center; gap: .5rem; }
.sg-login h1 i { color: var(--em-600); }
.sg-login label { display: block; font-size: .8125rem; font-weight: 600; color: var(--ink-2); margin: .8rem 0 .3rem; }
.sg-login input[type=email], .sg-login input[type=password] { width: 100%; padding: .55rem .65rem; border: 1px solid #cbd5e1; border-radius: .3rem; font: inherit; }
.sg-login .sg-remember { display: flex; align-items: center; gap: .45rem; font-weight: 400; color: var(--ink); }
.sg-login button { margin-top: 1.1rem; width: 100%; padding: .6rem; border: 0; border-radius: .3rem; background: var(--em-600); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.sg-login .sg-error { color: var(--red-800); font-size: .8125rem; margin-top: .3rem; }

@media (min-width: 768px) {
  .sg-header-in { padding: .6rem 28px; }
  .sg-nav { padding: 0 20px; }
  .sg-user .sg-name { display: inline; }
  .sg-head { padding: 1rem 28px; }
  .sg-head-in { flex-direction: row; align-items: center; }
  .sg-head-in > div:first-child { flex: 1; min-width: 0; }
  .sg-main { padding: 16px 28px 40px; }
  .sg-flash { margin: 16px 28px 0; }
}

.sg-down { width: 100%; max-width: 28rem; background: #fff; border: 1px solid var(--rule); border-radius: .5rem; padding: 1.5rem; }
.sg-down h1 { margin: 0 0 .75rem; font-size: 1.15rem; }
.sg-down p { margin: 0 0 .75rem; color: var(--ink-2); }
