/* ============================================================
   ASKARBON - Design System
   Askon Demir Çelik Karbon Ayak İzi Takip Sistemi
   ============================================================ */

/* --- CSS Variables --- */
:root {
  --primary: #00376E;
  --primary-dark: #002a54;
  --primary-light: #004d99;
  --bg-body: #0a1628;
  --bg-body-lighter: #0f1f36;
  --bg-card: #112240;
  --bg-card-hover: #162d50;
  --bg-input: #0d1b30;
  --white: #ffffff;
  --text-primary: #e6f0ff;
  --text-secondary: #8ba3c7;
  --text-muted: #5a7a9e;
  --border: rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.15);
  --accent-blue: #00a8ff;
  --accent-cyan: #00d4ff;
  --success: #00c853;
  --warning: #ffab00;
  --danger: #ff1744;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.4);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --header-height: 64px;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--bg-body);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-cyan);
}

/* --- Loading Overlay --- */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--bg-body);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s, visibility 0.5s;
}

.loading-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
}

.spinner-ring {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* --- Header --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-height);
  background: var(--primary);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--white);
  text-decoration: none;
}

.logo:hover {
  color: var(--white);
}

.logo-icon {
  width: 36px;
  height: 36px;
}

.logo-icon svg {
  width: 100%;
  height: 100%;
}

.logo-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #fff 0%, #a8d4ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-subtitle {
  display: block;
  font-size: 10px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-top: -2px;
}

/* Navigation */
.main-nav {
  display: flex;
  align-items: center;
  gap: 5px;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--radius-xs);
  transition: all var(--transition);
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
}

.nav-link.active {
  color: var(--white);
}

/* Arrow indicator under nav items */
.nav-arrow {
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  color: var(--accent-blue);
  pointer-events: none;
}

.nav-link:hover .nav-arrow,
.nav-link.active .nav-arrow {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.nav-link.active .nav-arrow {
  color: var(--accent-cyan);
}

.dropdown-chevron {
  transition: transform var(--transition);
  opacity: 0.6;
  margin-left: 2px;
}

/* Dropdown */
.nav-dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  min-width: 210px;
  background: var(--primary-dark);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
  z-index: 100;
}

.nav-dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.nav-dropdown:hover .dropdown-chevron {
  transform: rotate(180deg);
}

.dropdown-item {
  display: block;
  padding: 10px 16px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-xs);
  transition: all var(--transition);
}

.dropdown-item:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
}

.dropdown-item.active {
  color: var(--accent-cyan);
  background: rgba(0, 168, 255, 0.1);
}

/* Mobile menu */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.mobile-menu-btn span {
  width: 24px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: all var(--transition);
}

.mobile-menu-btn.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.open span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Main Content --- */
.main-content {
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height) - 56px);
  padding: 32px 24px;
  max-width: 1440px;
  margin-left: auto;
  margin-right: auto;
}

/* --- Page Header --- */
.page-header {
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.page-header h1 {
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(135deg, #fff 0%, #8bb8e8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.page-header-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* --- KPI Cards --- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan));
  opacity: 0;
  transition: opacity var(--transition);
}

.kpi-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.kpi-card:hover::before {
  opacity: 1;
}

.kpi-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.kpi-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -1px;
  line-height: 1.1;
}

.kpi-unit {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 4px;
}

.kpi-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 8px;
  padding: 2px 8px;
  border-radius: 20px;
}

.kpi-change.up {
  color: var(--success);
  background: rgba(0, 200, 83, 0.1);
}

.kpi-change.down {
  color: var(--danger);
  background: rgba(255, 23, 68, 0.1);
}

/* --- Charts --- */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  overflow: hidden;
}

.chart-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-card h3::before {
  content: '';
  width: 4px;
  height: 20px;
  background: linear-gradient(180deg, var(--accent-blue), var(--accent-cyan));
  border-radius: 2px;
}

.chart-wrapper {
  position: relative;
  height: 280px;
}

/* --- Data Table --- */
.table-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

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

.table-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-header h3::before {
  content: '';
  width: 4px;
  height: 20px;
  background: linear-gradient(180deg, var(--accent-blue), var(--accent-cyan));
  border-radius: 2px;
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.15);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 12px 16px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr {
  transition: background var(--transition);
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

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

/* Special cell types */
.cell-number {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.cell-highlight {
  color: var(--accent-cyan);
  font-weight: 700;
}

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

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

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

.badge {
  display: inline-flex;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 20px;
  letter-spacing: 0.3px;
}

.badge-scope1 {
  background: rgba(0, 200, 83, 0.15);
  color: var(--success);
}

.badge-scope2 {
  background: rgba(0, 168, 255, 0.15);
  color: var(--accent-blue);
}

.badge-scope3 {
  background: rgba(255, 171, 0, 0.15);
  color: var(--warning);
}

.badge-active {
  background: rgba(0, 200, 83, 0.15);
  color: var(--success);
}

.badge-inactive {
  background: rgba(255, 23, 68, 0.15);
  color: var(--danger);
}

.table-empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

.table-empty svg {
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  opacity: 0.3;
}

/* Total/Summary Row */
.table-summary {
  display: flex;
  justify-content: flex-end;
  gap: 24px;
  padding: 16px 20px;
  border-top: 2px solid var(--accent-blue);
  background: rgba(0, 168, 255, 0.05);
}

.summary-item {
  text-align: right;
}

.summary-label {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.summary-value {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent-cyan);
}

/* --- Filters --- */
.filters-bar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-group label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

/* --- Forms & Inputs --- */
input,
select,
textarea {
  font-family: var(--font);
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 10px 14px;
  font-size: 14px;
  border-radius: var(--radius-xs);
  transition: all var(--transition);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(0, 168, 255, 0.15);
}

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

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238ba3c7' fill='none' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue), #0077cc);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(0, 168, 255, 0.3);
}

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

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--border-light);
}

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

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

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

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-icon {
  padding: 8px;
  border-radius: var(--radius-xs);
}

.btn-group {
  display: flex;
  gap: 8px;
}

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
  padding: 24px;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(20px);
  transition: transform var(--transition);
}

.modal-overlay.open .modal {
  transform: scale(1) translateY(0);
}

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

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--white);
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  border-radius: var(--radius-xs);
  transition: all var(--transition);
}

.modal-close:hover {
  background: rgba(255, 23, 68, 0.15);
  color: var(--danger);
}

.modal-body {
  padding: 24px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

/* --- Toast --- */
.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  transform: translateX(120%);
  animation: toastIn 0.4s forwards, toastOut 0.4s 3s forwards;
  max-width: 380px;
}

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

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

.toast-info {
  background: var(--accent-blue);
  color: var(--white);
}

@keyframes toastIn {
  to {
    transform: translateX(0);
  }
}

@keyframes toastOut {
  to {
    transform: translateX(120%);
    opacity: 0;
  }
}

/* --- Footer --- */
.footer {
  background: var(--primary-dark);
  border-top: 1px solid var(--border);
  padding: 16px 24px;
}

.footer-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.footer-sep {
  opacity: 0.3;
}

/* --- Empty / Info States --- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 64px 24px;
  text-align: center;
}

.empty-state-icon {
  width: 80px;
  height: 80px;
  margin-bottom: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 168, 255, 0.1);
  color: var(--accent-blue);
  font-size: 32px;
}

.empty-state h3 {
  font-size: 18px;
  color: var(--white);
  margin-bottom: 8px;
}

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

/* --- Inline Spinner --- */
.inline-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  color: var(--text-secondary);
  font-size: 14px;
  gap: 12px;
}

.inline-spinner::before {
  content: '';
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* --- Sayaç Hesaplama Result Card --- */
.result-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}

.result-card h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 24px;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.result-item {
  padding: 16px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.result-label {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.result-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--white);
  margin-top: 4px;
}

.result-value.highlight {
  color: var(--accent-cyan);
}

.result-value.co2 {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Action Button Cells --- */
.actions-cell {
  display: flex;
  gap: 6px;
}

.action-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-xs);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all var(--transition);
}

.action-btn-edit {
  background: rgba(0, 168, 255, 0.1);
  color: var(--accent-blue);
}

.action-btn-edit:hover {
  background: rgba(0, 168, 255, 0.25);
}

.action-btn-delete {
  background: rgba(255, 23, 68, 0.1);
  color: var(--danger);
}

.action-btn-delete:hover {
  background: rgba(255, 23, 68, 0.25);
}

.btn-lifetime {
  padding: 6px 12px;
  background: rgba(0, 200, 83, 0.1);
  color: #00c853;
  border: 1px solid rgba(0, 200, 83, 0.2);
  border-radius: var(--radius-xs);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-lifetime:hover {
  background: rgba(0, 200, 83, 0.25);
  box-shadow: 0 0 10px rgba(0, 200, 83, 0.15);
}

/* --- Animations --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

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

.fade-in-up {
  animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.stagger-1 {
  animation-delay: 0.05s;
}

.stagger-2 {
  animation-delay: 0.1s;
}

.stagger-3 {
  animation-delay: 0.15s;
}

.stagger-4 {
  animation-delay: 0.2s;
}

/* --- Live Indicator --- */
.live-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: var(--success);
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(0, 200, 83, 0.7);
  }

  70% {
    transform: scale(1);
    box-shadow: 0 0 0 8px rgba(0, 200, 83, 0);
  }

  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(0, 200, 83, 0);
  }
}

/* --- Stock Market Flashing Animation --- */
@keyframes flashGreen {
  0% {
    background-color: rgba(0, 200, 83, 0.35);
    text-shadow: 0 0 8px rgba(0, 200, 83, 0.8);
  }

  100% {
    background-color: transparent;
  }
}

.flash-green {
  animation: flashGreen 1s ease-out;
  border-radius: var(--radius-xs);
}

/* --- Custom Theme Scrollbar Styling --- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(10, 22, 40, 0.5);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 168, 255, 0.3);
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 168, 255, 0.6);
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .main-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--primary);
    flex-direction: column;
    padding: 16px;
    gap: 2px;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
    box-shadow: var(--shadow-lg);
    max-height: calc(100vh - var(--header-height));
    overflow-y: auto;
  }

  .main-nav.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .nav-link {
    padding: 12px 16px;
    width: 100%;
  }

  .nav-arrow {
    display: none;
  }

  .nav-dropdown {
    width: 100%;
  }

  .dropdown-menu {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    background: rgba(0, 0, 0, 0.15);
    box-shadow: none;
    border: none;
    margin-top: 4px;
    display: none;
  }

  .nav-dropdown.open .dropdown-menu {
    display: block;
  }

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

  .form-row {
    grid-template-columns: 1fr;
  }

  .kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .page-header h1 {
    font-size: 22px;
  }

  .table-summary {
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
  }
}

@media (max-width: 600px) {
  .main-content {
    padding: 20px 12px;
  }

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

  .filters-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group {
    width: 100%;
  }

  .filter-group input,
  .filter-group select {
    width: 100%;
  }
}

/* --- Official A4 Document Exporter Styling --- */
.report-export-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-bottom: 20px;
}

.report-a4-wrapper {
  display: flex;
  justify-content: center;
  padding: 20px 0;
  background: var(--bg-body);
  overflow-x: auto;
}

.report-a4-page {
  width: 210mm;
  min-height: 297mm;
  padding: 20mm;
  background: #ffffff;
  color: #1a202c;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  box-sizing: border-box;
}

.official-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 3px double #00376E;
  padding-bottom: 16px;
  margin-bottom: 24px;
}

.official-logo-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.official-logo-img {
  max-height: 48px;
  width: auto;
}

.official-logo-text {
  text-align: left;
}

.official-logo-text h2 {
  font-size: 16px;
  font-weight: 800;
  color: #00376E;
  margin: 0;
  line-height: 1.2;
}

.official-logo-text p {
  font-size: 10px;
  color: #5a7a9e;
  margin: 0;
  text-transform: uppercase;
}

.official-meta {
  text-align: right;
  font-size: 11px;
  color: #4a5568;
  line-height: 1.5;
}

.official-title {
  text-align: center;
  margin-bottom: 28px;
}

.official-title h1 {
  font-size: 20px;
  font-weight: 800;
  color: #00376E;
  text-transform: uppercase;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.official-title p {
  font-size: 12px;
  color: #718096;
}

.official-section-title {
  font-size: 14px;
  font-weight: 700;
  color: #00376E;
  border-bottom: 1.5px solid #e2e8f0;
  padding-bottom: 6px;
  margin-top: 24px;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.official-text {
  font-size: 12px;
  line-height: 1.6;
  color: #2d3748;
  margin-bottom: 16px;
}

.official-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  margin-bottom: 20px;
}

.official-table th {
  background: #f7fafc;
  border-bottom: 2px solid #cbd5e0;
  padding: 8px 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: #4a5568;
  text-align: left;
}

.official-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #e2e8f0;
  color: #2d3748;
}

.official-table tr:last-child td {
  border-bottom: 2px solid #cbd5e0;
}

.official-table tr.official-total-row {
  background: #edf2f7;
  font-weight: 700;
}

.official-table tr.official-total-row td {
  border-top: 1.5px solid #cbd5e0;
  border-bottom: 2px solid #4a5568;
}

.official-sign-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  margin-top: 48px;
  page-break-inside: avoid;
}

.official-sign-box {
  border: 1px dashed #cbd5e0;
  border-radius: var(--radius-xs);
  padding: 16px;
  text-align: center;
  min-height: 100px;
}

.official-sign-label {
  font-size: 11px;
  font-weight: 600;
  color: #718096;
  margin-bottom: 30px;
  text-transform: uppercase;
}

.official-sign-name {
  font-size: 12px;
  font-weight: 700;
  color: #1a202c;
}

.official-stamp {
  border: 3px double #ff1744;
  color: #ff1744;
  display: inline-block;
  padding: 6px 12px;
  font-weight: 900;
  font-size: 12px;
  border-radius: 4px;
  transform: rotate(-10deg);
  opacity: 0.85;
  text-transform: uppercase;
  margin-top: 10px;
}

@media print {
  body * {
    visibility: hidden;
  }
  .report-a4-page, .report-a4-page * {
    visibility: visible;
  }
  .report-a4-page {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    box-shadow: none;
    padding: 0;
    margin: 0;
  }
  .report-export-actions {
    display: none;
  }
}

/* --- CBAM (SKDM) Calculator & Layout Styles --- */
.cbam-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 1024px) {
  .cbam-grid {
    grid-template-columns: 1fr;
  }
}

.cbam-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.cbam-machine-selector {
  max-height: 220px;
  overflow-y: auto;
  padding: 12px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  margin-top: 8px;
}

.cbam-scope-group-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 4px;
  margin-top: 12px;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.cbam-scope-group-title:first-of-type {
  margin-top: 0;
}

.cbam-machine-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  user-select: none;
}

.cbam-machine-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.cbam-progress-container {
  margin-top: 16px;
  margin-bottom: 16px;
}

.cbam-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-secondary);
}

.cbam-progress-track {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  height: 14px;
  margin: 6px 0;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.cbam-progress-fill {
  height: 100%;
  border-radius: 8px;
  width: 0%;
  transition: width 0.4s ease, background-color 0.4s ease;
}

.cbam-progress-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #ff1744;
  z-index: 2;
  box-shadow: 0 0 6px rgba(255, 23, 68, 0.8);
}

.cbam-progress-marker-label {
  position: absolute;
  font-size: 9px;
  color: #ff1744;
  font-weight: 700;
  top: -16px;
  transform: translateX(-50%);
  white-space: nowrap;
}

/* Custom rating badges */
.badge-cbam {
  display: inline-flex;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
  border-radius: var(--radius-xs);
  text-transform: uppercase;
}

.badge-cbam-a {
  background: rgba(0, 200, 83, 0.15);
  color: var(--success);
  border: 1px solid rgba(0, 200, 83, 0.3);
}

.badge-cbam-b {
  background: rgba(0, 168, 255, 0.15);
  color: var(--accent-blue);
  border: 1px solid rgba(0, 168, 255, 0.3);
}

.badge-cbam-c {
  background: rgba(255, 171, 0, 0.15);
  color: var(--warning);
  border: 1px solid rgba(255, 171, 0, 0.3);
}

.badge-cbam-d {
  background: rgba(255, 23, 68, 0.15);
  color: var(--danger);
  border: 1px solid rgba(255, 23, 68, 0.3);
}

.cbam-official-badge {
  border: 3px solid #00c853;
  color: #00c853;
  padding: 6px 12px;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 11px;
  display: inline-block;
  border-radius: 4px;
  transform: rotate(-5deg);
  opacity: 0.9;
  margin-top: 10px;
}

.cbam-official-badge.warning {
  border-color: #ffab00;
  color: #ffab00;
}

.cbam-official-badge.danger {
  border-color: #ff1744;
  color: #ff1744;
}