:root {
  --bg-main: #f5f6fa;
  --bg-card: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border-color: #e2e8f0;
  --primary-blue: #3b82f6;
  --primary-hover: #2563eb;
  --badge-green-bg: #dcfce7;
  --badge-green-text: #166534;
  --badge-red-bg: #fee2e2;
  --badge-red-text: #991b1b;
  --color-its: #3b82f6;
  --color-claro: #ef4444;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Tela de Login */
.login-wrapper {
  position: fixed;
  inset: 0;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.login-card {
  background: #ffffff;
  border-radius: 12px;
  width: 100%;
  max-width: 400px;
  padding: 32px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.input-text {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 13.5px;
  color: #1e293b;
  outline: none;
}

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

/* Sidebar */
.sidebar {
  width: 250px;
  background-color: #ffffff;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-badge {
  background: linear-gradient(135deg, #6366f1, #3b82f6);
  color: white;
  font-weight: bold;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
}

.sidebar-nav {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

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

.nav-item:hover, .nav-item.active {
  background-color: #ede9fe;
  color: #4f46e5;
}

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

.top-header {
  height: 64px;
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
}

.breadcrumbs {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

.breadcrumbs span {
  color: var(--text-primary);
}

.tenant-selector {
  display: flex;
  align-items: center;
  gap: 12px;
}

.select-box {
  padding: 6px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 13px;
  background-color: #fff;
  color: var(--text-primary);
  outline: none;
  font-weight: 500;
}

.content-body {
  padding: 28px;
  flex: 1;
}

.page-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  color: #0f172a;
}

.btn-primary {
  background-color: #0284c7;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover {
  background-color: #0369a1;
}

/* SD-WAN Cards Grid */
.sdwan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.sdwan-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
}

.card-header-inner {
  padding: 16px 18px 10px 18px;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 8px;
}

.status-badge {
  display: inline-block;
  background-color: var(--badge-green-bg);
  color: var(--badge-green-text);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 12px;
}

.card-meta-list {
  font-size: 12.5px;
  color: #334155;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-meta-list strong {
  color: #64748b;
  font-weight: 600;
}

.link-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
}

.link-indicator {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}

.link-indicator.its { background-color: var(--color-its); }
.link-indicator.claro { background-color: var(--color-claro); }

.card-sparkline-container {
  height: 60px;
  width: 100%;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  margin-top: 8px;
  border-bottom: 1px solid var(--border-color);
}

.card-sparkline-container svg {
  width: 100%;
  height: 100%;
}

.card-actions-bar {
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  background-color: #fafafa;
  font-size: 11.5px;
  color: var(--text-secondary);
}

.card-action-btn {
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-action-btn:hover {
  color: var(--primary-blue);
}

/* Modais e Timeline */
.timeline-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.timeline-dialog {
  background: #ffffff;
  border-radius: 12px;
  width: 90%;
  max-width: 850px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
}

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

.dialog-title {
  font-size: 20px;
  font-weight: 700;
}

.dialog-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

/* Timeline */
.timeline-list {
  position: relative;
  padding-left: 36px;
}

.timeline-list::before {
  content: "";
  position: absolute;
  top: 15px;
  bottom: 15px;
  left: 17px;
  width: 2px;
  background-color: #e2e8f0;
}

.timeline-entry {
  position: relative;
  margin-bottom: 24px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.timeline-icon-bubble {
  position: absolute;
  left: -36px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  z-index: 2;
}

.timeline-icon-bubble.current {
  border-color: #22c55e;
  color: #22c55e;
}

.timeline-icon-bubble.switch {
  border-color: #94a3b8;
  color: #64748b;
}

.timeline-text {
  font-size: 13.5px;
  line-height: 1.5;
  color: #475569;
}

/* Status dos Links WAN */
.links-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.link-status-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.link-name-huge {
  font-size: 20px;
  font-weight: 700;
}

.badge-on {
  background-color: #dcfce7;
  color: #15803d;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
}

.badge-off {
  background-color: #fee2e2;
  color: #b91c1c;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
}
