:root {
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-secondary: #f1f5f9;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  
  --accent-primary: #0284c7;
  --accent-hover: #0369a1;
  --accent-light: #e0f2fe;
  
  --color-success: #16a34a;
  --color-warning: #ea580c;
  --color-danger: #dc2626;
  
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 10px 25px rgba(15, 23, 42, 0.08);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-family);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

input, textarea, select {
  user-select: text !important;
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
}

.app-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-icon {
  width: 42px;
  height: 42px;
  background: var(--accent-primary);
  color: #ffffff;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
}

.brand-name {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.typing-link {
  color: var(--text-primary);
  text-decoration: none;
}

.typing-text {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  animation: typingEffect 10s steps(12, end) infinite;
}

@keyframes typingEffect {
  0% { width: 0; }
  25% { width: 100%; }
  85% { width: 100%; }
  100% { width: 0; }
}

.brand-tagline {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  height: 1.2em;
  overflow: hidden;
  position: relative;
}

.tagline-slide {
  display: inline-block;
  transition: all 0.4s ease-in-out;
  opacity: 0;
  transform: translateY(8px);
}

.tagline-slide.active {
  opacity: 1;
  transform: translateY(0);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.live-status-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: var(--color-success);
  padding: 0.35rem 0.75rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--color-success);
  border-radius: 50%;
  box-shadow: 0 0 0 rgba(22, 163, 74, 0.4);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(22, 163, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

.btn-icon {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
}

.dashboard-container {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem;
  flex: 1;
}

.hero-card {
  background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%);
  border: 1px solid #bae6fd;
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
  gap: 1.5rem;
}

.badge-tech {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent-light);
  color: var(--accent-hover);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.hero-content h1 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.hero-content p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 650px;
}

.hero-widget {
  text-align: right;
  background: #ffffff;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  min-width: 180px;
}

.clock-display {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent-primary);
  font-family: monospace;
  line-height: 1.1;
}

.date-display {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
}

.dash-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.dash-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.dash-card.highlighted-card {
  border-top: 3px solid var(--accent-primary);
}

.dash-card.span-2 {
  grid-column: span 2;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--bg-secondary);
}

.card-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.card-title h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.icon-accent {
  color: var(--accent-primary);
  font-size: 1.1rem;
}

.badge-live {
  background: #fef2f2;
  color: var(--color-danger);
  border: 1px solid #fecaca;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.tag-category {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-secondary);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.grid-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.metric-box {
  background: var(--bg-secondary);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  text-align: center;
}

.metric-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.metric-value {
  display: block;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0.2rem 0;
}

.metric-sub {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.info-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.info-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px dashed var(--border-color);
}

.info-list li:last-child {
  border-bottom: none;
}

.info-list span {
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.text-highlight {
  color: var(--accent-primary);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.mini-form {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.input-group label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 0.2rem;
}

.input-group input {
  width: 100%;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.btn-primary {
  grid-column: span 3;
  background: var(--accent-primary);
  color: #ffffff;
  border: none;
  padding: 0.55rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.calc-result {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #15803d;
  padding: 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  text-align: center;
}

.grid-tools {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
}

.tool-shortcut {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.88rem;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.tool-shortcut i {
  font-size: 1.4rem;
  color: var(--accent-primary);
}

.tool-shortcut:hover {
  background: var(--accent-light);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

.app-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 1.5rem;
  margin-top: 2rem;
}

.footer-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-info p {
  font-size: 0.88rem;
  color: var(--text-primary);
}

.footer-sub {
  font-size: 0.78rem !important;
  color: var(--text-muted) !important;
}

.footer-links {
  display: flex;
  gap: 1.25rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--accent-primary);
}

@media (max-width: 992px) {
  .dash-card.span-2 {
    grid-column: span 1;
  }
}

@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .hero-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-widget {
    width: 100%;
    text-align: left;
  }

  .grid-metrics {
    grid-template-columns: 1fr;
  }

  .footer-container {
    flex-direction: column;
    align-items: flex-start;
  }
}