/* MarketIntelligence Global Styles */

/* Color Palette */
:root {
  --primary-color: #1769e8;
  --secondary-color: #6c757d;
  --success-color: #28a745;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --info-color: #17a2b8;
  --white: #ffffff;
  --gray-100: #f8f9fa;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-400: #ced4da;
  --gray-500: #adb5bd;
  --gray-600: #6c757d;
  --gray-700: #495057;
  --gray-800: #343a40;
  --gray-900: #212529;
  --mi-navy: #0f172a;
  --mi-blue: #1769e8;
  --mi-blue-dark: #1d4ed8;
  --mi-soft-bg: #f4f7fb;
  --mi-border: #e2e8f0;
  --mi-muted: #64748b;
  --mi-card-radius: 18px;
  --mi-shadow: 0 16px 38px rgba(15, 23, 42, .06);
  --mi-shadow-lg: 0 22px 55px rgba(15, 23, 42, .14);
}

/* Typography */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #1f2937;
  background-color: var(--mi-soft-bg);
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

/* Spacing */
.p-0 { padding: 0; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.p-5 { padding: 3rem; }

.m-0 { margin: 0; }
.m-1 { margin: 0.25rem; }
.m-2 { margin: 0.5rem; }
.m-3 { margin: 1rem; }
.m-4 { margin: 1.5rem; }
.m-5 { margin: 3rem; }

/* Layout */
.sidebar {
  width: 264px;
  background-color: var(--white);
  border-right: 1px solid var(--mi-border);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 1000;
}

.main-content {
  margin-left: 264px;
  padding: 0;
  min-height: 100vh;
}

.topbar {
  min-height: 68px;
  background-color: var(--white);
  border-bottom: 1px solid var(--mi-border);
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer {
  background-color: transparent;
  border-top: 1px solid var(--mi-border);
  padding: 1rem;
  text-align: center;
  color: var(--gray-600);
}

/* Cards */
.card {
  border: 1px solid var(--mi-border);
  border-radius: var(--mi-card-radius);
  box-shadow: var(--mi-shadow);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card:hover {
  box-shadow: 0 20px 45px rgba(15, 23, 42, .08);
}

.card-header {
  background-color: #fff;
  border-bottom: 1px solid var(--mi-border);
  font-weight: 600;
}

/* Buttons */
.btn {
  border-radius: 10px;
  font-weight: 700;
  transition: all 0.2s ease;
}

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

.btn-primary:hover {
  background-color: #0056b3;
  border-color: #0056b3;
}

/* Tables */
.table {
  margin-bottom: 0;
}

.table thead th {
  border-bottom: 2px solid var(--gray-200);
  font-weight: 600;
  color: var(--gray-700);
}

.table tbody tr:hover {
  background-color: var(--gray-50);
}

/* Forms */
.form-control {
  border-radius: 10px;
  border: 1px solid #cbd5e1;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.18rem rgba(23, 105, 232, 0.16);
}

.form-select {
  border-radius: 10px;
  border: 1px solid #cbd5e1;
}

/* Modals */
.modal-content {
  border-radius: 8px;
  border: none;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* Alerts */
.alert {
  border-radius: 6px;
  border: none;
}

/* Badges */
.badge {
  font-weight: 500;
  border-radius: 999px;
}

/* Progress Bars */
.progress {
  height: 8px;
  border-radius: 4px;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
  }

  .main-content {
    margin-left: 0;
  }

  .topbar {
    padding: 0 0.5rem;
  }
}

/* Notification styles */
.notification-menu {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.notification-item:hover {
    background-color: rgba(0, 123, 255, 0.1);
    border-left-color: #007bff;
}

.notification-item.unread {
    background-color: rgba(0, 123, 255, 0.05);
    border-left-color: #007bff;
}

.notification-item .badge {
    font-size: 0.7em;
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

.focus-visible:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Modern SaaS UI primitives */
.mi-page-shell {
  max-width: 1180px;
  margin: 0 auto;
}

.mi-hero {
  background: linear-gradient(135deg, var(--mi-navy) 0%, var(--mi-blue-dark) 100%);
  border-radius: 24px;
  color: #fff;
  overflow: hidden;
  padding: 30px;
  position: relative;
  box-shadow: var(--mi-shadow-lg);
}

.mi-hero::after {
  background: rgba(255, 255, 255, .08);
  border-radius: 999px;
  content: "";
  height: 220px;
  position: absolute;
  right: -70px;
  top: -90px;
  width: 220px;
}

.mi-hero > * {
  position: relative;
  z-index: 1;
}

.mi-eyebrow,
.mi-muted-label {
  color: var(--mi-muted);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.mi-hero .mi-eyebrow {
  color: #bfdbfe;
}

.mi-hero-title {
  font-size: clamp(1.7rem, 3vw, 2.45rem);
  font-weight: 850;
  letter-spacing: -.035em;
}

.mi-card {
  background: #fff;
  border: 1px solid var(--mi-border);
  border-radius: var(--mi-card-radius);
  box-shadow: var(--mi-shadow);
}

.mi-card-header {
  background: #fff;
  border-bottom: 1px solid var(--mi-border);
  padding: 1.15rem 1.35rem;
}

.mi-card-body {
  padding: 1.35rem;
}

.mi-metric-card {
  background: #fff;
  border: 1px solid var(--mi-border);
  border-radius: var(--mi-card-radius);
  box-shadow: var(--mi-shadow);
  height: 100%;
  padding: 1.1rem;
}

.mi-metric-value {
  color: var(--mi-navy);
  font-size: clamp(1.55rem, 3vw, 2rem);
  font-weight: 850;
  letter-spacing: -.03em;
  margin-top: .35rem;
}

.mi-action-btn {
  border-radius: 999px;
  font-weight: 800;
  padding-left: 1rem;
  padding-right: 1rem;
}

.mi-table {
  margin-bottom: 0;
}

.mi-table thead th {
  background: #f8fafc;
  border-bottom: 1px solid var(--mi-border);
  color: #475569;
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.mi-table tbody td {
  border-color: #eef2f7;
  padding: .95rem .75rem;
  vertical-align: middle;
}

.mi-table tbody tr:hover {
  background: #f8fafc;
}

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

.mi-empty-icon {
  align-items: center;
  background: #eff6ff;
  border-radius: 999px;
  color: var(--mi-blue);
  display: inline-flex;
  font-size: 2rem;
  height: 64px;
  justify-content: center;
  margin-bottom: 1rem;
  width: 64px;
}

.mi-filter-bar {
  background: #fff;
  border: 1px solid var(--mi-border);
  border-radius: var(--mi-card-radius);
  box-shadow: var(--mi-shadow);
  padding: 1.1rem;
}

.mi-soft-panel {
  background: #f8fafc;
  border: 1px solid var(--mi-border);
  border-radius: 16px;
  padding: 1rem;
}

.sidebar .nav-link {
  border-radius: 12px;
  color: #475569;
  font-weight: 700;
  margin-bottom: .2rem;
  padding: .68rem .85rem;
}

.sidebar .nav-link:hover {
  background: #eff6ff;
  color: var(--mi-blue);
}

.sidebar .nav-link.active {
  background: linear-gradient(135deg, var(--mi-blue), var(--mi-blue-dark));
  color: #fff;
  box-shadow: 0 12px 24px rgba(29, 78, 216, .2);
}

.avatar-circle-sm {
  align-items: center;
  background: #eff6ff;
  border-radius: 999px;
  color: var(--mi-blue);
  display: inline-flex;
  font-weight: 800;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.avatar-text-sm {
  font-size: .72rem;
}
