/* ========================================
   Local Eats Support Portal
   Brand: #E30613 red, #000, #fff
   ======================================== */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: #f5f5f5;
  color: #333;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: #E30613;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ========== Layout ========== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

main.container {
  flex: 1;
  padding-top: 30px;
  padding-bottom: 50px;
}

/* ========== Header ========== */
.site-header {
  background: #E30613;
  padding: 8px 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  height: 40px;
  width: auto;
  -webkit-filter: brightness(60000000%) contrast(200%) saturate(0%) blur(0px) hue-rotate(0deg);
  filter: brightness(60000000%) contrast(200%) saturate(0%) blur(0px) hue-rotate(0deg);
}

.admin-badge {
  background: #fff;
  color: #E30613;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.header-nav a {
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}
.header-nav a:hover {
  color: #f5f0f0;
  text-decoration: none;
}

.btn-logout {
  background: rgba(255,255,255,0.2);
  padding: 6px 14px;
  border-radius: 4px;
}
.btn-logout:hover {
  background: rgba(255,255,255,0.35) !important;
}

/* ========== Footer ========== */
.site-footer {
  background: #E30613;
  color: rgba(255,255,255,0.8);
  text-align: center;
  padding: 20px;
  font-size: 13px;
  margin-top: auto;
}
.site-footer a {
  color: #fff;
}

/* ========== Page Header ========== */
.page-header {
  margin-bottom: 30px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.page-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: #111;
  flex: 1;
}

.back-link {
  display: block;
  width: 100%;
  font-size: 14px;
  margin-bottom: 4px;
}

.subtitle {
  width: 100%;
  color: #666;
  font-size: 15px;
  margin-top: -8px;
}

/* ========== Tickets Table ========== */
.tickets-table-wrap {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  overflow: hidden;
}

.tickets-table {
  width: 100%;
  border-collapse: collapse;
}

.tickets-table th {
  background: #fafafa;
  padding: 14px 18px;
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #888;
  border-bottom: 2px solid #eee;
}

.tickets-table td {
  padding: 14px 18px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
}

.tickets-table tbody tr:hover {
  background: #fafafa;
}

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

.ticket-id {
  font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
  font-size: 13px;
  color: #666;
  font-weight: 600;
}

.ticket-link {
  font-weight: 600;
  color: #111;
}
.ticket-link:hover {
  color: #E30613;
}

/* ========== Status Badges ========== */
.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.status-open {
  background: #e8f5e9;
  color: #2e7d32;
}

.status-in-progress {
  background: #fff3e0;
  color: #e65100;
}

.status-resolved {
  background: #e3f2fd;
  color: #1565c0;
}

.status-closed {
  background: #f5f5f5;
  color: #777;
}

/* ========== Forms ========== */
.form-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  padding: 30px;
  max-width: 600px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
  color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #E30613;
  box-shadow: 0 0 0 3px rgba(227,6,19,0.1);
}

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

/* ========== Home Grid ========== */
.home-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

.home-grid .form-card {
  max-width: none;
}

.home-grid .form-card h2 {
  font-size: 20px;
  margin-bottom: 4px;
  color: #111;
}

.form-description {
  color: #666;
  font-size: 14px;
  margin-bottom: 20px;
}

.alert-success {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 14px;
}

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

/* ========== Buttons ========== */
.btn {
  display: inline-block;
  padding: 10px 24px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  text-align: center;
}

.btn-primary {
  background: #E30613;
  color: #fff;
}
.btn-primary:hover {
  background: #c00510;
  text-decoration: none;
  color: #fff;
}

.btn-secondary {
  background: #333;
  color: #fff;
}
.btn-secondary:hover {
  background: #111;
}

.btn-danger {
  background: #fff;
  color: #E30613;
  border: 1px solid #E30613;
}
.btn-danger:hover {
  background: #E30613;
  color: #fff;
}

.btn-full {
  width: 100%;
}

.btn-remove {
  background: none;
  border: none;
  color: #ccc;
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  line-height: 1;
  transition: all 0.2s;
}
.btn-remove:hover {
  color: #E30613;
  background: #fdeaea;
}

/* ========== Alerts ========== */
.alert {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 14px;
}

.alert-error {
  background: #fdeaea;
  color: #c00;
  border: 1px solid #f5c6c6;
}

.alert-info {
  background: #e8f4fd;
  color: #0d47a1;
  border: 1px solid #bbdefb;
}

/* ========== Empty State ========== */
.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: #999;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* ========== Ticket Content ========== */
.ticket-content {
  background: #fff;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  font-size: 15px;
  line-height: 1.7;
}

.ticket-description {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  margin-bottom: 30px;
  font-size: 15px;
  line-height: 1.7;
}

/* ========== Messages ========== */
.messages-section {
  margin-top: 30px;
  padding-top: 30px;
  border-top: 2px solid #eee;
}

.messages-section h2 {
  font-size: 20px;
  margin-bottom: 16px;
  color: #111;
}

.messages-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.message {
  padding: 16px;
  border-radius: 8px;
  border-left: 4px solid transparent;
}

.message-user {
  background: #fff;
  border-left-color: #ddd;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.message-admin {
  background: #fef7f7;
  border-left-color: #E30613;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.message-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
}

.message-header strong {
  color: #111;
}

.message-time {
  color: #999;
  font-size: 12px;
}

.message-body {
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.message-image {
  margin-top: 10px;
}

.message-image img {
  max-width: 400px;
  max-height: 300px;
  border-radius: 6px;
  border: 1px solid #eee;
  cursor: pointer;
}

.message-image img:hover {
  opacity: 0.9;
}

.file-input {
  display: block;
  width: 100%;
  padding: 8px;
  border: 1px dashed #ccc;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}

.file-input:hover {
  border-color: #E30613;
}

.message-form {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  margin-top: 24px;
  border-top: 2px solid #eee;
}

/* ========== Admin Ticket Grid ========== */
.admin-ticket-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  align-items: start;
}

.sidebar-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  padding: 20px;
  margin-bottom: 16px;
}

.sidebar-card h3 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #888;
  margin-bottom: 12px;
}

.sidebar-card dl {
  font-size: 14px;
}

.sidebar-card dt {
  font-weight: 600;
  color: #555;
  margin-top: 10px;
}
.sidebar-card dt:first-child {
  margin-top: 0;
}

.sidebar-card dd {
  color: #333;
  margin-left: 0;
  margin-bottom: 4px;
}

.sidebar-danger {
  border: 1px solid #fdeaea;
}

.sidebar-danger h3 {
  color: #E30613;
}

/* ========== Login ========== */
.login-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 50vh;
}

.login-card {
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.login-card h1 {
  font-size: 24px;
  margin-bottom: 4px;
}

.login-card .subtitle {
  text-align: center;
  margin-bottom: 24px;
}

/* ========== Access CTA ========== */
.access-cta {
  margin-top: 24px;
  text-align: center;
  padding: 20px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  font-size: 14px;
  color: #666;
}

/* ========== Ticket Meta ========== */
.ticket-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
}

/* ========== Error Card ========== */
.error-card {
  text-align: center;
  background: #fff;
  padding: 40px;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.error-card p {
  font-size: 16px;
  color: #666;
  margin-bottom: 20px;
}

/* ========== Updates Timeline ========== */
.updates-section {
  margin-top: 30px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  color: #111;
  margin-bottom: 16px;
}

.updates-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.update-item {
  padding: 16px 20px;
  background: #fff;
  border-left: 3px solid #ddd;
  position: relative;
  margin-left: 12px;
}

.update-item:first-child {
  border-radius: 8px 8px 0 0;
}

.update-item:last-child {
  border-radius: 0 0 8px 8px;
}

.update-item:only-child {
  border-radius: 8px;
}

.update-status {
  border-left-color: #E30613;
  background: #fef7f7;
}

.update-time {
  font-size: 12px;
  color: #999;
  margin-bottom: 4px;
  font-weight: 600;
}

.update-content {
  font-size: 14px;
  line-height: 1.6;
  color: #333;
}

/* ========== Mobile Ticket Cards ========== */
.mobile-only {
  display: none !important;
}

.desktop-only {
  display: block !important;
}

.ticket-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ticket-card {
  display: block;
  background: #fff;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  text-decoration: none;
  transition: box-shadow 0.2s;
}

.ticket-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  text-decoration: none;
}

.ticket-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.ticket-card-name {
  font-size: 16px;
  font-weight: 600;
  color: #111;
}

/* ========== Utilities ========== */
.text-muted {
  color: #999;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    height: auto;
    padding: 16px 0;
    gap: 12px;
  }

  .logo-link {
    position: relative;
  }

  .admin-badge {
    position: absolute;
    top: -8px;
    right: -55px;
    font-size: 10px;
  }

  .header-nav {
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .header-nav a {
    font-size: 13px;
  }

  main.container {
    padding-top: 24px;
  }

  .admin-ticket-grid {
    grid-template-columns: 1fr;
  }

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

  /* Hide table, show cards on mobile - admin too */
  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: flex !important;
  }

  /* Stack admin table on mobile */
  .tickets-table thead {
    display: none;
  }

  .tickets-table,
  .tickets-table tbody,
  .tickets-table tr,
  .tickets-table td {
    display: block;
    width: 100%;
  }

  .tickets-table tr {
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    position: relative;
  }

  .tickets-table td {
    padding: 4px 0;
    border: none;
    font-size: 14px;
  }

  .tickets-table td:before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #999;
    display: block;
    margin-bottom: 2px;
  }

  .tickets-table td.ticket-id {
    font-size: 12px;
    color: #999;
  }

  .tickets-table td:last-child {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 0;
  }

  .page-header h1 {
    font-size: 22px;
  }

  .ticket-content {
    padding: 20px;
  }

  .update-item {
    margin-left: 4px;
    padding: 12px 16px;
  }

  .container {
    padding: 0 16px;
  }
}
