/* ==========================================================================
   SCRUTINY GLOBAL - DASHBOARD SAAS STYLESHEET
   Brand Identity: Deep Navy #0D2040 & Cyan #27BED6
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Poppins:wght@500;600;700&display=swap');

:root {
  --pm-navy-dark: #07101e;
  --pm-navy: #0d2040;
  --pm-navy-2: #132b52;
  --pm-blue: #0877d9;
  --pm-cyan: #20bfe0;
  --pm-green: #0d9f75;
  --pm-amber: #b7791f;
  --pm-red: #c83737;
  --pm-slate-50: #f6f8fb;
  --pm-slate-100: #eef3f8;
  --pm-slate-200: #dbe5ef;
  --pm-slate-300: #c6d3e1;
  --pm-slate-500: #64748b;
  --pm-slate-700: #334155;
  --pm-slate-900: #0f172a;
  --font-heading: 'Poppins', sans-serif;
  --font-body: 'Inter', sans-serif;
  --shadow-xs: 0 1px 2px rgba(13, 32, 64, 0.06);
  --shadow-sm: 0 8px 22px rgba(13, 32, 64, 0.08);
  --shadow-md: 0 16px 40px rgba(13, 32, 64, 0.12);
  --radius-sm: 6px;
  --radius-md: 8px;
}

*, *::before, *::after {
  box-sizing: border-box !important;
}

html,
body {
  min-height: 100%;
  margin: 0;
  padding: 0;
  background:
    linear-gradient(180deg, #eef5fb 0, var(--pm-slate-50) 220px),
    var(--pm-slate-50) !important;
  color: var(--pm-slate-700) !important;
  font-family: var(--font-body) !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
}

#app {
  min-height: 100vh;
}

main.py-4 {
  padding-top: 26px !important;
  padding-bottom: 38px !important;
}

/* Navbar */
.dashboard-navbar.navbar-dark.bg-black,
.dashboard-navbar.navbar-dark.bg-navy {
  background: linear-gradient(90deg, var(--pm-navy-dark), var(--pm-navy)) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 32px rgba(7, 16, 30, 0.18);
  min-height: 74px;
  padding: 0 !important;
}

.dashboard-navbar-inner {
  min-height: 74px;
  padding-left: 30px !important;
  padding-right: 30px !important;
}

.navbar-brand-dashboard {
  align-items: center;
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
  display: inline-flex;
  padding: 6px 12px !important;
}

.brand-logo-dashboard {
  display: block;
  height: 42px;
  max-width: min(292px, 58vw);
  object-fit: contain;
  width: auto;
}

.navbar-toggler {
  border-color: rgba(255, 255, 255, 0.28) !important;
  padding: 6px 9px !important;
}

.nav-link {
  align-items: center;
  color: #ffffff !important;
  display: inline-flex;
  font-family: var(--font-heading);
  font-weight: 600;
  min-height: 44px;
  transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.nav-link:hover,
.nav-link:focus {
  color: #e9fbff !important;
}

.nav-login-link,
.account-toggle {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-md);
  gap: 9px;
  letter-spacing: 0;
  min-height: 42px;
  padding: 7px 12px !important;
  text-transform: none;
}

.account-toggle:hover,
.account-toggle:focus,
.nav-login-link:hover,
.nav-login-link:focus {
  background: rgba(32, 191, 224, 0.15);
  border-color: rgba(32, 191, 224, 0.38);
}

.account-avatar {
  align-items: center;
  background: rgba(32, 191, 224, 0.18);
  border: 1px solid rgba(32, 191, 224, 0.35);
  border-radius: 50%;
  color: var(--pm-cyan);
  display: inline-flex;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.account-name {
  display: inline-block;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

.account-menu {
  border: 1px solid var(--pm-slate-200) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-md) !important;
  min-width: 210px;
  padding: 7px !important;
}

.account-menu .dropdown-item {
  align-items: center;
  border-radius: var(--radius-sm);
  color: var(--pm-slate-700);
  display: flex;
  font-size: 0.9rem;
  font-weight: 600;
  gap: 10px;
  padding: 9px 10px;
}

.account-menu .dropdown-item:hover,
.account-menu .dropdown-item:focus {
  background: var(--pm-slate-100);
  color: var(--pm-navy);
}

.account-menu .dropdown-divider {
  margin: 6px 0;
}

/* Page Shell */
.dashboard-shell {
  max-width: 1540px;
  padding-left: 28px !important;
  padding-right: 28px !important;
}

.dashboard-page-header {
  align-items: flex-end;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.dashboard-title-block {
  min-width: 0;
}

.dashboard-kicker,
.filter-eyebrow,
.table-eyebrow {
  color: var(--pm-blue);
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-bottom: 5px;
  text-transform: uppercase;
}

.dashboard-title-block h1 {
  align-items: center;
  color: var(--pm-slate-900);
  display: flex;
  font-family: var(--font-heading);
  font-size: clamp(1.32rem, 2vw, 1.75rem);
  font-weight: 700;
  gap: 10px;
  letter-spacing: 0;
  line-height: 1.25;
  margin: 0;
}

.dashboard-title-block h1 i {
  color: var(--pm-blue);
  font-size: 1.18rem;
}

.dashboard-title-block p {
  color: var(--pm-slate-500);
  font-size: 0.92rem;
  margin: 7px 0 0;
}

.dashboard-breadcrumb .breadcrumb {
  background: transparent;
  margin: 0;
  padding: 0;
}

.dashboard-breadcrumb .breadcrumb-item {
  color: var(--pm-slate-500);
  font-size: 0.82rem;
  font-weight: 600;
}

.dashboard-breadcrumb a {
  color: var(--pm-blue) !important;
}

/* Filter Card & Controls */
.filter-card,
.card-modern {
  background: #ffffff !important;
  border: 1px solid var(--pm-slate-200) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-sm) !important;
  max-width: 100%;
  overflow: hidden;
  width: 100%;
}

.filter-card {
  margin-bottom: 18px !important;
}

.filter-card-header,
.table-card-header {
  align-items: center;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  border-bottom: 1px solid var(--pm-slate-200);
  display: flex;
  justify-content: space-between;
  padding: 15px 18px 13px;
}

.panel-hint,
.record-count {
  align-items: center;
  background: var(--pm-slate-100);
  border: 1px solid var(--pm-slate-200);
  border-radius: 999px;
  color: var(--pm-slate-500);
  display: inline-flex;
  font-size: 0.76rem;
  font-weight: 700;
  min-height: 28px;
  padding: 5px 11px;
  white-space: nowrap;
}

.record-count {
  background: rgba(8, 119, 217, 0.08);
  border-color: rgba(8, 119, 217, 0.16);
  color: var(--pm-blue);
}

.filter-card-header h2,
.table-card-header h2 {
  color: var(--pm-slate-900);
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
  margin: 0;
}

.filter-card .card-body,
.survey-table-card .card-body {
  padding: 0 !important;
}

.filter-grid {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(140px, 0.82fr) minmax(150px, 0.9fr) minmax(150px, 1fr) minmax(145px, 0.88fr) minmax(145px, 0.88fr) minmax(188px, auto);
  padding: 16px 18px 18px;
}

.filter-field {
  min-width: 0;
}

.filter-field label {
  color: var(--pm-slate-700);
  display: block;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.form-control-modern {
  background-color: #ffffff !important;
  border: 1px solid var(--pm-slate-300) !important;
  border-radius: var(--radius-sm) !important;
  color: var(--pm-slate-900) !important;
  font-size: 0.88rem !important;
  height: 40px !important;
  padding: 7px 10px !important;
  transition: border-color 0.16s ease, box-shadow 0.16s ease !important;
  width: 100%;
}

.form-control-modern:focus {
  border-color: var(--pm-blue) !important;
  box-shadow: 0 0 0 3px rgba(8, 119, 217, 0.14) !important;
}

.filter-actions {
  display: grid;
  gap: 8px;
  grid-auto-flow: column;
}

.btn-toolbar-action,
.btn-delete-record {
  align-items: center !important;
  border-radius: var(--radius-sm) !important;
  display: inline-flex !important;
  font-weight: 700 !important;
  gap: 8px;
  justify-content: center !important;
  letter-spacing: 0;
  white-space: nowrap;
}

.btn-toolbar-action {
  min-height: 40px !important;
  padding: 8px 14px !important;
}

.btn-toolbar-action i,
.btn-delete-record i,
.account-menu .dropdown-item i {
  flex: 0 0 auto;
  line-height: 1;
}

.btn-primary {
  background: var(--pm-blue) !important;
  border: 1px solid var(--pm-blue) !important;
  box-shadow: 0 8px 18px rgba(8, 119, 217, 0.18) !important;
  color: #ffffff !important;
}

.btn-primary:hover,
.btn-primary:focus {
  background: #066cc5 !important;
  border-color: #066cc5 !important;
  box-shadow: 0 10px 22px rgba(8, 119, 217, 0.24) !important;
}

.btn-success {
  background: #0d9f75 !important;
  border: 1px solid #0d9f75 !important;
  box-shadow: 0 8px 18px rgba(13, 159, 117, 0.16) !important;
  color: #ffffff !important;
}

.btn-success:hover,
.btn-success:focus {
  background: #0a8864 !important;
  border-color: #0a8864 !important;
}

/* Table */
.survey-table-card {
  box-shadow: 0 12px 34px rgba(13, 32, 64, 0.09) !important;
}

.table-scroll-frame {
  border: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  scrollbar-color: var(--pm-slate-300) transparent;
  scrollbar-width: thin;
}

.table-scroll-frame::-webkit-scrollbar {
  height: 9px;
}

.table-scroll-frame::-webkit-scrollbar-thumb {
  background: var(--pm-slate-300);
  border-radius: 999px;
}

.table-scroll-frame::-webkit-scrollbar-track {
  background: transparent;
}

.table-modern {
  margin-bottom: 0 !important;
  min-width: 1040px;
  table-layout: fixed !important;
  width: 100% !important;
}

.table-modern .col-serial { width: 68px; }
.table-modern .col-username { width: 180px; }
.table-modern .col-project { width: 148px; }
.table-modern .col-status { width: 150px; }
.table-modern .col-ip { width: 150px; }
.table-modern .col-country { width: 190px; }
.table-modern .col-created { width: 176px; }
.table-modern .col-action { width: 104px; }

.table-modern thead th {
  background: linear-gradient(180deg, var(--pm-navy-2), var(--pm-navy)) !important;
  border: 0 !important;
  border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
  font-family: var(--font-heading);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 13px 14px !important;
  position: sticky;
  text-transform: uppercase;
  top: 0;
  white-space: nowrap !important;
  z-index: 1;
}

.table-modern tbody td {
  border-color: var(--pm-slate-200) !important;
  color: var(--pm-slate-700);
  font-size: 0.86rem !important;
  height: 54px;
  padding: 10px 14px !important;
  text-overflow: ellipsis;
  vertical-align: middle !important;
  white-space: nowrap !important;
}

.table-modern tbody tr:nth-child(odd) {
  background: #ffffff;
}

.table-modern tbody tr:nth-child(even) {
  background: #f9fbfd;
}

.table-modern tbody tr:hover {
  background-color: #edf8fc !important;
}

.survey-user {
  color: var(--pm-slate-900) !important;
  font-weight: 700;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-chip,
.country-chip {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--pm-slate-200);
  border-radius: var(--radius-sm);
  color: var(--pm-slate-900);
  display: inline-flex;
  font-size: 0.8rem;
  font-weight: 700;
  max-width: 100%;
  min-height: 26px;
  overflow: hidden;
  padding: 4px 8px;
  text-overflow: ellipsis;
}

.country-chip {
  color: var(--pm-slate-700);
  font-weight: 650;
}

.ip-cell code {
  background: #eef4f9;
  border: 1px solid var(--pm-slate-200);
  border-radius: 5px;
  color: #31506d;
  font-size: 0.8rem;
  padding: 3px 6px;
}

.badge-pill-custom {
  align-items: center;
  border-radius: var(--radius-sm) !important;
  display: inline-flex;
  font-size: 0.7rem !important;
  font-weight: 800 !important;
  gap: 5px;
  letter-spacing: 0.04em;
  min-height: 25px;
  padding: 4px 8px !important;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-completed {
  background-color: rgba(13, 159, 117, 0.11) !important;
  border: 1px solid rgba(13, 159, 117, 0.24) !important;
  color: #087f5f !important;
}

.badge-terminated {
  background-color: rgba(200, 55, 55, 0.1) !important;
  border: 1px solid rgba(200, 55, 55, 0.22) !important;
  color: var(--pm-red) !important;
}

.badge-quotafull {
  background-color: rgba(183, 121, 31, 0.12) !important;
  border: 1px solid rgba(183, 121, 31, 0.24) !important;
  color: var(--pm-amber) !important;
}

.btn-delete-record {
  background: #ffffff !important;
  border: 1px solid rgba(200, 55, 55, 0.25) !important;
  color: var(--pm-red) !important;
  font-size: 0.76rem !important;
  line-height: 1.2;
  min-height: 30px;
  padding: 6px 9px !important;
}

.btn-delete-record:hover,
.btn-delete-record:focus {
  background: rgba(200, 55, 55, 0.08) !important;
  border-color: rgba(200, 55, 55, 0.42) !important;
  color: #a92323 !important;
}

.empty-state-cell {
  color: var(--pm-slate-500) !important;
  font-weight: 600;
  padding: 38px 16px !important;
  text-align: center;
}

.empty-state-cell i {
  color: var(--pm-slate-300);
  display: block;
  font-size: 1.65rem;
  margin-bottom: 10px;
}

.table-card-footer {
  background: #ffffff;
  border-top: 1px solid var(--pm-slate-200);
  padding: 10px 14px;
  text-align: right;
}

.table-card-footer .pagination {
  justify-content: flex-end;
  margin-bottom: 0;
}

.table-card-footer .page-link {
  border-color: var(--pm-slate-200);
  color: var(--pm-navy);
  font-size: 0.84rem;
  font-weight: 700;
}

.table-card-footer .page-item.active .page-link {
  background-color: var(--pm-blue);
  border-color: var(--pm-blue);
}

.dashboard-footer {
  background: #ffffff;
  border-top: 1px solid var(--pm-slate-200);
  color: var(--pm-slate-500);
  font-size: 0.86rem;
  margin-top: 42px;
  padding: 22px 16px;
  text-align: center;
}

.dashboard-footer strong {
  color: var(--pm-navy);
}

.auth-brand-logo {
  max-height: 78px;
  max-width: min(360px, 100%);
  object-fit: contain;
}

@media (max-width: 1199.98px) {
  .filter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .filter-actions {
    grid-column: span 3;
    grid-template-columns: repeat(2, minmax(0, 180px));
    justify-content: end;
  }
}

@media (max-width: 991.98px) {
  .dashboard-navbar-inner {
    padding-left: 18px !important;
    padding-right: 18px !important;
  }

  .brand-logo-dashboard {
    height: 36px;
    max-width: 62vw;
  }

  .dashboard-page-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
  }
}

@media (max-width: 767.98px) {
  main.py-4 {
    padding-top: 18px !important;
  }

  .dashboard-shell {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  .dashboard-navbar-inner {
    min-height: 66px;
  }

  .dashboard-navbar .navbar-collapse {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    margin-top: 10px;
    padding: 10px 0 12px;
  }

  .dashboard-account-nav,
  .dashboard-account-nav .nav-item,
  .dashboard-account-nav .account-toggle,
  .dashboard-account-nav .nav-login-link {
    align-items: stretch !important;
    width: 100%;
  }

  .account-toggle,
  .nav-login-link {
    justify-content: flex-start;
  }

  .account-menu {
    margin-top: 8px;
    width: 100%;
  }

  .dashboard-title-block h1 {
    align-items: flex-start;
    font-size: 1.24rem;
  }

  .dashboard-title-block p {
    font-size: 0.84rem;
  }

  .filter-card-header,
  .table-card-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
    padding: 13px 14px 11px;
  }

  .panel-hint,
  .record-count {
    border-radius: var(--radius-sm);
    width: 100%;
  }

  .filter-grid {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .filter-actions {
    grid-column: auto;
    grid-template-columns: 1fr;
  }

  .btn-toolbar-action {
    width: 100%;
  }

  .table-modern {
    min-width: 940px;
  }

  .table-card-footer {
    text-align: left;
  }

  .table-card-footer .pagination {
    justify-content: flex-start;
  }
}

@media (max-width: 420px) {
  .dashboard-navbar-inner {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .navbar-brand-dashboard {
    padding: 5px 8px !important;
  }

  .brand-logo-dashboard {
    height: 31px;
    max-width: 66vw;
  }
}
