:root {
  --bg-primary: #111827;
  --bg-secondary: #1F2937;
  --bg-tertiary: #374151;
  --bg-hover: #2d3a4e;
  --border-color: #2d3a4e;
  --text-primary: #F9FAFB;
  --text-secondary: #9CA3AF;
  --text-muted: #6B7280;
  --blue: #2563EB;
  --blue-bg: rgba(37, 99, 235, 0.12);
  --green: #22C55E;
  --green-bg: rgba(34, 197, 94, 0.12);
  --orange: #F59E0B;
  --orange-bg: rgba(245, 158, 11, 0.12);
  --red: #EF4444;
  --red-bg: rgba(239, 68, 68, 0.12);
  --purple: #8B5CF6;
  --purple-bg: rgba(139, 92, 246, 0.12);
  --sidebar-width: 240px;
  --navbar-height: 56px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --transition: 200ms ease;
}

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

html, body {
  height: 100%;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #4B5563;
}

.layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 1040;
  transition: transform var(--transition);
}

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

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.sidebar-logo i {
  font-size: 22px;
  color: var(--blue);
}

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  margin-bottom: 2px;
}

.nav-item i {
  font-size: 18px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

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

.nav-item.active {
  background: var(--blue-bg);
  color: var(--blue);
}

.nav-divider {
  height: 1px;
  background: var(--border-color);
  margin: 8px 12px;
}

.sidebar-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-color);
}

.sidebar-version {
  font-size: 12px;
  color: var(--text-muted);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1035;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Navbar Top */
.navbar-top {
  position: sticky;
  top: 0;
  z-index: 1025;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--navbar-height);
  padding: 0 24px;
  background: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
}

.navbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.navbar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
}

.page-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.navbar-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-online {
  background: var(--green);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
}

.status-offline {
  background: var(--red);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

.navbar-avatar {
  font-size: 26px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color var(--transition);
}

.navbar-avatar:hover {
  color: var(--text-primary);
}

/* Content Wrapper */
.content-wrapper {
  padding: 24px;
  flex: 1;
}

/* Stat Cards */
.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.stat-card:hover {
  border-color: var(--bg-tertiary);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

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

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

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

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

.stat-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-trend {
  width: 100%;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

.stat-trend-up {
  color: var(--green);
}

.stat-trend-down {
  color: var(--red);
}

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

/* Chart Cards */
.card-chart {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.card-chart-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.card-chart-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-chart-body {
  padding: 20px;
}

/* Table Cards */
.card-table {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.card-table-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.card-table-body {
  padding: 0;
}

.card-table-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.table-info {
  font-size: 13px;
  color: var(--text-muted);
}

/* Creative Table */
.creative-table {
  margin: 0;
  color: var(--text-primary);
  border-collapse: separate;
  border-spacing: 0;
}

.creative-table thead th {
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.creative-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
  font-size: 14px;
}

.creative-table tbody tr:last-child td {
  border-bottom: none;
}

.creative-table tbody tr:hover {
  background: var(--bg-hover);
}

.sortable {
  cursor: pointer;
  user-select: none;
}

.sortable i {
  font-size: 11px;
  margin-left: 4px;
  opacity: 0.5;
}

.sortable:hover i {
  opacity: 1;
}

/* Badges */
.badge-custom {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  gap: 4px;
}

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

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

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

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

.badge-gray {
  background: rgba(156, 163, 175, 0.1);
  color: var(--text-secondary);
}

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

/* Buttons */
.btn-custom {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-custom-primary {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.btn-custom-primary:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}

.btn-custom-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-color);
}

.btn-custom-ghost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-custom-danger {
  background: var(--red-bg);
  color: var(--red);
  border-color: transparent;
}

.btn-custom-danger:hover {
  background: var(--red);
  color: #fff;
}

.btn-custom-sm {
  padding: 4px 10px;
  font-size: 12px;
}

.btn-custom-icon {
  padding: 6px;
  font-size: 16px;
}

/* Search Box */
.search-box {
  position: relative;
  min-width: 280px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 9px 12px 9px 38px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition);
}

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

.search-input:focus {
  border-color: var(--blue);
}

/* Filter Group */
.filter-group {
  display: flex;
  gap: 8px;
}

.filter-select {
  padding: 9px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition);
  min-width: 150px;
}

.filter-select:focus {
  border-color: var(--blue);
}

.filter-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* Page Actions */
.page-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

/* Modal Custom */
.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

.modal-header {
  border-bottom: 1px solid var(--border-color);
  padding: 16px 20px;
}

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

.modal-header .btn-close {
  filter: invert(0.8);
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  border-top: 1px solid var(--border-color);
  padding: 16px 20px;
}

/* License Detail Modal */
.license-detail-section {
  margin-bottom: 20px;
}

.license-detail-section:last-child {
  margin-bottom: 0;
}

.license-detail-section h6 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-weight: 600;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.detail-item-label {
  font-size: 12px;
  color: var(--text-muted);
}

.detail-item-value {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
}

/* Product Cards */
.product-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.product-card:hover {
  border-color: var(--bg-tertiary);
  box-shadow: var(--shadow-md);
}

.product-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 16px;
}

.product-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.product-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.product-stats {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.product-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
}

.product-stat:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.product-stat-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.product-stat-value {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 600;
}

/* Server Stats */
.server-stats {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.server-stat-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.server-stat-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  min-width: 80px;
}

.server-stat-bar {
  flex: 1;
  height: 8px;
  background: var(--bg-primary);
  border-radius: 100px;
  overflow: hidden;
}

.server-stat-fill {
  height: 100%;
  background: var(--blue);
  border-radius: 100px;
  transition: width 0.6s ease;
}

.server-stat-fill-green {
  background: var(--green);
}

.server-stat-fill-orange {
  background: var(--orange);
}

.server-stat-value {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 600;
  min-width: 48px;
  text-align: right;
}

.server-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.server-info-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.server-info-label {
  font-size: 12px;
  color: var(--text-muted);
}

.server-info-value {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
}

/* Machine List in Modal */
.machine-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--bg-primary);
  border-radius: var(--radius);
  margin-bottom: 8px;
}

.machine-list-item:last-child {
  margin-bottom: 0;
}

.machine-list-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.machine-list-name {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
}

.machine-list-id {
  font-size: 12px;
  color: var(--text-muted);
  font-family: monospace;
}

/* Alert Custom */
.alert-custom {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  border: 1px solid transparent;
}

.alert-custom i {
  font-size: 18px;
  flex-shrink: 0;
}

.alert-info {
  background: var(--blue-bg);
  border-color: rgba(37, 99, 235, 0.2);
  color: var(--blue);
}

.alert-success {
  background: var(--green-bg);
  border-color: rgba(34, 197, 94, 0.2);
  color: var(--green);
}

.alert-warning {
  background: var(--orange-bg);
  border-color: rgba(245, 158, 11, 0.2);
  color: var(--orange);
}

.alert-danger {
  background: var(--red-bg);
  border-color: rgba(239, 68, 68, 0.2);
  color: var(--red);
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}

.empty-state i {
  font-size: 48px;
  color: var(--text-muted);
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h6 {
  font-size: 16px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.empty-state p {
  font-size: 13px;
  color: var(--text-secondary);
  max-width: 300px;
}

/* Login Page */
.login-body {
  background: var(--bg-primary);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-container {
  width: 100%;
  max-width: 420px;
}

.login-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px 32px 32px;
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.login-logo i {
  font-size: 28px;
  color: var(--blue);
}

.login-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--red-bg);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius);
  color: var(--red);
  font-size: 13px;
  font-weight: 500;
}

.login-alert i {
  font-size: 16px;
  flex-shrink: 0;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

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

.input-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  font-size: 16px;
  pointer-events: none;
}

.form-input {
  width: 100%;
  padding: 10px 12px 10px 40px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition);
}

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

.form-input:focus {
  border-color: var(--blue);
}

.input-toggle {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.input-toggle:hover {
  color: var(--text-secondary);
}

.login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px 20px;
  background: var(--blue);
  border: 1px solid var(--blue);
  border-radius: var(--radius);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  margin-top: 4px;
}

.login-btn:hover:not(:disabled) {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

.login-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.login-spinner {
  display: none;
  align-items: center;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

.login-footer {
  text-align: center;
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.login-hint {
  font-size: 12px;
  color: var(--text-muted);
}

/* User info in navbar */
.navbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.navbar-user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}

.navbar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.navbar-user-role {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: capitalize;
}

.navbar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--blue-bg);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  position: relative;
}

.navbar-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  min-width: 160px;
  padding: 4px;
  display: none;
  z-index: 1050;
  box-shadow: var(--shadow-md);
}

.navbar-dropdown.show {
  display: block;
}

.dropdown-info {
  padding: 8px 12px;
}

.dropdown-user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.dropdown-user-role {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.dropdown-env {
  margin-top: 4px;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.dropdown-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.dropdown-item i {
  font-size: 16px;
}

.dropdown-divider {
  height: 1px;
  background: var(--border-color);
  margin: 4px 0;
}

/* Profile panel */
.profile-panel {
  padding: 40px 24px;
  text-align: center;
}

.profile-panel .navbar-avatar {
  width: 64px;
  height: 64px;
  font-size: 28px;
  margin: 0 auto 16px;
}

.profile-panel h4 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 4px;
}

.profile-panel .text-secondary {
  font-size: 14px;
}

/* Partner / Marketing Hero */
.partner-hero {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
}

.partner-hero-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.15);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin: 0 auto 16px;
}

.partner-hero-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.partner-hero-desc {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto 24px;
  line-height: 1.6;
}

.partner-code-box {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 12px 20px;
}

.partner-code-label {
  font-size: 12px;
  color: var(--text-muted);
}

.partner-code-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--blue);
  font-family: monospace;
  letter-spacing: 1px;
}

/* Marketing Cards */
.marketing-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: border-color var(--transition);
}

.marketing-card:hover {
  border-color: var(--bg-tertiary);
}

.marketing-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 12px;
}

.marketing-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.marketing-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.marketing-card-meta {
  font-size: 12px;
  color: var(--text-muted);
}

/* Error Pages */
.error-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}

.error-container {
  text-align: center;
  max-width: 480px;
}

.error-code {
  font-size: 96px;
  font-weight: 800;
  color: var(--blue);
  line-height: 1;
  margin-bottom: 8px;
  opacity: 0.8;
}

.error-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.error-description {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 32px;
  line-height: 1.6;
}

/* Login Footer Tagline */
.login-tagline {
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
}

.login-footer-brand {
  text-align: center;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  font-size: 12px;
  color: var(--text-muted);
}

.login-footer-brand .brand-name {
  font-weight: 600;
  color: var(--text-secondary);
}

.login-footer-brand .brand-version {
  display: block;
  margin-top: 2px;
  font-size: 11px;
}

/* Environment Badge */
.env-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.env-badge-production {
  background: var(--green-bg);
  color: var(--green);
}

.env-badge-development {
  background: var(--orange-bg);
  color: var(--orange);
}

/* =============================================
   NOTIFICATIONS
   ============================================= */
.navbar-notifications {
  position: relative;
}

.notif-bell {
  position: relative;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  transition: all var(--transition);
  line-height: 1;
}

.notif-bell:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.notif-badge {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
}

.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: -60px;
  width: 360px;
  max-height: 480px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: none;
  z-index: 1060;
  overflow: hidden;
}

.notif-dropdown.show {
  display: flex;
  flex-direction: column;
}

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

.notif-dropdown-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.notif-mark-read {
  background: none;
  border: none;
  color: var(--blue);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all var(--transition);
}

.notif-mark-read:hover {
  background: var(--blue-bg);
}

.notif-dropdown-body {
  flex: 1;
  overflow-y: auto;
  max-height: 380px;
}

.notif-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--text-muted);
  gap: 8px;
}

.notif-empty i {
  font-size: 32px;
  opacity: 0.5;
}

.notif-empty span {
  font-size: 13px;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition);
  position: relative;
}

.notif-item:last-child {
  border-bottom: none;
}

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

.notif-item-unread {
  background: rgba(37, 99, 235, 0.05);
}

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

.notif-item-content {
  flex: 1;
  min-width: 0;
}

.notif-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.notif-item-msg {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.notif-item-dismiss {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 14px;
  border-radius: 4px;
  transition: all var(--transition);
  flex-shrink: 0;
}

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

/* =============================================
   EVENT FEED
   ============================================= */
.card-event-feed {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card-event-feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.card-event-feed-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-event-feed-title i {
  color: var(--green);
}

.card-event-feed-body {
  flex: 1;
  overflow-y: auto;
  max-height: 500px;
  padding: 8px;
}

.feed-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  color: var(--text-muted);
  gap: 8px;
}

.feed-empty i {
  font-size: 36px;
  opacity: 0.4;
}

.feed-empty span {
  font-size: 13px;
}

.feed-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius);
  transition: background var(--transition);
  animation: feedSlideIn 0.3s ease;
}

@keyframes feedSlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.feed-time {
  font-size: 11px;
  color: var(--text-muted);
  font-family: monospace;
  flex-shrink: 0;
  min-width: 40px;
}

.feed-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}

.feed-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.3;
  flex: 1;
  min-width: 0;
}

/* =============================================
   MACHINE STATUS DOTS
   ============================================= */
.machine-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

.machine-status-dot.online {
  background: var(--green);
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
}

.machine-status-dot.away {
  background: var(--orange);
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.5);
}

.machine-status-dot.offline {
  background: var(--text-muted);
}

/* =============================================
   PRODUCT DETAIL PAGE
   ============================================= */
.product-detail-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
}

.product-detail-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius);
  background: var(--blue-bg);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}

.product-detail-name {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 4px;
}

.product-detail-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

/* =============================================
   FORM CHECK DARK
   ============================================= */
.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-check-input {
  width: 16px;
  height: 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  cursor: pointer;
  accent-color: var(--blue);
}

.form-check-label {
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
}

/* =============================================
   SIDEBAR NOTIFICATIONS
   ============================================= */
@media (max-width: 991.98px) {
  .notif-dropdown {
    right: -20px;
    width: 320px;
  }
}

@media (max-width: 575.98px) {
  .notif-dropdown {
    right: -60px;
    width: 300px;
  }
}

/* Responsive */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
  }

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

  .sidebar-overlay.show {
    display: block;
  }

  .navbar-toggle {
    display: block;
  }

  .main-content {
    margin-left: 0;
  }

  .content-wrapper {
    padding: 16px;
  }

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

  .server-info-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 575.98px) {
  .page-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .search-box {
    min-width: 0;
  }

  .filter-group {
    flex-direction: column;
  }

  .stat-card {
    padding: 16px;
  }

  .stat-value {
    font-size: 24px;
  }
}
