/* =============================================
   Support TaskManager — style.css
   Colors: #09d9ba (main), #fff (bg), #000 (text)
============================================= */

:root {
  --main: #09d9ba;
  --main-dark: #07bfa4;
  --main-light: rgba(9, 217, 186, 0.12);
  --bg: #f5f7fa;
  --white: #ffffff;
  --text: #1a1d23;
  --muted: #6b7280;
  --border: #e5e7eb;
  --radius: 12px;
  --shadow: 0 2px 16px rgba(0,0,0,0.07);
}

* { box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
}

/* ─── NAVBAR ─── */
.navbar-custom {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 0;
  box-shadow: 0 1px 10px rgba(0,0,0,0.05);
}

.navbar-custom .navbar-brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--main) !important;
  letter-spacing: -0.3px;
}

.navbar-custom .nav-link {
  color: var(--muted) !important;
  font-weight: 500;
  padding: 0.5rem 0.9rem !important;
  border-radius: 8px;
  transition: all 0.2s;
}

.navbar-custom .nav-link:hover,
.navbar-custom .nav-link.active {
  color: var(--main) !important;
  background: var(--main-light);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

/* ─── PAGE WRAPPER ─── */
.page-wrapper {
  min-height: calc(100vh - 60px);
  padding-bottom: 40px;
}

.page-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

/* ─── BUTTONS ─── */
.btn-main {
  background: var(--main);
  color: #fff !important;
  border: none;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.2s;
}
.btn-main:hover {
  background: var(--main-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(9,217,186,0.35);
}

.btn-outline-main {
  border: 2px solid var(--main);
  color: var(--main) !important;
  background: transparent;
  font-weight: 600;
  border-radius: 8px;
}
.btn-outline-main:hover {
  background: var(--main);
  color: #fff !important;
}

.btn-xs {
  padding: 3px 8px;
  font-size: 12px;
  border-radius: 6px;
}

/* ─── CARDS ─── */
.card-custom {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header-custom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}

.card-header-custom h6 {
  color: var(--text);
  font-weight: 600;
}

/* ─── STAT CARDS ─── */
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 18px 16px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform 0.2s;
}

.stat-card:hover { transform: translateY(-2px); }

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
  color: #fff;
  font-size: 16px;
}

.stat-val {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
}

.stat-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 3px;
}

.bg-main { background: var(--main) !important; }
.bg-purple { background: #7c3aed !important; }
.text-main { color: var(--main) !important; }

/* ─── BADGES ─── */
.badge-pending  { background: #fff3cd; color: #856404; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-progress { background: #cce5ff; color: #004085; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-paused   { background: #f8d7da; color: #721c24; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-closed   { background: #d4edda; color: #155724; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; }

.badge-type { padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-type-support { background: rgba(9,217,186,0.15); color: var(--main-dark); }
.badge-type-account_manager { background: rgba(124,58,237,0.12); color: #7c3aed; }

.role-badge { padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; display: inline-block; }
.role-admin { background: #fee2e2; color: #dc2626; }
.role-support { background: rgba(9,217,186,0.15); color: var(--main-dark); }
.role-account_manager { background: #ede9fe; color: #7c3aed; }
.role-buyer { background: #fef3c7; color: #d97706; }

/* ─── TASK ITEMS ─── */
.task-id {
  font-family: monospace;
  font-size: 11px;
  background: var(--main-light);
  color: var(--main-dark);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}

.task-link {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}
.task-link:hover { color: var(--main); }

.task-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow);
}
.task-card:hover {
  border-color: var(--main);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(9,217,186,0.15);
}

/* ─── TABLES ─── */
.table thead th {
  background: #f9fafb;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border);
  padding: 10px 14px;
}

.table tbody td {
  padding: 10px 14px;
  vertical-align: middle;
  border-bottom: 1px solid #f3f4f6;
}

.table tbody tr:hover { background: #fafbfc; }

/* ─── CHAT ─── */
.chat-window {
  height: 380px;
  overflow-y: auto;
  padding: 16px;
  background: #f9fafb;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-msg { display: flex; }
.chat-msg-mine { justify-content: flex-end; }
.chat-msg-other { justify-content: flex-start; }

.chat-bubble {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
}

.chat-msg-mine .chat-bubble {
  background: var(--main);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-msg-other .chat-bubble {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.chat-author {
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 3px;
  opacity: 0.8;
}

.chat-time {
  font-size: 10px;
  opacity: 0.6;
  margin-top: 4px;
  text-align: right;
}

.chat-role-tag {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(0,0,0,0.1);
}

.chat-msg-mine .chat-role-tag { background: rgba(255,255,255,0.2); }

.chat-input-bar {
  border-top: 1px solid var(--border);
  background: #fff;
}

.chat-live-badge {
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 20px;
  font-weight: 700;
  animation: pulse 1.5s infinite;
}

.chat-icon-pulse {
  color: var(--main);
  animation: pulse 1.5s infinite;
  cursor: pointer;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ─── LOGIN ─── */
.login-bg {
  background: linear-gradient(135deg, #f0fffe 0%, #e8f4f8 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-container { width: 100%; padding: 20px; }

.login-card {
  max-width: 420px;
  margin: 0 auto;
  background: #fff;
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 8px 40px rgba(9,217,186,0.15);
  border: 1px solid rgba(9,217,186,0.2);
  text-align: center;
}

.login-logo {
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, var(--main), var(--main-dark));
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 28px;
  color: #fff;
  box-shadow: 0 6px 20px rgba(9,217,186,0.35);
}

.login-card h2 { font-weight: 700; color: var(--text); }

.login-card .form-control { text-align: left; }

/* ─── PERFORMER ─── */
.performer-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.performer-row:last-child { border-bottom: none; }

.performer-rank {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--main-light);
  color: var(--main-dark);
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.performer-info { flex: 1; }
.performer-score { font-size: 1.2rem; font-weight: 700; color: var(--main); }

/* ─── DETAIL ─── */
.detail-item {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid #f3f4f6;
  font-size: 13px;
}
.detail-item:last-child { border-bottom: none; }
.detail-label { color: var(--muted); font-weight: 500; }

.task-description {
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  line-height: 1.7;
  color: var(--text);
}

/* ─── ASSIGNEE CHOICE ─── */
.assignee-choice {
  display: block;
  padding: 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.assignee-choice:hover { border-color: var(--main); }
.assignee-choice.selected { border-color: var(--main); background: var(--main-light); }

.assignee-icon {
  width: 42px;
  height: 42px;
  background: var(--main-light);
  color: var(--main);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ─── METRICS INSIGHTS ─── */
.insight-item {
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  border-left: 4px solid;
}
.insight-success { background: #d4edda; border-color: #28a745; color: #155724; }
.insight-warning { background: #fff3cd; border-color: #ffc107; color: #856404; }
.insight-danger  { background: #f8d7da; border-color: #dc3545; color: #721c24; }
.insight-info    { background: #cce5ff; border-color: #17a2b8; color: #004085; }
.insight-main    { background: var(--main-light); border-color: var(--main); color: var(--main-dark); }

/* ─── FORM CONTROLS ─── */
.form-control:focus, .form-select:focus {
  border-color: var(--main);
  box-shadow: 0 0 0 3px rgba(9,217,186,0.15);
}

.input-group-text {
  background: #f9fafb;
  border-color: var(--border);
  color: var(--muted);
}

/* ─── PROGRESS BAR ─── */
.progress { background: #f0fffe; }
.bg-main.progress-bar { background: var(--main) !important; }

/* ─── UTILITIES ─── */
.text-light-gray { color: #d1d5db; }

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .stat-val { font-size: 1.4rem; }
  .chat-bubble { max-width: 85%; }
  .card-header-custom { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ─── STAFF NOTE ─── */
.note-textarea {
  resize: vertical;
  min-height: 110px;
  font-size: 13px;
  line-height: 1.6;
  background: #fffef0;
  border-color: #f0e68c;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.note-textarea:focus {
  border-color: var(--main);
  box-shadow: 0 0 0 3px rgba(9,217,186,0.15);
  background: #fff;
}

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 4px; }
::-webkit-scrollbar-thumb { background: var(--main); border-radius: 4px; }

/* ─── TELEGRAM CONNECT STEPS ─── */
.tg-connect-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tg-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13px;
}
.tg-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #0088cc;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ─── NOTIFICATIONS LIST ─── */
.notify-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.notify-list li {
  padding: 5px 0;
  font-size: 13px;
  border-bottom: 1px solid #f3f4f6;
}
.notify-list li:last-child { border: none; }

/* ─── USER CHIP as link ─── */
a.user-chip:hover {
  background: var(--main-light);
  border-color: var(--main);
  text-decoration: none;
}
