/* ───────────────────────────────────────────────────────────────────────
   COTEMAR BRAND TOKENS + LAYOUT UTILITIES
   Single source of truth for all UI styling across mocks.
   Include via <link rel="stylesheet" href="./static/shared.css"> in every page.
   No Tailwind. Layout utilities are appended at the bottom.
   ─────────────────────────────────────────────────────────────────────── */

:root {
  /* Primary palette */
  --cotemar-navy:        #0A2540;
  --cotemar-navy-deep:   #061829;
  --cotemar-steel:       #1E3A5F;

  /* Brand accents */
  --cotemar-teal:        #0E7C7B;
  --cotemar-teal-light:  #19A2A1;

  /* Status colors */
  --cotemar-amber:       #E89F3C;
  --cotemar-coral:       #D9532B;

  /* Neutrals */
  --cotemar-sand:        #F5F1E8;
  --cotemar-white:       #FFFFFF;
  --cotemar-fog:         #F4F6F9;
  --cotemar-graphite:    #2D3748;
  --cotemar-slate:       #64748B;
  --cotemar-border:      #E2E8F0;

  /* Spacing scale (matches Tailwind defaults but explicit for consistency) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;

  /* Border radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(10, 37, 64, 0.04);
  --shadow-md: 0 2px 8px rgba(10, 37, 64, 0.06);
  --shadow-lg: 0 8px 24px rgba(10, 37, 64, 0.10);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', Menlo, Consolas, monospace;
}

/* ──────────────────────────────────────────────────────────────
   Base
   ────────────────────────────────────────────────────────────── */

body {
  font-family: var(--font-sans);
  background: var(--cotemar-fog);
  color: var(--cotemar-graphite);
  -webkit-font-smoothing: antialiased;
}

/* ──────────────────────────────────────────────────────────────
   Header / branding (use on every mock)
   ────────────────────────────────────────────────────────────── */

.cotemar-header {
  background: var(--cotemar-navy);
  color: var(--cotemar-white);
  padding: var(--space-3) var(--space-6);
  border-bottom: 1px solid var(--cotemar-steel);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cotemar-header__brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.cotemar-header__logo {
  height: 32px;
  width: auto;
}

.cotemar-header__title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--cotemar-teal-light);
}

.cotemar-header__subtitle {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
}

/* Demo watermark — honesty badge */
.cotemar-demo-badge {
  background: rgba(232, 159, 60, 0.15);
  color: var(--cotemar-amber);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid rgba(232, 159, 60, 0.3);
}

/* ──────────────────────────────────────────────────────────────
   Cards
   ────────────────────────────────────────────────────────────── */

.cotemar-card {
  background: var(--cotemar-white);
  border: 1px solid var(--cotemar-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-6);
}

.cotemar-card--compact {
  padding: var(--space-4);
}

.cotemar-card__header {
  border-bottom: 1px solid var(--cotemar-border);
  padding-bottom: var(--space-3);
  margin-bottom: var(--space-4);
}

/* ──────────────────────────────────────────────────────────────
   Buttons
   ────────────────────────────────────────────────────────────── */

.cotemar-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 10px 20px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.cotemar-btn--primary {
  background: var(--cotemar-teal);
  color: var(--cotemar-white);
}
.cotemar-btn--primary:hover {
  background: var(--cotemar-teal-light);
  box-shadow: var(--shadow-md);
}
.cotemar-btn--primary:active {
  transform: scale(0.98);
}

.cotemar-btn--secondary {
  background: var(--cotemar-white);
  color: var(--cotemar-navy);
  border-color: var(--cotemar-steel);
}
.cotemar-btn--secondary:hover {
  background: var(--cotemar-fog);
}

.cotemar-btn--danger {
  background: var(--cotemar-coral);
  color: var(--cotemar-white);
}

/* ──────────────────────────────────────────────────────────────
   Status badges (priority, status)
   ────────────────────────────────────────────────────────────── */

.cotemar-badge {
  display: inline-block;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

.cotemar-badge--low      { background: #EFF3F8; color: var(--cotemar-slate); }
.cotemar-badge--medium   { background: #FEF3E8; color: var(--cotemar-amber); }
.cotemar-badge--high     { background: #FCE5DA; color: var(--cotemar-coral); }
.cotemar-badge--critical { background: var(--cotemar-coral); color: white; }

.cotemar-badge--open        { background: #EFF3F8; color: var(--cotemar-slate); }
.cotemar-badge--in-progress { background: #FEF3E8; color: var(--cotemar-amber); }
.cotemar-badge--resolved    { background: #E0F2F1; color: var(--cotemar-teal); }
.cotemar-badge--escalated   { background: var(--cotemar-coral); color: white; }

.cotemar-badge--agent {
  background: linear-gradient(135deg, var(--cotemar-teal) 0%, var(--cotemar-navy) 100%);
  color: var(--cotemar-white);
  font-weight: 700;
}

/* ──────────────────────────────────────────────────────────────
   Kanban columns (UNUS)
   ────────────────────────────────────────────────────────────── */

.kanban-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-6);
}

.kanban-column {
  background: var(--cotemar-white);
  border: 1px solid var(--cotemar-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  min-height: 600px;
}

.kanban-column__header {
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--cotemar-border);
  background: var(--cotemar-fog);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kanban-column__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--cotemar-navy);
  letter-spacing: 0.02em;
}

.kanban-column__count {
  background: var(--cotemar-steel);
  color: var(--cotemar-white);
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  min-width: 24px;
  text-align: center;
}

.kanban-column__body {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* ──────────────────────────────────────────────────────────────
   Ticket cards
   ────────────────────────────────────────────────────────────── */

.ticket-card {
  background: var(--cotemar-white);
  border: 1px solid var(--cotemar-border);
  border-left-width: 4px;
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  transition: all 0.3s ease;
  cursor: default;
}
.ticket-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.ticket-card--low      { border-left-color: var(--cotemar-slate); }
.ticket-card--medium   { border-left-color: var(--cotemar-amber); }
.ticket-card--high     { border-left-color: var(--cotemar-coral); }
.ticket-card--critical { border-left-color: var(--cotemar-coral); border-left-width: 5px; }

.ticket-card__id {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--cotemar-slate);
}

.ticket-card__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--cotemar-navy);
  line-height: 1.35;
  margin: var(--space-2) 0;
}

.ticket-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-2);
  font-size: 12px;
  color: var(--cotemar-slate);
}

/* ──────────────────────────────────────────────────────────────
   Event severity (Dynatrace)
   ────────────────────────────────────────────────────────────── */

.event-card {
  background: var(--cotemar-white);
  border: 1px solid var(--cotemar-border);
  border-left-width: 4px;
  border-radius: var(--radius-md);
  padding: var(--space-4);
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}
.event-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--cotemar-teal);
}

.event-card--high     { border-left-color: var(--cotemar-amber); }
.event-card--critical { border-left-color: var(--cotemar-coral); }
.event-card--medium   { border-left-color: var(--cotemar-slate); }

/* ──────────────────────────────────────────────────────────────
   Layout utilities (Tailwind-equivalents; only what we use)
   ────────────────────────────────────────────────────────────── */

.max-w-7xl { max-width: 80rem; }
.mx-auto   { margin-left: auto; margin-right: auto; }

.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.px-6 { padding-left: var(--space-6); padding-right: var(--space-6); }
.py-3 { padding-top: var(--space-3); padding-bottom: var(--space-3); }
.py-6 { padding-top: var(--space-6); padding-bottom: var(--space-6); }
.py-8 { padding-top: var(--space-8); padding-bottom: var(--space-8); }
.py-12 { padding-top: var(--space-12); padding-bottom: var(--space-12); }
.pt-6 { padding-top: var(--space-6); }
.pb-12 { padding-bottom: var(--space-12); }
.p-4 { padding: var(--space-4); }

.mt-1 { margin-top: var(--space-1); }
.mt-8 { margin-top: var(--space-8); }
.mt-12 { margin-top: var(--space-12); }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-6 { margin-bottom: var(--space-6); }

.flex       { display: flex; }
.inline-flex { display: inline-flex; }
.block      { display: block; }
.hidden     { display: none; }

.items-center  { align-items: center; }
.items-start   { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }

.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

.grid { display: grid; }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.w-full { width: 100%; }
.w-2    { width: 8px; }
.h-2    { height: 8px; }

.rounded-full { border-radius: 9999px; }

.text-left   { text-align: left; }
.text-center { text-align: center; }

.text-xs  { font-size: 12px;  line-height: 1.4; }
.text-sm  { font-size: 14px;  line-height: 1.5; }
.text-xl  { font-size: 20px;  line-height: 1.35; }
.text-2xl { font-size: 24px;  line-height: 1.3; }

.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }

.leading-snug { line-height: 1.375; }

.space-y-8 > * + * { margin-top: var(--space-8); }

.animate-pulse {
  animation: cotemar-pulse 1.6s ease-in-out infinite;
}
@keyframes cotemar-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

/* Reset button (rehearsal only) */
.cotemar-reset-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.1);
  color: var(--cotemar-white);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}
.cotemar-reset-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--cotemar-amber);
}

/* ──────────────────────────────────────────────────────────────
   Ticket detail modal
   ────────────────────────────────────────────────────────────── */

.ticket-modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 37, 64, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--space-4);
  animation: cotemar-fade-in 0.15s ease;
}
@keyframes cotemar-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.ticket-modal__panel {
  background: var(--cotemar-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  overflow-y: auto;
  padding: var(--space-6);
  animation: cotemar-slide-up 0.2s ease;
}
@keyframes cotemar-slide-up {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.ticket-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--cotemar-border);
  padding-bottom: var(--space-3);
  margin-bottom: var(--space-4);
}

.ticket-modal__close {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--cotemar-slate);
  cursor: pointer;
  padding: 0 8px;
  line-height: 1;
}
.ticket-modal__close:hover { color: var(--cotemar-coral); }

.ticket-modal__title {
  font-size: 20px;
  font-weight: 700;
  color: var(--cotemar-navy);
  margin: 0 0 var(--space-3) 0;
  line-height: 1.3;
}

.ticket-modal__description {
  color: var(--cotemar-graphite);
  font-size: 14px;
  line-height: 1.55;
  background: var(--cotemar-fog);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--cotemar-steel);
  margin: 0 0 var(--space-4) 0;
}

.ticket-modal__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3) var(--space-6);
  margin-bottom: var(--space-6);
}
.ticket-modal__grid > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ticket-modal__label {
  font-size: 11px;
  font-weight: 700;
  color: var(--cotemar-slate);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.ticket-modal__value {
  font-size: 14px;
  color: var(--cotemar-graphite);
}

.ticket-modal__section {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--cotemar-border);
}

.ticket-modal__section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--cotemar-navy);
  letter-spacing: 0.02em;
  margin: 0 0 var(--space-3) 0;
}

.ticket-modal__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.ticket-modal__table tr { border-bottom: 1px solid var(--cotemar-border); }
.ticket-modal__table tr:last-child { border-bottom: none; }
.ticket-modal__td-key {
  padding: 8px 12px 8px 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--cotemar-slate);
  vertical-align: top;
  white-space: nowrap;
}
.ticket-modal__td-val {
  padding: 8px 0;
  color: var(--cotemar-graphite);
  word-break: break-word;
}

.ticket-modal__pre {
  background: var(--cotemar-fog);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--cotemar-navy);
  margin: 0;
  overflow-x: auto;
}

.ticket-modal__timeline {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--cotemar-border);
}

.ticket-modal__steps {
  margin: 0;
  padding-left: var(--space-6);
  font-size: 13px;
  color: var(--cotemar-graphite);
  line-height: 1.7;
}
.ticket-modal__steps code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--cotemar-fog);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  color: var(--cotemar-navy);
}
.ticket-modal__steps li {
  margin-bottom: 4px;
}
