/* Global Asset Management — S.S. Solutions theme (blue / cyan / dark blue with green, orange, purple status colours) */
:root {
  --gam-navy: #0b2545;
  --gam-blue: #0b5fad;
  --gam-blue-600: #0a4f91;
  --gam-cyan: #12b5cb;
  --gam-sky: #e8f4fd;
  --gam-bg: #f3f6fa;
  --gam-card: #ffffff;
  --gam-border: #dde5ef;
  --gam-text: #1d2a3a;
  --gam-muted: #64748b;
  --gam-green: #1f9d55;
  --gam-orange: #f08c00;
  --gam-purple: #7048e8;
  --gam-red: #d6336c;
  --gam-sidebar-w: 264px;
  --bs-primary: var(--gam-blue);
  --bs-primary-rgb: 11, 95, 173;
  --bs-link-color: var(--gam-blue);
  --bs-link-color-rgb: 11, 95, 173;
  --bs-body-font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans Telugu", "Helvetica Neue", Arial, sans-serif;
  --bs-body-color: var(--gam-text);
}

html, body { height: 100%; }
body.gam { background: var(--gam-bg); font-size: .925rem; }

.btn-primary { --bs-btn-bg: var(--gam-blue); --bs-btn-border-color: var(--gam-blue); --bs-btn-hover-bg: var(--gam-blue-600); --bs-btn-hover-border-color: var(--gam-blue-600); --bs-btn-active-bg: var(--gam-navy); }
.btn-outline-primary { --bs-btn-color: var(--gam-blue); --bs-btn-border-color: var(--gam-blue); --bs-btn-hover-bg: var(--gam-blue); --bs-btn-hover-border-color: var(--gam-blue); }
.text-bg-purple, .badge-purple { background: var(--gam-purple) !important; color: #fff !important; }
.text-bg-warning { background: #ffe8cc !important; color: #a35200 !important; }
.text-bg-success { background: #d3f9d8 !important; color: #136c34 !important; }
.text-bg-danger { background: #ffe3e3 !important; color: #b02a37 !important; }
.text-bg-secondary { background: #e9ecef !important; color: #495057 !important; }
.text-bg-primary { background: #dbeafe !important; color: #0a4f91 !important; }
.badge { font-weight: 600; letter-spacing: .01em; }

/* ---------- shell ---------- */
.gam-shell { display: flex; min-height: 100vh; }
.gam-sidebar {
  width: var(--gam-sidebar-w); flex-shrink: 0;
  background: linear-gradient(180deg, var(--gam-navy) 0%, #0d3466 100%);
  color: #c9d7ea;
}
@media (min-width: 992px) {
  .gam-sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; }
}
.gam-sidebar .offcanvas-body { padding: 0; display: block; }
.gam-brand-row { display: flex; align-items: center; padding-right: 1rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.gam-brand { flex: 1; display: flex; align-items: center; gap: .65rem; padding: 1rem 1.1rem; color: #fff; text-decoration: none; }
.gam-brand img { width: 38px; height: 38px; }
.gam-brand .t1 { font-weight: 700; font-size: 1.02rem; line-height: 1.1; }
.gam-brand .t2 { font-size: .7rem; color: var(--gam-cyan); text-transform: uppercase; letter-spacing: .08em; }
.gam-nav { list-style: none; margin: 0; padding: .5rem 0 2rem; }
.gam-nav .grp > a, .gam-nav .item > a {
  display: flex; align-items: center; gap: .65rem; padding: .5rem 1.1rem; color: #c9d7ea; text-decoration: none; font-size: .88rem;
}
.gam-nav .grp > a:hover, .gam-nav .item > a:hover { background: rgba(255,255,255,.06); color: #fff; }
.gam-nav .grp > a.active, .gam-nav .item > a.active { color: #fff; background: rgba(18,181,203,.16); box-shadow: inset 3px 0 0 var(--gam-cyan); }
.gam-nav .bi { font-size: 1.05rem; width: 1.2rem; text-align: center; color: var(--gam-cyan); }
.gam-nav .grp > a .chev { margin-left: auto; font-size: .75rem; transition: transform .2s; color: #8fa6c4; }
.gam-nav .grp > a[aria-expanded="true"] .chev { transform: rotate(90deg); }
.gam-nav .sub { list-style: none; padding: 0 0 .25rem; margin: 0; }
.gam-nav .sub a { display: block; padding: .35rem 1rem .35rem 3rem; color: #a9bcd6; text-decoration: none; font-size: .84rem; }
.gam-nav .sub a:hover, .gam-nav .sub a.active { color: #fff; }
.gam-nav .sub a.active { font-weight: 600; }

.gam-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.gam-topbar {
  position: sticky; top: 0; z-index: 1020; background: #fff; border-bottom: 1px solid var(--gam-border);
  display: flex; align-items: center; gap: .75rem; padding: .55rem 1rem; min-height: 58px;
}
.gam-topbar .search { flex: 1; max-width: 520px; }
.gam-topbar .search .form-control { background: var(--gam-bg); border-color: transparent; }
.gam-topbar .search .form-control:focus { background: #fff; border-color: var(--gam-cyan); box-shadow: 0 0 0 .2rem rgba(18,181,203,.15); }
.gam-content { padding: 1.1rem 1.25rem 2rem; flex: 1; }
.gam-footer { padding: .75rem 1.25rem; color: var(--gam-muted); font-size: .78rem; border-top: 1px solid var(--gam-border); background: #fff; }
@media (max-width: 575.98px) { .gam-content { padding: .9rem .75rem 2rem; } .gam-topbar .user-name { display: none; } }

.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.page-head h1 { font-size: 1.35rem; font-weight: 700; margin: 0; color: var(--gam-navy); }
.page-head .sub { color: var(--gam-muted); font-size: .85rem; }
.breadcrumb { font-size: .8rem; margin-bottom: .35rem; }

/* ---------- cards & tables ---------- */
.card { border: 1px solid var(--gam-border); border-radius: .75rem; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.card-header { background: #fff; border-bottom: 1px solid var(--gam-border); font-weight: 600; color: var(--gam-navy); border-radius: .75rem .75rem 0 0 !important; }
.table { --bs-table-hover-bg: #f5f9fe; margin-bottom: 0; }
.table thead th { background: #f1f5fb; color: #42536b; font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; font-weight: 700; border-bottom-width: 1px; white-space: nowrap; }
.table td { vertical-align: middle; }
.table-responsive { border-radius: .75rem; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.dl-grid { display: grid; grid-template-columns: minmax(130px, 38%) 1fr; gap: .35rem .9rem; font-size: .88rem; margin: 0; }
.dl-grid dt { color: var(--gam-muted); font-weight: 500; }
.dl-grid dd { margin: 0; word-break: break-word; }

/* ---------- KPI cards ---------- */
.kpi { display: flex; gap: .85rem; align-items: center; padding: .9rem 1rem; background: #fff; border: 1px solid var(--gam-border); border-radius: .75rem; height: 100%; text-decoration: none; color: inherit; transition: box-shadow .15s, transform .15s; }
.kpi:hover { box-shadow: 0 6px 18px rgba(11,37,69,.08); transform: translateY(-1px); color: inherit; }
.kpi .ico { width: 44px; height: 44px; border-radius: .65rem; display: grid; place-items: center; font-size: 1.3rem; flex-shrink: 0; }
.kpi .val { font-size: 1.35rem; font-weight: 700; line-height: 1.1; color: var(--gam-navy); }
.kpi .lbl { font-size: .78rem; color: var(--gam-muted); }
.tone-primary .ico { background: #dbeafe; color: var(--gam-blue); }
.tone-cyan .ico { background: #d0f4f8; color: #0b8a9c; }
.tone-success .ico { background: #d3f9d8; color: var(--gam-green); }
.tone-orange .ico { background: #ffe8cc; color: var(--gam-orange); }
.tone-purple .ico { background: #e5dbff; color: var(--gam-purple); }
.tone-danger .ico { background: #ffe3e3; color: var(--gam-red); }
.tone-secondary .ico { background: #e9ecef; color: #495057; }
.chart-box { position: relative; height: 270px; }

/* ---------- forms ---------- */
.form-label { font-weight: 600; font-size: .8rem; color: #42536b; margin-bottom: .25rem; }
.form-section { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--gam-blue); font-weight: 700; border-bottom: 1px solid var(--gam-border); padding-bottom: .35rem; margin: 1.1rem 0 .8rem; }
.field-validation-error, .validation-summary-errors { color: #b02a37; font-size: .8rem; }
.validation-summary-errors ul { margin: 0; padding-left: 1.1rem; }
.input-validation-error { border-color: #dc3545 !important; }
.ts-wrapper.form-select, .ts-wrapper.form-control { padding: 0; border: 0; }
.ts-control { border-radius: .375rem; min-height: 38px; }
.required::after { content: " *"; color: #d6336c; }

.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--gam-muted); }
.empty-state .bi { font-size: 2.4rem; color: #b6c4d6; display: block; margin-bottom: .5rem; }

/* ---------- timeline ---------- */
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 1rem 1.6rem; }
.timeline li::before { content: ""; position: absolute; left: .42rem; top: .4rem; bottom: -.2rem; width: 2px; background: var(--gam-border); }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ""; position: absolute; left: 0; top: .25rem; width: .95rem; height: .95rem; border-radius: 50%; background: #fff; border: 3px solid var(--gam-cyan); }
.timeline .when { font-size: .75rem; color: var(--gam-muted); }

/* ---------- workflow stepper ---------- */
.stepper { display: flex; flex-wrap: wrap; gap: .35rem; }
.stepper .s { font-size: .72rem; padding: .3rem .55rem; border-radius: 1rem; background: #eef2f7; color: #6b7a90; white-space: nowrap; }
.stepper .s.done { background: #d3f9d8; color: #136c34; }
.stepper .s.now { background: var(--gam-blue); color: #fff; font-weight: 600; }

/* ---------- loading overlay ---------- */
#gam-loading { position: fixed; inset: 0; background: rgba(255,255,255,.55); display: none; z-index: 2000; align-items: center; justify-content: center; }
#gam-loading.show { display: flex; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-hero {
  background:
    radial-gradient(circle at 85% 12%, rgba(255,255,255,.10) 0, rgba(255,255,255,0) 32%),
    radial-gradient(circle at 8% 92%, rgba(18,181,203,.28) 0, rgba(18,181,203,0) 40%),
    linear-gradient(135deg, var(--gam-navy), var(--gam-blue) 60%, var(--gam-cyan));
  color: #fff; padding: 2.5rem 3rem; display: flex; flex-direction: column; justify-content: space-between; gap: 1.5rem;
}
.login-hero h1 { font-weight: 800; font-size: 2.2rem; }
.login-hero .login-art { display: block; width: 100%; max-width: 520px; height: auto; margin: 1.25rem 0 1rem; }
.login-hero ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .35rem 1.25rem; font-size: .9rem; }
.login-hero li { margin: .2rem 0; }
@media (max-height: 760px) { .login-hero .login-art { max-width: 400px; } }
.login-hero li .bi { color: #9be7f2; margin-right: .5rem; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; background: #fff; }
.login-form .box { width: 100%; max-width: 380px; }
.login-banner { margin-bottom: 1.5rem; padding: 1rem 1rem .85rem; border-radius: 1rem; color: #fff; background: linear-gradient(135deg, var(--gam-navy), var(--gam-blue) 60%, var(--gam-cyan)); }
.login-banner > img { display: block; width: 100%; height: auto; }
@media (max-width: 991.98px) { .login-wrap { grid-template-columns: 1fr; } .login-hero { display: none; } }

/* ---------- scanner ---------- */
#reader { width: 100%; max-width: 480px; margin: 0 auto; }
.scan-result { border-radius: .6rem; padding: .7rem .9rem; font-weight: 600; }

/* ---------- mobile & tablet ---------- */
.gam-topbrand img { display: block; }
.pagination { flex-wrap: wrap; }

/* Quick navigation bar (phones / tablets) */
.gam-bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; display: flex;
  background: #fff; border-top: 1px solid var(--gam-border); box-shadow: 0 -4px 16px rgba(11,37,69,.06);
  padding-bottom: env(safe-area-inset-bottom);
}
.gam-bottomnav > a, .gam-bottomnav > button {
  flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem;
  padding: .45rem .15rem .4rem; min-height: 56px; border: 0; background: none;
  color: var(--gam-muted); font-size: .68rem; font-weight: 600; text-decoration: none; -webkit-tap-highlight-color: transparent;
}
.gam-bottomnav span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gam-bottomnav .bi { font-size: 1.25rem; line-height: 1; }
.gam-bottomnav > .active { color: var(--gam-blue); }
.gam-bottomnav > .accent .bi { display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 50%; background: var(--gam-blue); color: #fff; font-size: 1.05rem; }
.gam-bottomnav > .accent.active .bi { background: var(--gam-navy); }

@media (max-width: 991.98px) {
  body.has-bottomnav { padding-bottom: calc(56px + env(safe-area-inset-bottom)); }
  .gam-nav .grp > a, .gam-nav .item > a { padding-top: .65rem; padding-bottom: .65rem; }
  .gam-nav .sub a { padding-top: .55rem; padding-bottom: .55rem; }
  /* 16px inputs stop iOS Safari from zooming the page when a field is tapped */
  .form-control, .form-select, .ts-control, .ts-control input, .ts-dropdown { font-size: 16px; }
  .nav-tabs, .nav-pills { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .nav-tabs .nav-link, .nav-pills .nav-link { white-space: nowrap; }
  .chart-box { height: 240px; }
}

/* Filter panels collapse behind a toggle on phones (see site.js) */
.filters-toggle { display: none; }
@media (max-width: 767.98px) {
  .filters-toggle { display: flex; }
  .filters-collapsible:not(.open) { display: none !important; }
}

@media (max-width: 575.98px) {
  body.gam { font-size: .9rem; }
  .gam-topbar { flex-wrap: wrap; gap: .5rem; padding: .45rem .6rem; min-height: 54px; }
  .gam-topbar .search { display: none; order: 10; flex: 1 0 100%; max-width: none; }
  .gam-topbar.search-open .search { display: block; }
  .gam-topbar .btn { padding: .375rem .6rem; }
  .gam-content { padding: .75rem .6rem 1.5rem; }
  .gam-footer { text-align: center; justify-content: center !important; padding: .6rem .75rem; }
  .breadcrumb { font-size: .75rem; }

  .page-head { gap: .5rem; }
  .page-head h1 { font-size: 1.15rem; }
  .page-head > :last-child:not(:first-child) { width: 100%; }
  .page-head > .btn, .page-head > div > .btn, .page-head > div > .btn-group, .page-head > div > form { flex: 1 1 auto; }
  .page-head .btn-group > .btn { flex: 1 1 auto; }

  .card-body { padding: .85rem; }
  .card-header { padding: .6rem .85rem; }
  .dl-grid { grid-template-columns: minmax(96px, 40%) 1fr; font-size: .85rem; }
  .kpi { padding: .7rem; gap: .6rem; }
  .kpi .ico { width: 36px; height: 36px; font-size: 1.05rem; }
  .kpi .val { font-size: 1.05rem; overflow-wrap: anywhere; }
  .kpi .lbl { font-size: .72rem; }
  .chart-box { height: 220px; }
  .modal-footer > .btn { flex: 1 1 auto; }

  /* Tables become stacked cards: each row is a card, each cell shows its column heading (labels set by site.js). */
  .table-stack thead { display: none; }
  .table-stack, .table-stack > tbody, .table-stack > tfoot, .table-stack > * > tr,
  .table-stack > * > tr > td, .table-stack > * > tr > th { display: block; width: 100%; }
  .table-stack > * > tr { padding: .55rem .85rem; border-bottom: 1px solid var(--gam-border); }
  .table-stack > * > tr:last-child { border-bottom: 0; }
  .table-stack > * > tr > td, .table-stack > * > tr > th {
    position: relative; border: 0 !important; box-shadow: none; background: transparent;
    padding: .22rem 0 .22rem 40% !important; text-align: left !important; white-space: normal;
  }
  .table-stack > * > tr > *::before {
    content: attr(data-label); position: absolute; left: 0; top: .3rem; width: 38%;
    font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--gam-muted); line-height: 1.3;
  }
  .table-stack > * > tr > [data-label=""] { padding-left: 0 !important; }
  .table-stack > * > tr > [data-label=""]::before { content: none; }
  .table-stack > * > tr > td:empty { display: none; }
  .table-stack > * > tr > :first-child { font-weight: 600; }
  .table-stack .form-control, .table-stack .form-select { width: 100%; }
}

/* ---------- print ---------- */
@media print {
  .gam-sidebar, .gam-topbar, .gam-footer, .no-print, .breadcrumb, .btn, form.filters { display: none !important; }
  .gam-content { padding: 0 !important; }
  body.gam { background: #fff; font-size: 10pt; }
  .card { border: 0; box-shadow: none; }
  .table thead th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: inherit; text-decoration: none; }
  .print-only { display: block !important; }
}
.print-only { display: none; }
.print-header { border-bottom: 2px solid var(--gam-navy); margin-bottom: .6rem; padding-bottom: .4rem; }
