/* HSCODES admin theme (Skote template). Loaded last in index.html; !important where the template's inline
   styles or Angular's scoped component styles would otherwise win. No gradients: solid brand colours only. */
:root {
  --hs-navy: #0b2545;
  --hs-navy-2: #12355f;
  --hs-blue: #1565c0;
  --hs-blue-dark: #0f4f99;
  --hs-blue-light: #e8f1fc;
  --hs-green: #1e9b3c;
  --hs-red: #d93636;
  --hs-text: #1d2433;
  --hs-muted: #5b6476;
  --hs-border: #e3e8ef;
  --hs-bg: #f4f6fa;
  --hs-surface: #ffffff;
  --hs-skeleton: #e9edf3;
  --hs-radius: 12px;
  --hs-radius-sm: 8px;
  --hs-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 14px rgba(16, 24, 40, .05);
  --hs-shadow-lg: 0 12px 32px rgba(16, 24, 40, .14);
  --hs-topbar: 64px;
  --hs-safe-top: env(safe-area-inset-top, 0px);
  --hs-safe-bottom: env(safe-area-inset-bottom, 0px);
  --hs-safe-left: env(safe-area-inset-left, 0px);
  --hs-safe-right: env(safe-area-inset-right, 0px);
  --hs-ease: cubic-bezier(.2, .8, .2, 1);
}

body { background: var(--hs-bg); color: var(--hs-text); -webkit-font-smoothing: antialiased; }
a { color: var(--hs-blue); }
a:hover { color: var(--hs-blue-dark); }

/* keyboard focus stays visible everywhere */
a:focus-visible, button:focus-visible, .btn:focus-visible, .form-control:focus-visible, .form-select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--hs-blue);
  outline-offset: 2px;
}

/* =========================================================== sign in */
.hs-auth {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(380px, 1fr);
  background: var(--hs-surface);
}
.hs-auth-brand {
  background: var(--hs-navy);
  color: rgba(255, 255, 255, .85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 48px;
  text-align: center;
}
.hs-auth-brand img { width: min(320px, 60%); height: auto; filter: drop-shadow(0 18px 36px rgba(0, 0, 0, .3)); }
.hs-auth-brand p { max-width: 360px; font-size: 15px; margin: 0; }
.hs-auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(32px + var(--hs-safe-top)) calc(24px + var(--hs-safe-right)) calc(32px + var(--hs-safe-bottom)) calc(24px + var(--hs-safe-left));
}
.hs-auth-card { width: 100%; max-width: 400px; }
.hs-auth-head { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.hs-auth-head img { border-radius: 50%; flex: 0 0 auto; }
.hs-auth-head h1 { font-size: 24px; font-weight: 700; margin: 0; color: var(--hs-navy); }
.hs-auth-head p { margin: 2px 0 0; color: var(--hs-muted); font-size: 13.5px; }
.hs-auth .form-control { height: 46px; }
.hs-auth .input-group .btn { height: 46px; border: 1px solid #ced4da; border-left: 0; }
.hs-auth-cta { height: 48px; font-size: 15px; margin-top: 4px; }
.hs-auth-foot { margin: 28px 0 0; text-align: center; color: var(--hs-muted); font-size: 12.5px; }
@media (max-width: 991.98px) {
  .hs-auth { grid-template-columns: 1fr; }
  .hs-auth-brand { display: none; }
  /* sign-in button stays above the fold on phones */
  .hs-auth-main { align-items: flex-start; padding-top: calc(28px + var(--hs-safe-top)); }
  .hs-auth-head { margin-bottom: 20px; }
}

/* =========================================================== 2FA setup page */
nav.navbar.bg-dark { background: var(--hs-navy) !important; padding: calc(12px + var(--hs-safe-top)) 20px 12px !important; }
nav.navbar .navbar-brand { font-weight: 600; font-size: 16px; margin-left: 0; white-space: normal; }
nav.navbar .nav-link { color: #fff !important; cursor: pointer; }
nav.navbar.bg-dark + .container { padding-top: 32px; padding-bottom: calc(32px + var(--hs-safe-bottom)); }
.card-container {
  max-width: 560px;
  margin: 0 auto;
  padding: 28px !important;
  background: var(--hs-surface);
  border: 1px solid var(--hs-border) !important;
  border-radius: var(--hs-radius) !important;
  box-shadow: var(--hs-shadow) !important;
}
.card-container img.img-thumbnail { max-width: 220px; }

/* =========================================================== topbar */
#page-topbar {
  height: calc(var(--hs-topbar) + var(--hs-safe-top)) !important;
  padding-top: var(--hs-safe-top);
  background: var(--hs-surface) !important;
  box-shadow: 0 1px 0 var(--hs-border) !important;
}
.navbar-header { height: var(--hs-topbar); padding: 0 calc(12px + var(--hs-safe-right)) 0 0; }
.navbar-brand-box {
  background: var(--hs-navy) !important;
  height: var(--hs-topbar);
  display: flex;
  align-items: center;
  padding: 0 0 0 calc(18px + var(--hs-safe-left)) !important;
}
.hs-brand { display: flex; align-items: center; gap: 10px; color: #fff !important; text-decoration: none; min-width: 0; }
.hs-brand img { border-radius: 50%; background: #fff; flex: 0 0 auto; }
.hs-brand-name { font-weight: 700; font-size: 16px; letter-spacing: .04em; white-space: nowrap; }
body.vertical-collpsed .hs-brand-name { display: none; }
.navbar-header .header-item {
  height: var(--hs-topbar);
  color: var(--hs-text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: none !important;
}
.hs-menu-btn { font-size: 24px; padding: 0 16px !important; }
.hs-lang img { border-radius: 2px; }
.hs-account { gap: 10px !important; padding: 0 6px !important; }
.hs-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: var(--hs-blue-light);
  color: var(--hs-blue-dark);
  font-weight: 700;
}
.hs-account-text { flex-direction: column; align-items: flex-start; line-height: 1.2; text-align: left; }
.hs-account-name { font-weight: 600; font-size: 13.5px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hs-account-role { font-size: 12px; color: var(--hs-muted); }

/* =========================================================== sidebar */
.vertical-menu {
  background: var(--hs-navy) !important;
  top: calc(var(--hs-topbar) + var(--hs-safe-top)) !important;
  bottom: 0 !important;
  padding-left: var(--hs-safe-left);
  box-shadow: none !important;
}
#sidebar-menu { padding: 8px 0 calc(24px + var(--hs-safe-bottom)) !important; }
#sidebar-menu .menu-title {
  color: #8399bb !important;
  font-size: 11px !important;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 18px 26px 6px !important;
}
#sidebar-menu ul li a {
  display: flex !important;
  align-items: center;
  gap: 2px;
  color: #cdd7e6 !important;
  font-size: 14px !important;
  font-weight: 500;
  margin: 1px 12px;
  padding: 9px 14px !important;
  border-radius: var(--hs-radius-sm);
  transition: background-color .15s ease, color .15s ease;
}
#sidebar-menu ul li a i { color: #8fa6c7 !important; min-width: 28px; font-size: 18px !important; transition: color .15s ease; }
#sidebar-menu ul li a:hover { background: rgba(255, 255, 255, .08); color: #fff !important; }
#sidebar-menu ul li a:hover i { color: #fff !important; }
#sidebar-menu ul li.mm-active > a,
#sidebar-menu ul li a.active { background: var(--hs-blue) !important; color: #fff !important; }
#sidebar-menu ul li.mm-active > a i,
#sidebar-menu ul li a.active i { color: #fff !important; }
.vertical-menu .simplebar-scrollbar::before { background: rgba(255, 255, 255, .35); }
body.vertical-collpsed #sidebar-menu .menu-title { display: none; }
body.vertical-collpsed #sidebar-menu ul li a { margin: 2px 6px; }

/* phones/tablets: off-canvas drawer; a transition (not a keyframe) so a second tap reverses it mid-way */
@media (max-width: 991.98px) {
  .vertical-menu {
    display: block !important;
    width: min(280px, 84vw) !important;
    transform: translateX(-105%);
    transition: transform .28s var(--hs-ease);
    z-index: 1003 !important;
  }
  body.sidebar-enable .vertical-menu { transform: none; box-shadow: var(--hs-shadow-lg) !important; }
  body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 1002;
    background: rgba(11, 37, 69, .45);
    opacity: 0;
    pointer-events: none;
    transition: opacity .28s var(--hs-ease);
  }
  body.sidebar-enable::after { opacity: 1; pointer-events: auto; }
  .navbar-brand-box { width: auto !important; padding: 0 4px 0 calc(12px + var(--hs-safe-left)) !important; background: transparent !important; }
  .hs-brand { color: var(--hs-navy) !important; }
  .hs-brand-name { font-size: 15px; }
  .main-content { margin-left: 0 !important; }
}
@media (max-width: 420px) {
  .hs-brand-name { display: none; }
}

/* =========================================================== page frame */
.main-content { overflow: visible; }
.page-content {
  background: var(--hs-bg);
  padding: calc(var(--hs-topbar) + var(--hs-safe-top) + 24px) calc(12px + var(--hs-safe-right)) calc(72px + var(--hs-safe-bottom)) calc(12px + var(--hs-safe-left)) !important;
}
.page-title-box { padding-bottom: 16px !important; display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; justify-content: space-between; }
.page-title-box h4 { color: var(--hs-navy); font-weight: 700; font-size: 18px !important; text-transform: none !important; letter-spacing: 0; margin: 0; }
.page-title-box .breadcrumb { margin: 0; font-size: 13px; }
.footer {
  background: var(--hs-surface);
  border-top: 1px solid var(--hs-border);
  color: var(--hs-muted);
  height: auto !important;
  padding: 14px calc(16px + var(--hs-safe-right)) calc(14px + var(--hs-safe-bottom)) calc(16px + var(--hs-safe-left)) !important;
}

/* =========================================================== cards */
.card {
  background: var(--hs-surface);
  border: 1px solid var(--hs-border);
  border-radius: var(--hs-radius);
  box-shadow: var(--hs-shadow);
  margin-bottom: 20px;
}
.card-body { padding: 20px; overflow-x: auto; }
.card-title { font-weight: 600; color: var(--hs-navy); }
@media (max-width: 575.98px) {
  .card-body { padding: 16px; }
  .container-fluid { padding-left: 4px; padding-right: 4px; }
}

/* =========================================================== buttons */
.btn {
  border-radius: var(--hs-radius-sm);
  font-weight: 500;
  min-height: 40px;
  padding: 8px 16px;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.btn-sm { min-height: 32px; padding: 4px 10px; }
.btn-primary { background: var(--hs-blue); border-color: var(--hs-blue); }
.btn-primary:hover, .btn-primary:focus, .btn-primary:active { background: var(--hs-blue-dark) !important; border-color: var(--hs-blue-dark) !important; }
.btn-success { background: var(--hs-green); border-color: var(--hs-green); }
.btn-danger { background: var(--hs-red); border-color: var(--hs-red); }
.btn-light { background: #f1f4f8; border-color: var(--hs-border); color: var(--hs-text); }
/* a submitted button waits for its API calls (set by jwt.interceptor) */
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  animation: hs-spin .7s linear infinite;
}
.btn-light.is-loading::after, .btn-outline-secondary.is-loading::after { border-color: rgba(29, 36, 51, .25); border-top-color: var(--hs-text); }
@keyframes hs-spin { to { transform: rotate(360deg); } }
/* inline icon buttons in the templates (excel export etc.) get a real hit area */
.card-body > .row i.mdi[style*="cursor"], .card-body i.mdi-file-excel-outline { display: inline-flex; padding: 4px; cursor: pointer; }

/* =========================================================== dropdowns */
.dropdown-menu {
  border: 1px solid var(--hs-border);
  border-radius: var(--hs-radius);
  box-shadow: var(--hs-shadow-lg);
  padding: 6px;
  min-width: 190px;
  animation: none;
}
.dropdown-item { border-radius: 6px; padding: 9px 12px; font-size: 14px; }
.dropdown-item:hover, .dropdown-item:focus { background: var(--hs-blue-light); color: var(--hs-blue-dark); }
.dropdown-item.text-danger:hover { background: #fdecec; color: var(--hs-red) !important; }
.dropdown-header { padding: 8px 12px; }
.table .dropdown-toggle.card-drop { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; }
.table .dropdown-toggle.card-drop:hover { background: #eef2f7; }

/* =========================================================== forms */
.form-control, .form-select, .custom-select, select.form-control {
  min-height: 42px;
  border-radius: var(--hs-radius-sm);
  border-color: #cfd6e0;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control:focus, .form-select:focus {
  border-color: var(--hs-blue);
  box-shadow: 0 0 0 3px rgba(21, 101, 192, .16);
}
.form-label, label { font-weight: 500; color: var(--hs-text); }
/* error states: Bootstrap .is-invalid, plus any touched invalid reactive-form control */
.form-control.is-invalid, .form-select.is-invalid,
.form-control.ng-invalid.ng-touched:not(.ng-untouched), .form-select.ng-invalid.ng-touched {
  border-color: var(--hs-red) !important;
  background-color: #fffafa;
}
.form-control.is-invalid:focus, .form-control.ng-invalid.ng-touched:focus { box-shadow: 0 0 0 3px rgba(217, 54, 54, .15); }
.invalid-feedback { display: block; color: var(--hs-red); font-size: 12.5px; margin-top: 6px; }
.invalid-feedback:empty { display: none; }
.alert { border-radius: var(--hs-radius-sm); }
/* the form's main action stays reachable while scrolling a long form on phones */
@media (max-width: 767.98px) {
  .card form button[type="submit"]:not(.btn-sm) {
    position: sticky;
    bottom: calc(12px + var(--hs-safe-bottom));
    z-index: 5;
    width: 100%;
    box-shadow: 0 8px 20px rgba(16, 24, 40, .18);
  }
  .form-control, .form-select { font-size: 16px; } /* no iOS zoom on focus */
}

/* =========================================================== tables */
.table { color: var(--hs-text); margin-bottom: 0; }
.table > thead th {
  background: #f7f9fc;
  color: var(--hs-muted);
  font-weight: 600;
  font-size: 12.5px;
  white-space: nowrap;
  border-bottom: 1px solid var(--hs-border);
}
.table > :not(caption) > * > * { padding: 12px 14px; vertical-align: middle; }
.table-hover > tbody > tr:hover > *, .table > tbody > tr:hover > * { background: #f8fafd; }
.table td img { border-radius: 8px; object-fit: cover; max-height: 64px; width: auto; }
/* the list pages cap their table at 500px with its own scrollbar: on phones that is a second scroller */
#demoDW { max-height: calc(100vh - 290px) !important; max-height: calc(100dvh - 290px) !important; }
@media (max-width: 767.98px) {
  #demoDW { max-height: none !important; }
  .table > :not(caption) > * > * { padding: 10px 12px; font-size: 13.5px; }
}
.table-responsive { -webkit-overflow-scrolling: touch; }

/* skeleton rows while a list is loading, an empty state once it has loaded with nothing */
.card-body:has(.table tbody:empty)::after {
  content: 'No records to show';
  display: block;
  padding: 28px 12px;
  text-align: center;
  color: var(--hs-muted);
}
body.http-busy .card-body:has(.table tbody:empty)::after {
  /* four solid skeleton rows: one bar plus three box-shadow copies 44px apart */
  content: '';
  height: 32px;
  margin: 8px 0 140px;
  padding: 0;
  border-radius: var(--hs-radius-sm);
  background: var(--hs-skeleton);
  box-shadow: 0 44px 0 var(--hs-skeleton), 0 88px 0 var(--hs-skeleton), 0 132px 0 var(--hs-skeleton);
  animation: hs-pulse 1.2s ease-in-out infinite;
}
@keyframes hs-pulse { 50% { opacity: .55; } }

/* =========================================================== misc components */
.badge { font-weight: 600; border-radius: 6px; padding: 5px 8px; }
.pagination .page-link { border-radius: 6px; margin: 0 2px; min-width: 36px; text-align: center; }
.modal-content { border: 0; border-radius: var(--hs-radius); box-shadow: var(--hs-shadow-lg); }
.swal2-popup { border-radius: var(--hs-radius) !important; }
.swal2-styled.swal2-confirm { background-color: var(--hs-blue) !important; border-radius: var(--hs-radius-sm) !important; }
.nav-tabs .nav-link, .nav-pills .nav-link { border-radius: var(--hs-radius-sm); }

/* =========================================================== page transitions */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; animation-timing-function: var(--hs-ease); }
#page-topbar { view-transition-name: hs-topbar; }
.vertical-menu { view-transition-name: hs-sidebar; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* delete / create-admin controls are superadmin-only (body class set in layout.component.ts) */
.limited-admin .sa-only {
  display: none !important;
}
