/* ============================================================
   CFGS - Colombo Fort Group Services PVT LTD
   Ticket System - VULNERABLE VERSION
   Color Theme: Green & White
   ============================================================ */

:root {
  --primary:        #1e5631;
  --primary-dark:   #0d3b20;
  --primary-light:  #2d8a4e;
  --accent:         #4caf50;
  --accent-light:   #a5d6a7;
  --bg-light:       #e8f5e9;
  --white:          #ffffff;
  --gray-100:       #f5f5f5;
  --gray-200:       #eeeeee;
  --gray-300:       #e0e0e0;
  --gray-600:       #757575;
  --text-dark:      #1a1a1a;
  --text-medium:    #424242;
  --danger:         #c62828;
  --danger-light:   #ffebee;
  --warning:        #e65100;
  --warning-light:  #fff3e0;
  --info:           #1565c0;
  --info-light:     #e3f2fd;
  --shadow-sm:      0 1px 3px rgba(0,0,0,0.12);
  --shadow-md:      0 4px 6px rgba(0,0,0,0.1);
  --shadow-lg:      0 10px 25px rgba(0,0,0,0.15);
  --radius:         8px;
  --radius-lg:      12px;
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg-light);
  color: var(--text-dark);
  line-height: 1.6;
  min-height: 100vh;
}

/* ── VULNERABILITY BANNER ── */
.vuln-banner {
  background: var(--danger);
  color: var(--white);
  text-align: center;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.vuln-banner span { opacity: 0.85; font-weight: 400; }

/* ── NAVBAR ── */
.navbar {
  background: var(--primary);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 64px;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 42px;
  height: 42px;
  background: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 15px;
  color: var(--primary);
  letter-spacing: -1px;
  flex-shrink: 0;
}

.brand-text h1 {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
}

.brand-text p {
  font-size: 10px;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.navbar-nav a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.navbar-nav a:hover,
.navbar-nav a.active {
  background: rgba(255,255,255,0.15);
  color: var(--white);
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--white);
}

.user-info { text-align: right; }
.user-info .user-name { font-size: 13px; font-weight: 600; }
.user-info .user-role { font-size: 11px; opacity: 0.7; text-transform: capitalize; }

/* ── ROLE BADGE ── */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-admin    { background: #4a148c; color: white; }
.badge-manager  { background: #e65100; color: white; }
.badge-employee { background: var(--primary-light); color: white; }
.badge-open     { background: var(--info); color: white; }
.badge-closed   { background: var(--gray-600); color: white; }
.badge-approved { background: var(--accent); color: white; }

/* ── LAYOUT ── */
.page-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 20px;
}

.page-header {
  margin-bottom: 24px;
}

.page-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary-dark);
}

.page-header p {
  color: var(--gray-600);
  font-size: 14px;
  margin-top: 2px;
}

.context-note {
  background: linear-gradient(135deg, #f5fff7, #ecf7ff);
  border: 1px solid #c8e6c9;
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 16px;
}

.context-note h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--primary-dark);
  margin-bottom: 4px;
}

.context-note p {
  font-size: 13px;
  color: var(--text-medium);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  align-items: start;
}

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

/* ── CARD ── */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-300);
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  background: var(--primary);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h3 {
  font-size: 15px;
  font-weight: 600;
}

.card-body { padding: 20px; }

/* ── VULNERABILITY DEMO CARD ── */
.vuln-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 2px solid var(--danger);
  overflow: hidden;
  margin-bottom: 24px;
}

.vuln-card .card-header {
  background: var(--danger);
}

.vuln-card .card-body {
  padding: 16px 20px;
  font-size: 13px;
}

.cookie-display {
  background: #1a1a1a;
  color: #4caf50;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-family: 'Courier New', monospace;
  font-size: 12px;
  word-break: break-all;
  margin: 10px 0;
  min-height: 40px;
}

.vuln-step {
  background: var(--danger-light);
  border-left: 4px solid var(--danger);
  padding: 10px 14px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 8px 0;
  font-size: 13px;
}

.vuln-step strong { color: var(--danger); }

/* ── FORM ── */
.form-group { margin-bottom: 16px; }

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-medium);
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  color: var(--text-dark);
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(76,175,80,0.15);
}

.form-group textarea { resize: vertical; min-height: 80px; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border: none;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: inherit;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }

.btn-accent {
  background: var(--accent);
  color: var(--white);
}
.btn-accent:hover { background: var(--primary-light); transform: translateY(-1px); }

.btn-danger {
  background: var(--danger);
  color: var(--white);
}
.btn-danger:hover { opacity: 0.85; transform: translateY(-1px); }

.btn-warning {
  background: var(--warning);
  color: var(--white);
}
.btn-warning:hover { opacity: 0.85; }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover {
  background: var(--primary);
  color: var(--white);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
}

.btn-full { width: 100%; justify-content: center; }

/* ── TABLE ── */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead th {
  background: var(--primary);
  color: var(--white);
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--gray-200);
  transition: background 0.15s;
}

tbody tr:hover { background: var(--bg-light); }
tbody td { padding: 12px 16px; }

.ticket-title { font-weight: 600; color: var(--primary-dark); }
.ticket-desc  { font-size: 12px; color: var(--gray-600); margin-top: 2px; }

.no-action {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px dashed #b0bec5;
  color: #607d8b;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

/* ── STATS ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 18px;
  border: 1px solid var(--gray-300);
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.stat-card .stat-num {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.stat-card .stat-label {
  font-size: 12px;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

/* ── LOGIN PAGE ── */
.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
}

.login-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.login-box {
  width: 100%;
  max-width: 440px;
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
  color: var(--white);
}

.login-logo {
  width: 72px;
  height: 72px;
  background: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 900;
  color: var(--primary);
  margin: 0 auto 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.login-header h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.login-header p {
  font-size: 12px;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 2px;
}

.login-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 32px;
}

.login-card h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 6px;
}

.login-card .subtitle {
  font-size: 13px;
  color: var(--gray-600);
  margin-bottom: 24px;
}

.demo-creds {
  background: var(--bg-light);
  border: 1px solid var(--accent-light);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-top: 20px;
  font-size: 12px;
}

.demo-creds h4 {
  font-size: 12px;
  color: var(--primary-dark);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.demo-creds table {
  width: 100%;
  font-size: 12px;
}

.demo-creds thead th {
  background: var(--primary-light);
  font-size: 10px;
  padding: 6px 8px;
}

.demo-creds tbody td {
  padding: 5px 8px;
  border-bottom: 1px solid var(--gray-200);
}

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

.demo-creds code {
  background: var(--gray-200);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  cursor: pointer;
  color: var(--primary-dark);
}

.demo-creds code:hover { background: var(--accent-light); }

/* ── ALERT ── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
  align-items: center;
  gap: 8px;
}

.alert.show { display: flex; }
.alert-error   { background: var(--danger-light);  border: 1px solid #ef9a9a; color: var(--danger); }
.alert-success { background: var(--bg-light);       border: 1px solid var(--accent-light); color: var(--primary-dark); }
.alert-warning { background: var(--warning-light);  border: 1px solid #ffcc80; color: var(--warning); }
.alert-info    { background: var(--info-light);     border: 1px solid #90caf9; color: var(--info); }

/* ── TABS ── */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--gray-300);
}

.tab-btn {
  padding: 10px 18px;
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
  font-family: inherit;
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

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

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── MODAL (Admin Access Demo) ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
  align-items: center;
  justify-content: center;
}

.modal-overlay.show { display: flex; }

.modal-box {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 560px;
  overflow: hidden;
}

.modal-header {
  background: var(--danger);
  color: var(--white);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 { font-size: 16px; font-weight: 600; }

.modal-close {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}

.modal-body { padding: 20px; font-size: 14px; }

/* ── MISC ── */
.text-center { text-align: center; }
.text-danger  { color: var(--danger); }
.text-success { color: var(--primary-light); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.flex { display: flex; align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.justify-between { justify-content: space-between; }
.divider { height: 1px; background: var(--gray-300); margin: 20px 0; }

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--gray-600);
}

.empty-state svg { margin-bottom: 12px; opacity: 0.4; }
.empty-state p { font-size: 14px; }

.query-preview {
  font-size: 11px;
  font-family: 'Courier New', monospace;
  color: #666;
  margin: 6px 2px 8px;
  white-space: pre-wrap;
}

.muted-note {
  font-size: 13px;
  color: #4e5a62;
  line-height: 1.7;
}

.footer {
  text-align: center;
  padding: 16px;
  font-size: 12px;
  color: var(--gray-600);
  border-top: 1px solid var(--gray-300);
  background: var(--white);
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--accent-light); border-radius: 3px; }
