:root {
  /* Vibrant, Modern Light Theme Colors */
  --primary: #4f46e5;
  /* Indigo */
  --primary-hover: #4338ca;
  --primary-bg: rgba(79, 70, 229, 0.1);
  --secondary: #0ea5e9;
  /* Sky Blue */
  --accent: #f43f5e;
  /* Rose */

  --bg-color: #f8fafc;
  --surface-color: #ffffff;
  --border-color: #e2e8f0;

  /* Text */
  --text-main: #0f172a;
  --text-muted: #64748b;

  /* Status Colors */
  --success: #10b981;
  --success-bg: #d1fae5;
  --warning: #f59e0b;
  --warning-bg: #fef3c7;
  --danger: #ef4444;
  --danger-bg: #fee2e2;
  --info: #3b82f6;
  --info-bg: #dbeafe;
  --secondary-bg: #e0f2fe;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --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-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 80px;

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --header-height: 70px;
}

[data-theme="dark"] {
  --bg-color: #0f172a;
  --surface-color: #1e293b;
  --border-color: #334155;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;

  --success-bg: rgba(16, 185, 129, 0.2);
  --warning-bg: rgba(245, 158, 11, 0.2);
  --danger-bg: rgba(239, 68, 68, 0.2);
  --info-bg: rgba(59, 130, 246, 0.2);
  --secondary-bg: rgba(14, 165, 233, 0.2);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-color);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Utilities */
.hidden {
  display: none !important;
}

.mt-2 {
  margin-top: 0.5rem;
}

.mt-3 {
  margin-top: 1rem;
}

.mt-4 {
  margin-top: 1.5rem;
}

.mb-2 {
  margin-bottom: 0.5rem;
}

.ml-1 {
  margin-left: 0.25rem;
}

.ml-2 {
  margin-left: 0.5rem;
}

.text-warning {
  color: var(--warning);
}

.text-danger {
  color: var(--danger);
}

.text-success {
  color: var(--success);
}

.text-muted {
  color: var(--text-muted);
}

.text-center {
  text-align: center;
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: #fff;
  z-index: 9999;
  box-shadow: var(--shadow-lg);
  animation: slideInUp 0.3s ease;
  max-width: 360px;
}

.toast-success {
  background: var(--success);
}

.toast-error {
  background: var(--danger);
}

.toast-info {
  background: var(--info);
  border-left: 4px solid #fff;
}

.toast-warning {
  background: var(--warning);
  color: #fff;
  border-left: 4px solid #fff;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.4);
}

@keyframes slideInUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Internal note highlight */
.timeline-item.internal-note .timeline-content {
  background: var(--warning-bg);
  border-color: var(--warning);
}

/* Disabled button */
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  font-family: inherit;
  outline: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  box-shadow: 0 4px 14px 0 rgba(79, 70, 229, 0.39);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px 0 rgba(79, 70, 229, 0.4);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--info-bg);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
  transform: translateY(-1px);
}

.btn-outline-danger {
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
}

.btn-outline-danger:hover {
  background: var(--danger);
  color: white;
}

.btn-block {
  width: 100%;
}

/* Input Group */
.input-group {
  display: flex;
  width: 100%;
}

.input-group .form-control {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  flex: 1;
}

.input-group .btn {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.input-group-sm .form-control,
.input-group-sm .btn,
.input-group-sm select.form-control {
  padding: 0.35rem 0.6rem;
  font-size: 0.8rem;
  height: auto;
}

.form-control {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-bg);
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  background: var(--border-color);
  color: var(--text-main);
}

/* Filter Bar */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--surface-color);
  padding: 0.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.filter-bar select,
.filter-bar input {
  border: 1px solid var(--border-color);
  background: var(--bg-color);
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-main);
  outline: none;
  min-width: 120px;
}

.filter-bar input {
  min-width: 200px;
}

.filter-bar select:focus,
.filter-bar input:focus {
  border-color: var(--primary);
  background: var(--surface-color);
}

.input-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon i {
  position: absolute;
  left: 10px;
  color: var(--text-muted);
}

.input-icon input {
  padding-left: 32px;
}

/* Settings Layout */
.settings-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2rem;
  min-height: calc(100vh - 200px);
}

.settings-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
}

.settings-nav-item i {
  font-size: 1.25rem;
}

.settings-nav-item:hover {
  background: var(--primary-bg);
  color: var(--primary);
}

.settings-nav-item.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.settings-card {
  background: var(--surface-color);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.settings-card-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.01);
}

.settings-card-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
}

.settings-card-body {
  padding: 2rem;
}

.sync-status-card {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem;
  background: var(--primary-bg);
  border-radius: var(--radius-md);
  margin-bottom: 2rem;
  border: 1px solid var(--primary-bg);
}

.sync-status-icon {
  width: 54px;
  height: 54px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.sync-status-details h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
}

.sync-status-details p {
  margin: 2px 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Badges */
.badge {
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-block;
}

.badge-success {
  background: var(--success-bg);
  color: var(--success);
}

.badge-warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.badge-danger {
  background: var(--danger-bg);
  color: var(--danger);
}

.badge-info {
  background: var(--info-bg);
  color: var(--info);
}

.badge-secondary {
  background: var(--secondary-bg);
  color: var(--secondary);
}

/* Views Toggling */
.view-hidden {
  display: none !important;
}

.view-active {
  display: block;
}

.page-view {
  animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Login View */
#login-view {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-color) 0%, #e2e8f0 100%);
}

[data-theme="dark"] #login-view {
  background: linear-gradient(135deg, var(--bg-color) 0%, #020617 100%);
}

.login-card {
  background: var(--surface-color);
  padding: 3rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.logo-circle {
  width: 80px;
  height: 80px;
  background: white;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem auto;
  box-shadow: var(--shadow-md);
  padding: 10px;
}

.header-logo {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.login-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
}

.login-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-main);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--surface-color);
  color: var(--text-main);
  font-family: inherit;
  transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-row {
  display: flex;
  gap: 1rem;
}

.form-row .half {
  flex: 1;
}

/* App Layout */
#app-view {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--surface-color);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  z-index: 1000;
  left: 0;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}

.sidebar-header {
  height: 70px;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--border-color);
  gap: 1rem;
}

.logo-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  white-space: nowrap;
  flex: 1;
}

.sidebar.collapsed .logo-text {
  display: none;
}

.toggle-btn {
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
}

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

.sidebar-menu {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0;
  list-style: none;
}

.menu-label {
  padding: 0.5rem 1.5rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 0.5rem;
}

.sidebar.collapsed .menu-label {
  text-align: center;
  font-size: 0;
}

.sidebar.collapsed .menu-label::after {
  content: "•••";
  font-size: 10px;
}

.sidebar-menu li:not(.menu-label) {
  padding: 0.8rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-muted);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border-left: 3px solid transparent;
}

.sidebar-menu li:not(.menu-label):hover {
  background: var(--info-bg);
  color: var(--primary);
}

.sidebar-menu li:not(.menu-label).active {
  background: var(--info-bg);
  color: var(--primary);
  border-left-color: var(--primary);
}

.sidebar-menu li i {
  font-size: 1.3rem;
}

.sidebar.collapsed li span {
  display: none;
}

.sidebar-menu li.action-btn {
  margin: 1rem 1.5rem;
  background: var(--primary);
  color: white;
  border-radius: var(--radius-sm);
  padding: 0.8rem;
  justify-content: center;
}

.sidebar-menu li.action-btn:hover {
  background: var(--primary-hover);
  color: white;
  transform: translateY(-1px);
}

.sidebar.collapsed li.action-btn {
  margin: 1rem 0.5rem;
  padding: 0.8rem 0;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  overflow: hidden;
}

.user-info img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.user-info h4 {
  font-size: 0.9rem;
  white-space: nowrap;
}

.user-info span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.sidebar.collapsed .user-details {
  display: none;
}

.logout-btn {
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  transition: 0.2s;
}

.logout-btn:hover {
  color: var(--danger);
  transform: scale(1.1);
}

/* Main Content Area */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Topbar */
.topbar {
  height: 70px;
  background: var(--surface-color);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
}

.topbar-search {
  display: flex;
  align-items: center;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 0.5rem 1rem;
  width: 300px;
}

.topbar-search i {
  color: var(--text-muted);
  margin-right: 0.5rem;
}

.topbar-search input {
  border: none;
  background: transparent;
  outline: none;
  color: var(--text-main);
  width: 100%;
}

.topbar-actions {
  display: flex;
  gap: 1rem;
}

.notif-btn {
  position: relative;
}

.notif-btn .badge {
  position: absolute;
  top: 0px;
  right: 0px;
  background: var(--danger);
  color: white;
  font-size: 0.6rem;
  padding: 0.15rem 0.3rem;
  border-radius: 10px;
  border: 2px solid var(--surface-color);
}

/* Content Container */
.content-container {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
}

/* Page Headers */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 2rem;
}

.page-header h2 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-main);
}

.page-header p {
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.header-actions {
  display: flex;
  gap: 0.75rem;
}

.form-compact .form-group {
  margin-bottom: 0.75rem;
}

.form-compact label {
  font-size: 0.7rem;
  margin-bottom: 2px;
}

.form-compact .form-control,
.form-compact select {
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--surface-color);
  color: var(--text-main);
  outline: none;
}

.status-select {
  font-weight: 600;
  border: none !important;
  background: var(--info-bg) !important;
  color: var(--primary) !important;
  cursor: pointer;
}

.theme-dark .status-select {
  background: rgba(79, 70, 229, 0.2) !important;
}

/* Dashboard Stats Grid */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--surface-color);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 1.25rem;
  transition: var(--transition);
  border: 1px solid var(--border-color);
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
}

.stat-icon.open {
  background: var(--info-bg);
  color: var(--info);
}

.stat-icon.progress {
  background: var(--warning-bg);
  color: var(--warning);
}

.stat-icon.breach {
  background: var(--danger-bg);
  color: var(--danger);
}

.stat-icon.resolved {
  background: var(--success-bg);
  color: var(--success);
}

.stat-info h3 {
  font-size: 1.6rem;
  font-weight: 700;
}

.stat-info p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.stat-card.mini {
  padding: 1.2rem;
  gap: 1rem;
}

.stat-card.mini h3 {
  font-size: 1.4rem;
}

/* Dashboard Panels Layout */
.dashboard-panels {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}

/* Panels / Cards */
.panel {
  background: var(--surface-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.panel-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

.panel-body {
  padding: 1.5rem;
}

.panel-body.no-padding {
  padding: 0;
}

.border-bottom {
  border-bottom: 1px solid var(--border-color);
}

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 1rem 1.5rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.table th {
  background: rgba(0, 0, 0, 0.02);
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

[data-theme="dark"] .table th {
  background: rgba(255, 255, 255, 0.02);
}

.table td {
  font-size: 0.9rem;
  color: var(--text-main);
  vertical-align: middle;
}

.table tbody tr {
  transition: var(--transition);
}

.table tbody tr:hover {
  background: var(--bg-color);
  cursor: pointer;
}

/* Alert List (for subscriptions) */
.alert-list {
  list-style: none;
}

.alert-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
}

.alert-list li:last-child {
  border-bottom: none;
}

.alert-list li .service-info {
  flex: 1;
}

.alert-info-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.alert-info-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Extracted Admin Only Items */
.admin-only-hidden {
  display: none !important;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal {
  background: var(--surface-color);
  width: 100%;
  max-width: 500px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.modal.modal-lg {
  max-width: 800px;
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  display: flex;
  align-items: center;
}

.close-btn {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
}

.close-btn:hover {
  color: var(--danger);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
}

.modal-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

/* Modal Ticket Detail Layout */
.layout-split {
  display: flex;
  gap: 1.5rem;
  padding: 0;
}

.split-main {
  flex: 2;
  padding: 1.5rem;
  border-right: 1px solid var(--border-color);
}

.split-sidebar {
  flex: 1;
  padding: 1.5rem;
  background: var(--bg-color);
}

.ticket-meta-info {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.ticket-meta-info i {
  margin-right: 0.2rem;
}

.ticket-meta-info b {
  color: var(--text-main);
}

/* Timeline Replies */
.timeline {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.timeline-item {
  display: flex;
  gap: 1rem;
}

.timeline-avatar img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.timeline-content {
  flex: 1;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
}

.timeline-header b {
  color: var(--text-main);
}

.timeline-header span {
  color: var(--text-muted);
}

.timeline-body p {
  font-size: 0.9rem;
}

/* System Events in Timeline */
.timeline-item.system-event {
  gap: 1.5rem;
  position: relative;
  padding-bottom: 0.5rem;
}

.timeline-item.system-event::before {
  content: '';
  position: absolute;
  left: 18px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-color);
  z-index: 0;
}

.timeline-item.system-event:last-child::before {
  display: none;
}

.timeline-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.2rem;
  z-index: 1;
  flex-shrink: 0;
  border: 3px solid var(--surface-color);
}

.system-event .timeline-content {
  background: transparent;
  border: none;
  padding: 0.2rem 0;
}

.system-event .timeline-header {
  margin-bottom: 0;
  font-size: 0.85rem;
}

.reply-box textarea {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  background: var(--surface-color);
  color: var(--text-main);
  font-family: inherit;
  resize: vertical;
}

.reply-box textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.form-compact .form-group {
  margin-bottom: 1rem;
}

.form-compact label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.form-compact select,
.form-compact input {
  padding: 0.5rem;
  font-size: 0.9rem;
}

.linked-asset {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.8rem;
  background: var(--info-bg);
  color: var(--info);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
}

/* File Upload Area */
.file-upload {
  border: 2px dashed var(--border-color);
  padding: 2rem;
  text-align: center;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.file-upload:hover {
  border-color: var(--primary);
  background: var(--info-bg);
  color: var(--primary);
}

.file-upload i {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.5rem;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 4rem;
  color: var(--border-color);
  margin-bottom: 1rem;
}

.empty-state h3 {
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

/* Responsiveness */
@media (max-width: 900px) {
  .dashboard-panels {
    grid-template-columns: 1fr;
  }

  .layout-split {
    flex-direction: column;
  }

  .split-main {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }

  .sidebar {
    position: absolute;
    height: 100vh;
    transform: translateX(-100%);
    width: var(--sidebar-width);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }
}

/* Scan Input Styling */
.scan-input-wrapper {
  position: relative;
  border: 2px dashed var(--primary);
  border-radius: var(--radius-md);
  padding: 10px;
  background: var(--info-bg);
  display: flex;
  gap: 10px;
  align-items: center;
}

.scan-badge {
  background: var(--primary);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: bold;
  white-space: nowrap;
}

.scan-input-wrapper input {
  border: none;
  background: transparent;
  width: 100%;
  font-size: 1rem;
  outline: none;
  color: var(--text-main);
}

/* Public Asset View specific */
#public-asset-view .login-card {
  box-shadow: var(--shadow-lg);
  border-top: 4px solid var(--primary);
}

#pub-history {
  border-left: 2px solid var(--border-color);
  margin-left: 10px;
  padding-left: 15px;
}

/* Asset Detail Remake */
.asset-detail-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
}

.asset-primary-card {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.asset-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin-top: 1rem;
}

.meta-item {
  padding: 10px;
  background: var(--bg-color);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.meta-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  margin-bottom: 4px;
}

.meta-value {
  font-weight: 600;
  color: var(--text-main);
  font-size: 0.95rem;
}

.asset-history-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-entry {
  position: relative;
  padding-left: 20px;
  border-left: 2px solid var(--border-color);
  padding-bottom: 15px;
}

.history-entry::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-color);
  border: 2px solid var(--surface-color);
}

.history-entry.active::before {
  background: var(--primary);
}

.history-entry .time {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.history-entry .action {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-main);
}

.history-entry .desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Asset Detail Image */
#ad-image-container img {
  transition: transform 0.3s ease;
  cursor: zoom-in;
}

#ad-image-container img:hover {
  transform: scale(1.05);
}

/* Settings user list */
#asset-users-table tr:hover {
  background-color: rgba(0, 0, 0, 0.02);
}

.theme-dark #asset-users-table tr:hover {
  background-color: rgba(255, 255, 255, 0.05);
}


@media (max-width: 800px) {
  .asset-detail-grid {
    grid-template-columns: 1fr;
  }
}

/* Notification Dropdown */
.dropdown-panel {
  position: absolute;
  top: 100%;
  right: 0;
  width: 320px;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  margin-top: 10px;
  animation: slideIn 0.2s ease;
  overflow: hidden;
}

.dropdown-header {
  padding: 12px 15px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dropdown-header h3 {
  font-size: 0.95rem;
  margin: 0;
}

.dropdown-list {
  max-height: 400px;
  overflow-y: auto;
}

.notif-item {
  padding: 12px 15px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  gap: 12px;
}

.notif-item:hover {
  background: var(--bg-color);
}

.notif-item.unread {
  background: var(--info-bg);
}

.notif-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-bg);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notif-body {
  flex: 1;
}

.notif-title {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 2px;
}

.notif-msg {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.notif-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Linked Asset Cards */
.linked-asset-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.linked-asset-card:hover {
  border-color: var(--primary);
  background: var(--surface-color);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.lac-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--primary-bg);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.lac-body {
  flex: 1;
  min-width: 0;
}

.lac-code {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-main);
  line-height: 1.2;
}

.lac-name {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lac-remove {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  opacity: 0;
}

.linked-asset-card:hover .lac-remove {
  opacity: 1;
}

.lac-remove:hover {
  background: #fee2e2;
  color: #ef4444;
}

@media print {
  body * {
    visibility: hidden;
  }

  #printable-label,
  #printable-label * {
    visibility: visible;
  }

  #printable-label {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    display: flex !important;
    justify-content: center;
    padding-top: 2rem;
  }
}

.asset-label-box {
  width: 320px;
  padding: 20px;
  border: 2px solid #000;
  border-radius: 8px;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: #000 !important;
}

.asset-label-header {
  border-bottom: 2px solid #000;
  width: 100%;
  padding-bottom: 10px;
  margin-bottom: 15px;
}

.asset-label-header h4 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 1px;
}

.asset-label-header p {
  margin: 4px 0 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  font-weight: 600;
}

#label-qr-canvas {
  margin-bottom: 15px;
  padding: 10px;
  background: #fff;
  border-radius: 4px;
}

.asset-label-footer {
  width: 100%;
  padding-top: 10px;
  border-top: 2px solid #000;
}

.asset-label-code {
  font-size: 1.4rem;
  font-weight: 900;
}

.asset-label-name {
  font-size: 0.9rem;
  font-weight: 500;
  margin-top: 2px;
}

/* ── Kanban Board & Project Styles ────────────────────────── */
.grid-layout {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.project-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.project-card .project-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}

.progress-container {
  height: 8px;
  background: var(--border-color);
  border-radius: 4px;
  overflow: hidden;
  margin: 1rem 0;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 0.5s ease;
}

/* Kanban System */
.full-height-view {
  height: calc(100vh - 100px);
  display: flex;
  flex-direction: column;
}

.kanban-container {
  display: flex;
  gap: 1rem;
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden; /* Prevent vertical scroll on the container itself */
  padding-bottom: 1rem;
  align-items: flex-start;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.kanban-column {
  background: rgba(148, 163, 184, 0.08);
  border-radius: var(--radius-md);
  min-width: 300px;
  width: 300px;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid transparent;
  transition: var(--transition);
}

.column-header {
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
}

.column-header h3 {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05rem;
  color: var(--text-muted);
}

.count-badge {
  background: var(--border-color);
  color: var(--text-main);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
}

.column-content {
  padding: 0.5rem;
  flex: 1;
  overflow-y: auto;
  min-height: 100px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

.kanban-card {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow-sm);
  cursor: grab;
  transition: var(--transition);
  touch-action: manipulation;
}

.drag-handle {
    cursor: grab;
    touch-action: none; /* Prevent scroll only when touching the handle */
}

.drag-handle:active {
    cursor: grabbing;
}

.kanban-card:active {
  cursor: grabbing;
}

/* Kanban SortableJS Classes */
.kanban-ghost-class {
  opacity: 0.5;
  background: var(--bg-color) !important;
  border: 2px dashed var(--border-color) !important;
  box-shadow: none !important;
}

.kanban-chosen-class {
  background: var(--surface-color);
  box-shadow: var(--shadow-lg) !important;
  transform: scale(1.02);
}

.kanban-drag-class {
  opacity: 1 !important;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1) !important;
  transform: rotate(2deg) scale(1.02);
  z-index: 9999;
}

.kanban-card:hover {
  border-color: var(--primary);
}

.kanban-card .task-title {
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
  display: block;
}

.kanban-card .task-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
}

.task-key {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.task-label {
  font-size: 0.7rem;
  padding: 2px 6px;
  background: var(--info-bg);
  color: var(--info);
  border-radius: 4px;
  font-weight: 700;
  margin-left: 5px;
}

.card-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

/* Modal XL & Tabbed Revamp */
.modal-xl {
  max-width: 1000px;
  width: 95%;
}

.tab-btn {
  background: transparent;
  border: 1px solid transparent;
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
}

.tab-btn:hover {
  background: rgba(0,0,0,0.03);
  color: var(--text-main);
}

.tab-btn.active {
  background: white;
  color: var(--primary);
  border-color: var(--border-color);
  box-shadow: var(--shadow-sm);
}

.project-tab-view.hidden {
  display: none !important;
}

/* Quick Tailwind-style Utilities for Modal */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.p-0 { padding: 0 !important; }
.p-4 { padding: 1rem !important; }
.p-6 { padding: 1.5rem !important; }
.pb-2 { padding-bottom: 0.5rem !important; }
.border-none { border: none !important; }
.border-b { border-bottom: 1px solid var(--border-color); }
.border-r { border-right: 1px solid var(--border-color); }
.border-t { border-top: 1px solid var(--border-color); }
.bg-slate-50 { background-color: #f8fafc; }
.w-1\/4 { width: 25%; }
.flex-1 { flex: 1; }
.overflow-y-auto { overflow-y: auto; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.col-span-2 { grid-column: span 2 / span 2; }
.text-2xl { font-size: 1.5rem; }
.text-xl { font-size: 1.25rem; }
.text-lg { font-size: 1.125rem; }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.uppercase { text-transform: uppercase; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.h-2 { height: 0.5rem; }
.h-full { height: 100%; }
.bg-slate-100 { background-color: #f1f5f9; }
.w-full { width: 100%; }
.rounded-full { border-radius: 9999px; }
.extra-small { font-size: 0.75rem; }

/* ── Mobile Responsive Overrides ────────────────────────── */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    #app-view {
        overflow: visible;
    }
    
    .sidebar {
        position: fixed !important;
        top: 0;
        left: 0 !important;
        width: var(--sidebar-width) !important;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1100 !important;
        display: flex !important;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    }
    
    .sidebar.mobile-show {
        transform: translateX(0) !important;
    }
    
    .main-content {
        width: 100%;
        margin-left: 0;
        padding-top: var(--header-height);
    }
    
    .topbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 900;
        background: var(--surface-color);
        padding: 0 1rem;
        height: var(--header-height);
    }

    /* Mobile Menu Toggle Button (Hamburger) */
    .mobile-nav-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
        border-radius: var(--radius-sm);
        background: var(--bg-color);
        color: var(--text-main);
        margin-right: 1rem;
        border: 1px solid var(--border-color);
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stat-card {
        padding: 1.25rem;
    }

    .grid-layout {
        grid-template-columns: 1fr;
    }

    .panel-body {
        overflow-x: auto;
    }

    .settings-layout {
        grid-template-columns: 1fr;
    }

    .settings-sidebar {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }

    .settings-nav-item {
        white-space: nowrap;
        width: auto;
    }
    
    /* Overlay when sidebar is open */
    .sidebar-overlay.active {
        display: block !important;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.3); /* Lighter backdrop */
        z-index: 950;
    }

    .topbar-search {
        display: none; /* Hide global search on mobile to save space */
    }
}

.mobile-nav-toggle {
    display: none;
}

.sidebar-overlay {
    display: none;
}

/* ═══════════════════════════════════════════════════════════ */
/* REPORTS DASHBOARD STYLES                                   */
/* ═══════════════════════════════════════════════════════════ */

.report-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.report-card {
    background: var(--surface-color);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 1.25rem;
    transition: var(--transition);
}

.report-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-content .stat-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 2px;
}

.stat-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.reports-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.reports-grid .col-span-2 {
    grid-column: span 2;
}

.report-card-header {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
}

.report-card-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
}

.report-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.performance-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: var(--bg-color);
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    transition: var(--transition);
}

.performance-item:hover {
    border-color: var(--primary-bg);
    background: var(--surface-color);
}

.p-item-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.p-item-user img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.p-item-name {
    font-size: 0.9rem;
    font-weight: 600;
}

.p-item-stats {
    text-align: right;
}

.p-item-count {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary);
}

.p-item-time {
    font-size: 0.7rem;
    color: var(--text-muted);
}

@media (max-width: 1200px) {
    .reports-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .reports-grid .col-span-2 {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .reports-grid {
        grid-template-columns: 1fr;
    }
    .reports-grid .col-span-2 {
        grid-column: span 1;
    }
}