* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #f8fafc; color: #1e293b; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; max-width: 900px; margin: 0 auto; padding: 24px 16px 48px; width: 100%; }
header { background: #1e40af; padding: 16px 24px; }
.header-inner { max-width: 900px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
.logo-icon { width: 40px; height: 40px; object-fit: contain; margin-right: 12px; }
.logo-area { display: flex; align-items: center; }
.logo-name { color: white; font-weight: 700; font-size: 18px; }
.logo-sub { color: #93c5fd; font-size: 13px; }
.header-actions { display: flex; gap: 8px; align-items: center; }
.user-name { color: #93c5fd; font-size: 14px; }
.btn-outline { color: white; border: 1px solid rgba(255,255,255,0.4); padding: 8px 16px; border-radius: 6px; text-decoration: none; font-size: 14px; background: transparent; cursor: pointer; }
.btn-outline:hover { background: rgba(255,255,255,0.1); }
footer { text-align: center; padding: 24px; color: #94a3b8; font-size: 13px; border-top: 1px solid #e2e8f0; margin-top: auto; }
footer a { color: #3b82f6; text-decoration: none; }
.login-section { display: flex; justify-content: center; align-items: center; padding: 80px 16px; }
.login-card { background: white; border-radius: 16px; padding: 48px 40px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); max-width: 440px; width: 100%; text-align: center; }
.login-card h1 { font-size: 28px; margin-bottom: 12px; }
.login-card p { color: #64748b; margin-bottom: 28px; }
.form-card { background: white; border-radius: 16px; padding: 32px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); margin-bottom: 24px; }
.form-card h2 { font-size: 22px; margin-bottom: 8px; }
.form-card h3 { font-size: 18px; margin-bottom: 12px; }
.form-group { margin-bottom: 20px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
label { display: block; font-weight: 500; font-size: 14px; margin-bottom: 6px; color: #374151; }
.required { color: #ef4444; }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"], select, textarea {
  width: 100%; padding: 10px 14px; border: 1.5px solid #d1d5db; border-radius: 8px; font-size: 15px; font-family: inherit; transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
input[type="file"] { padding: 8px; border: 1.5px dashed #d1d5db; border-radius: 8px; width: 100%; cursor: pointer; }
.form-hint { color: #94a3b8; font-size: 12px; margin-top: 4px; display: block; }
.form-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 8px; }
.urgency-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 600px) { .urgency-options { grid-template-columns: 1fr; } }
.urgency-option { display: flex; flex-direction: column; align-items: flex-start; padding: 12px; border: 1.5px solid #e2e8f0; border-radius: 8px; cursor: pointer; transition: all 0.15s; }
.urgency-option:has(input:checked) { border-color: #3b82f6; background: #eff6ff; }
.urgency-option input[type="radio"] { display: none; }
.urgency-label { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.urgency-label.standard { color: #64748b; }
.urgency-label.high { color: #ea580c; }
.urgency-label.critical { color: #dc2626; }
.urgency-option small { color: #94a3b8; font-size: 11px; }
.btn-submit { width: 100%; padding: 14px; background: #1e40af; color: white; border: none; border-radius: 8px; font-size: 16px; font-weight: 600; cursor: pointer; transition: background 0.2s; }
.btn-submit:hover { background: #1d4ed8; }
.btn-submit:disabled { background: #94a3b8; cursor: not-allowed; }
.btn-sm { padding: 4px 12px; font-size: 12px; }
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; font-size: 14px; }
.alert-error { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.dashboard-section { padding: 24px 0; }
.dashboard-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.dashboard-header h1 { font-size: 24px; }
.empty-state { text-align: center; padding: 48px; color: #64748b; background: white; border-radius: 12px; }
.loading { text-align: center; padding: 24px; color: #94a3b8; }
.ticket-card-link { text-decoration: none; color: inherit; display: block; }
.ticket-card { background: white; border: 1px solid #e2e8f0; border-radius: 10px; padding: 16px; margin-bottom: 12px; border-left: 4px solid #3b82f6; transition: box-shadow 0.15s; }
.ticket-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.ticket-card.critical { border-left-color: #dc2626; }
.ticket-card.high { border-left-color: #ea580c; }
.ticket-card.standard { border-left-color: #3b82f6; }
.ticket-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.ticket-ref { font-weight: 700; color: #1e40af; font-size: 13px; }
.ticket-status { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 4px; text-transform: uppercase; }
.ticket-status.open { background: #dbeafe; color: #1e40af; }
.ticket-status.resolved { background: #dcfce7; color: #16a34a; }
.urgency-badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 4px; }
.urgency-badge.critical { background: #fef2f2; color: #dc2626; }
.urgency-badge.high { background: #fff7ed; color: #ea580c; }
.urgency-badge.standard { background: #f1f5f9; color: #64748b; }
.unread-badge { background: #1e40af; color: white; font-size: 11px; padding: 2px 8px; border-radius: 4px; font-weight: 600; }
.ticket-date { color: #94a3b8; font-size: 12px; margin-left: auto; }
.ticket-subject { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.ticket-meta { font-size: 13px; color: #64748b; }
.ticket-section { padding: 24px 0; }
.ticket-detail-header { margin-bottom: 24px; }
.ticket-detail-top { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.ticket-detail-top h1 { font-size: 22px; }
.ticket-detail-meta { font-size: 13px; color: #64748b; display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.message-thread { margin-bottom: 24px; }
.message { background: white; border: 1px solid #e2e8f0; border-radius: 10px; padding: 16px; margin-bottom: 12px; }
.message.admin { border-left: 3px solid #1e40af; }
.message.customer { border-left: 3px solid #16a34a; }
.message.ai { border-left: 3px solid #a855f7; background: #faf5ff; }
.message-header { display: flex; justify-content: space-between; margin-bottom: 8px; }
.message-sender { font-weight: 600; font-size: 14px; }
.message-sender.customer { color: #16a34a; }
.message-sender.admin { color: #1e40af; }
.message-sender.ai { color: #a855f7; }
.message-time { color: #94a3b8; font-size: 12px; }
.message-body { font-size: 14px; line-height: 1.6; white-space: pre-wrap; }
.attachment { margin-top: 8px; }
.attachment-img { max-width: 300px; border-radius: 8px; margin-bottom: 4px; display: block; }
.attachment a { color: #3b82f6; font-size: 13px; }
.reply-box { background: white; border-radius: 12px; padding: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); margin-bottom: 24px; }
.reply-box h3 { margin-bottom: 12px; }
.ai-chat-section { background: white; border-radius: 12px; padding: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); border: 2px solid #e9d5ff; }
.ai-chat-header { margin-bottom: 16px; }
.ai-chat-header h3 { color: #7c3aed; margin-bottom: 4px; }
.ai-chat-header p { color: #64748b; font-size: 14px; }
.ai-chat-messages { max-height: 400px; overflow-y: auto; margin-bottom: 16px; }
.ai-msg { padding: 10px 14px; border-radius: 8px; margin-bottom: 8px; font-size: 14px; line-height: 1.5; }
.ai-msg.user { background: #eff6ff; }
.ai-msg.ai { background: #faf5ff; }
.ai-msg.typing { color: #a855f7; font-style: italic; }
.ai-chat-input { display: flex; gap: 8px; }
.ai-chat-input input { flex: 1; }
.admin-section { padding: 24px 0; }
.admin-section h2 { margin-bottom: 16px; color: #38bdf8; }
.admin-container h1 { color: #38bdf8; }
.admin-filters { display: flex; gap: 12px; margin-bottom: 20px; }
.admin-filters select { padding: 8px 12px; border-radius: 6px; border: 1.5px solid #d1d5db; font-size: 14px; }
.staff-list { margin-bottom: 16px; }
.staff-card { background: white; border: 1px solid #e2e8f0; border-radius: 8px; padding: 12px 16px; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.staff-prefs { display: flex; gap: 6px; }
.pref-badge { background: #dbeafe; color: #1e40af; font-size: 11px; padding: 2px 8px; border-radius: 4px; font-weight: 600; }
.notif-banner { position: fixed; top: 0; left: 0; right: 0; background: #1e40af; color: white; text-align: center; padding: 12px; font-weight: 600; z-index: 1000; animation: slideDown 0.3s ease; }
@keyframes slideDown { from { transform: translateY(-100%); } to { transform: translateY(0); } }
.admin-table { width: 100%; border-collapse: collapse; background: white; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.admin-table th { background: #f1f5f9; text-align: left; padding: 10px 14px; font-size: 13px; font-weight: 600; color: #475569; border-bottom: 2px solid #e2e8f0; }
.admin-table td { padding: 10px 14px; border-bottom: 1px solid #f1f5f9; font-size: 14px; }
.admin-table tr:hover { background: #f8fafc; }
.status-badge { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.status-badge.approved { background: #dcfce7; color: #166534; }
.status-badge.pending { background: #fef3c7; color: #92400e; }
.btn-approve { background: #16a34a; color: white; border: none; padding: 4px 12px; border-radius: 4px; cursor: pointer; font-size: 12px; font-weight: 600; }
.btn-approve:hover { background: #15803d; }
.btn-reject { background: #dc2626; color: white; border: none; padding: 4px 12px; border-radius: 4px; cursor: pointer; font-size: 12px; font-weight: 600; }
.btn-reject:hover { background: #b91c1c; }
.btn-small { font-size: 12px; padding: 4px 12px; }
.admin-container { max-width: 1000px; margin: 24px auto; padding: 0 20px; }
.admin-nav { display: flex; gap: 8px; align-items: center; }
.toggle-label { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; }
.filter-bar { display: flex; gap: 12px; }
.filter-bar select { padding: 8px 12px; border-radius: 6px; border: 1.5px solid #d1d5db; font-size: 14px; }
.ticket-status.pending_approval { background: #fef3c7; color: #92400e; }
.ticket-status.rejected { background: #fef2f2; color: #dc2626; }
.contract-badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 4px; }
.contract-badge.has-contract { background: #dcfce7; color: #166534; }
.contract-badge.no-contract { background: #fff7ed; color: #ea580c; }
.pending-banner { background: #fffbeb; border: 1px solid #f59e0b; border-radius: 8px; padding: 12px 16px; margin-bottom: 12px; color: #92400e; font-size: 14px; }
.approve-actions { display: flex; gap: 8px; margin-top: 12px; }
.btn-approve-lg { background: #16a34a; color: white; border: none; padding: 10px 20px; border-radius: 6px; cursor: pointer; font-size: 14px; font-weight: 600; }
.btn-approve-lg:hover { background: #15803d; }
.btn-reject-lg { background: #dc2626; color: white; border: none; padding: 10px 20px; border-radius: 6px; cursor: pointer; font-size: 14px; font-weight: 600; }
.btn-reject-lg:hover { background: #b91c1c; }
.chatbot-panel { background: white; border-radius: 12px; padding: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); border: 2px solid #e9d5ff; }
.chatbot-messages { max-height: 400px; overflow-y: auto; margin-bottom: 16px; }
.chat-msg { padding: 10px 14px; border-radius: 8px; margin-bottom: 8px; font-size: 14px; line-height: 1.5; }
.chat-msg.user { background: #eff6ff; }
.chat-msg.bot { background: #faf5ff; }
.chat-msg.typing { color: #a855f7; font-style: italic; }
.chat-input { display: flex; gap: 8px; }
.chat-input input { flex: 1; }
.pending-readonly { background: #fffbeb; border: 1px solid #f59e0b; border-radius: 8px; padding: 16px; text-align: center; color: #92400e; }

/* ============ WELCOME PAGE ============ */
.landing-body {
  background: white;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.landing-body header { width: 100%; flex-shrink: 0; }
.welcome-page {
  text-align: center;
  padding: 40px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.welcome-logo {
  height: 120px;
  width: auto;
  object-fit: contain;
  margin-bottom: 40px;
}
.welcome-title {
  color: #1e293b;
  font-size: 42px;
  font-weight: 300;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}
.welcome-text {
  color: #64748b;
  font-size: 18px;
  font-weight: 300;
  margin-bottom: 48px;
}
.welcome-btn {
  display: inline-block;
  background: #1e40af;
  color: white;
  padding: 14px 56px;
  border-radius: 8px;
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 14px rgba(30,64,175,0.3);
}
.welcome-btn:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(30,64,175,0.4);
}
.welcome-guide-link {
  display: inline-block;
  margin-top: 16px;
  color: #64748b;
  font-size: 13px;
  text-decoration: none;
  transition: color 0.2s;
}
.welcome-guide-link:hover { color: #1e40af; }
@media (max-width: 640px) {
  .welcome-logo { height: 90px; }
  .welcome-title { font-size: 32px; }
  .welcome-text { font-size: 16px; }
}

/* User Guide Section */
.guide-section {
  max-width: 800px;
  margin: 0 auto;
  padding: 48px 24px 32px;
}
.guide-main-title {
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 8px;
}
.guide-intro {
  text-align: center;
  color: #64748b;
  font-size: 16px;
  margin-bottom: 40px;
}
.guide-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}
.guide-step {
  background: white;
  border-radius: 12px;
  padding: 24px 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  border: 1px solid #e2e8f0;
}
.guide-step-num {
  width: 36px;
  height: 36px;
  background: #1e40af;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 12px;
}
.guide-step h3 {
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 8px;
}
.guide-step p {
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
}
.guide-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 32px;
}
.guide-card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  border: 1px solid #e2e8f0;
}
.guide-card:first-child {
  grid-column: span 2;
}
.guide-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 12px;
}
.guide-card p {
  font-size: 14px;
  color: #64748b;
  line-height: 1.6;
  margin-bottom: 8px;
}
.guide-card ul {
  list-style: none;
  padding: 0;
  margin: 8px 0;
}
.guide-card ul li {
  font-size: 14px;
  color: #64748b;
  padding: 4px 0 4px 16px;
  position: relative;
}
.guide-card ul li::before {
  content: "\2022";
  color: #1e40af;
  font-weight: bold;
  position: absolute;
  left: 0;
}
.guide-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 8px;
}
.guide-table td {
  padding: 8px 12px;
  font-size: 13px;
  color: #475569;
  border-bottom: 1px solid #f1f5f9;
}
.guide-table tr:last-child td {
  border-bottom: none;
}
.guide-table td:first-child {
  width: 160px;
  white-space: nowrap;
  color: #1e293b;
}
.guide-note {
  font-size: 12px !important;
  color: #94a3b8 !important;
  margin-top: 4px;
}
.guide-contact {
  text-align: center;
  background: #1e40af;
  color: white;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}
.guide-contact h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}
.guide-contact p {
  font-size: 14px;
  color: #dbeafe;
  margin-bottom: 4px;
}
.guide-contact b {
  color: white;
}
@media (max-width: 768px) {
  .guide-steps { grid-template-columns: 1fr 1fr; }
  .guide-details { grid-template-columns: 1fr; }
  .guide-card:first-child { grid-column: span 1; }
}
@media (max-width: 480px) {
  .guide-steps { grid-template-columns: 1fr; }
  .guide-table td:first-child { width: auto; white-space: normal; }
}
