:root {
  --gerry-bg: #f4f7fb;
  --gerry-surface: #ffffff;
  --gerry-surface-soft: #f8fafc;
  --gerry-border: #e3e8ef;
  --gerry-text: #1f2937;
  --gerry-muted: #6b7280;
  --gerry-primary: #2563eb;
  --gerry-primary-dark: #1d4ed8;
  --gerry-danger: #dc3545;
  --gerry-radius: 14px;
  --gerry-radius-sm: 10px;
  --gerry-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  --gerry-shadow-hover: 0 12px 32px rgba(15, 23, 42, 0.09);
}

html {
  font-size: 14px;
  position: relative;
  min-height: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--gerry-bg);
  color: var(--gerry-text);
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
}

.gerry-app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}


/* ============================================
   HEADER
   ============================================ */

.gerry-header {
  position: sticky;
  top: 0;
  z-index: 1030;
}

.navbar-gerry {
  min-height: 78px;
  padding: 0;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--gerry-border);
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.05);
  backdrop-filter: blur(12px);
}

.gerry-navbar-container {
  max-width: 1680px;
  margin: 0 auto;
  padding: 0.65rem 1.4rem;
}

.gerry-brand {
  padding: 0;
  margin-right: 1.5rem;
}

.gerry-logo {
  display: block;
  width: auto;
  height: 65px;
  max-width: 230px;
}

.gerry-main-nav {
  gap: 0.2rem;
}

.navbar-gerry .nav-link {
  white-space: nowrap;
  padding: 0.62rem 0.75rem !important;
  border-radius: 9px;
  color: #475569;
  font-size: 0.93rem;
  font-weight: 600;
  transition:
    color 0.15s ease,
    background-color 0.15s ease;
}

.navbar-gerry .nav-link:hover,
.navbar-gerry .nav-link:focus {
  color: var(--gerry-primary);
  background: #eff6ff;
}

.navbar-gerry .dropdown-menu {
  margin-top: 0.5rem;
  padding: 0.55rem;
  min-width: 210px;
  border: 1px solid var(--gerry-border);
  border-radius: 12px;
  box-shadow: var(--gerry-shadow);
}

.navbar-gerry .dropdown-item {
  white-space: nowrap;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  color: #475569;
  font-size: 0.92rem;
  font-weight: 500;
}

.navbar-gerry .dropdown-item:hover,
.navbar-gerry .dropdown-item:focus {
  color: var(--gerry-primary);
  background: #eff6ff;
}

.gerry-toggler {
  border: 1px solid var(--gerry-border);
  border-radius: 10px;
}

.gerry-navbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: 1rem;
}

.gerry-search {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 280px;
}

.gerry-search .form-control {
  min-width: 190px;
}

.gerry-user-box {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  white-space: nowrap;
  padding-left: 1rem;
  border-left: 1px solid var(--gerry-border);
}

.gerry-user-info {
  text-align: right;
  line-height: 1.15;
}

.gerry-user-name {
  max-width: 185px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.88rem;
  font-weight: 700;
  color: #334155;
}

.gerry-user-role {
  margin-top: 0.2rem;
  color: var(--gerry-muted);
  font-size: 0.76rem;
}


/* ============================================
   MAIN
   ============================================ */

.gerry-main {
  flex: 1;
  padding: 1.7rem 0 2.5rem;
}

.gerry-content-container {
  width: 100%;
  max-width: 1580px;
  margin: 0 auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: #1e293b;
  font-weight: 700;
  letter-spacing: -0.015em;
}

h1 {
  font-size: clamp(1.75rem, 2vw, 2.25rem);
}

.text-muted {
  color: var(--gerry-muted) !important;
}


/* ============================================
   CARDS
   ============================================ */

.card {
  border: 1px solid var(--gerry-border);
  border-radius: var(--gerry-radius);
  background: var(--gerry-surface);
  box-shadow: var(--gerry-shadow);
}

.card.shadow-sm {
  box-shadow: var(--gerry-shadow) !important;
}

.card-header {
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--gerry-border);
  border-top-left-radius: var(--gerry-radius) !important;
  border-top-right-radius: var(--gerry-radius) !important;
  background: var(--gerry-surface-soft);
  color: #334155;
}

.card-body {
  padding: 1.1rem;
}


/* ============================================
   BUTTONS
   ============================================ */

.btn {
  border-radius: 9px;
  font-weight: 600;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    background-color 0.12s ease,
    border-color 0.12s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  border-color: var(--gerry-primary);
  background: var(--gerry-primary);
}

.btn-primary:hover,
.btn-primary:focus {
  border-color: var(--gerry-primary-dark);
  background: var(--gerry-primary-dark);
}

.btn-success,
.btn-danger,
.btn-warning,
.btn-secondary,
.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-danger {
  border-radius: 9px;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.15);
}


/* ============================================
   FORMS
   ============================================ */

.form-control,
.form-select {
  min-height: 42px;
  border: 1px solid #d8dee8;
  border-radius: 9px;
  background-color: #fff;
}

textarea.form-control {
  min-height: auto;
}

.form-control:focus,
.form-select:focus {
  border-color: #93b4ff;
}

.form-label {
  margin-bottom: 0.4rem;
  color: #475569;
  font-size: 0.9rem;
  font-weight: 600;
}

.form-check-input {
  border-color: #b9c3d0;
}

.form-check-input:checked {
  border-color: var(--gerry-primary);
  background-color: var(--gerry-primary);
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
  text-align: start;
}


/* ============================================
   TABLES
   ============================================ */

.table-responsive {
  overflow: hidden;
  border: 1px solid var(--gerry-border);
  border-radius: var(--gerry-radius);
  background: #fff;
  box-shadow: var(--gerry-shadow);
}

.table {
  margin-bottom: 0;
}

.table > :not(caption) > * > * {
  padding: 0.82rem 0.9rem;
  border-bottom-color: #edf1f5;
  vertical-align: middle;
}

.table thead th {
  border-bottom: 1px solid var(--gerry-border);
  background: #f8fafc;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.table-hover > tbody > tr:hover > * {
  background-color: #f8fbff;
}


/* ============================================
   BADGES / ALERTS
   ============================================ */

.badge {
  padding: 0.5em 0.72em;
  border-radius: 999px;
  font-weight: 600;
}

.alert {
  border: 1px solid transparent;
  border-radius: 11px;
}

.alert-info {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1e40af;
}

.alert-warning {
  border-color: #fde68a;
  background: #fffbeb;
}

.alert-danger {
  border-color: #fecaca;
  background: #fef2f2;
}


/* ============================================
   PAGINATION / LIST GROUP
   ============================================ */

.pagination .page-link {
  color: var(--gerry-primary);
}

.page-link {
  border-color: var(--gerry-border);
}

.list-group-item {
  border-color: var(--gerry-border);
}


/* ============================================
   FOOTER
   ============================================ */

.gerry-footer {
  padding: 1.1rem 0;
  border-top: 1px solid var(--gerry-border);
  background: #fff;
  color: var(--gerry-muted);
  font-size: 0.82rem;
}


/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1199.98px) {

  .navbar-gerry {
    min-height: 70px;
  }

  .gerry-navbar-container {
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
  }

  .gerry-logo {
    height: 55px;
  }

  .navbar-collapse {
    padding-top: 1rem;
    padding-bottom: 0.35rem;
  }

  .gerry-main-nav {
    gap: 0;
  }

  .navbar-gerry .nav-link {
    padding: 0.65rem 0.75rem !important;
  }

  .gerry-navbar-actions {
    flex-direction: column;
    align-items: stretch;
    margin-top: 1rem;
    margin-left: 0;
    padding-top: 1rem;
    border-top: 1px solid var(--gerry-border);
  }

  .gerry-search {
    width: 100%;
    min-width: 0;
  }

  .gerry-search .form-control {
    min-width: 0;
  }

  .gerry-user-box {
    justify-content: space-between;
    padding-left: 0;
    border-left: 0;
  }

  .gerry-user-info {
    text-align: left;
  }

}

@media (max-width: 767.98px) {

  .gerry-content-container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .gerry-main {
    padding-top: 1.15rem;
  }

  .card-body,
  .card-header {
    padding-left: 0.9rem;
    padding-right: 0.9rem;
  }

  .btn {
    min-height: 40px;
  }

  .table-responsive {
    border-radius: 10px;
  }

}


/* ============================================
   DASHBOARD GERRY
   ============================================ */

.gerry-page-header {
  padding: 0.3rem 0 0.2rem;
}

.gerry-page-header h1 {
  margin-bottom: 0.35rem;
}

.gerry-kpi-grid {
  row-gap: 1rem;
}

.gerry-kpi-card {
  position: relative;
  overflow: hidden;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease;
}

.gerry-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--gerry-shadow-hover) !important;
}

.gerry-kpi-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: #cbd5e1;
}

.gerry-kpi-warning::before {
  background: #f59e0b;
}

.gerry-kpi-danger::before {
  background: #dc2626;
}

.gerry-kpi-card .card-body {
  padding: 1.2rem 1.25rem;
}

.gerry-kpi-label {
  margin-bottom: 0.7rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.gerry-kpi-value {
  margin-bottom: 0.75rem;
  font-size: clamp(2rem, 3vw, 2.6rem);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.gerry-dashboard-section {
  overflow: hidden;
}

.gerry-dashboard-section > .card-body {
  padding: 1.25rem;
}

.gerry-section-title {
  font-size: 1.08rem;
  font-weight: 750;
}

.gerry-dashboard-section .table-responsive {
  box-shadow: none;
}

.gerry-dashboard-section .alert:last-child,
.gerry-dashboard-section p:last-child {
  margin-bottom: 0;
}

@media (max-width: 767.98px) {
  .gerry-page-header {
    align-items: flex-start !important;
    flex-direction: column;
    gap: 1rem;
  }

  .gerry-page-header > .d-flex {
    width: 100%;
  }

  .gerry-page-header .btn {
    flex: 1 1 auto;
  }

  .gerry-dashboard-section > .card-body {
    padding: 1rem;
  }
}


/* ============================================
   CLIENTI / AZIENDE
   ============================================ */

.gerry-eyebrow {
  margin-bottom: 0.35rem;
  color: var(--gerry-primary);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gerry-client-kpis {
  margin-top: -0.1rem;
}

.gerry-mini-kpi {
  box-shadow: var(--gerry-shadow);
}

.gerry-mini-kpi .card-body {
  padding: 1rem 1.1rem;
}

.gerry-mini-kpi-label {
  margin-bottom: 0.25rem;
  color: #64748b;
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.gerry-mini-kpi-value {
  color: #1e293b;
  font-size: 1.85rem;
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.gerry-list-card {
  overflow: hidden;
}

.gerry-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
}

.gerry-table-search {
  width: min(100%, 360px);
}

.gerry-table-search .form-control {
  min-height: 38px;
}

.gerry-table-wrap {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.gerry-data-table thead th {
  white-space: nowrap;
}

.gerry-client-row {
  transition: background-color 0.12s ease;
}

.gerry-client-name {
  color: #1e293b;
  font-weight: 750;
}

.gerry-client-name:hover {
  color: var(--gerry-primary);
}

.gerry-contact-stack {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.gerry-empty-state {
  padding: 2.8rem 1.2rem;
  text-align: center;
}

.gerry-empty-state-title {
  margin-bottom: 0.35rem;
  color: #334155;
  font-size: 1.05rem;
  font-weight: 750;
}

.gerry-client-header {
  padding-bottom: 0.35rem;
}

.gerry-detail-card {
  overflow: hidden;
}

.gerry-detail-card-header {
  display: flex;
  align-items: center;
  min-height: 50px;
}

.gerry-detail-card .card-body strong {
  color: #475569;
  font-size: 0.86rem;
  font-weight: 700;
}

.gerry-detail-card .card-body strong + div {
  margin-top: 0.2rem;
  color: #1e293b;
}

.gerry-section-heading {
  margin-bottom: 0;
  font-size: 1.25rem;
}

.gerry-detail-card .table-responsive {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

@media (max-width: 767.98px) {
  .gerry-list-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .gerry-table-search {
    width: 100%;
  }

  .gerry-client-header {
    align-items: stretch !important;
  }

  .gerry-client-header > a,
  .gerry-client-header > .btn {
    width: 100%;
  }
}
