/*
 * SignalDesk application styles
 * Cleaned layout system for dashboard, issues, projects, tags, timeline, reports, search, auth, and forms.
 */

/* ========================================
   GLOBAL STYLES
======================================== */

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: #f3f1f1;
  color: #0e0c0c;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: 2rem;
  line-height: 1.1;
}

h2 {
  font-size: 1.35rem;
}

h3 {
  margin-bottom: 0.5rem;
}

a {
  text-decoration: none;
}

a:hover {
  text-decoration: none;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

/* ========================================
   LAYOUT
======================================== */

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

main,
.main-content {
  flex: 1;
  max-width: 1400px;
  padding: 2.5rem;
  color: #0e0c0c;
}

.page-header,
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 2rem;
}

.page-header h1,
.section-header h2 {
  margin: 0 0 0.5rem;
}

.page-header p,
.section-header p {
  margin: 0;
  color: #5f5f5f;
  line-height: 1.5;
}

/* ========================================
   SIDEBAR
======================================== */

.sidebar {
  width: 250px;
  min-height: 100vh;
  padding: 2rem 1rem;
  background-color: #0e0c0c;
  color: #f3f1f1;
  overflow-y: auto;
  flex-shrink: 0;
}

.sidebar-brand {
  margin-bottom: 2rem;
}

.sidebar-brand h2 {
  margin: 0;
  font-size: 1.4rem;
}

.sidebar-brand p {
  margin: 0.25rem 0 0;
  color: #9ca3af;
  font-size: 0.9rem;
}

.sidebar-section-label {
  margin: 2rem 0 0.75rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9ca3af;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar-nav a {
  display: block;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  color: #d1d5db;
}

.sidebar-nav a:visited {
  color: #d1d5db;
}

.sidebar-nav a:hover {
  background-color: #1f2937;
  color: #ffffff;
}

.sidebar-nav .active-nav {
  background-color: rgb(24, 97, 169);
  color: #ffffff !important;
  font-weight: 700;
}

.sidebar-divider {
  width: 100%;
  height: 1px;
  margin: 2rem 0;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.15), transparent);
}

.logout-button {
  width: 100%;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 10px;
  background-color: #111827;
  color: #facc15;
  font-weight: 800;
  cursor: pointer;
}

.logout-button:hover {
  background-color: #030712;
}

/* ========================================
   LINKS
======================================== */

main a,
main a:visited {
  color: #0e0c0c;
}

/* ========================================
   ACTION BUTTONS
======================================== */

.primary-action,
.secondary-action,
.danger-action,
input[type="submit"]:not(.search-submit) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 1.25rem;
  border-radius: 8px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  box-sizing: border-box;
  cursor: pointer;
}

.primary-action,
input[type="submit"]:not(.search-submit) {
  background-color: #111827;
  color: #facc15 !important;
}

.secondary-action {
  background-color: #ffffff;
  color: #111827 !important;
  border-color: #d1d5db;
}

.danger-action {
  background-color: #ffffff;
  color: #991b1b !important;
  border-color: #d1d5db;
}

.primary-action:hover,
.secondary-action:hover,
.danger-action:hover,
input[type="submit"]:hover {
  opacity: 0.9;
}

.inline-button-form {
  display: inline-flex;
  margin: 0;
}

.inline-button-form button,
.inline-button-form .primary-action,
.inline-button-form .secondary-action,
.inline-button-form .danger-action {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
}

/* ========================================
   CARDS / PANELS
======================================== */

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.dashboard-stats div,
.dashboard-panel,
.report-card,
.form-card,
.filter-panel,
.dashboard-side-panel,
.search-filter-sidebar,
.search-results-panel,
.empty-state,
.issue-card,
.project-card,
.tag-card,
.detail-section {
  background-color: #ffffff;
  border: 1px solid #dcdcdc;
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.dashboard-stats div,
.dashboard-panel {
  padding: 1.5rem;
}

.dashboard-panel h2,
.dashboard-panel h3 {
  margin-bottom: 1rem;
}

.dashboard-panel span {
  display: block;
  margin-top: 0.4rem;
  color: #6b7280;
  font-size: 0.85rem;
}

.dashboard-stats div:hover,
.dashboard-panel:hover,
.issue-card:hover,
.project-card:hover,
.tag-card:hover,
.timeline-v2-row:hover,
.timeline-entry:hover {
  transform: translateY(-2px);
  transition: 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07);
}

/* ========================================
   FORMS / INPUTS / SELECTS
======================================== */

.form-card {
  max-width: 700px;
  padding: 2rem;
  margin-top: 2rem;
}

.form-section {
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.resource-form,
.auth-form,
.search-filter-form {
  display: grid;
  gap: 1rem;
}

.field,
.form-field,
.auth-field,
.filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.field label,
.form-field label,
.auth-field label,
.filter-field label,
.filter-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: #374151;
}

.field input,
.field textarea,
.field select,
.form-input,
.form-field input,
.form-field textarea,
.form-field select,
.auth-field input,
.filter-field input,
.filter-field select,
.dashboard-search input,
.search-hero-form input[type="text"],
.search-toolbar select,
.search-header-actions select,
.search-sort select,
.saved-searches-select,
.saved-search-select,
.results-sort-select,
.search-results-header select,
.report-header-actions select,
.report-card select,
select {
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background-color: #ffffff;
  color: #111827;
  font-family: inherit;
  font-size: 0.95rem;
  box-sizing: border-box;
}

.field input,
.field textarea,
.field select,
.form-input,
.form-field input,
.form-field textarea,
.form-field select,
.auth-field input,
.filter-field input,
.filter-field select {
  width: 100%;
  padding: 0.85rem 1rem;
}

.form-input,
.form-field input,
.form-field textarea,
.form-field select {
  max-width: 500px;
}

.field textarea,
.form-field textarea {
  resize: vertical;
  min-height: 140px;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.form-input:focus,
.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus,
.auth-field input:focus,
.filter-field input:focus,
.filter-field select:focus,
.search-hero-form input[type="text"]:focus,
.dashboard-search input:focus,
select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.form-input::placeholder,
.form-field input::placeholder,
.search-hero-form input::placeholder,
.dashboard-search input::placeholder {
  color: #9ca3af;
}

.form-actions,
.issue-actions,
.filter-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: 2rem;
}

.error-box {
  padding: 1rem;
  border-radius: 10px;
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* nicer select dropdowns */
select,
.search-toolbar select,
.search-header-actions select,
.search-sort select,
.saved-searches-select,
.saved-search-select,
.results-sort-select,
.search-results-header select,
.report-header-actions select,
.report-card select {
  appearance: none;
  -webkit-appearance: none;
  min-height: 42px;
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, #6b7280 50%),
    linear-gradient(135deg, #6b7280 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

/* ========================================
   FILTERS
======================================== */

.status-filters,
.project-filters,
.tag-filters {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.status-filters a,
.project-filters a,
.tag-filters a {
  background-color: #f9fafb;
  border: 1px solid #dcdcdc;
  border-radius: 999px;
  padding: 0.55rem 1rem;
  color: #111827;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
}

.status-filters a:hover,
.project-filters a:hover,
.tag-filters a:hover {
  background-color: #f3f4f6;
}

.active-filter {
  background-color: #111827 !important;
  color: #ffffff !important;
}

.filter-panel {
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.filter-form {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1.2fr auto auto;
  gap: 1rem;
  align-items: end;
}

.filter-summary {
  background-color: #ffffff;
  border: 1px solid #dcdcdc;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin: 1rem 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.filter-summary p {
  margin: 0;
}

.filter-summary a {
  color: #111827;
  font-weight: 700;
}

/* ========================================
   DASHBOARD / TABLES
======================================== */

.dashboard-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2rem;
  margin-top: 1.5rem;
}

.dashboard-toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.dashboard-search {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.dashboard-search input {
  width: 240px;
  height: 44px;
  padding: 0 0.9rem;
}

.dashboard-table {
  background-color: #ffffff;
  border: 1px solid #dcdcdc;
  border-radius: 12px;
  overflow: hidden;
}

.dashboard-table-header,
.dashboard-row {
  display: grid;
  grid-template-columns: 40px 2fr 1.5fr 1fr 1fr 1fr;
  gap: 1rem;
  align-items: center;
  padding: 0.85rem 1rem;
}

.dashboard-table-header,
.projects-table-header,
.tags-table-header {
  background-color: #f9fafb;
  font-weight: 700;
  border-bottom: 1px solid #e5e7eb;
  color: #374151;
}

.dashboard-row,
.projects-row,
.tags-row {
  border-bottom: 1px solid #f3f4f6;
}

.dashboard-row:last-child,
.projects-row:last-child,
.tags-row:last-child {
  border-bottom: none;
}

.dashboard-row:hover,
.projects-row:hover,
.tags-row:hover {
  background-color: #f9fafb;
}

.dashboard-row a,
.projects-row a,
.tags-row a {
  color: #111827;
  font-weight: 700;
}

.dashboard-row a:hover,
.projects-row a:hover,
.tags-row a:hover {
  color: #2563eb;
}

.dashboard-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.dashboard-side-panel {
  padding: 1.5rem;
}

.dashboard-side-panel h2 {
  margin-top: 0;
}

.dashboard-side-panel ul {
  padding-left: 1.25rem;
  margin-bottom: 0;
}

.dashboard-side-panel li {
  margin-bottom: 0.75rem;
}

/* ========================================
   ISSUES
======================================== */

.issue-card {
  padding: 1.25rem;
  margin-bottom: 1rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.issue-card h2 {
  margin: 0;
}

.issue-card h2 a {
  color: #000000;
}

.issue-card h2 a:hover {
  color: #444444;
}

.issue-card-header,
.issue-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.issue-project,
.issue-date {
  color: #555555;
  margin-bottom: 0.5rem;
}

.issue-meta {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  color: #5f5f5f;
  font-size: 0.95rem;
  margin-top: 0.5rem;
}

.issue-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.issue-detail-page {
  max-width: 1000px;
}

.detail-section {
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.detail-section h2 {
  margin-bottom: 1rem;
}

.stack-trace {
  background-color: #f4f4f4;
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
}

/* ========================================
   BADGES / PILLS
======================================== */

.status-badge,
.severity-badge,
.severity-pill,
.tag-pill {
  display: inline-block;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-badge,
.severity-badge,
.severity-pill {
  padding: 0.35rem 0.75rem;
}

.status-badge {
  background-color: #e5e7eb;
}

.status-resolved {
  background-color: #e6f4ea;
  color: #137333;
}

.status-investigating {
  background-color: #fff3cd;
  color: #856404;
}

.status-pending {
  background-color: #f3f4f6;
  color: #374151;
}

.issue-badges {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.severity-badge,
.severity-pill {
  background-color: #f3f4f6;
  color: #374151;
}

.severity-low {
  background-color: #e0f2fe;
  color: #075985;
}

.severity-medium {
  background-color: #fef3c7;
  color: #92400e;
}

.severity-high {
  background-color: #fee2e2;
  color: #991b1b;
}

.severity-critical {
  background-color: #111827;
  color: #ffffff;
}

/* ========================================
   PROJECTS
======================================== */

.project-grid,
.tag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.project-card,
.tag-card {
  display: block;
  padding: 1.5rem;
  color: #111827;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.project-card h2,
.tag-card h2 {
  margin-top: 0;
}

.project-card h2 a {
  color: #111827;
}

.project-card h2 a:hover {
  color: #374151;
}

.projects-filter-form,
.tags-filter-form {
  grid-template-columns: 2fr 1fr auto;
}

.projects-table-header,
.projects-row {
  display: grid;
  grid-template-columns: minmax(200px, 1.3fr) minmax(260px, 1.8fr) 90px 110px 150px 130px;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
}

.progress-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.progress-track,
.mini-progress-track {
  height: 8px;
  background-color: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}

.progress-track {
  width: 90px;
}

.progress-fill,
.mini-progress-fill {
  height: 100%;
  background-color: #2563eb;
  border-radius: 999px;
}

.progress-cell span {
  font-size: 0.9rem;
  font-weight: 700;
  color: #374151;
}

/* ========================================
   TAGS
======================================== */

.issue-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.tag-pill {
  background-color: #eef2ff;
  color: #3730a3;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
}

.tag-pill:hover {
  background-color: #e0e7ff;
}

.tags-table,
.tags-list,
.table-card {
  width: 100%;
}

.tags-table-header,
.tags-row {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) 120px 120px 150px 190px;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.25rem;
}

table.tags-table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
}

table.tags-table th,
table.tags-table td {
  padding: 1rem;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  vertical-align: middle;
}

table.tags-table th {
  background: #f9fafb;
  color: #374151;
  font-weight: 700;
}

.table-actions,
.tags-table-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.table-actions form,
.tags-table-actions form {
  margin: 0;
}

/* ========================================
   CHECKBOX GROUPS
======================================== */

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background-color: #f9fafb;
  border: 1px solid #dcdcdc;
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
}

.checkbox-item input {
  margin: 0;
}

/* ========================================
   TIMELINE
======================================== */

.timeline-filter-form {
  grid-template-columns: 2fr 1fr 1fr auto;
}

.timeline-v2,
.timeline-list {
  margin-top: 2rem;
  display: grid;
  gap: 1.5rem;
  position: relative;
}

.timeline-v2::before {
  content: "";
  position: absolute;
  left: 122px;
  top: 2.2rem;
  bottom: 1rem;
  width: 2px;
  background-color: #e5e7eb;
  z-index: 0;
}

.timeline-date-group,
.timeline-day {
  display: grid;
  gap: 0.75rem;
}

.timeline-date-heading,
.timeline-day h2 {
  margin: 0.5rem 0;
  font-size: 1.4rem;
  color: #111827;
}

.timeline-v2-row {
  display: grid;
  grid-template-columns: 100px 32px 1fr 130px 180px;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.25rem;
  border: 1px solid #dcdcdc;
  border-radius: 12px;
  background: #ffffff;
  position: relative;
  z-index: 1;
}

.timeline-entry {
  padding: 1rem 1.25rem;
  display: grid;
  gap: 0.5rem;
}

.timeline-time,
.timeline-entry time {
  color: #6b7280;
  font-size: 0.9rem;
}

.timeline-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background-color: #111827;
  position: relative;
  z-index: 2;
}

.timeline-event a {
  color: #111827;
  font-weight: 700;
}

.timeline-event a:hover {
  color: #2563eb;
}

/* ========================================
   REPORTS
======================================== */

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

.report-tabs,
.search-tabs {
  display: flex;
  gap: 2rem;
  border-bottom: 1px solid #dcdcdc;
  margin-bottom: 1.5rem;
}

.report-tabs a,
.search-tabs a {
  padding: 0.75rem 0;
  color: #374151;
  font-weight: 700;
}

.report-tabs .active-tab,
.search-tabs .active-tab {
  color: #2563eb;
  border-bottom: 2px solid #2563eb;
}

.reports-visual-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.reports-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.report-card {
  padding: 1.25rem;
}

.report-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.report-card h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

.reports-summary-stats {
  margin-top: 2rem;
}

.mini-table {
  display: grid;
  gap: 0.9rem;
}

.mini-table-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto minmax(120px, 180px);
  gap: 0.75rem;
  align-items: center;
}

.mini-progress-track {
  width: 100%;
}

.report-link {
  display: inline-block;
  margin-top: 1rem;
  font-weight: 700;
  color: #2563eb;
}

.summary-list p {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.info-box {
  background-color: #eff6ff;
  border-radius: 8px;
  padding: 1rem;
  color: #1e3a8a;
  margin-top: 1rem;
}

.grafana-embed-card {
  margin: 2rem 0;
  padding: 1.5rem;
  width: 100%;
  box-sizing: border-box;
}

.grafana-frame-wrapper {
  width: 100%;
  height: 1250px;
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid #d1d5db;
  background: #111827;
}

.grafana-dashboard-frame {
  display: block;
  width: 100%;
  height: 1250px;
  border: 0;
}

/* ========================================
   SEARCH
======================================== */

.search-hero-form {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.search-hero-form input[type="text"] {
  flex: 1;
  height: 48px;
  padding: 0 1rem;
}

.search-submit {
  height: 48px;
  min-width: 100px;
  padding: 0 1.25rem;
  margin: 0;
  border: none;
  border-radius: 10px;
  background-color: #111827 !important;
  color: #facc15 !important;
  font: inherit;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-sizing: border-box;
  appearance: none;
}

.search-submit:hover {
  opacity: 0.9;
}

.search-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
}

.search-filter-sidebar {
  padding: 1.25rem;
  align-self: start;
}

.search-results-panel {
  overflow: hidden;
}

.filter-sidebar-header,
.search-results-header,
.search-toolbar,
.search-header-actions,
.search-sort {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.filter-sidebar-header,
.search-results-header {
  justify-content: space-between;
}

.filter-sidebar-header {
  margin-bottom: 1rem;
}

.filter-sidebar-header h2,
.search-results-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.search-results-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 1rem;
}

.search-header-actions,
.search-sort {
  justify-content: flex-end;
}

.search-result-row {
  display: grid;
  grid-template-columns: 48px 1fr 160px;
  gap: 1rem;
  padding: 1.25rem;
  border-bottom: 1px solid #e5e7eb;
}

.search-result-row:last-child {
  border-bottom: none;
}

.search-result-row:hover {
  background-color: #f9fafb;
}

.search-result-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background-color: #eef2ff;
  color: #3730a3;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.search-result-main h3 {
  margin: 0 0 0.5rem;
}

.search-result-main h3 a {
  color: #2563eb;
}

.search-result-main p {
  margin: 0 0 0.75rem;
  color: #374151;
  line-height: 1.5;
}

.search-result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  color: #6b7280;
  font-size: 0.9rem;
}

.search-result-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
  color: #6b7280;
}

/* ========================================
   VISUAL PLACEHOLDERS / UTILITIES
======================================== */

.quick-actions {
  display: flex;
  gap: 1rem;
  align-items: stretch;
  margin: 1.5rem 0 2rem;
}

.quick-actions a {
  height: 48px;
  padding: 0 1.4rem;
}

.compact-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid #eeeeee;
}

.compact-row:last-child {
  border-bottom: none;
}

.tag-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.empty-state {
  padding: 3rem;
  text-align: center;
}

.line-chart-placeholder {
  position: relative;
  height: 220px;
  margin-top: 1rem;
  border-left: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  background: repeating-linear-gradient(to top, #ffffff, #ffffff 43px, #f3f4f6 44px);
}

.chart-line {
  position: absolute;
  height: 3px;
  border-radius: 999px;
  transform-origin: left center;
}

.chart-line-one {
  width: 80%;
  background-color: #2563eb;
  left: 8%;
  top: 55%;
  transform: rotate(-12deg);
}

.chart-line-two {
  width: 70%;
  background-color: #16a34a;
  left: 10%;
  top: 68%;
  transform: rotate(-10deg);
}

.chart-line-three {
  width: 65%;
  background-color: #7c3aed;
  left: 12%;
  top: 78%;
  transform: rotate(-9deg);
}

.chart-axis {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.75rem;
  display: flex;
  justify-content: space-around;
  color: #6b7280;
  font-size: 0.8rem;
}

.status-donut-layout {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-top: 1.5rem;
}

.donut-chart {
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: conic-gradient(#16a34a 0 70%, #2563eb 70% 85%, #f59e0b 85% 100%);
  display: grid;
  place-items: center;
}

.donut-chart span {
  background-color: #ffffff;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  text-align: center;
  font-weight: 700;
}

.status-breakdown {
  list-style: none;
  padding: 0;
}

.status-breakdown li {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.legend-dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 999px;
  display: inline-block;
}

.resolved-dot {
  background-color: #16a34a;
}

.active-dot {
  background-color: #2563eb;
}

.pending-dot {
  background-color: #f59e0b;
}

/* ========================================
   AUTH
======================================== */

.auth-page {
  min-height: calc(100vh - 4rem);
  display: grid;
  place-items: center;
  padding: 3rem 1rem;
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background-color: #ffffff;
  border: 1px solid #dcdcdc;
  border-radius: 18px;
  padding: 2rem;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

.auth-header {
  margin-bottom: 1.5rem;
}

.auth-header h1 {
  margin: 0 0 0.5rem;
  font-size: 1.8rem;
  letter-spacing: -0.03em;
}

.auth-header p {
  margin: 0;
  color: #6b7280;
  line-height: 1.5;
}

.auth-submit {
  height: 48px;
  border: none;
  border-radius: 10px;
  background-color: #111827;
  color: #facc15;
  font-weight: 800;
  cursor: pointer;
  margin-top: 0.5rem;
}

.auth-submit:hover {
  background-color: #030712;
}

.auth-demo {
  width: 100%;
  box-sizing: border-box;
  margin-top: 0.75rem;
  background-color: transparent;
  color: #111827;
  border: 1px solid #dcdcdc;
}

.auth-demo:hover {
  background-color: #f9fafb;
}

.auth-footer {
  margin-top: 1.25rem;
  text-align: center;
}

.auth-footer a {
  color: #374151;
  font-weight: 700;
}

/* ========================================
   RESPONSIVE
======================================== */

@media (max-width: 1100px) {
  .dashboard-layout,
  .reports-visual-grid,
  .reports-bottom-grid,
  .search-layout {
    grid-template-columns: 1fr;
  }

  .dashboard-sidebar {
    order: -1;
  }

  .search-filter-sidebar {
    order: 2;
  }

  .search-results-panel {
    order: 1;
  }

  .filter-form {
    grid-template-columns: 1fr 1fr;
  }
}

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

  .dashboard-toolbar,
  .timeline-top-row,
  .section-header,
  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .dashboard-search,
  .dashboard-search input {
    width: 100%;
  }

  .dashboard-table-header,
  .projects-table-header,
  .tags-table-header {
    display: none;
  }

  .dashboard-row,
  .projects-row,
  .tags-row,
  .timeline-v2-row,
  .timeline-entry,
  .search-result-row,
  .mini-table-row,
  .reports-bottom-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .projects-filter-form,
  .tags-filter-form,
  .timeline-filter-form,
  .filter-form {
    grid-template-columns: 1fr;
  }

  .timeline-v2::before,
  .timeline-dot {
    display: none;
  }

  .timeline-v2-row {
    padding: 1rem;
  }

  .table-actions,
  .tags-table-actions {
    flex-wrap: wrap;
  }
}

@media (max-width: 700px) {
  .search-hero-form,
  .form-actions,
  .filter-actions,
  .issue-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .search-submit,
  .primary-action,
  .secondary-action,
  .danger-action {
    width: 100%;
  }

  .search-result-side {
    align-items: flex-start;
  }

  .search-tabs,
  .report-tabs {
    overflow-x: auto;
  }
}

@media (max-width: 640px) {
  main,
  .main-content {
    padding: 1.5rem;
  }

  .dashboard-stats,
  .project-grid,
  .tag-grid {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   TIMELINE OVERFLOW FIX
======================================== */

.timeline-v2-row {
  overflow: hidden;
}

.timeline-v2-row > * {
  min-width: 0;
}

/* Fix long project names spilling outside cards */
.timeline-v2-row span:last-child,
.timeline-v2-row .project-pill {
  max-width: 250px;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Prevent issue titles from pushing layout */
.timeline-v2-row .timeline-title,
.timeline-v2-row h4,
.timeline-v2-row strong {
  min-width: 0;
  overflow-wrap: break-word;
}

/* Mobile */
@media (max-width: 1100px) {
  .timeline-v2-row span:last-child,
  .timeline-v2-row .project-pill {
    max-width: 100%;
  }
}