/* assets/css/components.css - 360° Modals, Theme Customizer, Calendar & Error Dialogs */

/* =========================================================================
   INVOICE 360° VIEW MODAL (EXACT 50.5% VIDEO FRAME SPECIFICATION)
   ========================================================================= */
.modal-360-container {
  width: 95%;
  max-width: 1200px;
  height: 90vh;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.modal-360-header {
  padding: 16px 24px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-360-title-area {
  display: flex;
  align-items: center;
  gap: 12px;
}
.modal-360-code {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: 0.5px;
}
.modal-360-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}
.modal-360-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-360-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* 360 Left Column: 35% Summary */
.modal-360-left-col {
  width: 35%;
  background: var(--bg-card-subtle);
  border-right: 1px solid var(--border-color);
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 5 Metric Cards */
.summary-5cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.summary-5cards-grid .metric-tile-card:first-child {
  grid-column: span 2;
}
.metric-tile-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}
.metric-tile-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.metric-tile-val {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
}
.metric-tile-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Key-Value Details List */
.details-kv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.details-kv-table td {
  padding: 6px 0;
  border-bottom: 1px solid var(--border-color);
}
.details-kv-table td:first-child {
  color: var(--text-muted);
  font-weight: 500;
  width: 45%;
}
.details-kv-table td:last-child {
  color: var(--text-main);
  font-weight: 600;
  text-align: right;
}

/* 360 Right Column: 65% Multi-Tab Audit Panel */
.modal-360-right-col {
  width: 65%;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  overflow: hidden;
}

.modal-360-tabs-bar {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 0 16px;
  overflow-x: auto;
  gap: 4px;
}
.tab-360-btn {
  padding: 14px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.tab-360-btn:hover {
  color: var(--text-main);
}
.tab-360-btn.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

.modal-360-tab-content-area {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}
.tab-pane {
  display: none;
}
.tab-pane.active {
  display: block;
}

/* Timeline Audit Items */
.audit-timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  padding-left: 24px;
}
.audit-timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--border-color);
}
.timeline-item {
  position: relative;
}
.timeline-dot {
  position: absolute;
  left: -24px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary-color);
  border: 3px solid var(--bg-card);
  box-shadow: 0 0 0 2px var(--primary-border);
}
.timeline-content-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
}
.timeline-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}
.timeline-time {
  font-size: 11px;
  color: var(--text-muted);
}

/* =========================================================================
   LIVE THEME CUSTOMIZER POPOVER
   ========================================================================= */
.theme-customizer-popover {
  display: none;
  position: fixed;
  top: 70px;
  right: 24px;
  width: 320px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  z-index: 1050;
  padding: 18px 20px;
  animation: fadeIn 0.2s ease forwards;
}
.theme-customizer-popover.active {
  display: block;
}

.theme-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
  margin-bottom: 14px;
}
.theme-popover-title {
  font-size: 14px;
  font-weight: 700;
}
.theme-opt-group {
  margin-bottom: 14px;
}
.theme-opt-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: block;
}
.theme-btn-toggle-group {
  display: flex;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 2px;
  gap: 2px;
}
.theme-toggle-btn {
  flex: 1;
  padding: 5px 8px;
  border: none;
  background: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}
.theme-toggle-btn.active {
  background: var(--bg-card);
  color: var(--primary-color);
  box-shadow: var(--shadow-sm);
}

/* 18 Primary Color Swatches */
.swatches-grid-18 {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}
.swatch-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}
.swatch-btn:hover {
  transform: scale(1.15);
}
.swatch-btn.active {
  border-color: #ffffff;
  box-shadow: 0 0 0 2px #0f172a;
}

/* =========================================================================
   MANDATORY VALIDATION ERROR MODAL
   ========================================================================= */
.error-modal-card {
  width: 100%;
  max-width: 460px;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 60px -15px rgba(239, 68, 68, 0.4);
  overflow: hidden;
  border: 1px solid #fecaca;
  text-align: center;
  padding: 28px 24px;
}
.error-icon-circle {
  width: 64px;
  height: 64px;
  background: #fee2e2;
  color: #dc2626;
  font-size: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.error-modal-title {
  font-size: 18px;
  font-weight: 800;
  color: #991b1b;
  margin-bottom: 8px;
}
.error-modal-message {
  font-size: 14px;
  color: var(--text-main);
  line-height: 1.5;
  margin-bottom: 20px;
}

/* =========================================================================
   CALENDAR RESOURCE DAY VIEW & ATTENDANCE MATRIX
   ========================================================================= */
.calendar-resource-grid {
  display: grid;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
}
.resource-stylist-header {
  padding: 12px;
  text-align: center;
  font-weight: 700;
  font-size: 13px;
  border-bottom: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  background: var(--bg-card-subtle);
}
.resource-time-slot {
  height: 48px;
  border-bottom: 1px dashed var(--border-color);
  border-right: 1px solid var(--border-color);
  position: relative;
  padding: 2px 4px;
}
.resource-apt-pill {
  position: absolute;
  inset: 2px;
  background: var(--primary-light);
  border-left: 3px solid var(--primary-color);
  border-radius: var(--radius-sm);
  padding: 4px 6px;
  font-size: 11px;
  font-weight: 600;
  overflow: hidden;
  cursor: pointer;
}
.resource-break-block {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    45deg,
    rgba(148, 163, 184, 0.15),
    rgba(148, 163, 184, 0.15) 8px,
    rgba(148, 163, 184, 0.25) 8px,
    rgba(148, 163, 184, 0.25) 16px
  );
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Attendance 31-Day Matrix */
.matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
  text-align: center;
}
.matrix-table th, .matrix-table td {
  padding: 6px 4px;
  border: 1px solid var(--border-color);
}
.matrix-pill-p { background: #dcfce7; color: #166534; font-weight: 700; border-radius: 3px; }
.matrix-pill-a { background: #fee2e2; color: #991b1b; font-weight: 700; border-radius: 3px; }
.matrix-pill-l { background: #fef3c7; color: #92400e; font-weight: 700; border-radius: 3px; }
.matrix-pill-h { background: #ffedd5; color: #c2410c; font-weight: 700; border-radius: 3px; }
.matrix-pill-w { background: #f1f5f9; color: #64748b; font-weight: 600; border-radius: 3px; }
