:root {
  --bg-main: #14100a;
  --bg-card: #21190f;
  --bg-soft: #332515;

  --text-main: #fffaf0;
  --text-muted: #c0ad92;

  --accent: #f59e0b;
  --accent-hover: #d97706;

  --border: #4a3820;

  --low: #22c55e;
  --medium: #f59e0b;
  --high: #ef4444;

  --open: #38bdf8;
  --progress: #a78bfa;
  --resolved: #22c55e;

  --shadow: 0 24px 80px rgba(20, 12, 0, 0.48);

  --font-main: "Inter", sans-serif;
  --font-code: "JetBrains Mono", monospace;
}

/* RESET */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(245, 158, 11, 0.16), transparent 34rem),
    radial-gradient(circle at bottom right, rgba(239, 68, 68, 0.06), transparent 28rem),
    var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-main);
  line-height: 1.6;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-main);
  color: var(--text-main);
  outline: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

input,
select {
  min-height: 46px;
  padding: 0 14px;
}

textarea {
  resize: vertical;
  padding: 14px;
}

input::placeholder,
textarea::placeholder {
  color: #8f7c63;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.14);
}

a {
  color: inherit;
  text-decoration: none;
}

/* MATERIAL SYMBOLS */

.material-symbols-rounded {
  font-variation-settings:
    "FILL" 0,
    "wght" 500,
    "GRAD" 0,
    "opsz" 24;
}

/* LAYOUT */

.app {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}

.eyebrow {
  color: var(--accent);
  font-family: var(--font-code);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.header h1 {
  margin-top: 10px;
  font-size: clamp(2.4rem, 6vw, 4.8rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.header-text {
  max-width: 680px;
  margin-top: 18px;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.header-card {
  min-width: 220px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--bg-card);
  padding: 22px;
  box-shadow: var(--shadow);
}

.header-card .material-symbols-rounded {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 18px;
  background: var(--bg-soft);
  color: var(--accent);
  font-size: 28px;
}

.header-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.header-card strong {
  display: block;
  margin-top: 2px;
  font-size: 2rem;
  line-height: 1;
}

/* DASHBOARD */

.dashboard {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 24px;
  align-items: start;
}

.panel {
  border: 1px solid var(--border);
  border-radius: 32px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    var(--bg-card);
  padding: 24px;
  box-shadow: var(--shadow);
}

.panel-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 22px;
}

.panel-header > .material-symbols-rounded {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: var(--bg-soft);
  color: var(--accent);
  font-size: 26px;
}

.panel-header h2 {
  font-size: 1.4rem;
  line-height: 1.1;
}

.panel-header p {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* FORM */

.ticket-form {
  display: grid;
  gap: 16px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-group {
  display: grid;
  gap: 8px;
}

label {
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 700;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 20px;
  font-weight: 800;
  transition:
    transform 0.2s ease,
    background-color 0.2s ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button.primary {
  background: var(--accent);
  color: #14100a;
}

.button.primary:hover {
  background: var(--accent-hover);
}

/* FILTERS */

.tickets-panel {
  min-height: 560px;
}

.filters {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.8fr auto;
  gap: 12px;
}

.search-box {
  position: relative;
}

.search-box .material-symbols-rounded {
  position: absolute;
  top: 50%;
  left: 14px;
  color: var(--text-muted);
  font-size: 22px;
  transform: translateY(-50%);
}

.search-box input {
  padding-left: 44px;
}

/* RESET BUTTON */

.reset-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;

  min-height: 46px;
  padding: 0 14px;

  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-main);
  color: var(--text-muted);

  font-weight: 800;
  white-space: nowrap;

  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    background-color 0.2s ease;
}

.reset-button:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  color: var(--text-main);
  background: rgba(245, 158, 11, 0.08);
}

.reset-button .material-symbols-rounded {
  font-size: 19px;
  line-height: 1;
}

/* SUMMARY */

.status-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 18px;
}

.status-summary article {
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg-main);
  padding: 14px;
}

.summary-dot {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.summary-dot.open {
  background: var(--open);
}

.summary-dot.progress {
  background: var(--progress);
}

.summary-dot.resolved {
  background: var(--resolved);
}

.status-summary p {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.status-summary strong {
  display: block;
  margin-top: 2px;
  font-size: 1.5rem;
}

/* TICKET LIST */

.tickets-list {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.ticket-card {
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--bg-main);
  padding: 18px;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease;
}

.ticket-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}

.ticket-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.ticket-id {
  color: var(--accent);
  font-family: var(--font-code);
  font-size: 0.78rem;
  font-weight: 700;
}

.ticket-card h3 {
  margin-top: 6px;
  font-size: 1.12rem;
  line-height: 1.25;
}

.ticket-description {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 0.94rem;
}

.ticket-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 10px;
  background: var(--bg-soft);
  color: var(--text-muted);
  font-family: var(--font-code);
  font-size: 0.72rem;
  font-weight: 700;
}

.badge.priority-low {
  color: var(--low);
}

.badge.priority-medium {
  color: var(--medium);
}

.badge.priority-high {
  color: var(--high);
}

.badge.status-open {
  color: var(--open);
}

.badge.status-in-progress {
  color: var(--progress);
}

.badge.status-resolved {
  color: var(--resolved);
}

.ticket-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.action-button {
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--text-main);
  padding: 0 12px;
  font-size: 0.82rem;
  font-weight: 700;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.action-button:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.action-button.danger:hover {
  border-color: var(--high);
  color: var(--high);
}

/* EMPTY STATE */

.empty-state {
  display: none;
  margin-top: 24px;
  border: 1px dashed var(--border);
  border-radius: 24px;
  padding: 36px 20px;
  text-align: center;
  color: var(--text-muted);
}

.empty-state.show {
  display: block;
}

.empty-state .material-symbols-rounded {
  color: var(--accent);
  font-size: 42px;
}

.empty-state h3 {
  margin-top: 10px;
  color: var(--text-main);
}

/* FOOTER */

.footer {
  margin-top: 32px;
  padding: 24px 4px 8px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;

  color: var(--text-muted);
}

.footer p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer p a {
  color: var(--text-main);
  font-weight: 700;
  transition: color 0.2s ease;
}

.footer p a:hover {
  color: var(--accent);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;

  min-height: 36px;
  padding: 0 12px;

  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;

  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 700;

  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    background-color 0.2s ease;
}

.footer-links a:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: rgba(245, 158, 11, 0.08);
  color: var(--text-main);
}

.footer-links .material-symbols-rounded {
  font-size: 18px;
  line-height: 1;
}

/* TOAST */

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;

  display: flex;
  align-items: center;
  gap: 10px;

  max-width: min(360px, calc(100% - 32px));
  padding: 14px 16px;

  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--bg-card);
  color: var(--text-main);
  box-shadow: var(--shadow);

  opacity: 0;
  pointer-events: none;
  transform: translateY(16px);

  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast .material-symbols-rounded {
  color: var(--accent);
  font-size: 22px;
  line-height: 1;
}

.toast p {
  font-size: 0.92rem;
  font-weight: 700;
}

/* RESPONSIVE */

@media (max-width: 1050px) {
  .filters {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 950px) {
  .header {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-card {
    width: 100%;
  }

  .dashboard {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .app {
    width: min(100% - 20px, 1200px);
    padding: 28px 0;
  }

  .header h1 {
    font-size: 3rem;
  }

  .panel {
    border-radius: 24px;
    padding: 18px;
  }

  .form-row,
  .filters,
  .status-summary {
    grid-template-columns: 1fr;
  }

  .ticket-top {
    flex-direction: column;
  }

  .button,
  .reset-button {
    width: 100%;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
    padding: 24px 0 8px;
  }

  .footer-links {
    width: 100%;
  }

  .footer-links a {
    flex: 1;
  }

  .toast {
    right: 10px;
    bottom: 10px;
  }
}