* {
  box-sizing: border-box;
}

:root {
  --blue: #0755b7;
  --blue-dark: #063777;
  --orange: #f46a2b;
  --navy: #0f2745;
  --background: #f4f7fb;
  --border: #dbe4ef;
  --text: #17263a;
  --muted: #64748b;
  --white: #ffffff;
  --green: #15803d;
  --red: #b91c1c;
}

body {
  margin: 0;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background: var(--background);
  color: var(--text);
}

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

.topbar {
  height: 72px;
  padding: 0 30px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  color: var(--blue);
  font-size: 20px;
  font-weight: 900;
}

.public-nav,
.customer-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.public-nav a,
.customer-nav a {
  font-weight: 700;
  color: #475569;
}

.button-link {
  padding: 11px 18px;
  border-radius: 8px;
  background: var(--blue);
  color: white !important;
}

.hero {
  padding: 90px 7%;
  text-align: center;
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--navy));
}

.hero h1 {
  margin: 0 auto 20px;
  max-width: 900px;
  font-size: clamp(38px, 6vw, 66px);
  line-height: 1.05;
}

.hero p {
  max-width: 760px;
  margin: 0 auto 32px;
  font-size: 19px;
  opacity: .9;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.primary-button,
.secondary-button,
button {
  border: 0;
  border-radius: 9px;
  padding: 13px 20px;
  font-weight: 800;
  cursor: pointer;
}

.primary-button,
button {
  background: var(--orange);
  color: white;
}

.secondary-button {
  border: 1px solid white;
  color: white;
}

.features {
  padding: 70px 7%;
}

.page-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px 1fr;
}

.sidebar {
  background: var(--navy);
  color: white;
  padding: 24px 16px;
}

.sidebar-brand {
  padding: 10px 12px 24px;
  font-size: 18px;
  font-weight: 900;
}

.sidebar a {
  display: block;
  padding: 12px 14px;
  margin-bottom: 5px;
  border-radius: 8px;
  color: #d8e5f5;
  font-weight: 650;
}

.sidebar a:hover,
.sidebar a.active {
  background: var(--blue);
  color: white;
}

.content {
  padding: 32px;
  overflow-x: auto;
}

.page-title {
  margin-top: 0;
  font-size: 30px;
}

.subtitle {
  color: var(--muted);
  margin-top: -12px;
  margin-bottom: 28px;
}

.stats-grid,
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(190px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.stat-card,
.card,
.form-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 7px 24px rgba(15, 39, 69, .06);
}

.stat-card {
  padding: 22px;
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.stat-card strong {
  display: block;
  margin-top: 10px;
  font-size: 30px;
  color: var(--blue);
}

.card {
  padding: 24px;
}

.card h3 {
  margin-top: 0;
  color: var(--blue-dark);
}

.form-wrap {
  max-width: 760px;
  margin: 50px auto;
  padding: 20px;
}

.form-card {
  padding: 32px;
  border-top: 5px solid var(--orange);
}

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

input,
select,
textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  font: inherit;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

.full {
  grid-column: 1 / -1;
}

.table-wrap {
  background: white;
  border: 1px solid var(--border);
  border-radius: 13px;
  overflow-x: auto;
  box-shadow: 0 7px 24px rgba(15, 39, 69, .05);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

.data-table th {
  padding: 13px;
  background: var(--blue);
  color: white;
  text-align: left;
  font-size: 13px;
}

.data-table td {
  padding: 13px;
  border-bottom: 1px solid #e7edf4;
  font-size: 14px;
}

.search-box {
  max-width: 480px;
  margin-bottom: 20px;
}

.status {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eaf1f9;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 800;
}

.status-active {
  color: var(--green);
  background: #dcfce7;
}

.status-suspended {
  color: var(--red);
  background: #fee2e2;
}

.empty-message {
  text-align: center;
  padding: 40px;
  color: var(--muted);
}

@media (max-width: 900px) {
  .page-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: flex;
    overflow-x: auto;
    gap: 5px;
  }

  .sidebar-brand {
    display: none;
  }

  .sidebar a {
    min-width: max-content;
  }

  .stats-grid,
  .card-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .full {
    grid-column: auto;
  }

  .content {
    padding: 20px;
  }
}

.price-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.price-summary strong {
  color: var(--orange);
  font-size: 26px;
}

.message {
  margin-top: 14px;
  min-height: 20px;
  font-weight: 700;
}

.message-success {
  padding: 12px;
  border-radius: 8px;
  background: #dcfce7;
  color: #166534;
}

.message-error {
  padding: 12px;
  border-radius: 8px;
  background: #fee2e2;
  color: #991b1b;
}

.login-wrap {
  max-width: 500px;
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.customer-login {
  margin-top: 20px;
  text-align: center;
  color: var(--muted);
}

.customer-login a {
  color: var(--blue);
  font-weight: 800;
}

.logout-button {
  width: 100%;
  margin-top: 24px;
  background: #b91c1c;
}

.logout-button:hover {
  background: #991b1b;
}

.detail-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0;
}

.small-button {
  padding: 8px 11px;
  font-size: 12px;
}

.warning-button {
  background: #d97706;
}

.danger-button {
  background: #b91c1c;
}

.credential-box {
  margin: 20px 0;
  padding: 22px;
  background: #fff7ed;
  border: 2px solid var(--orange);
  border-radius: 12px;
}

.credential-box code {
  padding: 5px 8px;
  background: white;
  border: 1px solid #fed7aa;
  border-radius: 5px;
  font-size: 16px;
}

.credential-warning {
  color: #9a3412;
  font-weight: 800;
}

.large-status {
  color: var(--blue);
  font-size: 28px;
  font-weight: 900;
}

.content h2 {
  margin-top: 32px;
  color: var(--blue-dark);
}

.module-form {
  max-width: 850px;
  margin-bottom: 30px;
}

.notice-card {
  margin-bottom: 20px;
  padding: 15px 18px;
  border-left: 5px solid var(--orange);
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
  font-weight: 700;
}

.table-link {
  color: var(--blue);
  font-weight: 800;
}

.profile-card {
  max-width: 850px;
}

.profile-card label {
  color: var(--blue-dark);
  font-weight: 700;
}

.profile-card label input {
  margin-top: 7px;
}

input:disabled {
  background: #edf2f7;
  color: #64748b;
}

.hidden {
  display: none !important;
}

.module-form {
  margin-bottom: 30px;
}

.module-form h2 {
  margin-top: 0;
}

.data-table button,
.data-table select {
  width: auto;
}

.credential-box code {
  user-select: all;
}

.admin-login-brand {
  margin-bottom: 22px;
  text-align: center;
}

.admin-session-controls {
  margin-top: 28px;
  padding: 14px 10px;
  border-top: 1px solid rgba(255,255,255,.18);
}

.admin-session-controls span,
.admin-session-controls small {
  display: block;
}

.admin-session-controls span {
  color: white;
  font-weight: 800;
}

.admin-session-controls small {
  margin-top: 3px;
  color: #b7c7dc;
}

.admin-session-controls .logout-button {
  margin-top: 12px;
}

.ticket-summary {
  padding: 18px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
}

.ticket-original-message {
  padding: 15px;
  border-left: 4px solid var(--orange);
  border-radius: 6px;
  background: #fff7ed;
  white-space: pre-wrap;
}

.ticket-conversation {
  margin: 18px 0;
}

.ticket-message {
  max-width: 820px;
  margin-bottom: 14px;
  padding: 16px;
  border-radius: 12px;
}

.ticket-message-customer {
  border: 1px solid var(--border);
  background: white;
}

.ticket-message-staff {
  margin-left: auto;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
}

.ticket-message-header {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 8px;
  color: var(--blue-dark);
}

.ticket-message-header span {
  color: var(--muted);
  font-size: 12px;
}

.ticket-message p {
  margin: 0;
  white-space: pre-wrap;
}

.priority-low {
  color: #475569;
  font-weight: 800;
}

.priority-normal {
  color: var(--blue);
  font-weight: 800;
}

.priority-high {
  color: #d97706;
  font-weight: 800;
}

.priority-urgent {
  color: #b91c1c;
  font-weight: 900;
}

.report-card {
  transition: transform .15s ease;
}

.report-card:hover {
  transform: translateY(-3px);
}

.report-card strong {
  color: var(--orange);
}

.dashboard-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 20px;
}

.refresh-button {
  background: var(--blue);
  white-space: nowrap;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(
    2,
    minmax(320px, 1fr)
  );
  gap: 20px;
  margin: 24px 0 34px;
}

.chart-card {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: white;
  box-shadow: 0 7px 24px rgba(15, 39, 69, .06);
}

.chart-heading {
  margin-bottom: 20px;
}

.chart-heading h3 {
  margin: 0;
  color: var(--blue-dark);
}

.chart-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.bar-row {
  display: grid;
  grid-template-columns: 65px 1fr 80px;
  align-items: center;
  gap: 10px;
  margin: 13px 0;
}

.bar-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.bar-track,
.status-chart-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef6;
}

.bar-fill,
.status-chart-fill {
  height: 100%;
  min-width: 2px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    var(--blue),
    var(--orange)
  );
}

.bar-value {
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 900;
  text-align: right;
}

.status-chart-row {
  margin: 17px 0;
}

.status-chart-heading {
  display: flex;
  justify-content: space-between;
  margin-bottom: 7px;
  font-size: 14px;
}

.status-chart-heading span {
  color: var(--text);
  font-weight: 700;
}

.status-chart-heading strong {
  color: var(--blue);
}

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

  .dashboard-heading {
    flex-direction: column;
  }
}

@media (max-width: 600px) {
  .bar-row {
    grid-template-columns: 55px 1fr 65px;
  }
}

.table-link {
  color: var(--blue);
  font-weight: 800;
  white-space: nowrap;
}

.table-link:hover {
  color: var(--orange);
  text-decoration: underline;
}
