:root {
  --color-bg: #f4f6f9;
  --color-surface: #ffffff;
  --color-text: #1a2233;
  --color-text-muted: #5b6472;
  --color-border: #e2e6ec;
  --color-primary: #1d5fd6;
  --color-primary-dark: #14449e;
  --color-accent: #0fb98d;
  --color-danger: #d63b3b;
  --color-warning: #d68f1d;
  --radius: 10px;
  --shadow: 0 2px 8px rgba(20, 30, 60, 0.06);
  --shadow-lg: 0 8px 24px rgba(20, 30, 60, 0.10);
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a:hover {
  text-decoration: underline;
}

img, svg {
  max-width: 100%;
}

/* ---------- Header / Nav ---------- */

.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.nav {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--color-text);
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--color-text-muted);
  font-weight: 500;
  font-size: 0.95rem;
}

.nav-links a.active,
.nav-links a:hover {
  color: var(--color-primary);
  text-decoration: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--color-text);
}

@media (max-width: 780px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0.5rem 0;
    display: none;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links a {
    display: block;
    padding: 0.75rem 1.5rem;
  }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.3rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-primary-dark);
}

.btn-secondary {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-secondary:hover {
  background: rgba(29, 95, 214, 0.08);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}

/* ---------- Layout helpers ---------- */

main {
  flex: 1;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.page-header {
  padding: 2.5rem 0 1.5rem;
}

.page-header h1 {
  margin: 0 0 0.35rem;
  font-size: 1.9rem;
}

.page-header p {
  color: var(--color-text-muted);
  margin: 0;
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

/* ---------- Hero (home page) ---------- */

.hero {
  background: radial-gradient(circle at 20% 20%, rgba(29, 95, 214, 0.08), transparent 55%), var(--color-bg);
  padding: 4.5rem 0 3.5rem;
}

.hero-inner {
  max-width: 640px;
}

.hero h1 {
  font-size: 2.6rem;
  line-height: 1.15;
  margin: 0 0 1rem;
}

.hero p {
  font-size: 1.1rem;
  color: var(--color-text-muted);
  margin: 0 0 1.75rem;
}

.hero-actions {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  padding: 3rem 0 4rem;
}

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

.feature-card h3 {
  margin: 0.75rem 0 0.4rem;
  font-size: 1.05rem;
}

.feature-card p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.92rem;
}

.feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(29, 95, 214, 0.1);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

/* ---------- Auth (login page) ---------- */

.auth-wrap {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
}

.auth-card {
  width: 100%;
  max-width: 380px;
}

.auth-card h1 {
  font-size: 1.5rem;
  margin: 0 0 0.3rem;
}

.auth-card > p {
  color: var(--color-text-muted);
  margin: 0 0 1.5rem;
  font-size: 0.92rem;
}

.field {
  margin-bottom: 1.1rem;
}

.field label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
  color: var(--color-text);
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: 2px solid rgba(29, 95, 214, 0.35);
  outline-offset: 1px;
  border-color: var(--color-primary);
}

.field-note {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  text-align: center;
}

.form-message {
  margin-top: 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-size: 0.88rem;
  display: none;
}

.form-message.visible {
  display: block;
}

.form-message.success {
  background: rgba(15, 185, 141, 0.12);
  color: #0a7a5c;
}

.form-message.error {
  background: rgba(214, 59, 59, 0.1);
  color: var(--color-danger);
}

/* ---------- Dashboard layout ---------- */

.dashboard {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2rem;
  padding: 2rem 0 3rem;
}

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

.sidebar {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem;
  align-self: start;
}

.sidebar-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.sidebar-nav a {
  display: block;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  color: var(--color-text-muted);
  font-weight: 500;
  font-size: 0.92rem;
}

.sidebar-nav a.active,
.sidebar-nav a:hover {
  background: rgba(29, 95, 214, 0.08);
  color: var(--color-primary);
  text-decoration: none;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
  margin-bottom: 1.75rem;
}

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

.stat-card .stat-label {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
}

.stat-card .stat-value {
  font-size: 1.9rem;
  font-weight: 700;
}

.stat-card .stat-sub {
  font-size: 0.8rem;
  color: var(--color-accent);
  margin-top: 0.25rem;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.9rem;
}

.section-title h2 {
  font-size: 1.15rem;
  margin: 0;
}

/* ---------- Tables ---------- */

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

thead th {
  text-align: left;
  color: var(--color-text-muted);
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 0.6rem 0.7rem;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

tbody td {
  padding: 0.75rem 0.7rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: none;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.badge-open {
  background: rgba(214, 59, 59, 0.1);
  color: var(--color-danger);
}

.badge-progress {
  background: rgba(214, 143, 29, 0.12);
  color: var(--color-warning);
}

.badge-resolved {
  background: rgba(15, 185, 141, 0.12);
  color: #0a7a5c;
}

/* ---------- Tickets page ---------- */

.tickets-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.new-ticket-form {
  display: none;
  margin-bottom: 1.5rem;
}

.new-ticket-form.visible {
  display: block;
}

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

@media (max-width: 640px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* ---------- Contact page ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2rem;
  padding-bottom: 4rem;
}

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

.contact-info-item {
  display: flex;
  gap: 0.85rem;
  margin-bottom: 1.4rem;
}

.contact-info-item .feature-icon {
  flex-shrink: 0;
}

.contact-info-item h3 {
  margin: 0 0 0.2rem;
  font-size: 0.98rem;
}

.contact-info-item p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  padding: 1.5rem 0;
  margin-top: 2rem;
}

.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}
