/* ============================================================
   LandAxis Hub v2 — Components
   ============================================================ */

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 15px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  border: 1px solid transparent;
  letter-spacing: 0.01em;
}

.btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.btn-primary {
  background: linear-gradient(145deg, #F08040 0%, #C85010 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 1px 6px rgba(200,80,16,0.35), inset 0 1px 0 rgba(255,255,255,0.12);
}

.btn-primary:hover {
  background: linear-gradient(145deg, #FF8848 0%, #D86018 100%);
  box-shadow: 0 2px 12px rgba(200,80,16,0.45), inset 0 1px 0 rgba(255,255,255,0.15);
  transform: translateY(-0.5px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(200,80,16,0.3);
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text-primary);
  border-color: var(--border-md);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
  background: var(--surface-3);
  border-color: var(--border-lg);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--surface-1);
  color: var(--text-primary);
  border-color: var(--border-md);
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ============================================================
   Badges
   ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-xl);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-green  { background: rgba(34, 196, 122, 0.14); color: #3CD48A; }
.badge-green .badge-dot  { background: #3CD48A; }

.badge-amber  { background: rgba(240, 160, 48,  0.14); color: #F0A030; }
.badge-amber .badge-dot  { background: #F0A030; }

.badge-blue   { background: rgba(58, 154, 217, 0.14); color: #5AB2E8; }
.badge-blue .badge-dot   { background: #5AB2E8; }

.badge-teal   { background: rgba(15, 170, 170, 0.14); color: #20BABA; }
.badge-teal .badge-dot   { background: #20BABA; }

.badge-red    { background: rgba(224, 82,  82,  0.14); color: #E87070; }
.badge-red .badge-dot    { background: #E87070; }

.badge-accent { background: rgba(224, 112, 32, 0.14); color: var(--accent); }
.badge-accent .badge-dot { background: var(--accent); }

.badge-purple { background: rgba(139, 111, 212, 0.14); color: #A48AE0; }
.badge-purple .badge-dot { background: #A48AE0; }

.badge-muted  { background: var(--surface-2); color: var(--text-secondary); }

/* ============================================================
   Cards
   ============================================================ */

.card {
  background: var(--surface-0);
  border: 1px solid var(--border-md);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.card-sm { padding: 14px 16px; }
.card-flush { padding: 0; }

/* ============================================================
   KPI Cards
   ============================================================ */

.kpi-card {
  background: var(--surface-0);
  border: 1px solid var(--border-md);
  border-radius: var(--radius-lg);
  padding: 18px 20px 16px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.kpi-card:hover {
  border-color: var(--border-lg);
  box-shadow: var(--shadow-md);
}

/* Colored top strip */
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* Subtle inner glow at top */
.kpi-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  pointer-events: none;
}

.kpi-card.kpi-green::before  { background: var(--green); }
.kpi-card.kpi-green::after   { background: linear-gradient(180deg, rgba(34,196,122,0.06) 0%, transparent 100%); }

.kpi-card.kpi-amber::before  { background: var(--amber); }
.kpi-card.kpi-amber::after   { background: linear-gradient(180deg, rgba(240,160,48,0.07) 0%, transparent 100%); }

.kpi-card.kpi-orange::before { background: var(--accent); }
.kpi-card.kpi-orange::after  { background: linear-gradient(180deg, rgba(224,112,32,0.07) 0%, transparent 100%); }

.kpi-card.kpi-blue::before   { background: var(--blue); }
.kpi-card.kpi-blue::after    { background: linear-gradient(180deg, rgba(58,154,217,0.07) 0%, transparent 100%); }

.kpi-card.kpi-teal::before   { background: var(--teal); }
.kpi-card.kpi-teal::after    { background: linear-gradient(180deg, rgba(15,168,168,0.07) 0%, transparent 100%); }

.kpi-label {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}

.kpi-value {
  font-family: var(--font-tight);
  font-size: 30px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.05;
  margin-bottom: 7px;
  letter-spacing: -0.02em;
  font-feature-settings: "tnum" 1;
  position: relative;
  z-index: 1;
}

.kpi-meta {
  font-size: 11.5px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
  z-index: 1;
}

.kpi-meta .up   { color: var(--green); font-weight: 600; }
.kpi-meta .down { color: var(--red);   font-weight: 600; }

/* Icon slot in top-right */
.kpi-icon {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.55;
  z-index: 1;
}

.kpi-icon svg {
  width: 15px;
  height: 15px;
}

.kpi-green  .kpi-icon { background: rgba(34,196,122,0.15);  color: var(--green); }
.kpi-amber  .kpi-icon { background: rgba(240,160,48,0.15);  color: var(--amber); }
.kpi-orange .kpi-icon { background: rgba(224,112,32,0.15);  color: var(--accent); }
.kpi-blue   .kpi-icon { background: rgba(58,154,217,0.15);  color: var(--blue); }
.kpi-teal   .kpi-icon { background: rgba(15,168,168,0.15);  color: var(--teal); }

/* Operational KPI row — smaller */
#dashboard-ops-kpis .kpi-card .kpi-value {
  font-size: 22px;
}

/* ============================================================
   Form Inputs
   ============================================================ */

.input {
  width: 100%;
  padding: 7px 11px;
  background: var(--surface-1);
  border: 1px solid var(--border-md);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-sans);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  box-sizing: border-box;
}

.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(224, 112, 32, 0.12);
  background: var(--surface-0);
}

.input:disabled,
.input[readonly] {
  background: var(--surface-0);
  color: var(--text-secondary);
  cursor: default;
  opacity: 0.7;
}

.input::placeholder { color: var(--text-muted); }

select.input { cursor: pointer; }
textarea.input { resize: vertical; line-height: 1.5; }

.field-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 5px;
}

/* ============================================================
   Modals
   ============================================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal {
  background: var(--surface-0);
  border: 1px solid var(--border-md);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-tight);
  letter-spacing: -0.01em;
}

.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.modal-close:hover {
  background: var(--surface-2);
  color: var(--text-primary);
}

.modal-close svg { width: 15px; height: 15px; }

.modal-body {
  padding: 22px;
  flex: 1;
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* ============================================================
   Tables
   ============================================================ */

.table-wrap {
  overflow-x: auto;
}

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

.table th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0 14px 10px;
  white-space: nowrap;
  border-bottom: 1px solid var(--border-md);
}

.table th:first-child { padding-left: 0; }

.table td {
  padding: 13px 14px;
  font-size: 13px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.table td:first-child { padding-left: 0; }

.table tbody tr:last-child td {
  border-bottom: none;
}

.table tbody tr {
  transition: background var(--transition);
  position: relative;
}

.table tbody tr:hover td {
  background: rgba(255,255,255,0.025);
}

.table tbody tr:hover td:first-child {
  box-shadow: inset 2px 0 0 var(--accent);
}

.table .td-muted {
  color: var(--text-secondary);
}

/* ============================================================
   Progress Bars
   ============================================================ */

.progress {
  height: 4px;
  background: var(--surface-3);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.55s ease;
}

.progress-green  { background: var(--green); }
.progress-amber  { background: var(--amber); }
.progress-blue   { background: var(--blue); }
.progress-accent { background: var(--accent); }
.progress-teal   { background: var(--teal); }

/* ============================================================
   Section Headers
   ============================================================ */

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-title {
  font-family: var(--font-tight);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

/* ============================================================
   Activity Feed
   ============================================================ */

.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.activity-item {
  display: flex;
  gap: 11px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}

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

.activity-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}

.activity-body {
  flex: 1;
  min-width: 0;
}

.activity-text {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.activity-text strong {
  font-weight: 600;
  color: var(--text-primary);
}

.activity-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ============================================================
   Search / Filter Bar
   ============================================================ */

.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 320px;
}

.search-input-wrap svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 13px;
  height: 13px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  background: var(--surface-1);
  border: 1px solid var(--border-md);
  border-radius: var(--radius-sm);
  padding: 7px 12px 7px 32px;
  color: var(--text-primary);
  font-size: 13px;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(224,112,32,0.1);
  background: var(--surface-0);
}

.select-filter {
  background: var(--surface-1);
  border: 1px solid var(--border-md);
  border-radius: var(--radius-sm);
  padding: 7px 28px 7px 11px;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%233C5570' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: border-color var(--transition);
}

.select-filter:focus {
  border-color: var(--accent);
  color: var(--text-primary);
}

/* ============================================================
   Project Cards (Projects page)
   ============================================================ */

.project-card {
  background: var(--surface-0);
  border: 1px solid var(--border-md);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: border-color var(--transition), transform var(--transition-md), box-shadow var(--transition-md);
  box-shadow: var(--shadow-sm);
}

.project-card:hover {
  border-color: var(--border-lg);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.project-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.project-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.project-icon svg {
  width: 17px;
  height: 17px;
}

.project-card-title {
  font-family: var(--font-tight);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
  margin-top: 10px;
  letter-spacing: -0.01em;
}

.project-card-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.project-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.project-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.project-stat-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 3px;
}

.project-stat-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  font-feature-settings: "tnum" 1;
}

/* ============================================================
   Kanban Board
   ============================================================ */

.kanban-board {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.kanban-col {
  flex: 0 0 244px;
  background: var(--surface-0);
  border: 1px solid var(--border-md);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 180px);
  box-shadow: var(--shadow-sm);
}

.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 14px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.kanban-col-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.kanban-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.kanban-count {
  background: var(--surface-2);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 20px;
}

.kanban-cards {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.kanban-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: grab;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.kanban-card:hover {
  border-color: var(--border-md);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.kanban-card-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.kanban-card-meta {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.kanban-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

/* ============================================================
   Analytics Charts
   ============================================================ */

.chart-container {
  width: 100%;
  position: relative;
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 160px;
  padding: 0 4px;
}

.bar-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
}

.bar {
  width: 100%;
  border-radius: var(--radius-xs) var(--radius-xs) 0 0;
  background: var(--accent);
  min-width: 24px;
  transition: opacity var(--transition), transform var(--transition);
  position: relative;
}

.bar:hover {
  opacity: 0.75;
}

.bar-label {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.bar-value {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Donut chart */
.donut-wrap {
  display: flex;
  align-items: center;
  gap: 24px;
}

.donut-chart-svg {
  flex-shrink: 0;
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.donut-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
}

.donut-legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.donut-legend-label {
  color: var(--text-secondary);
  flex: 1;
}

.donut-legend-pct {
  font-weight: 600;
  color: var(--text-primary);
  font-feature-settings: "tnum" 1;
}

/* ============================================================
   Empty State
   ============================================================ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  text-align: center;
  color: var(--text-muted);
}

.empty-state svg {
  width: 36px;
  height: 36px;
  margin-bottom: 14px;
  opacity: 0.3;
}

.empty-state p {
  font-size: 13px;
  color: var(--text-muted);
}

/* ============================================================
   Divider
   ============================================================ */

.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

/* ============================================================
   Chip Filters
   ============================================================ */

.chip-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip {
  padding: 4px 12px;
  border-radius: var(--radius-xl);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  background: transparent;
  transition: all var(--transition);
  white-space: nowrap;
}

.chip:hover {
  color: var(--text-primary);
  border-color: var(--border-md);
  background: var(--surface-1);
}

.chip.active {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: rgba(224, 112, 32, 0.28);
  font-weight: 600;
}

/* ============================================================
   Panel Tabs (slide-in panels)
   ============================================================ */

.tr-tab {
  flex: 1;
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
  letter-spacing: 0.02em;
}

.tr-tab:hover { color: var(--text-primary); }

.tr-tab.tr-tab-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ============================================================
   Quick Launch Grid (Dashboard)
   ============================================================ */

.quick-launch-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 10px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  position: relative;
  text-align: center;
  line-height: 1.3;
}

.quick-launch-btn svg {
  width: 20px;
  height: 20px;
  color: var(--accent);
  flex-shrink: 0;
  opacity: 0.9;
}

.quick-launch-btn:hover {
  background: var(--surface-2);
  color: var(--text-primary);
  border-color: var(--border-md);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.quick-launch-btn:hover svg {
  opacity: 1;
}

.quick-launch-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 1px 4px rgba(224,112,32,0.4);
}
