@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;700&display=swap');

:root {
  --font-sans: 'Plus Jakarta Sans', 'Poppins', sans-serif;
  --font-mono: 'Fira Code', 'JetBrains Mono', monospace;

  /* Colors */
  --bg-app: #0B0F1A;
  --bg-surface-primary: #111827;
  --bg-surface-secondary: #131C2E;
  --bg-surface-elevated: #1A2340;
  --bg-surface-glass: rgba(255,255,255,0.04);
  --bg-sidebar: #0D1321;
  --bg-topbar: rgba(11,15,26,0.85);

  --accent-primary: #0075FF;
  --accent-primary-hover: #0062D6;
  --accent-cyan: #00D4FF;
  --accent-purple: #7B61FF;
  --accent-teal: #01B574;

  --semantic-success: #01B574;
  --semantic-success-bg: rgba(1,181,116,0.15);
  --semantic-warning: #FFB547;
  --semantic-warning-bg: rgba(255,181,71,0.15);
  --semantic-danger: #E53E3E;
  --semantic-danger-bg: rgba(229,62,62,0.15);
  --semantic-info: #0075FF;
  --semantic-info-bg: rgba(0,117,255,0.15);

  --text-primary: #FFFFFF;
  --text-secondary: rgba(255,255,255,0.6);
  --text-tertiary: rgba(255,255,255,0.35);
  --text-muted: rgba(255,255,255,0.2);

  --border-default: rgba(255,255,255,0.06);
  --border-subtle: rgba(255,255,255,0.04);
  --border-strong: rgba(255,255,255,0.12);
  --border-accent: rgba(0,117,255,0.4);

  --gradient-blue-purple: linear-gradient(135deg, #0075FF 0%, #7B61FF 100%);
  --gradient-blue-cyan: linear-gradient(135deg, #0075FF 0%, #00D4FF 100%);
  --gradient-teal-blue: linear-gradient(135deg, #01B574 0%, #0075FF 100%);
  --gradient-orange: linear-gradient(135deg, #FFB547, #FF7A00);
  --gradient-card-hero: linear-gradient(127deg, #0F1B3C 0%, #1A2E5A 50%, rgba(0,117,255,0.13) 100%);

  /* Typography */
  --text-body: 14px;
  --line-height-body: 1.6;

  /* Spacing */
  --spacing-base: 8px;
  --sidebar-width: 240px;
  --topbar-height: 70px;
  --content-padding: 32px;
  --card-padding: 24px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-xxl: 24px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-card: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-card-hover: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-glow-blue: 0 0 20px rgba(0,117,255,0.4);
  --shadow-glow-cyan: 0 0 20px rgba(0,212,255,0.3);
  --shadow-icon-badge: 0 4px 12px rgba(0,117,255,0.4);
  --shadow-modal: 0 20px 60px rgba(0,0,0,0.7);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { 
  font-family: var(--font-sans); 
  font-size: var(--text-body); 
  line-height: var(--line-height-body);
  color: var(--text-secondary); 
  background: var(--bg-app); 
}

.app { display: flex; height: 100vh; min-height: 600px; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-default);
  display: flex;
  flex-direction: column;
  padding: 20px 0;
}
.sidebar-logo {
  padding: 0 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.sidebar-logo-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--gradient-blue-purple);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  color: #fff;
  font-size: 22px;
  box-shadow: var(--shadow-glow-blue);
}
.sidebar-logo-text h1 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-primary);
  line-height: 1.2;
}
.sidebar-logo-text span {
  font-size: 12px;
  color: var(--text-tertiary);
}

.nav-section { padding: 4px 0; }
.nav-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 16px 20px 8px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin: 2px 16px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
}
.nav-item.active {
  background: var(--gradient-blue-purple);
  color: var(--text-primary);
  box-shadow: var(--shadow-glow-blue);
  font-weight: 700;
}
.nav-icon { width: 18px; height: 18px; opacity: 1; }

/* Main Area */
.main {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Topbar */
.topbar {
  height: var(--topbar-height);
  background: rgba(13,19,33,0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-default);
  padding: 0 var(--content-padding);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}
.topbar-actions { display: flex; gap: 12px; align-items: center; }

/* Buttons */
.btn {
  padding: 10px 24px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text-primary);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn:hover {
  background: rgba(255,255,255,0.06);
  transform: translateY(-2px);
}
.btn-primary {
  background: var(--gradient-blue-purple);
  color: #fff;
  border: none;
  box-shadow: var(--shadow-glow-blue);
}
.btn-primary:hover {
  opacity: 0.9;
  background: var(--gradient-blue-purple);
}
.btn-sm {
  padding: 6px 16px;
  font-size: 13px;
}

/* Content */
.content {
  padding: var(--content-padding);
  flex: 1;
}
.page { display: none; animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1); }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* Stat Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-surface-secondary);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-subtle);
  padding: 24px;
  box-shadow: var(--shadow-card);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-card-hover); border-color: var(--border-strong); }

.stat-info { display: flex; flex-direction: column; }
.stat-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}
.stat-value {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.stat-sub { font-size: 13px; font-weight: 700; display:flex; gap:6px; align-items:center; }
.stat-sub span { color: var(--text-tertiary); font-weight: 400; }

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: var(--shadow-icon-badge);
  color: #fff;
}

/* Base Cards */
.card {
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 24px 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}
.card.card-hero {
  background: var(--gradient-card-hero);
  border-radius: var(--radius-xxl);
  border: 1px solid var(--border-subtle);
}
.card:hover {
  box-shadow: var(--shadow-card-hover);
}
.card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
}
th {
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-strong);
}
td {
  padding: 16px 16px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 14px;
  color: var(--text-secondary);
  transition: background 0.15s;
}
td .clickable { color: var(--text-primary); font-weight: 700; transition: color 0.15s; }
td .clickable:hover { color: var(--accent-cyan); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.03); }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
}
.badge-success { background: var(--semantic-success-bg); color: var(--semantic-success); border: 1px solid rgba(1,181,116,0.3); }
.badge-warning { background: var(--semantic-warning-bg); color: var(--semantic-warning); border: 1px solid rgba(255,181,71,0.3); }
.badge-danger { background: var(--semantic-danger-bg); color: var(--semantic-danger); border: 1px solid rgba(229,62,62,0.3); }
.badge-info { background: var(--semantic-info-bg); color: var(--semantic-info); border: 1px solid rgba(0,117,255,0.3); border-color:rgba(0,117,255,0.4) }
.badge-gray { background: transparent; color: var(--text-tertiary); border: 1px solid var(--border-strong); }

/* Forms & Inputs */
.search-bar {
  width: 100%;
  padding: 12px 20px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
  font-size: 14px;
  margin-bottom: 24px;
  outline: none;
  font-family: inherit;
  transition: all 0.2s;
}
.search-bar::placeholder { color: var(--text-tertiary); }
.search-bar:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(0,117,255,0.15);
  background: rgba(255,255,255,0.08);
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-tertiary);
  letter-spacing: 0.04em;
}
.form-group input, .form-group select {
  padding: 12px 16px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: all 0.2s;
}
.form-group input:focus, .form-group select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(0,117,255,0.15);
}
.form-group select option {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
}

/* Progress */
.progress-bar {
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 10px;
}
.progress-fill {
  height: 100%;
  border-radius: 3px;
  box-shadow: 0 0 10px rgba(0,212,255,0.4);
}
.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}
.progress-label span:last-child {
  font-weight: 400;
  color: var(--text-secondary);
}

/* Modals */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 100;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.modal-overlay.open { display: flex; animation: fadeIn 0.2s ease; }
.modal {
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-xxl);
  border: 1px solid var(--border-default);
  padding: 32px;
  width: 600px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-modal);
}
.modal-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 28px;
  color: var(--text-primary);
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 32px;
}

/* Detail view */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.asset-detail-header {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 32px;
}
.asset-avatar {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-xl);
  background: var(--gradient-blue-purple);
  box-shadow: var(--shadow-glow-blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  flex-shrink: 0;
}
.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 14px;
}
.detail-row:last-child { border-bottom: none; }
.detail-label { color: var(--text-secondary); }
.detail-value { font-weight: 700; color: var(--text-primary); }

/* Timeline */
.timeline { position: relative; padding-left: 32px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: rgba(255,255,255,0.08);
}
.timeline-item { position: relative; margin-bottom: 28px; }
.timeline-dot {
  position: absolute;
  left: -28px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--bg-surface-secondary);
  background: var(--text-tertiary);
}
.timeline-dot.green { background: var(--semantic-success); box-shadow: 0 0 12px var(--semantic-success); }
.timeline-dot.amber { background: var(--semantic-warning); box-shadow: 0 0 12px var(--semantic-warning); }
.timeline-dot.red { background: var(--semantic-danger); box-shadow: 0 0 12px var(--semantic-danger); }
.timeline-dot.blue { background: var(--accent-primary); box-shadow: 0 0 12px var(--accent-primary); }
.timeline-date { font-size: 11px; font-weight: 700; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 6px; }
.timeline-title { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.timeline-desc { font-size: 14px; color: var(--text-secondary); margin-top: 6px; line-height: 1.5; }

/* Misc */
.clickable { cursor: pointer; color: var(--text-primary); font-weight: 700; transition: color 0.15s; text-decoration: none; }
.clickable:hover { color: var(--accent-cyan); text-shadow: var(--shadow-glow-cyan); }
.alert-warning {
  background: var(--semantic-warning-bg);
  border: 1px solid rgba(255,181,71,0.3);
  color: var(--semantic-warning);
  padding: 16px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  margin-bottom: 24px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
}
.report-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-default);
  padding: 24px;
  border-radius: var(--radius-xl);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.report-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--border-strong);
  background: rgba(255,255,255,0.06);
}
