/* ============================================================
   Help Desk  |  Stylesheet
   iOS-Inspired Design with SF Pro Typography
   ============================================================ */

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

/* ===== CSS VARIABLES ===== */
:root {
  /* Nexo Controls Color Palette */
  --blue:        #27438b;
  --blue-90:     #1e3366;
  --blue-70:     #525e98;
  --blue-50:     #747aaa;
  --blue-30:     #a6a5a3;
  --orange:      #fc832b;
  --orange-80:   #ea9b60;
  --orange-60:   #eeb280;
  --orange-40:   #eeb280;
  --orange-20:   #f2c8a2;
  --grey:        #545454;
  --grey-90:     #3d3d3d;
  --grey-70:     #6c6c69;
  --grey-50:     #868583;
  --grey-30:     #E5E5EA;
  --dark:        #000000;

  /* Semantic */
  --text:        #000000;
  --text-secondary: #545454;
  --text-muted:  #868583;
  --border:      #C6C6C8;
  --border-light:#E5E5EA;
  --bg:          #F2F2F7;
  --bg-card:     #FFFFFF;
  --bg-subtle:   #F9F9F9;

  /* Sidebar */
  --sidebar-bg:      #27438b;
  --sidebar-hover:   #1e3366;
  --sidebar-active:  #525e98;
  --sidebar-border:  rgba(255,255,255,0.15);
  --sidebar-text:    rgba(255,255,255,0.75);
  --sidebar-text-active: #FFFFFF;

  /* Actions */
  --primary:     #27438b;
  --primary-hover:#1e3366;
  --primary-active:#525e98;
  --secondary:   #545454;
  --secondary-hover:#3d3d3d;
  --success:     #34C759;
  --success-hover:#28A745;
  --danger:      #c0392b;
  --danger-hover:#a02f23;
  --warning:     #fc832b;
  --warning-hover:#ea9b60;
  --info:        #27438b;

  /* Focus */
  --focus-ring:  rgba(0,122,255,0.25);
  --focus-border:#007AFF;

  /* Radius - iOS uses more generous corner radius */
  --radius:      10px;
  --radius-lg:   16px;
  --radius-xl:   20px;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; height: 100%; } /* iOS uses slightly larger base font */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  font-weight: 400;
  background: var(--bg);
  color: var(--text);
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--primary); text-decoration: none; }
a:hover { opacity: 0.7; }
button { cursor: pointer; font-family: inherit; font-size: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }
table { border-collapse: collapse; width: 100%; }

/* iOS-Style Headings */
h1 { font-weight: 700; font-size: 34px; color: var(--text); letter-spacing: -0.5px; } /* Large Title */
h2 { font-weight: 700; font-size: 28px; color: var(--text); letter-spacing: -0.5px; } /* Title 1 */
h3 { font-weight: 600; font-size: 22px; color: var(--text); letter-spacing: -0.3px; } /* Title 2 */
h4 { font-weight: 600; font-size: 20px; color: var(--text); letter-spacing: -0.2px; } /* Title 3 */
h5 { font-weight: 600; font-size: 17px; color: var(--text); } /* Headline */

/* ===== LOGIN SCREEN ===== */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: var(--bg);
}
.login-card {
  background: var(--sidebar-bg);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  color: #fff;
}
.login-header {
  text-align: center;
  margin-bottom: 28px;
}
.login-header .login-logo {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-header .login-logo svg {
  width: 48px;
  height: 48px;
}
.login-header h2 {
  font-size: 22px;
  font-weight: 500;
  color: #fff;
  margin-bottom: 4px;
}
.login-header p {
  font-size: 13px;
  color: rgba(255,255,255,0.92);
}
.login-card .form-group label,
.login-card label,
.login-card .text-muted,
.login-card small {
  color: #ffffff;
}
.login-card .form-group { margin-bottom: 16px; }
.login-card .form-control {
  background: #ffffff;
  color: var(--dark);
  border-color: rgba(255,255,255,0.2);
}
.login-card .form-control:focus {
  border-color: #fff;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.15);
}
.login-card .form-error {
  min-height: 18px;
  margin-bottom: 8px;
  font-size: 12px;
  color: #ffb4b4;
}
.login-btn {
  width: 100%;
  justify-content: center;
  background: #fff;
  color: var(--sidebar-bg);
  border: none;
}
.login-btn:hover { background: #f1f4fb; color: var(--sidebar-bg); }

/* ===== LOGOUT BUTTON ===== */
.logout-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  font-size: 14px;
  padding: 4px 6px;
  border-radius: var(--radius);
  cursor: pointer;
  flex-shrink: 0;
  transform: rotate(180deg);
  transition: color 0.15s, background 0.15s;
}
.logout-btn:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
}
#sidebar.collapsed .logout-btn { display: none; }

/* ===== LAYOUT ===== */
#app { display: flex; height: 100vh; }

/* ===== SIDEBAR ===== */
#sidebar {
  width: 80px;
  min-width: 80px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  transition: width 0.35s cubic-bezier(0.175, 0.685, 0.32, 1);
  z-index: 100;
  overflow: hidden;
}
#sidebar:hover {
  width: 250px;
}
#sidebar::-webkit-scrollbar {
  width: 8px;
  background-color: transparent;
}
#sidebar::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
}
#sidebar::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.5);
}

.sidebar-header {
  padding: 0 8px;
  margin-bottom: 24px;
  width: 100%;
  height: 80px;
  background: transparent;
  display: flex;
  align-items: center;
}
.sidebar-header-inner {
  display: flex;
  align-items: center;
  width: 100%;
}
.sidebar-header-inner:hover {
  background-color: transparent;
}
.logo-placeholder {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}
.logo-placeholder svg {
  width: 36px;
  height: 36px;
}
.logo-placeholder::before {
  display: none;
}
.logo-notif-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--orange);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 12px;
  min-width: 20px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.sidebar-header-text {
  width: 0;
  opacity: 0;
  overflow: hidden;
  transition: all 0.35s cubic-bezier(0.175, 0.685, 0.32, 1);
}
#sidebar:hover .sidebar-header-text {
  width: calc(100% - 64px);
  opacity: 1;
}
.sidebar-header h1 {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.2;
  color: #fff;
  margin: 0;
}

.sidebar-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 8px 0; }
.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}
.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}
.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.3);
}
.sidebar-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(255,255,255,0.4);
  padding: 20px 8px 8px 8px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.35s cubic-bezier(0.175, 0.685, 0.32, 1);
}
.sidebar-section-title {
  opacity: 0;
}
#sidebar:hover .sidebar-section-title {
  opacity: 1;
}
.nav-item {
  padding: 0 8px;
  width: 100%;
  cursor: pointer;
}
.nav-item-inner {
  display: flex;
  align-items: center;
  padding: 12px 0;
  width: 100%;
  position: relative;
  color: var(--sidebar-text);
  border-radius: 8px;
  transition: all 0.2s cubic-bezier(0.175, 0.685, 0.32, 1);
}
.nav-item-inner:hover {
  background: var(--sidebar-hover);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.nav-item.active .nav-item-inner {
  background: var(--sidebar-active);
  color: #fff;
}
.nav-icon-wrapper {
  width: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}
.nav-icon {
  font-size: 22px;
}
ion-icon.nav-icon {
  font-size: 22px;
  display: block;
}
.sidebar-label {
  margin: 0;
  width: 0;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: all 0.35s cubic-bezier(0.175, 0.685, 0.32, 1);
  overflow: hidden;
  opacity: 0;
  font-size: 15px;
  font-weight: 500;
}
#sidebar:hover .sidebar-label {
  width: calc(100% - 64px);
  opacity: 1;
}
.nav-badge {
  margin-left: auto;
  background: rgba(255, 149, 0, 0.9);
  color: #fff;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 12px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.35s cubic-bezier(0.175, 0.685, 0.32, 1);
}
#sidebar:hover .nav-badge {
  opacity: 1;
}
#topbar .toggle-sidebar {
  display: none;
}

.sidebar-footer {
  padding: 8px 0;
  margin-top: auto;
  width: 100%;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.sidebar-footer .nav-item {
  padding: 0 8px;
}

.sidebar-user {
  padding: 0 8px 16px;
  width: 100%;
}
.sidebar-user-inner {
  display: flex;
  align-items: center;
  padding: 12px 0;
  border-radius: 8px;
  transition: all 0.2s cubic-bezier(0.175, 0.685, 0.32, 1);
  cursor: pointer;
}
.sidebar-user-inner:hover {
  background: var(--sidebar-hover);
}
.sidebar-user-avatar-wrapper {
  width: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sidebar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}
.sidebar-user-info {
  width: 0;
  opacity: 0;
  overflow: hidden;
  transition: all 0.35s cubic-bezier(0.175, 0.685, 0.32, 1);
}
#sidebar:hover .sidebar-user-info {
  width: calc(100% - 64px);
  opacity: 1;
}
.sidebar-user-info span { display: block; }
.sidebar-user-info .user-name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-info .user-role {
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.sidebar-user .logout-btn {
  opacity: 0;
  width: 0;
  overflow: hidden;
  padding: 4px 0;
  font-size: 18px;
  transform: none;
}
#sidebar:hover .sidebar-user .logout-btn {
  opacity: 1;
  width: auto;
  padding: 4px 6px;
}

/* View As dropdown (super admin) */
.view-as-wrap {
  padding: 0 12px 4px;
  width: 100%;
  overflow: hidden;
  opacity: 0;
  max-height: 0;
  transition: all 0.35s cubic-bezier(0.175, 0.685, 0.32, 1);
}
#sidebar:hover .view-as-wrap:not(.hidden) {
  opacity: 1;
  max-height: 50px;
}
.view-as-select {
  width: 100%;
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 12px;
  cursor: pointer;
  outline: none;
}
.view-as-select:hover { border-color: rgba(255,255,255,0.4); }
.view-as-select option { background: var(--sidebar-bg); color: #fff; }
.view-as-active {
  border-color: var(--orange) !important;
  box-shadow: 0 0 0 1px var(--orange);
}

/* ===== MAIN CONTENT ===== */
#main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ===== TOP BAR ===== */
#topbar {
  height: 56px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 0.5px solid var(--border-light);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  flex-shrink: 0;
  position: relative;
}
#topbar .toggle-sidebar {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--grey-70);
  padding: 6px;
}
#topbar .toggle-sidebar ion-icon {
  font-size: 22px;
  display: block;
}
#topbar .toggle-sidebar:hover { color: var(--dark); }
.topbar-search {
  flex: 1;
  max-width: 400px;
  position: relative;
}
.topbar-search input {
  width: 100%;
  padding: 7px 12px 7px 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
  outline: none;
  transition: border-color 0.15s;
}
.topbar-search input:focus { border-color: var(--focus-border); background: #fff; }
.topbar-search .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--grey-50);
  font-size: 14px;
}
.topbar-search ion-icon.search-icon {
  font-size: 18px;
  display: block;
}
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.topbar-btn {
  background: none;
  border: none;
  font-size: 16px;
  color: var(--grey-70);
  padding: 6px 8px;
  border-radius: var(--radius);
  position: relative;
}
.topbar-btn ion-icon {
  font-size: 22px;
  display: block;
}
.topbar-btn:hover { background: var(--bg); color: var(--dark); }
.topbar-btn .notif-dot {
  position: absolute;
  top: 4px; right: 4px;
  width: 8px; height: 8px;
  background: var(--orange);
  border-radius: 50%;
  border: 2px solid #fff;
}

/* ===== CONTENT AREA ===== */
#content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px;
  min-width: 0;
}

/* ===== PAGE HEADER ===== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-header h2 { font-size: 26px; font-weight: 400; color: var(--dark); }
.page-header-sub { color: var(--text-muted); font-size: 13px; margin-top: 2px; }
.page-actions { display: flex; gap: 8px; align-items: center; }

/* ===== BUTTONS (iOS Style) ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 20px;
  border: none;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 15px;
  transition: opacity 0.2s, transform 0.1s;
  white-space: nowrap;
  letter-spacing: -0.2px;
}
.btn ion-icon {
  font-size: 18px;
  display: block;
}
.btn:active { transform: scale(0.97); }

/* Primary = iOS Blue filled */
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { opacity: 0.85; }

/* Secondary = iOS Gray filled */
.btn-secondary {
  background: var(--grey-30);
  color: var(--text);
}
.btn-secondary:hover { opacity: 0.85; }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { opacity: 0.85; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: 0.85; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { opacity: 0.85; }

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 12px 28px; font-size: 17px; font-weight: 700; }

.btn-ghost {
  background: transparent;
  color: var(--primary);
  font-weight: 400;
  padding: 6px 12px;
}
.btn-ghost:hover { background: rgba(0,122,255,0.08); }

.btn-icon {
  width: 34px; height: 34px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--grey-30);
  color: var(--text);
  border: none;
}
.btn-icon:hover { opacity: 0.85; }

/* ===== CARDS ===== */
.card {
  background: #ffffff;
  border: none;
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 0.5px solid var(--border-light);
}
.card-header h3 { font-size: 20px; font-weight: 600; color: var(--text); letter-spacing: -0.2px; }
.card-body { }

/* ===== STATS GRID ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: #ffffff;
  border: none;
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.stat-icon {
  width: 42px; height: 42px;
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.stat-icon ion-icon {
  font-size: 24px;
  display: block;
}
.stat-icon.blue { background: #a6a5a3; color: var(--blue); }
.stat-icon.green { background: #d4edda; color: var(--success); }
.stat-icon.orange { background: var(--orange-20); color: var(--orange); }
.stat-icon.red { background: #f5d5d0; color: var(--danger); }
.stat-icon.purple { background: #a6a5a3; color: var(--blue-90); }
.stat-icon.slate { background: var(--bg); color: var(--grey); }
.stat-info h4 { font-size: 22px; font-weight: 800; color: var(--dark); }
.stat-info p { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ===== TABLE ===== */
.table-wrapper {
  background: #ffffff;
  border: none;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.table-toolbar {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border-light);
  flex-wrap: wrap;
}
.table-toolbar .filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
}
.table-toolbar select,
.table-toolbar input[type="text"],
.table-toolbar input[type="search"] {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
  font-size: 12px;
  outline: none;
}
.table-toolbar select:focus,
.table-toolbar input:focus { border-color: var(--focus-border); }
.table-count { margin-left: auto; font-size: 12px; color: var(--text-muted); }

table.data-table { width: 100%; }
table.data-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 600;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  position: relative;
}
table.data-table th:hover { color: var(--dark); }
table.data-table th .sort-arrow { margin-left: 4px; font-size: 10px; opacity: 0.4; }
table.data-table th.sort-active .sort-arrow { opacity: 1; color: var(--primary); }
table.data-table th[data-sort]:hover .sort-arrow { opacity: 0.7; }
table.data-table thead tr.filter-row th {
  padding: 4px 6px;
  border-bottom: 2px solid var(--border);
  cursor: default;
}
table.data-table thead tr.filter-row th select {
  width: 100%;
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  font-size: 11px;
  outline: none;
  color: var(--text);
  cursor: pointer;
}
table.data-table thead tr.filter-row th select:focus { border-color: var(--focus-border); }
table.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
  vertical-align: middle;
}
table.data-table tr:last-child td { border-bottom: none; }
table.data-table tr:hover td { background: var(--bg-subtle); }
table.data-table tr.clickable { cursor: pointer; }

.table-footer {
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-light);
  font-size: 12px;
  color: var(--text-muted);
}
.table-pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}
.table-pagination .pagination-btns { display: flex; gap: 4px; }
.table-pagination button {
  padding: 5px 10px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 4px;
  font-size: 12px;
  color: var(--grey);
}
.table-pagination button:hover { background: var(--bg); }
.table-pagination button.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.table-pagination button:disabled { opacity: 0.4; cursor: default; }

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  gap: 4px;
  letter-spacing: 0.2px;
}
.badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  display: inline-block;
}
.badge-submitted { background: var(--grey-30); color: var(--grey); }
.badge-submitted .badge-dot { background: var(--grey); }
.badge-support { background: rgba(39,67,139,0.15); color: var(--blue); }
.badge-support .badge-dot { background: var(--blue); }
.badge-dev { background: rgba(252,131,43,0.15); color: var(--orange); }
.badge-dev .badge-dot { background: var(--orange); }
.badge-confirmed { background: rgba(82,94,152,0.15); color: #525e98; }
.badge-confirmed .badge-dot { background: #525e98; }
.badge-fixed { background: rgba(252,131,43,0.15); color: var(--orange); }
.badge-fixed .badge-dot { background: var(--orange); }
.badge-tested { background: rgba(52,199,89,0.15); color: var(--success); }
.badge-tested .badge-dot { background: var(--success); }
.badge-assigned { background: rgba(139,92,246,0.15); color: #8b5cf6; }
.badge-assigned .badge-dot { background: #8b5cf6; }
.badge-development { background: rgba(252,131,43,0.15); color: var(--orange); }
.badge-development .badge-dot { background: var(--orange); }
.badge-testing { background: rgba(230,168,23,0.15); color: #c49000; }
.badge-testing .badge-dot { background: #e6a817; }
.badge-release { background: rgba(52,199,89,0.15); color: var(--success); }
.badge-release .badge-dot { background: var(--success); }
.badge-closed { background: rgba(107,114,128,0.15); color: #6b7280; }
.badge-closed .badge-dot { background: #6b7280; }

.badge-critical { background: rgba(192,57,43,0.15); color: var(--danger); }
.badge-high { background: rgba(252,131,43,0.15); color: var(--orange); }
.badge-medium { background: rgba(234,155,96,0.15); color: var(--orange-80); }
.badge-low { background: rgba(52,199,89,0.15); color: var(--success); }

.badge-internal { background: rgba(39,67,139,0.15); color: var(--blue); }
.badge-external { background: rgba(252,131,43,0.15); color: var(--orange); }
.badge-team { font-size: 11px; padding: 2px 8px; border-radius: 10px; font-weight: 600; }
.team-checkboxes { display: flex; gap: 12px; flex-wrap: wrap; padding: 6px 0; }
.team-checkbox-label { display: flex; align-items: center; gap: 5px; font-size: 13px; cursor: pointer; }
.team-checkbox-label input { cursor: pointer; }

.category-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}

/* ===== AVATAR ===== */
.avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.avatar.lg { width: 40px; height: 40px; font-size: 16px; }
.avatar.xl { width: 56px; height: 56px; font-size: 22px; }
.avatar-group { display: flex; }
.avatar-group .avatar { margin-left: -6px; border: 2px solid #fff; }
.avatar-group .avatar:first-child { margin-left: 0; }

/* ===== FORMS ===== */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-grid .full-width { grid-column: 1 / -1; }
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--grey);
  margin-bottom: 5px;
}
.form-group label .required { color: var(--danger); margin-left: 2px; }
.form-control {
  width: 100%;
  padding: 11px 14px;
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-size: 15px;
}
.form-control:focus {
  border-color: var(--focus-border);
  box-shadow: 0 0 0 4px var(--focus-ring);
}
.form-control.error { border-color: var(--danger); }
.form-hint { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 13px; color: var(--danger); margin-top: 4px; }
textarea.form-control { min-height: 100px; resize: vertical; line-height: 1.4; }
select.form-control { cursor: pointer; }

.form-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.form-row .form-group { flex: 1; }

.form-section {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-light);
}
.form-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.form-section h4 {
  font-size: 15px;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 14px;
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal {
  background: #ffffff;
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 640px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  transform: translateY(-20px);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-overlay.active .modal { transform: translateY(0); }
.modal.modal-lg { max-width: 800px; }
.modal.modal-xl { max-width: 1000px; }
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 { font-size: 18px; font-weight: 500; }
.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-muted);
  padding: 4px;
  line-height: 1;
}
.modal-close:hover { color: var(--dark); }
.modal-body { padding: 20px; max-height: 60vh; overflow-y: auto; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ===== TICKET STATUS TABS ===== */
.ticket-status-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  width: fit-content;
}
.ticket-status-tab {
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  background: #fff;
  border: none;
  border-right: 1px solid var(--border);
  transition: all 0.15s;
}
.ticket-status-tab:last-child { border-right: none; }
.ticket-status-tab:hover { background: var(--bg-subtle); color: var(--text); }
.ticket-status-tab.active { background: var(--blue); color: #fff; }

/* ===== CHAT EDIT BUTTON ===== */
.btn-edit-chat {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
  font-size: 13px;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
  display: inline-flex;
  align-items: center;
}
.chat-message:hover .btn-edit-chat { opacity: 1; }
.btn-edit-chat:hover { color: var(--blue); }
.btn-delete-chat {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
  font-size: 13px;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
  display: inline-flex;
  align-items: center;
}
.chat-message:hover .btn-delete-chat { opacity: 1; }
.btn-delete-chat:hover { color: var(--danger); }
.chat-edit-textarea {
  width: 100%;
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
}

/* ===== TABS ===== */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--border-light);
  margin-bottom: 20px;
  gap: 0;
}
.tab {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}
.tab:hover { color: var(--dark); }
.tab.active { color: var(--orange); border-bottom-color: var(--orange); }

/* ===== @MENTION AUTOCOMPLETE ===== */
.mention-input-wrapper {
  position: relative;
}
.mention-dropdown {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  z-index: 100;
  margin-bottom: 2px;
}
.mention-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.1s;
}
.mention-item:hover, .mention-item.active {
  background: var(--bg-subtle);
}
.mention-item-name { font-weight: 600; color: var(--text); }
.mention-item-role { font-size: 11px; color: var(--text-muted); }
.avatar.xs {
  width: 24px;
  height: 24px;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: white;
  font-weight: 700;
  flex-shrink: 0;
}
.mention-tag {
  background: rgba(39, 67, 139, 0.1);
  color: var(--blue);
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 3px;
}

/* ===== NOTIFICATION BELL & PANEL ===== */
.help-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}
.help-btn:hover { color: #fff; }
.notif-bell-btn {
  position: relative;
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}
.notif-bell-btn:hover { color: #fff; }
.notif-bell-badge {
  position: absolute;
  top: -4px;
  right: -6px;
  background: var(--danger, #e74c3c);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
}
.notif-panel {
  position: fixed;
  bottom: 70px;
  left: 10px;
  width: 360px;
  max-height: 480px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
}
.notif-panel-header h4 { margin: 0; font-size: 14px; font-weight: 700; }
.notif-panel-body {
  overflow-y: auto;
  flex: 1;
  max-height: 400px;
}
.notif-item {
  display: flex;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.1s;
  border-bottom: 1px solid var(--border-light);
  align-items: flex-start;
}
.notif-item:hover { background: var(--bg-subtle); }
.notif-item:last-child { border-bottom: none; }
.notif-item.notif-read { opacity: 0.6; }
.notif-item-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: transparent;
  flex-shrink: 0;
  margin-top: 5px;
}
.notif-item-dot.unread { background: var(--blue); }
.notif-item-content { flex: 1; min-width: 0; }
.notif-item-text { font-size: 13px; line-height: 1.4; color: var(--text); }
.notif-item-preview {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notif-item-time { font-size: 11px; color: var(--grey-50); margin-top: 2px; }

/* ===== ISSUE DETAIL ===== */
/* ===== TICKET DETAIL LAYOUT ===== */
.ticket-detail-layout, .issue-detail-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
  align-items: flex-start;
}
.ticket-main, .issue-main { min-width: 0; }
.ticket-sidebar-panel, .issue-sidebar-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ticket-title-bar, .issue-title-bar {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
}
.ticket-id, .issue-id {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  display: inline-block;
}
.ticket-title-bar h2, .issue-title-bar h2 { font-size: 22px; font-weight: 400; flex: 1; }
.ticket-title-bar .ticket-actions, .issue-title-bar .issue-actions { display: flex; gap: 6px; flex-shrink: 0; }

.ticket-meta-grid, .issue-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.ticket-meta-item, .issue-meta-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}
.ticket-meta-item:last-child, .issue-meta-item:last-child {
  border-bottom: none;
}
.ticket-meta-item .meta-label, .issue-meta-item .meta-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  margin-bottom: 6px;
}
.ticket-meta-item .meta-value, .issue-meta-item .meta-value {
  font-size: 13px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.description-block {
  padding: 0;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  color: var(--text-secondary);
}

/* ===== ESCALATION PIPELINE ===== */
.escalation-pipeline {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
}
.escalation-step {
  padding: 8px 12px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--grey-50);
  background: var(--bg-subtle);
  border-radius: 6px;
  position: relative;
  cursor: pointer;
  transition: all 0.2s;
  border-left: 3px solid var(--border);
}
.escalation-step.active {
  background: rgba(39, 67, 139, 0.1);
  color: var(--blue);
  border-left-color: var(--blue);
  font-weight: 700;
}
.escalation-step.completed {
  background: rgba(52, 199, 89, 0.1);
  color: var(--success);
  border-left-color: var(--success);
}
.escalation-step:hover:not(.active):not(.completed):not(.auto-step) {
  background: var(--bg);
  color: var(--grey);
}
.escalation-step.auto-step {
  cursor: default;
  font-style: italic;
}
.escalation-step.auto-step::after {
  content: ' (auto)';
  font-size: 10px;
  font-weight: 400;
  opacity: 0.6;
}

/* ===== CHAT ===== */
.chat-section { margin-top: 16px; }
.chat-messages { max-height: 400px; overflow-y: auto; padding: 4px 0; }
.chat-message {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}
.chat-message:last-child { border-bottom: none; }
.chat-message .chat-avatar { flex-shrink: 0; margin-top: 2px; }
.chat-message .chat-content { flex: 1; min-width: 0; }
.chat-message .chat-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}
.chat-message .chat-author { font-weight: 600; font-size: 13px; color: var(--dark); }
.chat-message .chat-time { font-size: 11px; color: var(--grey-50); }
.chat-message .chat-text { font-size: 13px; line-height: 1.6; color: var(--text-secondary); white-space: pre-wrap; }
.chat-message.private {
  background: var(--orange-20);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin: 4px 0;
  border: 1px solid var(--orange-40);
}
.chat-message.private .private-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--orange);
  font-weight: 700;
}

.chat-input-area {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative;
}
.chat-input-area textarea {
  width: 100%;
  border: none;
  padding: 10px 12px;
  resize: none;
  outline: none;
  min-height: 70px;
  font-size: 13px;
}
.chat-input-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-light);
}
.chat-input-toolbar label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
}
.chat-input-toolbar label input { cursor: pointer; }

/* ===== TIME TRACKING ===== */
.time-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
}
.time-entry:last-child { border-bottom: none; }
.time-entry .time-hours {
  font-weight: 700;
  color: var(--dark);
  min-width: 50px;
}
.time-entry .time-user { color: var(--blue); font-weight: 500; }
.time-entry .time-date { color: var(--grey-50); font-size: 11px; margin-left: auto; }
.time-entry .time-note { color: var(--text-muted); }

.time-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  margin-top: 8px;
  border-top: 2px solid var(--border-light);
  font-weight: 700;
  font-size: 14px;
}

/* ===== TESTING ===== */
.test-entry {
  padding: 12px 14px;
  border-radius: var(--radius);
  margin-bottom: 10px;
  border-left: 4px solid var(--border);
  background: var(--bg-subtle);
}
.test-entry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}
.test-entry-comment {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
  white-space: pre-wrap;
  padding-left: 42px;
}
.test-result-working {
  border-left-color: var(--success);
  background: rgba(52, 199, 89, 0.06);
}
.test-result-not-working {
  border-left-color: var(--danger, #e74c3c);
  background: rgba(231, 76, 60, 0.06);
}
.test-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.test-badge-working {
  background: rgba(52, 199, 89, 0.15);
  color: var(--success);
}
.test-badge-not-working {
  background: rgba(231, 76, 60, 0.15);
  color: var(--danger, #e74c3c);
}
.test-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text);
}
.test-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
  cursor: pointer;
}
.test-form {
  border-top: 1px solid var(--border-light);
  padding-top: 16px;
}

/* ===== REPORTS ===== */
.report-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.chart-container {
  background: #ffffff;
  border: none;
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.chart-container h4 {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--dark);
}
.bar-chart { display: flex; flex-direction: column; gap: 8px; }
.bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.bar-label {
  width: 100px;
  font-size: 12px;
  color: var(--text-secondary);
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bar-track {
  flex: 1;
  height: 24px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
  display: flex;
  align-items: center;
  padding-left: 8px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}
.bar-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--dark);
  width: 32px;
  text-align: right;
}

.donut-chart {
  width: 160px;
  height: 160px;
  margin: 0 auto 16px;
  position: relative;
}
.donut-chart canvas { width: 100%; height: 100%; }
.donut-center {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}
.donut-center .donut-value { font-size: 24px; font-weight: 800; color: var(--dark); }
.donut-center .donut-label { font-size: 11px; color: var(--text-muted); }
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-secondary);
}
.legend-dot { width: 10px; height: 10px; border-radius: 3px; }

/* ===== KNOWLEDGE BASE ===== */
.kb-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}
.kb-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.kb-tab ion-icon { font-size: 16px; }
.kb-tab:hover { color: var(--text); }
.kb-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.kb-tab-sep {
  width: 1px;
  background: var(--border);
  margin: 6px 8px;
  align-self: stretch;
}

/* ===== SETTINGS ===== */
.settings-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
}
.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.settings-nav-item {
  padding: 8px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
  transition: all 0.15s;
  border: none;
  background: none;
  text-align: left;
}
.settings-nav-item:hover { background: var(--bg); color: var(--dark); }
.settings-nav-item.active { background: var(--blue-30); color: var(--blue); font-weight: 600; }
.settings-panel { }

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  max-width: 400px;
  animation: slideIn 0.2s ease;
  font-size: 13px;
}
.toast.toast-success { border-left: 4px solid var(--success); }
.toast.toast-error { border-left: 4px solid var(--danger); }
.toast.toast-info { border-left: 4px solid var(--blue); }
.toast.toast-warning { border-left: 4px solid var(--orange); }
.toast-icon { font-size: 16px; flex-shrink: 0; }
ion-icon.toast-icon { font-size: 20px; display: block; }
.toast-close {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--grey-50);
  font-size: 14px;
  cursor: pointer;
  padding: 0;
}
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ===== LOADING SPINNER ===== */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}
.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}
.loading-spinner {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 32px 40px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  text-align: center;
  min-width: 200px;
}
.spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  border: 4px solid var(--border-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.loading-spinner p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 40px; margin-bottom: 12px; opacity: 0.5; }
.empty-state h4 { font-size: 16px; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state p { font-size: 13px; max-width: 320px; margin: 0 auto; }

/* ===== CONFIRM DIALOG ===== */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.confirm-dialog {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  text-align: center;
}
.confirm-dialog h4 { font-size: 18px; font-weight: 800; margin-bottom: 8px; }
.confirm-dialog p { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }
.confirm-dialog .confirm-btns { display: flex; gap: 8px; justify-content: center; }

/* ===== UTILITIES ===== */
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-mono { font-family: 'Consolas', 'Courier New', monospace; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.hidden { display: none !important; }

/* ===== KB TAB MANAGER ===== */
.kbt-table { width: auto; border-collapse: collapse; }
.kbt-table th, .kbt-table td { vertical-align: middle; padding: 8px 10px; white-space: nowrap; }
.kbt-table th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-muted); text-align: left; font-weight: 600; }
.kbt-table th.w-check, .kbt-table td.kbt-center { text-align: center; }
.kbt-table th.w-drag, .kbt-table td.kbt-handle { width: 28px; text-align: center; cursor: grab; color: var(--text-muted); padding: 8px 4px; }
.kbt-table th.w-icon, .kbt-table td.kbt-icon { width: 32px; text-align: center; padding: 8px 2px; }
.kbt-table th.w-check { width: 80px; min-width: 80px; }
.kbt-table th.w-companies { min-width: 220px; }
.kbt-table th.w-actions { width: 80px; text-align: center; }
.kbt-table td.kbt-actions { text-align: center; white-space: nowrap; }
.kbt-table .kbt-name { width: 200px; }
.kbt-table .kbt-companies-select { width: 220px; min-height: 80px; padding: 4px 8px; font-size: 13px; }

/* Grouped "Edit Permission" header */
.kbt-table .kbt-group-head {
  text-align: center;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 10px;
  color: var(--primary);
  letter-spacing: 0.8px;
  padding: 6px 10px !important;
}
.kbt-table th.kbt-group-start, .kbt-table td.kbt-group-start { border-left: 1px solid var(--border); }
.kbt-table th.kbt-group-end, .kbt-table td.kbt-group-end { border-right: 1px solid var(--border); }

.kbt-row { transition: background 0.15s; }
.kbt-row:hover { background: var(--bg); }
.kbt-row.kbt-dragging { opacity: 0.4; background: var(--bg-card); }
.kbt-handle:active { cursor: grabbing; }
.big-check { width: 18px; height: 18px; cursor: pointer; accent-color: var(--primary); }

/* ===== BULK ACTION BAR ===== */
.bulk-action-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--blue);
  color: #fff;
  border-radius: var(--radius);
  margin-bottom: 12px;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.bulk-action-bar .btn-bulk-apply {
  background: #fff;
  color: var(--blue);
  font-weight: 600;
  border: none;
  padding: 5px 14px;
  border-radius: var(--radius);
}
.bulk-action-bar .btn-bulk-apply:hover { background: #e8e8e8; }
.bulk-action-bar .btn-bulk-cancel {
  color: rgba(255,255,255,0.7);
  margin-left: auto;
}
.bulk-action-bar .btn-bulk-cancel:hover { color: #fff; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--grey-30); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--grey-50); }

/* ===== SPRINT BOARD ===== */
.sprint-section {
  margin-bottom: 20px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  overflow: hidden;
}
.sprint-section-header {
  padding: 10px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border-light);
  border-left: 4px solid var(--grey);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sprint-section-header h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sprint-section-confirmed { border-left-color: #525e98; }
.sprint-section-fixed { border-left-color: var(--orange); }
.sprint-section-tested { border-left-color: var(--success); }
.sprint-section-assigned { border-left-color: #8b5cf6; }
.sprint-section-development { border-left-color: var(--orange); }
.sprint-section-testing { border-left-color: #e6a817; }
.sprint-section-release { border-left-color: var(--success); }
.sprint-section .data-table { margin: 0; border: none; border-radius: 0; }
.sprint-section .table-wrapper { margin: 0; border: none; border-radius: 0; box-shadow: none; }
.sprint-empty {
  padding: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.sprint-actions {
  white-space: nowrap;
  display: flex;
  gap: 6px;
  align-items: center;
}
.sprint-actions .btn { font-size: 12px; padding: 4px 10px; }
.sprint-next-version-wrap {
  position: relative;
  display: inline-block;
}
.sprint-next-version-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 100;
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  padding: 8px;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sprint-nv-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  padding: 2px 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.sprint-nv-reason {
  text-align: left !important;
  justify-content: flex-start !important;
  font-size: 13px !important;
  padding: 6px 10px !important;
  border-radius: 4px;
}
.sprint-nv-reason:hover {
  background: var(--bg) !important;
}

/* Sprint progress bar */
.progress-track {
  height: 8px;
  background: var(--grey-20);
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--success);
  border-radius: 4px;
  transition: width 0.3s ease;
  min-width: 0;
}

/* Sprint table tweaks */
.sprint-table td { vertical-align: middle; }
.sprint-ticket-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}
.sprint-ticket-link:hover { text-decoration: underline; }

/* Dark mode sprint */
body.dark .sprint-section { border-color: var(--grey-30); }
body.dark .sprint-section-header { background: rgba(255,255,255,0.03); border-bottom-color: var(--grey-30); }
body.dark .sprint-next-version-dropdown { background: var(--card); border-color: var(--grey-30); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
body.dark .sprint-nv-reason:hover { background: rgba(255,255,255,0.05) !important; }
body.dark .progress-track { background: var(--grey-30); }

/* ===== HELP CENTER ===== */
.help-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
  align-items: flex-start;
}
.help-layout.help-layout-full {
  grid-template-columns: 1fr;
}
.help-sidebar-panel {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  position: sticky;
  top: 0;
}
.help-topic-nav {
  display: flex;
  flex-direction: column;
  padding: 8px;
  gap: 2px;
}
.help-topic-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: none;
  background: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius);
  transition: all 0.15s;
  text-align: left;
}
.help-topic-item ion-icon { font-size: 18px; flex-shrink: 0; display: block; }
.help-topic-item:hover { background: var(--bg); color: var(--text); }
.help-topic-item.active { background: rgba(39,67,139,0.1); color: var(--primary); font-weight: 600; }

.help-content-panel {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  padding: 32px;
  min-height: 400px;
}
.help-content-loading {
  text-align: center;
  padding: 60px 20px;
}
.help-content-body { line-height: 1.7; }

/* Help content typography */
.help-content-body section { margin-bottom: 32px; }
.help-content-body section:last-child { margin-bottom: 0; }
.help-content-body h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}
.help-content-body h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--dark);
  margin: 20px 0 8px;
}
.help-content-body p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}
.help-content-body ul, .help-content-body ol {
  font-size: 14px;
  color: var(--text-secondary);
  padding-left: 24px;
  margin-bottom: 12px;
}
.help-content-body li { margin-bottom: 6px; }
.help-content-body a { color: var(--primary); font-weight: 500; }
.help-content-body a:hover { opacity: 0.8; }

/* Help tables */
.help-content-body table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  font-size: 13px;
}
.help-content-body th {
  text-align: left;
  padding: 10px 14px;
  background: var(--bg-subtle);
  color: var(--text);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 1px solid var(--border);
}
.help-content-body td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
}
.help-content-body tr:last-child td { border-bottom: none; }

/* Code blocks */
.help-content-body code {
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 12.5px;
  background: var(--bg-subtle);
  color: var(--primary);
  padding: 2px 6px;
  border-radius: 4px;
}
.help-content-body pre {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 16px;
  overflow-x: auto;
  margin-bottom: 16px;
}
.help-content-body pre code {
  background: none;
  padding: 0;
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.6;
}

/* Callout boxes */
.help-content-body .callout {
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 13px;
  line-height: 1.6;
  border-left: 4px solid;
}
.help-content-body .callout strong { display: block; margin-bottom: 4px; }
.help-content-body .callout-info {
  background: rgba(39,67,139,0.08);
  border-left-color: var(--primary);
  color: var(--text-secondary);
}
.help-content-body .callout-warning {
  background: rgba(252,131,43,0.08);
  border-left-color: var(--warning);
  color: var(--text-secondary);
}
.help-content-body .callout-tip {
  background: rgba(52,199,89,0.08);
  border-left-color: var(--success);
  color: var(--text-secondary);
}

/* Card grid from help files */
.help-content-body .card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.help-content-body .card-grid .card,
.help-content-body .card-grid a.card {
  display: block;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
  cursor: pointer;
}
.help-content-body .card-grid .card:hover,
.help-content-body .card-grid a.card:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(39,67,139,0.12);
  transform: translateY(-1px);
}
.help-content-body .card-grid .card h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
  margin: 0 0 8px;
  padding: 0;
  border: none;
}
.help-content-body .card-grid .card p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

/* Steps list */
.help-content-body ol.steps {
  counter-reset: step-counter;
  list-style: none;
  padding-left: 0;
}
.help-content-body ol.steps li {
  counter-increment: step-counter;
  padding: 10px 0 10px 44px;
  position: relative;
  border-bottom: 1px solid var(--border-light);
}
.help-content-body ol.steps li:last-child { border-bottom: none; }
.help-content-body ol.steps li::before {
  content: counter(step-counter);
  position: absolute;
  left: 0;
  top: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 1024px) {
  .help-layout { grid-template-columns: 1fr; }
  .help-sidebar-panel { position: static; }
}

/* ===== FLARE EFFECTS ===== */
/* ===== DARK THEME ===== */
body.dark {
  --bg:          #141821;
  --bg-card:     #1c2230;
  --bg-subtle:   #222838;
  --text:        #d8dce5;
  --text-secondary: #a0a8b8;
  --text-muted:  #6b7280;
  --dark:        #e8ecf2;
  --border:      #2e3546;
  --border-light:#2e3546;

  background: #0f1525;
}
body.dark #sidebar {
  background: #0f1525;
}
body.dark .sidebar-header { border-color: rgba(255,255,255,0.08); }
body.dark .sidebar-user { border-color: rgba(255,255,255,0.08); }
body.dark .nav-item:hover { background: rgba(255,255,255,0.05); }
body.dark .nav-item.active { background: rgba(255,255,255,0.08); }
body.dark .sidebar-section-title { color: rgba(255,255,255,0.2); }
body.dark .sidebar-hover { background: rgba(255,255,255,0.06); }
body.dark .form-control { background: var(--bg); color: var(--text); }
body.dark .chat-input-area textarea { background: var(--bg); color: var(--text); }
body.dark .table-toolbar select,
body.dark .table-toolbar input { background: var(--bg); color: var(--text); }
body.dark table.data-table thead tr.filter-row th select { background: var(--bg); color: var(--text); border-color: var(--border); }
body.dark .table-pagination button { background: var(--bg); color: var(--text); }
body.dark .topbar-search input { background: var(--bg); color: var(--text); }
body.dark .btn-secondary { background: var(--bg-card); color: var(--text); }
body.dark .confirm-dialog { background: var(--bg-card); }
body.dark .stat-icon.blue { background: rgba(39,67,139,0.3); }
body.dark .stat-icon.green { background: rgba(52,199,89,0.25); }
body.dark .stat-icon.orange { background: rgba(252,131,43,0.3); }
body.dark .stat-icon.red { background: rgba(192,57,43,0.3); }
body.dark .stat-icon.purple { background: rgba(39,67,139,0.3); }
body.dark .stat-icon.slate { background: rgba(84,84,84,0.25); }
body.dark .chat-message.private { background: rgba(252,131,43,0.1); border-color: rgba(252,131,43,0.2); }
body.dark .login-screen { background: var(--bg); }
body.dark .login-card .form-control { background: #ffffff; color: var(--dark); }
body.dark .help-topic-item.active { background: rgba(122,162,247,0.12); color: #7aa2f7; }
body.dark .help-content-body code { color: #7aa2f7; }
body.dark .help-content-body .callout-info { background: rgba(122,162,247,0.08); border-left-color: #7aa2f7; }
body.dark .help-content-body .callout-warning { background: rgba(252,131,43,0.1); }
body.dark .help-content-body .callout-tip { background: rgba(52,199,89,0.1); }
body.dark .help-content-body .card-grid .card:hover { box-shadow: 0 2px 8px rgba(122,162,247,0.15); }
body.dark .help-content-body ol.steps li::before { background: #7aa2f7; }
body.dark .notif-panel { background: var(--card); border-color: var(--grey-30); }
body.dark .topbar-title { color: var(--text); }
body.dark #topbar { background: rgba(28,34,48,0.85); border-color: var(--border); }
body.dark #topbar .toggle-sidebar { color: var(--text-secondary); }
body.dark #topbar .toggle-sidebar:hover { color: var(--text); }
body.dark .sidebar-backdrop { background: rgba(0,0,0,0.6); }
@media (max-width: 768px) {
  body.dark table.data-table tr { background: var(--bg-card); }
  body.dark .table-wrapper { background: transparent; }
}

/* ===== SIDEBAR BACKDROP ===== */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 199;
  opacity: 0;
  transition: opacity 0.25s;
}
.sidebar-backdrop.active { display: block; opacity: 1; }

/* ===== TOPBAR MOBILE ELEMENTS ===== */
.topbar-title {
  font-weight: 600;
  font-size: 17px;
  color: var(--dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: none;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .ticket-detail-layout, .issue-detail-layout { grid-template-columns: 1fr; }
  .ticket-sidebar-panel, .issue-sidebar-panel { order: -1; }
  .report-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { flex-direction: row; flex-wrap: wrap; }
}

@media (max-width: 768px) {
  /* ── Sidebar ── */
  #sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    bottom: 0;
    width: 260px;
    z-index: 200;
    transition: left 0.25s ease;
  }
  #sidebar:hover { width: 260px; }
  #sidebar.mobile-open { left: 0; }
  #sidebar.mobile-open .sidebar-label { width: calc(100% - 64px); opacity: 1; }
  #sidebar.mobile-open .sidebar-section-title { opacity: 1; }
  #sidebar.mobile-open .sidebar-user-info { opacity: 1; width: calc(100% - 64px); }
  #sidebar.mobile-open .sidebar-user .logout-btn { opacity: 1; width: auto; padding: 4px 6px; }
  #sidebar.mobile-open .view-as-wrap:not(.hidden) { opacity: 1; max-height: 50px; }

  /* ── Topbar ── */
  #topbar { padding: 0 12px; gap: 8px; }
  #topbar .toggle-sidebar { display: flex; }
  .topbar-title { display: block; }

  /* ── Content ── */
  #content { padding: 16px 12px; }

  /* ── Page header ── */
  .page-header { margin-bottom: 16px; }
  .page-header h2 { font-size: 20px; }
  .page-header-sub { font-size: 12px; }

  /* ── Stats ── */
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { padding: 12px 14px; gap: 10px; }
  .stat-icon { width: 36px; height: 36px; }
  .stat-icon ion-icon { font-size: 20px; }
  .stat-info h4 { font-size: 18px; }
  .stat-info p { font-size: 11px; }

  /* ── Ticket status tabs (scrollable) ── */
  .ticket-status-tabs {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .ticket-status-tabs::-webkit-scrollbar { display: none; }
  .ticket-status-tab { padding: 8px 12px; font-size: 12px; white-space: nowrap; flex-shrink: 0; }

  /* ── Table → Card view ── */
  .table-wrapper { box-shadow: none; background: transparent; border-radius: 0; overflow: visible; }
  table.data-table thead { display: none; }
  table.data-table,
  table.data-table tbody { display: block; }
  table.data-table tr {
    display: block;
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    padding: 12px 14px;
    margin-bottom: 8px;
    position: relative;
  }
  table.data-table tr:hover td { background: transparent; }
  table.data-table td {
    display: block;
    padding: 2px 0;
    border-bottom: none;
    font-size: 13px;
  }
  table.data-table td:before {
    content: attr(data-label);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: block;
    margin-bottom: 2px;
  }
  /* Hide ID cell on mobile - shown inline with title */
  table.data-table td.mob-hide { display: none; }
  /* Title cell gets special treatment */
  table.data-table td.mob-title {
    font-size: 15px;
    padding-bottom: 6px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--border-light);
  }
  table.data-table td.mob-title:before { display: none; }
  /* Inline badge row */
  table.data-table td.mob-inline {
    display: inline-block;
    padding: 2px 4px 2px 0;
    vertical-align: middle;
  }
  table.data-table td.mob-inline:before { display: none; }

  .table-footer { padding: 8px 4px; flex-wrap: wrap; gap: 8px; }
  .table-pagination { flex-wrap: wrap; }
  .table-count { margin-left: 0; }

  /* ── Forms ── */
  .form-row { flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }

  /* ── Cards ── */
  .card { border-radius: var(--radius); }
  .card-header { padding: 12px 14px; }
  .card-header h3 { font-size: 16px; }

  /* ── Buttons ── */
  .btn { padding: 9px 14px; font-size: 13px; }
  .btn-sm { padding: 6px 10px; font-size: 12px; }
  .page-actions { gap: 6px; }
  .page-actions .btn { padding: 8px 12px; font-size: 12px; }

  /* ── Modals ── */
  .modal-overlay { padding: 16px 8px; }
  .modal { border-radius: var(--radius-lg); }
  .modal-header { padding: 14px 16px; }
  .modal-body { padding: 16px; }
  .modal-footer { padding: 12px 16px; }

  /* ── Ticket detail ── */
  .ticket-detail-layout, .issue-detail-layout { grid-template-columns: 1fr; gap: 12px; }
  .ticket-sidebar-panel, .issue-sidebar-panel { order: -1; }
  .escalation-pipeline { flex-wrap: wrap; gap: 2px; }
  .escalation-step { font-size: 11px; padding: 6px 8px; }
  .ticket-meta-grid { gap: 8px; }
  .ticket-meta-item { gap: 4px; }

  /* ── Chat / comments ── */
  .chat-message { padding: 10px 12px; }

  /* ── Settings ── */
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .settings-nav-item { padding: 8px 12px; font-size: 12px; }

  /* ── Sprint board ── */
  .sprint-pipeline { flex-direction: column; }
  .pipeline-column { min-width: 100%; }

  /* ── Dashboard charts ── */
  .dash-charts-grid { grid-template-columns: 1fr !important; }
  .dash-pie-grid { grid-template-columns: 1fr 1fr !important; }
  .chart-container { padding: 14px; overflow: hidden; }
  .chart-container h4 { font-size: 13px; margin-bottom: 10px; }
  .chart-container canvas { max-width: 100%; height: auto !important; }
  .pie-inner { grid-template-columns: 1fr !important; gap: 8px; }
  .pie-legend { font-size: 11px; }

  /* ── Report grid ── */
  .report-grid { grid-template-columns: 1fr; }

  /* ── KB / Help tabs ── */
  .kb-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; flex-wrap: nowrap; }
  .kb-tabs::-webkit-scrollbar { display: none; }
  .kb-tab { white-space: nowrap; flex-shrink: 0; padding: 8px 12px; font-size: 12px; }
  .kb-tab-spacer { display: none; }

  /* ── Help layout ── */
  .help-layout { grid-template-columns: 1fr; }
  .help-sidebar-panel { position: static; max-height: none; }
  .help-topic-nav { flex-direction: row; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; flex-wrap: nowrap; padding: 6px; gap: 4px; }
  .help-topic-nav::-webkit-scrollbar { display: none; }
  .help-topic-item { white-space: nowrap; flex-shrink: 0; padding: 6px 10px; font-size: 12px; }

  /* ── Help content (guides) no overflow ── */
  .help-content-body { overflow-x: hidden; word-wrap: break-word; overflow-wrap: break-word; }
  .help-content-body pre { overflow-x: auto; max-width: 100%; font-size: 12px; }
  .help-content-body table { display: block; overflow-x: auto; max-width: 100%; font-size: 12px; }
  .help-content-body img { max-width: 100%; height: auto; }

  /* ── Articles ── */
  #articlesListPanel { padding: 12px; }
  #articleViewPanel { padding: 12px; }
  #articleEditorPanel { padding: 12px; }
  #articlesList { grid-template-columns: 1fr 1fr !important; }
  #articleEditContent { min-height: 200px; font-size: 13px; }
  #articleEditToolbar { gap: 2px; }
  #articleEditToolbar .btn-sm { padding: 4px 6px; font-size: 11px; }

  /* ── Settings nav mobile ── */
  .settings-nav { flex-direction: row; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--border); padding-bottom: 12px; margin-bottom: 12px; }
  .settings-nav .sidebar-section-title { display: none; }
  .settings-nav-item { padding: 6px 10px; font-size: 11px; border-radius: 16px; background: var(--bg-secondary); }

  /* ── User sidebar ── */
  .sidebar-user { padding: 10px 12px; }
  .view-as-wrap { padding: 6px 12px 0; }

  /* ── Notification panel ── */
  .notif-panel { width: calc(100vw - 24px); left: 12px; bottom: 60px; max-height: 60vh; }
}

/* ── Extra small devices ── */
@media (max-width: 380px) {
  .stats-grid { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; text-align: center; }
  #articlesList { grid-template-columns: 1fr !important; }
  .dash-pie-grid { grid-template-columns: 1fr !important; }
}

/* ===== PRINT ===== */
@media print {
  #sidebar, #topbar, .page-actions, .chat-input-area, .modal-overlay, .toast-container { display: none !important; }
  #content { padding: 0; }
  body { background: #fff; }
}
