@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ===== CSS Variables ===== */
:root {
  /* Layout Colors */
  --bg-body: #f8fafc;
  --bg-surface: #ffffff;
  --sidebar-bg: #0f172a;
  --sidebar-text: #94a3b8;
  --sidebar-text-hover: #f1f5f9;
  --sidebar-hover-bg: #1e293b;
  --sidebar-active-bg: #3b82f6;
  --sidebar-active-text: #ffffff;
  
  --border-color: #e2e8f0;

  /* Accent Colors */
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-light: #eff6ff;

  /* Status Colors */
  --success: #10b981;
  --success-bg: #d1fae5;
  --success-text: #065f46;
  
  --danger: #ef4444;
  --danger-bg: #fee2e2;
  --danger-text: #991b1b;
  
  --warning: #f59e0b;
  --warning-bg: #fef3c7;
  --warning-text: #92400e;

  /* Text Colors */
  --text-main: #0f172a;
  --text-muted: #64748b;
  
  /* Utilities */
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-modal: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --transition: all 0.2s ease-in-out;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg-body);
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ===== Typography ===== */
h1 { font-size: 1.875rem; font-weight: 700; color: var(--text-main); }
h2 { font-size: 1.5rem; font-weight: 600; color: var(--text-main); }
h3 { font-size: 1.25rem; font-weight: 600; color: var(--text-main); }
h4 { font-size: 1rem; font-weight: 600; color: var(--text-main); }
p { color: var(--text-muted); }
a { color: var(--accent); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-hover); }

/* ===== SVG Icons ===== */
.icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 24px; height: 24px; }

/* ===== Main Layout (Sidebar + Content) ===== */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ===== Sidebar ===== */
.sidebar {
  width: 260px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-right: 1px solid #000000;
  z-index: 50;
}
.sidebar-header {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.sidebar-header .logo-box {
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.sidebar-nav {
  padding: 20px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: var(--radius);
  color: var(--sidebar-text);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  font-size: 0.95rem;
}
.nav-item:hover {
  background: var(--sidebar-hover-bg);
  color: var(--sidebar-text-hover);
}
.nav-item.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
}
a.nav-item {
  text-decoration: none;
  font-family: inherit;
}
.sidebar-footer {
  padding: 20px;
  border-top: 1px solid rgba(255,255,255,0.05);
}
.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.user-info .avatar {
  width: 36px;
  height: 36px;
  background: #334155;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}
.user-details {
  display: flex;
  flex-direction: column;
}
.user-name { color: #fff; font-weight: 600; font-size: 0.9rem; }
.user-role { font-size: 0.75rem; color: var(--sidebar-text); }

/* ===== Main Dashboard Content ===== */
.dashboard-content {
  flex: 1;
  overflow-y: auto;
  padding: 32px 40px;
}
.page-header {
  margin-bottom: 32px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.page-title-wrap h1 { font-size: 1.875rem; margin-bottom: 4px; }
.page-title-wrap p { color: var(--text-muted); font-size: 0.95rem; }

/* ===== Stats Grid ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 20px;
}
.stat-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}
.stat-info { display: flex; flex-direction: column; }
.stat-value { font-size: 1.75rem; font-weight: 700; color: var(--text-main); line-height: 1.2; }
.stat-label { font-size: 0.85rem; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* ===== Cards & Containers ===== */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}
.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.card-title { font-size: 1.125rem; font-weight: 600; display: flex; align-items: center; gap: 8px;}
.card-body { padding: 24px; }

/* ===== Search Bar ===== */
.search-bar {
  display: flex;
  gap: 12px;
}
.search-input-wrap {
  position: relative;
  width: 260px;
}
.search-input-wrap .icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}
.search-input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.875rem;
  transition: var(--transition);
  outline: none;
}
.search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.filter-select {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.875rem;
  outline: none;
  cursor: pointer;
}

/* ===== Table ===== */
.table-wrapper { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
thead th {
  padding: 12px 24px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  background: #f8fafc;
}
tbody td {
  padding: 16px 24px;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f1f5f9; }
.table-empty {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-muted);
}
.table-empty .icon {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  color: #cbd5e1;
}

/* ===== Badges ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-open { background: var(--danger-bg); color: var(--danger-text); }
.badge-closed { background: var(--success-bg); color: var(--success-text); }
.badge-inprogress { background: rgba(245,158,11,0.12); color: #b45309; }
.badge-new { background: #e0e7ff; color: #4338ca; }
.btn-warning { background: rgba(245,158,11,0.12); color: #b45309; border: 1px solid rgba(245,158,11,0.3); }
.btn-warning:hover { background: rgba(245,158,11,0.22); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-secondary { background: #fff; color: var(--text-main); border: 1px solid var(--border-color); box-shadow: var(--shadow-sm); }
.btn-secondary:hover:not(:disabled) { background: #f8fafc; border-color: #cbd5e1; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #dc2626; }
.btn-ghost { background: transparent; color: var(--text-muted); padding: 6px; }
.btn-ghost:hover:not(:disabled) { background: #f1f5f9; color: var(--text-main); }
.btn-sm { padding: 6px 12px; font-size: 0.8125rem; }
.btn-block { width: 100%; padding: 12px; font-size: 0.95rem; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ===== Forms ===== */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.875rem;
  transition: var(--transition);
  outline: none;
}
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
textarea.form-control { resize: vertical; min-height: 100px; }

/* ===== Tags Input ===== */
.tags-input-wrapper {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 6px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 42px;
  cursor: text;
  transition: var(--transition);
}
.tags-input-wrapper:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.tag-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-body);
  border: 1px solid var(--border-color);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.8125rem;
}
.tag-remove { cursor: pointer; color: var(--text-muted); }
.tag-remove:hover { color: var(--danger); }
.tags-input { border: none; outline: none; flex: 1; min-width: 120px; font-size: 0.875rem; padding: 2px; }

/* ===== Modal (Slide-over / Center) ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  box-shadow: var(--shadow-modal);
  transform: scale(0.95) translateY(10px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.modal-overlay.active .modal { transform: scale(1) translateY(0); }
.modal-lg { max-width: 700px; }
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-title { font-size: 1.125rem; font-weight: 600; display: flex; align-items: center; gap: 8px;}
.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
}
.modal-close:hover { background: #f1f5f9; color: var(--text-main); }
.modal-body {
  padding: 24px;
  overflow-y: auto;
}
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: #f8fafc;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ===== Login Page ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  background: #ffffff;
}
.login-split-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px;
  max-width: 540px;
  margin: 0 auto;
}
.login-split-right {
  flex: 1.2;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  padding: 40px;
  position: relative;
  overflow: hidden;
}
/* Abstract pattern for login right side */
.login-split-right::before {
  content: '';
  position: absolute;
  width: 100%; height: 100%;
  background: radial-gradient(circle at top right, rgba(37, 99, 235, 0.2), transparent 50%),
              radial-gradient(circle at bottom left, rgba(16, 185, 129, 0.1), transparent 50%);
}
.login-logo-big {
  width: 80px; height: 80px;
  background: rgba(255,255,255,0.1);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  backdrop-filter: blur(10px);
}
.login-logo-big .icon { width: 40px; height: 40px; }

.login-form-container { width: 100%; max-width: 380px; margin: 0 auto; }
.login-header { margin-bottom: 32px; }
.login-header h1 { font-size: 2rem; margin-bottom: 8px; }
.login-header p { color: var(--text-muted); }
.login-error {
  background: var(--danger-bg);
  color: var(--danger-text);
  padding: 12px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 20px;
  display: none;
}
.login-error.show { display: block; }

/* ===== Ticket Details (Inside Modal) ===== */
.ticket-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}
.ticket-meta-item {
  padding: 10px 16px;
  background: var(--bg-body);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 120px;
}
.meta-label { font-size: 0.7rem; text-transform: uppercase; color: var(--text-muted); font-weight: 600; letter-spacing: 0.05em; }
.meta-value { font-size: 0.875rem; font-weight: 500; }

.ticket-description {
  background: var(--bg-body);
  border-radius: var(--radius);
  padding: 16px;
  font-size: 0.9rem;
  color: var(--text-main);
  white-space: pre-wrap;
  border: 1px solid var(--border-color);
  margin-bottom: 32px;
}

.replies-section { margin-top: 32px; }
.replies-title { font-size: 1rem; font-weight: 600; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.reply-item {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}
.reply-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: #cbd5e1;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; color: #fff;
  flex-shrink: 0;
}
.reply-avatar.admin { background: var(--sidebar-bg); }
.reply-avatar.user { background: var(--accent); }
.reply-bubble {
  flex: 1;
  background: var(--bg-body);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
}
.reply-meta { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.reply-author { font-weight: 600; font-size: 0.9rem; }
.reply-time { font-size: 0.75rem; color: var(--text-muted); }
.reply-text { font-size: 0.9rem; white-space: pre-wrap; line-height: 1.5; }

.reply-form {
  margin-top: 24px;
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
}
.reply-form textarea {
  display: block;
  width: 100%;
  min-height: 100px;
  padding: 12px 14px;
  background: var(--bg-body);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-main);
  font-size: 0.875rem;
  font-family: inherit;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.reply-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.reply-form textarea::placeholder { color: var(--text-muted); }
.reply-form-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: 12px;
  gap: 10px;
}

/* Drag-over highlight */
.reply-form.drag-over {
  outline: 2.5px dashed var(--accent);
  outline-offset: 4px;
  border-radius: var(--radius-lg);
  background: rgba(37,99,235,0.04);
}

/* Attach button (label acting as button) */
.reply-attach-btn {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Preview thumbnails before send */
.reply-image-preview {
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.attach-thumb {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  border: 1.5px solid var(--border-color);
  flex-shrink: 0;
}
.attach-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: zoom-in;
  display: block;
}
.attach-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  background: rgba(0,0,0,0.65);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 0.65rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-family: inherit;
  transition: background 0.15s;
}
.attach-remove:hover { background: rgba(239,68,68,0.85); }

/* Images inside reply bubbles */
.reply-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.reply-img-thumb {
  max-width: 220px;
  max-height: 160px;
  border-radius: 8px;
  cursor: zoom-in;
  border: 1.5px solid var(--border-color);
  object-fit: cover;
  display: block;
  transition: opacity 0.15s, transform 0.15s;
}
.reply-img-thumb:hover { opacity: 0.88; transform: scale(1.02); }


/* ===== Unread Banner ===== */
@keyframes unread-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(99,102,241,0.15); }
  50%       { box-shadow: 0 0 0 6px rgba(99,102,241,0.05); }
}
@keyframes banner-slide-in {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.unread-banner-box {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(99,102,241,0.04));
  border: 1.5px solid rgba(99,102,241,0.3);
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 20px;
  animation: banner-slide-in 0.3s ease;
}
.unread-banner-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  background: rgba(99,102,241,0.12);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.unread-banner-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.unread-banner-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.unread-ticket-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s, transform 0.15s;
}
.unread-ticket-btn:hover { opacity: 0.88; transform: translateY(-1px); }
.unread-ticket-badge {
  background: rgba(255,255,255,0.28);
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 0.75rem;
}

/* ===== Date Filter Row ===== */
.date-filter-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border-color);
  background: #f8fafc;
}
.date-btn {
  padding: 5px 14px;
  border: 1.5px solid var(--border-color);
  border-radius: 999px;
  background: #fff;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition);
  font-family: inherit;
}
.date-btn:hover { background: #f1f5f9; border-color: #cbd5e1; }
.date-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ===== Pagination ===== */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 20px;
  border-top: 1px solid var(--border-color);
}
.pag-info {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-right: 8px;
}
.pag-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 8px !important;
  font-size: 0.8125rem !important;
  border-radius: var(--radius) !important;
}
.pag-dots {
  padding: 0 4px;
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 32px;
}

/* ===== Toast ===== */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.toast {
  background: #1e293b;
  color: #fff;
  padding: 14px 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.875rem;
  font-weight: 500;
  animation: slideIn 0.3s ease;
}
.toast .icon { color: var(--success); }
.toast.error .icon { color: var(--danger); }
.toast.removing { animation: fadeOut 0.3s ease forwards; }

@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; transform: scale(0.9); } }

/* ===== Chips / Numbers ===== */
.numbers-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.number-chip {
  padding: 6px 12px;
  background: var(--bg-body);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}
.number-chip:hover { background: #e2e8f0; }
.number-chip.selected { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ===== BOTTOM NAV (Mobile) ===== */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 60px;
  background: var(--sidebar-bg);
  border-top: 1px solid rgba(255,255,255,0.08);
  z-index: 200;
  align-items: stretch;
}
.mobile-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  transition: color 0.15s;
  cursor: pointer;
  border: none;
  background: transparent;
  font-family: inherit;
}
.mobile-nav-item svg { width: 20px; height: 20px; }
.mobile-nav-item.active { color: #fff; }
.mobile-nav-item:active { opacity: 0.7; }

/* ===== TICKET CARDS (Mobile) ===== */
.ticket-cards { display: none; flex-direction: column; gap: 10px; padding: 0 0 80px; }
.ticket-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.ticket-card:active { box-shadow: 0 0 0 2px var(--accent); border-color: var(--accent); }
.ticket-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.ticket-card-num { font-size: 0.72rem; color: var(--text-muted); font-weight: 600; }
.ticket-card-subject {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ticket-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.ticket-card-user {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}
.ticket-card-user svg { width: 12px; height: 12px; flex-shrink: 0; }
.ticket-card-date {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-left: auto;
}
.ticket-card-replies {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 3px;
}
.ticket-card-replies svg { width: 12px; height: 12px; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  /* Layout */
  .app-layout { flex-direction: column; overflow: auto; height: auto; min-height: 100vh; }
  .sidebar { display: none; } /* hidden — replaced by bottom nav */
  .mobile-bottom-nav { display: flex; }
  .dashboard-content { padding: 14px 14px 0; }

  /* Login */
  .login-page { flex-direction: column; }
  .login-split-right { display: none; }
  .login-split-left { padding: 32px 24px; }

  /* Page header */
  .page-header {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 14px;
  }
  .page-title-wrap h1 { font-size: 1.25rem; }
  .page-title-wrap p { display: none; }

  /* Stats grid — 2 columns on mobile */
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
  .stat-card { padding: 12px 14px; gap: 10px; }
  .stat-icon-wrap { width: 36px; height: 36px; }
  .stat-value { font-size: 1.35rem; }
  .stat-label { font-size: 0.72rem; }

  /* Card */
  .card { margin-bottom: 14px; }
  .card-header { padding: 14px 14px; flex-wrap: wrap; gap: 10px; }
  .card-title { font-size: 1rem; }

  /* Search bar */
  .search-bar { flex-wrap: wrap; gap: 8px; }
  .search-input-wrap { flex: 1 1 100%; }
  .filter-select { flex: 1; min-width: 0; }

  /* Date filter */
  .date-filter-row { flex-wrap: wrap; padding: 8px 12px; gap: 6px; }
  .date-btn { flex: 1 1 auto; min-width: 60px; text-align: center; font-size: 0.75rem; padding: 5px 8px; }
  #tickets-count-info { width: 100%; text-align: center; }

  /* Table → hide on mobile, show cards */
  .table-wrapper { display: none; }
  .ticket-cards { display: flex; }
  #tickets-pagination { padding: 0 0 14px; }

  /* Pagination */
  .pagination { padding: 10px 14px; }
  .pag-info { font-size: 0.75rem; }

  /* Modal — sheet from bottom, footer always visible */
  .modal-overlay {
    bottom: 60px; /* stay above mobile nav bar */
    align-items: flex-end;
  }
  .modal {
    max-width: 100%;
    max-height: calc(90vh - 60px);
    border-radius: 20px 20px 0 0;
    align-self: flex-end;
    display: flex;
    flex-direction: column;
  }
  .modal-overlay.active .modal { transform: scale(1) translateY(0); }
  .modal-body { padding: 14px; flex: 1; overflow-y: auto; }
  .modal-footer {
    padding: 12px 14px;
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 8px;
  }
  .modal-footer .btn { flex: 1; justify-content: center; min-width: 120px; }

  /* Ticket Meta inside modal */
  .ticket-meta { flex-direction: column; gap: 8px; }
  .reply-item { flex-direction: column; gap: 8px; }
}

/* ===== Notification Cards (user push) ===== */
@keyframes notif-pop-in {
  0%   { opacity: 0; transform: scale(0.82) translateY(20px); }
  70%  { opacity: 1; transform: scale(1.03) translateY(-4px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes notif-pop-out {
  0%   { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.88) translateY(12px); }
}
@keyframes notif-glow-pulse {
  0%,100% { opacity: 0.4; transform: scale(1); }
  50%      { opacity: 0.7; transform: scale(1.08); }
}

/* Full-screen backdrop when a notif is showing */
#notif-cards-container::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: -1;
  pointer-events: all;
}

.notif-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: linear-gradient(145deg, #1e1f2e, #16172a);
  border: 1.5px solid rgba(99,102,241,0.35);
  border-radius: 22px;
  padding: 32px 28px 24px;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04),
    0 24px 64px rgba(0,0,0,0.55),
    0 0 80px rgba(99,102,241,0.18);
  animation: notif-pop-in 0.45s cubic-bezier(0.34,1.56,0.64,1) forwards;
  text-align: center;
  overflow: hidden;
}

/* Gradient glow blob */
.notif-card-glow {
  position: absolute;
  top: -40px; left: 50%; transform: translateX(-50%);
  width: 200px; height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,0.35) 0%, transparent 70%);
  animation: notif-glow-pulse 3s ease-in-out infinite;
  pointer-events: none;
}

/* Large emoji icon */
.notif-card-icon-big {
  font-size: 2.6rem;
  line-height: 1;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 0 12px rgba(99,102,241,0.6));
}

/* Header: just the title */
.notif-card-header {
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}
.notif-card-title {
  font-weight: 800;
  font-size: 1.15rem;
  color: #f1f5f9;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

/* Body text */
.notif-card-body {
  font-size: 0.925rem;
  color: #94a3b8;
  line-height: 1.65;
  margin-bottom: 24px;
  white-space: pre-wrap;
  position: relative;
  z-index: 1;
}

/* Footer: time left, dismiss button */
.notif-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: relative;
  z-index: 1;
}
.notif-card-time {
  font-size: 0.75rem;
  color: #475569;
}
.notif-card-dismiss {
  flex: 1;
  padding: 11px 20px;
  background: linear-gradient(135deg, #6366f1, #818cf8);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
  letter-spacing: -0.01em;
}
.notif-card-dismiss:hover { opacity: 0.88; transform: translateY(-1px); }
.notif-card-dismiss:active { transform: translateY(0); }

