/* ============================================================
   POOJA'S COUTURE — Reusable Component Styles
   Cards, tables, modals, forms, badges, buttons, tabs
   ============================================================ */

/* ---------- Cards ---------- */
.card {
  background: var(--pc-bg-card);
  border: 1px solid var(--pc-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-base);
  position: relative;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--pc-gradient-card);
  pointer-events: none;
  border-radius: inherit;
}

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

.card-header {
  padding: var(--sp-5) var(--sp-6);
  border-bottom: 1px solid var(--pc-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}

.card-title {
  font-family: var(--font-body);
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--pc-text-heading);
}

.card-body {
  padding: var(--sp-6);
  position: relative;
}

.card-footer {
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--pc-border);
}

/* Stat Widget Card */
.stat-card {
  background: var(--pc-bg-card);
  border: 1px solid var(--pc-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--pc-gradient-card);
  pointer-events: none;
}

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

.stat-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--sp-4);
  position: relative;
}

.stat-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xl);
  flex-shrink: 0;
}

.stat-card-icon.gold { background: var(--pc-amber-glow); color: var(--pc-gold); }
.stat-card-icon.green { background: var(--pc-success-bg); color: var(--pc-success); }
.stat-card-icon.blue { background: var(--pc-info-bg); color: var(--pc-info); }
.stat-card-icon.red { background: var(--pc-danger-bg); color: var(--pc-danger); }
.stat-card-icon.purple { background: var(--pc-purple-bg); color: var(--pc-purple); }
.stat-card-icon.amber { background: var(--pc-warning-bg); color: var(--pc-warning); }

.stat-card-trend {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.stat-card-trend.up { color: var(--pc-success); background: var(--pc-success-bg); }
.stat-card-trend.down { color: var(--pc-danger); background: var(--pc-danger-bg); }
.stat-card-trend.neutral { color: var(--pc-text-muted); background: rgba(255,255,255,0.05); }

.stat-card-value {
  font-family: var(--font-mono);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--pc-text-heading);
  line-height: 1.1;
  margin-bottom: var(--sp-1);
  position: relative;
}

.stat-card-label {
  font-size: var(--text-sm);
  color: var(--pc-text-muted);
  font-weight: 500;
  position: relative;
}

.stat-card-sparkline {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 100px;
  height: 40px;
  opacity: 0.3;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-5);
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  line-height: 1.5;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--pc-gradient-gold);
  color: var(--pc-text-inverse);
  border-color: transparent;
}

.btn-primary:hover {
  box-shadow: var(--pc-shadow-gold);
  filter: brightness(1.1);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--pc-text);
  border-color: var(--pc-border-light);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--pc-border-light);
}

.btn-ghost {
  background: transparent;
  color: var(--pc-text-muted);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--pc-text);
}

.btn-danger {
  background: rgba(248, 113, 113, 0.1);
  color: var(--pc-danger);
  border-color: rgba(248, 113, 113, 0.2);
}

.btn-danger:hover {
  background: rgba(248, 113, 113, 0.2);
}

.btn-sm {
  padding: var(--sp-1) var(--sp-3);
  font-size: var(--text-xs);
}

.btn-lg {
  padding: var(--sp-3) var(--sp-7);
  font-size: var(--text-md);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-md);
}

.btn-icon.sm {
  width: 28px;
  height: 28px;
  font-size: var(--text-sm);
}

/* ---------- Forms ---------- */
.form-group {
  margin-bottom: var(--sp-5);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--pc-text);
  margin-bottom: var(--sp-2);
}

.form-label .required {
  color: var(--pc-danger);
  margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  background: var(--pc-bg-input);
  border: 1px solid var(--pc-border);
  border-radius: var(--radius-md);
  color: var(--pc-text);
  font-size: var(--text-sm);
  transition: all var(--transition-fast);
  line-height: 1.5;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--pc-border-gold);
  box-shadow: 0 0 0 3px rgba(236, 182, 118, 0.1);
  background: var(--pc-bg-card);
}

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

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B6780' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.form-select option {
  background: var(--pc-bg-card);
  color: var(--pc-text);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--pc-text-muted);
  margin-top: var(--sp-1);
}

.form-error {
  font-size: var(--text-xs);
  color: var(--pc-danger);
  margin-top: var(--sp-1);
}

.form-input.error {
  border-color: var(--pc-danger);
}

/* ---------- Tables ---------- */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--pc-border);
  background: var(--pc-bg-card);
}

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

.data-table th {
  text-align: left;
  padding: var(--sp-3) var(--sp-5);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--pc-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--pc-border);
  white-space: nowrap;
  font-family: var(--font-body);
}

.data-table td {
  padding: var(--sp-3) var(--sp-5);
  font-size: var(--text-sm);
  color: var(--pc-text);
  border-bottom: 1px solid var(--pc-border);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

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

.table-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-full);
  white-space: nowrap;
  gap: 4px;
}

.badge-gold { background: var(--pc-amber-glow); color: var(--pc-gold); }
.badge-success { background: var(--pc-success-bg); color: var(--pc-success); }
.badge-warning { background: var(--pc-warning-bg); color: var(--pc-warning); }
.badge-danger { background: var(--pc-danger-bg); color: var(--pc-danger); }
.badge-info { background: var(--pc-info-bg); color: var(--pc-info); }
.badge-purple { background: var(--pc-purple-bg); color: var(--pc-purple); }
.badge-muted { background: rgba(255,255,255,0.05); color: var(--pc-text-muted); }

/* ---------- Modals ---------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--pc-bg-overlay);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

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

.modal {
  background: var(--pc-bg-modal);
  border: 1px solid var(--pc-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--pc-shadow-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  transform: scale(0.95) translateY(10px);
  transition: transform var(--transition-base);
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal-lg { max-width: 720px; }
.modal-xl { max-width: 900px; }

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

.modal-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--pc-text-heading);
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pc-text-muted);
  font-size: var(--text-xl);
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--pc-text);
}

.modal-body {
  padding: var(--sp-7);
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: var(--sp-4) var(--sp-7);
  border-top: 1px solid var(--pc-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-3);
  flex-shrink: 0;
}

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: var(--sp-1);
  border-bottom: 1px solid var(--pc-border);
  margin-bottom: var(--sp-6);
  overflow-x: auto;
}

.tab-btn {
  padding: var(--sp-3) var(--sp-5);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--pc-text-muted);
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
  white-space: nowrap;
  cursor: pointer;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: var(--font-body);
}

.tab-btn:hover {
  color: var(--pc-text);
}

.tab-btn.active {
  color: var(--pc-gold);
  border-bottom-color: var(--pc-gold);
}

.tab-content {
  display: none;
  animation: fadeIn var(--transition-base) ease-out;
}

.tab-content.active {
  display: block;
}

/* ---------- Avatar ---------- */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--pc-text-inverse);
  flex-shrink: 0;
  position: relative;
}

.avatar-sm { width: 32px; height: 32px; font-size: var(--text-xs); }
.avatar-lg { width: 56px; height: 56px; font-size: var(--text-lg); }
.avatar-xl { width: 80px; height: 80px; font-size: var(--text-2xl); }

.avatar-status {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--pc-bg-card);
}

.avatar-status.online { background: var(--pc-success); }
.avatar-status.offline { background: var(--pc-text-muted); }
.avatar-status.away { background: var(--pc-warning); }

/* ---------- User Cell (Table) ---------- */
.user-cell {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.user-cell-info {
  min-width: 0;
}

.user-cell-name {
  font-weight: 500;
  color: var(--pc-text-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-cell-detail {
  font-size: var(--text-xs);
  color: var(--pc-text-muted);
}

/* ---------- Empty State ---------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-10) var(--sp-6);
  text-align: center;
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: var(--sp-5);
  opacity: 0.3;
}

.empty-state-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--pc-text-heading);
  margin-bottom: var(--sp-2);
  font-family: var(--font-body);
}

.empty-state-text {
  font-size: var(--text-sm);
  color: var(--pc-text-muted);
  max-width: 360px;
  margin-bottom: var(--sp-6);
}

/* ---------- Progress Bar ---------- */
.progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--pc-gradient-gold);
  transition: width var(--transition-slow);
}

.progress-bar-fill.green { background: var(--pc-success); }
.progress-bar-fill.blue { background: var(--pc-info); }
.progress-bar-fill.red { background: var(--pc-danger); }

/* ---------- List Items ---------- */
.list-item {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4);
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
  cursor: pointer;
}

.list-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.list-item + .list-item {
  border-top: 1px solid var(--pc-border);
}

.list-item-content {
  flex: 1;
  min-width: 0;
}

.list-item-title {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--pc-text);
}

.list-item-subtitle {
  font-size: var(--text-xs);
  color: var(--pc-text-muted);
  margin-top: 2px;
}

/* ---------- Kanban Board ---------- */
.kanban-board {
  display: flex;
  gap: var(--sp-4);
  overflow-x: auto;
  padding-bottom: var(--sp-4);
}

.kanban-column {
  min-width: 280px;
  max-width: 320px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--pc-border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
}

.kanban-column-header {
  padding: var(--sp-4);
  border-bottom: 1px solid var(--pc-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kanban-column-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--pc-text);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.kanban-column-count {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  font-size: var(--text-xs);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pc-text-muted);
}

.kanban-cards {
  padding: var(--sp-3);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  min-height: 100px;
  overflow-y: auto;
  max-height: 500px;
}

.kanban-card {
  background: var(--pc-bg-card);
  border: 1px solid var(--pc-border);
  border-radius: var(--radius-md);
  padding: var(--sp-4);
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

.kanban-card-title {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--pc-text);
  margin-bottom: var(--sp-2);
}

.kanban-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-xs);
  color: var(--pc-text-muted);
}

/* ---------- Timeline ---------- */
.timeline {
  position: relative;
  padding-left: var(--sp-8);
}

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

.timeline-item {
  position: relative;
  padding-bottom: var(--sp-7);
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -25px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--pc-gold);
  border: 3px solid var(--pc-bg-body);
  z-index: 1;
}

.timeline-dot.completed { background: var(--pc-success); }
.timeline-dot.pending { background: var(--pc-text-muted); }
.timeline-dot.active { background: var(--pc-gold); animation: pulse-glow 2s infinite; }

.timeline-content {
  background: var(--pc-bg-card);
  border: 1px solid var(--pc-border);
  border-radius: var(--radius-md);
  padding: var(--sp-4);
}

.timeline-date {
  font-size: var(--text-xs);
  color: var(--pc-text-muted);
  margin-bottom: var(--sp-1);
}

.timeline-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--pc-text);
}

.timeline-description {
  font-size: var(--text-xs);
  color: var(--pc-text-muted);
  margin-top: var(--sp-1);
}

/* ---------- Filter Bar ---------- */
.filter-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
  flex-wrap: wrap;
}

.filter-bar .form-input,
.filter-bar .form-select {
  max-width: 200px;
}

.filter-search {
  position: relative;
  flex: 1;
  max-width: 300px;
}

.filter-search input {
  width: 100%;
  padding-left: 36px;
}

.filter-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--pc-text-muted);
  font-size: var(--text-sm);
  pointer-events: none;
}

/* ---------- Chart Container ---------- */
.chart-container {
  position: relative;
  width: 100%;
  height: 250px;
}

.chart-container canvas {
  width: 100% !important;
  height: 100% !important;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  margin-top: var(--sp-4);
}

.chart-legend-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-xs);
  color: var(--pc-text-muted);
}

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

/* ---------- Invoice Print View ---------- */
.invoice-preview {
  background: #fff;
  color: #111;
  border-radius: var(--radius-lg);
  padding: var(--sp-9);
  max-width: 800px;
  margin: 0 auto;
}

.invoice-preview h1,
.invoice-preview h2,
.invoice-preview h3 {
  color: #111;
}

.invoice-preview table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--sp-6) 0;
}

.invoice-preview th {
  text-align: left;
  padding: var(--sp-3);
  border-bottom: 2px solid #ECB676;
  font-size: var(--text-sm);
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.invoice-preview td {
  padding: var(--sp-3);
  border-bottom: 1px solid #eee;
  font-size: var(--text-sm);
}

/* ---------- Confirmation Dialog ---------- */
.confirm-dialog {
  text-align: center;
  padding: var(--sp-6) 0;
}

.confirm-dialog-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  margin: 0 auto var(--sp-5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-2xl);
  background: var(--pc-danger-bg);
  color: var(--pc-danger);
}

.confirm-dialog-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--pc-text-heading);
  margin-bottom: var(--sp-2);
  font-family: var(--font-body);
}

.confirm-dialog-text {
  font-size: var(--text-sm);
  color: var(--pc-text-muted);
}

/* ---------- Skeleton Loading ---------- */
.skeleton {
  background: linear-gradient(90deg,
    rgba(255,255,255,0.03) 25%,
    rgba(255,255,255,0.06) 37%,
    rgba(255,255,255,0.03) 63%
  );
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--radius-sm);
}

.skeleton-text {
  height: 14px;
  margin-bottom: var(--sp-2);
}

.skeleton-heading {
  height: 24px;
  width: 60%;
  margin-bottom: var(--sp-3);
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
}

/* ---------- Authentication Overlay & Cards ---------- */
.auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--pc-bg-dark);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6);
  transition: all 0.3s ease;
}

.auth-overlay:not(.active) {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--pc-bg-card);
  border: 1px solid var(--pc-border-gold);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  box-shadow: var(--pc-shadow-xl);
}

.brand-header {
  text-align: center;
  margin-bottom: var(--sp-6);
}

.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--pc-gradient-gold);
  color: var(--pc-text-inverse);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--sp-3) auto;
  box-shadow: var(--pc-shadow-gold);
}
