/* ==========================================================================
   BDIS - Manajemen Aset Tiang TM Stylesheet
   Dark Industrial Technology Theme with Violet/Purple Accent (#a855f7)
   ========================================================================== */

.tiang-page-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 20px 80px 20px;
}

/* Header Banner */
.tiang-header-card {
  background: linear-gradient(135deg, rgba(17, 24, 39, 0.95), rgba(30, 27, 75, 0.9));
  border: 1px solid var(--border-subtle);
  border-left: 4px solid #a855f7;
  border-radius: var(--radius-md);
  padding: 22px 28px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
}

.tiang-header-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 250px;
  height: 100%;
  background: radial-gradient(circle at top right, rgba(168, 85, 247, 0.18), transparent 70%);
  pointer-events: none;
}

.tiang-title-group h2 {
  font-family: var(--font-heading);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.tiang-title-group p {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin: 0;
}

.tiang-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 2;
}

.tiang-role-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #c084fc;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  font-weight: 600;
}

/* Upload Action Button */
.btn-tiang-upload {
  background: linear-gradient(135deg, #9333ea, #7c3aed);
  color: #ffffff;
  border: 1px solid rgba(192, 132, 252, 0.5);
  box-shadow: 0 4px 14px rgba(147, 51, 234, 0.35);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 8px 18px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-tiang-upload:hover {
  background: linear-gradient(135deg, #a855f7, #9333ea);
  box-shadow: 0 6px 20px rgba(168, 85, 247, 0.5);
  transform: translateY(-1px);
}

/* KPI Summary Grid */
.tiang-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.tiang-kpi-card {
  background: rgba(14, 28, 49, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}

.tiang-kpi-card:hover {
  border-color: rgba(168, 85, 247, 0.4);
  transform: translateY(-2px);
}

.tiang-kpi-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.tiang-kpi-val {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.tiang-kpi-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Toolbar & Filters */
.tiang-toolbar {
  background: rgba(14, 28, 49, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

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

.tiang-input-search {
  padding: 7px 12px 7px 34px;
  background: rgba(7, 17, 31, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: #fff;
  font-size: 0.82rem;
  min-width: 260px;
  outline: none;
  transition: border-color 0.2s;
}

.tiang-input-search:focus {
  border-color: #a855f7;
}

.tiang-select {
  padding: 7px 12px;
  background: rgba(7, 17, 31, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: #fff;
  font-size: 0.82rem;
  outline: none;
  cursor: pointer;
}

.tiang-select:focus {
  border-color: #a855f7;
}

/* Table Container */
.tiang-table-wrapper {
  background: rgba(14, 28, 49, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

.tiang-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  text-align: left;
}

.tiang-table th {
  background: rgba(7, 17, 31, 0.85);
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.tiang-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  vertical-align: middle;
}

.tiang-table tbody tr:hover {
  background: rgba(168, 85, 247, 0.05);
}

/* Badges */
.badge-condition-belum {
  background: rgba(148, 163, 184, 0.15);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #cbd5e1;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  display: inline-block;
  white-space: nowrap;
}

.badge-condition-normal {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #4ade80;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  display: inline-block;
  white-space: nowrap;
}

.badge-condition-perhatian {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  display: inline-block;
  white-space: nowrap;
}

/* Modal Windows */
.tiang-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.tiang-modal.open {
  display: flex;
}

.tiang-modal-content {
  background: linear-gradient(135deg, #0c182b, #0f172a);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  padding: 28px 32px;
}

.tiang-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 14px;
}

.tiang-modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.tiang-modal-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.3rem;
  cursor: pointer;
  transition: color 0.2s;
}

.tiang-modal-close:hover {
  color: #fff;
}

/* Dropzone */
.tiang-dropzone {
  border: 2px dashed rgba(168, 85, 247, 0.4);
  border-radius: var(--radius-md);
  padding: 28px 20px;
  text-align: center;
  background: rgba(168, 85, 247, 0.04);
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 18px;
}

.tiang-dropzone:hover,
.tiang-dropzone.dragover {
  border-color: #c084fc;
  background: rgba(168, 85, 247, 0.08);
}

.tiang-dropzone-icon {
  font-size: 2.2rem;
  margin-bottom: 8px;
  color: #c084fc;
}

/* Summary Grid in Result Modal */
.tiang-result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 18px 0;
}

.tiang-result-box {
  background: rgba(7, 17, 31, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 12px;
  text-align: center;
}

.tiang-result-box .num {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--font-heading);
}

.tiang-result-box .lbl {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
}

/* Leaflet Tiang TM Marker Icon */
.tiang-map-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: #9333ea;
  border: 2px solid #ffffff;
  border-radius: 50%;
  color: #ffffff;
  font-size: 12px;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.8);
  cursor: pointer;
  transition: transform 0.2s;
}

.tiang-map-marker:hover {
  transform: scale(1.3);
  box-shadow: 0 0 16px rgba(168, 85, 247, 1);
}
