:root {
  --primary: #c0392b;
  --primary-dark: #962d22;
  --primary-light: #fdecea;
  --accent: #e67e22;
  --success: #27ae60;
  --warning: #f39c12;
  --danger: #e74c3c;
  --info: #2980b9;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --text: #2c3e50;
  --text-muted: #7f8c8d;
  --border: #e1e8ed;
  --sidebar-width: 260px;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--primary-dark);
}

/* Layout */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
  color: #fff;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #fff;
}

.sidebar-brand a:hover {
  color: #fff;
  opacity: 0.9;
}

.brand-icon {
  width: 42px;
  height: 42px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.brand-text h1 {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
}

.brand-text span {
  font-size: 0.7rem;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
}

.nav-section {
  padding: 0.5rem 1.25rem;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.5;
  margin-top: 0.5rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1.25rem;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.9rem;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-left-color: var(--primary);
}

.nav-link .icon {
  width: 20px;
  text-align: center;
  font-size: 1rem;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.75rem;
  opacity: 0.6;
}

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

.topbar {
  background: var(--surface);
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar h2 {
  font-size: 1.35rem;
  font-weight: 600;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--bg);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  gap: 0.5rem;
}

.search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.85rem;
  width: 200px;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.8rem;
}

.page-content {
  padding: 2rem;
}

/* Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
}

.stat-card.success { border-left-color: var(--success); }
.stat-card.warning { border-left-color: var(--warning); }
.stat-card.info { border-left-color: var(--info); }
.stat-card.danger { border-left-color: var(--danger); }

.stat-card .label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.stat-card .value {
  font-size: 2rem;
  font-weight: 700;
  margin: 0.25rem 0;
}

.stat-card .change {
  font-size: 0.8rem;
  color: var(--success);
}

.stat-card .change.negative {
  color: var(--danger);
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h3 {
  font-size: 1rem;
  font-weight: 600;
}

.card-body {
  padding: 1.5rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

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

/* Tables */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}

th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg);
}

tr:hover td {
  background: #fafbfc;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-success { background: #d5f5e3; color: #1e8449; }
.badge-warning { background: #fef9e7; color: #b7950b; }
.badge-danger { background: #fadbd8; color: #c0392b; }
.badge-info { background: #d6eaf8; color: #1a5276; }
.badge-neutral { background: #ecf0f1; color: #566573; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
  color: #fff;
}

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

.btn-outline:hover {
  background: var(--bg);
  color: var(--text);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
}

/* Progress */
.progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--success);
  transition: width 0.3s;
}

.progress-fill.warning { background: var(--warning); }
.progress-fill.danger { background: var(--danger); }

/* Timeline */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: 1.5rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -2rem;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 2px var(--primary);
}

.timeline-item.done::before {
  background: var(--success);
  box-shadow: 0 0 0 2px var(--success);
}

.timeline-item.pending::before {
  background: var(--border);
  box-shadow: 0 0 0 2px var(--border);
}

.timeline-item h4 {
  font-size: 0.9rem;
  margin-bottom: 0.15rem;
}

.timeline-item p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Kanban */
.kanban {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

@media (max-width: 1100px) {
  .kanban {
    grid-template-columns: repeat(2, 1fr);
  }
}

.kanban-col {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 1rem;
}

.kanban-col h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kanban-card {
  background: var(--surface);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.kanban-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.kanban-card h5 {
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.kanban-card p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Profile */
.profile-header {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin-bottom: 2rem;
}

.profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  flex-shrink: 0;
}

.profile-info h2 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 1rem;
}

.meta-item {
  font-size: 0.85rem;
}

.meta-item .label {
  color: var(--text-muted);
  font-size: 0.75rem;
  display: block;
}

/* Map placeholder */
.map-placeholder {
  background: linear-gradient(135deg, #d5dbdb 0%, #aeb6bf 100%);
  border-radius: var(--radius);
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #566573;
  font-size: 0.9rem;
  position: relative;
  overflow: hidden;
}

.map-dot {
  position: absolute;
  width: 14px;
  height: 14px;
  background: var(--primary);
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 8px rgba(192, 57, 43, 0.5);
  cursor: pointer;
}

.map-dot::after {
  content: attr(data-label);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a2e;
  color: #fff;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.65rem;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.map-dot:hover::after {
  opacity: 1;
}

/* Calendar grid */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  background: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.cal-header {
  background: var(--bg);
  padding: 0.5rem;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
}

.cal-day {
  background: var(--surface);
  padding: 0.5rem;
  min-height: 80px;
  font-size: 0.8rem;
}

.cal-day .date {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.cal-event {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.65rem;
  padding: 0.15rem 0.35rem;
  border-radius: 3px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Alert banner */
.alert-banner {
  background: linear-gradient(90deg, var(--primary), var(--accent));
  color: #fff;
  padding: 0.75rem 2rem;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.alert-banner a {
  color: #fff;
  text-decoration: underline;
}

/* Checklist */
.checklist-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

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

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

.check-icon.done {
  background: #d5f5e3;
  color: var(--success);
}

.check-icon.pending {
  background: #fef9e7;
  color: var(--warning);
}

.check-icon.missing {
  background: #fadbd8;
  color: var(--danger);
}

/* Demo watermark */
.demo-banner {
  background: #1a1a2e;
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
  padding: 0.5rem;
  font-size: 0.75rem;
}

.demo-banner strong {
  color: var(--accent);
}

/* Value proposition */
.value-hero {
  background: linear-gradient(135deg, #1a1a2e 0%, #2c3e50 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 2rem 2.5rem;
  margin-bottom: 1.5rem;
}

.value-hero h2 {
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.value-hero p {
  font-size: 0.95rem;
  opacity: 0.9;
  max-width: 720px;
  line-height: 1.6;
}

.value-pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 2rem;
}

@media (max-width: 900px) {
  .value-pillars {
    grid-template-columns: 1fr;
  }
}

.value-pillar {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border-top: 4px solid var(--primary);
  color: inherit;
  transition: transform 0.15s, box-shadow 0.15s;
}

.value-pillar:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  color: inherit;
}

.value-pillar:nth-child(2) { border-top-color: var(--info); }
.value-pillar:nth-child(3) { border-top-color: var(--success); }

.pillar-icon {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
}

.value-pillar h3 {
  font-size: 1rem;
  margin-bottom: 0.4rem;
}

.value-pillar p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.module-tagline {
  background: var(--primary-light);
  border-left: 4px solid var(--primary);
  padding: 0.85rem 1.25rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.compare-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (max-width: 700px) {
  .compare-strip {
    grid-template-columns: 1fr;
  }
}

.compare-box {
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}

.compare-box.manual {
  background: #fdf2f2;
  border: 1px solid #fadbd8;
}

.compare-box.seamless {
  background: #eafaf1;
  border: 1px solid #d5f5e3;
}

.compare-box h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.compare-box.manual h4 { color: var(--danger); }
.compare-box.seamless h4 { color: var(--success); }

.compare-box ul {
  list-style: none;
  font-size: 0.85rem;
}

.compare-box li {
  padding: 0.3rem 0;
  padding-left: 1.25rem;
  position: relative;
}

.compare-box.manual li::before {
  content: '✕';
  position: absolute;
  left: 0;
  color: var(--danger);
  font-size: 0.75rem;
}

.compare-box.seamless li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--success);
  font-size: 0.75rem;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  padding: 1rem;
}

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

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

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

.modal-header h3 {
  font-size: 1.1rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group.full {
  grid-column: 1 / -1;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

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

.btn-danger:hover {
  background: #c0392b;
  color: #fff;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: 0.85rem 1.25rem;
  border-radius: 8px;
  color: #fff;
  font-size: 0.9rem;
  z-index: 2000;
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.3s;
  box-shadow: var(--shadow);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-info { background: var(--info); }

.action-cell {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.empty-state {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    width: 60px;
  }

  .sidebar .brand-text,
  .sidebar .nav-link span,
  .sidebar .nav-section,
  .sidebar-footer {
    display: none;
  }

  .main-content {
    margin-left: 60px;
  }

  .topbar {
    padding: 1rem;
  }

  .page-content {
    padding: 1rem;
  }
}
