/* CoreLink AI — Tech Blend Consulting LLC Unified Design System */
:root {
  --bg-deep: #050e1d;
  --bg-navy: #091930;
  --bg-card: rgba(8, 22, 43, 0.82);
  --bg-card-solid: #0b1e3a;
  --border-subtle: rgba(26, 209, 255, 0.22);
  --border-strong: rgba(26, 209, 255, 0.58);
  --cyan: #1ad1ff;
  --cyan-dark: #0099cc;
  --emerald: #2ce6a8;
  --amber: #fbbf24;
  --rose: #fb7185;
  --text-main: #f4f9ff;
  --text-muted: #9ebad6;
  --text-dim: #6f90b2;
  --radius: 12px;
  --shadow: 0 14px 34px rgba(2, 8, 18, 0.45);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-deep);
  color: var(--text-main);
  font-family: "Avenir Next", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

a {
  color: var(--cyan);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 9px;
  font-weight: 700;
  font-size: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
  font-family: inherit;
}

.btn:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #22d8ff 0%, #00a2dc 100%);
  color: #041222;
  box-shadow: 0 6px 20px rgba(26, 209, 255, 0.28);
}

.btn-primary:hover {
  box-shadow: 0 8px 26px rgba(26, 209, 255, 0.42);
}

.btn-outline {
  background: rgba(26, 209, 255, 0.08);
  color: #e6f7ff;
  border-color: rgba(26, 209, 255, 0.45);
}

.btn-outline:hover {
  background: rgba(26, 209, 255, 0.16);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.12);
}

.btn-sm {
  padding: 7px 12px;
  font-size: 12.5px;
  border-radius: 7px;
}

/* Badges / Pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: rgba(26, 209, 255, 0.13);
  border: 1px solid rgba(26, 209, 255, 0.42);
  color: #daf8ff;
}

.pill-live {
  background: rgba(44, 230, 168, 0.14);
  border-color: rgba(44, 230, 168, 0.45);
  color: #a7f3d0;
}

.pill-sandbox {
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.4);
  color: #fde68a;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  display: inline-block;
}

.dot-live {
  background: var(--emerald);
}

.dot-sandbox {
  background: var(--amber);
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.card-glow {
  border-color: var(--border-strong);
  box-shadow: 0 0 28px rgba(26, 209, 255, 0.18), var(--shadow);
}

/* Form Elements */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.field label {
  font-size: 12.5px;
  font-weight: 700;
  color: #cfe4f7;
  letter-spacing: 0.03em;
}

.input, .select, .textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(26, 209, 255, 0.28);
  background: rgba(4, 13, 27, 0.85);
  color: #ffffff;
  font-family: inherit;
  font-size: 14px;
  outline: none;
}

.input:focus, .select:focus, .textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(26, 209, 255, 0.16);
}

.textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.45;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

table.data-table th {
  text-align: left;
  padding: 11px 14px;
  background: rgba(10, 30, 58, 0.9);
  color: var(--text-muted);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--border-subtle);
}

table.data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  vertical-align: middle;
}

table.data-table tr:last-child td {
  border-bottom: none;
}

/* Status chips */
.status-chip {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
}

.status-green { background: rgba(44, 230, 168, 0.16); color: #6ee7b7; border: 1px solid rgba(44, 230, 168, 0.35); }
.status-cyan { background: rgba(26, 209, 255, 0.15); color: #7ce8ff; border: 1px solid rgba(26, 209, 255, 0.35); }
.status-amber { background: rgba(251, 191, 36, 0.15); color: #fde68a; border: 1px solid rgba(251, 191, 36, 0.35); }
.status-rose { background: rgba(251, 113, 133, 0.15); color: #fda4af; border: 1px solid rgba(251, 113, 133, 0.35); }

/* Brand Lockup */
.tb-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.tb-brand:hover {
  text-decoration: none;
}

.tb-divider {
  width: 1.5px;
  height: 28px;
  background: rgba(255, 255, 255, 0.32);
}

.tb-wordmark {
  display: flex;
  flex-direction: column;
  line-height: 1.08;
}

.tb-wordmark strong {
  font-size: 16px;
  letter-spacing: 0.06em;
  color: #ffffff;
}

.tb-wordmark strong span {
  color: var(--cyan);
}

.tb-wordmark small {
  font-size: 9px;
  letter-spacing: 0.22em;
  color: #b7d2eb;
  font-weight: 600;
  margin-top: 2px;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 9, 20, 0.78);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-box {
  width: 100%;
  max-width: 520px;
  background: #081830;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
  max-height: 92vh;
  overflow-y: auto;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #0b2447;
  border: 1px solid var(--cyan);
  color: #ffffff;
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 700;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 3000;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.code-block {
  background: #040c18;
  border: 1px solid rgba(26, 209, 255, 0.3);
  border-radius: 8px;
  padding: 12px 14px;
  font-family: Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  color: #7ee8ff;
  overflow-x: auto;
  word-break: break-all;
  white-space: pre-wrap;
  line-height: 1.55;
}

/* =========================================================================
   Universal Responsive Utilities (PC, iPad, Surface Duo, Android & iPhone)
   ========================================================================= */
.resp-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.resp-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.resp-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.resp-grid-5 {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.table-wrap {
  -webkit-overflow-scrolling: touch;
}

/* iPad Portrait & Landscape (768px - 1080px) */
@media (max-width: 1080px) {
  .resp-grid-5 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .resp-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Surface Duo (540px single / 720px), Small Tablets & Large Phones */
@media (max-width: 760px) {
  .card {
    padding: 16px;
  }
  .modal-backdrop {
    padding: 12px;
  }
  .modal-box {
    padding: 18px 16px;
    max-height: 90dvh;
  }
  .resp-grid-5,
  .resp-grid-4,
  .resp-grid-3,
  .resp-grid-2 {
    grid-template-columns: 1fr !important;
  }
  table.data-table th,
  table.data-table td {
    padding: 9px 10px;
    font-size: 12.5px;
  }
}

/* iOS & Android Phones: prevent iOS Safari auto-zoom on form input focus (requires >=16px) & 44px touch targets */
@media (max-width: 640px) {
  .input,
  .select,
  .textarea {
    font-size: 16px;
    min-height: 44px;
  }
  .btn {
    min-height: 42px;
  }
  .btn-sm {
    min-height: 36px;
    padding: 7px 11px;
  }
  .toast {
    bottom: calc(18px + env(safe-area-inset-bottom));
    max-width: calc(100vw - 24px);
    text-align: center;
  }
}

/* Dual-Screen / Foldable Spanning (Surface Duo & Galaxy Z Fold) */
@media (horizontal-viewport-segments: 2) {
  .resp-grid-2,
  .resp-grid-4 {
    column-gap: 28px;
  }
}

