:root {
  --brand-primary: #1f6feb;
  --brand-primary-hover: #195bcc;
  --brand-success: #2ea043;
  --brand-success-hover: #22863a;
  --brand-muted: #e9eef7;
}

body {
  padding-top: 20px;
  background: linear-gradient(160deg, #f7f9fe 0%, #eef2fb 40%, #f6f8fd 100%);
  min-height: 100vh;
}

.card {
  margin-top: 20px;
  border: none;
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.table th, .table td {
  vertical-align: middle;
}

form {
  margin-bottom: 20px;
}

.navbar-nav .nav-item .nav-link {
    padding-left: 20px;
    padding-right: 20px;
}

.navbar-brand {
    font-weight: bold;
}

.navbar-glass {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(170%) blur(20px);
  box-shadow: 0 18px 32px rgba(15, 23, 42, 0.12);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  padding: 0.75rem 1.5rem;
}

.navbar-brand .brand-text {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #0f172a;
}

.navbar-glass .nav-link {
  color: #1f2937 !important;
  font-weight: 500;
  transition: color 0.2s ease, transform 0.15s ease;
}

.navbar-glass .nav-link:hover,
.navbar-glass .nav-link:focus {
  color: var(--brand-primary) !important;
  transform: translateY(-1px);
}

.content-wrapper {
  max-width: 1380px;
  margin: 0 auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

@media (max-width: 767.98px) {
  .content-wrapper {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* Flash messages - compact, auto-dismissing, stacked under navbar */
.flash-stack.flash-stack--top-center{
  position: fixed;
  top: 16px;                 /* push a bit below the top edge / navbar */
  left: 50%;
  transform: translateX(-50%);
  z-index: 1080;             /* above page content */
  width: min(640px, calc(100% - 32px));
  pointer-events: none;      /* clicks pass through except alerts */
}
.flash-stack .alert{
  pointer-events: auto;      /* keep close button clickable */
  border-radius: .85rem;
  box-shadow: 0 18px 30px rgba(15, 23, 42, 0.12);
  border: 1px solid rgba(15, 23, 42, 0.06);
  padding: .75rem .9rem;
  backdrop-filter: saturate(140%) blur(2px);
}
.alert-elevated .bi{ font-size: 1rem; line-height: 1; }

/* Add a subtle left accent bar per variant */
.alert-elevated { position: relative; }
.alert-elevated::before{
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; border-radius: .5rem 0 0 .5rem;
}
.alert-success.alert-elevated::before { background: #28a745; }
.alert-danger.alert-elevated::before  { background: #dc3545; }
.alert-warning.alert-elevated::before { background: #ffc107; }
.alert-info.alert-elevated::before    { background: #17a2b8; }
.alert-secondary.alert-elevated::before { background: #6c757d; }


/* Keep URL text from exploding the layout */
.ig-url-cell .ig-url-text {
  max-width: 640px;
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ig-url-cell .input-group-sm .form-control { min-width: 480px; }

/* Prevent action buttons from wrapping */
td.text-nowrap { white-space: nowrap; }

/* Prevent long URLs from breaking layout */
.fb-url-cell .fb-url-text,
.ig-url-cell .ig-url-text {
  max-width: 640px;
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fb-url-cell .input-group-sm .form-control,
.ig-url-cell .input-group-sm .form-control { min-width: 480px; }

/* Uniform compact icon buttons */
.table td, .table th { vertical-align: middle !important; }
td.text-nowrap { white-space: nowrap; }

/* Status summary */
.status-summary {
  border: none;
  background-color: transparent;
}

.status-summary .card-body {
  padding-left: 0;
  padding-right: 0;
  background: transparent;
}

.status-tile {
  min-width: 150px;
  padding: 1rem 1.35rem;
  border-radius: 18px;
  margin: 0.35rem 0.6rem;
  flex: 1 1 150px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06), 0 12px 25px rgba(15, 23, 42, 0.08);
}

.status-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #516079;
  margin-bottom: 0.25rem;
}

.status-value {
  font-size: 1.8rem;
  font-weight: 600;
  color: #111827;
}

.table-striped tbody tr {
  transition: background-color 0.2s ease;
}

.table-striped tbody tr:hover {
  background-color: rgba(31, 111, 235, 0.08);
}

.bg-success-soft {
  background: linear-gradient(135deg, rgba(46,160,67,0.12), rgba(46,160,67,0.04));
}

.bg-secondary-soft {
  background: linear-gradient(135deg, rgba(107,114,128,0.12), rgba(107,114,128,0.04));
}

.bg-danger-soft {
  background: linear-gradient(135deg, rgba(220,53,69,0.12), rgba(220,53,69,0.04));
}

.bg-primary-soft {
  background: linear-gradient(135deg, rgba(31,111,235,0.12), rgba(31,111,235,0.04));
}

@media (max-width: 767.98px) {
  .status-summary .card-body {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  .status-tile {
    flex: 1 1 100%;
  }
}
/* --- Buttons & Pills --- */
.btn-primary {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
  box-shadow: 0 6px 12px rgba(31, 111, 235, 0.25);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--brand-primary-hover);
  border-color: var(--brand-primary-hover);
  color: #fff;
}

.btn-success {
  background-color: var(--brand-success);
  border-color: var(--brand-success);
  color: #fff;
  box-shadow: 0 6px 12px rgba(34, 134, 58, 0.2);
}

.btn-success:hover,
.btn-success:focus {
  background-color: var(--brand-success-hover);
  border-color: var(--brand-success-hover);
  color: #fff;
}

.btn-outline-primary {
  color: var(--brand-primary);
  border-color: rgba(31, 111, 235, 0.35);
  background-color: rgba(31, 111, 235, 0.08);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  background-color: rgba(31, 111, 235, 0.18);
  border-color: rgba(31, 111, 235, 0.45);
  color: var(--brand-primary);
}

.btn-outline-secondary {
  color: #344054;
  border-color: rgba(52, 64, 84, 0.35);
  background-color: rgba(52, 64, 84, 0.08);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
  background-color: rgba(52, 64, 84, 0.18);
  border-color: rgba(52, 64, 84, 0.45);
}

.btn-light {
  background-color: #f5f7fb;
  border-color: rgba(15, 23, 42, 0.08);
  color: #1f2937;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.btn-light:hover,
.btn-light:focus {
  background-color: #e6ebf6;
  border-color: rgba(15, 23, 42, 0.15);
  transform: translateY(-1px);
}

.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
}

.btn-group .btn {
  margin-right: 6px;
  border-radius: 10px !important;
}

.nav-pills .nav-link {
  border-radius: 999px;
  padding: 0.5rem 1.25rem;
  color: #46556b;
  background-color: transparent;
  border: 1px solid transparent;
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.nav-pills .nav-link.active,
.nav-pills .nav-link:hover {
  background-color: rgba(31, 111, 235, 0.12);
  color: var(--brand-primary);
  border-color: rgba(31, 111, 235, 0.25);
  box-shadow: 0 6px 14px rgba(31, 111, 235, 0.15);
}

.entry-search-wrapper {
  width: 100%;
  max-width: 320px;
}

.entry-search-group .input-group-text {
  background-color: rgba(31, 111, 235, 0.08);
  border-right: 0;
  color: var(--brand-primary);
}

.entry-search-group .form-control {
  border-left: 0;
}

.entry-search-group .form-control:focus {
  box-shadow: 0 0 0 0.2rem rgba(31, 111, 235, 0.15);
}
