/* Pindora Brand Theme with Glassmorphism */
:root {
  --brand-primary: #e93525; /* Pantone 485-C */
  --brand-dark: #242424;
  --brand-gray: #4e4e4e;
  --brand-muted: #9fa3a7;
  --brand-white: #ffffff;

  /* Light theme background tones */
  --bg-0: #f5f7fb;
  --bg-1: #f8f9fc;
  --bg-2: #ffffff;

  /* Glass for light theme */
  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(36, 36, 36, 0.08);
  --glass-highlight: linear-gradient(180deg, rgba(255,255,255,0.55), rgba(255,255,255,0.15));
  --shadow-soft: 0 12px 26px -12px rgba(18, 23, 34, 0.18);
  --shadow-glow: 0 12px 28px -12px rgba(233, 53, 37, 0.35);

  /* Stage palette (for pills) */
  --stage-0-a: #ff6b5f; --stage-0-b: #e93525;
  --stage-1-a: #23d5ab; --stage-1-b: #159f85;
  --stage-2-a: #7ad66a; --stage-2-b: #3ca34a;
  --stage-3-a: #a78bfa; --stage-3-b: #6d49e6;
  --stage-4-a: #f59e0b; --stage-4-b: #d97706;
  --stage-5-a: #60a5fa; --stage-5-b: #2563eb;
}

html, body {
  height: 100%;
}

body {
  color: var(--brand-dark);
  background:
    radial-gradient(1200px 700px at 85% -10%, rgba(233, 53, 37, 0.12), transparent 60%),
    radial-gradient(900px 550px at -10% 0%, rgba(159, 163, 167, 0.10), transparent 55%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0));
  background-attachment: fixed;
  font-family: 'Ubuntu', system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, sans-serif;
}

h1, h2, h3, h4, h5, h6, .navbar-brand {
  font-family: 'Montserrat', system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, sans-serif;
  letter-spacing: 0.2px;
}

.text-muted, .text-secondary { color: var(--brand-gray) !important; }

/* Brand Buttons */
.btn-primary {
  border: 0;
  color: #fff;
  background: linear-gradient(180deg, #ff6b5f, var(--brand-primary));
  box-shadow: var(--shadow-glow);
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-outline-secondary { color: var(--brand-dark); border-color: rgba(36,36,36,0.25); }

/* Glass Nav */
.glass-nav {
  background: rgba(255, 255, 255, 0.65) !important;
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid rgba(36,36,36,0.08);
  position: sticky; top: 0; z-index: 20;
}
.glass-nav::after {
  content: "";
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(110deg, transparent 0%, rgba(255,255,255,0.6) 12%, transparent 22%);
  transform: translateX(-100%);
  animation: navShine 7s ease-in-out infinite;
}
.navbar .nav-link { color: var(--brand-dark) !important; }
.navbar .nav-link:hover { color: var(--brand-primary) !important; }

/* Content spacing */
.page-wrap { padding: 16px; }

.section-eyebrow {
  letter-spacing: 0.18em;
  font-weight: 700;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-header .page-title {
  margin-bottom: 0;
}

.page-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.page-actions .btn {
  flex: 0 0 auto;
}

.page-action-form {
  margin: 0;
}

.navbar-search {
  min-width: 260px;
}

.navbar-search input {
  min-width: 0;
}

@media (max-width: 991.98px) {
  .navbar-search {
    width: 100%;
    margin: 0 0 1rem 0;
  }
}

@media (max-width: 767.98px) {
  .page-header {
    flex-direction: column;
    align-items: stretch;
  }
  .page-actions {
    width: 100%;
  }
  .page-actions .btn,
  .page-actions form {
    flex: 1 1 140px;
    width: 100%;
  }
  .page-actions form .btn {
    width: 100%;
  }
}

/* Pipeline board */
.pipeline-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  padding: 8px 8px 24px 8px;
}

.glass-surface {
  position: relative;
  background: var(--glass-bg);
  -webkit-backdrop-filter: saturate(160%) blur(22px);
  backdrop-filter: saturate(160%) blur(22px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
}
.glass-surface::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--glass-highlight);
  mask: linear-gradient(#000, transparent 35%);
  pointer-events: none;
}
.glass-surface::after {
  content: "";
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,0.45) 12%, transparent 22%);
  transform: translateX(-120%);
  animation: glassShine 6.5s ease-in-out infinite;
}

.pipeline-header {
  font-weight: 700;
  padding: 10px 12px 0 12px;
  color: var(--brand-dark);
  letter-spacing: 0.3px;
}

.pipeline-cards { padding: 8px 8px 12px 8px; min-height: 200px; }

.deal-card {
  background: rgba(255,255,255,0.65);
  border: 1px solid rgba(36,36,36,0.08);
  border-radius: 14px;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
  box-shadow: 0 6px 20px -12px rgba(18, 23, 34, 0.22);
}
.deal-card:hover {
  transform: translateY(-2px);
  border-color: rgba(233,53,37,0.35);
  box-shadow: var(--shadow-glow);
}
.deal-card .card-body { color: var(--brand-dark); }

.pipeline-column.drag-over { outline: 2px dashed rgba(233,53,37,0.6); }

.stage-total { font-weight: 700; color: var(--brand-gray); }

.quarter-badge {
  display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px;
  background: linear-gradient(135deg, rgba(233,53,37,0.18), rgba(233,53,37,0.35));
  color: var(--brand-dark); font-weight: 700; font-size: .8rem;
  border: 1px solid rgba(233,53,37,0.25);
}

/* Tables and forms on glass */
.table { color: var(--brand-dark); }
.table thead th { color: #3d3f45; border-bottom-color: rgba(36,36,36,0.08); }
.table-striped > tbody > tr:nth-of-type(odd) > * { background: rgba(36,36,36,0.02); }

.card { background: rgba(255,255,255,0.7); border: 1px solid rgba(36,36,36,0.08); color: var(--brand-dark); }
.card-header { background: transparent; border-bottom: 1px solid rgba(36,36,36,0.08); color: #3d3f45; }

.form-control, .form-select, textarea {
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(36,36,36,0.12);
  color: var(--brand-dark);
}
.form-control:focus, .form-select:focus, textarea:focus {
  border-color: rgba(233,53,37,0.35);
  box-shadow: 0 0 0 0.2rem rgba(233,53,37,0.22);
}

.alert { border: 1px solid rgba(36,36,36,0.1); }
.alert-success { background: rgba(61, 220, 132, 0.12); color: #0f6; border-color: rgba(61,220,132,0.35); }
.alert-danger  { background: rgba(233, 53, 37, 0.12); color: #b30000; border-color: rgba(233,53,37,0.35); }

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.btn-icon .action-label {
  font-weight: 600;
  font-size: 0.9rem;
}

.contact-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
  padding: 1.5rem;
}

.contact-hero-info {
  flex: 1 1 240px;
}

.hero-field + .hero-field {
  margin-top: 0.75rem;
}

.hero-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: var(--brand-muted);
}

.hero-value {
  font-size: 1rem;
  font-weight: 600;
}

.contact-hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.contact-hero-actions .btn {
  min-width: 160px;
}

.contact-table table {
  border-collapse: separate;
  border-spacing: 0;
}

.contact-table tbody tr td:last-child {
  text-align: right;
}

.contact-quick-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.mobile-action-bar {
  display: none;
}

@media (max-width: 767.98px) {
  .contact-hero {
    flex-direction: column;
    align-items: flex-start;
  }
  .contact-hero-actions {
    width: 100%;
    justify-content: stretch;
  }
  .contact-hero-actions .btn {
    flex: 1 1 140px;
  }
  .mobile-action-bar {
    position: sticky;
    bottom: 0;
    z-index: 30;
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding: 0.75rem 1rem 1rem;
    background: rgba(255,255,255,0.92);
    box-shadow: 0 -12px 24px rgba(18,23,34,0.12);
  }
  .mobile-action-bar .btn {
    flex: 1 1 auto;
  }
}

@media (max-width: 576px) {
  .btn-icon .action-label {
    display: inline;
  }
  .contact-table thead {
    display: none;
  }
  .contact-table table,
  .contact-table tbody,
  .contact-table tr,
  .contact-table td {
    display: block;
    width: 100%;
  }
  .contact-table tbody tr {
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: 18px;
    background: rgba(255,255,255,0.82);
    border: 1px solid rgba(36,36,36,0.08);
    box-shadow: 0 14px 30px -20px rgba(18,23,34,0.45);
  }
  .contact-table td {
    border: 0;
    padding: 0.35rem 0;
  }
  .contact-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brand-muted);
    margin-bottom: 0.1rem;
  }
  .contact-table tbody tr td:last-child {
    text-align: left;
  }
  .contact-quick-actions {
    width: 100%;
    justify-content: stretch;
  }
  .contact-quick-actions .btn {
    flex: 1 1 45%;
  }
}

@media (min-width: 577px) {
  .btn-icon .action-label {
    display: none;
  }
}

/* Glass footer gradient edge */
.page-wrap::after {
  content: "";
  position: fixed;
  left: 0; right: 0; bottom: 0; height: 120px;
  background: linear-gradient(180deg, transparent, rgba(36,36,36,0.12));
  pointer-events: none;
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  .deal-card { transition: none; }
}

/* Stage pill styles */
.stage-pill {
  display: inline-flex; align-items: center; gap: 8px;
  color: #fff; font-weight: 700; letter-spacing: .2px;
  border-radius: 999px; padding: 6px 12px; font-size: 0.9rem;
  box-shadow: 0 6px 18px -10px rgba(0,0,0,0.25);
}
.stage-color-0 { background: linear-gradient(135deg, var(--stage-0-a), var(--stage-0-b)); }
.stage-color-1 { background: linear-gradient(135deg, var(--stage-1-a), var(--stage-1-b)); }
.stage-color-2 { background: linear-gradient(135deg, var(--stage-2-a), var(--stage-2-b)); }
.stage-color-3 { background: linear-gradient(135deg, var(--stage-3-a), var(--stage-3-b)); }
.stage-color-4 { background: linear-gradient(135deg, var(--stage-4-a), var(--stage-4-b)); }
.stage-color-5 { background: linear-gradient(135deg, var(--stage-5-a), var(--stage-5-b)); }

/* Animations */
@keyframes glassShine {
  0% { transform: translateX(-120%); }
  50% { transform: translateX(120%); }
  100% { transform: translateX(120%); }
}
@keyframes navShine {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(100%); }
  100% { transform: translateX(100%); }
}
