/* ==========================================
   1. GLOBAL MODAL (Kerangka Umum)
   ========================================== */
.mdl-backdrop {
    position: fixed;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none; /* Default tersembunyi */
    justify-content: center;
    align-items: center;
    z-index: 1050;
    backdrop-filter: blur(2px);
}

/* Kelas untuk memunculkan modal */
.mdl-backdrop.show {
    display: flex;
}

.mdl-dialog {
    background: #ffffff;
    border-radius: 20px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    animation: mdlFadeIn 0.25s ease-out;
}

.mdl-header {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--primary-500, #267cee);
    
}

.mdl-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #ffffff;
}

.mdl-close-btn {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: #ffffff;
    cursor: pointer;
    line-height: 1;
    transition: transform 0.2s;
}

.mdl-close-btn:hover {
    color: #b70000;
    transform: scale(1.1);
}

.mdl-body {
    padding: 1.5rem;
}

.mdl-footer {
    padding: 1rem 1.5rem;
    background-color: #f9fafb;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    border-top: 1px solid #e5e7eb;
}


/* ==========================================
   2. MODAL SPESIFIK: BARANG (barang-mdl-...)
   ========================================== */
.barang-mdl-header {
    background: var(--primary-500, #267cee);
    border-bottom: 1px solid #e5e7eb;
    
}

.barang-mdl-form-group {
    margin-bottom: 1.25rem;
}

.barang-mdl-form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.barang-mdl-input,
.barang-mdl-select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.95rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: #fff;
    box-sizing: border-box;
}

.barang-mdl-input:focus,
.barang-mdl-select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Animasi halus saat modal muncul */
@keyframes mdlFadeIn {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   3. GLOBAL ALERT MODAL
   ========================================== */

.alert-mdl-backdrop {
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    padding: 1rem;
}

.alert-mdl-dialog {
    max-width: 420px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow:
        0 20px 50px rgba(15, 23, 42, 0.18),
        0 4px 12px rgba(15, 23, 42, 0.08);
    animation: alertModalIn 0.22s ease-out;
}

.alert-mdl-content {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem 1.5rem 1.25rem;
}

.alert-mdl-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.alert-mdl-icon svg {
    width: 22px;
    height: 22px;
    stroke-width: 2;
}

.alert-mdl-text {
    flex: 1;
}

.alert-mdl-title {
    margin: 0 0 0.35rem;
    font-size: 1rem;
    font-weight: 650;
    color: #111827;
}

.alert-mdl-message {
    margin: 0;
    font-size: 0.925rem;
    line-height: 1.6;
    color: #6b7280;
}

/* SUCCESS */
.alert-success .alert-mdl-icon {
    background: #ecfdf5;
    color: #059669;
}

/* ERROR */
.alert-error .alert-mdl-icon {
    background: #fef2f2;
    color: #dc2626;
}

/* WARNING */
.alert-warning .alert-mdl-icon {
    background: #fffbeb;
    color: #d97706;
}

/* INFO */
.alert-info .alert-mdl-icon {
    background: #eff6ff;
    color: #2563eb;
}

/* Footer */
.alert-mdl-footer {
    background: #ffffff;
    border-top: 1px solid #eef0f3;
    padding: 0.85rem 1.5rem;
}

.alert-mdl-ok {
    min-width: 80px;
}

/* Animation */
@keyframes alertModalIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Mobile */
@media (max-width: 480px) {
    .alert-mdl-dialog {
        max-width: 100%;
    }

    .alert-mdl-content {
        padding: 1.25rem;
    }

    .alert-mdl-footer {
        padding: 0.75rem 1.25rem;
    }

    .alert-mdl-ok {
        width: 100%;
    }
}

/* ==========================================
   4. GLOBAL CONFIRM MODAL
   ========================================== */

.confirm-mdl-backdrop {
    backdrop-filter: blur(4px);
}

.confirm-mdl-dialog {
    max-width: 440px;
}

.confirm-mdl-content {
    padding: 1.75rem 1.75rem 0.5rem;
    text-align: center;
}

.confirm-mdl-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.confirm-mdl-icon svg {
    width: 26px;
    height: 26px;
}

.confirm-danger .confirm-mdl-icon {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
}

.confirm-warning .confirm-mdl-icon {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.confirm-info .confirm-mdl-icon {
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
}

.confirm-mdl-title {
    margin: 0 0 0.5rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: #1f2937;
}

.confirm-mdl-message {
    margin: 0;
    color: #6b7280;
    font-size: 0.95rem;
    line-height: 1.6;
}

.confirm-mdl-footer {
    margin-top: 1.5rem;
    justify-content: center;
    background: transparent;
    border-top: none;
    padding: 1rem 1.75rem 1.75rem;
}

.confirm-mdl-footer button {
    min-width: 110px;
}

.btn-danger {
    background: #dc2626;
    color: #ffffff;
    border: 1px solid #dc2626;
}

.btn-danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
}

/* ==========================================
   MODAL SPESIFIK: PRODUKSI
   (produksi-mdl-...)
   ========================================== */

.produksi-mdl-header {
    background: var(--primary-500, #267cee);
    border-bottom: 1px solid #e5e7eb;
    color: #ffffff;
}

.produksi-mdl-form-group {
    margin-bottom: 1.25rem;
}

.produksi-mdl-form-group:last-child {
    margin-bottom: 0;
}

.produksi-mdl-form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.produksi-mdl-input,
.produksi-mdl-select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.95rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: #ffffff;
    box-sizing: border-box;
}

.produksi-mdl-input:focus,
.produksi-mdl-select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.produksi-mdl-input::placeholder {
    color: #9ca3af;
}

.produksi-mdl-input:disabled,
.produksi-mdl-select:disabled {
    background-color: #f3f4f6;
    cursor: not-allowed;
    color: #6b7280;
}

/* Responsive */
@media (max-width: 480px) {
    .produksi-mdl-input,
    .produksi-mdl-select {
        font-size: 0.9rem;
    }
}


/* ==========================================
   DETAIL PRODUKSI
   ========================================== */

.detail-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
}

.detail-item {
  display: grid;
  grid-template-columns: 150px 18px 1fr;
  align-items: center;
  min-height: 48px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.detail-item:last-child {
  border-bottom: none;
}

.detail-label {
  color: var(--text-muted, #6b7280);
  font-size: 0.9rem;
  font-weight: 500;
}

.detail-label::after {
  content: ":";
  float: right;
  margin-right: 8px;
  color: var(--text-muted, #9ca3af);
}

.detail-item strong,
.detail-item > span:last-child {
  grid-column: 3;
  color: var(--text-primary, #111827);
  font-size: 0.95rem;
  font-weight: 600;
}

/* ==========================================
   STATUS
   ========================================== */

#detailStatusProduksi {
  display: inline-flex;
  width: fit-content;
  padding: 5px 10px;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 600px) {

  .detail-item {
    grid-template-columns: 120px 18px 1fr;
    min-height: 44px;
    padding: 8px 0;
  }

  .detail-label {
    font-size: 0.82rem;
  }

  .detail-item strong,
  .detail-item > span:last-child {
    font-size: 0.88rem;
  }

}
