:root {
  --cream: #FFEFD3;
  --navy: #001B2E;
  --steel: #294C60;
  --bg: #F7F7F5;
  --card: #FFFFFF;
  --border: #E7E4DD;
  --text: var(--navy);
  --text-muted: #5b6b75;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0, 27, 46, 0.06), 0 4px 16px rgba(0, 27, 46, 0.04);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a { color: var(--steel); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px 60px;
}

/* --- Nav --- */
.topbar {
  background: var(--navy);
  color: #fff;
}
.topbar-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  letter-spacing: 0.2px;
}
.brand:hover { text-decoration: none; }
.nav-links { display: flex; align-items: center; gap: 18px; font-size: 14px; }
.nav-links a { color: var(--cream); opacity: 0.9; }
.nav-links a:hover { opacity: 1; text-decoration: none; }
.nav-links form { display: inline; }
.nav-links button.link-btn {
  background: none; border: none; color: var(--cream); opacity: 0.9;
  font-size: 14px; cursor: pointer; padding: 0; font-family: inherit;
}
.nav-links button.link-btn:hover { opacity: 1; text-decoration: underline; }

.project-switcher select {
  background: rgba(255,255,255,0.08);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 14px;
}

/* --- Page header --- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 32px 0 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-header h1 { font-size: 22px; margin: 0; }
.page-header .sub { color: var(--text-muted); font-size: 14px; margin-top: 4px; }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--steel);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.btn:hover { background: var(--navy); text-decoration: none; color: #fff; }
.btn.secondary {
  background: transparent;
  color: var(--steel);
  border: 1px solid var(--border);
}
.btn.secondary:hover { background: var(--card); color: var(--navy); }
.btn.danger { background: #b3261e; }
.btn.danger:hover { background: #8c1d17; }

/* --- Cards / list --- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.ticket-list { display: flex; flex-direction: column; gap: 10px; }
.ticket-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.ticket-row:hover { box-shadow: var(--shadow); transform: translateY(-1px); text-decoration: none; }
.ticket-number { font-family: ui-monospace, Menlo, monospace; color: var(--text-muted); font-size: 13px; min-width: 68px; }
.ticket-title { flex: 1; color: var(--text); font-weight: 500; min-width: 200px; }
.ticket-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* --- Badges / pills --- */
.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.type-BUG { background: #fde2e1; color: #8c1d17; }
.type-EVOL { background: var(--cream); color: #7a4b00; }
.type-FEATURE { background: #dbe9e3; color: #1c5e42; }

.status-todo { background: #eceff1; color: #55636b; }
.status-doing { background: #dfe9f0; color: var(--steel); }
.status-done { background: #dcf3e3; color: #1c7a3f; }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

/* --- Forms --- */
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
input[type=text], input[type=email], input[type=number], input[type=file], textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}
textarea { resize: vertical; min-height: 90px; }
.field { margin-bottom: 16px; }
.form-actions { display: flex; gap: 10px; margin-top: 20px; }
.error-msg { background: #fde2e1; color: #8c1d17; padding: 10px 14px; border-radius: 8px; font-size: 14px; margin-bottom: 16px; }
.hint { color: var(--text-muted); font-size: 13px; margin-top: 6px; }

/* --- Modal --- */
.modal-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0, 27, 46, 0.45);
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: #fff;
  border-radius: 14px;
  padding: 28px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal h2 { margin-top: 0; }

/* --- Login --- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy);
}
.auth-card {
  background: #fff;
  border-radius: 14px;
  padding: 40px;
  width: 100%;
  max-width: 380px;
}
.auth-card h1 { font-size: 20px; margin: 0 0 4px; }
.auth-card .sub { color: var(--text-muted); font-size: 14px; margin-bottom: 24px; }
.auth-brand { text-align: center; margin-bottom: 24px; font-weight: 700; color: var(--cream); }

/* --- Ticket detail --- */
.ticket-detail-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.ticket-body { margin: 20px 0; white-space: pre-wrap; color: var(--text); }
.ticket-image { max-width: 100%; border-radius: 10px; border: 1px solid var(--border); margin-top: 16px; }
.meta-block { display: flex; gap: 24px; flex-wrap: wrap; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-muted); }
.status-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); }

table.report { width: 100%; border-collapse: collapse; }
table.report th, table.report td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 14px; }
table.report th { color: var(--text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
